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

qgar::GenQgarPolyline< T > Class Template Reference
[Qgar (graphical) primitives]

#include <qgarlib/primitives.H>

Inheritance diagram for qgar::GenQgarPolyline< T >:

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

Detailed Description

template<class T>
class qgar::GenQgarPolyline< T >

Graphical polyline, so-called Qgar 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 15:35
Since:
Qgar 2.1

Definition at line 139 of file _QGAR_GenQgarPolyline.H.

Public Types

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

Public Member Functions

Constructors
 GenQgarPolyline (int aThickness=1, QGEcolor aColor=QGE_COLOR_DEFAULT, QGEoutline anOutline=QGE_OUTLINE_DEFAULT)
 Default constructor: The series of vertices is empty.
 GenQgarPolyline (const GenQgarPolyline< value_type > &aQPoly)
 Copy constructor.
 GenQgarPolyline (const GenPolyline< value_type > &aPoly, int aThickness=1, QGEcolor aColor=QGE_COLOR_DEFAULT, QGEoutline anOutline=QGE_OUTLINE_DEFAULT)
 Initialize from a geometrical polyline.
 GenQgarPolyline (const GenQgarSegment< value_type > &aQSeg)
 Initialize from a Qgar segment.
 GenQgarPolyline (const GenSegment< value_type > &aSeg, int aThickness=1, QGEcolor aColor=QGE_COLOR_DEFAULT, QGEoutline anOutline=QGE_OUTLINE_DEFAULT)
 Initialize from a (geometrical) segment.
 GenQgarPolyline (const GenPoint< value_type > &aSource, const GenPoint< value_type > &aTarget, int aThickness=1, QGEcolor aColor=QGE_COLOR_DEFAULT, QGEoutline anOutline=QGE_OUTLINE_DEFAULT)
 Initialize from 2 vertices: source and target.
 GenQgarPolyline (const std::list< GenPoint< value_type > > &aPtList, int aThickness=1, QGEcolor aColor=QGE_COLOR_DEFAULT, QGEoutline anOutline=QGE_OUTLINE_DEFAULT)
 Initialize from a list of at least two points.
Destructor
virtual ~GenQgarPolyline ()
 Virtual destructor.
Copy
virtual GenQgarPolyline< value_type > * clone () const
 Create a dynamically allocated deep copy of the primitive.
Operators
GenQgarPolyline< value_type > & operator= (const GenQgarPolyline< value_type > &aQPoly)
 Assignment.
Access to the geometrical structure
const GenPolyline< value_type > & accessGeomStructure () const
 Get the structure implementing the geometrical aspect of a Qgar polyline.
Access to vertices
int size () const
 Get number of vertices.
vertices_const_reference accessVertices () const
 Get vertices in a deque.
vertices_reference getVertices ()
 Give non-protected access to the vertices.
vertices_type vertices () const
 Get a copy of the vertices in a deque.
Insert vertices
GenQgarPolyline< value_type > & appendSource (const GenPoint< value_type > &aPt)
 Add a point as new source.
GenQgarPolyline< value_type > & appendTarget (const GenPoint< value_type > &aPt)
 Append a point as new target.
GenQgarPolyline< value_type > & append (const GenQgarPolyline< value_type > &aQPoly)
 Appends a Qgar polyline.
GenQgarPolyline< value_type > & append (const GenPolyline< value_type > &aPoly)
 Appends a polyline.
GenQgarPolyline< value_type > & append (const std::vector< GenPoint< value_type > > &aPtVect)
 Appends a set of point to a Qgar polyline.
Remove vertices
GenQgarPolyline< value_type > & remove (const GenPoint< value_type > &aPt)
 Remove a vertex from the polyline.
Conversion of the vertices
std::vector< GenPoint< value_type > > toPointVector ()
 Get a vector of points from the series of vertices.
std::list< GenSegment< value_type > > toSegList ()
 Get a list of (geometrical) segments from the vertices.
std::list< GenQgarSegment<
value_type > > 
toQgarSegList ()
 Get a list of Qgar segments from the vertices.
Geometry: Translation
virtual void translate (value_type aX, value_type aY)
 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 attributes
int thickness () const
 Get thickness.
QGEcolor color () const
 Get color.
QGEoutline outline () const
 Get outline.
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 attributes
void setThickness (int aThickness)
 Set thickness.
void setColor (QGEcolor aColor)
 Set color.
void setOutline (QGEoutline anOutline)
 Set outline.
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

Non-protected access to the geometrical aspect
AbstractGenPrimitive< value_type > & getGeomStructure ()
 Return the geometrical aspect.

Protected Attributes

Geometrical structure of a Qgar polyline
GenPolyline< value_type_geomStructure
 Geometrical structure.
Attributes
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.

int _thickness
 Thickness of the outline.
QGEcolor _color
 Color of the outline.
QGEoutline _outline
 Type of outline.


Member Typedef Documentation

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

Constant pointer to qgar::GenQgarPolyline::value_type.

Reimplemented from qgar::AbstractGenQgarPrimitive< T >.

Definition at line 177 of file _QGAR_GenQgarPolyline.H.

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

Constant reference to qgar::GenQgarPolyline::value_type.

Reimplemented from qgar::AbstractGenQgarPrimitive< T >.

Definition at line 167 of file _QGAR_GenQgarPolyline.H.

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

Pointer to qgar::GenQgarPolyline::value_type.

Reimplemented from qgar::AbstractGenQgarPrimitive< T >.

Definition at line 172 of file _QGAR_GenQgarPolyline.H.

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

Reference to qgar::GenQgarPolyline::value_type.

Reimplemented from qgar::AbstractGenQgarPrimitive< T >.

Definition at line 162 of file _QGAR_GenQgarPolyline.H.

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

Type of the vertices coordinates.

Reimplemented from qgar::AbstractGenQgarPrimitive< T >.

Definition at line 157 of file _QGAR_GenQgarPolyline.H.

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

Constant reference to qgar::GenQgarPolyline::vertices_type.

Definition at line 192 of file _QGAR_GenQgarPolyline.H.

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

Reference to qgar::GenQgarPolyline::vertices_type.

Definition at line 187 of file _QGAR_GenQgarPolyline.H.

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

Type of the vertices container.

Definition at line 182 of file _QGAR_GenQgarPolyline.H.


Constructor & Destructor Documentation

template<class T>
qgar::GenQgarPolyline< T >::GenQgarPolyline int  aThickness = 1,
QGEcolor  aColor = QGE_COLOR_DEFAULT,
QGEoutline  anOutline = QGE_OUTLINE_DEFAULT
 

Default constructor: The series of vertices is empty.

Parameters:
aThickness thickness (default 1)
aColor color (default qgar::QGE_COLOR_DEFAULT)
anOutline outline (default qgar::QGE_OUTLINE_DEFAULT)
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 62 of file _QGAR_GenQgarPolyline.TCC.

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

Copy constructor.

Parameters:
aQPoly a Qgar polyline

Definition at line 78 of file _QGAR_GenQgarPolyline.TCC.

template<class T>
qgar::GenQgarPolyline< T >::GenQgarPolyline const GenPolyline< value_type > &  aPoly,
int  aThickness = 1,
QGEcolor  aColor = QGE_COLOR_DEFAULT,
QGEoutline  anOutline = QGE_OUTLINE_DEFAULT
[explicit]
 

Initialize from a geometrical polyline.

Parameters:
aPoly a (geometrical) polyline
aThickness thickness (default 1)
aColor color (default qgar::QGE_COLOR_DEFAULT)
anOutline outline (default qgar::QGE_OUTLINE_DEFAULT)
Warning:
This kind of conversion must be explicitely specified by the client.

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

Initialize from a Qgar segment.

The created polyline has the same thickness, color and outline as the given Qgar segment.

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

Definition at line 111 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure, and qgar::GenQgarSegment< T >::accessGeomStructure().

template<class T>
qgar::GenQgarPolyline< T >::GenQgarPolyline const GenSegment< value_type > &  aSeg,
int  aThickness = 1,
QGEcolor  aColor = QGE_COLOR_DEFAULT,
QGEoutline  anOutline = QGE_OUTLINE_DEFAULT
[explicit]
 

Initialize from a (geometrical) segment.

Parameters:
aSeg a (geometrical) segment
aThickness thickness (default 1)
aColor color (default qgar::QGE_COLOR_DEFAULT)
anOutline outline (default qgar::QGE_OUTLINE_DEFAULT)
Warning:
This kind of conversion must be explicitely specified by the client.

template<class T>
qgar::GenQgarPolyline< T >::GenQgarPolyline const GenPoint< value_type > &  aSource,
const GenPoint< value_type > &  aTarget,
int  aThickness = 1,
QGEcolor  aColor = QGE_COLOR_DEFAULT,
QGEoutline  anOutline = QGE_OUTLINE_DEFAULT
 

Initialize from 2 vertices: source and target.

Parameters:
aSource source vertex
aTarget target vertex
aThickness thickness (default 1)
aColor color (default qgar::QGE_COLOR_DEFAULT)
anOutline outline (default qgar::QGE_OUTLINE_DEFAULT)

template<class T>
qgar::GenQgarPolyline< T >::GenQgarPolyline const std::list< GenPoint< value_type > > &  aPtList,
int  aThickness = 1,
QGEcolor  aColor = QGE_COLOR_DEFAULT,
QGEoutline  anOutline = QGE_OUTLINE_DEFAULT
[explicit]
 

Initialize from a list of at least two points.

Parameters:
aPtList a list of at least two points
aThickness thickness (default 1)
aColor color (default qgar::QGE_COLOR_DEFAULT)
anOutline outline (default qgar::QGE_OUTLINE_DEFAULT)
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 160 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure.

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

Virtual destructor.

Definition at line 182 of file _QGAR_GenQgarPolyline.TCC.


Member Function Documentation

template<class T>
const GenPolyline< T > & qgar::GenQgarPolyline< T >::accessGeomStructure  )  const [inline, virtual]
 

Get the structure implementing the geometrical aspect of a Qgar polyline.

Implements qgar::AbstractGenQgarPrimitive< T >.

Definition at line 234 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure.

Referenced by qgar::AbstractGraphicsFile::write().

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

Get source point.

Definition at line 147 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::accessGeomStructure(), and qgar::AbstractGenPrimitive< T >::accessSource().

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

Get target point.

Definition at line 167 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::accessGeomStructure(), and qgar::AbstractGenPrimitive< T >::accessTarget().

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

Get vertices in a deque.

Definition at line 259 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure, and qgar::GenPolyline< T >::accessVertices().

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

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

Appends a set of point to a Qgar polyline.

The last point of the vector becomes the new polyline target.

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

Definition at line 338 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure, and qgar::GenPolyline< T >::append().

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

Appends a polyline.

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

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

Appends a Qgar polyline.

Parameters:
aQPoly the Qgar polyline to be appended
Returns:
a reference on the current polyline
Warning:
The thickness, color and outline of the current polyline always remain unchanged.

Definition at line 316 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure, and qgar::GenPolyline< T >::append().

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

Add a point as new source.

Parameters:
aPt a point

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

Append a point as new target.

Parameters:
aPt a point

Referenced by qgar::DxfFile::retrievePQgarPolyline().

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

Create a dynamically allocated deep copy of the primitive.

Implements qgar::AbstractGenQgarPrimitive< T >.

Definition at line 197 of file _QGAR_GenQgarPolyline.TCC.

template<class T>
QGEcolor qgar::AbstractGenQgarPrimitive< T >::color  )  const [inline, inherited]
 

Get color.

Definition at line 122 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::_color.

Referenced by qgar::GenQgarSegment< T >::read(), qgar::GenQgarPolyline< T >::read(), qgar::GenQgarPolygon< T >::read(), qgar::GenQgarArc< T >::read(), and qgar::AbstractGraphicsFile::write().

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

Difference between target and source X coordinates.

Definition at line 237 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::accessGeomStructure(), and qgar::AbstractGenPrimitive< T >::dx().

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

Difference between target and source Y coordinates.

Definition at line 247 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::accessGeomStructure(), and qgar::AbstractGenPrimitive< T >::dy().

template<class T>
void qgar::AbstractGenQgarPrimitive< T >::fixSource const GenPoint< value_type > &  aPt  )  [inline, 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::AbstractGenQgarPrimitive< T >::fixSource 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:
Function qgar::AbstractGenPrimitive::updateSource is called after the modification of the source point.

Definition at line 364 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::fixSource(), and qgar::AbstractGenQgarPrimitive< T >::getGeomStructure().

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

Set both source and target points.

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

template<class T>
void qgar::AbstractGenQgarPrimitive< T >::fixSourceTarget value_type  aXSource,
value_type  aYSource,
value_type  aXTarget,
value_type  aYTarget
[inline, 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::updateTarget is called after the modification of the source target.

Definition at line 402 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::fixSourceTarget(), and qgar::AbstractGenQgarPrimitive< T >::getGeomStructure().

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

Set target point.

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

template<class T>
void qgar::AbstractGenQgarPrimitive< T >::fixTarget 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:
Function qgar::AbstractGenPrimitive::updateTarget is called after the modification of the target point.

Definition at line 383 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::fixTarget(), and qgar::AbstractGenQgarPrimitive< T >::getGeomStructure().

template<class T>
void qgar::AbstractGenQgarPrimitive< T >::fixXSource value_type  aX  )  [inline, 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 474 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::fixXSource(), and qgar::AbstractGenQgarPrimitive< T >::getGeomStructure().

template<class T>
void qgar::AbstractGenQgarPrimitive< T >::fixXTarget value_type  aX  )  [inline, 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 484 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::fixXTarget(), and qgar::AbstractGenQgarPrimitive< T >::getGeomStructure().

template<class T>
void qgar::AbstractGenQgarPrimitive< T >::fixYSource value_type  aY  )  [inline, 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 494 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::fixYSource(), and qgar::AbstractGenQgarPrimitive< T >::getGeomStructure().

template<class T>
void qgar::AbstractGenQgarPrimitive< T >::fixYTarget value_type  aY  )  [inline, 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 504 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenPrimitive< T >::fixYTarget(), and qgar::AbstractGenQgarPrimitive< T >::getGeomStructure().

template<class T>
AbstractGenPrimitive< T > & qgar::GenQgarPolyline< T >::getGeomStructure  )  [inline, protected, virtual]
 

Return the geometrical aspect.

It may then be modified using appropriate transformation function members.

Implements qgar::AbstractGenQgarPrimitive< T >.

Definition at line 407 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure.

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

Give non-protected access to the vertices.

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

Definition at line 269 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure, and qgar::GenPolyline< T >::getVertices().

template<class T>
GenQgarPolyline< T > & qgar::GenQgarPolyline< T >::operator= const GenQgarPolyline< value_type > &  aQPoly  ) 
 

Assignment.

Parameters:
aQPoly a Qgar polyline

Definition at line 211 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure.

template<class T>
QGEoutline qgar::AbstractGenQgarPrimitive< T >::outline  )  const [inline, inherited]
 

Get outline.

Definition at line 132 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::_outline.

Referenced by qgar::GenQgarSegment< T >::read(), qgar::GenQgarPolyline< T >::read(), qgar::GenQgarPolygon< T >::read(), qgar::GenQgarArc< T >::read(), and qgar::AbstractGraphicsFile::write().

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

Deserializes the current polyline from an input stream.

A serialized Qgar polyline is represented as:

QgarPolyline(<GEOMETRICAL STRUCTURE>)(<THICKNESS>)(<COLOR>)(<OUTLINE>)

Parameters:
anInStream The input stream

Implements qgar::ISerializable.

Definition at line 420 of file _QGAR_GenQgarPolyline.TCC.

References qgar::AbstractGenQgarPrimitive< T >::_color, qgar::GenQgarPolyline< T >::_geomStructure, qgar::AbstractGenQgarPrimitive< T >::_outline, qgar::AbstractGenQgarPrimitive< T >::color(), qgar::AbstractGenQgarPrimitive< T >::outline(), qgar::qgReadObjData(), and qgar::qgReadObjName().

template<class T>
GenQgarPolyline<value_type>& qgar::GenQgarPolyline< T >::remove const GenPoint< value_type > &  aPt  ) 
 

Remove a vertex from the polyline.

Parameters:
aPt a point
Warning:
The resulting polyline should be provided with at least two vertices.
Exceptions:
qgar::QgarErrorUser (no removal in a polyline including 2 vertices)

template<class T>
void qgar::AbstractGenQgarPrimitive< T >::setColor QGEcolor  aColor  )  [inline, inherited]
 

Set color.

Parameters:
aColor a color

Definition at line 272 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::_color.

template<class T>
void qgar::AbstractGenQgarPrimitive< T >::setOutline QGEoutline  anOutline  )  [inline, inherited]
 

Set outline.

Parameters:
anOutline an outline

Definition at line 282 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::_outline.

template<class T>
void qgar::AbstractGenQgarPrimitive< 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::AbstractGenQgarPrimitive< 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 298 of file _QGAR_AbstractGenQgarPrimitive.TCC.

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

template<class T>
void qgar::AbstractGenQgarPrimitive< T >::setSourceTarget const GenPoint< value_type > &  aSource,
const GenPoint< value_type > &  aTarget
[inline, 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::AbstractGenQgarPrimitive< T >::setSourceTarget value_type  aXSource,
value_type  aYSource,
value_type  aXTarget,
value_type  aYTarget
[inline, 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 336 of file _QGAR_AbstractGenQgarPrimitive.TCC.

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

template<class T>
void qgar::AbstractGenQgarPrimitive< 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::AbstractGenQgarPrimitive< 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 317 of file _QGAR_AbstractGenQgarPrimitive.TCC.

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

template<class T>
void qgar::AbstractGenQgarPrimitive< T >::setThickness int  aThickness  )  [inline, inherited]
 

Set thickness.

Parameters:
aThickness a thickness

Definition at line 262 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::_thickness.

template<class T>
void qgar::AbstractGenQgarPrimitive< 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 429 of file _QGAR_AbstractGenQgarPrimitive.TCC.

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

template<class T>
void qgar::AbstractGenQgarPrimitive< 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 439 of file _QGAR_AbstractGenQgarPrimitive.TCC.

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

template<class T>
void qgar::AbstractGenQgarPrimitive< 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 449 of file _QGAR_AbstractGenQgarPrimitive.TCC.

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

template<class T>
void qgar::AbstractGenQgarPrimitive< 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 459 of file _QGAR_AbstractGenQgarPrimitive.TCC.

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

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

Get number of vertices.

Definition at line 249 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure, and qgar::GenPolyline< T >::size().

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

Get a copy of the source point.

Definition at line 157 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::accessGeomStructure(), and qgar::AbstractGenPrimitive< T >::source().

Referenced by RWARCVECTOR_arcsInLoop().

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

Get a copy of the target point.

Definition at line 177 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::accessGeomStructure(), and qgar::AbstractGenPrimitive< T >::target().

Referenced by qgar::GenPolyline< T >::append(), and RWARCVECTOR_arcsInLoop().

template<class T>
int qgar::AbstractGenQgarPrimitive< T >::thickness  )  const [inline, inherited]
 

Get thickness.

Definition at line 112 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::_thickness.

Referenced by qgar::AbstractGraphicsFile::write().

template<class T>
std::vector< GenPoint< T > > qgar::GenQgarPolyline< T >::toPointVector  )  [inline]
 

Get a vector of points from the series of vertices.

Definition at line 370 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure, and qgar::GenPolyline< T >::toPointVector().

template<class T>
std::list< GenQgarSegment< T > > qgar::GenQgarPolyline< T >::toQgarSegList  )  [inline]
 

Get a list of Qgar segments from the vertices.

The resulting segments are provided with the same thickness, color and outline as the current polyline.

Definition at line 390 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure, and qgar::GenPolyline< T >::toQgarSegList().

template<class T>
std::list< GenSegment< T > > qgar::GenQgarPolyline< T >::toSegList  )  [inline]
 

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

Definition at line 380 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure, and qgar::GenPolyline< T >::toSegList().

template<class T>
void qgar::GenQgarPolyline< T >::translate value_type  aX,
value_type  aY
[inline, virtual]
 

Translate current polyline along X and Y axis.

Parameters:
aX X translation factor
aY Y translation factor

Reimplemented from qgar::AbstractGenQgarPrimitive< T >.

Definition at line 476 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure.

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

Get a copy of the vertices in a deque.

Definition at line 279 of file _QGAR_GenQgarPolyline.TCC.

References qgar::GenQgarPolyline< T >::_geomStructure, and qgar::GenPolyline< T >::vertices().

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

Serializes the current polyline to an input stream.

A serialized Qgar polyline is represented as:

QgarPolyline(<GEOMETRICAL STRUCTURE>)(<THICKNESS>)(<COLOR>)(<OUTLINE>)

Parameters:
anOutStream The output stream

Implements qgar::ISerializable.

Definition at line 446 of file _QGAR_GenQgarPolyline.TCC.

References qgar::AbstractGenQgarPrimitive< T >::_color, qgar::GenQgarPolyline< T >::_geomStructure, qgar::AbstractGenQgarPrimitive< T >::_outline, and qgar::AbstractGenQgarPrimitive< T >::_thickness.

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

Get X coordinate of the source point.

Definition at line 192 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::accessGeomStructure(), and qgar::AbstractGenPrimitive< T >::xSource().

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

Get X coordinate of the target point.

Definition at line 202 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::accessGeomStructure(), and qgar::AbstractGenPrimitive< T >::xTarget().

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

Get Y coordinate of the source point.

Definition at line 212 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::accessGeomStructure(), and qgar::AbstractGenPrimitive< T >::ySource().

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

Get Y coordinate of the target point.

Definition at line 222 of file _QGAR_AbstractGenQgarPrimitive.TCC.

References qgar::AbstractGenQgarPrimitive< T >::accessGeomStructure(), and qgar::AbstractGenPrimitive< T >::yTarget().


Member Data Documentation

template<class T>
QGEcolor qgar::AbstractGenQgarPrimitive< T >::_color [protected, inherited]
 

Color of the outline.

Definition at line 666 of file _QGAR_AbstractGenQgarPrimitive.H.

Referenced by qgar::AbstractGenQgarPrimitive< T >::color(), qgar::GenQgarSegment< T >::equal(), qgar::GenQgarArc< T >::equal(), qgar::GenQgarSegment< T >::notEqual(), qgar::AbstractGenQgarPrimitive< T >::operator=(), qgar::GenQgarSegment< T >::read(), qgar::GenQgarPolyline< T >::read(), qgar::GenQgarPolygon< T >::read(), qgar::GenQgarArc< T >::read(), qgar::AbstractGenQgarPrimitive< T >::setColor(), qgar::GenQgarSegment< T >::write(), qgar::GenQgarPolyline< T >::write(), qgar::GenQgarPolygon< T >::write(), and qgar::GenQgarArc< T >::write().

template<class T>
GenPolyline<value_type> qgar::GenQgarPolyline< T >::_geomStructure [protected]
 

Geometrical structure.

Definition at line 548 of file _QGAR_GenQgarPolyline.H.

Referenced by qgar::GenQgarPolyline< T >::accessGeomStructure(), qgar::GenQgarPolyline< T >::accessVertices(), qgar::GenQgarPolyline< T >::append(), qgar::GenQgarPolyline< T >::GenQgarPolyline(), qgar::GenQgarPolyline< T >::getGeomStructure(), qgar::GenQgarPolyline< T >::getVertices(), qgar::GenQgarPolyline< T >::operator=(), qgar::GenQgarPolyline< T >::read(), qgar::GenQgarPolyline< T >::size(), qgar::GenQgarPolyline< T >::toPointVector(), qgar::GenQgarPolyline< T >::toQgarSegList(), qgar::GenQgarPolyline< T >::toSegList(), qgar::GenQgarPolyline< T >::translate(), qgar::GenQgarPolyline< T >::vertices(), and qgar::GenQgarPolyline< T >::write().

template<class T>
QGEoutline qgar::AbstractGenQgarPrimitive< T >::_outline [protected, inherited]
 

Type of outline.

See also:
Enum type qgar::QGEoutline

Definition at line 673 of file _QGAR_AbstractGenQgarPrimitive.H.

Referenced by qgar::GenQgarSegment< T >::equal(), qgar::GenQgarArc< T >::equal(), qgar::GenQgarSegment< T >::notEqual(), qgar::AbstractGenQgarPrimitive< T >::operator=(), qgar::AbstractGenQgarPrimitive< T >::outline(), qgar::GenQgarSegment< T >::read(), qgar::GenQgarPolyline< T >::read(), qgar::GenQgarPolygon< T >::read(), qgar::GenQgarArc< T >::read(), qgar::AbstractGenQgarPrimitive< T >::setOutline(), qgar::GenQgarSegment< T >::write(), qgar::GenQgarPolyline< T >::write(), qgar::GenQgarPolygon< T >::write(), and qgar::GenQgarArc< T >::write().

template<class T>
int qgar::AbstractGenQgarPrimitive< T >::_thickness [protected, inherited]
 

Thickness of the outline.

Definition at line 661 of file _QGAR_AbstractGenQgarPrimitive.H.

Referenced by qgar::GenQgarSegment< T >::equal(), qgar::GenQgarArc< T >::equal(), qgar::GenQgarSegment< T >::notEqual(), qgar::AbstractGenQgarPrimitive< T >::operator=(), qgar::AbstractGenQgarPrimitive< T >::setThickness(), qgar::AbstractGenQgarPrimitive< T >::thickness(), qgar::GenQgarSegment< T >::write(), qgar::GenQgarPolyline< T >::write(), qgar::GenQgarPolygon< T >::write(), and qgar::GenQgarArc< T >::write().


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