crystalspace.jbind.interfaces.igeom.clip2d
Interface iClipper2D

All Superinterfaces:
iBase, iPointer
All Known Implementing Classes:
csClipper2D

public interface iClipper2D
extends iBase

This interfaces represents a 2D clipper for polygons.

Author:
Java wrapper - Quentin Anciaux, c++ version - http://crystal.sourceforge.net/docs/online/devapi/structiClipper2D.php

Method Summary
 int classifyBox(csBox2 box)
          Classify some bounding box against this clipper.
 short clip(csVector2Array InPolygon, csVector2Array OutPolygon)
          Clip a set of 2D points and return in 'OutPolygon' which is expected to contain space at least for MAX_OUTPUT_VERTICES elements.
 short clip(csVector2Array InPolygon, csVector2Array OutPolygon, csBox2 BoundingBox)
          Clip a set of 2D points.
 short clip(csVector2Array InPolygon, csVector2Array OutPolygon, csVertexStatus OutStatus)
          Clips a set of 2D points and provides additional information on each output vertex.
 short clipInPlace(csVector2Array InPolygon, csBox2 BoundingBox)
          Wrapper function: clip a polygon in-place.
 csVector2Array getClipPoly()
          Return a pointer to the array of csVector2's.
 int getVertexCount()
          Return number of vertices for this clipper polygon.
 boolean isInside(csVector2 v)
          Return true if given point is inside (or on bound); of clipper polygon.
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Method Detail

classifyBox

public int classifyBox(csBox2 box)
Classify some bounding box against this clipper. This function returns: -1 if box is not visible. 0 if box is partially visible. 1 if box is entirely visible. Implemented in csBoxClipper, and csPolygonClipper.

Parameters:
box -
Returns:

clip

public short clip(csVector2Array InPolygon,
                  csVector2Array OutPolygon,
                  csVertexStatus OutStatus)
Clips a set of 2D points and provides additional information on each output vertex. The information type can be: vertex is one of original vertices, vertex is on the edge of the original polygon and vertex is arbitrary located inside the original polygon. Both OutPolygon and OutStatus arrays are expected to have enough storage for at least MAX_OUTPUT_VERTICES elements. Returns one of CS_CLIP_. Implemented in csBoxClipper, and csPolygonClipper.

Parameters:
InPolygon -
OutPolygon -
OutStatus -
Returns:

clip

public short clip(csVector2Array InPolygon,
                  csVector2Array OutPolygon,
                  csBox2 BoundingBox)
Clip a set of 2D points. On output OutCount is set to number of vertices in output polygon. The output array is expected to contain space for at least MAX_OUTPUT_VERTICES elements. The bounding box is set to the minimal rectangle that contains the output polygon. Returns one of CS_CLIP_. Implemented in csBoxClipper, and csPolygonClipper.

Parameters:
InPolygon -
OutPolygon -
BoundingBox -
Returns:

clip

public short clip(csVector2Array InPolygon,
                  csVector2Array OutPolygon)
Clip a set of 2D points and return in 'OutPolygon' which is expected to contain space at least for MAX_OUTPUT_VERTICES elements. Returns one of CS_CLIP_. Implemented in csBoxClipper, and csPolygonClipper.

Parameters:
InPolygon -
OutPolygon -
Returns:

clipInPlace

public short clipInPlace(csVector2Array InPolygon,
                         csBox2 BoundingBox)
Wrapper function: clip a polygon in-place. Returns one of CS_CLIP_. Implemented in csClipper.

Parameters:
InPolygon -
BoundingBox -
Returns:

getClipPoly

public csVector2Array getClipPoly()
Return a pointer to the array of csVector2's. Implemented in csBoxClipper, and csPolygonClipper.

Returns:

getVertexCount

public int getVertexCount()
Return number of vertices for this clipper polygon. Implemented in csBoxClipper, and csPolygonClipper.

Returns:

isInside

public boolean isInside(csVector2 v)
Return true if given point is inside (or on bound); of clipper polygon. Implemented in csBoxClipper, and csPolygonClipper.

Parameters:
v -
Returns: