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

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

#include <qgarlib/primitives.H>

Inheritance diagram for qgar::GenPolygon< T >:

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

Detailed Description

template<class T>
class qgar::GenPolygon< T >

Geometrical polygon, with coordinates of type T.

Warning:
Author:
Gérald Masini
Date:
March 23, 2004 15:15
Since:
Qgar 2.0

Definition at line 152 of file _QGAR_GenPolygon.H.

Public Types

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

Public Member Functions

Constructors
 GenPolygon ()
 Default constructor.
 GenPolygon (const GenPolygon< value_type > &aPoly)
 Copy constructor.
 GenPolygon (const GenQgarPolygon< value_type > &aQPoly)
 Initialize from a Qgar polygon.
 GenPolygon (const std::list< GenPoint< value_type > > &aPtList) throw (QgarErrorUser)
 Initialize from a STL list of at least 3 points.
Destructor
virtual ~GenPolygon ()
 Virtual destructor.
Copy
virtual GenPolygon< value_type > * clone () const
 Perform a deep copy.
Operators
GenPolygon< value_type > & operator= (const GenPolygon< value_type > &aPoly)
 Assignment.
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
GenPolygon< value_type > & appendSource (const GenPoint< value_type > &aPt)
 Insert a point as new source.
GenPolygon< value_type > & appendTarget (const GenPoint< value_type > &aPt)
 Insert a point as new target.
GenPolygon< value_type > & append (const std::vector< GenPoint< value_type > > &aPtVect)
 Appends a set of vertices to a Qgar polygon.
Remove vertices
GenPolygon< value_type > & remove (const GenPoint< value_type > &aPt) throw (QgarErrorUser)
 Remove a vertex from the polygon.
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 STL 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 STL list of Qgar segments, provided with given attributes, from the vertices.
Geometry: Translation
virtual void translate (value_type aTransX, value_type aTransY)
 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 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 polygon
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::GenPolygon< T >::const_pointer
 

Constant pointer to qgar::GenPolygon::value_type.

Reimplemented from qgar::AbstractGenPrimitive< T >.

Definition at line 191 of file _QGAR_GenPolygon.H.

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

Constant reference to qgar::GenPolygon::value_type.

Reimplemented from qgar::AbstractGenPrimitive< T >.

Definition at line 181 of file _QGAR_GenPolygon.H.

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

Pointer to qgar::GenPolygon::value_type.

Reimplemented from qgar::AbstractGenPrimitive< T >.

Definition at line 186 of file _QGAR_GenPolygon.H.

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

Reference to qgar::GenPolygon::value_type.

Reimplemented from qgar::AbstractGenPrimitive< T >.

Definition at line 176 of file _QGAR_GenPolygon.H.

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

Type of the vertices coordinates.

Reimplemented from qgar::AbstractGenPrimitive< T >.

Definition at line 171 of file _QGAR_GenPolygon.H.

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

Constant reference to qgar::GenPolygon::vertices_type.

Definition at line 206 of file _QGAR_GenPolygon.H.

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

Reference to qgar::GenPolygon::vertices_type.

Definition at line 201 of file _QGAR_GenPolygon.H.

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

Type of the vertices container.

Definition at line 196 of file _QGAR_GenPolygon.H.


Constructor & Destructor Documentation

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

Default constructor.

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

Definition at line 63 of file _QGAR_GenPolygon.TCC.

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

Copy constructor.

Parameters:
aPoly a polygon

template<class T>
qgar::GenPolygon< T >::GenPolygon const GenQgarPolygon< value_type > &  aQPoly  )  [explicit]
 

Initialize from a Qgar polygon.

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

Definition at line 88 of file _QGAR_GenPolygon.TCC.

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

Initialize from a STL list of at least 3 points.

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

Definition at line 102 of file _QGAR_GenPolygon.TCC.

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

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

Virtual destructor.

Definition at line 134 of file _QGAR_GenPolygon.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::GenPolygon< T >::accessVertices  )  const [inline]
 

Get vertices.

Definition at line 254 of file _QGAR_GenPolygon.TCC.

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

Referenced by qgar::GenQgarPolygon< T >::accessVertices(), and qgar::GenPolygon< T >::write().

template<class T>
GenPolygon< T > & qgar::GenPolygon< 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 polyline. 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 313 of file _QGAR_GenPolygon.TCC.

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

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

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

Insert a point as new source.

Parameters:
aPt a point

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

Insert a point as new target.

Parameters:
aPt a point

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

Get area.

Definition at line 229 of file _QGAR_GenPolygon.TCC.

References qgar::GenPolygon< T >::signedArea().

Referenced by qgar::GenQgarPolygon< T >::area(), and qgar::GenPolygon< T >::signedArea().

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

Perform a deep copy.

Implements qgar::AbstractGenPrimitive< T >.

Definition at line 149 of file _QGAR_GenPolygon.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::GenPolygon< T >::getVertices  )  [inline]
 

Give non-protected access to the vertices.

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

Definition at line 264 of file _QGAR_GenPolygon.TCC.

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

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

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

Assignment.

Parameters:
aPoly a polygon

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

Deserializes the current polygon from an input stream.

A serialized polygon is represented by:

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

Parameters:
anInStream the input stream

Implements qgar::ISerializable.

Definition at line 477 of file _QGAR_GenPolygon.TCC.

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

template<class T>
GenPolygon<value_type>& qgar::GenPolygon< 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::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>
double qgar::GenPolygon< T >::signedArea  ) 
 

Get signed area.

Definition at line 186 of file _QGAR_GenPolygon.TCC.

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

Referenced by qgar::GenPolygon< T >::area(), and qgar::GenQgarPolygon< T >::signedArea().

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

Get number of vertices.

Definition at line 244 of file _QGAR_GenPolygon.TCC.

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

Referenced by qgar::GenQgarPolygon< 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::GenPolygon< T >::toPointVector  ) 
 

Get a vector of points from the vertices.

Definition at line 389 of file _QGAR_GenPolygon.TCC.

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

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

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

Get a STL 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 435 of file _QGAR_GenPolygon.TCC.

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

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

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

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

Definition at line 406 of file _QGAR_GenPolygon.TCC.

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

Referenced by qgar::GenQgarPolygon< T >::toSegList(), and qgar::DxfFile::write().

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

Translate current segment along X and Y axis.

Parameters:
aTransX X translation factor
aTransY Y translation factor

Implements qgar::AbstractGenPrimitive< T >.

Definition at line 586 of file _QGAR_GenPolygon.TCC.

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

Referenced by qgar::GenQgarPolygon< T >::translate().

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

Update the geometrical structure when the source has been changed.

Implements qgar::AbstractGenPrimitive< T >.

Definition at line 552 of file _QGAR_GenPolygon.TCC.

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

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

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

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

Implements qgar::AbstractGenPrimitive< T >.

Definition at line 572 of file _QGAR_GenPolygon.TCC.

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

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

Update the geometrical structure when the target has been changed.

Implements qgar::AbstractGenPrimitive< T >.

Definition at line 562 of file _QGAR_GenPolygon.TCC.

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

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

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

Get a copy of the vertices.

Definition at line 274 of file _QGAR_GenPolygon.TCC.

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

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

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

Serializes the current polygon to an input stream.

A serialized polygon is represented by:

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

Parameters:
anOutStream the output stream

Implements qgar::ISerializable.

Definition at line 507 of file _QGAR_GenPolygon.TCC.

References qgar::GenPolygon< T >::accessVertices(), qgar::AbstractGenPrimitive< T >::source(), and qgar::AbstractGenPrimitive< T >::target().

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::GenPolygon< T >::_vertices [protected]
 

Vertices.

Definition at line 494 of file _QGAR_GenPolygon.H.

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


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