model
Class Model

java.lang.Object
  extended by model.Model

public class Model
extends java.lang.Object

The overarching class that stores the entire model in memory. Also used for submodels. Containes methods for accessing submodels and objects, and file and graphical I/O.


Field Summary
static int NUM_PRIORITY_GL_LISTS
           
 
Constructor Summary
Model()
           
Model(java.io.File path)
           
Model(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, com.sun.opengl.util.GLUT glut)
           
Model(Model parentModel, java.io.File path, javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, com.sun.opengl.util.GLUT glut)
           
Model(java.lang.String alias, javax.media.opengl.GL g)
          Constructs a new Model object that does not already have a file associated with it.
 
Method Summary
 void brightnessOn(boolean b)
           
 Model copy()
          Makes a deep copy of this model.
 void drawModel()
           
 void drawModel(boolean forceRender)
           
 void drawModel(boolean forceRender, int maxPriority)
           
 void drawModel(boolean forceRender, int minPriority, int maxPriority)
           
 java.lang.String getAlias()
          Added by Debbie Gets the alias belonging to this Model.
 java.util.ArrayList<ComplexObject> getComplexObjectList()
          Accesses complex objects.
 java.lang.String getFileName()
          Gets the filename of this Model.
 javax.media.opengl.GL getGL()
           
 javax.media.opengl.glu.GLU getGLU()
           
 com.sun.opengl.util.GLUT getGLUT()
           
 ComplexObject getObjByAlias(java.lang.String objAlias)
          Retrieves an object from this model's list by its alias
 IDList getObjectIDList()
           
 java.util.ArrayList<ComplexObject> getObjectList()
           
 ObjectType getObjectType()
           
 PriorityList getPriorityGLList()
           
 java.util.ArrayList<Model> getSubModelList()
          Added by Debbie.
 Transformation getTransformation()
           
 boolean hasSubModels()
          Added by Debbie Accesses hasSubModels boolean
 void markForRedraw()
          Marks this model for redraw.
 void readModel(Model parentModel, java.io.File file)
          Reads in a model.
 java.lang.String readSingleModelFile(Model parentModel, java.io.File file, java.util.ArrayList<ComplexObject> objList, IDList objIDList, Transformation trans, boolean isCO, ComplexObject co)
           
 void setAlias(java.lang.String alias)
          Added by Debbie.
 void setGL(javax.media.opengl.GL gl)
           
 void setGLU(javax.media.opengl.glu.GLU glu)
           
 void setGLUT(com.sun.opengl.util.GLUT glut)
           
 void setObjectIDList(IDList objectIDList)
           
 void setObjectList(java.util.ArrayList<ComplexObject> list)
           
 void setPriorityGLList(PriorityList priorityGLList)
           
 void setSubModelList(java.util.ArrayList<Model> sml)
          Sets this model's list of sub-models
 void setTransform(Transformation t)
           
 void setTransformation(Transformation t)
           
 void texturesOn(boolean b)
           
 void writeModel(java.lang.String path, boolean overwrite)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_PRIORITY_GL_LISTS

public static final int NUM_PRIORITY_GL_LISTS
See Also:
Constant Field Values
Constructor Detail

Model

public Model()

Model

public Model(java.io.File path)

Model

public Model(javax.media.opengl.GL gl,
             javax.media.opengl.glu.GLU glu,
             com.sun.opengl.util.GLUT glut)

Model

public Model(Model parentModel,
             java.io.File path,
             javax.media.opengl.GL gl,
             javax.media.opengl.glu.GLU glu,
             com.sun.opengl.util.GLUT glut)

Model

public Model(java.lang.String alias,
             javax.media.opengl.GL g)
Constructs a new Model object that does not already have a file associated with it.

Parameters:
alias - alias of new model (Example: "TopSecretHideout")
g - GL belonging to viewer currently in use (necessary for proper assembly of priority lists)
Method Detail

copy

public Model copy()
Makes a deep copy of this model.

Returns:
copy of the model

markForRedraw

public void markForRedraw()
Marks this model for redraw.


getFileName

public java.lang.String getFileName()
Gets the filename of this Model.

Returns:
name of model's file

getAlias

public java.lang.String getAlias()
Added by Debbie Gets the alias belonging to this Model.

Returns:
alias

setAlias

public void setAlias(java.lang.String alias)
Added by Debbie. Sets the alias for this Model.

Parameters:
alias -

getObjByAlias

public ComplexObject getObjByAlias(java.lang.String objAlias)
Retrieves an object from this model's list by its alias

Returns:
ComplexObject

getObjectIDList

public IDList getObjectIDList()

setObjectIDList

public void setObjectIDList(IDList objectIDList)

getObjectType

public ObjectType getObjectType()

getTransformation

public Transformation getTransformation()

setTransformation

public void setTransformation(Transformation t)

getGL

public javax.media.opengl.GL getGL()

setGL

public void setGL(javax.media.opengl.GL gl)

getGLU

public javax.media.opengl.glu.GLU getGLU()

setGLU

public void setGLU(javax.media.opengl.glu.GLU glu)

getGLUT

public com.sun.opengl.util.GLUT getGLUT()

setGLUT

public void setGLUT(com.sun.opengl.util.GLUT glut)

hasSubModels

public boolean hasSubModels()
Added by Debbie Accesses hasSubModels boolean

Returns:
True if has submodels, false otherwise

setSubModelList

public void setSubModelList(java.util.ArrayList<Model> sml)
Sets this model's list of sub-models


getSubModelList

public java.util.ArrayList<Model> getSubModelList()
Added by Debbie. Returns list of sub-models.

Returns:
sub models belonging to this model

getPriorityGLList

public PriorityList getPriorityGLList()

setPriorityGLList

public void setPriorityGLList(PriorityList priorityGLList)

getObjectList

public java.util.ArrayList<ComplexObject> getObjectList()

getComplexObjectList

public java.util.ArrayList<ComplexObject> getComplexObjectList()
Accesses complex objects.

Returns:
list of complex objects in this model

setObjectList

public void setObjectList(java.util.ArrayList<ComplexObject> list)

setTransform

public void setTransform(Transformation t)

drawModel

public void drawModel()

drawModel

public void drawModel(boolean forceRender)

drawModel

public void drawModel(boolean forceRender,
                      int maxPriority)

drawModel

public void drawModel(boolean forceRender,
                      int minPriority,
                      int maxPriority)

readModel

public void readModel(Model parentModel,
                      java.io.File file)
Reads in a model.

Parameters:
parentModel -
file -

readSingleModelFile

public java.lang.String readSingleModelFile(Model parentModel,
                                            java.io.File file,
                                            java.util.ArrayList<ComplexObject> objList,
                                            IDList objIDList,
                                            Transformation trans,
                                            boolean isCO,
                                            ComplexObject co)

writeModel

public void writeModel(java.lang.String path,
                       boolean overwrite)
Parameters:
path - - the path to the model directory/file
overwrite - - by default, files will not be overwritten

texturesOn

public void texturesOn(boolean b)

brightnessOn

public void brightnessOn(boolean b)