#include <2DPolyBase.h>
Inheritance diagram for C2DPolyBase:
Public Member Functions | |
C2DPolyBase (void) | |
Constructor. | |
C2DPolyBase (const C2DPolyBase &Other) | |
Constructor. | |
~C2DPolyBase (void) | |
Destructor. | |
const C2DPolyBase & | operator= (const C2DPolyBase &Other) |
Assigment. | |
void | Set (const C2DPolyBase &Other) |
Assigment. | |
void | CreateDirect (C2DLineBaseSet &Lines) |
Creates directly from a set of lines by extracting them from the set provided. | |
void | Create (const C2DLineBaseSet &Lines) |
Creates from the set of lines using copies. | |
bool | Contains (const C2DPoint &pt) const |
True if the point is in the shape. | |
bool | Contains (const C2DPolyBase &Other) const |
True if it entirely contains the other. | |
bool | Contains (const C2DHoledPolyBase &Other) const |
True if it entirely contains the other. | |
bool | Contains (const C2DLineBase &Line) const |
True if it entirely contains the line. | |
bool | HasCrossingLines (void) const |
True if any of the lines cross. | |
double | Distance (const C2DPoint &pt) const |
Distance of the point from the shape. Returns -ve if inside. | |
double | Distance (const C2DLineBase &Line) const |
Distance to the line. | |
double | Distance (const C2DPolyBase &Other, C2DPoint *ptOnThis=0, C2DPoint *ptOnOther=0) const |
Distance of the poly from the shape. | |
bool | IsWithinDistance (const C2DPoint &pt, double dRange) const |
True if the point is with the range given to the shape or inside. | |
void | GetBoundingRect (C2DRect &Rect) const |
Returns the bounding rectangle. | |
const C2DRect & | GetBoundingRect (void) const |
Returns the bournding rectangle. | |
const C2DLineBase * | GetLine (unsigned int i) const |
Returns a pointer to the line, 0 if invalid. Cycliclly handles indexes over the max. | |
const C2DLineBaseSet & | GetLines (void) const |
Returns the line set. | |
const C2DRect * | GetLineRect (unsigned int i) const |
Returns a pointer to the line rect. | |
unsigned int | GetLineRectCount (void) const |
number of line rectangles (should be the same as the number of lines!). | |
double | GetPerimeter (void) const |
Calculates the perimeter. | |
void | Clear (void) |
Clears all. | |
void | Move (const C2DVector &vector) |
Moves the shape. | |
void | RotateToRight (double dAng, const C2DPoint &Origin) |
Rotates the polygon to the right around the origin given. | |
void | Grow (double dFactor, const C2DPoint &Origin) |
Grows the area around the origin. | |
void | Reflect (const C2DPoint &point) |
Reflects the area about the point. | |
void | Reflect (const C2DLine &Line) |
Reflects throught the line provided. | |
bool | Crosses (const C2DPolyBase &Other) const |
True if it crosses the other. | |
bool | Crosses (const C2DPolyBase &Other, C2DPointSet *IntersectionPts) const |
Intersection with another. | |
bool | Crosses (const C2DLineBase &Line) const |
Intersection with a line base. Finds out what sort of line it is first. | |
bool | Crosses (const C2DLineBase &Line, C2DPointSet *IntersectionPts) const |
True if it crosses the line. Provides the intersection points. | |
bool | CrossesRay (const C2DLine &Ray, C2DPointSet *IntersectionPts) const |
True if it crosses the ray. Provides the intersection points. | |
bool | Overlaps (const C2DPolyBase &Other) const |
True if this overlaps the other. | |
bool | Overlaps (const C2DHoledPolyBase &Other) const |
True if this overlaps the other. | |
bool | IsClosed (void) const |
True if it is a closed shape which it should be. | |
void | SnapToGrid (void) |
Snap to the conceptual grid. | |
void | GetNonOverlaps (const C2DPolyBase &Other, C2DHoledPolyBaseSet &Polygons, CGrid::eDegenerateHandling eDegen=CGrid::None) const |
Returns the non-overlaps of this with another. | |
void | GetUnion (const C2DPolyBase &Other, C2DHoledPolyBaseSet &Polygons, CGrid::eDegenerateHandling eDegen=CGrid::None) const |
Returns the union of this with another. | |
void | GetOverlaps (const C2DPolyBase &Other, C2DHoledPolyBaseSet &Polygons, CGrid::eDegenerateHandling eDegen=CGrid::None) const |
Returns the overlaps of this with another. | |
void | GetRoutes (C2DPointSet &IntPts, CIndexSet &IntIndexes, C2DLineBaseSetSet &Routes, bool bStartInside, bool bRoutesInside=true) const |
Returns the routes inside or outside the other polygon / holed polygon. | |
void | GetBoolean (const C2DPolyBase &Other, C2DHoledPolyBaseSet &Polygons, bool bThisInside, bool bOtherInside, CGrid::eDegenerateHandling eDegen=CGrid::None) const |
Gets the boolean operation with the other. e.g. union / intersection. | |
void | Project (const C2DLine &Line, CInterval &Interval) const |
Projection onto the line. | |
void | Project (const C2DVector &Vector, CInterval &Interval) const |
Projection onto the vector. | |
void | RandomPerturb (void) |
Moves this by a tiny random amount. | |
Static Public Member Functions | |
static void | GetRoutes (const C2DPolyBase &Poly1, bool bP1RoutesInside, const C2DPolyBase &Poly2, bool bP2RoutesInside, C2DLineBaseSetSet &Routes1, C2DLineBaseSetSet &Routes2) |
Returns the Route collections for 2 polygons. | |
static void | RoutesToPolygons (C2DPolyBaseSet &Polygons, C2DLineBaseSetSet &Routes) |
Given a set of routes, this function converts them all to created polygon. | |
Protected Member Functions | |
void | MakeBoundingRect (void) |
Forms the bounding rectangle. | |
void | MakeLineRects (void) |
Forms the bounding rectangle. | |
void | ReverseDirection (void) |
Reverses the direction of the lines. | |
Protected Attributes | |
C2DLineBaseSet | m_Lines |
The lines. | |
C2DRect | m_BoundingRect |
The bounding rectangle. | |
C2DRectSet | m_LineRects |
The LINE bounding rectangles. |
---------------------------------------------------------------------------
|
Constructor.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Constructor.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Destructor.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Clears all.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Reimplemented in C2DPolyArc, and C2DPolygon. |
|
True if it entirely contains the line.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Reimplemented in C2DPolygon. |
|
True if it entirely contains the other.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Reimplemented in C2DPolygon. |
|
True if it entirely contains the other.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if the point is in the shape.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Reimplemented in C2DPolygon. |
|
Creates from the set of lines using copies.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Creates directly from a set of lines by extracting them from the set provided.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if it crosses the line. Provides the intersection points.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Reimplemented in C2DPolygon. |
|
Intersection with a line base. Finds out what sort of line it is first.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Reimplemented in C2DPolygon. |
|
Intersection with another.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if it crosses the other.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if it crosses the ray. Provides the intersection points.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Reimplemented in C2DPolygon. |
|
Distance of the poly from the shape.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Distance to the line.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Distance of the point from the shape. Returns -ve if inside.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Gets the boolean operation with the other. e.g. union / intersection.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Returns a pointer to the line, 0 if invalid. Cycliclly handles indexes over the max.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Reimplemented in C2DPolygon. |
|
Returns a pointer to the line rect.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Returns the non-overlaps of this with another.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Returns the overlaps of this with another.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Calculates the perimeter.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Returns the Route collections for 2 polygons.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Returns the routes inside or outside the other polygon / holed polygon. Returns the routes (collection of lines and sublines) either inside or outside another Given the intersection points. |
|
Returns the union of this with another.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Grows the area around the origin.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. Reimplemented in C2DPolygon. |
|
True if any of the lines cross.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if it is a closed shape which it should be.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if the point is with the range given to the shape or inside.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Forms the bounding rectangle.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Forms the bounding rectangle.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Moves the shape.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. Reimplemented in C2DPolygon. |
|
Assigment.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if this overlaps the other.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Projection onto the vector.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. Reimplemented in C2DPolygon. |
|
Projection onto the line.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. Reimplemented in C2DPolygon. |
|
Moves this by a tiny random amount.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Reflects throught the line provided.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. Reimplemented in C2DPolygon. |
|
Reflects the area about the point.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. Reimplemented in C2DPolygon. |
|
Reverses the direction of the lines.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Rotates the polygon to the right around the origin given.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. Reimplemented in C2DPolyArc, and C2DPolygon. |
|
Given a set of routes, this function converts them all to created polygon.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Assigment.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Snap to the conceptual grid.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |