10 #ifndef TYMPAN__CGAL_TOOLS_HPP__INCLUDED
11 #define TYMPAN__CGAL_TOOLS_HPP__INCLUDED
13 #include <boost/array.hpp>
14 #include <boost/foreach.hpp>
15 #include <boost/range.hpp>
16 #include <boost/range/iterator_range.hpp>
23 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
24 #include <CGAL/Triangulation_face_base_with_info_2.h>
25 #include <CGAL/Triangulation_vertex_base_with_info_2.h>
26 #include <CGAL/Constrained_Delaunay_triangulation_2.h>
27 #include <CGAL/Constrained_triangulation_plus_2.h>
28 #include <CGAL/Polygon_2.h>
29 #include <CGAL/Polygon_2_algorithms.h>
30 #include <CGAL/centroid.h>
31 #include <CGAL/box_intersection_d.h>
32 #include <CGAL/intersections.h>
42 typedef CGAL::Exact_predicates_inexact_constructions_kernel
CGAL_K;
52 typedef CGAL::Box_intersection_d::Box_with_handle_d<double, 3, CGAL_Triangles::iterator>
CGAL_TBox;
58 return OPoint3D(cp.x(), cp.y(), cp.z());
108 std::deque<CGAL_Point3> query_triangle,
float l,
float w,
float h);
136 typedef CGAL::Triangulation_vertex_base_with_info_2<VertexInfo, CGAL_Gt>
Vbb;
137 typedef CGAL::Triangulation_face_base_with_info_2<FaceInfo, CGAL_Gt>
Fbb;
138 typedef CGAL::Constrained_triangulation_face_base_2<CGAL_Gt, Fbb>
Fb;
139 typedef CGAL::Triangulation_data_structure_2<Vbb, Fb>
TDS;
140 typedef CGAL::Exact_predicates_tag
Itag;
141 typedef CGAL::Constrained_Delaunay_triangulation_2<CGAL_Gt, TDS, Itag>
CDT;
All base classes related to 3D manipulation.
double _y
y coordinate of OCoord3D
double _z
z coordinate of OCoord3D
double _x
x coordinate of OCoord3D
Plan defined by its equation : ax+by+cz+d=0.
This class provides triangulating simple polygons without holes.
PolygonTriangulator(const CGAL_Polygon &poly_)
Constructor from a CGAL_Polygon.
CGAL::Triangulation_vertex_base_with_info_2< VertexInfo, CGAL_Gt > Vbb
const CDT & triangulation() const
Return CDT object.
const Vertex_handle & vertex_handle(unsigned i) const
Return the ith vertex handle.
const Vertex_handles_container & vertex_handles() const
Return the polygon vertex handles.
virtual ~PolygonTriangulator()
Destructor.
CGAL::Triangulation_face_base_with_info_2< FaceInfo, CGAL_Gt > Fbb
std::deque< CDT::Vertex_handle > Vertex_handles_container
const CGAL_Polygon & poly
Reference to the CGAL_Polygon to triangulate.
CGAL::Constrained_triangulation_face_base_2< CGAL_Gt, Fbb > Fb
CGAL::Triangulation_data_structure_2< Vbb, Fb > TDS
CDT::Face_handle Face_handle
CGAL::Constrained_Delaunay_triangulation_2< CGAL_Gt, TDS, Itag > CDT
CDT::Vertex_handle Vertex_handle
boost::array< unsigned, 3 > Tri_indices
CGAL::Exact_predicates_tag Itag
void exportTrianglesIndices(std::deque< Tri_indices > &triangles) const
Exports the triangles inside the polygon.
void exportTriangles(std::deque< CDT::Triangle > &triangles) const
Exports the triangles inside the polygon.
Vertex_handles_container poly_vh
Polygon vertex handles.
CGAL_Vector3 normalize(CGAL_Vector3 v)
normalize vector v
CGAL::Exact_predicates_inexact_constructions_kernel CGAL_K
CGAL::Triangle_3< CGAL_Gt > CGAL_Triangle
CGAL_Plane to_cgal(const OPlan &oplan)
Convert a OPlan to CGAL_Plane.
CGAL::Vector_2< CGAL_Gt > CGAL_Vector2
CGAL::Point_3< CGAL_Gt > CGAL_Point3
CGAL::Vector_3< CGAL_Gt > CGAL_Vector3
OPoint3D from_cgal(const CGAL_Point3 &cp)
Convert a CGAL_Point3 to OPoint3D.
CGAL::Point_2< CGAL_Gt > CGAL_Point2
CGAL::Box_intersection_d::Box_with_handle_d< double, 3, CGAL_Triangles::iterator > CGAL_TBox
std::deque< CGAL_Triangle > CGAL_Triangles
std::deque< CGAL_Point3 > build_box(float w, float h, CGAL_Point3 pta, CGAL_Point3 ptb)
return 4 points defining a 3D parallelepiped
CGAL::Aff_transformation_3< CGAL_Gt > CGAL_Transform3
CGAL::Plane_3< CGAL_Gt > CGAL_Plane
CGAL::Polygon_2< CGAL_Gt > CGAL_Polygon
std::deque< size_t > intersected_triangles(CGAL_Triangles &triangle_soup, std::deque< CGAL_Point3 > query_box, float length, float width, float height)
Find the triangles from triangle_soup that are intersected by the 3D box including the points of quer...
int i
This is the index of the vertice within the initial polygon.
VertexInfo(int i_=-1)
Constructor.