crystalspace.jbind.impl.csgeom.clip2d
Class csClipper2D

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.csgeom.clip2d.csClipper2D
All Implemented Interfaces:
iBase, iClipper2D, iPointer

public class csClipper2D
extends csBase
implements iClipper2D

Author:
Quentin Anciaux

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csClipper2D(iPointer nPointer)
           
 
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.
static java.lang.Class getInterfaceClass()
           
static java.lang.String getInterfaceName()
           
static int getInterfaceVersion()
           
 java.lang.String getName()
          Return the name of the interface
 int getVersion()
          Return the version of the interface
 int getVertexCount()
          Return number of vertices for this clipper polygon.
static void initSCF()
           
 boolean isInside(csVector2 v)
          Return true if given point is inside (or on bound); of clipper polygon.
protected  boolean isNativePointerValidSafe(long pointer)
           
 
Methods inherited from class crystalspace.jbind.impl.csutil.scf.csBase
decRef, equals, finalize, getRefCount, incRef, nDelete, queryInterface, queryInterfaceSafe
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Constructor Detail

csClipper2D

public csClipper2D(iPointer nPointer)
Parameters:
nPointer -
Method Detail

getVersion

public int getVersion()
Description copied from interface: iBase
Return the version of the interface

Specified by:
getVersion in interface iBase
Specified by:
getVersion in class csBase

getName

public java.lang.String getName()
Description copied from interface: iBase
Return the name of the interface

Specified by:
getName in interface iBase
Specified by:
getName in class csBase

initSCF

public static void initSCF()

getInterfaceVersion

public static int getInterfaceVersion()

getInterfaceName

public static java.lang.String getInterfaceName()

getInterfaceClass

public static java.lang.Class getInterfaceClass()

isNativePointerValidSafe

protected boolean isNativePointerValidSafe(long pointer)
Specified by:
isNativePointerValidSafe in class csNativeObject
See Also:
csNativeObject.isNativePointerValidSafe(long)

classifyBox

public int classifyBox(csBox2 box)
Description copied from interface: iClipper2D
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.

Specified by:
classifyBox in interface iClipper2D
Parameters:
box -
Returns:
See Also:
iClipper2D.classifyBox(crystalspace.jbind.impl.csgeom.box.csBox2)

clip

public short clip(csVector2Array InPolygon,
                  csVector2Array OutPolygon,
                  csVertexStatus OutStatus)
Description copied from interface: iClipper2D
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.

Specified by:
clip in interface iClipper2D
Parameters:
InPolygon -
OutPolygon -
OutStatus -
Returns:
See Also:
crystalspace.jbind.interfaces.igeom.clip2d.iClipper2D#clip(crystalspace.jbind.impl.csgeom.vector2.csVector2, int, crystalspace.jbind.impl.csgeom.vector2.csVector2, int, crystalspace.jbind.impl.csgeom.clip2d.csVertexStatus)

clip

public short clip(csVector2Array InPolygon,
                  csVector2Array OutPolygon,
                  csBox2 BoundingBox)
Description copied from interface: iClipper2D
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.

Specified by:
clip in interface iClipper2D
Parameters:
InPolygon -
OutPolygon -
BoundingBox -
Returns:
See Also:
crystalspace.jbind.interfaces.igeom.clip2d.iClipper2D#clip(crystalspace.jbind.impl.csgeom.vector2.csVector2, int, crystalspace.jbind.impl.csgeom.vector2.csVector2, int, crystalspace.jbind.impl.csgeom.box.csBox2)

clip

public short clip(csVector2Array InPolygon,
                  csVector2Array OutPolygon)
Description copied from interface: iClipper2D
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.

Specified by:
clip in interface iClipper2D
Parameters:
InPolygon -
OutPolygon -
Returns:
See Also:
crystalspace.jbind.interfaces.igeom.clip2d.iClipper2D#clip(crystalspace.jbind.impl.csgeom.vector2.csVector2, int, crystalspace.jbind.impl.csgeom.vector2.csVector2, int)

clipInPlace

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

Specified by:
clipInPlace in interface iClipper2D
Parameters:
InPolygon -
BoundingBox -
Returns:
See Also:
crystalspace.jbind.interfaces.igeom.clip2d.iClipper2D#clipInPlace(crystalspace.jbind.impl.csgeom.vector2.csVector2, int, crystalspace.jbind.impl.csgeom.box.csBox2)

getClipPoly

public csVector2Array getClipPoly()
Description copied from interface: iClipper2D
Return a pointer to the array of csVector2's. Implemented in csBoxClipper, and csPolygonClipper.

Specified by:
getClipPoly in interface iClipper2D
Returns:
See Also:
iClipper2D.getClipPoly()

getVertexCount

public int getVertexCount()
Description copied from interface: iClipper2D
Return number of vertices for this clipper polygon. Implemented in csBoxClipper, and csPolygonClipper.

Specified by:
getVertexCount in interface iClipper2D
Returns:
See Also:
iClipper2D.getVertexCount()

isInside

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

Specified by:
isInside in interface iClipper2D
Parameters:
v -
Returns:
See Also:
iClipper2D.isInside(crystalspace.jbind.impl.csgeom.vector2.csVector2)