|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.ohiou.cs456_badabing.sceneapi.basic.ModelFile
public class ModelFile
Container for data loaded from OBJ and MTL files. It prepares it for use in ModelNode.
Description: Container for data loaded from OBJ and MTL files. It prepares it for use in ModelNode.
Copyright: Lev A Neiman 2008
Company: Ohio University EECS
| Field Summary | |
|---|---|
java.util.Vector<Coordinate> |
coordinates
vertices in this model. |
java.util.Hashtable<java.lang.String,Material> |
materials
different material properties in this model. |
java.util.Hashtable<java.lang.String,java.util.Vector<Triangle>> |
mtl_groups
Hashtable which associates a material name with a group of triangles. |
private java.lang.String |
name
unique name for this model. |
boolean |
no_mtl
|
static java.lang.String |
separator
system specific file path separator. |
java.util.Vector<Coordinate> |
texture_coordinates
array of texture coordinates. |
java.util.Vector<Triangle> |
triangles
triangles that make up this model. |
private double |
x_max
|
private double |
x_min
|
private double |
y_max
|
private double |
y_min
|
private double |
z_max
|
private double |
z_min
|
| Constructor Summary | |
|---|---|
ModelFile(java.lang.String name)
|
|
| Method Summary | |
|---|---|
static java.util.Vector<java.lang.String> |
expand(java.lang.String string,
char delimeter)
This method takes string and breaks it into a Vector of strings based on a given delimeter |
double |
getXMax()
greatest value of x in all coordinates. |
double |
getXMin()
least value of x in all coordiantes. |
double |
getYMax()
greatest value of y in all coordinates. |
double |
getYMin()
least value of y in all coordinates. |
double |
getZMax()
greatest value of z in all coordinates. |
double |
getZMin()
least value of z in all all coordinates. |
private void |
init()
function that loads the data files. |
private void |
readMTL(java.util.Scanner s)
this method loads materials from the MTL file. |
private void |
readOBJ(java.util.Scanner input)
method to read OBJ file. |
private void |
sortMaterials()
this method associates Material names to Vector's of triangles that belong to that material group. |
static java.lang.String |
stripExtension(java.lang.String a)
Removes extension from the string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String name
public static final java.lang.String separator
public java.util.Vector<Coordinate> coordinates
public java.util.Vector<Triangle> triangles
public java.util.Hashtable<java.lang.String,Material> materials
public java.util.Vector<Coordinate> texture_coordinates
public java.util.Hashtable<java.lang.String,java.util.Vector<Triangle>> mtl_groups
private double x_max
private double x_min
private double y_max
private double y_min
private double z_max
private double z_min
public boolean no_mtl
| Constructor Detail |
|---|
public ModelFile(java.lang.String name)
name - String name of the model to load| Method Detail |
|---|
public double getXMax()
public double getXMin()
public double getYMax()
public double getYMin()
public double getZMax()
public double getZMin()
public static java.util.Vector<java.lang.String> expand(java.lang.String string,
char delimeter)
string - Stringdelimiter - char
public static java.lang.String stripExtension(java.lang.String a)
a - String - input string.
private void init()
private void sortMaterials()
private void readMTL(java.util.Scanner s)
throws ModelFile_ReadError
s - Scanner
ModelFile_ReadError
private void readOBJ(java.util.Scanner input)
throws ModelFile_ReadError
input - Scanner
ModelFile_ReadError - if any excpetion is caught
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||