![]() |
Public API Reference |
![]() |
The following class represents a general polygon. More...
#include <csgeom/polyidx.h>
Public Member Functions | |
int | AddVertex (int i) |
Add a vertex index to the polygon. | |
csPolyIndexed (int start_size=10) | |
Make a new empty polygon. | |
csPolyIndexed (csPolyIndexed ©) | |
Copy constructor. | |
int | GetVertex (int i) const |
Get the specified vertex index. | |
int | GetVertexCount () const |
Get the number of vertices. | |
int * | GetVertexIndices () |
Get the array with all vertex indices. | |
const int * | GetVertexIndices () const |
Get the array with all vertex indices. | |
void | MakeEmpty () |
Initialize the polygon to empty. | |
void | MakeRoom (int new_max) |
Make room for at least the specified number of vertices. | |
csPolyIndexed & | operator= (const csPolyIndexed &other) |
Assignment operator. | |
int & | operator[] (int i) |
Get the specified vertex index. | |
int & | operator[] (int i) const |
Get the specified vertex index. | |
virtual | ~csPolyIndexed () |
Destructor. | |
Protected Attributes | |
int * | vertices_idx |
The vertex indices. |
The following class represents a general polygon.
Vertices are indexed relative to some vertex array instead of directly represented in the polygon. Note that this polygon has no knowledge of the actual values of the vertices. It only keeps the indices. So it can actually be used both for 3D and 2D polygons.
csPolyIndexed::csPolyIndexed | ( | int | start_size = 10 | ) |
Make a new empty polygon.
csPolyIndexed::csPolyIndexed | ( | csPolyIndexed & | copy | ) |
Copy constructor.
virtual csPolyIndexed::~csPolyIndexed | ( | ) | [virtual] |
Destructor.
int csPolyIndexed::AddVertex | ( | int | i | ) |
Add a vertex index to the polygon.
Return index of added index.
int csPolyIndexed::GetVertex | ( | int | i | ) | const [inline] |
int csPolyIndexed::GetVertexCount | ( | ) | const [inline] |
int* csPolyIndexed::GetVertexIndices | ( | ) | [inline] |
const int* csPolyIndexed::GetVertexIndices | ( | ) | const [inline] |
void csPolyIndexed::MakeEmpty | ( | ) |
Initialize the polygon to empty.
void csPolyIndexed::MakeRoom | ( | int | new_max | ) |
Make room for at least the specified number of vertices.
csPolyIndexed& csPolyIndexed::operator= | ( | const csPolyIndexed & | other | ) |
Assignment operator.
int& csPolyIndexed::operator[] | ( | int | i | ) | [inline] |
int& csPolyIndexed::operator[] | ( | int | i | ) | const [inline] |
int* csPolyIndexed::vertices_idx [protected] |