Polygons with real coordinates. More...
#include <ogdf/basic/geometry.h>
Public Member Functions | |
DPolygon (bool cc=true) | |
Creates an empty polygon. | |
DPolygon (const DPolygon &dop) | |
Copy constructor. | |
DPolygon (const DRect &rect, bool cc=true) | |
Creates a polgon from a rectangle. | |
bool | containsPoint (DPoint &p) const |
Checks wether a Point /a p is inside the Poylgon or not. | |
bool | counterclock () |
Returns true iff points are given in counter-clockwise order. | |
int | getCrossPoints (const DPolygon &p, List< DPoint > &crossPoints) const |
Returns the list of intersection points of this polygon with p . | |
void | insertCrossPoint (const DPoint &p) |
Inserts point p on every segment (a,b) with p in the open range ]a, b[. | |
ListIterator< DPoint > | insertPoint (const DPoint &p) |
Inserts point p , that must lie on a polygon segment. | |
ListIterator< DPoint > | insertPoint (const DPoint &p, ListIterator< DPoint > p1, ListIterator< DPoint > p2) |
Inserts point p , but just searching from point p1 to p2 . | |
void | normalize () |
Deletes all points, which are not facets. | |
DPolygon & | operator= (const DPolygon &dop) |
Assignment operator. | |
DPolygon & | operator= (const DRect &rect) |
Assignment operator (for assigning from a rectangle). | |
DSegment | segment (ListConstIterator< DPoint > it) const |
Returns the line segment that starts at position it . | |
void | unify () |
Deletes all consecutive points that are equal. | |
Public Member Functions inherited from ogdf::GenericPolyline< PointType > | |
GenericPolyline () | |
Creates an empty polyline. | |
GenericPolyline (const GenericPolyline< PointType > &pl) | |
Copy constructor. | |
GenericPolyline (const List< PointType > &pl) | |
Creates a polyline using the list of points pl . | |
double | length () const |
Returns the Euclidean length of the polyline. | |
void | normalize (double minAngle=Math::pi) |
Deletes all redundant points on the polyline that lie on a (nearly) straight line given by their adjacent points. | |
void | normalize (PointType src, PointType tgt, double minAngle=Math::pi) |
Deletes all redundant points on the polyline that lie on a (nearly) straight line given by their adjacent points. | |
GenericPolyline< PointType > & | operator= (const GenericPolyline &pl) |
Assignment operator. | |
DPoint | position (const double fraction, double len=-1.0) const |
Returns a point on the polyline which is fraction * len away from the start point. | |
void | unify () |
Deletes all successive points with equal coordinates. | |
Public Member Functions inherited from ogdf::List< PointType > | |
List () | |
Constructs an empty doubly linked list. | |
List (const List< PointType > &L) | |
Constructs a doubly linked list that is a copy of L . | |
List (List< PointType > &&L) | |
Constructs a doubly linked list containing the elements of L (move semantics). | |
List (std::initializer_list< PointType > init) | |
Constructs a doubly linked list containing the elements in init . | |
int | size () const |
Returns the number of elements in the list. | |
const ListPure< PointType > & | getListPure () const |
Conversion to const ListPure. | |
List< PointType > & | operator= (const List< PointType > &L) |
Assignment operator. | |
List< PointType > & | operator= (List< PointType > &&L) |
Assignment operator (move semantics). | |
bool | operator== (const List< PointType > &L) const |
Equality operator. | |
bool | operator!= (const List< PointType > &L) const |
Inequality operator. | |
iterator | pushFront (const PointType &x) |
Adds element x at the beginning of the list. | |
iterator | emplaceFront (Args &&... args) |
Adds a new element at the beginning of the list. | |
iterator | pushBack (const PointType &x) |
Adds element x at the end of the list. | |
iterator | emplaceBack (Args &&... args) |
Adds a new element at the end of the list. | |
iterator | insert (const PointType &x, iterator it, Direction dir=Direction::after) |
Inserts element x before or after it . | |
iterator | insertBefore (const PointType &x, iterator it) |
Inserts element x before it . | |
iterator | insertAfter (const PointType &x, iterator it) |
Inserts element x after it . | |
void | popFront () |
Removes the first element from the list. | |
PointType | popFrontRet () |
Removes the first element from the list and returns it. | |
void | popBack () |
Removes the last element from the list. | |
PointType | popBackRet () |
Removes the last element from the list and returns it. | |
void | del (iterator it) |
Removes it from the list. | |
bool | removeFirst (const PointType &x) |
Removes the first occurrence of x (if any) from the list. | |
void | clear () |
Removes all elements from the list. | |
void | moveToFront (iterator it, List< PointType > &L2) |
Moves it to the begin of the list. | |
void | moveToBack (iterator it, List< PointType > &L2) |
Moves it to the end of the list. | |
void | moveToSucc (iterator it, List< PointType > &L2, iterator itBefore) |
Moves it after itBefore . | |
void | moveToPrec (iterator it, List< PointType > &L2, iterator itAfter) |
Moves it before itAfter . | |
void | conc (List< PointType > &L2) |
Appends L2 to this list and makes L2 empty. | |
void | concFront (List< PointType > &L2) |
Prepends L2 to this list and makes L2 empty. | |
void | swap (List< PointType > &other) |
Exchanges the contents of this list and other in constant time. | |
void | split (iterator it, List< PointType > &L1, List< PointType > &L2, Direction dir=Direction::before) |
Splits the list at element it into lists L1 and L2 . | |
Protected Attributes | |
bool | m_counterclock |
If true points are given in conter-clockwise order. | |
Additional Inherited Members | |
Protected Member Functions inherited from ogdf::GenericPolyline< PointType > | |
void | normalizeUnified (double minAngle) |
Deletes all redundant points on the polyline that lie on a (nearly) straight line given by their adjacent points. | |
Polygons with real coordinates.
Definition at line 981 of file geometry.h.
Creates an empty polygon.
cc | determines in which order the points will be given; true means counter-clockwise, false means clockwise. |
Definition at line 992 of file geometry.h.
Creates a polgon from a rectangle.
Definition at line 995 of file geometry.h.
Copy constructor.
Definition at line 998 of file geometry.h.
Checks wether a Point /a p is inside the Poylgon or not.
|
inline |
Returns true iff points are given in counter-clockwise order.
Definition at line 1001 of file geometry.h.
Returns the list of intersection points of this polygon with p
.
Inserts point p on every segment (a,b) with p
in the open range ]a, b[.
|
inline |
Inserts point p
, that must lie on a polygon segment.
Definition at line 1017 of file geometry.h.
ListIterator< DPoint > ogdf::DPolygon::insertPoint | ( | const DPoint & | p, |
ListIterator< DPoint > | p1, | ||
ListIterator< DPoint > | p2 | ||
) |
Inserts point p
, but just searching from point p1
to p2
.
That is, from the segment starting at p1
to the segment ending at p2
.
void ogdf::DPolygon::normalize | ( | ) |
Deletes all points, which are not facets.
Assignment operator.
Definition at line 1004 of file geometry.h.
Assignment operator (for assigning from a rectangle).
DSegment ogdf::DPolygon::segment | ( | ListConstIterator< DPoint > | it | ) | const |
Returns the line segment that starts at position it
.
void ogdf::DPolygon::unify | ( | ) |
Deletes all consecutive points that are equal.
|
protected |
If true points are given in conter-clockwise order.
Definition at line 983 of file geometry.h.