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