#include <WDSegmentList.H>
Inheritance diagram for qgar::WDSegment:

Definition at line 86 of file WDSegmentList.H.
Public Types | |
| typedef int | value_type |
| Type of the source and target coordinates. | |
| typedef value_type & | reference |
| Reference to qgar::GenSegment::value_type. | |
| typedef const value_type & | const_reference |
| Constant reference to qgar::GenSegment::value_type. | |
| typedef value_type * | pointer |
| Pointer to qgar::GenSegment::value_type. | |
| typedef const value_type * | const_pointer |
| Constant pointer to qgar::GenSegment::value_type. | |
Public Member Functions | |
| GenSegment () | |
| Default constructor. | |
| GenSegment (const GenSegment< value_type > &aSeg) | |
| Copy constructor. | |
| GenSegment (const GenQgarSegment< value_type > &aQSeg) | |
| Initialize from a Qgar segment. | |
| GenSegment (const GenPoint< value_type > &aSource, const GenPoint< value_type > &aTarget) | |
| Initialize from source and target points. | |
| GenSegment (const value_type aXSource, const value_type aYSource, const value_type aXTarget, const value_type aYTarget) | |
| Initialize from coordinates. | |
| virtual GenSegment< value_type > * | clone () const |
| Return a deep copy of the surrent segment. | |
| double | sqr_length () const |
| Get squared length of the segment. | |
| double | rho () const |
| Distance between point (0,0) and its perpendicular projection onto the line supporting the segment. | |
| double | theta () const |
| Angle between the X axis and the segment, in [0,2PI[ radians. | |
| double | angle () const |
| Same as qgar::GenSegment::theta. | |
| double | slope () const |
| Angle between the X axis and the segment, in [0,PI[ radians. | |
| double | thetaDegrees () const |
| Same as qgar::GenSegment::theta, but the result is given in [0,360[ degrees. | |
| double | angleDegrees () const |
| Same as qgar::GenSegment::theta, but the result is given in [0,360[ degrees. | |
| double | slopeDegrees () const |
| Same as qgar::GenSegment::slope, but the result is given in [0,180[ degrees. | |
| bool | contains (const GenPoint< int > &c, double aDist=Math::epsilonD()) |
| Return true if the given point approximately belongs to the current segment. | |
| bool | operator== (const GenSegment< value_type > &aSeg) const |
| Same as function qgar::GenSegment::eq. | |
| bool | operator!= (const GenSegment< value_type > &aSeg) const |
| Same as function qgar::GenSegment::notEq. | |
| bool | eq (const GenSegment< value_type > &aSeg) const |
| Equality. | |
| bool | notEq (const GenSegment< value_type > &aSeg) const |
| Inequality. | |
| virtual void | translate (value_type aTransX, value_type aTransY) |
| Translate current segment along X and Y axis. | |
| virtual std::istream & | read (std::istream &anInStream) |
| Deserializes the current segment from an input stream. | |
| virtual std::ostream & | write (std::ostream &anOutStream) const |
| Serializes the current segment to an input stream. | |
| 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. | |
| 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. | |
| 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. | |
| value_type | dx () const |
| Difference between target and source X coordinates. | |
| value_type | dy () const |
| Difference between target and source Y coordinates. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
Constructors | |
| WDSegment () | |
| Default constructor: Creation of a null segment. | |
| WDSegment (GenPoint< int > &orig, int deltaX, int deltaY, QGEdirection d) | |
| Construct from full data (used during approximation). | |
| WDSegment (const WDSegment &aSeg) | |
| Copy constructor. | |
Access | |
| int | approxFactor () const |
| Get approximation factor. | |
| int | sqrLength () const |
| Get square length. | |
| QGEdirection | direction () const |
| Get general direction. | |
| double | length () const |
| Get length of segment. | |
Transformation | |
| void | setApproxFactor (int af) |
| Set approximation factor. | |
| void | setSqrLength (int sl) |
| Set square length. | |
| void | setDirection (QGEdirection d) |
| Set general direction. | |
| void | translateTarget (GenPoint< int > &) |
| Translate extremum point with given point. | |
| void | set (const WDSegment &aSeg) |
| Set segment from an other segment (member-to-member copy). | |
| void | set (GenPoint< int > &orig, int deltaX, int deltaY, QGEdirection d) |
Operators | |
| WDSegment & | operator= (const WDSegment &w) |
| Assignment. | |
| int | operator== (const WDSegment s) const |
| Equality. | |
| int | operator!= (const WDSegment s) const |
| Inequality. | |
Protected Member 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 | |
| GenPoint< value_type > | _source |
| Source point. | |
| GenPoint< value_type > | _target |
| Target point. | |
Representation of a segment | |
| int | _sqrLength |
| Square length. | |
| int | _approxFactor |
| Approximation factor. | |
| QGEdirection | _direction |
| Direction of the segment. | |
|
|
Constant pointer to qgar::GenSegment::value_type.
Reimplemented from qgar::AbstractGenPrimitive< int >. Definition at line 170 of file _QGAR_GenSegment.H. |
|
|
Constant reference to qgar::GenSegment::value_type.
Reimplemented from qgar::AbstractGenPrimitive< int >. Definition at line 160 of file _QGAR_GenSegment.H. |
|
|
Pointer to qgar::GenSegment::value_type.
Reimplemented from qgar::AbstractGenPrimitive< int >. Definition at line 165 of file _QGAR_GenSegment.H. |
|
|
Reference to qgar::GenSegment::value_type.
Reimplemented from qgar::AbstractGenPrimitive< int >. Definition at line 155 of file _QGAR_GenSegment.H. |
|
|
Type of the source and target coordinates.
Reimplemented from qgar::AbstractGenPrimitive< int >. Definition at line 150 of file _QGAR_GenSegment.H. |
|
|
Default constructor: Creation of a null segment.
Definition at line 87 of file WDSegmentList.C. |
|
||||||||||||||||||||
|
Construct from full data (used during approximation).
Definition at line 99 of file WDSegmentList.C. References qgar::AbstractGenPrimitive< int >::_target, and qgar::GenPoint< T >::translate(). |
|
|
Copy constructor.
Definition at line 116 of file WDSegmentList.C. References _approxFactor, _direction, qgar::AbstractGenPrimitive< T >::_source, qgar::AbstractGenPrimitive< int >::_source, _sqrLength, qgar::AbstractGenPrimitive< T >::_target, and qgar::AbstractGenPrimitive< int >::_target. |
|
||||||||||||||||||||
|
Initialize from coordinates.
|
|
||||||||||||
|
Initialize from source and target.
|
|
|
Copy constructor.
|
|
|
Default constructor. Source and target at (0, 0). |
|
|
Get source point.
|
|
|
Get target point.
|
|
|
Same as qgar::GenSegment::theta.
|
|
|
Same as qgar::GenSegment::theta, but the result is given in [0,360[ degrees.
|
|
|
Get approximation factor.
Definition at line 266 of file WDSegmentList.H. References _approxFactor. Referenced by qgar::WDSegmentList::PRIVATEperform(). |
|
|
Return a deep copy of the surrent segment.
Implements qgar::AbstractGenPrimitive< int >. |
|
||||||||||||
|
Return true if the given point approximately belongs to the current segment. Here, ''to belong'' means to be at a distance smaller or equal to the given threshold from somed point between the source and the target of the segment.
|
|
|
Get general direction.
Definition at line 284 of file WDSegmentList.H. References _direction. Referenced by qgar::WDSegmentList::PRIVATEperform(). |
|
|
Difference between target and source X coordinates.
|
|
|
Difference between target and source Y coordinates.
|
|
|
Equality.
|
|
|
Set source point.
|
|
||||||||||||
|
Set source point.
|
|
||||||||||||
|
Set both source and target points.
|
|
||||||||||||||||||||
|
Set both source and target points.
|
|
|
Set target point.
|
|
||||||||||||
|
Set target point.
|
|
|
Set X coordinate of the source point.
|
|
|
Set X coordinate of the target point.
|
|
|
Set Y coordinate of the source point.
|
|
|
Set Y coordinate of the target point.
|
|
||||||||||||||||||||
|
Initialize from coordinates.
|
|
||||||||||||
|
Initialize from source and target points.
|
|
|
Initialize from a Qgar segment.
|
|
|
Copy constructor.
|
|
|
Default constructor. Zero-length segment located at the origin of the coordinate system.
|
|
|
Get length of segment.
Reimplemented from qgar::GenSegment< int >. Definition at line 293 of file WDSegmentList.H. References _sqrLength. |
|
|
Inequality.
|
|
|
Same as function qgar::GenSegment::notEq.
|
|
|
Inequality.
Definition at line 348 of file WDSegmentList.H. |
|
|
Assignment.
Definition at line 192 of file WDSegmentList.C. References _approxFactor, _direction, _sqrLength, qgar::AbstractGenPrimitive< int >::setSource(), qgar::AbstractGenPrimitive< int >::setTarget(), qgar::AbstractGenPrimitive< T >::source(), and qgar::AbstractGenPrimitive< T >::target(). |
|
|
Same as function qgar::GenSegment::eq.
|
|
|
Equality.
Definition at line 339 of file WDSegmentList.H. |
|
|
Deserializes the current segment from an input stream. A serialized segment is represented as: Segment(<SOURCE>)(<TARGET>)
Implements qgar::ISerializable. |
|
|
Distance between point (0,0) and its perpendicular projection onto the line supporting the segment. Always positive. |
|
||||||||||||||||||||
|
Set segment from given data.
Definition at line 147 of file WDSegmentList.C. References _approxFactor, _direction, qgar::AbstractGenPrimitive< int >::_source, _sqrLength, qgar::AbstractGenPrimitive< int >::_target, and qgar::GenPoint< T >::translate(). |
|
|
Set segment from an other segment (member-to-member copy).
Definition at line 134 of file WDSegmentList.C. References _approxFactor, _direction, qgar::AbstractGenPrimitive< T >::_source, qgar::AbstractGenPrimitive< int >::_source, _sqrLength, qgar::AbstractGenPrimitive< T >::_target, and qgar::AbstractGenPrimitive< int >::_target. Referenced by qgar::WDSegmentList::PRIVATEperform(). |
|
|
Set approximation factor.
Definition at line 307 of file WDSegmentList.H. References _approxFactor. Referenced by qgar::WDSegmentList::PRIVATEperform(). |
|
|
Set general direction.
Definition at line 325 of file WDSegmentList.H. References _direction. Referenced by qgar::WDSegmentList::PRIVATEperform(). |
|
|
Set source point.
|
|
||||||||||||
|
Set source point.
Referenced by operator=(). |
|
||||||||||||
|
Set both source and target points.
|
|
||||||||||||||||||||
|
Set both source and target points.
|
|
|
Set square length.
Definition at line 316 of file WDSegmentList.H. References _sqrLength. Referenced by qgar::WDSegmentList::PRIVATEperform(). |
|
|
Set target point.
|
|
||||||||||||
|
Set target point.
Referenced by operator=(). |
|
|
Set X coordinate of the source point.
|
|
|
Set X coordinate of the target point.
|
|
|
Set Y coordinate of the source point.
|
|
|
Set Y coordinate of the target point.
|
|
|
Angle between the X axis and the segment, in [0,PI[ radians.
O O +------------------> X +-----------------> X | \ | | \ | | \ <-' angle | \ <-' angle | \ | \ | + source | + target | \ | \ | \ | \ | \ | \ v + target v + source Y Y
|
|
|
Same as qgar::GenSegment::slope, but the result is given in [0,180[ degrees.
|
|
|
Get a copy of the source point.
|
|
|
Get squared length of the segment.
|
|
|
Get square length.
Definition at line 275 of file WDSegmentList.H. References _sqrLength. Referenced by qgar::WDSegmentList::PRIVATEperform(). |
|
|
Get a copy of the target point.
|
|
|
Angle between the X axis and the segment, in [0,2PI[ radians.
----->/ O O / / +------------------> X +---------|-------------> X | \ | | | / | | \ <-' angle | angle \_ /__/ | \ | / | + source | + target | \ | ^ | \ | / | v | / v + target v + source Y Y
|
|
|
Same as qgar::GenSegment::theta, but the result is given in [0,360[ degrees.
|
|
||||||||||||
|
Translate current segment along X and Y axis.
Implements qgar::AbstractGenPrimitive< int >. |
|
|
Translate extremum point with given point.
Definition at line 163 of file WDSegmentList.C. References _direction, qgar::AbstractGenPrimitive< int >::_source, _sqrLength, qgar::AbstractGenPrimitive< int >::_target, qgar::QGE_DIRECTION_E, qgar::QGE_DIRECTION_N, qgar::QGE_DIRECTION_NE, qgar::QGE_DIRECTION_NW, qgar::QGE_DIRECTION_S, qgar::QGE_DIRECTION_SE, qgar::QGE_DIRECTION_W, qgar::GenPoint< T >::x(), and qgar::GenPoint< T >::y(). Referenced by qgar::WDSegmentList::PRIVATEperform(). |
|
|
Update the geometrical structure when the source has been changed. Inherited from qgar::AbstractGenPrimitive. Implements qgar::AbstractGenPrimitive< int >. |
|
|
Update the geometrical structure when both source and target have been changed.
Implements qgar::AbstractGenPrimitive< int >. |
|
|
Update the geometrical structure when the target has been changed.
Implements qgar::AbstractGenPrimitive< int >. |
|
|
Serializes the current segment to an input stream. A serialized segment is represented as: Segment(<SOURCE>)(<TARGET>)
Implements qgar::ISerializable. |
|
|
Get X coordinate of the source point.
|
|
|
Get X coordinate of the target point.
|
|
|
Get Y coordinate of the source point.
|
|
|
Get Y coordinate of the target point.
|
|
|
Approximation factor. In the Wall & Danielsson's method, it is a measure of the algebraic area between the segment and the approximated curve. Definition at line 236 of file WDSegmentList.H. Referenced by approxFactor(), operator=(), set(), setApproxFactor(), and WDSegment(). |
|
|
Direction of the segment.
Definition at line 241 of file WDSegmentList.H. Referenced by direction(), operator=(), set(), setDirection(), translateTarget(), and WDSegment(). |
|
|
Source point.
Definition at line 615 of file _QGAR_AbstractGenPrimitive.H. Referenced by set(), translateTarget(), and WDSegment(). |
|
|
Square length.
Definition at line 228 of file WDSegmentList.H. Referenced by length(), operator=(), set(), setSqrLength(), sqrLength(), translateTarget(), and WDSegment(). |
|
|
Target point.
Definition at line 620 of file _QGAR_AbstractGenPrimitive.H. Referenced by set(), translateTarget(), and WDSegment(). |