Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

C2DSegment Class Reference

C2DSegment represents a segment which is part of a circle, sliced in 2 with a line. More...

#include <2DSegment.h>

Inheritance diagram for C2DSegment:

C2DBase List of all members.

Public Member Functions

 C2DSegment (void)
 Constructor.
 ~C2DSegment (void)
 Destructor.
 C2DSegment (const C2DArc &Arc)
 Constructor.
 C2DSegment (const C2DPoint &PtFrom, const C2DPoint &PtTo, double dRadius, bool bCentreOnRight=true, bool bArcOnRight=false)
 Constructor.
 C2DSegment (const C2DPoint &PtFrom, const C2DVector &Vector, double dRadius, bool bCentreOnRight=true, bool bArcOnRight=false)
 Constructor.
 C2DSegment (const C2DLine &Line, double dRadius, bool bCentreOnRight=true, bool bArcOnRight=false)
 Constructor.
void Set (const C2DPoint &PtFrom, const C2DPoint &PtTo, double dRadius, bool bCentreOnRight=true, bool bArcOnRight=false)
 Assignment.
void Set (const C2DPoint &PtFrom, const C2DVector &Vector, double dRadius, bool bCentreOnRight=true, bool bArcOnRight=false)
 Assignment.
void Set (const C2DLine &Line, double dRadius, bool bCentreOnRight=true, bool bArcOnRight=false)
 Assignment.
bool IsValid (void) const
 False if the radius is too small to join the points given.
C2DPoint GetCircleCentre (void) const
 Returns the centre of the corresponding circle.
double GetPerimeter (void) const
 Returns the perimeter of the shape.
double GetArcLength (void) const
 Returns the length of the arc.
void GetBoundingRect (C2DRect &Rect) const
 Returns the bounding rectangle.
void GetInverse (C2DSegment &Other) const
 Returns the inverse of this i.e. the other part of the circle to this.
double GetSegmentAngle (void) const
 Always +ve and LESS than PI. In radians.
double GetArea (void) const
 Returns the area.
double GetAreaSigned (void) const
 Returns the area which is positive if anti-clockwise -ve if clockwise.
C2DPoint GetCentroid (void) const
 Returns the centroid.
const C2DPointGetPointFrom (void) const
C2DPoint GetPointTo (void) const
const C2DArcGetArc (void) const
const C2DLineGetLine (void) const
bool Contains (const C2DPoint &TestPoint) const
 Returns whether the point is in the shape.
void Move (const C2DVector &vector)
void RotateToRight (double dAng, const C2DPoint &Origin)
void Grow (double dFactor, const C2DPoint &Origin)
void Reflect (const C2DPoint &point)
void Reflect (const C2DLine &Line)
 Reflects the in the line given.
double Distance (const C2DPoint &TestPoint) const
 Returns the distance to the point given.
void Project (const C2DLine &Line, CInterval &Interval) const
 Projects this onto the line given.
void Project (const C2DVector &Vector, CInterval &Interval) const
 Projects this onto the vector given.
void SnapToGrid (void)
 Snaps this to the conceptual grid.

Detailed Description

C2DSegment represents a segment which is part of a circle, sliced in 2 with a line.

C2DSegment which is a segment of a circle defined by a line, a circle radius, whether the circle centre and the arc are on the right or left.

---------------------------------------------------------------------------


Constructor & Destructor Documentation

C2DSegment::C2DSegment void   ) 
 

Constructor.

--------------------------------------------------------------------------
C2DSegment::C2DSegment

---------------------------------------------------------------------------

C2DSegment::~C2DSegment void   ) 
 

Destructor.

--------------------------------------------------------------------------
C2DSegment::~C2DSegment

---------------------------------------------------------------------------

C2DSegment::C2DSegment const C2DArc Arc  ) 
 

Constructor.

--------------------------------------------------------------------------
C2DSegment::C2DSegment

---------------------------------------------------------------------------

C2DSegment::C2DSegment const C2DPoint PtFrom,
const C2DPoint PtTo,
double  dRadius,
bool  bCentreOnRight = true,
bool  bArcOnRight = false
 

Constructor.

--------------------------------------------------------------------------
C2DSegment::C2DSegment

---------------------------------------------------------------------------

C2DSegment::C2DSegment const C2DPoint PtFrom,
const C2DVector Vector,
double  dRadius,
bool  bCentreOnRight = true,
bool  bArcOnRight = false
 

Constructor.

--------------------------------------------------------------------------
C2DSegment::C2DSegment

---------------------------------------------------------------------------

C2DSegment::C2DSegment const C2DLine Line,
double  dRadius,
bool  bCentreOnRight = true,
bool  bArcOnRight = false
 

Constructor.

--------------------------------------------------------------------------
C2DSegment::C2DSegment

---------------------------------------------------------------------------


Member Function Documentation

bool C2DSegment::Contains const C2DPoint TestPoint  )  const
 

Returns whether the point is in the shape.

--------------------------------------------------------------------------
C2DSegment::Contains

---------------------------------------------------------------------------

double C2DSegment::Distance const C2DPoint TestPoint  )  const [virtual]
 

Returns the distance to the point given.

--------------------------------------------------------------------------
C2DSegment::Distance

---------------------------------------------------------------------------

Implements C2DBase.

const C2DArc& C2DSegment::GetArc void   )  const [inline]
 

--------------------------------------------------------------------------
C2DSegment::GetArc
Returns a reference to the Arc.

---------------------------------------------------------------------------

double C2DSegment::GetArcLength void   )  const
 

Returns the length of the arc.

--------------------------------------------------------------------------
C2DSegment::GetArcLength

---------------------------------------------------------------------------

double C2DSegment::GetArea void   )  const
 

Returns the area.

--------------------------------------------------------------------------
C2DSegment::GetArea

---------------------------------------------------------------------------

double C2DSegment::GetAreaSigned void   )  const
 

Returns the area which is positive if anti-clockwise -ve if clockwise.

--------------------------------------------------------------------------
C2DSegment::GetAreaSigned

---------------------------------------------------------------------------

void C2DSegment::GetBoundingRect C2DRect Rect  )  const [virtual]
 

Returns the bounding rectangle.

--------------------------------------------------------------------------
C2DSegment::GetBoundingRect

---------------------------------------------------------------------------

Implements C2DBase.

C2DPoint C2DSegment::GetCentroid void   )  const
 

Returns the centroid.

--------------------------------------------------------------------------
C2DSegment::GetCentroid

---------------------------------------------------------------------------

C2DPoint C2DSegment::GetCircleCentre void   )  const
 

Returns the centre of the corresponding circle.

--------------------------------------------------------------------------
C2DSegment::GetCircleCentre

---------------------------------------------------------------------------

void C2DSegment::GetInverse C2DSegment Other  )  const
 

Returns the inverse of this i.e. the other part of the circle to this.

--------------------------------------------------------------------------
C2DSegment::GetInverse

---------------------------------------------------------------------------

const C2DLine& C2DSegment::GetLine void   )  const [inline]
 

--------------------------------------------------------------------------
C2DSegment::GetLine
Returns a reference to the line.

---------------------------------------------------------------------------

double C2DSegment::GetPerimeter void   )  const
 

Returns the perimeter of the shape.

--------------------------------------------------------------------------
C2DSegment::GetPerimeter

---------------------------------------------------------------------------

const C2DPoint& C2DSegment::GetPointFrom void   )  const [inline]
 

--------------------------------------------------------------------------
C2DSegment::GetPointFrom
Gets the first point on the straight line.

---------------------------------------------------------------------------

C2DPoint C2DSegment::GetPointTo void   )  const [inline]
 

--------------------------------------------------------------------------
C2DSegment::GetPointTo
Gets the second point on the straight line.

---------------------------------------------------------------------------

double C2DSegment::GetSegmentAngle void   )  const
 

Always +ve and LESS than PI. In radians.

--------------------------------------------------------------------------
C2DSegment::GetSegmentAngle

---------------------------------------------------------------------------

void C2DSegment::Grow double  dFactor,
const C2DPoint Origin
[inline, virtual]
 

--------------------------------------------------------------------------
C2DSegment::Grow
Grows the segment by the factor from the origin provided.

---------------------------------------------------------------------------

Implements C2DBase.

bool C2DSegment::IsValid void   )  const
 

False if the radius is too small to join the points given.

--------------------------------------------------------------------------
C2DSegment::IsValid

---------------------------------------------------------------------------

void C2DSegment::Move const C2DVector vector  )  [inline, virtual]
 

--------------------------------------------------------------------------
C2DSegment::Move
Moves the segment by the vector given.

---------------------------------------------------------------------------

Implements C2DBase.

void C2DSegment::Project const C2DVector Vector,
CInterval Interval
const [virtual]
 

Projects this onto the vector given.

--------------------------------------------------------------------------
C2DSegment::Distance

---------------------------------------------------------------------------

Implements C2DBase.

void C2DSegment::Project const C2DLine Line,
CInterval Interval
const [virtual]
 

Projects this onto the line given.

--------------------------------------------------------------------------
C2DSegment::Distance

---------------------------------------------------------------------------

Implements C2DBase.

void C2DSegment::Reflect const C2DPoint point  )  [inline, virtual]
 

--------------------------------------------------------------------------
C2DSegment::Reflect
Reflects the shape throught the point given.

---------------------------------------------------------------------------

Implements C2DBase.

void C2DSegment::RotateToRight double  dAng,
const C2DPoint Origin
[inline, virtual]
 

--------------------------------------------------------------------------
C2DSegment::RotateToRight
Rotates the segment to the right by the angle.

---------------------------------------------------------------------------

Implements C2DBase.

void C2DSegment::Set const C2DLine Line,
double  dRadius,
bool  bCentreOnRight = true,
bool  bArcOnRight = false
 

Assignment.

--------------------------------------------------------------------------
C2DSegment::Set

---------------------------------------------------------------------------

void C2DSegment::Set const C2DPoint PtFrom,
const C2DVector Vector,
double  dRadius,
bool  bCentreOnRight = true,
bool  bArcOnRight = false
 

Assignment.

--------------------------------------------------------------------------
C2DSegment::Set

---------------------------------------------------------------------------

void C2DSegment::Set const C2DPoint PtFrom,
const C2DPoint PtTo,
double  dRadius,
bool  bCentreOnRight = true,
bool  bArcOnRight = false
 

Assignment.

--------------------------------------------------------------------------
C2DSegment::Set

---------------------------------------------------------------------------

void C2DSegment::SnapToGrid void   )  [virtual]
 

Snaps this to the conceptual grid.

--------------------------------------------------------------------------
C2DSegment::SnapToGrid

---------------------------------------------------------------------------

Implements C2DBase.


The documentation for this class was generated from the following files:
Generated on Mon Apr 21 11:43:52 2008 for GeoLib by  doxygen 1.4.4