unc.cdva.graphics.models
Class ObjData

java.lang.Object
  extended by unc.cdva.graphics.models.ObjData

public class ObjData
extends java.lang.Object

The data that has been read from the Wavefront .obj file. This is kept seperate from the actual rendering with the hope the data might be used for some other rendering engine in the future.

Author:
Kevin Glass, Guillaume Conte (Adapted the class to handle arbitrary types of polygons, and materials)

Constructor Summary
ObjData(java.io.InputStream inObject, java.io.InputStream inMaterial)
          Create a new set of OBJ data by reading it in from the specified input stream.
 
Method Summary
 Face getFace(int index)
          Get the data for specific face
 int getFaceCount()
          Get the number of faces found in the model file
 Material getMaterial(int materialId)
          Get the material for material id
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjData

public ObjData(java.io.InputStream inObject,
               java.io.InputStream inMaterial)
        throws java.io.IOException
Create a new set of OBJ data by reading it in from the specified input stream.

Parameters:
inObject - The input stream from which to read the OBJ data
inMaterial - The input stream from which to read the material data
Throws:
java.io.IOException - Indicates a failure to read from the stream
Method Detail

getFaceCount

public int getFaceCount()
Get the number of faces found in the model file

Returns:
The number of faces found in the model file

getFace

public Face getFace(int index)
Get the data for specific face

Parameters:
index - The index of the face whose data should be retrieved
Returns:
The face data requested

getMaterial

public Material getMaterial(int materialId)
Get the material for material id

Parameters:
materialId - The material index of the face whose data should be retrieved
Returns:
The face data requested