com.sun.j3d.loaders.lw3d
Class LwoSurface

java.lang.Object
  extended by com.sun.j3d.loaders.lw3d.ParserObject
      extended by com.sun.j3d.loaders.lw3d.LwoSurface

 class LwoSurface
extends ParserObject

This class is responsible for retrieving the surface parameters for a particular surface from a binary Object file and turning that data into Java3D data. These surface parameters include diffuse/specular/emissive properties, color, shininess, transparency, and textures. For textures, this class instantiates a LwoTexture object to parse that data and turn it into Java3D texture data.


Field Summary
(package private)  int blue
           
(package private)  Color3f color
           
(package private)  float creaseAngle
           
(package private)  float diffuse
           
(package private)  Color3f diffuseColor
           
(package private)  Color3f emissiveColor
           
(package private)  int gloss
           
(package private)  int green
           
(package private)  float luminosity
           
(package private)  int red
           
(package private)  float shininess
           
(package private)  float specular
           
(package private)  Color3f specularColor
           
(package private)  java.lang.String surfName
           
(package private)  int textureAxis
           
(package private)  Vector3f textureCenter
           
(package private)  java.util.Vector textureList
           
(package private)  Vector3f textureSize
           
(package private)  java.awt.Image theImage
           
(package private)  LWOBFileReader theReader
           
(package private)  float transparency
           
 
Fields inherited from class com.sun.j3d.loaders.lw3d.ParserObject
debugPrinter, EXCEPTION, LINE_TRACE, MISC, NONE, TIME, TRACE, VALUES, WARNING
 
Constructor Summary
LwoSurface(LWOBFileReader reader, int length, int debugVals)
          Constructor that parses surface data from the binary file and creates the necessary Java3d objects
 
Method Summary
(package private)  Color3f getColor()
           
(package private)  float getCreaseAngle()
           
(package private)  Color3f getDiffuseColor()
           
(package private)  Color3f getEmissiveColor()
           
(package private)  float getShininess()
           
(package private)  Color3f getSpecularColor()
           
(package private)  void getSurf(int length)
          Parses the binary file and gets all data for this surface
(package private)  java.lang.String getSurfName()
           
(package private)  LwoTexture getTexture()
          Returns the LwoTexture for the surface, if any is defined.
(package private)  float getTransparency()
           
(package private)  void setJ3dColors()
          Creates Java3d color objects from the lw3d surface data
 
Methods inherited from class com.sun.j3d.loaders.lw3d.ParserObject
debugOutput, debugOutputLn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theReader

LWOBFileReader theReader

red

int red

green

int green

blue

int blue

diffuse

float diffuse

specular

float specular

transparency

float transparency

luminosity

float luminosity

creaseAngle

float creaseAngle

gloss

int gloss

color

Color3f color

diffuseColor

Color3f diffuseColor

specularColor

Color3f specularColor

emissiveColor

Color3f emissiveColor

shininess

float shininess

theImage

java.awt.Image theImage

textureCenter

Vector3f textureCenter

textureSize

Vector3f textureSize

textureAxis

int textureAxis

surfName

java.lang.String surfName

textureList

java.util.Vector textureList
Constructor Detail

LwoSurface

LwoSurface(LWOBFileReader reader,
           int length,
           int debugVals)
     throws java.io.FileNotFoundException
Constructor that parses surface data from the binary file and creates the necessary Java3d objects

Throws:
java.io.FileNotFoundException
Method Detail

setJ3dColors

void setJ3dColors()
Creates Java3d color objects from the lw3d surface data


getColor

Color3f getColor()

getDiffuseColor

Color3f getDiffuseColor()

getSpecularColor

Color3f getSpecularColor()

getEmissiveColor

Color3f getEmissiveColor()

getShininess

float getShininess()

getCreaseAngle

float getCreaseAngle()

getTexture

LwoTexture getTexture()
Returns the LwoTexture for the surface, if any is defined. Note that lw3d allows users to define multiple textures for any surface, which is not possible through Java3d. Therefore, we just grab the first texture in any list of textures for a surface


getSurfName

java.lang.String getSurfName()

getTransparency

float getTransparency()

getSurf

void getSurf(int length)
       throws java.io.FileNotFoundException,
              IncorrectFormatException,
              ParsingErrorException
Parses the binary file and gets all data for this surface

Throws:
java.io.FileNotFoundException
IncorrectFormatException
ParsingErrorException


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.