1 #ifndef TRIANGULATION_H 2 #define TRIANGULATION_H 10 # define CGAL_HEADER_ONLY 1 11 # define CGAL_NO_GMP 1 13 #include <CGAL/Triangulation_data_structure_2.h> 15 namespace frechet {
namespace poly {
39 template <
class TDS=DummyTDS>
42 public CGAL::Triangulation_ds_vertex_base_2<TDS>
77 void setPoint(
const Point& p);
146 return QLineF(*prev,*
this);
193 typedef CGAL::Triangulation_data_structure_2<
195 CGAL::Triangulation_ds_face_base_2<> >
230 typedef std::pair<Face_handle,Face_handle>
FacePair;
260 bool is_outer_edge()
const;
262 bool is_polygon_edge()
const;
289 void setPolygonSize(
int n);
309 int countFaces()
const {
return (
int)tds.number_of_faces(); }
315 Vertex_handle operator[] (
int i);
320 const Vertex_handle operator[] (
int i)
const;
332 TDS::Vertex_iterator
vertices_end()
const {
return tds.vertices_end(); }
335 FacePair adjacentFaces(
Segment s)
const;
339 EdgePair adjacentEdges(Edge e)
const;
346 EdgePair adjacentEdges(Edge e,
int i1,
int i2)
const;
354 void mirror(Edge& e)
const;
359 void mirror(EdgePair& e2)
const;
367 Face_circulator incidentFaces(Vertex_handle v)
const;
374 Vertex_handle oppositeVertex(Edge e)
const;
381 int thirdVertex(
int a,
int b)
const;
389 Edge edge(
int i,
int j)
const;
394 VertexPair incidentVertexes(Edge e)
const;
443 void createFace(
int a,
int b,
int c);
453 bool isComplete()
const {
return neighbors.empty() && tds.is_valid(); }
463 static bool is_south_pole(Vertex_handle v);
468 static bool is_outer_face(Face_handle f);
473 static bool is_inner_face(Face_handle f) ;
478 static bool is_outer_edge(Edge e);
483 static bool is_polygon_edge(Edge e);
494 bool is_ccw_face(Face_handle f);
508 Vertex_handle insertVertexOnEdge(
double x);
514 void removeVertexFromEdge(
int index);
533 Vertex_handle addVertex(
double w);
542 void clearPredecessors();
560 void addVertex(Vertex_handle v,
double x,
Point p);
567 void linkNeighbors(
Segment s, Edge e);
575 static Vertex_handle third_vertex(Face_handle f, Vertex_handle v1, Vertex_handle v2);
582 Vertex_handle third_vertex(Face_handle f,
Segment s);
589 std::ostream&
operator<< (std::ostream& out,
const Triangulation& tri);
593 std::ostream&
operator<< (std::ostream& out,
const Triangulation::Edge_iterator& e);
608 Point::operator=(that);
609 this->pindex = that.
pindex;
610 this->dindex = that.
dindex;
611 this->offset = that.
offset;
613 this->prev = that.
prev;
614 this->target = that.
target;
628 this->pindex = pindex;
629 this->dindex = dindex;
630 this->offset = offset;
632 this->prev =
nullptr;
633 this->target =
nullptr;
647 #endif // TRIANGULATION_H TDS::Vertex_iterator vertices_end() const
Represents a polygon line segment from node i to j.
Dummy class acting as a default for template arguments (required by CGAL::Triangulation_data_structur...
NeighborMap neighbors
Keeps track of diagonals and their neighborhood during construction.
std::vector< frechet::reach::Placement > Placements
a list of Placement objects
std::pair< Vertex_handle, Vertex_handle > VertexPair
a pair of vertexes
std::map< Segment, TDS::Edge > NeighborMap
void setPoint(const Point &p)
assign a point in the plane
global definitions for all algorithms.
TDS::Vertex_iterator vertices_begin() const
TDS::Edge Edge
an edge of the triangulation either an edge of the polygon, or a diagonal, or an articial "outer" edg...
TDS::Face_handle Face_handle
handle to a triangulation face (handles are managed by TDS base class)
int dindex
Index of diagonal vertex (points into CurveData::d_points); invalid for other points.
Vertex_base & setData(const Vertex_base &that)
copy properties of derived class (anything but base class info)
int pindex
Index of polygon vertex (if this object refers to a polygon vertex; invalid for extra points)
std::pair< Edge_iterator, Edge_iterator > Edge_range
a range of edges
Interval LR
Reachable Free-Space intervals LR,BR,RR (usually part of an FSPath object)
Interval L
Free-Space intervals L,B,R (usually part of a FreeSpace object) L,B,R is calculated from [Guibas-star...
QPointF Point
a point in the plane; with double floating point precision. This type is heavily used throughout all ...
bool assertEquals(const mzd_t *M, const gpuword *G, int padded_rows)
const frechet::reach::Placement * target
base class for vertexes in a Triangulation Data Structure.
template re-bind to resolve cyclic dependcies
std::pair< Face_handle, Face_handle > FacePair
a pair of faces
std::pair< Edge, Edge > EdgePair
a pair of edges
Edge_iterator edges_end() const
int countVertexes() const
Edge_iterator edges_begin() const
std::pair< Vertex_handle, Vertex_handle > TwoVertices
a pair of vertex handles
placement of a diagonal point in free-space diagram When calculating valid placements in [buchin06]
TDS tds
CGAL Triangulation Data Structure.
CGAL::Triangulation_data_structure_2< Vertex_base<>, CGAL::Triangulation_ds_face_base_2<> > TDS
Triangulation Data Structure. Instantiates CGAL::Triangulation_data_structure_2 with our customized V...
void clearTarget()
reset target info (used by PolygonShortestPaths algorithm)
TDS::Face_circulator Face_circulator
a circulating iterator
TDS::Vertex_handle south_pole
a special vertex that completes the TDS structure
Vertex_base< TDS > Vertex
a vertex of the triangulation
Wrapper for CGAL::Triangulation_Data_Structure https://doc.cgal.org/latest/TDS_2/index....
TDS::Vertex_handle Vertex_handle
handle to a vertex (handles are managed by TDS base class)
static bool is_diagonal(int a, int b, int n)
an interval of two double values.
std::vector< TDS::Vertex_handle > VertexMap
Keeps track of Vertex handles.
Vertex_base< TDS2 > Other
edge iterator. Traverses all edges of the triangulation. Derives from TDS::Edge_iterator and supplies...
std::ostream & operator<<(std::ostream &out, const frechet::poly::CgalPolygon &poly)
print operator (for debugging)
int poly_n
polygon size, number of vertexes in polyong