In file include/csgeom/poly2d.h:

class csPoly2D

The following class represents a general 2D polygon with a bounding box

Inheritance:


Public Methods

void AddVertex (float x, float y)
Add a vertex (2D) to the polygon
void AddVertex (const csVector2& v)
Add a vertex (2D) to the polygon
bool ClipAgainst (csClipper* view)
Clipping routines
csPoly2D (int start_size = 10)
Make a new empty polygon
csPoly2D (csPoly2D& copy)
Copy constructor.
csBox& GetBoundingBox ()
Get the bounding box (in 2D space) for this polygon.
csVector2* GetFirst ()
Get the first vertex
csVector2* GetLast ()
Get the last vertex
int GetNumVertices ()
Get the number of vertices
csVector2* GetVertex (int i)
Get the specified vertex
csVector2* GetVertices ()
Get the array with all vertices
void MakeEmpty ()
Initialize the polygon to empty
void MakeRoom (int new_max)
Make room for at least the specified number of vertices
csVector2& operator[] (int i)
Get the specified vertex
void SetVertices (csVector2 *v, int num)
Set all polygon vertices at once
virtual ~csPoly2D ()
Destructor.

Protected Fields

csBox bbox
A 2D bounding box that is maintained automatically.
int max_vertices
int num_vertices
csVector2* vertices
The 2D vertices.

Documentation

The following class represents a general 2D polygon with a bounding box
csVector2* vertices
The 2D vertices.

int num_vertices

int max_vertices

csBox bbox
A 2D bounding box that is maintained automatically.

csPoly2D(int start_size = 10)
Make a new empty polygon

csPoly2D(csPoly2D& copy)
Copy constructor.

virtual ~csPoly2D()
Destructor.

void MakeEmpty()
Initialize the polygon to empty

int GetNumVertices()
Get the number of vertices

csVector2* GetVertices()
Get the array with all vertices

csVector2* GetVertex(int i)
Get the specified vertex

csVector2& operator[] (int i)
Get the specified vertex

csVector2* GetFirst()
Get the first vertex

csVector2* GetLast()
Get the last vertex

void MakeRoom(int new_max)
Make room for at least the specified number of vertices

void AddVertex(const csVector2& v)
Add a vertex (2D) to the polygon

void AddVertex(float x, float y)
Add a vertex (2D) to the polygon

void SetVertices(csVector2 *v, int num)
Set all polygon vertices at once

csBox& GetBoundingBox()
Get the bounding box (in 2D space) for this polygon.

bool ClipAgainst(csClipper* view)
Clipping routines. They return false if the resulting polygon is not visible for some reason. Note that these routines must not be called if the polygon is not visible. These routines will not check that. Note that these routines will put the resulting clipped 2D polygon in place of the original 2D polygon.


Direct child classes:
csPolygon2D

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de