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

qgar::WDSegment Class Reference
[Polygonal approximations]

#include <WDSegmentList.H>

Inheritance diagram for qgar::WDSegment:

qgar::GenSegment< int > qgar::AbstractGenPrimitive< int > qgar::ISerializable List of all members.

Detailed Description

A segment resulting from a polygonal approximation performed according to Wall and Danielsson's method.

Todo:
Dirty: Take a look at functions qgar::WDSegmentList::set(), and conversions from WDSegments to Segments. Find a way to remove this class!
Author:
Karl Tombre
Date:
July 3, 2001 09:56
Since:
Qgar 1.0

Definition at line 86 of file WDSegmentList.H.

Public Types

typedef int value_type
 Type of the source and target coordinates.
typedef value_typereference
 Reference to qgar::GenSegment::value_type.
typedef const value_typeconst_reference
 Constant reference to qgar::GenSegment::value_type.
typedef value_typepointer
 Pointer to qgar::GenSegment::value_type.
typedef const value_typeconst_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_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.
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
WDSegmentoperator= (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.


Member Typedef Documentation

typedef const value_type* qgar::GenSegment< int >::const_pointer [inherited]
 

Constant pointer to qgar::GenSegment::value_type.

Reimplemented from qgar::AbstractGenPrimitive< int >.

Definition at line 170 of file _QGAR_GenSegment.H.

typedef const value_type& qgar::GenSegment< int >::const_reference [inherited]
 

Constant reference to qgar::GenSegment::value_type.

Reimplemented from qgar::AbstractGenPrimitive< int >.

Definition at line 160 of file _QGAR_GenSegment.H.

typedef value_type* qgar::GenSegment< int >::pointer [inherited]
 

Pointer to qgar::GenSegment::value_type.

Reimplemented from qgar::AbstractGenPrimitive< int >.

Definition at line 165 of file _QGAR_GenSegment.H.

typedef value_type& qgar::GenSegment< int >::reference [inherited]
 

Reference to qgar::GenSegment::value_type.

Reimplemented from qgar::AbstractGenPrimitive< int >.

Definition at line 155 of file _QGAR_GenSegment.H.

typedef int qgar::GenSegment< int >::value_type [inherited]
 

Type of the source and target coordinates.

Reimplemented from qgar::AbstractGenPrimitive< int >.

Definition at line 150 of file _QGAR_GenSegment.H.


Constructor & Destructor Documentation

qgar::WDSegment::WDSegment  ) 
 

Default constructor: Creation of a null segment.

Definition at line 87 of file WDSegmentList.C.

qgar::WDSegment::WDSegment GenPoint< int > &  orig,
int  deltaX,
int  deltaY,
QGEdirection  d
 

Construct from full data (used during approximation).

Parameters:
orig origin point
deltaX displacement to end point ($\Delta_x$ )
deltaY displacement to end point ($\Delta_y$ )
d direction of segment

Definition at line 99 of file WDSegmentList.C.

References qgar::AbstractGenPrimitive< int >::_target, and qgar::GenPoint< T >::translate().

qgar::WDSegment::WDSegment const WDSegment aSeg  ) 
 

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.


Member Function Documentation

qgar::AbstractGenPrimitive< int >::AbstractGenPrimitive value_type  aXSource,
value_type  aYSource,
value_type  aXTarget,
value_type  aYTarget
[inherited]
 

Initialize from coordinates.

Parameters:
aXSource X coordinate of source point
aYSource Y coordinate of source point
aXTarget X coordinate of target point
aYTarget Y coordinate of target point

qgar::AbstractGenPrimitive< int >::AbstractGenPrimitive const GenPoint< value_type aSource,
const GenPoint< value_type aTarget
[inherited]
 

Initialize from source and target.

Parameters:
aSource source point
aTarget target point

qgar::AbstractGenPrimitive< int >::AbstractGenPrimitive const AbstractGenPrimitive< value_type > &  aPrim  )  [inherited]
 

Copy constructor.

Parameters:
aPrim primitive to be copied

qgar::AbstractGenPrimitive< int >::AbstractGenPrimitive  )  [inherited]
 

Default constructor.

Source and target at (0, 0).

const GenPoint<value_type>& qgar::AbstractGenPrimitive< int >::accessSource  )  const [inline, inherited]
 

Get source point.

const GenPoint<value_type>& qgar::AbstractGenPrimitive< int >::accessTarget  )  const [inline, inherited]
 

Get target point.

double qgar::GenSegment< int >::angle  )  const [inline, inherited]
 

Same as qgar::GenSegment::theta.

double qgar::GenSegment< int >::angleDegrees  )  const [inline, inherited]
 

Same as qgar::GenSegment::theta, but the result is given in [0,360[ degrees.

int qgar::WDSegment::approxFactor  )  const [inline]
 

Get approximation factor.

Definition at line 266 of file WDSegmentList.H.

References _approxFactor.

Referenced by qgar::WDSegmentList::PRIVATEperform().

virtual GenSegment<value_type>* qgar::GenSegment< int >::clone  )  const [virtual, inherited]
 

Return a deep copy of the surrent segment.

Implements qgar::AbstractGenPrimitive< int >.

bool qgar::GenSegment< int >::contains const GenPoint< int > &  c,
double  aDist = Math::epsilonD()
[inline, inherited]
 

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.

Parameters:
c a point
aDist threshold used to decide whether the given point belongs to the segment (default qgar::Math::epsilonD)
Todo:
Use values computed for 'r' to get the distance between the point and the segment, instead of using function qgar::qgDist, which computes again these values.

QGEdirection qgar::WDSegment::direction  )  const [inline]
 

Get general direction.

Definition at line 284 of file WDSegmentList.H.

References _direction.

Referenced by qgar::WDSegmentList::PRIVATEperform().

value_type qgar::AbstractGenPrimitive< int >::dx  )  const [inline, inherited]
 

Difference between target and source X coordinates.

value_type qgar::AbstractGenPrimitive< int >::dy  )  const [inline, inherited]
 

Difference between target and source Y coordinates.

bool qgar::GenSegment< int >::eq const GenSegment< value_type > &  aSeg  )  const [inherited]
 

Equality.

Parameters:
aSeg a segment
Returns:
true if the current segment and the given segment have the same coordinates.

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

qgar::GenSegment< int >::GenSegment const value_type  aXSource,
const value_type  aYSource,
const value_type  aXTarget,
const value_type  aYTarget
[inherited]
 

Initialize from coordinates.

Parameters:
aXSource X coordinate of the source point
aYSource Y coordinate of the source point
aXTarget X coordinate of the target point
aYTarget X coordinate of the target point

qgar::GenSegment< int >::GenSegment const GenPoint< value_type > &  aSource,
const GenPoint< value_type > &  aTarget
[inherited]
 

Initialize from source and target points.

Parameters:
aSource source point
aTarget target point

qgar::GenSegment< int >::GenSegment const GenQgarSegment< value_type > &  aQSeg  )  [explicit, inherited]
 

Initialize from a Qgar segment.

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

qgar::GenSegment< int >::GenSegment const GenSegment< value_type > &  aSeg  )  [inherited]
 

Copy constructor.

qgar::GenSegment< int >::GenSegment  )  [inherited]
 

Default constructor.

Zero-length segment located at the origin of the coordinate system.

Todo:
The created segment does not conform to the definition of a segment!

double qgar::WDSegment::length  )  const [inline]
 

Get length of segment.

Reimplemented from qgar::GenSegment< int >.

Definition at line 293 of file WDSegmentList.H.

References _sqrLength.

bool qgar::GenSegment< int >::notEq const GenSegment< value_type > &  aSeg  )  const [inherited]
 

Inequality.

Parameters:
aSeg a segment
Returns:
true if the coordinates of the current and given segments are different.

bool qgar::GenSegment< int >::operator!= const GenSegment< value_type > &  aSeg  )  const [inline, inherited]
 

Same as function qgar::GenSegment::notEq.

int qgar::WDSegment::operator!= const WDSegment  s  )  const [inline]
 

Inequality.

Definition at line 348 of file WDSegmentList.H.

WDSegment & qgar::WDSegment::operator= const WDSegment w  ) 
 

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().

bool qgar::GenSegment< int >::operator== const GenSegment< value_type > &  aSeg  )  const [inline, inherited]
 

Same as function qgar::GenSegment::eq.

int qgar::WDSegment::operator== const WDSegment  s  )  const [inline]
 

Equality.

Definition at line 339 of file WDSegmentList.H.

virtual std::istream& qgar::GenSegment< int >::read std::istream &  anInStream  )  [virtual, inherited]
 

Deserializes the current segment from an input stream.

A serialized segment is represented as:

  Segment(<SOURCE>)(<TARGET>)

Parameters:
anInStream the input stream
See also:
qgar::qgReadObjName, qgar::qgReadObjData

Implements qgar::ISerializable.

double qgar::GenSegment< int >::rho  )  const [inherited]
 

Distance between point (0,0) and its perpendicular projection onto the line supporting the segment.

Always positive.

void qgar::WDSegment::set GenPoint< int > &  orig,
int  deltaX,
int  deltaY,
QGEdirection  d
 

Set segment from given data.

Parameters:
orig origin point
deltaX displacement to end point ($\Delta_{x}$ )
deltaY displacement to end point ($\Delta_{y}$ )
d direction of segment

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().

void qgar::WDSegment::set const WDSegment aSeg  ) 
 

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().

void qgar::WDSegment::setApproxFactor int  af  )  [inline]
 

Set approximation factor.

Definition at line 307 of file WDSegmentList.H.

References _approxFactor.

Referenced by qgar::WDSegmentList::PRIVATEperform().

void qgar::WDSegment::setDirection QGEdirection  d  )  [inline]
 

Set general direction.

Definition at line 325 of file WDSegmentList.H.

References _direction.

Referenced by qgar::WDSegmentList::PRIVATEperform().

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

Referenced by operator=().

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

void qgar::WDSegment::setSqrLength int  sl  )  [inline]
 

Set square length.

Definition at line 316 of file WDSegmentList.H.

References _sqrLength.

Referenced by qgar::WDSegmentList::PRIVATEperform().

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

Referenced by operator=().

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

void qgar::AbstractGenPrimitive< int >::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.

double qgar::GenSegment< int >::slope  )  const [inline, inherited]
 

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

Warning:
The current segment is not assimilited to a vector.

double qgar::GenSegment< int >::slopeDegrees  )  const [inline, inherited]
 

Same as qgar::GenSegment::slope, but the result is given in [0,180[ degrees.

GenPoint<value_type> qgar::AbstractGenPrimitive< int >::source  )  const [inline, inherited]
 

Get a copy of the source point.

double qgar::GenSegment< int >::sqr_length  )  const [inherited]
 

Get squared length of the segment.

int qgar::WDSegment::sqrLength  )  const [inline]
 

Get square length.

Definition at line 275 of file WDSegmentList.H.

References _sqrLength.

Referenced by qgar::WDSegmentList::PRIVATEperform().

GenPoint<value_type> qgar::AbstractGenPrimitive< int >::target  )  const [inline, inherited]
 

Get a copy of the target point.

double qgar::GenSegment< int >::theta  )  const [inline, inherited]
 

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

Warning:
The current segment is assimilited to a vector joining its source to its target.

double qgar::GenSegment< int >::thetaDegrees  )  const [inline, inherited]
 

Same as qgar::GenSegment::theta, but the result is given in [0,360[ degrees.

virtual void qgar::GenSegment< int >::translate value_type  aTransX,
value_type  aTransY
[virtual, inherited]
 

Translate current segment along X and Y axis.

Parameters:
aTransX X translation factor
aTransY Y translation factor

Implements qgar::AbstractGenPrimitive< int >.

void qgar::WDSegment::translateTarget GenPoint< 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().

virtual void qgar::GenSegment< int >::updateSource  )  [protected, virtual, inherited]
 

Update the geometrical structure when the source has been changed.

Inherited from qgar::AbstractGenPrimitive.

Implements qgar::AbstractGenPrimitive< int >.

virtual void qgar::GenSegment< int >::updateSourceTarget  )  [protected, virtual, inherited]
 

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

Implements qgar::AbstractGenPrimitive< int >.

virtual void qgar::GenSegment< int >::updateTarget  )  [protected, virtual, inherited]
 

Update the geometrical structure when the target has been changed.

Implements qgar::AbstractGenPrimitive< int >.

virtual std::ostream& qgar::GenSegment< int >::write std::ostream &  anOutStream  )  const [virtual, inherited]
 

Serializes the current segment to an input stream.

A serialized segment is represented as:

  Segment(<SOURCE>)(<TARGET>)

Parameters:
anOutStream the output stream

Implements qgar::ISerializable.

value_type qgar::AbstractGenPrimitive< int >::xSource  )  const [inline, inherited]
 

Get X coordinate of the source point.

value_type qgar::AbstractGenPrimitive< int >::xTarget  )  const [inline, inherited]
 

Get X coordinate of the target point.

value_type qgar::AbstractGenPrimitive< int >::ySource  )  const [inline, inherited]
 

Get Y coordinate of the source point.

value_type qgar::AbstractGenPrimitive< int >::yTarget  )  const [inline, inherited]
 

Get Y coordinate of the target point.


Member Data Documentation

int qgar::WDSegment::_approxFactor [protected]
 

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().

QGEdirection qgar::WDSegment::_direction [protected]
 

Direction of the segment.

Definition at line 241 of file WDSegmentList.H.

Referenced by direction(), operator=(), set(), setDirection(), translateTarget(), and WDSegment().

GenPoint<value_type> qgar::AbstractGenPrimitive< int >::_source [protected, inherited]
 

Source point.

Definition at line 615 of file _QGAR_AbstractGenPrimitive.H.

Referenced by set(), translateTarget(), and WDSegment().

int qgar::WDSegment::_sqrLength [protected]
 

Square length.

Definition at line 228 of file WDSegmentList.H.

Referenced by length(), operator=(), set(), setSqrLength(), sqrLength(), translateTarget(), and WDSegment().

GenPoint<value_type> qgar::AbstractGenPrimitive< int >::_target [protected, inherited]
 

Target point.

Definition at line 620 of file _QGAR_AbstractGenPrimitive.H.

Referenced by set(), translateTarget(), and WDSegment().


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