|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.vwp.j3d.loaders.Objects
public abstract class Objects
Base class for all 3D model loaders which are conform to the extended loader interface which includes downloads, local files, caching, defineable quality and so on. As an other difference to the Sun loaders the handed over BranchGroup afterwards contains a more exact BoundingBox instead of a simple BoundingSphere
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static int |
ALLOW_ATTRIBUTES_READ
Capabilities that are set in the created sub scenegraph: allow reading of attributes |
static int |
ALLOW_COLOR_WRITE
Capabilities that are set in the created sub scenegraph: allows writing of colors in Attributes |
static int |
ALLOW_MATERIAL_COMPONENT_WRITE
Capabilities that are set in the created sub scenegraph: allows writing of a Material component |
static int |
ALLOW_MATERIAL_READ
Capabilities that are set in the created sub scenegraph: allows reading of the Material Attribute |
static int |
ALLOW_POLYGONATTRIBUTES_MODE_WRITE
Capabilities that are set in the created sub scenegraph: allows writing of the PolygonAttributes mode |
static int |
ALLOW_TEXTURE_ACCESS
Capabilities that are set in the created sub scenegraph: allows reading and writing of Texture-related properties |
static int |
ALLOW_TRANSFORM_WRITE
Capabilities that are set in the created sub scenegraph: allows writing of the base TransformGroup |
static int |
FASTEST
constants which specify the quality settings |
static int |
MEDIUM
constants which specify the quality settings |
MessagePipe |
MyMsgPipe
|
static int |
NICEST
constants which specify the quality settings |
int |
Quality
|
int |
TextureQuality
|
Object |
UserData
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
Objects(int Quality,
double imgScaleFactor)
Constructs a new Objects loader class without an DownloadCacheManager and with the default texture searchpath "tex/" |
|
Objects(int Quality,
double imgScaleFactor,
DownloadCacheManager DownCache)
Constructs a new Objects loader class with an DownloadCacheManager and with the default texture searchpath "tex/" |
|
Objects(int Quality,
double imgScaleFactor,
DownloadCacheManager DownCache,
String RelativeTexturePath)
Constructs a new Objects loader class with an DownloadCacheManager and a texture searchpath |
|
Objects(int Quality,
double imgScaleFactor,
DownloadCacheManager DownCache,
String RelativeTexturePath,
Object UserData)
Constructs a new Objects loader class with an DownloadCacheManager and a texture searchpath |
|
Objects(int Quality,
double imgScaleFactor,
DownloadCacheManager DownCache,
String RelativeTexturePath,
String RelativeDataPath,
Object UserData)
Constructs a new Objects loader class with an DownloadCacheManager and a texture searchpath |
|
| Method Summary | |
|---|---|
javax.media.j3d.Appearance |
createAppearance(int CullingFlag)
Creates and preinitializes a new Appearance object. |
int |
getCapabilityFlags()
Returns the currently used capability flags |
byte[] |
getDataFile(String FileName)
Tries to load a data file using the disk cache or the download location |
String |
getFileName()
Returns the name of the object which is actually processed |
int |
getQuality()
Returns the actual model quality settings |
LinkedList |
getTransformList()
Returns a list of all transformations within a scene / object |
Object |
getUserData()
Returns data whic hhave been attached to this Objects object by using setUserData() |
byte[] |
loadDataFile(String FileName)
Tries to load a texture file using the TextureCache, the disk cache or the download location and sets this texture for the given Appearance object. |
boolean |
loadFile(MessagePipe MyMsgPipe,
URL FileURL,
XBranchGroup ModelBranch,
DataCache MyTextureCache,
DataCache MyModelCache,
javax.media.j3d.Group ModelBranchParent)
Invokes downloading of a remote file and interpretion of the loaded data. |
boolean |
loadFile(String FileName,
XBranchGroup ModelBranch,
DataCache MyTextureCache)
Invokes loading of a local file and interpretion of the loaded data |
boolean |
loadFile(URL FileURL,
XBranchGroup ModelBranch,
DataCache MyTextureCache)
Invokes downloading of a remote file and interpretion of the loaded data |
boolean |
loadFileInBackground(MessagePipe MyMsgPipe,
URL FileURL,
XBranchGroup ModelBranch,
DataCache MyTextureCache,
DataCache MyModelCache,
javax.media.j3d.Group ModelBranchParent)
Invokes downloading of a remote file and interpretion of the loaded data using a separate Thread. |
void |
run()
|
void |
setCapabilityFlags(int CapabilityFlags)
Allowes setting and resetting of the Object-Capability flags defined here using the ALLOW_xxx-constants. |
void |
setDownloadCacheManager(DownloadCacheManager DownCache)
Sets a new DownloadCacheManager used for -file-accesses via an URL |
void |
setMessagePipe(MessagePipe MsgPipe)
Sets a new MessagePipe |
void |
setQuality(int Quality,
double imgScaleFactor)
Changes the actual model quality settings |
void |
setRelativeTexturePath(String RelativeTexturePath)
Sets a new RelativeTexturePath which is used for textures defined in a file |
boolean |
setTexture(String FileName,
javax.media.j3d.Appearance UseApp,
int TexLoaderFlags)
Tries to load a texture file using the TextureCache, the disk cache or the download location and sets this texture for the given Appearance object. |
void |
setTextureQuality(int TextureQuality)
Changes the actual texture quality settings, this value influences the minification and maxification texture filter |
void |
setUserData(Object UserData)
Attaches user defineable data to the Objects object. |
void |
stopThread()
Replaces the stop() method to implement an abort condition. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int FASTEST
public static final int MEDIUM
public static final int NICEST
public static final int ALLOW_ATTRIBUTES_READ
public static final int ALLOW_POLYGONATTRIBUTES_MODE_WRITE
public static final int ALLOW_COLOR_WRITE
public static final int ALLOW_TRANSFORM_WRITE
public static final int ALLOW_MATERIAL_COMPONENT_WRITE
public static final int ALLOW_TEXTURE_ACCESS
public static final int ALLOW_MATERIAL_READ
public Object UserData
public MessagePipe MyMsgPipe
public int Quality
public int TextureQuality
| Constructor Detail |
|---|
public Objects(int Quality,
double imgScaleFactor)
Quality - quality setting for all subsequent objectsimgScaleFactor - specifies by which the textures have to be prescaled,
values > 0.0 and <= 1.0 are meaningful here to save graphics memory
on systems with less powerful hardware
public Objects(int Quality,
double imgScaleFactor,
DownloadCacheManager DownCache)
Quality - quality setting for all subsequent objectsimgScaleFactor - specifies by which the textures have to be prescaled,
values > 0.0 and <= 1.0 are meaningful here to save graphics memory
on systems with less powerful hardwareDownCache - specifies a caching manager object which handles
caching of 3D objects which are downloaded from network and not
directly from a local disk
public Objects(int Quality,
double imgScaleFactor,
DownloadCacheManager DownCache,
String RelativeTexturePath)
Quality - quality setting for all subsequent objectsimgScaleFactor - specifies by which the textures have to be prescaled,
values > 0.0 and <= 1.0 are meaningful here to save graphics memory
on systems with less powerful hardwareDownCache - specifies a caching manager object which handles
caching of 3D objects which are downloaded from network and not
directly from a local diskRelativeTexturePath - specifies where textures of downloaded 3D
objects can be found relative to the location of the object, default
is "tex/"
public Objects(int Quality,
double imgScaleFactor,
DownloadCacheManager DownCache,
String RelativeTexturePath,
Object UserData)
Quality - quality setting for all subsequent objectsimgScaleFactor - specifies by which the textures have to be prescaled,
values > 0.0 and <= 1.0 are meaningful here to save graphics memory
on systems with less powerful hardwareDownCache - specifies a caching manager object which handles
caching of 3D objects which are downloaded from network and not
directly from a local diskRelativeTexturePath - specifies where textures of downloaded 3D
objects can be found relative to the location of the object, default
is "tex/"UserData - special user data which are appended to the new object
public Objects(int Quality,
double imgScaleFactor,
DownloadCacheManager DownCache,
String RelativeTexturePath,
String RelativeDataPath,
Object UserData)
Quality - quality setting for all subsequent objectsimgScaleFactor - specifies by which the textures have to be prescaled,
values > 0.0 and <= 1.0 are meaningful here to save graphics memory
on systems with less powerful hardwareDownCache - specifies a caching manager object which handles
caching of 3D objects which are downloaded from network and not
directly from a local diskRelativeTexturePath - specifies where textures of downloaded 3D
objects can be found relative to the location of the object, default
is "tex/"RelativeDataPath - specifies where special data like animation information,
material libs etc. for the downloaded 3D objects can be found relative
to the location of the object, default is "dat/"UserData - special user data which are appended to the new object| Method Detail |
|---|
public void setCapabilityFlags(int CapabilityFlags)
CapabilityFlags - the flags that have to be set, use the
OR-concatenated ALLOW_xxx constants here to enable a capabilitypublic int getCapabilityFlags()
public void setUserData(Object UserData)
UserData - the data which have to be attached to this objectpublic Object getUserData()
public String getFileName()
public void setQuality(int Quality,
double imgScaleFactor)
Quality - specifies the quality of the object which has to be loaded
using the constants FASTEST, MEDIUM or NICESTimgScaleFactor - specifies by which the textures have to be prescaled,
values > 0.0 and <= 1.0 are meaningful here to save graphics memory
on systems with less powerful hardwarepublic int getQuality()
public void setTextureQuality(int TextureQuality)
TextureQuality - specifies the texture quality of the object which has to be
loaded using the constants FASTEST, MEDIUM or NICESTpublic void stopThread()
public void setDownloadCacheManager(DownloadCacheManager DownCache)
DownCache - specifies a caching manager object which handles
caching of 3D objects which are downloaded from network and not
directly from a local diskpublic void setMessagePipe(MessagePipe MsgPipe)
MsgPipe - the new MessagePipepublic void setRelativeTexturePath(String RelativeTexturePath)
RelativeTexturePath - specifies where textures of downloaded 3D
objects can be found relative to the location of the object, default
is "tex/"public javax.media.j3d.Appearance createAppearance(int CullingFlag)
CullingFlag - specifies which culling shall be performed; here
CULL_NONE, CULL_BACK or CULL_FRONT from PolygonAttributes has to be
set
public byte[] getDataFile(String FileName)
FileName - name/file name of the data file
public boolean setTexture(String FileName,
javax.media.j3d.Appearance UseApp,
int TexLoaderFlags)
FileName - name/file name of the textureUseApp - Appearance object which requires this texture
public byte[] loadDataFile(String FileName)
FileName - name/file name of the texture
public boolean loadFile(MessagePipe MyMsgPipe,
URL FileURL,
XBranchGroup ModelBranch,
DataCache MyTextureCache,
DataCache MyModelCache,
javax.media.j3d.Group ModelBranchParent)
MyMsgPipe - MessagePipe object to transfer error or other messages
from the thread to the main program; if this isn'd neccessary this
parameter can be set to 0FileURL - URL of the object to downloadModelBranch - the BranchGroup where to append the object, this
BranchGroup is used in run() and replaced by an other, internal
object until thenMyTextureCache - used to cache objects texturesMyModelCache - used in run() to insert this object into the cache
for later usageModelBranchParent - the parent Group object of the ModelBranch
object (typically an TransformGroup object), this already live /
compiled object is used to detach the temporarily ModelBranch
and to add the new created BranchGroup object which contains the
loaded object
public boolean loadFileInBackground(MessagePipe MyMsgPipe,
URL FileURL,
XBranchGroup ModelBranch,
DataCache MyTextureCache,
DataCache MyModelCache,
javax.media.j3d.Group ModelBranchParent)
MyMsgPipe - MessagePipe object to transfer error or other messages
from the thread to the main program; if this isn'd neccessary this
parameter can be set to 0FileURL - URL of the object to downloadModelBranch - the BranchGroup where to append the object, this
BranchGroup is used in run() and replaced by an other, internal
object until thenMyTextureCache - used to cache objects texturesMyModelCache - used in run() to insert this object into the cache
for later usageModelBranchParent - the parent Group object of the ModelBranch
object (typically an TransformGroup object), this already live /
compiled object is used to detach the temporarily ModelBranch
and to add the new created BranchGroup object which contains the
loaded objectpublic void run()
run in interface Runnablerun in class Thread
public boolean loadFile(URL FileURL,
XBranchGroup ModelBranch,
DataCache MyTextureCache)
FileURL - URL of the object to downloadModelBranch - the BranchGroup where to append the object, this
BranchGroup is used in run() and replaced by an other, internal
object until thenMyTextureCache - used to cache objects textures
public boolean loadFile(String FileName,
XBranchGroup ModelBranch,
DataCache MyTextureCache)
FileName - pathname of the object which has to be loaded from diskModelBranch - the BranchGroup where to append the object, this
BranchGroup is used in run() and replaced by an other, internal
object until thenMyTextureCache - used to cache objects texturespublic LinkedList getTransformList()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||