Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.loader.stl
Class STLLoader

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

public class STLLoader
extends java.lang.Object
implements AVLoader

Loader for the STL (Stereolithography) file into Aviatrix3D.

In case that the file uses the binary STL format, no check can be done to assure that the file is in STL format. A wrong format will only be recognized if an invalid amount of data is contained in the file.

STL models do not contain layers or any other form of scene graph objects beyond the triangle geometry. All load flags are ignored.

Version:
$Revision: 1.3 $
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
STLLoader()
          Creates a STLLoader object.
 
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

STLLoader

public STLLoader()
Creates a STLLoader object.

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