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
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #ifndef OPENMESH_TRIMESH_HH
00051 #define OPENMESH_TRIMESH_HH
00052
00053
00054
00055
00056
00057 #include <OpenMesh/Core/System/config.h>
00058 #include <OpenMesh/Core/Mesh/PolyMeshT.hh>
00059 #include <vector>
00060
00061
00062
00063
00064
00065 namespace OpenMesh {
00066
00067
00068
00069
00070
00087 template <class Kernel>
00088 class TriMeshT : public PolyMeshT<Kernel>
00089 {
00090
00091 public:
00092
00093
00094
00095 typedef TriMeshT<Kernel> This;
00096 typedef PolyMeshT<Kernel> PolyMesh;
00097
00099
00100 enum { IsPolyMesh = 0 };
00101 enum { IsTriMesh = 1 };
00102 static bool is_polymesh() { return false; }
00103 static bool is_trimesh() { return true; }
00105
00106
00107
00108 typedef typename PolyMesh::Scalar Scalar;
00109 typedef typename PolyMesh::Point Point;
00110 typedef typename PolyMesh::Normal Normal;
00111 typedef typename PolyMesh::Color Color;
00112 typedef typename PolyMesh::TexCoord1D TexCoord1D;
00113 typedef typename PolyMesh::TexCoord2D TexCoord2D;
00114 typedef typename PolyMesh::TexCoord3D TexCoord3D;
00115 typedef typename PolyMesh::Vertex Vertex;
00116 typedef typename PolyMesh::Halfedge Halfedge;
00117 typedef typename PolyMesh::Edge Edge;
00118 typedef typename PolyMesh::Face Face;
00119
00120
00121
00122
00123 typedef typename PolyMesh::VertexHandle VertexHandle;
00124 typedef typename PolyMesh::HalfedgeHandle HalfedgeHandle;
00125 typedef typename PolyMesh::EdgeHandle EdgeHandle;
00126 typedef typename PolyMesh::FaceHandle FaceHandle;
00127
00128
00129
00130
00131 typedef typename PolyMesh::VertexIter VertexIter;
00132 typedef typename PolyMesh::ConstVertexIter ConstVertexIter;
00133 typedef typename PolyMesh::EdgeIter EdgeIter;
00134 typedef typename PolyMesh::ConstEdgeIter ConstEdgeIter;
00135 typedef typename PolyMesh::FaceIter FaceIter;
00136 typedef typename PolyMesh::ConstFaceIter ConstFaceIter;
00137
00138
00139
00140
00141
00142 typedef typename PolyMesh::VertexVertexIter VertexVertexIter;
00143 typedef typename PolyMesh::VertexOHalfedgeIter VertexOHalfedgeIter;
00144 typedef typename PolyMesh::VertexIHalfedgeIter VertexIHalfedgeIter;
00145 typedef typename PolyMesh::VertexEdgeIter VertexEdgeIter;
00146 typedef typename PolyMesh::VertexFaceIter VertexFaceIter;
00147 typedef typename PolyMesh::FaceVertexIter FaceVertexIter;
00148 typedef typename PolyMesh::FaceHalfedgeIter FaceHalfedgeIter;
00149 typedef typename PolyMesh::FaceEdgeIter FaceEdgeIter;
00150 typedef typename PolyMesh::FaceFaceIter FaceFaceIter;
00151 typedef typename PolyMesh::ConstVertexVertexIter ConstVertexVertexIter;
00152 typedef typename PolyMesh::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter;
00153 typedef typename PolyMesh::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter;
00154 typedef typename PolyMesh::ConstVertexEdgeIter ConstVertexEdgeIter;
00155 typedef typename PolyMesh::ConstVertexFaceIter ConstVertexFaceIter;
00156 typedef typename PolyMesh::ConstFaceVertexIter ConstFaceVertexIter;
00157 typedef typename PolyMesh::ConstFaceHalfedgeIter ConstFaceHalfedgeIter;
00158 typedef typename PolyMesh::ConstFaceEdgeIter ConstFaceEdgeIter;
00159 typedef typename PolyMesh::ConstFaceFaceIter ConstFaceFaceIter;
00160
00161
00162
00164 TriMeshT() : PolyMesh() {}
00166 virtual ~TriMeshT() {}
00167
00168
00169
00171 inline HalfedgeHandle vertex_split(Point _v0_point, VertexHandle _v1,
00172 VertexHandle _vl, VertexHandle _vr)
00173 { return PolyMesh::vertex_split(add_vertex(_v0_point), _v1, _vl, _vr); }
00174
00175 inline HalfedgeHandle vertex_split(VertexHandle _v0, VertexHandle _v1,
00176 VertexHandle _vl, VertexHandle _vr)
00177 { return PolyMesh::vertex_split(_v0, _v1, _vl, _vr); }
00178
00180 inline void split(EdgeHandle _eh, const Point& _p)
00181 { PolyMesh::split(_eh, add_vertex(_p)); }
00182
00183 inline void split(EdgeHandle _eh, VertexHandle _vh)
00184 { PolyMesh::split(_eh, _vh); }
00185
00187 inline void split(FaceHandle _fh, const Point& _p)
00188 { PolyMesh::split(_fh, _p); }
00189
00190 inline void split(FaceHandle _fh, VertexHandle _vh)
00191 { PolyMesh::split(_fh, _vh); }
00192
00196
00198 Normal calc_face_normal(FaceHandle _fh) const;
00199
00201 };
00202
00203
00204
00205 }
00206
00207 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_TRIMESH_C)
00208 #define OPENMESH_TRIMESH_TEMPLATES
00209 #include "TriMeshT.cc"
00210 #endif
00211
00212 #endif // OPENMESH_TRIMESH_HH defined
00213