org.jagatoo.loaders.models.ase
Class AseFile

java.lang.Object
  extended by org.jagatoo.loaders.models.ase.AseNode
      extended by org.jagatoo.loaders.models.ase.AseFile

public class AseFile
extends AseNode

Loader for the ase file format. Once the data is loaded, several methods can be used to build the Xith3D Scenegraph object. If the ase file represents a single object which is always treated as one (i.e. no moving parts within it) then the getModel method is the simplest way. Alternativly, to load each ase node as it's own Group with it's geometry relitive to it's pivot point (allowing for easy rotation) use the getNamedNodesMap and getTransformGroupTree methods. The former gives you a map containing just the named GEOM nodes, infact it just calls getTransformGroupTree passing a few flags to get this behaviour. The most useful and customisable method is getTransformGroupTree. All groups and geometry are loaded relitive to their pivot points, transformed into place and grouped into TransformGroupS. This is the most true representation of the file data as the pivots group concepts are preserved.

The Getting Started Guide has some tutorials to illustrate how to use the ASE loader, including a chapter on TransformGroup trees by the author of that method which diagramatically describes how that method works.


Field Summary
 java.util.Map<java.lang.String,AseNode> allTopLevelObjects
          Field used by the parser to store all Ase objects read in by the top-level parser.
 org.jagatoo.loaders.models.ase.AseGraph aseGraph
          Field used by the parser to store the ase graph
 java.lang.String comment
          Field used by the parser to store ASE information
 int materialCount
          Field used by the parser to store ASE information
 java.util.List<AseMaterial> materials
          Field used by the parser to store materials
 java.util.Map<java.lang.String,AseNode> objects
          Field used by the parser to store all Ase objects.
 float version
          Field used by the parser to store ASE information
 
Fields inherited from class org.jagatoo.loaders.models.ase.AseNode
debug, properties
 
Constructor Summary
AseFile()
           Creates an empty AseFile object to which data from the file will be read into.
 
Method Summary
 void parse(AseReader in)
          Overrides the default parse method because the top level of an ASE file has various nodes of different types, and its easier to handle them explicitly
static void updateHierarchyFromNodeParent(java.util.Map<java.lang.String,AseNode> objects, java.util.Map<java.lang.String,AseNode> allTopLevelObjects, AseGeom geom)
          Updates the hierarchy based on the NODE_PARENT field of the given AseGeom node.
 
Methods inherited from class org.jagatoo.loaders.models.ase.AseNode
parseProperty, trashBlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public float version
Field used by the parser to store ASE information


comment

public java.lang.String comment
Field used by the parser to store ASE information


aseGraph

public org.jagatoo.loaders.models.ase.AseGraph aseGraph
Field used by the parser to store the ase graph


objects

public java.util.Map<java.lang.String,AseNode> objects
Field used by the parser to store all Ase objects. This map maintains the scene graph structure; i.e., child nodes of the topmost ones are not present in this map, but instead in the maps contained in the subordinate AseGroups.


allTopLevelObjects

public java.util.Map<java.lang.String,AseNode> allTopLevelObjects
Field used by the parser to store all Ase objects read in by the top-level parser. Also contains temporary nodes constructed during parsing for the purpose of reconstructing the hierarchy based on the NODE_PARENT field.


materials

public java.util.List<AseMaterial> materials
Field used by the parser to store materials


materialCount

public int materialCount
Field used by the parser to store ASE information

Constructor Detail

AseFile

public AseFile()

Creates an empty AseFile object to which data from the file will be read into. To read the data, use the parse method passing an AseReader object.

Example: AseFile ase = new AseFile(); ase.parse(new BufferedReader(new FileReader("CUBE.ASE"));

Method Detail

updateHierarchyFromNodeParent

public static void updateHierarchyFromNodeParent(java.util.Map<java.lang.String,AseNode> objects,
                                                 java.util.Map<java.lang.String,AseNode> allTopLevelObjects,
                                                 AseGeom geom)
Updates the hierarchy based on the NODE_PARENT field of the given AseGeom node. The passed "objects" map contains the scene graph structure at the current depth in the scene. If the passed geometry node is reparented to another node, the geometry node is removed from the "objects" map. The "allTopLevelObjects" map, conversely, contains all objects that were ever parsed by the AseFile object; geometry nodes are never removed from this map, but AseGroup nodes that did not exist in the original file may be added to this map for the purpose of being able to find them quickly without searching through the scene graph.


parse

public void parse(AseReader in)
Overrides the default parse method because the top level of an ASE file has various nodes of different types, and its easier to handle them explicitly

Overrides:
parse in class AseNode