18 #include <boost/foreach.hpp>
32 virtual void exportMesh(std::deque<OPoint3D>& points, std::deque<OTriangle>& triangles)
const;
42 assert(points.size() == 0 &&
"Output arguments 'points' is expected to be initially empty");
43 assert(triangles.size() == 0 &&
"Output arguments 'triangles' is expected to be initially empty");
49 std::deque<LPTYElement> elements;
51 elements.push_back(element);
65 poly2d.push_back(pp2d);
69 if (!poly2d.is_simple())
71 std::deque<LPTYElement> elements;
73 elements.push_back(element);
81 std::deque<PolygonTriangulator::Tri_indices> tri_indices;
83 BOOST_FOREACH (
const auto& tri_idx, tri_indices)
85 OTriangle tri(tri_idx[0], tri_idx[1], tri_idx[2]);
86 for (
unsigned i = 0; i < 3; ++i)
88 const OPoint3D& p = points[tri_idx[i]];
91 triangles.push_back(tri);
92 assert(triangles.back().checkConsistencyWrtPointsTab(points));
Bridges TY* types with CGAL functionalities exposed by.
OPoint3D & vertex(unsigned i)
Get the OPoint3D from the specific index.
const TYTabPoint & getPoints() const
bool checkCoplanar() const
virtual const OPlan & getPlan() const
This class provides triangulating simple polygons without holes.
void exportTrianglesIndices(std::deque< Tri_indices > &triangles) const
Exports the triangles inside the polygon.
virtual void exportMesh(std::deque< OPoint3D > &points, std::deque< OTriangle > &triangles) const
Export the surface as a triangular mesh.
TYPolygonTriangulator(const TYPolygon &poly_)
#define tympan_source_loc
This macro build a source_loc object to be attached to a tympan::Exception.
Define some exception related utilities relying on DataManagerMetier classes.
boost::error_info< struct tag_elements_implied, std::deque< LPTYElement > > elements_implied_errinfo
CGAL_Plane to_cgal(const OPlan &oplan)
Convert a OPlan to CGAL_Plane.
CGAL::Point_3< CGAL_Gt > CGAL_Point3
CGAL::Point_2< CGAL_Gt > CGAL_Point2
CGAL::Plane_3< CGAL_Gt > CGAL_Plane
CGAL::Polygon_2< CGAL_Gt > CGAL_Polygon
std::unique_ptr< ITYPolygonTriangulator > make_polygon_triangulator(const TYPolygon &poly)
The base exception class for errors due to invalid data.