Open
Graph Drawing
Framework

 v.2010.10
 

Public Member Functions | Protected Attributes

ogdf::DPolygon Class Reference

Polygons with real coordinates. More...

#include <ogdf/basic/geometry.h>

Inheritance diagram for ogdf::DPolygon:
ogdf::DPolyline ogdf::List< DPoint > ogdf::ListPure< DPoint >

List of all members.

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.
DPolygonoperator= (const DPolygon &dop)
 Assignment operator.
DPolygonoperator= (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< DPointinsertPoint (const DPoint &p)
 Inserts point p, that must lie on a polygon segment.
ListIterator< DPointinsertPoint (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.

Detailed Description

Polygons with real coordinates.

Definition at line 708 of file geometry.h.


Constructor & Destructor Documentation

ogdf::DPolygon::DPolygon ( bool  cc = true  )  [inline]

Creates an empty polygon.

Parameters:
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.


Member Function Documentation

bool ogdf::DPolygon::containsPoint ( DPoint p  )  const

Checks wether a Point /a p is inside the Poylgon or not.

Note:
Polygons with crossings have inner areas that count as outside!
p the Point to check.
return true if Point is inside.
bool ogdf::DPolygon::counterclock (  )  [inline]

Returns true iff points are given in counter-clockwise order.

Definition at line 732 of file geometry.h.

int ogdf::DPolygon::getCrossPoints ( const DPolygon p,
List< DPoint > &  crossPoints 
) const

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.

DPolygon& ogdf::DPolygon::operator= ( const DPolygon dop  )  [inline]

Assignment operator.

Definition at line 735 of file geometry.h.

DPolygon& ogdf::DPolygon::operator= ( const DRect rect  ) 

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.


Member Data Documentation

If true points are given in conter-clockwise order.

Definition at line 712 of file geometry.h.


The documentation for this class was generated from the following file: