#include <2DHoledPolyBase.h>
Inheritance diagram for C2DHoledPolyBase:
Public Member Functions | |
C2DHoledPolyBase (void) | |
Constructor. | |
C2DHoledPolyBase (const C2DHoledPolyBase &Other) | |
Copy constructor. | |
~C2DHoledPolyBase (void) | |
Destructor. | |
const C2DHoledPolyBase & | operator= (const C2DHoledPolyBase &Other) |
Assignment. | |
void | SetRim (const C2DPolyBase &Polygon) |
Sets the rim to a copy of the polygon given. | |
void | AddHole (const C2DPolyBase &Polygon) |
Adds a copy of the polygon given. | |
void | SetHole (const C2DPolyBase &Polygon, unsigned int usIndex) |
Sets the holes to be a copy of the polygon given. | |
void | SetRimDirect (C2DPolyBase *Polygon) |
Sets the rim to be the polygon provided. Will delete on destruction. | |
void | AddHoleDirect (C2DPolyBase *Polygon) |
Adds the hole provided. Will delete on destruction. | |
void | SetHoleDirect (C2DPolyBase *Polygon, unsigned int usIndex) |
Sets the hole to be the polygon provided. Will delete on destruction. Deletes old one. | |
void | RemoveHole (unsigned int usIndex) |
Removes the hole at the index given. | |
C2DPolyBase * | GetRim (void) |
Returns the rim. | |
const C2DPolyBase * | GetRim (void) const |
Returns the rim. | |
C2DPolyBase * | ExtractRim (void) |
Extracts the rim. Deletion of the rim needs to be managed elsewhere. | |
C2DPolyBase * | GetHole (unsigned int usIndex) |
Returns a pointer to the hole specified. | |
const C2DPolyBase * | GetHole (unsigned int usIndex) const |
Returns a pointer to the hole specified. | |
C2DPolyBase * | ExtractHole (unsigned int usIndex) |
Extracts the hole. Deletion of the hole needs to be managed elsewhere. | |
unsigned int | GetHoleCount (void) const |
Returns the number of holes. | |
unsigned int | GetLineCount (void) const |
Return the number of lines. | |
void | Clear (void) |
Clears the shape. | |
bool | IsValid (void) |
True if the holes are contained and non-intersecting. | |
void | RotateToRight (double dAng, const C2DPoint &Origin) |
Rotates to the right by the angle around the origin. | |
void | Move (const C2DVector &Vector) |
Moves the polygon. | |
void | Grow (double dFactor, const C2DPoint &Origin) |
Grows around the origin. | |
void | Reflect (const C2DPoint &Point) |
Point reflection. | |
void | Reflect (const C2DLine &Line) |
Reflects throught the line provided. | |
double | Distance (const C2DPoint &TestPoint) const |
Distance from the point. | |
double | Distance (const C2DLineBase &Line) const |
Distance from the line provided. | |
double | Distance (const C2DPolyBase &Poly, C2DPoint *ptOnThis=0, C2DPoint *ptOnOther=0) const |
Distance from the polygon provided. Also returns points if provided. | |
bool | IsWithinDistance (const C2DPoint &TestPoint, double dDist) const |
Distance from the point. | |
double | GetPerimeter (void) const |
Returns the perimeter. | |
void | Project (const C2DLine &Line, CInterval &Interval) const |
Projection onto the line. | |
void | Project (const C2DVector &Vector, CInterval &Interval) const |
Projection onto the vector. | |
bool | HasCrossingLines (void) const |
True if there are crossing lines. | |
void | GetBoundingRect (C2DRect &Rect) const |
Returns the bounding rectangle. | |
bool | Contains (const C2DPoint &pt) const |
Point inside test. | |
bool | Contains (const C2DLineBase &Line) const |
Line entirely inside test. | |
bool | Contains (const C2DPolyBase &Polygon) const |
Polygon entirely inside test. | |
bool | Contains (const C2DHoledPolyBase &Polygon) const |
Polygon entirely inside test. | |
bool | Crosses (const C2DLineBase &Line) const |
True if this crosses the line. | |
bool | Crosses (const C2DLineBase &Line, C2DPointSet *IntersectionPts) const |
True if this crosses the line, returns the intersection points. | |
bool | Crosses (const C2DPolyBase &Poly) const |
True if it crosses the other. | |
bool | CrossesRay (const C2DLine &Ray, C2DPointSet *IntersectionPts) const |
True if this crosses the ray, returns the intersection points. | |
bool | Overlaps (const C2DHoledPolyBase &Other) const |
True if this overlaps the other. | |
bool | Overlaps (const C2DPolyBase &Other) const |
True if this overlaps the other. | |
void | GetOverlaps (const C2DHoledPolyBase &Other, C2DHoledPolyBaseSet &HoledPolys, CGrid::eDegenerateHandling eDegen=CGrid::None) const |
Returns the overlaps between this and the other complex polygon. | |
void | GetNonOverlaps (const C2DHoledPolyBase &Other, C2DHoledPolyBaseSet &HoledPolys, CGrid::eDegenerateHandling eDegen=CGrid::None) const |
Returns the difference between this and the other polygon. | |
void | GetUnion (const C2DHoledPolyBase &Other, C2DHoledPolyBaseSet &HoledPolys, CGrid::eDegenerateHandling eDegen=CGrid::None) const |
Returns the union of this and the other. | |
void | RandomPerturb (void) |
Moves this by a small random amount. | |
void | SnapToGrid (void) |
Snaps this to the conceptual grip. | |
void | GetBoolean (const C2DHoledPolyBase &Other, C2DHoledPolyBaseSet &HoledPolys, bool bThisInside, bool bOtherInside, CGrid::eDegenerateHandling eDegen=CGrid::None) const |
GetBoolean. | |
Static Public Member Functions | |
static void | PolygonsToHoledPolygons (C2DHoledPolyBaseSet &HoledPolys, C2DPolyBaseSet &Polygons) |
Function to convert polygons to complex polygons. Assigning holes to those that are contained. | |
static void | GetRoutes (const C2DHoledPolyBase &Poly1, bool bP1RoutesInside, const C2DHoledPolyBase &Poly2, bool bP2RoutesInside, C2DLineBaseSetSet &Routes1, C2DLineBaseSetSet &Routes2, C2DPolyBaseSet &CompleteHoles1, C2DPolyBaseSet &CompleteHoles2) |
GetRoutes. | |
Protected Attributes | |
C2DPolyBase * | m_Rim |
The rim. | |
C2DPolyBaseSet | m_Holes |
The holes. |
A class which represents an C2DPolyBase with holes. Note that some of the functions assume that the holes are inside the area for simplicity and speed. E.g. the projection function will project the rim and not the holes as there should be no need as long as it is a valid area.
---------------------------------------------------------------------------
|
Constructor.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Copy constructor.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Destructor.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Adds a copy of the polygon given.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Adds the hole provided. Will delete on destruction.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Clears the shape.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Polygon entirely inside test.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Polygon entirely inside test.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Line entirely inside test.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Point inside test.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if it crosses the other.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if this crosses the line, returns the intersection points.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if this crosses the line.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if this crosses the ray, returns the intersection points.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Distance from the polygon provided. Also returns points if provided.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Distance from the line provided.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Distance from the point.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Extracts the hole. Deletion of the hole needs to be managed elsewhere.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Extracts the rim. Deletion of the rim needs to be managed elsewhere.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Reimplemented in C2DHoledPolyArc, and C2DHoledPolygon. |
|
GetBoolean. Returns the boolean result (e.g. union) of 2 shapes. Boolean Operation defined by the inside / outside flags. |
|
Returns the bounding rectangle.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Returns a pointer to the hole specified.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Returns a pointer to the hole specified.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Return the number of lines.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Returns the difference between this and the other polygon.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Returns the overlaps between this and the other complex polygon.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Returns the perimeter.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
GetRoutes. Returns the routes (multiple lines or part polygons) either inside or outside the polygons provided. These are based on the intersections of the 2 polygons e.g. the routes / part polygons of one inside the other. |
|
Returns the union of this and the other.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Grows around the origin.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. Reimplemented in C2DHoledPolygon. |
|
True if there are crossing lines.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if the holes are contained and non-intersecting.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Distance from the point.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Moves the polygon.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Assignment.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if this overlaps the other.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
True if this overlaps the other.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Function to convert polygons to complex polygons. Assigning holes to those that are contained.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Projection onto the vector.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Projection onto the line.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Moves this by a small random amount.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Reflects throught the line provided.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Point reflection.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |
|
Removes the hole at the index given.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Rotates to the right by the angle around the origin.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. Reimplemented in C2DHoledPolygon. |
|
Sets the holes to be a copy of the polygon given.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Sets the hole to be the polygon provided. Will delete on destruction. Deletes old one.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Sets the rim to a copy of the polygon given.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Sets the rim to be the polygon provided. Will delete on destruction.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- |
|
Snaps this to the conceptual grip.
-------------------------------------------------------------------------- --------------------------------------------------------------------------- Implements C2DBase. |