org.ogre4j
Class Polygon

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.Polygon
All Implemented Interfaces:
IPolygon, INativeObject

public class Polygon
extends NativeObject
implements IPolygon


Nested Class Summary
static class Polygon.Edge
           
static class Polygon.EdgeMap
           
static class Polygon.VertexList
           
 
Nested classes/interfaces inherited from interface org.ogre4j.IPolygon
IPolygon.IEdge, IPolygon.IEdgeMap, IPolygon.IVertexList
 
Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  Polygon()
           
  Polygon(InstancePointer p)
          This constructor is public for internal useage only!
protected Polygon(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  Polygon(IPolygon cpy)
           
  Polygon(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 void delete()
          Deletes the corresponding C++ object.
 void deleteVertex(int vertex)
          Deletes a specific vertex.
 void finalize()
           
 IVector3 getNormal()
          Returns the polygon normal.
 IVector3 getVertex(int vertex)
          Returns a vertex.
 int getVertexCount()
          Vertex count.
 void insertVertex(IVector3 vdata)
          Inserts a vertex at the end of the polygon.
 void insertVertex(IVector3 vdata, int vertexIndex)
          Inserts a vertex at a specific position.
 boolean isPointInside(IVector3 point)
          Determines if a point is inside the polygon.
 boolean operatorEqual(IPolygon rhs)
          Determines if the current object is equal to the compared one.
 boolean operatorNotEqual(IPolygon rhs)
          Determines if the current object is not equal to the compared one.
 void removeDuplicates()
          Removes duplicate vertices from a polygon.
 void reset()
          Resets the object.
 void setVertex(IVector3 vdata, int vertexIndex)
          Sets a specific vertex of a polygon.
 void storeEdges(IPolygon.IEdgeMap edgeMap)
          Stores the edges of the polygon in ccw order.
 
Methods inherited from class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

Polygon

public Polygon(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


Polygon

protected Polygon(InstancePointer p,
                  boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


Polygon

public Polygon(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()

Polygon

public Polygon()

Polygon

public Polygon(IPolygon cpy)
Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

insertVertex

public void insertVertex(IVector3 vdata,
                         int vertexIndex)
Inserts a vertex at a specific position.

Specified by:
insertVertex in interface IPolygon

insertVertex

public void insertVertex(IVector3 vdata)
Inserts a vertex at the end of the polygon.

Specified by:
insertVertex in interface IPolygon

getVertex

public IVector3 getVertex(int vertex)
Returns a vertex.

Specified by:
getVertex in interface IPolygon

setVertex

public void setVertex(IVector3 vdata,
                      int vertexIndex)
Sets a specific vertex of a polygon.

Specified by:
setVertex in interface IPolygon

removeDuplicates

public void removeDuplicates()
Removes duplicate vertices from a polygon.

Specified by:
removeDuplicates in interface IPolygon

getVertexCount

public int getVertexCount()
Vertex count.

Specified by:
getVertexCount in interface IPolygon

getNormal

public IVector3 getNormal()
Returns the polygon normal.

Specified by:
getNormal in interface IPolygon

deleteVertex

public void deleteVertex(int vertex)
Deletes a specific vertex.

Specified by:
deleteVertex in interface IPolygon

isPointInside

public boolean isPointInside(IVector3 point)
Determines if a point is inside the polygon.

Specified by:
isPointInside in interface IPolygon

storeEdges

public void storeEdges(IPolygon.IEdgeMap edgeMap)
Stores the edges of the polygon in ccw order. The vertices are copied so the user has to take the deletion into account.

Specified by:
storeEdges in interface IPolygon

reset

public void reset()
Resets the object.

Specified by:
reset in interface IPolygon

operatorEqual

public boolean operatorEqual(IPolygon rhs)
Determines if the current object is equal to the compared one.

Specified by:
operatorEqual in interface IPolygon

operatorNotEqual

public boolean operatorNotEqual(IPolygon rhs)
Determines if the current object is not equal to the compared one.

Specified by:
operatorNotEqual in interface IPolygon


Copyright © 2007 netAllied GmbH. All Rights Reserved.