Polylines with real coordinates. More...
#include <ogdf/basic/geometry.h>
Inheritance diagram for ogdf::DPolyline:Public Member Functions | |
| DPolyline () | |
| Creates an empty integer polyline. | |
| DPolyline (const DPolyline &dpl) | |
| Copy constructor. | |
| void | convertToInt () |
| Converts all coordinates rounded to s_prec decimal digits. | |
| double | length () const |
| Returns the euclidean length of the polyline. | |
| void | normalize () |
| Deletes all redundant points on the polyline that lie on a straight line given by their adajcent points. | |
| void | normalize (DPoint src, DPoint tgt) |
| Deletes all redundant points on the polyline that lie on a straight line given by their adajcent points. | |
| DPolyline & | operator= (const DPolyline &dpl) |
| 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. | |
| void | writeGML (const char *filename) const |
| Writes the polyline as graph in gml-format to file filename. | |
| void | writeGML (ostream &stream) const |
| Writes the polyline as graph in gml-format to output stream stream. | |
Public Member Functions inherited from ogdf::List< DPoint > | |
| List () | |
| Constructs an empty doubly linked list. | |
| List (const List< DPoint > &L) | |
| Constructs a doubly linked list that is a copy of L. | |
| ~List () | |
| const DPoint & | back () const |
| Returns a reference to the last element. | |
| DPoint & | back () |
| Returns a reference to the last element. | |
| const ListConstIterator< DPoint > | begin () const |
| Returns an iterator to the first element of the list. | |
| ListIterator< DPoint > | begin () |
| Returns an iterator to the first element of the list. | |
| void | bucketSort (int l, int h, BucketFunc< DPoint > &f) |
| Sorts the list using bucket sort. | |
| const DPoint | chooseElement () const |
| Returns a random element from the list. | |
| DPoint | chooseElement () |
| Returns a random element from the list. | |
| ListConstIterator< DPoint > | chooseIterator () const |
| Returns an iterator to a random element in the list (or an invalid iterator if the list is empty) | |
| ListIterator< DPoint > | chooseIterator () |
| Returns an iterator to a random element in the list (or an invalid iterator if the list is empty) | |
| void | clear () |
| Removes all elements from the list. | |
| void | conc (List< DPoint > &L2) |
| Appends L2 to this list and makes L2 empty. | |
| void | concFront (List< DPoint > &L2) |
| Prepends L2 to this list and makes L2 empty. | |
| ListConstIterator< DPoint > | cyclicPred (ListConstIterator< DPoint > it) const |
| Returns an iterator to the cyclic predecessor of it. | |
| ListIterator< DPoint > | cyclicPred (ListIterator< DPoint > it) |
| Returns an iterator to the cyclic predecessor of it. | |
| ListConstIterator< DPoint > | cyclicSucc (ListConstIterator< DPoint > it) const |
| Returns an iterator to the cyclic successor of it. | |
| ListIterator< DPoint > | cyclicSucc (ListIterator< DPoint > it) |
| Returns an iterator to the cyclic successor of it. | |
| void | del (ListIterator< DPoint > it) |
| Removes it from the list. | |
| bool | empty () const |
| Returns true iff the list is empty. | |
| ListConstIterator< DPoint > | end () const |
| Returns an iterator to one-past-last element of the list. | |
| ListIterator< DPoint > | end () |
| Returns an iterator to one-past-last element of the list. | |
| void | exchange (ListIterator< DPoint > it1, ListIterator< DPoint > it2) |
| Exchanges the positions of it1 and it2 in the list. | |
| void | exchange (List< DPoint > &L2) |
| Exchanges too complete lists in O(1). | |
| const DPoint & | front () const |
| Returns a reference to the first element. | |
| DPoint & | front () |
| Returns a reference to the first element. | |
| ListConstIterator< DPoint > | get (int pos) const |
| Returns an iterator pointing to the element at position pos. | |
| ListIterator< DPoint > | get (int pos) |
| Returns an iterator pointing to the element at position pos. | |
| const ListPure< DPoint > & | getListPure () const |
| Conversion to const SListPure. | |
| ListIterator< DPoint > | insert (const DPoint &x, ListIterator< DPoint > it, Direction dir=after) |
| Inserts element x before or after it. | |
| ListIterator< DPoint > | insertAfter (const DPoint &x, ListIterator< DPoint > it) |
| Inserts element x after it. | |
| ListIterator< DPoint > | insertBefore (const DPoint &x, ListIterator< DPoint > it) |
| Inserts element x before it. | |
| void | moveToBack (ListIterator< DPoint > it) |
| Moves it to the end of the list. | |
| void | moveToBack (ListIterator< DPoint > it, List< DPoint > &L2) |
| Moves it to the end of L2. | |
| void | moveToFront (ListIterator< DPoint > it) |
| Moves it to the beginning of the list. | |
| void | moveToFront (ListIterator< DPoint > it, List< DPoint > &L2) |
| Moves it to the beginning of L2. | |
| void | moveToPrec (ListIterator< DPoint > it, ListIterator< DPoint > itAfter) |
| Moves it before itAfter. | |
| void | moveToPrec (ListIterator< DPoint > it, List< DPoint > &L2, ListIterator< DPoint > itAfter) |
| Moves it to list L2 and inserts it after itBefore. | |
| void | moveToSucc (ListIterator< DPoint > it, ListIterator< DPoint > itBefore) |
| Moves it after itBefore. | |
| void | moveToSucc (ListIterator< DPoint > it, List< DPoint > &L2, ListIterator< DPoint > itBefore) |
| Moves it to list L2 and inserts it after itBefore. | |
| bool | operator!= (const List< DPoint > &L) const |
| Inequality operator. | |
| List< DPoint > & | operator= (const List< DPoint > &L) |
| bool | operator== (const List< DPoint > &L) const |
| Equality operator. | |
| void | permute () |
| Randomly permutes the elements in the list. | |
| void | popBack () |
| Removes the last element from the list. | |
| DPoint | popBackRet () |
| Removes the last element from the list and returns it. | |
| void | popFront () |
| Removes the first element from the list. | |
| DPoint | popFrontRet () |
| Removes the first element from the list and returns it. | |
| int | pos (ListConstIterator< DPoint > it) const |
| Returns the position (starting with 0) of iterator it in the list. | |
| ListIterator< DPoint > | pushBack (const DPoint &x) |
| Adds element x at the end of the list. | |
| ListIterator< DPoint > | pushFront (const DPoint &x) |
| Adds element x at the begin of the list. | |
| void | quicksort () |
| Sorts the list using Quicksort. | |
| void | quicksort (const COMPARER &comp) |
| Sorts the list using Quicksort and comparer comp. | |
| const ListConstIterator< DPoint > | rbegin () const |
| Returns an iterator to the last element of the list. | |
| ListIterator< DPoint > | rbegin () |
| Returns an iterator to the last element of the list. | |
| ListConstIterator< DPoint > | rend () const |
| Returns an iterator to one-before-first element of the list. | |
| ListIterator< DPoint > | rend () |
| Returns an iterator to one-before-first element of the list. | |
| void | reverse () |
| Reverses the order of the list elements. | |
| int | search (const DPoint &e) const |
| Scans the list for the specified element and returns its position in the list, or -1 if not found. | |
| int | search (const DPoint &e, const COMPARER &comp) const |
| Scans the list for the specified element (using the user-defined comparer) and returns its position in the list, or -1 if not found. | |
| int | size () const |
| Returns the length of the list. | |
| void | split (ListIterator< DPoint > it, List< DPoint > &L1, List< DPoint > &L2, Direction dir=before) |
| Splits the list at element it into lists L1 and L2. | |
Static Private Attributes | |
| static const double | s_prec |
| The conversion-precision. | |
Additional Inherited Members | |
Public Types inherited from ogdf::List< DPoint > | |
| typedef ListConstIterator< DPoint > | const_iterator |
| typedef ListElement< DPoint > | element_type |
| typedef ListIterator< DPoint > | iterator |
| typedef DPoint | value_type |
Polylines with real coordinates.
This class represents real polylines by a list of real points. Such polylines are, e.g., used in layouts for representing bend point lists.
Definition at line 330 of file geometry.h.
|
inline |
Creates an empty integer polyline.
Definition at line 334 of file geometry.h.
|
inline |
Copy constructor.
Definition at line 337 of file geometry.h.
| void ogdf::DPolyline::convertToInt | ( | ) |
Converts all coordinates rounded to s_prec decimal digits.
| double ogdf::DPolyline::length | ( | ) | const |
Returns the euclidean length of the polyline.
| void ogdf::DPolyline::normalize | ( | ) |
Deletes all redundant points on the polyline that lie on a straight line given by their adajcent points.
Reimplemented in ogdf::DPolygon.
Deletes all redundant points on the polyline that lie on a straight line given by their adajcent points.
Assignment operator.
Definition at line 340 of file geometry.h.
| DPoint ogdf::DPolyline::position | ( | const double | fraction, |
| double | len = -1.0 |
||
| ) | const |
Returns a point on the polyline which is fraction * len away from the start point.
| fraction | defines the fraction of lento be considered. |
| len | is the given length, or the length of the polyline if len < 0. |
| void ogdf::DPolyline::unify | ( | ) |
Deletes all successive points with equal coordinates.
Reimplemented in ogdf::DPolygon.
| void ogdf::DPolyline::writeGML | ( | const char * | filename | ) | const |
Writes the polyline as graph in gml-format to file filename.
Reimplemented in ogdf::DPolygon.
| void ogdf::DPolyline::writeGML | ( | ostream & | stream | ) | const |
Writes the polyline as graph in gml-format to output stream stream.
Reimplemented in ogdf::DPolygon.
|
staticprivate |
The conversion-precision.
Definition at line 331 of file geometry.h.