13 #ifndef MULTI_POLYGON_SHAPE_H 14 #define MULTI_POLYGON_SHAPE_H 16 #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING 19 #include <boost/geometry.hpp> 20 #include <boost/geometry/geometries/point_xy.hpp> 21 #include <boost/geometry/geometries/polygon.hpp> 22 #include <boost/geometry/geometries/adapted/boost_tuple.hpp> 23 #include <boost/geometry/strategies/transform.hpp> 24 #include <boost/geometry/strategies/transform/matrix_transformers.hpp> 26 #include "base_data_package.h" 33 BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)
45 typedef model::polygon<model::d2::point_xy<Real>> boost_poly;
46 typedef model::multi_polygon<boost_poly> boost_multi_poly;
57 explicit MultiPolygon(
const Vec2d ¢er, Real radius,
int resolution);
58 boost_multi_poly &getBoostMultiPoly() {
return multi_poly_; };
61 bool checkContain(
const Vec2d &pnt,
bool BOUNDARY_INCLUDED =
true);
62 Vec2d findClosestPoint(
const Vec2d &input_pnt);
65 void addABoostMultiPoly(boost_multi_poly &boost_multi_poly,
ShapeBooleanOps op);
68 void addACircle(
const Vec2d ¢er, Real radius,
int resolution,
ShapeBooleanOps op);
69 void addAPolygonFromFile(std::string file_path_name,
ShapeBooleanOps op, Vec2d translation = Vecd(0), Real scale_factor = 1.0);
72 boost_multi_poly multi_poly_;
73 boost_multi_poly MultiPolygonByBooleanOps(boost_multi_poly multi_poly_in,
74 boost_multi_poly multi_poly_op,
89 :
Shape(shape_name), multi_polygon_(multi_polygon){};
90 virtual ~MultiPolygonShape(){};
92 virtual bool isValid()
override;
93 virtual bool checkContain(
const Vec2d &input_pnt,
bool BOUNDARY_INCLUDED =
true)
override;
94 virtual Vec2d findClosestPoint(
const Vec2d &input_pnt)
override;
97 MultiPolygon multi_polygon_;
99 virtual BoundingBox findBounds()
override;
103 #endif //MULTI_POLYGON_SHAPE_H MultiPolygonShape(const std::string &shape_name)
Definition: multi_polygon_shape.h:87
Base class for all volumetric geometries Note that checkContain and findClosest point are basic funct...
Definition: base_geometry.h:64
used to define a closed region
Definition: multi_polygon_shape.h:52
Shape is the base class for all geometries.
A shape whose geometry is defined by a multi polygon.
Definition: multi_polygon_shape.h:82
Boolean operation for generate complex shapes.
Definition: solid_body_supplementary.cpp:9