1 /*---------------------------------------------------------------------------*\
2 * OpenSG NURBS Library *
5 * Copyright (C) 2001-2006 by the University of Bonn, Computer Graphics Group*
7 * http://cg.cs.uni-bonn.de/ *
9 * contact: edhellon@cs.uni-bonn.de, guthe@cs.uni-bonn.de, rk@cs.uni-bonn.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
41 inline TrimSegment::TrimSegment(void) :
49 inline TrimSegment::TrimSegment(const TrimSegment &ts) :
50 trimbeziers(ts.trimbeziers),
57 inline TrimSegment::~TrimSegment(void)
63 inline DCTPFace::DCTPFace(void) :
66 #ifdef OSG_UNION_TRI_QUAD
80 inline DCTPFace::~DCTPFace(void)
85 inline void DCTPFace::AddVertex(DCTPVertex *v)
87 //FIXME: check for adding existing vertex?
88 vertices.push_back(v);
91 inline void DCTPFace::RemoveVertex(DCTPVertex *v)
93 std::vector<DCTPVertex*> ::iterator ve = vertices.end();
96 for(std::vector<DCTPVertex*>::iterator i = vertices.begin(); i != ve; ++i)
107 std::cerr << "DCTPFace::RemoveVertex: trying to remove nonexistant vertex..." << std::endl;
110 //to keep the order of the vertices
111 inline void DCTPFace::ReplaceVertex(DCTPVertex *oldv, DCTPVertex *newv)
113 std::vector<DCTPVertex*> ::iterator ve = vertices.end();
114 bool replaced = false;
116 for(std::vector<DCTPVertex*>::iterator i = vertices.begin(); i != ve; ++i)
127 std::cerr << "DCTPFace::ReplaceVertex: trying to replace nonexistant vertex..." << std::endl;
130 inline void DCTPFace::AddEdge(DCTPEdge *e)
132 //FIXME: check for adding existing edge?
136 inline void DCTPFace::RemoveEdge(DCTPEdge *e)
138 std::vector<DCTPEdge*> ::iterator ee = edges.end();
139 bool removed = false;
141 for(std::vector<DCTPEdge*>::iterator i = edges.begin(); i != ee; ++i)
152 std::cerr << "DCTPFace::RemoveEdge: trying to remove nonexistant edge..." << std::endl;
155 inline void DCTPFace::dump_triangle(void)
157 #ifdef OSG_UNION_TRI_QUAD
158 //FIXME: operator<< deprecated
159 // std::cerr << orig_face[ 0 ]->coords << ' ' << orig_face[ 1 ]->coords << ' ' << orig_face[ 2 ]->coords;
160 // if( orig_face[ 3 ] ) std::cerr << ' ' << orig_face[ 3 ]->coords;
161 std::cerr << std::endl;
164 // std::cerr << orig_triangle[ 0 ]->coords << ' ' << orig_triangle[ 1 ]->coords
165 // << ' ' << orig_triangle[ 2 ]->coords << std::endl;
167 // std::cerr << orig_quad[ 0 ]->coords << " " << orig_quad[ 1 ]->coords << " "
168 // << orig_quad[ 2 ]->coords << " " << orig_quad[ 3 ]->coords << std::endl;