Polygons with real coordinates. More...
#include <ogdf/basic/geometry.h>
Public Member Functions | |
| DPolygon (bool cc=true) | |
| Creates an empty polygon. | |
| DPolygon (const DRect &rect, bool cc=true) | |
| Creates a polgon from a rectangle. | |
| DPolygon (const DPolygon &dop) | |
| Copy constructor. | |
| bool | counterclock () |
| Returns true iff points are given in counter-clockwise order. | |
| 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. | |
| 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 | insertCrossPoint (const DPoint &p) |
| Inserts point p on every segment (a,b) with p in the open range ]a, b[. | |
| int | getCrossPoints (const DPolygon &p, List< DPoint > &crossPoints) const |
| Returns the list of intersection points of this polygon with p. | |
| void | unify () |
| Deletes all consecutive points that are equal. | |
| void | normalize () |
| Deletes all points, which are not facets. | |
| void | writeGML (const char *filename) const |
| Writes the polygon as graph in gml-format to file filename. | |
| void | writeGML (ostream &stream) const |
| Writes the polygon as graph in gml-format to output stream stream. | |
| bool | containsPoint (DPoint &p) const |
| Checks wether a Point /a p is inside the Poylgon or not. | |
Protected Attributes | |
| bool | m_counterclock |
| If true points are given in conter-clockwise order. | |
Polygons with real coordinates.
Definition at line 708 of file geometry.h.
| ogdf::DPolygon::DPolygon | ( | bool | cc = true |
) | [inline] |
Creates an empty polygon.
| cc | determines in which order the points will be given; true means counter-clockwise, false means clockwise. |
Definition at line 721 of file geometry.h.
| ogdf::DPolygon::DPolygon | ( | const DRect & | rect, | |
| bool | cc = true | |||
| ) | [inline] |
Creates a polgon from a rectangle.
Definition at line 724 of file geometry.h.
| ogdf::DPolygon::DPolygon | ( | const DPolygon & | dop | ) | [inline] |
Copy constructor.
Definition at line 729 of file geometry.h.
| bool ogdf::DPolygon::containsPoint | ( | DPoint & | p | ) | const |
Checks wether a Point /a p is inside the Poylgon or not.
| bool ogdf::DPolygon::counterclock | ( | ) | [inline] |
Returns true iff points are given in counter-clockwise order.
Definition at line 732 of file geometry.h.
Returns the list of intersection points of this polygon with p.
| void ogdf::DPolygon::insertCrossPoint | ( | const DPoint & | p | ) |
Inserts point p on every segment (a,b) with p in the open range ]a, b[.
| ListIterator<DPoint> ogdf::DPolygon::insertPoint | ( | const DPoint & | p | ) | [inline] |
Inserts point p, that must lie on a polygon segment.
Definition at line 749 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.
Reimplemented from ogdf::DPolyline.
Assignment operator.
Definition at line 735 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.
Reimplemented from ogdf::DPolyline.
| void ogdf::DPolygon::writeGML | ( | const char * | filename | ) | const |
Writes the polygon as graph in gml-format to file filename.
Reimplemented from ogdf::DPolyline.
| void ogdf::DPolygon::writeGML | ( | ostream & | stream | ) | const |
Writes the polygon as graph in gml-format to output stream stream.
Reimplemented from ogdf::DPolyline.
bool ogdf::DPolygon::m_counterclock [protected] |
If true points are given in conter-clockwise order.
Definition at line 712 of file geometry.h.