org.openmali.spatial
Class VertexList

java.lang.Object
  extended by org.openmali.spatial.VertexList
All Implemented Interfaces:
VertexContainer

public final class VertexList
extends java.lang.Object
implements VertexContainer

This is a utility class to abstract a vertex list.
The vertices may come from an array or Tuple3f or a List ir Tuple3f or a SpatialObjectInterface


Nested Class Summary
static class VertexList.SourceType
           
 
Constructor Summary
VertexList()
           
VertexList(java.util.List<Tuple3f> list)
           
VertexList(Tuple3f[] array)
           
VertexList(VertexContainer vc)
           
 
Method Summary
 VertexList.SourceType getSourceType()
           
 boolean getVertex(int i, Tuple3f coord)
          This allows the spatial container to have access to all the vertices in the object.
 int getVertexCount()
          
 void set(java.util.List<Tuple3f> list)
           
 void set(Tuple3f[] array)
           
 void set(VertexContainer vc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VertexList

public VertexList()

VertexList

public VertexList(VertexContainer vc)

VertexList

public VertexList(java.util.List<Tuple3f> list)

VertexList

public VertexList(Tuple3f[] array)
Method Detail

getSourceType

public final VertexList.SourceType getSourceType()

getVertexCount

public int getVertexCount()

Specified by:
getVertexCount in interface VertexContainer
Returns:
the number of vertices in this object. This could be the number of vertices which form a convex hull or it could be the the total number of vertices in the object. If the object is a triangle then this would return a count of 3.

getVertex

public final boolean getVertex(int i,
                               Tuple3f coord)
This allows the spatial container to have access to all the vertices in the object. This allows for the computation of bounding boxes which completely enclose the bounding box. The vertices need to be returned in world coordinates, not local coordinates.

Specified by:
getVertex in interface VertexContainer

set

public final void set(VertexContainer vc)

set

public final void set(java.util.List<Tuple3f> list)

set

public final void set(Tuple3f[] array)