CGAL 6.1.1 - 2D Triangulations

Loading...
Searching...
No Matches
Triangulation_2/colored_face.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/IO/Color.h>
#include <CGAL/Triangulation_2.h>
#include <CGAL/Triangulation_face_base_with_info_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_vertex_base_2<K> Vb;
typedef CGAL::Triangulation_face_base_with_info_2<CGAL::IO::Color,K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds;
typedef CGAL::Triangulation_2<K,Tds> Triangulation;
typedef Triangulation::Face_handle Face_handle;
typedef Triangulation::Point Point;
int main() {
Triangulation t;
t.insert(Point(0,1));
t.insert(Point(0,0));
t.insert(Point(2,0));
t.insert(Point(2,2));
for(Face_handle f : t.finite_face_handles())
f->info() = CGAL::IO::blue();
Point p(0.5,0.5);
Face_handle fh = t.locate(p);
fh->info() = CGAL::IO::red();
return 0;
}
CGAL::Exact_predicates_inexact_constructions_kernel
CGAL::Triangulation_2
The class Triangulation_2 is the basic class designed to handle triangulations of set of points in t...
Definition: Triangulation_2.h:170
CGAL::Triangulation_2::insert
Vertex_handle insert(const Point &p, Face_handle f=Face_handle())
Inserts point p in the triangulation and returns the corresponding vertex.
CGAL::Triangulation_data_structure_2
CGAL::Triangulation_face_base_with_info_2
The class Triangulation_face_base_with_info_2 is a model of the concept TriangulationFaceBase_2 to be...
Definition: Triangulation_face_base_with_info_2.h:34
CGAL::Triangulation_vertex_base_2
The class Triangulation_vertex_base_2 is the default model for the concept TriangulationVertexBase_2.
Definition: Triangulation_vertex_base_2.h:34