Go to the documentation of this file.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 #ifndef PCL_GEOMETRY_POLYGON_MESH_H
00042 #define PCL_GEOMETRY_POLYGON_MESH_H
00043
00044 #include <pcl/geometry/mesh_base.h>
00045
00046 namespace pcl
00047 {
00048 namespace geometry
00049 {
00051 struct PolygonMeshTag {};
00052
00058 template <class MeshTraitsT>
00059 class PolygonMesh : public pcl::geometry::MeshBase <PolygonMesh <MeshTraitsT>, MeshTraitsT, PolygonMeshTag>
00060 {
00061 public:
00062
00063 typedef pcl::geometry::MeshBase <PolygonMesh <MeshTraitsT>, MeshTraitsT, PolygonMeshTag> Base;
00064
00065 typedef PolygonMesh <MeshTraitsT> Self;
00066 typedef boost::shared_ptr <Self> Ptr;
00067 typedef boost::shared_ptr <const Self> ConstPtr;
00068
00069 typedef typename Base::VertexData VertexData;
00070 typedef typename Base::HalfEdgeData HalfEdgeData;
00071 typedef typename Base::EdgeData EdgeData;
00072 typedef typename Base::FaceData FaceData;
00073 typedef typename Base::IsManifold IsManifold;
00074 typedef typename Base::MeshTag MeshTag;
00075
00076 typedef typename Base::HasVertexData HasVertexData;
00077 typedef typename Base::HasHalfEdgeData HasHalfEdgeData;
00078 typedef typename Base::HasEdgeData HasEdgeData;
00079 typedef typename Base::HasFaceData HasFaceData;
00080
00081 typedef typename Base::VertexDataCloud VertexDataCloud;
00082 typedef typename Base::HalfEdgeDataCloud HalfEdgeDataCloud;
00083 typedef typename Base::EdgeDataCloud EdgeDataCloud;
00084 typedef typename Base::FaceDataCloud FaceDataCloud;
00085
00086
00087 typedef typename Base::VertexIndex VertexIndex;
00088 typedef typename Base::HalfEdgeIndex HalfEdgeIndex;
00089 typedef typename Base::EdgeIndex EdgeIndex;
00090 typedef typename Base::FaceIndex FaceIndex;
00091
00092 typedef typename Base::VertexIndices VertexIndices;
00093 typedef typename Base::HalfEdgeIndices HalfEdgeIndices;
00094 typedef typename Base::EdgeIndices EdgeIndices;
00095 typedef typename Base::FaceIndices FaceIndices;
00096
00097
00098 typedef typename Base::VertexAroundVertexCirculator VertexAroundVertexCirculator;
00099 typedef typename Base::OutgoingHalfEdgeAroundVertexCirculator OutgoingHalfEdgeAroundVertexCirculator;
00100 typedef typename Base::IncomingHalfEdgeAroundVertexCirculator IncomingHalfEdgeAroundVertexCirculator;
00101 typedef typename Base::FaceAroundVertexCirculator FaceAroundVertexCirculator;
00102 typedef typename Base::VertexAroundFaceCirculator VertexAroundFaceCirculator;
00103 typedef typename Base::InnerHalfEdgeAroundFaceCirculator InnerHalfEdgeAroundFaceCirculator;
00104 typedef typename Base::OuterHalfEdgeAroundFaceCirculator OuterHalfEdgeAroundFaceCirculator;
00105 typedef typename Base::FaceAroundFaceCirculator FaceAroundFaceCirculator;
00106
00108 PolygonMesh ()
00109 : Base (),
00110 add_triangle_ (3),
00111 add_quad_ (4)
00112 {
00113 }
00114
00116 using Base::addFace;
00117
00128 inline FaceIndex
00129 addFace (const VertexIndex& idx_v_0,
00130 const VertexIndex& idx_v_1,
00131 const VertexIndex& idx_v_2,
00132 const FaceData& face_data = FaceData (),
00133 const EdgeData& edge_data = EdgeData (),
00134 const HalfEdgeData& half_edge_data = HalfEdgeData ())
00135 {
00136 add_triangle_ [0] = idx_v_0;
00137 add_triangle_ [1] = idx_v_1;
00138 add_triangle_ [2] = idx_v_2;
00139
00140 return (this->addFaceImplBase (add_triangle_, face_data, edge_data, half_edge_data));
00141 }
00142
00154 inline FaceIndex
00155 addFace (const VertexIndex& idx_v_0,
00156 const VertexIndex& idx_v_1,
00157 const VertexIndex& idx_v_2,
00158 const VertexIndex& idx_v_3,
00159 const FaceData& face_data = FaceData (),
00160 const EdgeData& edge_data = EdgeData (),
00161 const HalfEdgeData& half_edge_data = HalfEdgeData ())
00162 {
00163 add_quad_ [0] = idx_v_0;
00164 add_quad_ [1] = idx_v_1;
00165 add_quad_ [2] = idx_v_2;
00166 add_quad_ [3] = idx_v_3;
00167
00168 return (this->addFaceImplBase (add_quad_, face_data, edge_data, half_edge_data));
00169 }
00170
00171 private:
00172
00173
00174 friend class pcl::geometry::MeshBase <PolygonMesh <MeshTraitsT>, MeshTraitsT, pcl::geometry::PolygonMeshTag>;
00175
00177 inline FaceIndex
00178 addFaceImpl (const VertexIndices& vertices,
00179 const FaceData& face_data,
00180 const EdgeData& edge_data,
00181 const HalfEdgeData& half_edge_data)
00182 {
00183 return (this->addFaceImplBase (vertices, face_data, edge_data, half_edge_data));
00184 }
00185
00187
00189
00191 VertexIndices add_triangle_;
00192
00194 VertexIndices add_quad_;
00195
00196 public:
00197
00198 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00199 };
00200 }
00201 }
00202
00203 #endif // PCL_GEOMETRY_POLYGON_MESH_H