Open
Graph Drawing
Framework

 v.2012.07
 

ogdf::DPolyline Class Reference

Polylines with real coordinates. More...

#include <ogdf/basic/geometry.h>

+ Inheritance diagram for ogdf::DPolyline:

List of all members.

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.
DPolylineoperator= (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 DPointback () const
 Returns a reference to the last element.
DPointback ()
 Returns a reference to the last element.
const ListConstIterator< DPointbegin () const
 Returns an iterator to the first element of the list.
ListIterator< DPointbegin ()
 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< DPointchooseIterator () const
 Returns an iterator to a random element in the list (or an invalid iterator if the list is empty)
ListIterator< DPointchooseIterator ()
 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< DPointcyclicPred (ListConstIterator< DPoint > it) const
 Returns an iterator to the cyclic predecessor of it.
ListIterator< DPointcyclicPred (ListIterator< DPoint > it)
 Returns an iterator to the cyclic predecessor of it.
ListConstIterator< DPointcyclicSucc (ListConstIterator< DPoint > it) const
 Returns an iterator to the cyclic successor of it.
ListIterator< DPointcyclicSucc (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< DPointend () const
 Returns an iterator to one-past-last element of the list.
ListIterator< DPointend ()
 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 DPointfront () const
 Returns a reference to the first element.
DPointfront ()
 Returns a reference to the first element.
ListConstIterator< DPointget (int pos) const
 Returns an iterator pointing to the element at position pos.
ListIterator< DPointget (int pos)
 Returns an iterator pointing to the element at position pos.
const ListPure< DPoint > & getListPure () const
 Conversion to const SListPure.
ListIterator< DPointinsert (const DPoint &x, ListIterator< DPoint > it, Direction dir=after)
 Inserts element x before or after it.
ListIterator< DPointinsertAfter (const DPoint &x, ListIterator< DPoint > it)
 Inserts element x after it.
ListIterator< DPointinsertBefore (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< DPointpushBack (const DPoint &x)
 Adds element x at the end of the list.
ListIterator< DPointpushFront (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< DPointrbegin () const
 Returns an iterator to the last element of the list.
ListIterator< DPointrbegin ()
 Returns an iterator to the last element of the list.
ListConstIterator< DPointrend () const
 Returns an iterator to one-before-first element of the list.
ListIterator< DPointrend ()
 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< DPointconst_iterator
typedef ListElement< DPointelement_type
typedef ListIterator< DPointiterator
typedef DPoint value_type

Detailed Description

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.


Constructor & Destructor Documentation

ogdf::DPolyline::DPolyline ( )
inline

Creates an empty integer polyline.

Definition at line 334 of file geometry.h.

ogdf::DPolyline::DPolyline ( const DPolyline dpl)
inline

Copy constructor.

Definition at line 337 of file geometry.h.


Member Function Documentation

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.

void ogdf::DPolyline::normalize ( DPoint  src,
DPoint  tgt 
)

Deletes all redundant points on the polyline that lie on a straight line given by their adajcent points.

DPolyline& ogdf::DPolyline::operator= ( const DPolyline dpl)
inline

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.

Parameters:
fractiondefines the fraction of lento be considered.
lenis 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.


Member Data Documentation

const double ogdf::DPolyline::s_prec
staticprivate

The conversion-precision.

Definition at line 331 of file geometry.h.


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