1
/*---------------------------------------------------------------------------*\
2
This file is part of the Fab@Home Project.
3
Fab@Home operates under the BSD Open Source License.
5
Copyright (c) 2009, Karl Gluck (kwg8@cornell.edu)
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.
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"
34
PathSlice::PathSlice(float z) : z_(z) {
40
//----[ ~PathSlice ]---------------------------------------------------------
41
PathSlice::~PathSlice() {
42
for (int i = 0; i < materials_.size(); ++i) {
50
//----[ getPathSliceMaterials ]----------------------------------------------
51
const PathSliceMaterialsArray& PathSlice::getPathSliceMaterials() const {
56
//----[ getZ ]---------------------------------------------------------------
57
float PathSlice::getZ() const {
64
//----[ addMaterial ]--------------------------------------------------------
65
void PathSlice::addMaterial(PathSliceMaterial* material) {
66
materials_.push_back(material);