00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef OPENMESH_TRIMESH_HH
00040 #define OPENMESH_TRIMESH_HH
00041
00042
00043
00044
00045
00046 #include <OpenMesh/Core/System/config.h>
00047 #include <OpenMesh/Core/Mesh/PolyMeshT.hh>
00048 #include <vector>
00049
00050
00051
00052
00053
00054 namespace OpenMesh {
00055
00056
00057
00058
00059
00076 template <class Kernel>
00077 class TriMeshT : public PolyMeshT<Kernel>
00078 {
00079
00080 public:
00081
00082
00083
00084 typedef TriMeshT<Kernel> This;
00085 typedef PolyMeshT<Kernel> PolyMesh;
00086
00088
00089 enum { IsPolyMesh = 0 };
00090 enum { IsTriMesh = 1 };
00091 static bool is_polymesh() { return false; }
00092 static bool is_trimesh() { return true; }
00094
00095
00096
00097 typedef typename PolyMesh::Scalar Scalar;
00098 typedef typename PolyMesh::Point Point;
00099 typedef typename PolyMesh::Normal Normal;
00100 typedef typename PolyMesh::Color Color;
00101 typedef typename PolyMesh::TexCoord1D TexCoord1D;
00102 typedef typename PolyMesh::TexCoord2D TexCoord2D;
00103 typedef typename PolyMesh::TexCoord3D TexCoord3D;
00104 typedef typename PolyMesh::Vertex Vertex;
00105 typedef typename PolyMesh::Halfedge Halfedge;
00106 typedef typename PolyMesh::Edge Edge;
00107 typedef typename PolyMesh::Face Face;
00108
00109
00110
00111
00112 typedef typename PolyMesh::VertexHandle VertexHandle;
00113 typedef typename PolyMesh::HalfedgeHandle HalfedgeHandle;
00114 typedef typename PolyMesh::EdgeHandle EdgeHandle;
00115 typedef typename PolyMesh::FaceHandle FaceHandle;
00116
00117
00118
00119
00120 typedef typename PolyMesh::VertexIter VertexIter;
00121 typedef typename PolyMesh::ConstVertexIter ConstVertexIter;
00122 typedef typename PolyMesh::EdgeIter EdgeIter;
00123 typedef typename PolyMesh::ConstEdgeIter ConstEdgeIter;
00124 typedef typename PolyMesh::FaceIter FaceIter;
00125 typedef typename PolyMesh::ConstFaceIter ConstFaceIter;
00126
00127
00128
00129
00130
00131 typedef typename PolyMesh::VertexVertexIter VertexVertexIter;
00132 typedef typename PolyMesh::VertexOHalfedgeIter VertexOHalfedgeIter;
00133 typedef typename PolyMesh::VertexIHalfedgeIter VertexIHalfedgeIter;
00134 typedef typename PolyMesh::VertexEdgeIter VertexEdgeIter;
00135 typedef typename PolyMesh::VertexFaceIter VertexFaceIter;
00136 typedef typename PolyMesh::FaceVertexIter FaceVertexIter;
00137 typedef typename PolyMesh::FaceHalfedgeIter FaceHalfedgeIter;
00138 typedef typename PolyMesh::FaceEdgeIter FaceEdgeIter;
00139 typedef typename PolyMesh::FaceFaceIter FaceFaceIter;
00140 typedef typename PolyMesh::ConstVertexVertexIter ConstVertexVertexIter;
00141 typedef typename PolyMesh::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter;
00142 typedef typename PolyMesh::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter;
00143 typedef typename PolyMesh::ConstVertexEdgeIter ConstVertexEdgeIter;
00144 typedef typename PolyMesh::ConstVertexFaceIter ConstVertexFaceIter;
00145 typedef typename PolyMesh::ConstFaceVertexIter ConstFaceVertexIter;
00146 typedef typename PolyMesh::ConstFaceHalfedgeIter ConstFaceHalfedgeIter;
00147 typedef typename PolyMesh::ConstFaceEdgeIter ConstFaceEdgeIter;
00148 typedef typename PolyMesh::ConstFaceFaceIter ConstFaceFaceIter;
00149
00150
00151
00153 TriMeshT() : PolyMesh() {}
00155 virtual ~TriMeshT() {}
00156
00157
00158
00160 inline HalfedgeHandle vertex_split(Point _v0_point, VertexHandle _v1,
00161 VertexHandle _vl, VertexHandle _vr)
00162 { return PolyMesh::vertex_split(add_vertex(_v0_point), _v1, _vl, _vr); }
00163
00164 inline HalfedgeHandle vertex_split(VertexHandle _v0, VertexHandle _v1,
00165 VertexHandle _vl, VertexHandle _vr)
00166 { return PolyMesh::vertex_split(_v0, _v1, _vl, _vr); }
00167
00169 inline void split(EdgeHandle _eh, const Point& _p)
00170 { PolyMesh::split(_eh, add_vertex(_p)); }
00171
00172 inline void split(EdgeHandle _eh, VertexHandle _vh)
00173 { PolyMesh::split(_eh, _vh); }
00174
00176
00178 inline void split(FaceHandle _fh, const Point& _p)
00179 { PolyMesh::split(_fh, _p); }
00180
00181 inline void split(FaceHandle _fh, VertexHandle _vh)
00182 { PolyMesh::split(_fh, _vh); }
00183 };
00184
00185
00186
00187 }
00188
00189 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_TRIMESH_C)
00190 #define OPENMESH_TRIMESH_TEMPLATES
00191 #include "TriMeshT.cc"
00192 #endif
00193
00194 #endif // OPENMESH_TRIMESH_HH defined
00195