1 #ifndef MEDIAL_AXIS_2D_H_
2 #define MEDIAL_AXIS_2D_H_
8 #include <unordered_map>
10 #include <CGAL/Simple_cartesian.h>
11 #include <CGAL/Segment_Delaunay_graph_filtered_traits_2.h>
12 #include <CGAL/Segment_Delaunay_graph_2.h>
13 #include <CGAL/Triangulation_2.h>
14 #include <containers/sequential/graph/graph.h>
15 #include <containers/sequential/graph/algorithms/graph_algo_util.h>
16 #include <boost/functional/hash.hpp>
39 typedef CGAL::Simple_cartesian<double>
CK;
40 typedef CGAL::Segment_Delaunay_graph_filtered_traits_2<
CK,
41 CGAL::Field_with_sqrt_tag>
Gt;
42 typedef CGAL::Segment_Delaunay_graph_2<Gt>
SDG2;
43 typedef typename SDG2::Site_2
Site2;
44 typedef typename SDG2::Point_2
Point2;
45 typedef typename SDG2::Edge
Edge2;
46 typedef typename SDG2::Data_structure
DS;
53 typedef unordered_map<WorkspaceSkeleton::VD, ClearanceType>
70 void InterpolateSegment(
double _step);
81 typedef stapl::sequential::graph<stapl::UNDIRECTED,stapl::MULTIEDGES,
90 bool OnLine(
const Point2& _p);
104 boost::hash_combine(seed,_ed.id());
105 boost::hash_combine(seed,boost::hash_value(make_pair(_ed.source(),
112 typedef unordered_map<WorkspaceSkeleton::ED,vector<ClearanceType>,
120 vector<Boundary*> _bndrys=vector<Boundary*>());
128 void AddSegments(vector<pair<Point3d,Point3d>>& _s);
133 void AddSegments(vector<Point3d>& _p, vector<pair<size_t,size_t>>& _s);
137 void AddPoints(vector<Point3d>& _p);
140 void BuildMedialAxis();
149 tuple<WorkspaceSkeleton,VertexClearanceMapType,EdgeClearanceMapType>
150 GetSkeleton(
size_t _t=0);
153 vector<ClearanceType> AnnotateSegment(MedialEdge& _e);
155 double GetVertexClearance(
size_t _i);
156 Point3d GetVertexClearanceWitness(
size_t _i);
166 vector<pair<Point3d,Point3d>>& _s,
Boundary* _b =
nullptr);
169 bool IsSkeletonEdge(Edge2& _e);
172 bool IsMedialAxisEdge(Edge2& _e,
bool k=
false);
174 bool IsReflexBisector(
const Point2& _p1,
const Point2& _p2,
175 Site2& _s1, Site2& _s2);
178 ClearanceType GetMinDistance(
const Point2& _p, Site2& _s1, Site2& _s2);
181 ClearanceType DistanceToSite(
const Point2& _p, Site2& _s);
184 double GetMinDistance(MedialEdge& _e);
187 double GetMaxDistance(MedialEdge& _e);
190 void CalculateClearance();
192 bool IsFree(
const Point2& _p);
194 bool IsOutside(
const Point2& _p);
197 void ValidateEdge(MedialEdge& _e);
202 Point2 MidPoint(Site2& _o, Site2& _p, Site2& _q, Point2& _fp);
209 MedialAxisGraph m_graph;
210 vector<PolygonSegments> m_polygons;
214 unordered_map<size_t, ClearanceType> m_vertexClearance;
217 Point3d m_boundary[2];
Definition: Boundary.h:30
Definition: GMSPolyhedron.h:42
Definition: SegmentTrees.h:25
Geometric skeleton of the workspace.
Definition: WorkspaceSkeleton.h:22
BaseType::EID ED
Definition: WorkspaceSkeleton.h:32