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_DCTPVERTEX_H_
39 #define _OSG_DCTPVERTEX_H_
44 #include "OSGDrawableDef.h"
45 #include "OSGConfig.h"
51 #include "OSGdctptypes.h"
59 class OSG_DRAWABLE_DLLMAPPING DCTPVertex
62 DCTPVertex() : edges(), faces(), coords(), id(), node_id(), vertexinfo(NULL
)
69 std::vector
<DCTPEdge
*> edges
;
70 std::vector
<DCTPFace
*> faces
;
71 #ifdef OSG_INTEGER_MESH
76 unsigned long id
; // unique id of this vertex
77 unsigned long node_id
; // uniqe ID of the surface graph node
80 void RemoveFace(DCTPFace
*f
)
82 std::vector
<DCTPFace
*>::iterator fe
= faces
.end();
85 for(std::vector
<DCTPFace
*>::iterator i
= faces
.begin(); i
!= fe
; ++i
)
89 *i
= faces
[faces
.size() - 1];
97 std::cerr
<< "DCTPVertex::RemoveFace: trying to remove nonexistant face..." << std::endl
;
100 void AddFace(DCTPFace
*f
)
102 std::vector
<DCTPFace
*>::iterator fe
= faces
.end();
105 for(std::vector
<DCTPFace
*>::iterator i
= faces
.begin(); i
!= fe
; ++i
)
114 void RemoveEdge(DCTPEdge
*e
)
116 std::vector
<DCTPEdge
*>::iterator ee
= edges
.end();
119 for(std::vector
<DCTPEdge
*>::iterator i
= edges
.begin(); i
!= ee
; ++i
)
123 *i
= edges
[edges
.size() - 1];
130 std::cerr
<< "DCTPVertex::RemoveEdge: trying to remove nonexistant edge..." << std::endl
;
133 struct DCTPVertexless
135 bool operator()(DCTPVertex
* v1
, DCTPVertex
* v2
) const
137 // std::cerr << "comparing: " << v1->coords << " and" << std::endl;
138 // std::cerr << " " << v2->coords << std::endl;
139 // std::cerr << "pointers: " << v1 << " and" << std::endl;
140 // std::cerr << " " << v2 << std::endl;
141 // bool k = v1->coords < v2->coords;
142 // std::cerr << "result: " << k << std::endl;
144 // return (v1->coords < v2->coords);
145 return DCTPVecIsLesser(v1
->coords
, v2
->coords
);
151 DCTPVertex(const DCTPVertex
&other
);
152 void operator =(const DCTPVertex
&rhs
);
155 typedef std::set
<DCTPVertex
*, DCTPVertex::DCTPVertexless
> dctpvertexset
;
157 typedef std::vector
<DCTPVertex
*> dctpvertexvector
;
158 typedef std::vector
<dctpvertexvector
> dctpvertexmatrix
;
162 #endif // DCTPVertex.h