Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.loader
Interface AVLoader

All Known Implementing Classes:
BTLoader, DEMLoader, MaxLoader, STLLoader

public interface AVLoader

The definition of a class that is capable of parsing a file format and turning it into an Aviatrix3D scene graph.

Loaders provide a common interface regardless of the type of file format that is being loaded. The flags allow you to control exactly what should be created from a loading process. For example, many applications only want the static geometry to be loaded, while ignoring any animation data provided. Many of the more complex model formats, such as those that come from modelling tools like 3DS Max or Maya include a wealth of useful renderable structure, and also a lot of useless stuff, such as parameters for the editor configuration or raytracing parameters. These are ignored by the loader interface as it focuses on working with realtime model data only.

Behavioural Requirements The default behaviour of a loader implementation, should the user not set any flags shall be as follows:

Version:
$Revision: 1.2 $
Author:
Justin Couch

Field Summary
static int BACKGROUNDS
          Load the background(s) defined in the file
static int FOGS
          Load the fogs defined in the file
static int GEOMETRY
          Load the geometry and structural portions of the file
static int LAYERS
          Load the layers defined in the file
static int LIGHTS
          Load the lights defined in the file
static int LOAD_ALL
          Load everything in the file
static int RUNTIMES
          Load code that will handling any runtime capabilities (such as animation) defined in the file.
static int VIEWPOINTS
          Load the viewpoints defined in the file
 
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.
 

Field Detail

GEOMETRY

static final int GEOMETRY
Load the geometry and structural portions of the file

See Also:
Constant Field Values

BACKGROUNDS

static final int BACKGROUNDS
Load the background(s) defined in the file

See Also:
Constant Field Values

VIEWPOINTS

static final int VIEWPOINTS
Load the viewpoints defined in the file

See Also:
Constant Field Values

RUNTIMES

static final int RUNTIMES
Load code that will handling any runtime capabilities (such as animation) defined in the file.

See Also:
Constant Field Values

FOGS

static final int FOGS
Load the fogs defined in the file

See Also:
Constant Field Values

LIGHTS

static final int LIGHTS
Load the lights defined in the file

See Also:
Constant Field Values

LAYERS

static final int LAYERS
Load the layers defined in the file

See Also:
Constant Field Values

LOAD_ALL

static final int LOAD_ALL
Load everything in the file

See Also:
Constant Field Values
Method Detail

load

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

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

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.

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

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

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

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.

Parameters:
flags - The collection of flags to use

getLoadFlags

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

Returns:
A bitmask of flags that are currently set

keepInternalModel

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.

Parameters:
enable - true to enable keeping the raw model, false otherwise

isInternalModelKept

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

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