Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

qgar::GenPolyline< T > Class Template Reference
[Geometrical primitives]

#include <qgarlib/primitives.H>

Inheritance diagram for qgar::GenPolyline< T >:

qgar::AbstractGenPrimitive< T > qgar::ISerializable List of all members.

Detailed Description

template<class T>
class qgar::GenPolyline< T >

Geometrical polyline, with coordinates of type T.

Warning:
The coherence of the data structure of a polyline after modifications of its source and/or its target and/or its other vertices is the user's responsibility!
Author:
Gérald Masini
Date:
June 24, 2003 18:00
Since:
Qgar 2.1

Definition at line 141 of file _QGAR_GenPolyline.H.

Public Types

Types
typedef T value_type
 Type of the vertices coordinates.
typedef value_typereference
 Reference to qgar::GenPolyline::value_type.
typedef const value_typeconst_reference
 Constant reference to qgar::GenPolyline::value_type.
typedef value_typepointer
 Pointer to qgar::GenPolyline::value_type.
typedef const value_typeconst_pointer
 Constant pointer to qgar::GenPolyline::value_type.
typedef std::deque< GenPoint<
value_type > > 
vertices_type
 Type of the vertices container.
typedef vertices_typevertices_reference
 Reference to qgar::GenPolyline::vertices_type.
typedef const vertices_typevertices_const_reference
 Constant reference to qgar::GenPolyline::vertices_type.

Public Member Functions

Constructors
 GenPolyline ()
 Default constructor.
 GenPolyline (const GenPolyline< value_type > &aPoly)
 Copy constructor.
 GenPolyline (const GenQgarPolyline< value_type > &aQPoly)
 Initialize from a Qgar polyline.
 GenPolyline (const GenQgarSegment< value_type > &aQSeg)
 Initialize from a Qgar segment.
 GenPolyline (const GenSegment< value_type > &aSeg)
 Initialize from a (geometrical) segment.
 GenPolyline (const GenPoint< value_type > &aSource, const GenPoint< value_type > &aTarget)
 Initialize from two vertices: source and target.
 GenPolyline (const std::list< GenPoint< value_type > > &aPtList) throw (QgarErrorUser)
 Initialize from a list of at least two vertices.
Destructor
virtual ~GenPolyline ()
 Virtual destructor.
Copy
virtual GenPolyline< value_type > * clone () const
 Perform a deep copy.
Operators
GenPolyline< value_type > & operator= (const GenPolyline< value_type > &aPoly)
 Assignment.
Access to vertices
int size () const
 Get number of vertices.
vertices_const_reference accessVertices () const
 Get the vertices.
vertices_reference getVertices ()
 Give non-protected access to the vertices.
vertices_type vertices () const
 Get a copy of the vertices.
Insert vertices
GenPolyline< value_type > & appendSource (const GenPoint< value_type > &aPt)
 Insert a point as new source.
GenPolyline< value_type > & appendTarget (const GenPoint< value_type > &aPt)
 Insert a point as new target.
GenPolyline< value_type > & append (const GenPolyline< value_type > &aPoly)
 Appends a polyline.
GenPolyline< value_type > & append (const GenQgarPolyline< value_type > &aQPoly)
 Appends a Qgar polyline.
GenPolyline< value_type > & append (const std::vector< GenPoint< value_type > > &aPtVect)
 Appends a set of vertices to a polyline.
Remove vertices
GenPolyline< value_type > & remove (const GenPoint< value_type > &aPt) throw (QgarErrorUser)
 Remove a vertex from the polyline.
Conversions of the vertices
std::vector< GenPoint< value_type > > toPointVector ()
 Get a vector of points from the vertices.
std::list< GenSegment< value_type > > toSegList ()
 Get a list of (geometrical) segments from the vertices.
std::list< GenQgarSegment<
value_type > > 
toQgarSegList (int aThickness=1, QGEcolor aColor=QGE_COLOR_DEFAULT, QGEoutline anOutline=QGE_OUTLINE_DEFAULT)
 Get a list of Qgar segments, provided with given attributes, from the vertices.
Geometry: Translation
virtual void translate (value_type aTransX, value_type aTransY)
 Translate current polyline along X and Y axis.
Serialization/deserialization
virtual std::istream & read (std::istream &anInStream)
 Deserializes the current polyline from an input stream.
virtual std::ostream & write (std::ostream &anOutStream) const
 Serializes the current polyline to an input stream.
Access to source and target
const GenPoint< value_type > & accessSource () const
 Get source point.
GenPoint< value_typesource () const
 Get a copy of the source point.
const GenPoint< value_type > & accessTarget () const
 Get target point.
GenPoint< value_typetarget () const
 Get a copy of the target point.
Access to separate coordinates
value_type xSource () const
 Get X coordinate of the source point.
value_type xTarget () const
 Get X coordinate of the target point.
value_type ySource () const
 Get Y coordinate of the source point.
value_type yTarget () const
 Get Y coordinate of the target point.
Access to geometrical characteristics
value_type dx () const
 Difference between target and source X coordinates.
value_type dy () const
 Difference between target and source Y coordinates.
Set source and/or target without update
void setSource (value_type aX, value_type aY)
 Set source point.
void setSource (const GenPoint< value_type > &aPt)
 Set source point.
void setTarget (value_type aX, value_type aY)
 Set target point.
void setTarget (const GenPoint< value_type > &aPt)
 Set target point.
void setSourceTarget (value_type aXSource, value_type aYSource, value_type aXTarget, value_type aYTarget)
 Set both source and target points.
void setSourceTarget (const GenPoint< value_type > &aSource, const GenPoint< value_type > &aTarget)
 Set both source and target points.
Set source and/or target with update
void fixSource (value_type aX, value_type aY)
 Set source point.
void fixSource (const GenPoint< value_type > &aPt)
 Set source point.
void fixTarget (value_type aX, value_type aY)
 Set target point.
void fixTarget (const GenPoint< value_type > &aPt)
 Set target point.
void fixSourceTarget (value_type aXSource, value_type aYSource, value_type aXTarget, value_type aYTarget)
 Set both source and target points.
void fixSourceTarget (const GenPoint< value_type > &aSource, const GenPoint< value_type > &aTarget)
 Set both source and target points.
Set separate (source and target) coordinates without update
void setXSource (value_type aX)
 Set X coordinate of the source point.
void setXTarget (value_type aX)
 Set X coordinate of the target point.
void setYSource (value_type aY)
 Set Y coordinate of the source point.
void setYTarget (value_type aY)
 Set Y coordinate of the target point.
Set separate (source and target) coordinates with update
void fixXSource (value_type aX)
 Set X coordinate of the source point.
void fixXTarget (value_type aX)
 Set X coordinate of the target point.
void fixYSource (value_type aY)
 Set Y coordinate of the source point.
void fixYTarget (value_type aY)
 Set Y coordinate of the target point.

Protected Member Functions

Updates subsequent to source and target modifications
virtual void updateSource ()
 Update the geometrical structure when the source has been changed.
virtual void updateTarget ()
 Update the geometrical structure when the target has been changed.
virtual void updateSourceTarget ()
 Update the geometrical structure when both source and target have been changed.

Protected Attributes

Structure of a polyline
vertices_type _vertices
 Vertices.
Source and target
Apply a central symmetry to the current primitive, using the point of given coordinates as the symmetry center. Apply a central symmetry to the current primitive, using the given point as the symmetry center. Apply a mirror symmetry to the current primitive, using the line passing through the two given points for the symmetry. Apply a mirror symmetry to the current primitive, using the line supporting the given segment for the symmetry.

GenPoint< value_type_source
 Source point.
GenPoint< value_type_target
 Target point.


Member Typedef Documentation

template<class T>
typedef const value_type* qgar::GenPolyline< T >::const_pointer
 

Constant pointer to qgar::GenPolyline::value_type.

Reimplemented from qgar::AbstractGenPrimitive< T >.

Definition at line 180 of file _QGAR_GenPolyline.H.

template<class T>
typedef const value_type& qgar::GenPolyline< T >::const_reference
 

Constant reference to qgar::GenPolyline::value_type.

Reimplemented from qgar::AbstractGenPrimitive< T >.

Definition at line 170 of file _QGAR_GenPolyline.H.

template<class T>
typedef value_type* qgar::GenPolyline< T >::pointer
 

Pointer to qgar::GenPolyline::value_type.

Reimplemented from qgar::AbstractGenPrimitive< T >.

Definition at line 175 of file _QGAR_GenPolyline.H.

template<class T>
typedef value_type& qgar::GenPolyline< T >::reference
 

Reference to qgar::GenPolyline::value_type.

Reimplemented from qgar::AbstractGenPrimitive< T >.

Definition at line 165 of file _QGAR_GenPolyline.H.

template<class T>
typedef T qgar::GenPolyline< T >::value_type
 

Type of the vertices coordinates.

Reimplemented from qgar::AbstractGenPrimitive< T >.

Definition at line 160 of file _QGAR_GenPolyline.H.

template<class T>
typedef const vertices_type& qgar::GenPolyline< T >::vertices_const_reference
 

Constant reference to qgar::GenPolyline::vertices_type.

Definition at line 195 of file _QGAR_GenPolyline.H.

template<class T>
typedef vertices_type& qgar::GenPolyline< T >::vertices_reference
 

Reference to qgar::GenPolyline::vertices_type.

Definition at line 190 of file _QGAR_GenPolyline.H.

template<class T>
typedef std::deque< GenPoint<value_type> > qgar::GenPolyline< T >::vertices_type
 

Type of the vertices container.

Definition at line 185 of file _QGAR_GenPolyline.H.


Constructor & Destructor Documentation

template<class T>
qgar::GenPolyline< T >::GenPolyline  ) 
 

Default constructor.

Todo:
The created polyline does not conform to the definition of a polyline: The vertices deque is empty whereas it should contain at least 2 elements!

Definition at line 63 of file _QGAR_GenPolyline.TCC.

template<class T>
qgar::GenPolyline< T >::GenPolyline const GenPolyline< value_type > &  aPoly  ) 
 

Copy constructor.

Parameters:
aPoly a polyline

template<class T>
qgar::GenPolyline< T >::GenPolyline const GenQgarPolyline< value_type > &  aQPoly  )  [explicit]
 

Initialize from a Qgar polyline.

The order of the vertices is preserved in the resulting polyline.

Parameters:
aQPoly a Qgar polyline
Warning:
This kind of conversion must be explicitely specified by the client.

Definition at line 88 of file _QGAR_GenPolyline.TCC.

template<class T>
qgar::GenPolyline< T >::GenPolyline const GenQgarSegment< value_type > &  aQSeg  )  [explicit]
 

Initialize from a Qgar segment.

The source (resp. target) of the resulting polyline is the source (resp. target) of the segment.

Parameters:
aQSeg a Qgar segment
Warning:
This kind of conversion must be explicitely specified by the client.

Definition at line 102 of file _QGAR_GenPolyline.TCC.

References qgar::GenPolyline< T >::_vertices.

template<class T>
qgar::GenPolyline< T >::GenPolyline const GenSegment< value_type > &  aSeg  )  [explicit]
 

Initialize from a (geometrical) segment.

The source (resp. target) of the resulting polyline is the source (resp. target) of the segment.

Parameters:
aSeg a (geometrical) segment
Warning:
This kind of conversion must be explicitely specified by the client.

template<class T>
qgar::GenPolyline< T >::GenPolyline const GenPoint< value_type > &  aSource,
const GenPoint< value_type > &  aTarget
 

Initialize from two vertices: source and target.

Parameters:
aSource source vertex
aTarget target vertex

template<class T>
qgar::GenPolyline< T >::GenPolyline const std::list< GenPoint< value_type > > &  aPtList  )  throw (QgarErrorUser) [explicit]
 

Initialize from a list of at least two vertices.

The order of the given vertices is preserved in the resulting polyline.

Parameters:
aPtList a list of at least two vertices
Warning:
This kind of conversion must be explicitely specified by the client.
Exceptions:
qgar::QgarErrorUser (cannot create a polyline of less than 2 vertices)

Definition at line 142 of file _QGAR_GenPolyline.TCC.

References qgar::AbstractGenPrimitive< T >::_source, and qgar::AbstractGenPrimitive< T >::_target.

template<class T>
qgar::GenPolyline< T >::~GenPolyline  )  [virtual]
 

Virtual destructor.

Definition at line 169 of file _QGAR_GenPolyline.TCC.


Member Function Documentation

template<class T>
const GenPoint< T > & qgar::AbstractGenPrimitive< T >::accessSource  )  const [inline, inherited]
 

Get source point.

Definition at line 143 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_source.

Referenced by qgar::AbstractGenQgarPrimitive< T >::accessSource().

template<class T>
const GenPoint< T > & qgar::AbstractGenPrimitive< T >::accessTarget  )  const [inline, inherited]
 

Get target point.

Definition at line 163 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_target.

Referenced by qgar::AbstractGenQgarPrimitive< T >::accessTarget(), and qgar::GenSegment< T >::slope().

template<class T>
const std::deque< GenPoint< T > > & qgar::GenPolyline< T >::accessVertices  )  const [inline]
 

Get the vertices.

Definition at line 231 of file _QGAR_GenPolyline.TCC.

References qgar::GenPolyline< T >::_vertices.

Referenced by qgar::GenQgarPolyline< T >::accessVertices(), qgar::TgifFile::savePolyline(), and qgar::DxfFile::savePolyline().

template<class T>
GenPolyline< T > & qgar::GenPolyline< T >::append const std::vector< GenPoint< value_type > > &  aPtVect  ) 
 

Appends a set of vertices to a polyline.

The given points are inserted after the target point. The order of the given vertices is preserved in the resulting polyline. The last point of the vector becomes the new target.

Parameters:
aPtVect the vector of points to be appended
Returns:
a reference to the current polyline

Definition at line 326 of file _QGAR_GenPolyline.TCC.

References qgar::AbstractGenPrimitive< T >::_target.

template<class T>
GenPolyline< T > & qgar::GenPolyline< T >::append const GenQgarPolyline< value_type > &  aQPoly  ) 
 

Appends a Qgar polyline.

Parameters:
aQPoly the Qgar polyline to be appended
Returns:
a reference to the current polyline

Definition at line 308 of file _QGAR_GenPolyline.TCC.

References qgar::AbstractGenPrimitive< T >::_target, qgar::GenQgarPolyline< T >::accessVertices(), and qgar::AbstractGenQgarPrimitive< T >::target().

template<class T>
GenPolyline<value_type>& qgar::GenPolyline< T >::append const GenPolyline< value_type > &  aPoly  ) 
 

Appends a polyline.

Parameters:
aPoly the polyline to be appended
Returns:
a reference to the current polyline

Referenced by qgar::GenQgarPolyline< T >::append().

template<class T>
GenPolyline<value_type>& qgar::GenPolyline< T >::appendSource const GenPoint< value_type > &  aPt  ) 
 

Insert a point as new source.

Parameters:
aPt a point

template<class T>
GenPolyline<value_type>& qgar::GenPolyline< T >::appendTarget const GenPoint< value_type > &  aPt  ) 
 

Insert a point as new target.

Parameters:
aPt a point

template<class T>
GenPolyline< T > * qgar::GenPolyline< T >::clone  )  const [virtual]
 

Perform a deep copy.

Implements qgar::AbstractGenPrimitive< T >.

Definition at line 184 of file _QGAR_GenPolyline.TCC.

template<class T>
T qgar::AbstractGenPrimitive< T >::dx  )  const [inline, inherited]
 

Difference between target and source X coordinates.

Definition at line 233 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_source, qgar::AbstractGenPrimitive< T >::_target, and qgar::GenPoint< T >::x().

Referenced by qgar::GenSegment< T >::contains(), and qgar::AbstractGenQgarPrimitive< T >::dx().

template<class T>
T qgar::AbstractGenPrimitive< T >::dy  )  const [inline, inherited]
 

Difference between target and source Y coordinates.

Definition at line 243 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_source, qgar::AbstractGenPrimitive< T >::_target, and qgar::GenPoint< T >::y().

Referenced by qgar::GenSegment< T >::contains(), qgar::AbstractGenQgarPrimitive< T >::dy(), and qgar::GenSegment< T >::length().

template<class T>
void qgar::AbstractGenPrimitive< T >::fixSource const GenPoint< value_type > &  aPt  )  [inherited]
 

Set source point.

Parameters:
aPt a point
Warning:
Function qgar::AbstractGenPrimitive::updateSource is called after the modification of the source point.

template<class T>
void qgar::AbstractGenPrimitive< T >::fixSource value_type  aX,
value_type  aY
[inherited]
 

Set source point.

Parameters:
aX new X coordinate of the source point
aY new Y coordinate of the source point
Warning:
Function qgar::AbstractGenPrimitive::updateSource is called after the modification of the source point.

Definition at line 327 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::setSource(), and qgar::AbstractGenPrimitive< T >::updateSource().

Referenced by qgar::AbstractGenQgarPrimitive< T >::fixSource().

template<class T>
void qgar::AbstractGenPrimitive< T >::fixSourceTarget const GenPoint< value_type > &  aSource,
const GenPoint< value_type > &  aTarget
[inherited]
 

Set both source and target points.

Parameters:
aSource source point
aTarget target point
Warning:
Function qgar::AbstractGenPrimitive::updateSourceTarget is called after the modification of the source and target points.

template<class T>
void qgar::AbstractGenPrimitive< T >::fixSourceTarget value_type  aXSource,
value_type  aYSource,
value_type  aXTarget,
value_type  aYTarget
[inherited]
 

Set both source and target points.

Parameters:
aXSource new X coordinate of the source point
aYSource new Y coordinate of the source point
aXTarget new X coordinate of the target point
aYTarget new Y coordinate of the target point
Warning:
Function qgar::AbstractGenPrimitive::updateSourceTarget is called after the modification of the source and target points.

Definition at line 369 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::setSourceTarget(), and qgar::AbstractGenPrimitive< T >::updateSourceTarget().

Referenced by qgar::AbstractGenQgarPrimitive< T >::fixSourceTarget().

template<class T>
void qgar::AbstractGenPrimitive< T >::fixTarget const GenPoint< value_type > &  aPt  )  [inherited]
 

Set target point.

Parameters:
aPt a point
Warning:
Function qgar::AbstractGenPrimitive::updateTarget is called after the modification of the source target.

template<class T>
void qgar::AbstractGenPrimitive< T >::fixTarget value_type  aX,
value_type  aY
[inherited]
 

Set target point.

Parameters:
aX new X coordinate of the target point
aY new Y coordinate of the target point
Warning:
Function qgar::AbstractGenPrimitive::updateTarget is called after the modification of the target point.

Definition at line 348 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::setTarget(), and qgar::AbstractGenPrimitive< T >::updateTarget().

Referenced by qgar::AbstractGenQgarPrimitive< T >::fixTarget().

template<class T>
void qgar::AbstractGenPrimitive< T >::fixXSource value_type  aX  )  [inherited]
 

Set X coordinate of the source point.

Parameters:
aX new X coordinate of the source point
Warning:
Function qgar::AbstractGenPrimitive::updateSource is called after the modification of the source point.

Definition at line 443 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::setXSource(), and qgar::AbstractGenPrimitive< T >::updateSource().

Referenced by qgar::AbstractGenQgarPrimitive< T >::fixXSource().

template<class T>
void qgar::AbstractGenPrimitive< T >::fixXTarget value_type  aX  )  [inherited]
 

Set X coordinate of the target point.

Parameters:
aX new X coordinate of the target point
Warning:
Function qgar::AbstractGenPrimitive::updateTarget is called after the modification of the target point.

Definition at line 454 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::setXTarget(), and qgar::AbstractGenPrimitive< T >::updateTarget().

Referenced by qgar::AbstractGenQgarPrimitive< T >::fixXTarget().

template<class T>
void qgar::AbstractGenPrimitive< T >::fixYSource value_type  aY  )  [inherited]
 

Set Y coordinate of the source point.

Parameters:
aY new Y coordinate of the source point
Warning:
Function qgar::AbstractGenPrimitive::updateSource is called after the modification of the source point.

Definition at line 465 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::setYSource(), and qgar::AbstractGenPrimitive< T >::updateSource().

Referenced by qgar::AbstractGenQgarPrimitive< T >::fixYSource().

template<class T>
void qgar::AbstractGenPrimitive< T >::fixYTarget value_type  aY  )  [inherited]
 

Set Y coordinate of the target point.

Parameters:
aY new Y coordinate of the target point
Warning:
Function qgar::AbstractGenPrimitive::updateTarget is called after the modification of the target point.

Definition at line 476 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::setYTarget(), and qgar::AbstractGenPrimitive< T >::updateTarget().

Referenced by qgar::AbstractGenQgarPrimitive< T >::fixYTarget().

template<class T>
std::deque< GenPoint< T > > & qgar::GenPolyline< T >::getVertices  )  [inline]
 

Give non-protected access to the vertices.

Vertices may then be directly modified using appropriate transformation function members.

Definition at line 241 of file _QGAR_GenPolyline.TCC.

References qgar::GenPolyline< T >::_vertices.

Referenced by qgar::GenQgarPolyline< T >::getVertices().

template<class T>
GenPolyline<value_type>& qgar::GenPolyline< T >::operator= const GenPolyline< value_type > &  aPoly  )  [inline]
 

Assignment.

Parameters:
aPoly a polyline

template<class T>
std::istream & qgar::GenPolyline< T >::read std::istream &  anInStream  )  [inline, virtual]
 

Deserializes the current polyline from an input stream.

A serialized polyline is represented as:

Polyline(<SOURCE>)(<TARGET>)(<VERTICES COUNT>)(<VERTICE 1>)..(<VERTICE n>)

Parameters:
anInStream the input stream

Implements qgar::ISerializable.

Definition at line 484 of file _QGAR_GenPolyline.TCC.

References qgar::GenPolyline< T >::_vertices, qgar::qgReadObjData(), and qgar::qgReadObjName().

template<class T>
GenPolyline<value_type>& qgar::GenPolyline< T >::remove const GenPoint< value_type > &  aPt  )  throw (QgarErrorUser)
 

Remove a vertex from the polyline.

Parameters:
aPt a point
Exceptions:
qgar::QgarErrorUser (no removal in a polyline including 2 vertices)

template<class T>
void qgar::AbstractGenPrimitive< T >::setSource const GenPoint< value_type > &  aPt  )  [inline, inherited]
 

Set source point.

Parameters:
aPt a point
Warning:
The data structure of the primitive is not subsequently updated.

template<class T>
void qgar::AbstractGenPrimitive< T >::setSource value_type  aX,
value_type  aY
[inline, inherited]
 

Set source point.

Parameters:
aX new X coordinate of the source point
aY new Y coordinate of the source point
Warning:
The data structure of the primitive is not subsequently updated.

Definition at line 259 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_source, and qgar::GenPoint< T >::setXY().

Referenced by qgar::AbstractGenPrimitive< T >::fixSource(), qgar::WDSegmentList::PRIVATEperform(), and qgar::AbstractGenQgarPrimitive< T >::setSource().

template<class T>
void qgar::AbstractGenPrimitive< T >::setSourceTarget const GenPoint< value_type > &  aSource,
const GenPoint< value_type > &  aTarget
[inherited]
 

Set both source and target points.

Parameters:
aSource source point
aTarget target point
Warning:
The data structure of the primitive is not subsequently updated.

template<class T>
void qgar::AbstractGenPrimitive< T >::setSourceTarget value_type  aXSource,
value_type  aYSource,
value_type  aXTarget,
value_type  aYTarget
[inherited]
 

Set both source and target points.

Parameters:
aXSource new X coordinate of the source point
aYSource new Y coordinate of the source point
aXTarget new X coordinate of the target point
aYTarget new Y coordinate of the target point
Warning:
The data structure of the primitive is not subsequently updated.

Definition at line 297 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_source, qgar::AbstractGenPrimitive< T >::_target, and qgar::GenPoint< T >::setXY().

Referenced by qgar::AbstractGenPrimitive< T >::fixSourceTarget(), qgar::AbstractGenQgarPrimitive< T >::setSourceTarget(), qgar::GenSegment< T >::translate(), qgar::GenPolyline< T >::translate(), qgar::GenPolygon< T >::translate(), and qgar::GenArc< T >::translate().

template<class T>
void qgar::AbstractGenPrimitive< T >::setTarget const GenPoint< value_type > &  aPt  )  [inline, inherited]
 

Set target point.

Parameters:
aPt a point
Warning:
The data structure of the primitive is not subsequently updated.

template<class T>
void qgar::AbstractGenPrimitive< T >::setTarget value_type  aX,
value_type  aY
[inline, inherited]
 

Set target point.

Parameters:
aX new X coordinate of the target point
aY new Y coordinate of the target point
Warning:
The data structure of the primitive is not subsequently updated.

Definition at line 278 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_target, and qgar::GenPoint< T >::setXY().

Referenced by qgar::AbstractGenPrimitive< T >::fixTarget(), qgar::WDSegmentList::PRIVATEperform(), and qgar::AbstractGenQgarPrimitive< T >::setTarget().

template<class T>
void qgar::AbstractGenPrimitive< T >::setXSource value_type  aX  )  [inline, inherited]
 

Set X coordinate of the source point.

Parameters:
aX new X coordinate of the source point
Warning:
The data structure of the primitive is not subsequently updated.

Definition at line 398 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_source.

Referenced by qgar::AbstractGenPrimitive< T >::fixXSource(), and qgar::AbstractGenQgarPrimitive< T >::setXSource().

template<class T>
void qgar::AbstractGenPrimitive< T >::setXTarget value_type  aX  )  [inline, inherited]
 

Set X coordinate of the target point.

Parameters:
aX new X coordinate of the target point
Warning:
The data structure of the primitive is not subsequently updated.

Definition at line 408 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_target.

Referenced by qgar::AbstractGenPrimitive< T >::fixXTarget(), and qgar::AbstractGenQgarPrimitive< T >::setXTarget().

template<class T>
void qgar::AbstractGenPrimitive< T >::setYSource value_type  aY  )  [inline, inherited]
 

Set Y coordinate of the source point.

Parameters:
aY new Y coordinate of the source point
Warning:
The data structure of the primitive is not subsequently updated.

Definition at line 418 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_source.

Referenced by qgar::AbstractGenPrimitive< T >::fixYSource(), and qgar::AbstractGenQgarPrimitive< T >::setYSource().

template<class T>
void qgar::AbstractGenPrimitive< T >::setYTarget value_type  aY  )  [inline, inherited]
 

Set Y coordinate of the target point.

Parameters:
aY new Y coordinate of the target point
Warning:
The data structure of the primitive is not subsequently updated.

Definition at line 428 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_target.

Referenced by qgar::AbstractGenPrimitive< T >::fixYTarget(), and qgar::AbstractGenQgarPrimitive< T >::setYTarget().

template<class T>
int qgar::GenPolyline< T >::size  )  const [inline]
 

Get number of vertices.

Definition at line 221 of file _QGAR_GenPolyline.TCC.

References qgar::GenPolyline< T >::_vertices.

Referenced by qgar::GenQgarPolyline< T >::size().

template<class T>
GenPoint< T > qgar::AbstractGenPrimitive< T >::source  )  const [inline, inherited]
 

Get a copy of the source point.

Definition at line 153 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_source.

Referenced by qgar::GenImage< T, CheckPolicy >::draw(), qgar::WDSegment::operator=(), qgar::WDSegmentList::PRIVATEperform(), qgar::AbstractGenQgarPrimitive< T >::source(), qgar::GenPolyline< T >::toQgarSegList(), qgar::GenPolyline< T >::toSegList(), qgar::GenPolygon< T >::write(), and qgar::GenArc< T >::write().

template<class T>
GenPoint< T > qgar::AbstractGenPrimitive< T >::target  )  const [inline, inherited]
 

Get a copy of the target point.

Definition at line 173 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_target.

Referenced by qgar::GenImage< T, CheckPolicy >::draw(), qgar::WDSegment::operator=(), qgar::WDSegmentList::PRIVATEperform(), qgar::AbstractGenQgarPrimitive< T >::target(), qgar::GenPolyline< T >::toQgarSegList(), qgar::GenPolyline< T >::toSegList(), qgar::GenPolygon< T >::write(), and qgar::GenArc< T >::write().

template<class T>
std::vector< GenPoint< T > > qgar::GenPolyline< T >::toPointVector  ) 
 

Get a vector of points from the vertices.

Definition at line 401 of file _QGAR_GenPolyline.TCC.

References qgar::GenPolyline< T >::_vertices.

Referenced by qgar::GenQgarPolyline< T >::toPointVector().

template<class T>
std::list< GenQgarSegment< T > > qgar::GenPolyline< T >::toQgarSegList int  aThickness = 1,
QGEcolor  aColor = QGE_COLOR_DEFAULT,
QGEoutline  anOutline = QGE_OUTLINE_DEFAULT
 

Get a list of Qgar segments, provided with given attributes, from the vertices.

Parameters:
aThickness thickness (default 1)
aColor color (default qgar::QGE_COLOR_DEFAULT)
anOutline outline (default qgar::QGE_OUTLINE_DEFAULT)

Definition at line 447 of file _QGAR_GenPolyline.TCC.

References qgar::GenPolyline< T >::_vertices, qgar::AbstractGenPrimitive< T >::source(), and qgar::AbstractGenPrimitive< T >::target().

Referenced by qgar::GenQgarPolyline< T >::toQgarSegList().

template<class T>
std::list< GenSegment< T > > qgar::GenPolyline< T >::toSegList  ) 
 

Get a list of (geometrical) segments from the vertices.

Definition at line 418 of file _QGAR_GenPolyline.TCC.

References qgar::GenPolyline< T >::_vertices, qgar::AbstractGenPrimitive< T >::source(), and qgar::AbstractGenPrimitive< T >::target().

Referenced by qgar::GenQgarPolyline< T >::toSegList().

template<class T>
void qgar::GenPolyline< T >::translate value_type  aTransX,
value_type  aTransY
[inline, virtual]
 

Translate current polyline along X and Y axis.

Parameters:
aTransX X translation factor
aTransY Y translation factor

Implements qgar::AbstractGenPrimitive< T >.

Definition at line 593 of file _QGAR_GenPolyline.TCC.

References qgar::GenPolyline< T >::_vertices, qgar::AbstractGenPrimitive< T >::setSourceTarget(), qgar::AbstractGenPrimitive< T >::xTarget(), qgar::AbstractGenPrimitive< T >::ySource(), and qgar::AbstractGenPrimitive< T >::yTarget().

template<class T>
void qgar::GenPolyline< T >::updateSource  )  [protected, virtual]
 

Update the geometrical structure when the source has been changed.

Implements qgar::AbstractGenPrimitive< T >.

Definition at line 559 of file _QGAR_GenPolyline.TCC.

References qgar::AbstractGenPrimitive< T >::_source, qgar::GenPolyline< T >::_vertices, and qgar::GenPoint< T >::setXY().

Referenced by qgar::GenPolyline< T >::updateSourceTarget().

template<class T>
void qgar::GenPolyline< T >::updateSourceTarget  )  [protected, virtual]
 

Update the geometrical structure when both source and target have been changed.

Implements qgar::AbstractGenPrimitive< T >.

Definition at line 579 of file _QGAR_GenPolyline.TCC.

References qgar::GenPolyline< T >::updateSource(), and qgar::GenPolyline< T >::updateTarget().

template<class T>
void qgar::GenPolyline< T >::updateTarget  )  [protected, virtual]
 

Update the geometrical structure when the target has been changed.

Implements qgar::AbstractGenPrimitive< T >.

Definition at line 569 of file _QGAR_GenPolyline.TCC.

References qgar::AbstractGenPrimitive< T >::_target, and qgar::GenPolyline< T >::_vertices.

Referenced by qgar::GenPolyline< T >::updateSourceTarget().

template<class T>
std::deque< GenPoint< T > > qgar::GenPolyline< T >::vertices  )  const [inline]
 

Get a copy of the vertices.

Definition at line 251 of file _QGAR_GenPolyline.TCC.

References qgar::GenPolyline< T >::_vertices.

Referenced by qgar::GenQgarPolyline< T >::vertices().

template<class T>
std::ostream & qgar::GenPolyline< T >::write std::ostream &  anOutStream  )  const [inline, virtual]
 

Serializes the current polyline to an input stream.

A serialized polyline is represented as:

Polyline(<SOURCE>)(<TARGET>)(<VERTICES COUNT>)(<VERTICE 1>)..(<VERTICE n>)

Parameters:
anOutStream the output stream

Implements qgar::ISerializable.

Definition at line 514 of file _QGAR_GenPolyline.TCC.

References qgar::AbstractGenPrimitive< T >::_source, qgar::AbstractGenPrimitive< T >::_target, and qgar::GenPolyline< T >::_vertices.

template<class T>
T qgar::AbstractGenPrimitive< T >::xSource  )  const [inline, inherited]
 

Get X coordinate of the source point.

Definition at line 188 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_source, and qgar::GenPoint< T >::x().

Referenced by qgar::GenSegment< T >::contains(), qgar::GenSegment< T >::rho(), qgar::TgifFile::write(), qgar::DxfFile::write(), and qgar::AbstractGenQgarPrimitive< T >::xSource().

template<class T>
T qgar::AbstractGenPrimitive< T >::xTarget  )  const [inline, inherited]
 

Get X coordinate of the target point.

Definition at line 198 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_target, and qgar::GenPoint< T >::x().

Referenced by qgar::GenSegment< T >::contains(), qgar::GenSegment< T >::rho(), qgar::GenSegment< T >::translate(), qgar::GenPolyline< T >::translate(), qgar::GenPolygon< T >::translate(), qgar::GenArc< T >::translate(), qgar::TgifFile::write(), qgar::DxfFile::write(), and qgar::AbstractGenQgarPrimitive< T >::xTarget().

template<class T>
T qgar::AbstractGenPrimitive< T >::ySource  )  const [inline, inherited]
 

Get Y coordinate of the source point.

Definition at line 208 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_source, and qgar::GenPoint< T >::y().

Referenced by qgar::GenSegment< T >::contains(), qgar::GenSegment< T >::translate(), qgar::GenPolyline< T >::translate(), qgar::GenPolygon< T >::translate(), qgar::GenArc< T >::translate(), qgar::TgifFile::write(), qgar::DxfFile::write(), and qgar::AbstractGenQgarPrimitive< T >::ySource().

template<class T>
T qgar::AbstractGenPrimitive< T >::yTarget  )  const [inline, inherited]
 

Get Y coordinate of the target point.

Definition at line 218 of file _QGAR_AbstractGenPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::_target, and qgar::GenPoint< T >::y().

Referenced by qgar::GenSegment< T >::contains(), qgar::GenSegment< T >::rho(), qgar::GenSegment< T >::translate(), qgar::GenPolyline< T >::translate(), qgar::GenPolygon< T >::translate(), qgar::GenArc< T >::translate(), qgar::TgifFile::write(), qgar::DxfFile::write(), and qgar::AbstractGenQgarPrimitive< T >::yTarget().


Member Data Documentation

template<class T>
GenPoint<value_type> qgar::AbstractGenPrimitive< T >::_source [protected, inherited]
 

Source point.

Definition at line 615 of file _QGAR_AbstractGenPrimitive.H.

Referenced by qgar::AbstractGenPrimitive< T >::accessSource(), qgar::AbstractGenPrimitive< T >::dx(), qgar::AbstractGenPrimitive< T >::dy(), qgar::GenPolygon< T >::GenPolygon(), qgar::GenPolyline< T >::GenPolyline(), qgar::WDSegment::set(), qgar::AbstractGenPrimitive< T >::setSource(), qgar::AbstractGenPrimitive< T >::setSourceTarget(), qgar::AbstractGenPrimitive< T >::setXSource(), qgar::AbstractGenPrimitive< T >::setYSource(), qgar::AbstractGenPrimitive< T >::source(), qgar::GenPolyline< T >::updateSource(), qgar::GenPolygon< T >::updateSource(), qgar::WDSegment::WDSegment(), qgar::GenSegment< T >::write(), qgar::GenPolyline< T >::write(), qgar::AbstractGenPrimitive< T >::xSource(), and qgar::AbstractGenPrimitive< T >::ySource().

template<class T>
GenPoint<value_type> qgar::AbstractGenPrimitive< T >::_target [protected, inherited]
 

Target point.

Definition at line 620 of file _QGAR_AbstractGenPrimitive.H.

Referenced by qgar::AbstractGenPrimitive< T >::accessTarget(), qgar::GenPolyline< T >::append(), qgar::GenPolygon< T >::append(), qgar::AbstractGenPrimitive< T >::dx(), qgar::AbstractGenPrimitive< T >::dy(), qgar::GenPolygon< T >::GenPolygon(), qgar::GenPolyline< T >::GenPolyline(), qgar::WDSegment::set(), qgar::AbstractGenPrimitive< T >::setSourceTarget(), qgar::AbstractGenPrimitive< T >::setTarget(), qgar::AbstractGenPrimitive< T >::setXTarget(), qgar::AbstractGenPrimitive< T >::setYTarget(), qgar::AbstractGenPrimitive< T >::target(), qgar::GenPolyline< T >::updateTarget(), qgar::GenPolygon< T >::updateTarget(), qgar::WDSegment::WDSegment(), qgar::GenSegment< T >::write(), qgar::GenPolyline< T >::write(), qgar::AbstractGenPrimitive< T >::xTarget(), and qgar::AbstractGenPrimitive< T >::yTarget().

template<class T>
vertices_type qgar::GenPolyline< T >::_vertices [protected]
 

Vertices.

Definition at line 525 of file _QGAR_GenPolyline.H.

Referenced by qgar::GenPolyline< T >::accessVertices(), qgar::GenPolyline< T >::GenPolyline(), qgar::GenPolyline< T >::getVertices(), qgar::GenPolyline< T >::read(), qgar::GenPolyline< T >::size(), qgar::GenPolyline< T >::toPointVector(), qgar::GenPolyline< T >::toQgarSegList(), qgar::GenPolyline< T >::toSegList(), qgar::GenPolyline< T >::translate(), qgar::GenPolyline< T >::updateSource(), qgar::GenPolyline< T >::updateTarget(), qgar::GenPolyline< T >::vertices(), and qgar::GenPolyline< T >::write().


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