~jeremyrcohen/+junk/FabStudio

« back to all changes in this revision

Viewing changes to pather/pathslice.cpp

  • Committer: Jeremy Cohen
  • Date: 2010-07-12 17:40:34 UTC
  • Revision ID: jeremyrcohen@gmail.com-20100712174034-exjymn1tf0jobt6u
test

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*---------------------------------------------------------------------------*\
 
2
 This file is part of the Fab@Home Project.
 
3
 Fab@Home operates under the BSD Open Source License.
 
4
 
 
5
 Copyright (c) 2009, Karl Gluck (kwg8@cornell.edu)
 
6
 
 
7
 All rights reserved.
 
8
 
 
9
 Redistribution and use in source and binary forms, with or without
 
10
 modification, are permitted provided that the following conditions are met:
 
11
     * Redistributions of source code must retain the above copyright
 
12
       notice, this list of conditions and the following disclaimer.
 
13
     * Redistributions in binary form must reproduce the above copyright
 
14
       notice, this list of conditions and the following disclaimer in the
 
15
       documentation and/or other materials provided with the distribution.
 
16
     * Neither the name of the <organization> nor the
 
17
       names of its contributors may be used to endorse or promote products
 
18
       derived from this software without specific prior written permission.
 
19
 
 
20
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 
21
 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
22
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 
23
 DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNERS OR CONTRIBUTORS BE LIABLE
 
24
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
25
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 
26
 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 
27
 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 
28
 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
29
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
30
\*---------------------------------------------------------------------------*/
 
31
#include "pathslice.h"
 
32
 
 
33
 
 
34
PathSlice::PathSlice(float z) : z_(z) {
 
35
}
 
36
 
 
37
 
 
38
 
 
39
 
 
40
//----[  ~PathSlice  ]---------------------------------------------------------
 
41
PathSlice::~PathSlice() {
 
42
  for (int i = 0; i < materials_.size(); ++i) {
 
43
    delete materials_[i];
 
44
  }
 
45
}
 
46
 
 
47
 
 
48
 
 
49
 
 
50
//----[  getPathSliceMaterials  ]----------------------------------------------
 
51
const PathSliceMaterialsArray& PathSlice::getPathSliceMaterials() const {
 
52
  return materials_;
 
53
}
 
54
 
 
55
 
 
56
//----[  getZ  ]---------------------------------------------------------------
 
57
float PathSlice::getZ() const {
 
58
  return z_;
 
59
}
 
60
 
 
61
 
 
62
 
 
63
 
 
64
//----[  addMaterial  ]--------------------------------------------------------
 
65
void PathSlice::addMaterial(PathSliceMaterial* material) {
 
66
  materials_.push_back(material);
 
67
}