41 #ifndef PCL_GEOMETRY_TRIANGLE_MESH_H
42 #define PCL_GEOMETRY_TRIANGLE_MESH_H
46 #include <pcl/geometry/mesh_base.h>
60 template <
class MeshTraitsT>
68 typedef boost::shared_ptr <Self>
Ptr;
69 typedef boost::shared_ptr <const Self>
ConstPtr;
140 add_triangle_ [0] = idx_v_0;
141 add_triangle_ [1] = idx_v_1;
142 add_triangle_ [2] = idx_v_2;
144 return (this->
addFaceImplBase (add_triangle_, face_data, edge_data, half_edge_data));
161 if (vertices.size () != 4)
167 return (this->
addTrianglePair (vertices [0], vertices [1], vertices [2], vertices [3], face_data, edge_data, half_edge_data));
195 FaceIndex idx_face_0 = this->
addFace (idx_v_0, idx_v_1, idx_v_2, face_data);
196 FaceIndex idx_face_1 = this->
addFace (idx_v_0, idx_v_2, idx_v_3, face_data);
200 return (std::make_pair (idx_face_0, idx_face_1));
202 else if (idx_face_1.
isValid ())
204 idx_face_0 = this->
addFace (idx_v_0, idx_v_1, idx_v_2, face_data);
205 return (std::make_pair (idx_face_1, idx_face_0));
212 idx_face_0 = this->
addFace (idx_v_1, idx_v_2, idx_v_3, face_data);
213 idx_face_1 = this->
addFace (idx_v_0, idx_v_1, idx_v_3, face_data);
217 return (std::make_pair (idx_face_0, idx_face_1));
219 else if (idx_face_1.
isValid ())
221 idx_face_0 = this->
addFace (idx_v_1, idx_v_2, idx_v_3, face_data);
222 return (std::make_pair (idx_face_1, idx_face_0));
225 if (!IsManifold::value)
240 if (!is_new_atp_ [0] && is_new_atp_ [1] && !is_new_atp_ [2] && is_new_atp_ [3])
242 return (this->connectTrianglePair (inner_he_atp_ [0], inner_he_atp_ [2], idx_v_0, idx_v_1, idx_v_2, idx_v_3, face_data, edge_data, half_edge_data));
244 else if (is_new_atp_ [0] && !is_new_atp_ [1] && is_new_atp_ [2] && !is_new_atp_ [3])
246 return (this->connectTrianglePair (inner_he_atp_ [1], inner_he_atp_ [3], idx_v_1, idx_v_2, idx_v_3, idx_v_0, face_data, edge_data, half_edge_data));
261 addFaceImpl (const VertexIndices& vertices,
262 const FaceData& face_data,
263 const EdgeData& edge_data,
264 const HalfEdgeData& half_edge_data)
266 if (vertices.size () == 3)
267 return (this->
addFaceImplBase (vertices, face_data, edge_data, half_edge_data));
326 inner_he_abc.push_back (idx_he_ab);
327 inner_he_abc.push_back (idx_he_bc);
328 inner_he_abc.push_back (idx_he_ca);
331 inner_he_acd.push_back (idx_he_ac);
332 inner_he_acd.push_back (idx_he_cd);
333 inner_he_acd.push_back (idx_he_da);
338 return (std::make_pair (idx_f_abc, idx_f_acd));
352 std::vector <bool> is_new_atp_;
356 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
361 #endif // PCL_GEOMETRY_TRIANGLE_MESH_H
Base::HalfEdgeIndices HalfEdgeIndices
Base::OuterHalfEdgeAroundFaceCirculator OuterHalfEdgeAroundFaceCirculator
Base::InnerHalfEdgeAroundFaceCirculator InnerHalfEdgeAroundFaceCirculator
void setOutgoingHalfEdgeIndex(const VertexIndex &idx_vertex, const HalfEdgeIndex &idx_outgoing_half_edge)
Set the outgoing half-edge index to a given vertex.
FaceIndexPair addTrianglePair(const VertexIndices &vertices, const FaceData &face_data=FaceData(), const EdgeData &edge_data=EdgeData(), const HalfEdgeData &half_edge_data=HalfEdgeData())
Add two triangles for the four given input vertices.
bool checkTopology1(const VertexIndex &idx_v_a, const VertexIndex &idx_v_b, HalfEdgeIndex &idx_he_ab, std::vector< bool >::reference is_new_ab, boost::true_type) const
Check if the edge between the two vertices can be added.
Base class for the half-edge mesh.
pcl::geometry::MeshBase< TriangleMesh< MeshTraitsT >, MeshTraitsT, TriangleMeshTag > Base
Index used to access elements in the half-edge mesh.
Base::HasFaceData HasFaceData
Circulates clockwise around a face and returns an index to the terminating vertex of the inner half-e...
void connectPrevNext(const HalfEdgeIndex &idx_he_ab, const HalfEdgeIndex &idx_he_bc)
Connect the next and prev indices of the two half-edges with each other.
MeshTraitsT::EdgeData EdgeData
HalfEdgeIndex getPrevHalfEdgeIndex(const HalfEdgeIndex &idx_half_edge) const
Get the previous half-edge index to a given half-edge.
HalfEdgeIndex getOppositeHalfEdgeIndex(const HalfEdgeIndex &idx_half_edge) const
Get the opposite half-edge index to a given half-edge.
bool isValid() const
Returns true if the index is valid.
Base::HalfEdgeIndex HalfEdgeIndex
Index used to access elements in the half-edge mesh.
FaceIndex addFaceImplBase(const VertexIndices &vertices, const FaceData &face_data, const EdgeData &edge_data, const HalfEdgeData &half_edge_data)
General implementation of addFace.
FaceIndex addFace(const VertexIndex &idx_v_0, const VertexIndex &idx_v_1, const VertexIndex &idx_v_2, const FaceData &face_data=FaceData(), const EdgeData &edge_data=EdgeData(), const HalfEdgeData &half_edge_data=HalfEdgeData())
Add a triangle to the mesh.
Index used to access elements in the half-edge mesh.
Base::VertexIndex VertexIndex
std::vector< HalfEdgeIndex > HalfEdgeIndices
Base::IncomingHalfEdgeAroundVertexCirculator IncomingHalfEdgeAroundVertexCirculator
Tag describing the type of the mesh.
Base::HalfEdgeData HalfEdgeData
Circulates clockwise around a face and returns an index to the outer half-edge (the target)...
FaceIndex connectFace(const HalfEdgeIndices &inner_he, const FaceData &face_data)
Add a face to the mesh and connect it to the half-edges.
Base::FaceDataCloud FaceDataCloud
boost::integral_constant< bool,!boost::is_same< EdgeData, pcl::geometry::NoData >::value > HasEdgeData
Circulates clockwise around a face and returns an index to the inner half-edge (the target)...
MeshTraitsT::HalfEdgeData HalfEdgeData
Base::EdgeIndices EdgeIndices
Base::VertexAroundVertexCirculator VertexAroundVertexCirculator
Base::FaceIndex FaceIndex
boost::integral_constant< bool,!boost::is_same< VertexData, pcl::geometry::NoData >::value > HasVertexData
Base::EdgeDataCloud EdgeDataCloud
boost::shared_ptr< Self > Ptr
Base::HalfEdgeDataCloud HalfEdgeDataCloud
boost::integral_constant< bool,!boost::is_same< HalfEdgeData, pcl::geometry::NoData >::value > HasHalfEdgeData
TriangleMesh()
Constructor.
FaceIndex addFace(const VertexIndices &vertices, const FaceData &face_data=FaceData(), const EdgeData &edge_data=EdgeData(), const HalfEdgeData &half_edge_data=HalfEdgeData())
Add a face to the mesh.
boost::shared_ptr< const Self > ConstPtr
Half-edge mesh that can only store triangles.
Base::VertexAroundFaceCirculator VertexAroundFaceCirculator
std::vector< EdgeIndex > EdgeIndices
Base::HasHalfEdgeData HasHalfEdgeData
Index used to access elements in the half-edge mesh.
Base::VertexIndices VertexIndices
Circulates clockwise around a face and returns an index to the face of the outer half-edge (the targe...
std::pair< FaceIndex, FaceIndex > FaceIndexPair
Base::EdgeIndex EdgeIndex
Base::OutgoingHalfEdgeAroundVertexCirculator OutgoingHalfEdgeAroundVertexCirculator
MeshTraitsT::VertexData VertexData
HalfEdgeIndex addEdge(const VertexIndex &idx_v_a, const VertexIndex &idx_v_b, const HalfEdgeData &he_data, const EdgeData &edge_data)
Add an edge between the two given vertices and connect them with the vertices.
Base::HasEdgeData HasEdgeData
Circulates counter-clockwise around a vertex and returns an index to the terminating vertex of the ou...
Base::HasVertexData HasVertexData
Circulates counter-clockwise around a vertex and returns an index to the incoming half-edge (the targ...
std::vector< VertexIndex > VertexIndices
FaceIndexPair addTrianglePair(const VertexIndex &idx_v_0, const VertexIndex &idx_v_1, const VertexIndex &idx_v_2, const VertexIndex &idx_v_3, const FaceData &face_data=FaceData(), const EdgeData &edge_data=EdgeData(), const HalfEdgeData &half_edge_data=HalfEdgeData())
Add two triangles for the four given input vertices.
Base::FaceAroundFaceCirculator FaceAroundFaceCirculator
Base::VertexData VertexData
Base::VertexDataCloud VertexDataCloud
Base::IsManifold IsManifold
Circulates counter-clockwise around a vertex and returns an index to the face of the outgoing half-ed...
boost::integral_constant< bool,!boost::is_same< FaceData, pcl::geometry::NoData >::value > HasFaceData
Base::FaceIndices FaceIndices
Base::FaceAroundVertexCirculator FaceAroundVertexCirculator
Circulates counter-clockwise around a vertex and returns an index to the outgoing half-edge (the targ...
HalfEdgeIndex getNextHalfEdgeIndex(const HalfEdgeIndex &idx_half_edge) const
Get the next half-edge index to a given half-edge.
std::vector< FaceIndex > FaceIndices
TriangleMesh< MeshTraitsT > Self
MeshTraitsT::IsManifold IsManifold
MeshTraitsT::FaceData FaceData