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

O
+---------------> X
|\ |
| \ <-'
| \ angle (in radians, unless specified)
| \
|
V
Y
O O
+----------------------> X +----------------------> X
| center |
| + + source | -----
| | | arc / \
| / arc | | + v
| target +<- | \ + target
| | +
V V source
Y Y
Definition at line 131 of file _QGAR_GenArc.H.
Public Types | |
Types | |
| typedef T | value_type |
| Type of the coordinates of the source, target and center. | |
| typedef value_type & | reference |
| Reference to qgar::GenArc::value_type. | |
| typedef const value_type & | const_reference |
| Constant reference to qgar::GenArc::value_type. | |
| typedef value_type * | pointer |
| Pointer to qgar::GenArc::value_type. | |
| typedef const value_type * | const_pointer |
| Constant pointer to qgar::GenArc::value_type. | |
Public Member Functions | |
Constructors | |
| GenArc () | |
| Default constructor. | |
| GenArc (const GenArc< value_type > &anArc) | |
| Copy constructor. | |
| GenArc (const GenQgarArc< value_type > &aQArc) | |
| Initialize from a Qgar arc. | |
| GenArc (const GenPoint< value_type > &aSource, const GenPoint< value_type > &aTarget, const GenPoint< value_type > &aCenter) | |
| Initialize from three points. | |
Destructor | |
| virtual | ~GenArc () |
| Virtual destructor. | |
Copy | |
| virtual GenArc< value_type > * | clone () const |
| Return a deep copy of the current arc. | |
Access to geometrical features | |
| double | radius () const |
| Get radius. | |
| double | length () const |
| Get arc length. | |
| double | angle () const |
| Get arc angle, in [0, 2PI] radians. | |
| double | angleDegrees () const |
| Get arc angle, in [0, 360] degrees. | |
| double | sourceAngle () const |
| Get the so-called source angle. | |
| double | sourceAngleDegrees () const |
| Get the source angle, in [0, 360] degrees. | |
| double | targetAngle () const |
| Get the so-called target angle. | |
| double | targetAngleDegrees () const |
| Get the target angle, in [0, 360] degrees. | |
Center | |
| const GenPoint< value_type > & | accessCenter () const |
| Get the center point. | |
| GenPoint< value_type > | center () const |
| Get a copy of the center point. | |
| value_type | xCenter () const |
| Get X coordinate of center point. | |
| value_type | yCenter () const |
| Get Y coordinate of center point. | |
| void | setXCenter (value_type aX) |
| Set X coordinate of the center point. | |
| void | setYCenter (value_type aY) |
| Set Y coordinate of the center point. | |
| void | setCenter (value_type aX, value_type aY) |
| Set the center point. | |
| void | setCenter (const GenPoint< value_type > &aCenter) |
| Set the center point. | |
Operators | |
| GenArc< value_type > & | operator= (const GenArc< value_type > &anArc) |
| Assignment. | |
| bool | operator== (const GenArc< value_type > &anArc) const |
| Same as function qgar::GenArc::eq. | |
| bool | operator!= (const GenArc< value_type > &anArc) const |
| Same as function qgar::GenArc::notEq. | |
Functional operators | |
| bool | eq (const GenArc< value_type > &anArc) const |
| Equality. | |
| bool | notEq (const GenArc< value_type > &anArc) const |
| Inequality. | |
Geometry: Translation | |
| virtual void | translate (value_type aTransX, value_type aTransY) |
| Translate current arc along X and Y axis. | |
Serialization/deserialization | |
| virtual std::istream & | read (std::istream &anInStream) |
| Deserializes the current arc from an input stream. | |
| virtual std::ostream & | write (std::ostream &anOutStream) const |
| Serializes the current arc to an input stream. | |
Protected Member Functions | |
Implementation of pure virtual functions | |
| 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 an arc | |
| GenPoint< value_type > | _center |
| Center of the circle supporting the arc. | |
|
|||||
|
Constant pointer to qgar::GenArc::value_type.
Reimplemented from qgar::AbstractGenPrimitive< T >. Definition at line 170 of file _QGAR_GenArc.H. |
|
|||||
|
Constant reference to qgar::GenArc::value_type.
Reimplemented from qgar::AbstractGenPrimitive< T >. Definition at line 160 of file _QGAR_GenArc.H. |
|
|||||
|
Pointer to qgar::GenArc::value_type.
Reimplemented from qgar::AbstractGenPrimitive< T >. Definition at line 165 of file _QGAR_GenArc.H. |
|
|||||
|
Reference to qgar::GenArc::value_type.
Reimplemented from qgar::AbstractGenPrimitive< T >. Definition at line 155 of file _QGAR_GenArc.H. |
|
|||||
|
Type of the coordinates of the source, target and center.
Reimplemented from qgar::AbstractGenPrimitive< T >. Definition at line 150 of file _QGAR_GenArc.H. |
|
|||||||||
|
Default constructor. Zero-length arc located at the origin of the coordinate system.
Definition at line 58 of file _QGAR_GenArc.TCC. |
|
||||||||||
|
Copy constructor.
|
|
||||||||||
|
Initialize from a Qgar arc.
Definition at line 84 of file _QGAR_GenArc.TCC. |
|
||||||||||||||||||||
|
Initialize from three points.
|
|
|||||||||
|
Virtual destructor.
Definition at line 115 of file _QGAR_GenArc.TCC. |
|
|||||||||
|
Get the center point.
Definition at line 240 of file _QGAR_GenArc.TCC. References qgar::GenArc< T >::_center. |
|
|||||||||
|
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(). |
|
|||||||||
|
Get arc angle, in [0, 2PI] radians. Always positive. Definition at line 163 of file _QGAR_GenArc.TCC. References qgar::Math::QG_2PI, qgar::GenArc< T >::sourceAngle(), and qgar::GenArc< T >::targetAngle(). Referenced by qgar::GenArc< T >::angleDegrees(), and qgar::GenArc< T >::length(). |
|
|||||||||
|
Get arc angle, in [0, 360] degrees. Always positive. Definition at line 183 of file _QGAR_GenArc.TCC. References qgar::GenArc< T >::angle(), and qgar::qgRadiansToDegrees(). |
|
|||||||||
|
Get a copy of the center point.
Definition at line 250 of file _QGAR_GenArc.TCC. References qgar::GenArc< T >::_center. Referenced by qgar::GenArc< T >::write(). |
|
|||||||||
|
Return a deep copy of the current arc.
Implements qgar::AbstractGenPrimitive< T >. Definition at line 128 of file _QGAR_GenArc.TCC. |
|
|||||||||
|
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(). |
|
||||||||||
|
Equality. Return true if the current arc and the given arc have the same coordinates.
|
|
||||||||||
|
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(). |
|
|||||||||
|
Get arc length.
Definition at line 153 of file _QGAR_GenArc.TCC. References qgar::GenArc< T >::angle(). |
|
||||||||||
|
Inequality. Return true if the coordinates of the current and given arcs are different.
|
|
||||||||||
|
Same as function qgar::GenArc::notEq.
|
|
||||||||||
|
Assignment.
|
|
||||||||||
|
Same as function qgar::GenArc::eq.
|
|
|||||||||
|
Get radius.
Definition at line 143 of file _QGAR_GenArc.TCC. References qgar::qgDist(). Referenced by qgar::TgifFile::write(), and qgar::DxfFile::write(). |
|
||||||||||
|
Deserializes the current arc from an input stream. A serialized arc is represented as: Arc(<SOURCE>)(<TARGET>)(<CENTER>)
Implements qgar::ISerializable. Definition at line 396 of file _QGAR_GenArc.TCC. References qgar::qgReadObjData(), and qgar::qgReadObjName(). |
|
||||||||||
|
Set the center point.
|
|
||||||||||||||||
|
Set the center point.
Definition at line 302 of file _QGAR_GenArc.TCC. References qgar::GenArc< T >::_center. Referenced by qgar::GenArc< T >::translate(). |
|
||||||||||
|
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 center point.
Definition at line 281 of file _QGAR_GenArc.TCC. References qgar::GenArc< T >::_center. |
|
||||||||||
|
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 center point.
Definition at line 292 of file _QGAR_GenArc.TCC. References qgar::GenArc< T >::_center. |
|
||||||||||
|
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 the so-called source angle. It is the angle between the vector joining the center to the source point and the X axis, in [0, 2PI] radians. Definition at line 194 of file _QGAR_GenArc.TCC. References qgar::qgAngle(). Referenced by qgar::GenArc< T >::angle(). |
|
|||||||||
|
Get the source angle, in [0, 360] degrees.
Definition at line 204 of file _QGAR_GenArc.TCC. References qgar::qgRadiansToDegrees(). Referenced by qgar::TgifFile::write(), and qgar::DxfFile::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(). |
|
|||||||||
|
Get the so-called target angle. It is the angle between the vector joining the center to the target point and the X axis, in [0, 2PI] radians. Definition at line 215 of file _QGAR_GenArc.TCC. References qgar::qgAngle(). Referenced by qgar::GenArc< T >::angle(). |
|
|||||||||
|
Get the target angle, in [0, 360] degrees.
Definition at line 225 of file _QGAR_GenArc.TCC. References qgar::qgRadiansToDegrees(). Referenced by qgar::TgifFile::write(), and qgar::DxfFile::write(). |
|
||||||||||||||||
|
Translate current arc along X and Y axis.
Implements qgar::AbstractGenPrimitive< T >. Definition at line 473 of file _QGAR_GenArc.TCC. References qgar::GenArc< T >::_center, qgar::GenArc< T >::setCenter(), qgar::AbstractGenPrimitive< T >::setSourceTarget(), qgar::GenPoint< T >::x(), qgar::AbstractGenPrimitive< T >::xTarget(), qgar::GenPoint< T >::y(), qgar::AbstractGenPrimitive< T >::ySource(), and qgar::AbstractGenPrimitive< T >::yTarget(). |
|
|||||||||
|
Update the geometrical structure when the source has been changed. Inherited from qgar::AbstractGenPrimitive. Implements qgar::AbstractGenPrimitive< T >. Definition at line 440 of file _QGAR_GenArc.TCC. |
|
|||||||||
|
Update the geometrical structure when both source and target have been changed. Inherited from qgar::AbstractGenPrimitive. Implements qgar::AbstractGenPrimitive< T >. Definition at line 460 of file _QGAR_GenArc.TCC. |
|
|||||||||
|
Update the geometrical structure when the target has been changed. Inherited from qgar::AbstractGenPrimitive. Implements qgar::AbstractGenPrimitive< T >. Definition at line 450 of file _QGAR_GenArc.TCC. |
|
||||||||||
|
Serializes the current arc to an input stream. A serialized arc is represented as: Arc(<SOURCE>)(<TARGET>)(<CENTER>)
Implements qgar::ISerializable. Definition at line 410 of file _QGAR_GenArc.TCC. References qgar::GenArc< T >::center(), qgar::AbstractGenPrimitive< T >::source(), and qgar::AbstractGenPrimitive< T >::target(). |
|
|||||||||
|
Get X coordinate of center point.
Definition at line 260 of file _QGAR_GenArc.TCC. References qgar::GenPoint< T >::x(). Referenced by qgar::TgifFile::write(), and qgar::DxfFile::write(). |
|
|||||||||
|
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 center point.
Definition at line 270 of file _QGAR_GenArc.TCC. Referenced by qgar::TgifFile::write(), and qgar::DxfFile::write(). |
|
|||||||||
|
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(). |
|
|||||
|
Center of the circle supporting the arc.
Definition at line 470 of file _QGAR_GenArc.H. Referenced by qgar::GenArc< T >::accessCenter(), qgar::GenArc< T >::center(), qgar::GenArc< T >::setCenter(), qgar::GenArc< T >::setXCenter(), qgar::GenArc< T >::setYCenter(), and qgar::GenArc< T >::translate(). |
|
|||||
|
|||||