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 \*---------------------------------------------------------------------------*/
38 #ifndef _OSG_DCTPEDGE_H_
39 #define _OSG_DCTPEDGE_H_
44 #include "OSGDrawableDef.h"
45 #include "OSGConfig.h"
54 #include "OSGdctptypes.h"
59 * This define decides whether to use a std::set for storing the edges of the
60 * mesh, or just use a std::vector. We originally thought using a set speeds
61 * up some operations, but in practice for large models the vector data
62 * structure actually works better (faster).
64 * Please note that if you decide to use a set, the "sorting" of the edges is
65 * based on the lexicographic sort of the physical addresses of their vertices,
66 * which means that you might get some edges "reversed" in the mesh from
67 * the same input data. Due to the nature of the graph-traversing algorithm,
68 * (it starts by searching a direted edge) you might get slightly different
69 * different triangulations for the same surface in different runs.
71 * (Our) default is not to use a set (i.e. to use a vector).
73 #define OSG_NO_EDGE_SET
79 #include "OSGDCTPFace.h"
83 class OSG_DRAWABLE_DLLMAPPING DCTPEdge
86 inline DCTPEdge(DCTPVertex
* vx1
, DCTPVertex
* vx2
, int orient
);
87 inline ~DCTPEdge(void );
89 inline void getVertices(DCTPVertex
*&vx1
, DCTPVertex
*&vx2
);
90 inline void setVertices(DCTPVertex
* vx1
, DCTPVertex
* vx2
);
92 inline void AddFace (DCTPFace
*f
);
93 inline void RemoveFace(DCTPFace
*f
);
100 dctpfacevector faces
;
103 int orientation
; // >0: first vertex->second vertex
105 // <0: second vertec->first vertex
106 unsigned long id
; // unique id of this edge
109 #ifndef OSG_NO_EDGE_SET
112 inline bool operator()(DCTPEdge
*e1
, DCTPEdge
*e2
) const;
119 DCTPEdge(const DCTPEdge
&other
);
120 void operator =(const DCTPEdge
&rhs
);
123 #ifdef OSG_NO_EDGE_SET
124 typedef std::vector
<DCTPEdge
* > dctpedgevector
;
126 typedef std::set
<DCTPEdge
*, DCTPEdge::DCTPEdgeless
> dctpedgeset
;
131 #include "OSGDCTPEdge.inl"