Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csPolygonClipper Class Reference

The csPolygonClipper class can be used for clipping any polygon against any other convex polygon. More...

#include <polyclip.h>

Inheritance diagram for csPolygonClipper:

csClipper iClipper2D iBase List of all members.

Public Methods

 csPolygonClipper (csPoly2D *Clipper, bool mirror=false, bool copy=false)
 Create a polygon clipper object from a 2D polygon.

 csPolygonClipper (csVector2 *Clipper, int Count, bool mirror=false, bool copy=false)
 Create a polygon clipper object from a set of 2D vectors.

virtual ~csPolygonClipper ()
 Destroy the polygon clipper object.

virtual uint8 Clip (csVector2 *InPolygon, int InCount, csVector2 *OutPolygon, int &OutCount)
 Simple clipping.

virtual uint8 Clip (csVector2 *InPolygon, int InCount, csVector2 *OutPolygon, int &OutCount, csBox2 &BoundingBox)
 Clip and compute the bounding box.

virtual uint8 Clip (csVector2 *InPolygon, int InCount, csVector2 *OutPolygon, int &OutCount, csVertexStatus *OutStatus)
 Clip and return additional information about each vertex.

virtual int ClassifyBox (const csBox2 &box)
 Classify some bounding box against this clipper.

virtual bool IsInside (const csVector2 &v)
 Return true if given point is inside (or on bound) of clipper polygon.

virtual int GetVertexCount ()
 Return number of vertices for this clipper polygon.

virtual csVector2GetClipPoly ()
 Return a pointer to the array of csVector2's.


Detailed Description

The csPolygonClipper class can be used for clipping any polygon against any other convex polygon.

The clipper object should be used, if possible, for many polygons (for example, a 3D sprite can initialize a clipper object then clip all of its triangle against it at once) as the initialization of clipper polygon involves some (although not too expensive) calculations. The clipping polygon *should* be convex since the routine does not expect any line to intersect the edge of clipping polygon more than twice.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000