#include <qgarlib/GenPointChain.H>
Inheritance diagram for qgar::GenPointChain< T >:

A point is an instance of class qgar::GenPoint<T>. New points can only be inserted to the beginning or to the end of the chain.
Such a chain is implemented by a STL list of points with an iterator that allows bidirectional traversal of the chain. The validity of the iterator is preserved by any legal operation on the chain, unless the chain is empty.
Warning: Such a chain cannot be used in the STL way. The beginning (resp. end) of the chain is the first (resp. last) point of the chain, that is returned by functions qgar::GenPointChain::accessFront and qgar::GenPointChain::front (resp. GenPointChain::back and qgar::GenPointChain::back). In other words, the iterator always points to a point in the chain (unless empty).
To use the chain in the Qgar way:
To use the chain in the STL way:
Predefined types:
Definition at line 116 of file GenPointChain.H.
Public Types | |
Types | |
| typedef T | value_type |
| Type of the coordinates of the points. | |
| typedef value_type & | reference |
| Reference to qgar::GenPointChain::value_type. | |
| typedef const value_type & | const_reference |
| Constant reference to qgar::GenPointChain::value_type. | |
| typedef value_type * | pointer |
| Pointer to qgar::GenPointChain::value_type. | |
| typedef const value_type * | const_pointer |
| Constant pointer to qgar::GenPointChain::value_type. | |
Public Member Functions | |
Constructors | |
| GenPointChain () | |
| Default constructor. | |
| GenPointChain (const GenPointChain< value_type > &aPtChain) | |
| Copy constructor. | |
| GenPointChain (const GenPoint< value_type > &aPoint) | |
| Construct from a given point, that becomes the current point. | |
Destructor | |
| virtual | ~GenPointChain () |
| Virtual destructor. | |
Access to chain characteristics | |
| virtual bool | empty () const |
| Is current chain empty? | |
| virtual int | size () const |
| Get chain size (number of points). | |
Iterator | |
| virtual void | setToBegin () |
| Make the internal iterator point to the beginning (first point) of the chain. | |
| virtual void | setToEnd () |
| Make the internal iterator point to the end (last point) of the chain. | |
| virtual bool | isAtBegin () const |
| Does internal iterator points to the beginning of the chain? | |
| virtual bool | isAtEnd () const |
| Does internal iterator points to the end of the chain? | |
| virtual bool | hasNext () const |
| Is there a point after the current point? | |
| virtual bool | hasPrevious () const |
| Is there a point before the current point? | |
| virtual void | moveNext () |
| Move to next point, that becomes the current point. | |
| virtual void | movePrevious () |
| Move to previous point, that becomes the current point. | |
Access to points | |
| virtual const GenPoint< value_type > & | accessFront () const |
| Get first point. | |
| virtual GenPoint< value_type > | front () const |
| Get a copy of first point. | |
| virtual const GenPoint< value_type > & | accessBack () const |
| Get last point. | |
| virtual GenPoint< value_type > | back () const |
| Get a copy of last point. | |
| virtual const GenPoint< value_type > & | accessCurrent () const |
| Get the current point. | |
| virtual GenPoint< value_type > | current () const |
| Get a copy of the current point. | |
| const GenPoint< value_type > & | accessNext () |
| Get the successor of the current point. | |
| virtual GenPoint< value_type > | next () |
| Get a copy of the successor of the current point. | |
| const GenPoint< value_type > & | accessPrevious () |
| Get the predecessor of the current point. | |
| virtual GenPoint< value_type > | previous () |
| Get a copy of the predecessor of the current point. | |
Access to the list of points | |
| const std::list< GenPoint< value_type > > & | accessPointList () const |
| Get the STL list implementing the chain of points. | |
| std::list< GenPoint< value_type > > & | pointList () |
| Get the STL list implementing the chain of points. | |
Insertion | |
| virtual void | push_front (const GenPoint< value_type > &aPt) |
| Insert a point at the beginning of the chain. | |
| virtual void | push_back (const GenPoint< value_type > &aPt) |
| Insert a point at the end of the chain. | |
Transformations | |
| virtual void | reverse () |
| Reverse the order of elements in the list. | |
Conversions | |
| virtual std::list< GenPoint< value_type > > | toPointList () const |
| Convert into a (STL) list of points. | |
Operators | |
| GenPointChain< value_type > & | operator= (const GenPointChain< value_type > &aPtChain) |
| Assignment. | |
Protected Attributes | |
Implementation of a chain of points | |
| std::list< GenPoint< value_type > > | _chain |
| List of the points. | |
| std::list< GenPoint< value_type > >::iterator | _iter |
| Iterator on the list of points. | |
|
|||||
|
Constant pointer to qgar::GenPointChain::value_type.
Reimplemented from qgar::AbstractGenPointChain< T >. Definition at line 153 of file GenPointChain.H. |
|
|||||
|
Constant reference to qgar::GenPointChain::value_type.
Reimplemented from qgar::AbstractGenPointChain< T >. Definition at line 143 of file GenPointChain.H. |
|
|||||
|
Pointer to qgar::GenPointChain::value_type.
Reimplemented from qgar::AbstractGenPointChain< T >. Definition at line 148 of file GenPointChain.H. |
|
|||||
|
Reference to qgar::GenPointChain::value_type.
Reimplemented from qgar::AbstractGenPointChain< T >. Definition at line 138 of file GenPointChain.H. |
|
|||||
|
Type of the coordinates of the points.
Reimplemented from qgar::AbstractGenPointChain< T >. Definition at line 133 of file GenPointChain.H. |
|
|||||||||
|
Default constructor. The STL list of points is empty and the value of the iterator is undefined. Definition at line 58 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain, and qgar::GenPointChain< T >::_iter. |
|
||||||||||
|
Copy constructor.
Definition at line 68 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain, and qgar::GenPointChain< T >::_iter. |
|
||||||||||
|
Construct from a given point, that becomes the current point. The internal iterator points to the beginning of the chain.
|
|
|||||||||
|
Virtual destructor.
Definition at line 98 of file GenPointChain.TCC. |
|
|||||||||
|
Get last point.
Implements qgar::AbstractGenPointChain< T >. Definition at line 239 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain. |
|
|||||||||
|
Get the current point.
Implements qgar::AbstractGenPointChain< T >. Definition at line 257 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Get first point.
Implements qgar::AbstractGenPointChain< T >. Definition at line 221 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain. |
|
|||||||||
|
Get the successor of the current point.
Implements qgar::AbstractGenPointChain< T >. Definition at line 276 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Get the STL list implementing the chain of points. The function returns a const result, so that the user cannot directly transform the list. Definition at line 323 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain. |
|
|||||||||
|
Get the predecessor of the current point.
Implements qgar::AbstractGenPointChain< T >. Definition at line 297 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Get a copy of last point.
Implements qgar::AbstractGenPointChain< T >. Definition at line 247 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain. Referenced by qgar::LINKEDCHAINLIST_canMerge(), and qgar::LINKEDCHAINLIST_mergeChains(). |
|
|||||||||
|
Get a copy of the current point.
Implements qgar::AbstractGenPointChain< T >. Definition at line 266 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Is current chain empty?
Implements qgar::AbstractGenPointChain< T >. Definition at line 113 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain. |
|
|||||||||
|
Get a copy of first point.
Implements qgar::AbstractGenPointChain< T >. Definition at line 230 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain. Referenced by qgar::LINKEDCHAINLIST_canMerge(), and qgar::LINKEDCHAINLIST_mergeChains(). |
|
|||||||||
|
Is there a point after the current point?
Implements qgar::AbstractGenPointChain< T >. Definition at line 157 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain, and qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Is there a point before the current point?
Implements qgar::AbstractGenPointChain< T >. Definition at line 168 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain, and qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Does internal iterator points to the beginning of the chain?
Implements qgar::AbstractGenPointChain< T >. Definition at line 178 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain, and qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Does internal iterator points to the end of the chain?
Implements qgar::AbstractGenPointChain< T >. Definition at line 188 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain, and qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Move to next point, that becomes the current point.
Implements qgar::AbstractGenPointChain< T >. Definition at line 197 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Move to previous point, that becomes the current point.
Implements qgar::AbstractGenPointChain< T >. Definition at line 206 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Get a copy of the successor of the current point.
Implements qgar::AbstractGenPointChain< T >. Definition at line 286 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_iter. |
|
||||||||||
|
Assignment.
Definition at line 401 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain, and qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Get the STL list implementing the chain of points.
Definition at line 334 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain. Referenced by qgar::LINKEDCHAINLIST_mergeChains(). |
|
|||||||||
|
Get a copy of the predecessor of the current point.
Implements qgar::AbstractGenPointChain< T >. Definition at line 307 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_iter. |
|
||||||||||
|
Insert a point at the end of the chain. The internal iterator remains valid after the operation.
Implements qgar::AbstractGenPointChain< T >. Referenced by qgar::LinkedChainList::aChain(), qgar::LinkedChainList::LinkedChainList(), and qgar::DxfFile::retrievePChain(). |
|
||||||||||
|
Insert a point at the beginning of the chain. The internal iterator remains valid after the operation.
Implements qgar::AbstractGenPointChain< T >. |
|
|||||||||
|
Reverse the order of elements in the list.
Implements qgar::AbstractGenPointChain< T >. Definition at line 371 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain. Referenced by qgar::LINKEDCHAINLIST_mergeChains(). |
|
|||||||||
|
Make the internal iterator point to the beginning (first point) of the chain.
Implements qgar::AbstractGenPointChain< T >. Definition at line 137 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain, and qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Make the internal iterator point to the end (last point) of the chain.
Implements qgar::AbstractGenPointChain< T >. Definition at line 146 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain, and qgar::GenPointChain< T >::_iter. |
|
|||||||||
|
Get chain size (number of points).
Implements qgar::AbstractGenPointChain< T >. Definition at line 123 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain. Referenced by qgar::LinkedChainList::aChain(), qgar::LinkedChainList::LinkedChainList(), and qgar::LINKEDCHAINLIST_tooSmall(). |
|
|||||||||
|
Convert into a (STL) list of points.
Implements qgar::AbstractGenPointChain< T >. Definition at line 386 of file GenPointChain.TCC. References qgar::GenPointChain< T >::_chain. |
|
|||||
|
|||||