Container of polygons. More...

#include <rpolygons.h>

Inheritance diagram for RPolygons:
[legend]
Collaboration diagram for RPolygons:
[legend]

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
 
RPolygonsoperator= (const RPolygons &poly)
 
void Save (RTextFile &f)
 
R::RCursor< RPolygonGetPolygonsCursor (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)
 
RContaineroperator= (const RContainer< RPolygon, true, bOrder > &src)
 
RContaineroperator= (const RContainer< RPolygon, false, bOrder > &src)
 
void Copy (const RContainer< RPolygon, a, bOrder > &src)
 
RContaineroperator+= (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 RPolygonoperator[] (size_t idx) const
 
RPolygonoperator[] (size_t idx)
 
const RPolygonGetPtrAt (size_t idx) const
 
RPolygonGetPtrAt (size_t idx)
 
RPolygonGetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const
 
RPolygonGetPtr (const TUse &tag, size_t min=0, size_t max=0) const
 
RPolygonGetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0)
 
RPolygonGetInsertPtr (const TUse &tag, size_t min=0, size_t max=0)
 
RPolygonGetInsertPtrAt (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)
 
iRContaineroperator= (const iRContainer< RPolygon > &src)
 
void Copy (const iRContainer< RPolygon > &src)
 
iRContaineroperator+= (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 RPolygonoperator[] (size_t idx) const
 
RPolygonoperator[] (size_t idx)
 
const RPolygonGetPtrAt (size_t idx) const
 
RPolygonGetPtrAt (size_t idx)
 
RPolygonGetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const
 
RPolygonGetPtr (const TUse &tag, size_t min=0, size_t max=0) const
 
RPolygonGetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0)
 
RPolygonGetInsertPtr (const TUse &tag, size_t min=0, size_t max=0)
 
RPolygonGetInsertPtrAt (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)
 
iRContainerNormalCopy (const iRContainer< RPolygon > &src)
 
void DeepCopy (const iRContainer< RPolygon > &src)
 
iRContainerAdd (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
nbInitial 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
ptThe point used.
bool IsOnEdge ( const RPoint pt,
const RPolygon exclude 
) const

Return true if the point is on an edge of a certain polygon.

Parameters
ptThe point used.
excludeThe polygon not to look in.
bool IsOnEdge ( const RPoint pt1,
const RPoint pt2 
) const

Return true if two points are on the same edge of one of the polygon contained.

Parameters
pt1The first point used.
pt2The second point used.
void PutPoints ( RPoints points) const

Add the points of the polygons contained to a container of points.

Parameters
pointsA pointer to the container of points.
void Union ( RPolygon upoly) const

This function calculate the union of the polygons contained.

Parameters
upolyA 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
ptPoint to verify.
Returns
true if the point is inside.
bool IsIn ( const tCoord  x,
const tCoord  y 
) const

Look if the point is inside of the polygons.

Parameters
xX-coordinate of the point.
yY-coordinate of the point.
Returns
true if the point is inside.
RPolygons& operator= ( const RPolygons poly)

Assign operator.

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.