de.javagl.utils.obj.impl
Class DefaultObjFace

java.lang.Object
  extended by de.javagl.utils.obj.impl.DefaultObjFace
All Implemented Interfaces:
ObjFace

public class DefaultObjFace
extends Object
implements ObjFace

Default implementation of an ObjFace


Constructor Summary
DefaultObjFace(int[] vertexIndices, int[] texCoordIndices, int[] normalIndices, ObjGroup group, ObjGroup materialGroup)
          Creates a Face from the given parameters
 
Method Summary
 boolean containsNormalIndices()
          Returns whether this face contains normal indices
 boolean containsTexCoordIndices()
          Returns whether this face contains texture coordinate indices
 ObjGroup getGroup()
          Returns the group that this face belongs to
 ObjGroup getMaterialGroup()
          Returns the material group that this face belongs to
 int getNormalIndex(int number)
          Returns the index of the normal with the given number.
 int getNumVertices()
          Returns the number of vertices this face consists of.
 int getTexCoordIndex(int number)
          Returns the index of the texture coordinate with the given number.
 int getVertexIndex(int number)
          Returns the index of the vertex with the given number.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultObjFace

public DefaultObjFace(int[] vertexIndices,
                      int[] texCoordIndices,
                      int[] normalIndices,
                      ObjGroup group,
                      ObjGroup materialGroup)
Creates a Face from the given parameters

Parameters:
vertexIndices - The vertex indices
texCoordIndices - The texture coordinate indices
normalIndices - The normal indices
group - The group
materialGroup - The material group
Method Detail

containsTexCoordIndices

public boolean containsTexCoordIndices()
Description copied from interface: ObjFace
Returns whether this face contains texture coordinate indices

Specified by:
containsTexCoordIndices in interface ObjFace
Returns:
Whether this face contains texture coordinate indices

containsNormalIndices

public boolean containsNormalIndices()
Description copied from interface: ObjFace
Returns whether this face contains normal indices

Specified by:
containsNormalIndices in interface ObjFace
Returns:
Whether this face contains normal indices

getVertexIndex

public int getVertexIndex(int number)
Description copied from interface: ObjFace
Returns the index of the vertex with the given number. The index that is returned will be ZERO-based, in contrast to the ONE-based storage in the OBJ file.

Specified by:
getVertexIndex in interface ObjFace
Parameters:
number - The number of the vertex
Returns:
The index of the vertex.

getTexCoordIndex

public int getTexCoordIndex(int number)
Description copied from interface: ObjFace
Returns the index of the texture coordinate with the given number. The index that is returned will be ZERO-based, in contrast to the ONE-based storage in the OBJ file.

Specified by:
getTexCoordIndex in interface ObjFace
Parameters:
number - The number of the texture coordinate
Returns:
The index of the texture coordinate.

getNormalIndex

public int getNormalIndex(int number)
Description copied from interface: ObjFace
Returns the index of the normal with the given number. The index that is returned will be ZERO-based, in contrast to the ONE-based storage in the OBJ file.

Specified by:
getNormalIndex in interface ObjFace
Parameters:
number - The number of the normal
Returns:
The index of the normal.

getNumVertices

public int getNumVertices()
Description copied from interface: ObjFace
Returns the number of vertices this face consists of.

Specified by:
getNumVertices in interface ObjFace
Returns:
The number of vertices this face consists of.

getGroup

public ObjGroup getGroup()
Description copied from interface: ObjFace
Returns the group that this face belongs to

Specified by:
getGroup in interface ObjFace
Returns:
The group that this face belongs to

getMaterialGroup

public ObjGroup getMaterialGroup()
Description copied from interface: ObjFace
Returns the material group that this face belongs to

Specified by:
getMaterialGroup in interface ObjFace
Returns:
The material group that this face belongs to

toString

public String toString()
Overrides:
toString in class Object