CGAL 5.1 - 2D Triangulation
Triangulation_2/constrained_hierarchy_plus.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_hierarchy_2.h>
#include <CGAL/Constrained_triangulation_plus_2.h>
#include <cassert>
#include <iostream>
typedef Triangulation::Point Point;
int
main( )
{
Triangulation cdt;
std::cout << "Inserting a grid 5 x 5 of constraints " << std::endl;
for (int i = 1; i < 6; ++i)
cdt.insert_constraint( Point(0,i), Point(6,i));
for (int j = 1; j < 6; ++j)
cdt.insert_constraint( Point(j,0), Point(j,6));
int count = 0;
for (Triangulation::Subconstraint_iterator scit = cdt.subconstraints_begin();
scit != cdt.subconstraints_end();
++scit) ++count;
std::cout << "The number of resulting constrained edges is ";
std::cout << count << std::endl;
//verbose mode of is_valid ; shows the number of vertices at each level
std::cout << "The number of vertices at successive levels" << std::endl;
assert(cdt.is_valid(true));
return 0;
}
CGAL::Triangulation_hierarchy_vertex_base_2
Definition: Triangulation_hierarchy_2.h:100
CGAL::Constrained_triangulation_face_base_2
Definition: Constrained_triangulation_face_base_2.h:34
CGAL::Exact_predicates_inexact_constructions_kernel
CGAL::Triangulation_vertex_base_2
Definition: Triangulation_vertex_base_2.h:34
CGAL::Constrained_triangulation_plus_2::insert_constraint
Constraint_id insert_constraint(Point a, Point b)
inserts the constraint segment ab in the triangulation.
CGAL::Triangulation_hierarchy_2
Definition: Triangulation_hierarchy_2.h:62
CGAL::Triangulation_data_structure_2
CGAL::Exact_predicates_tag
Definition: Constrained_triangulation_2.h:51
CGAL::Constrained_Delaunay_triangulation_2
Definition: Constrained_Delaunay_triangulation_2.h:96
CGAL::Constrained_triangulation_plus_2
Definition: Constrained_triangulation_plus_2.h:48