OpenMesh
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TriMeshT.hh
1 /*===========================================================================*\
2  * *
3  * OpenMesh *
4  * Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
5  * www.openmesh.org *
6  * *
7  *---------------------------------------------------------------------------*
8  * This file is part of OpenMesh. *
9  * *
10  * OpenMesh is free software: you can redistribute it and/or modify *
11  * it under the terms of the GNU Lesser General Public License as *
12  * published by the Free Software Foundation, either version 3 of *
13  * the License, or (at your option) any later version with the *
14  * following exceptions: *
15  * *
16  * If other files instantiate templates or use macros *
17  * or inline functions from this file, or you compile this file and *
18  * link it with other files to produce an executable, this file does *
19  * not by itself cause the resulting executable to be covered by the *
20  * GNU Lesser General Public License. This exception does not however *
21  * invalidate any other reasons why the executable file might be *
22  * covered by the GNU Lesser General Public License. *
23  * *
24  * OpenMesh is distributed in the hope that it will be useful, *
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
27  * GNU Lesser General Public License for more details. *
28  * *
29  * You should have received a copy of the GNU LesserGeneral Public *
30  * License along with OpenMesh. If not, *
31  * see <http://www.gnu.org/licenses/>. *
32  * *
33 \*===========================================================================*/
34 
35 /*===========================================================================*\
36  * *
37  * $Revision: 553 $ *
38  * $Date: 2012-03-02 17:54:35 +0100 (Fr, 02 Mär 2012) $ *
39  * *
40 \*===========================================================================*/
41 
42 
43 //=============================================================================
44 //
45 // CLASS TriMeshT
46 //
47 //=============================================================================
48 
49 
50 #ifndef OPENMESH_TRIMESH_HH
51 #define OPENMESH_TRIMESH_HH
52 
53 
54 //== INCLUDES =================================================================
55 
56 
57 #include <OpenMesh/Core/System/config.h>
58 #include <OpenMesh/Core/Mesh/PolyMeshT.hh>
59 #include <vector>
60 
61 
62 //== NAMESPACES ===============================================================
63 
64 
65 namespace OpenMesh {
66 
67 
68 //== CLASS DEFINITION =========================================================
69 
70 
87 template <class Kernel>
88 class TriMeshT : public PolyMeshT<Kernel>
89 {
90 
91 public:
92 
93 
94  // self
97 
99 
100  enum { IsPolyMesh = 0 };
101  enum { IsTriMesh = 1 };
102  static bool is_polymesh() { return false; }
103  static bool is_trimesh() { return true; }
105 
106  //--- items ---
107 
108  typedef typename PolyMesh::Scalar Scalar;
109  typedef typename PolyMesh::Point Point;
110  typedef typename PolyMesh::Normal Normal;
111  typedef typename PolyMesh::Color Color;
115  typedef typename PolyMesh::Vertex Vertex;
116  typedef typename PolyMesh::Halfedge Halfedge;
117  typedef typename PolyMesh::Edge Edge;
118  typedef typename PolyMesh::Face Face;
119 
120 
121  //--- handles ---
122 
124  typedef typename PolyMesh::HalfedgeHandle HalfedgeHandle;
125  typedef typename PolyMesh::EdgeHandle EdgeHandle;
126  typedef typename PolyMesh::FaceHandle FaceHandle;
127 
128 
129  //--- iterators ---
130 
131  typedef typename PolyMesh::VertexIter VertexIter;
132  typedef typename PolyMesh::ConstVertexIter ConstVertexIter;
133  typedef typename PolyMesh::EdgeIter EdgeIter;
134  typedef typename PolyMesh::ConstEdgeIter ConstEdgeIter;
135  typedef typename PolyMesh::FaceIter FaceIter;
136  typedef typename PolyMesh::ConstFaceIter ConstFaceIter;
137 
138 
139 
140  //--- circulators ---
141 
160 
161  // --- constructor/destructor
162 
166  virtual ~TriMeshT() {}
167 
168  //--- halfedge collapse / vertex split ---
169 
171  inline HalfedgeHandle vertex_split(Point _v0_point, VertexHandle _v1,
172  VertexHandle _vl, VertexHandle _vr)
173  { return PolyMesh::vertex_split(add_vertex(_v0_point), _v1, _vl, _vr); }
174 
176  VertexHandle _vl, VertexHandle _vr)
177  { return PolyMesh::vertex_split(_v0, _v1, _vl, _vr); }
178 
181  inline void split(EdgeHandle _eh, const Point& _p)
182  { Kernel::split(_eh, this->add_vertex(_p)); }
183 
184  inline void split(EdgeHandle _eh, VertexHandle _vh)
185  { Kernel::split(_eh, _vh); }
186 
188  inline void split(FaceHandle _fh, const Point& _p)
189  { PolyMesh::split(_fh, _p); }
190 
191  inline void split(FaceHandle _fh, VertexHandle _vh)
192  { PolyMesh::split(_fh, _vh); }
193 
197 
199  Normal calc_face_normal(FaceHandle _fh) const;
200 
202 };
203 
204 
205 //=============================================================================
206 } // namespace OpenMesh
207 //=============================================================================
208 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_TRIMESH_C)
209 #define OPENMESH_TRIMESH_TEMPLATES
210 #include "TriMeshT.cc"
211 #endif
212 //=============================================================================
213 #endif // OPENMESH_TRIMESH_HH defined
214 //=============================================================================

acg pic Project OpenMesh, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .