Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.loader.discreet
Class MaxLoader

java.lang.Object
  extended by org.j3d.renderer.aviatrix3d.loader.discreet.MaxLoader
All Implemented Interfaces:
AVLoader

public class MaxLoader
extends java.lang.Object
implements AVLoader

A loader implementation capable of loading .3ds files for all revisions.

This loader is designed for reusing multiple times to read multiple files. Several internal objects are reused wherever possible to aid in efficient state sorting by the pipeline.

Capabilities

Version:
$Revision: 1.7 $
Author:
Justin Couch

Field Summary
 
Fields inherited from interface org.j3d.renderer.aviatrix3d.loader.AVLoader
BACKGROUNDS, FOGS, GEOMETRY, LAYERS, LIGHTS, LOAD_ALL, RUNTIMES, VIEWPOINTS
 
Constructor Summary
MaxLoader()
          Create a new instance of the loader.
 
Method Summary
 int getLoadFlags()
          Get the current set collection of load flags.
 boolean isInternalModelKept()
          Check to see whether the loader should be currently keeping the internal model.
 void keepInternalModel(boolean enable)
          Define whether this loader should also keep around it's internal representation of the file format, if it has one.
 AVModel load(java.io.File file)
          Load a model from the given file.
 AVModel load(java.io.InputStream stream)
          Load a model from the given input stream.
 AVModel load(java.net.URL url)
          Load a model from the given URL.
 void setLoadFlags(int flags)
          Set the flags for which parts of the file that should be loaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaxLoader

public MaxLoader()
Create a new instance of the loader.

Method Detail

load

public AVModel load(java.net.URL url)
             throws java.io.IOException
Load a model from the given URL.

Specified by:
load in interface AVLoader
Parameters:
url - The url to load the model from
Returns:
A representation of the model at the URL
Throws:
java.io.IOException - something went wrong while reading the file

load

public AVModel load(java.io.InputStream stream)
             throws java.io.IOException
Load a model from the given input stream. If the file format would prefer to use a Reader interface, then use the InputStreamReader to convert this stream to the desired type. The caller will be responsible for closing down the stream at the end of this process.

Specified by:
load in interface AVLoader
Parameters:
stream - The stream to load the model from
Returns:
A representation of the model from the stream contents
Throws:
java.io.IOException - something went wrong while reading the file

load

public AVModel load(java.io.File file)
             throws java.io.IOException
Load a model from the given file.

Specified by:
load in interface AVLoader
Parameters:
file - The file instance to load the model from
Returns:
A representation of the model in the file
Throws:
java.io.IOException - something went wrong while reading the file

setLoadFlags

public void setLoadFlags(int flags)
Set the flags for which parts of the file that should be loaded. The flags are bit-fields, so can be bitwise OR'd together.

Specified by:
setLoadFlags in interface AVLoader
Parameters:
flags - The collection of flags to use

getLoadFlags

public int getLoadFlags()
Get the current set collection of load flags.

Specified by:
getLoadFlags in interface AVLoader
Returns:
A bitmask of flags that are currently set

keepInternalModel

public void keepInternalModel(boolean enable)
Define whether this loader should also keep around it's internal representation of the file format, if it has one. If kept, this can be retrieved through the AVModel.getRawModel() method and cast to the appropriate class type.

Specified by:
keepInternalModel in interface AVLoader
Parameters:
enable - true to enable keeping the raw model, false otherwise

isInternalModelKept

public boolean isInternalModelKept()
Check to see whether the loader should be currently keeping the internal model.

Specified by:
isInternalModelKept in interface AVLoader
Returns:
true when the internal model should be kept

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org