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

Such a primitive is provided with a so-called source point (head) and a so-called target point (tail), arbitrarily defined.
Predefined types: qgar::Primitive, qgar::IPrimitive, qgar::FPrimitive, qgar::DPrimitive.
Definition at line 96 of file _QGAR_AbstractGenPrimitive.H.
Public Types | |
Types | |
| typedef T | value_type |
| Type of a point of a primitive. | |
| typedef value_type & | reference |
| Reference to qgar::AbstractGenPrimitive::value_type. | |
| typedef const value_type & | const_reference |
| Constant reference to qgar::AbstractGenPrimitive::value_type. | |
| typedef value_type * | pointer |
| Pointer to qgar::AbstractGenPrimitive::value_type. | |
| typedef const value_type * | const_pointer |
| Constant pointer to qgar::AbstractGenPrimitive::value_type. | |
Public Member Functions | |
Constructors | |
| AbstractGenPrimitive () | |
| Default constructor. | |
| AbstractGenPrimitive (const AbstractGenPrimitive< value_type > &aPrim) | |
| Copy constructor. | |
| AbstractGenPrimitive (const GenPoint< value_type > aSource, const GenPoint< value_type > aTarget) | |
| Initialize from source and target. | |
| AbstractGenPrimitive (value_type aXSource, value_type aYSource, value_type aXTarget, value_type aYTarget) | |
| Initialize from coordinates. | |
Destructor | |
| virtual | ~AbstractGenPrimitive () |
| Virtual destructor. | |
Copy | |
| virtual AbstractGenPrimitive< value_type > * | clone () const =0 |
| Perform a deep copy. | |
Access to source and target | |
| const GenPoint< value_type > & | accessSource () const |
| Get source point. | |
| GenPoint< value_type > | source () const |
| Get a copy of the source point. | |
| const GenPoint< value_type > & | accessTarget () const |
| Get target point. | |
| GenPoint< value_type > | target () 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. | |
Operators | |
| AbstractGenPrimitive< value_type > & | operator= (const AbstractGenPrimitive< value_type > &aPrim) |
| Assignment. | |
Geometry: Translation | |
| virtual void | translate (value_type aX, value_type aY)=0 |
| Translate current primitive along X and Y axis. | |
Protected Member Functions | |
Updates subsequent to source and target modifications | |
| virtual void | updateSource ()=0 |
| Update the geometrical structure when the source point is modified. | |
| virtual void | updateTarget ()=0 |
| Update the geometrical structure when the target point is modified. | |
| virtual void | updateSourceTarget ()=0 |
| Update the geometrical structure when both source and targets points are modified. | |
Protected Attributes | |
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. | |
|
|||||
|
Constant pointer to qgar::AbstractGenPrimitive::value_type.
Reimplemented in qgar::GenArc< T >, qgar::GenPolygon< T >, qgar::GenPolyline< T >, qgar::GenSegment< T >, qgar::GenArc< value_type >, qgar::GenPolygon< value_type >, qgar::GenPolyline< value_type >, qgar::GenSegment< value_type >, and qgar::GenSegment< int >. Definition at line 131 of file _QGAR_AbstractGenPrimitive.H. |
|
|||||
|
Constant reference to qgar::AbstractGenPrimitive::value_type.
Reimplemented in qgar::GenArc< T >, qgar::GenPolygon< T >, qgar::GenPolyline< T >, qgar::GenSegment< T >, qgar::GenArc< value_type >, qgar::GenPolygon< value_type >, qgar::GenPolyline< value_type >, qgar::GenSegment< value_type >, and qgar::GenSegment< int >. Definition at line 121 of file _QGAR_AbstractGenPrimitive.H. |
|
|||||
|
Pointer to qgar::AbstractGenPrimitive::value_type.
Reimplemented in qgar::GenArc< T >, qgar::GenPolygon< T >, qgar::GenPolyline< T >, qgar::GenSegment< T >, qgar::GenArc< value_type >, qgar::GenPolygon< value_type >, qgar::GenPolyline< value_type >, qgar::GenSegment< value_type >, and qgar::GenSegment< int >. Definition at line 126 of file _QGAR_AbstractGenPrimitive.H. |
|
|||||
|
Reference to qgar::AbstractGenPrimitive::value_type.
Reimplemented in qgar::GenArc< T >, qgar::GenPolygon< T >, qgar::GenPolyline< T >, qgar::GenSegment< T >, qgar::GenArc< value_type >, qgar::GenPolygon< value_type >, qgar::GenPolyline< value_type >, qgar::GenSegment< value_type >, and qgar::GenSegment< int >. Definition at line 116 of file _QGAR_AbstractGenPrimitive.H. |
|
|||||
|
Type of a point of a primitive.
Reimplemented in qgar::GenArc< T >, qgar::GenPolygon< T >, qgar::GenPolyline< T >, qgar::GenSegment< T >, qgar::GenArc< value_type >, qgar::GenPolygon< value_type >, qgar::GenPolyline< value_type >, qgar::GenSegment< value_type >, and qgar::GenSegment< int >. Definition at line 111 of file _QGAR_AbstractGenPrimitive.H. |
|
|||||||||
|
Default constructor. Source and target at (0, 0). Definition at line 63 of file _QGAR_AbstractGenPrimitive.TCC. |
|
||||||||||
|
Copy constructor.
|
|
||||||||||||||||
|
Initialize from source and target.
|
|
||||||||||||||||||||||||
|
Initialize from coordinates.
Definition at line 106 of file _QGAR_AbstractGenPrimitive.TCC. |
|
|||||||||
|
Virtual destructor.
Definition at line 128 of file _QGAR_AbstractGenPrimitive.TCC. |
|
|||||||||
|
Get source point.
Definition at line 143 of file _QGAR_AbstractGenPrimitive.TCC. References qgar::AbstractGenPrimitive< T >::_source. Referenced by qgar::AbstractGenQgarPrimitive< T >::accessSource(). |
|
|||||||||
|
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(). |
|
|||||||||
|
Perform a deep copy.
Implemented in qgar::GenArc< T >, qgar::GenPolygon< T >, qgar::GenPolyline< T >, qgar::GenSegment< T >, qgar::GenArc< value_type >, qgar::GenPolygon< value_type >, qgar::GenPolyline< value_type >, qgar::GenSegment< value_type >, and qgar::GenSegment< int >. |
|
|||||||||
|
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(). |
|
|||||||||
|
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(). |
|
||||||||||
|
Set source point.
|
|
||||||||||||||||
|
Set 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(). |
|
||||||||||||||||
|
Set both source and target points.
|
|
||||||||||||||||||||||||
|
Set both 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(). |
|
||||||||||
|
Set target point.
|
|
||||||||||||||||
|
Set 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(). |
|
||||||||||
|
Set X coordinate 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(). |
|
||||||||||
|
Set X coordinate 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(). |
|
||||||||||
|
Set Y coordinate 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(). |
|
||||||||||
|
Set Y coordinate 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(). |
|
||||||||||
|
Assignment.
|
|
||||||||||
|
Set source point.
|
|
||||||||||||||||
|
Set source point.
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(). |
|
||||||||||||||||
|
Set both source and target points.
|
|
||||||||||||||||||||||||
|
Set both source and target points.
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(). |
|
||||||||||
|
Set target point.
|
|
||||||||||||||||
|
Set target point.
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(). |
|
||||||||||
|
Set X coordinate of the source point.
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(). |
|
||||||||||
|
Set X coordinate of the target point.
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(). |
|
||||||||||
|
Set Y coordinate of the source point.
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(). |
|
||||||||||
|
Set Y coordinate of the target point.
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(). |
|
|||||||||
|
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(). |
|
|||||||||
|
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(). |
|
||||||||||||||||
|
Translate current primitive along X and Y axis.
Implemented in qgar::GenArc< T >, qgar::GenPolygon< T >, qgar::GenPolyline< T >, qgar::GenSegment< T >, qgar::GenArc< value_type >, qgar::GenPolygon< value_type >, qgar::GenPolyline< value_type >, qgar::GenSegment< value_type >, and qgar::GenSegment< int >. |
|
|||||||||
|
Update the geometrical structure when the source point is modified.
Implemented in qgar::GenArc< T >, qgar::GenPolygon< T >, qgar::GenPolyline< T >, qgar::GenSegment< T >, qgar::GenArc< value_type >, qgar::GenPolygon< value_type >, qgar::GenPolyline< value_type >, qgar::GenSegment< value_type >, and qgar::GenSegment< int >. Referenced by qgar::AbstractGenPrimitive< T >::fixSource(), qgar::AbstractGenPrimitive< T >::fixXSource(), and qgar::AbstractGenPrimitive< T >::fixYSource(). |
|
|||||||||
|
Update the geometrical structure when both source and targets points are modified.
Implemented in qgar::GenArc< T >, qgar::GenPolygon< T >, qgar::GenPolyline< T >, qgar::GenSegment< T >, qgar::GenArc< value_type >, qgar::GenPolygon< value_type >, qgar::GenPolyline< value_type >, qgar::GenSegment< value_type >, and qgar::GenSegment< int >. Referenced by qgar::AbstractGenPrimitive< T >::fixSourceTarget(). |
|
|||||||||
|
Update the geometrical structure when the target point is modified.
Implemented in qgar::GenArc< T >, qgar::GenPolygon< T >, qgar::GenPolyline< T >, qgar::GenSegment< T >, qgar::GenArc< value_type >, qgar::GenPolygon< value_type >, qgar::GenPolyline< value_type >, qgar::GenSegment< value_type >, and qgar::GenSegment< int >. Referenced by qgar::AbstractGenPrimitive< T >::fixTarget(), qgar::AbstractGenPrimitive< T >::fixXTarget(), and qgar::AbstractGenPrimitive< T >::fixYTarget(). |
|
|||||||||
|
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(). |
|
|||||||||
|
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(). |
|
|||||||||
|
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(). |
|
|||||||||
|
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(). |
|
|||||
|
|||||