#include <2DLine.h>
Inheritance diagram for C2DLine:
Public Member Functions | |
C2DLine (void) | |
Constructor. | |
~C2DLine (void) | |
~Destructor. | |
C2DLine (const C2DPoint &PointFrom, const C2DVector &VectorTo) | |
Constructor assigns from a point and vector. | |
C2DLine (const C2DPoint &PointFrom, const C2DPoint &PointTo) | |
Constructor assigns from 2 points. | |
C2DLine (const C2DLine &Other) | |
Constructor assigns from another line. | |
void | Set (const C2DPoint &PointFrom, const C2DPoint &PointTo) |
Assigment from 2 points. | |
void | Set (const C2DPoint &PointFrom, const C2DVector &VectorTo) |
Assignment using a point and a vector. | |
void | SetPointTo (const C2DPoint &PointTo) |
Sets the point that this is going to. | |
void | SetPointFrom (const C2DPoint &PointFrom) |
Sets the point that this is going from changing the vector as well. | |
void | SetLength (double dLength) |
Set Length. | |
void | ReverseDirection (void) |
Reverses the direction of the line. | |
bool | IsOnRight (const C2DPoint &OtherPoint) const |
True if the point is to the right of the line. | |
C2DPoint | GetPointTo (void) const |
Returns the second point. | |
C2DPoint | GetPointFrom (void) const |
Returns the first point. | |
bool | WouldCross (const C2DLine &Other) const |
True if this line would cross the other if it were infinite. | |
bool | Crosses (const C2DLineBase &Other, C2DPointSet *IntersectionPts=0) const |
True if this line crosses the other line, returns the intersection pt. | |
bool | Crosses (const C2DLine &Other, C2DPointSet *IntersectionPts=0, bool *pbOnThis=0, bool *pbOnOther=0, bool bAddPtIfFalse=false) const |
True if this line crosses the other. Returns the point is a collection is provided. Returns whether it would cross on this or on the other. Can opt to get the point where the cross would occur (if not parallel) even if they don't cross. | |
bool | CrossesRay (const C2DLine &Ray, C2DPointSet *IntersectionPts=0) const |
True if the ray provided (infinite line starting from the first point) crosses this. | |
double | Distance (const C2DPoint &TestPoint) const |
Returns the distance from this to the point. | |
double | Distance (const C2DPoint &TestPoint, C2DPoint *ptOnThis) const |
Returns the distance from this to the point. | |
double | Distance (const C2DLine &Other, C2DPoint *ptOnThis=0, C2DPoint *ptOnOther=0) const |
Returns the distance from this to the other line. | |
double | Distance (const C2DLineBase &Other, C2DPoint *ptOnThis=0, C2DPoint *ptOnOther=0) const |
Distance to another line. | |
C2DPoint | GetMidPoint (void) const |
Gets the mid point on the line. | |
C2DPoint | GetPointOn (double dFactorFromStart) const |
Gets the point on the line given by the factor. e.g. 0.5 = mid point. | |
void | GetBoundingRect (C2DRect &Rect) const |
Returns the bounding rectangle. | |
double | GetLength (void) const |
Returns the length of the line. | |
void | Move (const C2DVector &vector) |
Moves the line by the vector given. | |
void | RotateToRight (double dAng, const C2DPoint &Origin) |
Rotation. | |
void | Grow (double dFactor, const C2DPoint &Origin) |
Grows the line in size. | |
void | Reflect (const C2DPoint &Point) |
Point reflection. | |
void | Reflect (const C2DLine &Line) |
Reflects the in the line given. | |
void | GrowFromCentre (double dFactor) |
Grows from the centre by the amount. | |
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 | GetSubLines (const C2DPointSet &PtsOnLine, C2DLineBaseSet &LineSet) const |
Splits the line up into sublines dependant upon the points provided which are points on this line. Adds the sub lines, in order, to the collection. | |
void | SnapToGrid (void) |
Snaps this to the conceptual grid. | |
Public Attributes | |
C2DPoint | point |
The first point. | |
C2DVector | vector |
The vector to the second point. |
Class which represents a line segment i.e. a finite line. Stores data as a point and a vector representing the movement to the new point.
---------------------------------------------------------------------------
|
Constructor.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
~Destructor.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Constructor assigns from a point and vector.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Constructor assigns from 2 points.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Constructor assigns from another line.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if this line crosses the other. Returns the point is a collection is provided. Returns whether it would cross on this or on the other. Can opt to get the point where the cross would occur (if not parallel) even if they don't cross. True if this line crosses the other. Returns the point is a collection is provided. Returns whether it would cross on this or on the other. Can opt to get the point where the cross would occur (if not parallel) even if they don't cross. |
|
True if this line crosses the other line, returns the intersection pt.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DLineBase. |
|
True if the ray provided (infinite line starting from the first point) crosses this.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Distance to another line.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DLineBase. |
|
Returns the distance from this to the other line.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Returns the distance from this to the point.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DLineBase. |
|
Returns the distance from this to the point.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DLineBase. |
|
Returns the bounding rectangle.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Gets the mid point on the line.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Gets the point on the line given by the factor. e.g. 0.5 = mid point.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Returns the second point.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DLineBase. |
|
Splits the line up into sublines dependant upon the points provided which are points on this line. Adds the sub lines, in order, to the collection. Returns the lines that make up this defined by the points which are assumed to be on this line. i.e. splits the line up. Implements C2DLineBase. |
|
Grows the line in size.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Grows from the centre by the amount.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if the point is to the right of the line.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Projects this onto the vector given.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Projects this onto the line given.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Reflects the in the line given.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Point reflection.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Reverses the direction of the line.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DLineBase. |
|
Rotation.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Assignment using a point and a vector.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Assigment from 2 points.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Sets the point that this is going from changing the vector as well.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Sets the point that this is going to.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Snaps this to the conceptual grid.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DLineBase. |
|
True if this line would cross the other if it were infinite.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |