Go to the documentation of this file.
20 #include <CGAL/Triangulation_2.h>
21 #include <CGAL/Constrained_Delaunay_triangulation_2.h>
27 template <
class Gt,
class Vb = CGAL::Triangulation_vertex_base_2<Gt> >
31 template <
typename TDS2 >
54 template <
class Gt,
class Fb = CGAL::Constrained_triangulation_face_base_2<Gt> >
62 typedef typename Fb::Triangulation_data_structure::Vertex_handle
Vertex_handle;
68 typedef typename Fb::Triangulation_data_structure::Face_handle
Face_handle;
70 template <
typename TDS2 >
88 bool c0,
bool c1,
bool c2 ) : Fb(v0,v1,v2,n0,n1,n2) {}
132 typedef typename CGAL::Triangulation_data_structure_2<Tri_vb,Tri_fb>
Tri_DS;
148 #if( CGAL_VERSION_NR >= 1050100000 )
149 typedef typename CGAL::No_constraint_intersection_requiring_constructions_tag
152 typedef typename CGAL::No_intersection_tag
Itag;
194 double x = to_double(norm_dir.x());
195 double y = to_double(norm_dir.y());
196 double z = to_double(norm_dir.z());
197 double absx = std::abs(x);
198 double absy = std::abs(y);
199 double absz = std::abs(z);
209 else if (absy >= absx && absy >= absz)
max_coordinate = (y>0)?1:4;
210 else if (absz >= absx && absz >= absy)
max_coordinate = (z>0)?2:5;
223 if(
v2->get_Label() == 0xFFFFFFFF)
v2->set_Label(0xFFFFFFFE);
224 if(
v3->get_Label() == 0xFFFFFFFF)
v3->set_Label(0xFFFFFFFD);
268 if(Label != 0xFFFFFFFF)
269 for(
unsigned int i = 0;i !=
pts_point.size();++i)
294 ct.insert_constraint(
c1,
c2);
307 std::vector< std::vector<unsigned long> >
get_triangles(
bool inv_triangles,
bool *IsExt)
313 std::vector<std::vector<unsigned long> > tris;
325 f2 = f->neighbor(f->ccw(i));
326 }
while( ! ( f->has_vertex(
c2) && f2->has_vertex(
c2) ) );
335 if(f->has_vertex(
ct.infinite_vertex()))
345 std::stack<Face_handle_tri> sfh;
359 std::vector<unsigned long> tri;
361 tri.push_back(f->vertex(0)->get_Label());
364 if(f->has_vertex(
v1,i) && f->neighbor(f->ccw(i))->has_vertex(
ct.infinite_vertex())) IsExt[0] =
true;
365 if(f->has_vertex(
v2,i) && f->neighbor(f->ccw(i))->has_vertex(
ct.infinite_vertex())) IsExt[1] =
true;
366 if(f->has_vertex(
v3,i) && f->neighbor(f->ccw(i))->has_vertex(
ct.infinite_vertex())) IsExt[2] =
true;
370 tri.push_back(f->vertex(2)->get_Label());
371 tri.push_back(f->vertex(1)->get_Label());
375 tri.push_back(f->vertex(1)->get_Label());
376 tri.push_back(f->vertex(2)->get_Label());
382 if(!(f->neighbor(i)->get_OK() || f->neighbor(i)->has_vertex(
ct.infinite_vertex())))
384 f->neighbor(i)->set_OK(
true);
385 f->neighbor(i)->set_Ext((f->is_constrained(i))?!f->get_Ext():f->get_Ext());
386 sfh.push(f->neighbor(i));
401 std::vector< std::vector<unsigned long> > tris;
404 std::vector<unsigned long> tri;
405 tri.push_back(f->vertex(0)->get_Label());
408 tri.push_back(f->vertex(2)->get_Label());
409 tri.push_back(f->vertex(1)->get_Label());
413 tri.push_back(f->vertex(1)->get_Label());
414 tri.push_back(f->vertex(2)->get_Label());
Fb::Triangulation_data_structure::Vertex_handle Vertex_handle
Handle for a vertex of a triangulation.
Enriched_face_base(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2)
std::vector< Vertex_handle_tri > pts_vertex
List of the handles of the points added in the triangulation.
Constrained_Delaunay_tri::Face_iterator Face_iterator_tri
Iterator for the faces of the triangulation.
Vertex_handle_tri v2
Handle of the point corresponding to the second vertex of the facet.
Constrained_Delaunay_tri::Point Point_tri
2d point for the triangulation
void add_segment(Point_3 &p1, Point_3 &p2, unsigned long &Label1, unsigned long &Label2)
Adds a constrained segment in the triangulation.
int max_coordinate
Code identifying the plane where the triangulation is done 0 : Plane (y, z) 1 : Plane (z,...
Enriched_vertex_base< K > Tri_vb
Vertex base.
Enriches the faces of a triangulation.
Fb::Triangulation_data_structure::Face_handle Face_handle
Handle for a face of a triangulation.
Constrained_Delaunay_tri ct
The triangulation.
unsigned long m_Label
An Id for the vertex.
Enriched_face_base< K > Tri_fb
Face base.
Enriches the vertices of a triangulation.
void set_OK(bool OK)
Accessor.
Fb::template Rebind_TDS< TDS2 >::Other Fb2
Enriched_face_base(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Face_handle n0, Face_handle n1, Face_handle n2, bool c0, bool c1, bool c2)
Enriched_face_base< Gt, Fb2 > Other
CGAL::Vector_3< Exact_Kernel > Vector_exact
3d vector using exact number type
CGAL::Triangulation_data_structure_2< Tri_vb, Tri_fb > Tri_DS
Data structure of the triangulation.
Point_tri get_minvar_point_2(Point_3 &p)
Compute the orthogonal projection of a point to the plane defined by the longest coordinate of the no...
Vertex_handle_tri c1
Handle of the point corresponding to the first vertex of the last segment added.
bool m_Ext
True if the vertex belongs to the result.
Vertex_handle_tri v3
Handle of the point corresponding to the third vertex of the facet.
Point3d_exact point_to_exact(Point3d &p)
Convertion from a Point3d (double) to a Point3d_exact (exact)
Constrained_Delaunay_tri::Face_handle Face_handle_tri
Face handle for the triangulation.
Vertex_handle_tri add_new_pt(Point_3 p, unsigned long &Label)
Adds a point in the triangulation.
To subdivide a facet. (the kernel K must be exact)
Enriched_vertex_base< Gt, Vb2 > Other
K::Point_3 Point_3
3d point using exact number type
void set_Label(unsigned long Label)
Accessor.
std::vector< std::vector< unsigned long > > get_triangles(bool inv_triangles, bool *IsExt)
Gets the triangles of the triangulation that belongs to the result and deduce for the three neighbori...
Constrained_Delaunay_tri::Vertex_handle Vertex_handle_tri
Vertex handle for the triangulation.
CGAL::Constrained_Delaunay_triangulation_2< K, Tri_DS, Itag > Constrained_Delaunay_tri
2d constrained Delaunay triangulation
EnrichedPolyhedron::Halfedge_handle Halfedge_handle
Vertex_handle_tri c2
Handle of the point corresponding to the second vertex of the last segment added.
bool m_OK
True if the vertex has been processed.
Vertex_handle_tri v1
Handle of the point corresponding to the first vertex of the facet.
std::vector< std::vector< unsigned long > > get_all_triangles(bool inv_triangles)
Gets all the triangles of the triangulation.
void set_Ext(bool Ext)
Accessor.
Vb::template Rebind_TDS< TDS2 >::Other Vb2
unsigned long get_Label()
Accessor.
Enriched_face_base(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Face_handle n0, Face_handle n1, Face_handle n2)
std::vector< InterId > pts_point
List of the id of the points added in the triangulation.
Triangulation(Halfedge_handle &he, Vector_exact &norm_dir)
Constructor.
CGAL::No_intersection_tag Itag
No intersection tag.