Container of polygons. More...
#include <rpolygons.h>
Public Member Functions | |
RPolygons (size_t nb=20) | |
bool | IsOnEdge (const RPoint &pt) const |
bool | IsOnEdge (const RPoint &pt, const RPolygon *exclude) const |
bool | IsOnEdge (const RPoint &pt1, const RPoint &pt2) const |
void | PutPoints (RPoints &points) const |
void | Union (RPolygon &upoly) const |
bool | DuplicatePoints (void) const |
bool | IsIn (const RPoint &pt) const |
bool | IsIn (const tCoord x, const tCoord y) const |
RPolygons & | operator= (const RPolygons &poly) |
void | Save (RTextFile &f) |
R::RCursor< RPolygon > | GetPolygonsCursor (void) |
Public Member Functions inherited from RContainer< RPolygon, true, false > | |
RContainer (size_t m, size_t i=0) | |
RContainer (const RContainer< RPolygon, true, bOrder > &src) | |
RContainer (const RContainer< RPolygon, false, bOrder > &src) | |
int | Compare (const RContainer< RPolygon, bAlloc, bOrder > &) const |
size_t | GetNb (void) const |
size_t | GetMaxPos (void) const |
size_t | GetMaxNb (void) const |
size_t | GetIncNb (void) const |
bool | VerifyIndex (size_t idx) const |
void | VerifyTab (size_t max=0) |
void | Clear (size_t m=0, size_t i=0, bool force=false) |
void | ReOrder (int sortOrder(const void *, const void *), size_t min, size_t max) |
void | ReOrder (int sortOrder(const void *, const void *)) |
void | ReOrder (void) |
void | Exchange (size_t pos1, size_t pos2) |
void | Shift (size_t idx, bool reverse) |
void | Transfer (RContainer< RPolygon, a, o > &src) |
RContainer & | operator= (const RContainer< RPolygon, true, bOrder > &src) |
RContainer & | operator= (const RContainer< RPolygon, false, bOrder > &src) |
void | Copy (const RContainer< RPolygon, a, bOrder > &src) |
RContainer & | operator+= (const RContainer< RPolygon, a, o > &src) |
size_t | GetIndex (const TUse &tag, bool &find, size_t min=0, size_t max=0) const |
bool | IsIn (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const |
bool | IsIn (const TUse &tag, size_t min=0, size_t max=0) const |
const RPolygon * | operator[] (size_t idx) const |
RPolygon * | operator[] (size_t idx) |
const RPolygon * | GetPtrAt (size_t idx) const |
RPolygon * | GetPtrAt (size_t idx) |
RPolygon * | GetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const |
RPolygon * | GetPtr (const TUse &tag, size_t min=0, size_t max=0) const |
RPolygon * | GetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) |
RPolygon * | GetInsertPtr (const TUse &tag, size_t min=0, size_t max=0) |
RPolygon * | GetInsertPtrAt (const TUse &tag, size_t pos) |
RContainer< RPolygon, false, bOrder > * | GetPtrs (const TUse &tag, size_t min=0, size_t max=0) const |
size_t | GetTab (const void **tab, size_t min=0, size_t max=0) const |
size_t | GetTab (void **tab, size_t min=0, size_t max=0) |
size_t | GetTab (const RPolygon **tab, size_t min=0, size_t max=0) const |
size_t | GetTab (RPolygon **tab, size_t min=0, size_t max=0) |
void | InsertPtrAt (RPolygon *ins, size_t pos, bool del) |
void | InsertPtrAt (RPolygon *ins, size_t pos) |
void | InsertPtr (RPolygon *ins, bool del=false, size_t min=0, size_t max=0) |
void | DeletePtrAt (size_t pos, bool shift, bool del) |
void | DeletePtrAt (size_t pos, bool shift) |
void | DeletePtrAt (size_t pos) |
void | DeletePtr (const TUse &tag, bool sortkey, bool del, size_t min=0, size_t max=0) |
void | DeletePtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) |
void | DeletePtr (const TUse &tag, size_t min=0, size_t max=0) |
void | Inter (const iRContainer< RPolygon > &src1, const iRContainer< RPolygon > &src2) |
void | Union (const iRContainer< RPolygon > &src1, const iRContainer< RPolygon > &src2) |
virtual | ~RContainer (void) |
Public Member Functions inherited from iRContainer< RPolygon > | |
size_t | GetNb (void) const |
size_t | GetMaxPos (void) const |
size_t | GetMaxNb (void) const |
size_t | GetIncNb (void) const |
bool | VerifyIndex (size_t idx) const |
void | VerifyTab (size_t max=0) |
void | Clear (size_t m=0, size_t i=0, bool force=false) |
void | ReOrder (int sortOrder(const void *, const void *), size_t min, size_t max) |
void | ReOrder (int sortOrder(const void *, const void *)) |
void | ReOrder (void) |
void | Exchange (size_t pos1, size_t pos2) |
void | Shift (size_t idx, bool reverse) |
void | Transfer (iRContainer< RPolygon > &src) |
iRContainer & | operator= (const iRContainer< RPolygon > &src) |
void | Copy (const iRContainer< RPolygon > &src) |
iRContainer & | operator+= (const iRContainer< RPolygon > &src) |
size_t | GetIndex (bool order, const TUse &tag, bool &find, size_t min=0, size_t max=0) const |
size_t | GetIndex (const TUse &tag, bool &find, size_t min=0, size_t max=0) const |
bool | IsIn (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const |
bool | IsIn (const TUse &tag, size_t min=0, size_t max=0) const |
const RPolygon * | operator[] (size_t idx) const |
RPolygon * | operator[] (size_t idx) |
const RPolygon * | GetPtrAt (size_t idx) const |
RPolygon * | GetPtrAt (size_t idx) |
RPolygon * | GetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const |
RPolygon * | GetPtr (const TUse &tag, size_t min=0, size_t max=0) const |
RPolygon * | GetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) |
RPolygon * | GetInsertPtr (const TUse &tag, size_t min=0, size_t max=0) |
RPolygon * | GetInsertPtrAt (const TUse &tag, size_t pos) |
size_t | GetTab (const void **tab, size_t min=0, size_t max=0) const |
size_t | GetTab (void **tab, size_t min=0, size_t max=0) |
size_t | GetTab (const RPolygon **tab, size_t min=0, size_t max=0) const |
size_t | GetTab (RPolygon **tab, size_t min=0, size_t max=0) |
void | InsertPtrAt (RPolygon *ins, size_t pos, bool del) |
void | InsertPtrAt (RPolygon *ins, size_t pos) |
void | InsertPtr (RPolygon *ins, bool del=false, size_t min=0, size_t max=0) |
void | DeletePtrAt (size_t pos, bool shift, bool del) |
void | DeletePtrAt (size_t pos, bool shift) |
void | DeletePtrAt (size_t pos) |
void | DeletePtr (const TUse &tag, bool sortkey, bool del, size_t min=0, size_t max=0) |
void | DeletePtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) |
void | DeletePtr (const TUse &tag, size_t min=0, size_t max=0) |
void | Inter (const iRContainer< RPolygon > &src1, const iRContainer< RPolygon > &src2) |
void | Union (const iRContainer< RPolygon > &src1, const iRContainer< RPolygon > &src2) |
virtual | ~iRContainer (void) |
Additional Inherited Members | |
Static Public Member Functions inherited from RContainer< RPolygon, true, false > | |
static int | SortOrder (const void *a, const void *b) |
Static Public Member Functions inherited from iRContainer< RPolygon > | |
static int | SortOrder (const void *a, const void *b) |
Protected Member Functions inherited from iRContainer< RPolygon > | |
void | Create (const iRContainer< RPolygon > &src) |
iRContainer & | NormalCopy (const iRContainer< RPolygon > &src) |
void | DeepCopy (const iRContainer< RPolygon > &src) |
iRContainer & | Add (const iRContainer< RPolygon > &src) |
Protected Attributes inherited from iRContainer< RPolygon > | |
RPolygon ** | Tab |
size_t | NbPtr |
size_t | MaxPtr |
size_t | LastPtr |
size_t | IncPtr |
Detailed Description
Container of polygons.
This class represents a set of polygons regrouped in a container.
Constructor & Destructor Documentation
RPolygons | ( | size_t | nb = 20 | ) |
Construct a container of polygons.
- Parameters
-
nb Initial maximum number of polygons.
Member Function Documentation
bool IsOnEdge | ( | const RPoint & | pt | ) | const |
Return true if the point is on an edge of one of the polygon contained.
- Parameters
-
pt The point used.
Return true if the point is on an edge of a certain polygon.
- Parameters
-
pt The point used. exclude The polygon not to look in.
Return true if two points are on the same edge of one of the polygon contained.
- Parameters
-
pt1 The first point used. pt2 The second point used.
void PutPoints | ( | RPoints & | points | ) | const |
Add the points of the polygons contained to a container of points.
- Parameters
-
points A pointer to the container of points.
void Union | ( | RPolygon & | upoly | ) | const |
This function calculate the union of the polygons contained.
- Parameters
-
upoly A pointer to the polygon representing the union.
- Warning
- All the polygons must be glued.
bool DuplicatePoints | ( | void | ) | const |
This function returns true when there are duplicate points.
bool IsIn | ( | const RPoint & | pt | ) | const |
Look if the point is inside one of the polygons.
- Parameters
-
pt Point to verify.
- Returns
- true if the point is inside.
Look if the point is inside of the polygons.
- Parameters
-
x X-coordinate of the point. y Y-coordinate of the point.
- Returns
- true if the point is inside.
void Save | ( | RTextFile & | f | ) |
Save the polygons in a file. param f Text file where the information must be written.
R::RCursor<RPolygon> GetPolygonsCursor | ( | void | ) |
Get a cursor on the polygons.
- Returns
- RPolygonCursor.