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

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

#include <qgarlib/primitives.H>

Inheritance diagram for qgar::GenQgarPolygon< T >:

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

Detailed Description

template<class T>
class qgar::GenQgarPolygon< T >

Graphical polygon, so-called Qgar polygon, with coordinates of type T.

Warning:
Author:
Gérald Masini
Date:
March 23, 2004 22:45
Since:
Qgar 2.1

Definition at line 149 of file _QGAR_GenQgarPolygon.H.

Public Types

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

Public Member Functions

Constructors
 GenQgarPolygon (int aThickness=1, QGEcolor aColor=QGE_COLOR_DEFAULT, QGEoutline anOutline=QGE_OUTLINE_DEFAULT)
 Default constructor: The vertices deque is empty.
 GenQgarPolygon (const GenQgarPolygon< T > &aQPoly)
 Copy constructor.
 GenQgarPolygon (const GenPolygon< value_type > &aPoly, int aThickness=1, QGEcolor aColor=QGE_COLOR_DEFAULT, QGEoutline anOutline=QGE_OUTLINE_DEFAULT)
 Initialize from a geometrical polygon.
 GenQgarPolygon (const std::list< GenPoint< value_type > > &aPtList, int aThickness=1, QGEcolor aColor=QGE_COLOR_DEFAULT, QGEoutline anOutline=QGE_OUTLINE_DEFAULT) throw (QgarErrorUser)
 Initialize from a STL list of at least 3 points.
Destructor
virtual ~GenQgarPolygon ()
 Virtual destructor.
Copy
virtual GenQgarPolygon< value_type > * clone () const
 Perform a deep copy.
Operators
GenQgarPolygon< value_type > & operator= (const GenQgarPolygon< value_type > &aQPoly)
 Assignment.
Access to the geometrical structure
const GenPolygon< value_type > & accessGeomStructure () const
 Get the structure implementing the geometrical aspect of a Qgar polygon.
Area
double signedArea ()
 Get signed area.
double area ()
 Get area.
Access to vertices
int size () const
 Get number of vertices.
vertices_const_reference accessVertices () const
 Get vertices.
vertices_reference getVertices ()
 Give non-protected access to the vertices.
vertices_type vertices () const
 Get a copy of the vertices.
Insert vertices
GenQgarPolygon< value_type > & appendSource (const GenPoint< value_type > &aPt)
 Insert a point as new source.
GenQgarPolygon< value_type > & appendTarget (const GenPoint< value_type > &aPt)
 Insert a point as new target.
GenQgarPolygon< value_type > & append (const std::vector< GenPoint< value_type > > &aPtVect)
 Appends a set of vertices to a Qgar polygon.
Remove vertices
GenQgarPolygon< value_type > & remove (const GenPoint< value_type > &aPt) throw (QgarErrorUser)
 Remove a vertex from the polygon.
Conversion 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 STL list of (geometrical) segments from the vertices.
std::list< GenQgarSegment<
value_type > > 
toQgarSegList ()
 Get a STL list of Qgar segments,.
Geometry: Translation
virtual void translate (value_type aX, value_type aY)
 Translate current segment along X and Y axis.
Serialization/deserialization
virtual std::istream & read (std::istream &anInStream)
 Deserializes the current polygon from an input stream.
virtual std::ostream & write (std::ostream &anOutStream) const
 Serializes the current polygon 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, which may then be modified using appropriate function members.

Protected Attributes

Geometrical structure of a Qgar polygon
GenPolygon< 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::GenQgarPolygon< T >::const_pointer
 

Constant pointer to qgar::GenQgarPolygon::value_type.

Reimplemented from qgar::AbstractGenQgarPrimitive< T >.

Definition at line 188 of file _QGAR_GenQgarPolygon.H.

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

Constant reference to qgar::GenQgarPolygon::value_type.

Reimplemented from qgar::AbstractGenQgarPrimitive< T >.

Definition at line 178 of file _QGAR_GenQgarPolygon.H.

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

Pointer to qgar::GenQgarPolygon::value_type.

Reimplemented from qgar::AbstractGenQgarPrimitive< T >.

Definition at line 183 of file _QGAR_GenQgarPolygon.H.

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

Reference to qgar::GenQgarPolygon::value_type.

Reimplemented from qgar::AbstractGenQgarPrimitive< T >.

Definition at line 173 of file _QGAR_GenQgarPolygon.H.

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

Type of the vertices coordinates.

Reimplemented from qgar::AbstractGenQgarPrimitive< T >.

Definition at line 168 of file _QGAR_GenQgarPolygon.H.

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

Constant reference to qgar::GenQgarPolygon::vertices_type.

Definition at line 203 of file _QGAR_GenQgarPolygon.H.

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

Reference to qgar::GenQgarPolygon::vertices_type.

Definition at line 198 of file _QGAR_GenQgarPolygon.H.

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

Type of the vertices container.

Definition at line 193 of file _QGAR_GenQgarPolygon.H.


Constructor & Destructor Documentation

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

Default constructor: The vertices deque is empty.

Parameters:
aThickness thickness (default 1)
aColor color (default qgar::QGE_COLOR_DEFAULT)
anOutline outline (default qgar::QGE_OUTLINE_DEFAULT)
Todo:
The vertices should at least be 3!

Definition at line 63 of file _QGAR_GenQgarPolygon.TCC.

template<class T>
qgar::GenQgarPolygon< T >::GenQgarPolygon const GenQgarPolygon< T > &  aQPoly  ) 
 

Copy constructor.

Parameters:
aQPoly a Qgar polygon

Definition at line 77 of file _QGAR_GenQgarPolygon.TCC.

template<class T>
qgar::GenQgarPolygon< T >::GenQgarPolygon const GenPolygon< value_type > &  aPoly,
int  aThickness = 1,
QGEcolor  aColor = QGE_COLOR_DEFAULT,
QGEoutline  anOutline = QGE_OUTLINE_DEFAULT
 

Initialize from a geometrical polygon.

Parameters:
aPoly a (geometrical) polygon
aThickness thickness (default 1)
aColor color (default qgar::QGE_COLOR_DEFAULT)
anOutline outline (default qgar::QGE_OUTLINE_DEFAULT)

template<class T>
qgar::GenQgarPolygon< T >::GenQgarPolygon const std::list< GenPoint< value_type > > &  aPtList,
int  aThickness = 1,
QGEcolor  aColor = QGE_COLOR_DEFAULT,
QGEoutline  anOutline = QGE_OUTLINE_DEFAULT
throw (QgarErrorUser)
 

Initialize from a STL list of at least 3 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)
Exceptions:
qgar::QgarErrorUser (cannot create a polygon of less than 3 vertices)

Definition at line 108 of file _QGAR_GenQgarPolygon.TCC.

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

Virtual destructor.

Definition at line 135 of file _QGAR_GenQgarPolygon.TCC.


Member Function Documentation

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

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

Implements qgar::AbstractGenQgarPrimitive< T >.

Definition at line 188 of file _QGAR_GenQgarPolygon.TCC.

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

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::GenQgarPolygon< T >::accessVertices  )  const [inline]
 

Get vertices.

Definition at line 238 of file _QGAR_GenQgarPolygon.TCC.

References qgar::GenQgarPolygon< T >::_geomStructure, and qgar::GenPolygon< T >::accessVertices().

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

Appends a set of vertices to a Qgar polygon.

The given vertices are inserted after the target vertex. The order of the given vertices is preserved in the resulting polygon. The last vertex of the vector becomes the new target.

Parameters:
aPtVect STL vector of vertices to be appended
Returns:
a reference on the polygon.

Definition at line 295 of file _QGAR_GenQgarPolygon.TCC.

References qgar::GenQgarPolygon< T >::_geomStructure, and qgar::GenPolygon< T >::append().

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

Insert a point as new source.

Parameters:
aPt a point

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

Insert a point as new target.

Parameters:
aPt a point

template<class T>
double qgar::GenQgarPolygon< T >::area  )  [inline]
 

Get area.

Definition at line 213 of file _QGAR_GenQgarPolygon.TCC.

References qgar::GenQgarPolygon< T >::_geomStructure, and qgar::GenPolygon< T >::area().

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

Perform a deep copy.

Implements qgar::AbstractGenQgarPrimitive< T >.

Definition at line 150 of file _QGAR_GenQgarPolygon.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::GenQgarPolygon< T >::getGeomStructure  )  [inline, protected, virtual]
 

Return the geometrical aspect, which may then be modified using appropriate function members.

Implements qgar::AbstractGenQgarPrimitive< T >.

Definition at line 424 of file _QGAR_GenQgarPolygon.TCC.

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

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

Give non-protected access to the vertices.

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

Definition at line 248 of file _QGAR_GenQgarPolygon.TCC.

References qgar::GenQgarPolygon< T >::_geomStructure, and qgar::GenPolygon< T >::getVertices().

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

Assignment.

Parameters:
aQPoly a Qgar polygon

Definition at line 165 of file _QGAR_GenQgarPolygon.TCC.

References qgar::GenQgarPolygon< 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::GenQgarPolygon< T >::read std::istream &  anInStream  )  [virtual]
 

Deserializes the current polygon from an input stream.

A serialized Qgar polygon is represented as:

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

Parameters:
anInStream the input stream

Implements qgar::ISerializable.

Definition at line 374 of file _QGAR_GenQgarPolygon.TCC.

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

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

Remove a vertex from the polygon.

Parameters:
aPt a point
Exceptions:
qgar::QgarErrorUser (no removal in a polygon including 3 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>
double qgar::GenQgarPolygon< T >::signedArea  )  [inline]
 

Get signed area.

Definition at line 203 of file _QGAR_GenQgarPolygon.TCC.

References qgar::GenQgarPolygon< T >::_geomStructure, and qgar::GenPolygon< T >::signedArea().

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

Get number of vertices.

Definition at line 228 of file _QGAR_GenQgarPolygon.TCC.

References qgar::GenQgarPolygon< T >::_geomStructure, and qgar::GenPolygon< 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::GenQgarPolygon< T >::toPointVector  )  [inline]
 

Get a vector of points from the vertices.

Definition at line 338 of file _QGAR_GenQgarPolygon.TCC.

References qgar::GenQgarPolygon< T >::_geomStructure, and qgar::GenPolygon< T >::toPointVector().

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

Get a STL list of Qgar segments,.

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

Definition at line 359 of file _QGAR_GenQgarPolygon.TCC.

References qgar::GenQgarPolygon< T >::_geomStructure, and qgar::GenPolygon< T >::toQgarSegList().

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

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

Definition at line 348 of file _QGAR_GenQgarPolygon.TCC.

References qgar::GenQgarPolygon< T >::_geomStructure, and qgar::GenPolygon< T >::toSegList().

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

Translate current segment along X and Y axis.

Parameters:
aX X translation factor
aY Y translation factor

Reimplemented from qgar::AbstractGenQgarPrimitive< T >.

Definition at line 445 of file _QGAR_GenQgarPolygon.TCC.

References qgar::GenQgarPolygon< T >::_geomStructure, and qgar::GenPolygon< T >::translate().

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

Get a copy of the vertices.

Definition at line 258 of file _QGAR_GenQgarPolygon.TCC.

References qgar::GenQgarPolygon< T >::_geomStructure, and qgar::GenPolygon< T >::vertices().

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

Serializes the current polygon to an input stream.

A serialized Qgar polygon is represented as:

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

Parameters:
anOutStream the output stream

Implements qgar::ISerializable.

Definition at line 400 of file _QGAR_GenQgarPolygon.TCC.

References qgar::AbstractGenQgarPrimitive< T >::_color, qgar::GenQgarPolygon< 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>
GenPolygon<value_type> qgar::GenQgarPolygon< T >::_geomStructure [protected]
 

Geometrical structure.

Definition at line 508 of file _QGAR_GenQgarPolygon.H.

Referenced by qgar::GenQgarPolygon< T >::accessGeomStructure(), qgar::GenQgarPolygon< T >::accessVertices(), qgar::GenQgarPolygon< T >::append(), qgar::GenQgarPolygon< T >::area(), qgar::GenQgarPolygon< T >::getGeomStructure(), qgar::GenQgarPolygon< T >::getVertices(), qgar::GenQgarPolygon< T >::operator=(), qgar::GenQgarPolygon< T >::read(), qgar::GenQgarPolygon< T >::signedArea(), qgar::GenQgarPolygon< T >::size(), qgar::GenQgarPolygon< T >::toPointVector(), qgar::GenQgarPolygon< T >::toQgarSegList(), qgar::GenQgarPolygon< T >::toSegList(), qgar::GenQgarPolygon< T >::translate(), qgar::GenQgarPolygon< T >::vertices(), and qgar::GenQgarPolygon< 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: