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 DCTPEdge::DCTPEdge(DCTPVertex * vx1, DCTPVertex * vx2, int orient) :
49 #ifndef OSG_NO_EDGE_SET
61 orientation = -orient;
67 #endif /* OSG_NO_EDGE_SET */
72 inline DCTPEdge::~DCTPEdge(void)
77 inline void DCTPEdge::getVertices(DCTPVertex* & vx1, DCTPVertex* & vx2)
83 inline void DCTPEdge::setVertices(DCTPVertex* vx1, DCTPVertex* vx2)
85 #ifndef OSG_NO_EDGE_SET
99 #endif /* OSG_NO_EDGE_SET */
102 inline void DCTPEdge::AddFace(DCTPFace *f)
104 // std::cerr << v1->coords << " " << v2->coords << f << std::endl;
105 //FIXME: shouldn't warn always...
106 //FIXME: check for adding existing face?
107 if((faces.size() != 0) && (faces[0] == f))
110 if(faces.size() >= 2)
115 std::cerr << "DCTPEdge::AddFace: third (nonmanifold) face supplied... " << faces.size() + 1 << std::endl;
116 // FIXME: operator<< deprecated
117 // std::cerr << "I am: " << v1->coords << ' ' << v2->coords << std::endl;
118 std::cerr << "The already existing triangles:\n";
120 for(unsigned int i = 0; i < faces.size(); ++i)
122 std::cerr << "Ptr: " << static_cast<void*>(faces[i]) << ' ';
123 faces[i]->dump_triangle();
126 std::cerr << "And the new one:\n";
127 std::cerr << "Ptr: " << static_cast<void*>(f) << ' '; f->dump_triangle();
133 inline void DCTPEdge::RemoveFace(DCTPFace *f)
135 dctpfacevector::iterator fe = faces.end();
136 bool removed = false;
138 for(dctpfacevector::iterator i = faces.begin(); i != fe; ++i)
150 std::cerr << "DCTPEdge::RemoveFace: trying to remove nonexistant face..." << std::endl;
154 #ifndef OSG_NO_EDGE_SET
155 inline bool DCTPEdge::DCTPEdgeless::operator ()(
156 DCTPEdge *e1, DCTPEdge *e2) const
162 e1-> getVertices(e1v1, e1v2);
163 e2-> getVertices(e2v1, e2v2);
165 if((e1v1 < e2v1) || (e1v1 == e2v1 && e1v2 < e2v2))