org.deegree.rendering.r3d.model
Class WorldObject<G extends QualityModelPart,QM extends QualityModel<G>>

java.lang.Object
  extended by org.deegree.rendering.r3d.model.WorldObject<G,QM>
Type Parameters:
G - the geometry type of the quality model
QM - the quality model type
All Implemented Interfaces:
Serializable, PositionableModel, MemoryAware
Direct Known Subclasses:
WorldGeometryObject, WorldRenderableObject

public class WorldObject<G extends QualityModelPart,QM extends QualityModel<G>>
extends Object
implements Serializable, MemoryAware, PositionableModel

The WorldRenderableObject top level class, all data objects can be stored in a dbase.

Version:
$Revision: 29127 $, $Date: 2011-01-10 16:13:35 +0100 (Mon, 10 Jan 2011) $
Author:
Rutger Bezema, last edited by: $Author: aschmitz $
See Also:
Serialized Form

Field Summary
protected  float[] position
          the position of this world object.
protected  QM[] qualityLevels
          The quality levels of the this object
 
Constructor Summary
WorldObject(String id, String time, Envelope bbox, QM[] qualityLevels)
           
WorldObject(String id, String time, Envelope bbox, QM[] qualityLevels, String name, String type, String externalReference)
           
 
Method Summary
 Envelope getBbox()
           
 float getErrorScalar()
           
 String getExternalReference()
           
 float getGroundLevel()
           
 String getId()
           
 float[] getModelBBox()
           
 String getName()
           
 int getNumberOfQualityLevels()
           
 float getObjectHeight()
           
 float[] getPosition()
           
 QM getQualityLevel(int index)
           
 QM[] getQualityLevels()
           
 String getTime()
           
 String getType()
           
protected  void resetQualityLevels(QM[] newLevels)
           
 void setBbox(Envelope bbox)
           
 void setExternalReference(String externalReference)
           
 void setId(String id)
           
 void setName(String name)
           
 void setQualityLevel(int index, QM model)
          Set the model at the given quality level.
 void setTime(String time)
           
 void setType(String type)
           
 long sizeOf()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

position

protected transient float[] position
the position of this world object.


qualityLevels

protected transient QM extends QualityModel<G>[] qualityLevels
The quality levels of the this object

Constructor Detail

WorldObject

public WorldObject(String id,
                   String time,
                   Envelope bbox,
                   QM[] qualityLevels)
Parameters:
id - of this object
time - this object was created in the dbase
bbox - of this object (may not be null)
qualityLevels - this data object may render.

WorldObject

public WorldObject(String id,
                   String time,
                   Envelope bbox,
                   QM[] qualityLevels,
                   String name,
                   String type,
                   String externalReference)
Parameters:
id - of this object
time - this object was created in the dbase
bbox - of this object (may not be null)
qualityLevels - this data object may render.
name - of this object
type - of this object
externalReference - of this object
Method Detail

getQualityLevel

public QM getQualityLevel(int index)
Parameters:
index - to get the level for
Returns:
the quality model at the given index.

getQualityLevels

public QM[] getQualityLevels()
Returns:
the quality models array

getNumberOfQualityLevels

public int getNumberOfQualityLevels()
Returns:
the number of quality levels this worldobject can hold.

setQualityLevel

public void setQualityLevel(int index,
                            QM model)
Set the model at the given quality level. If the index is out of bounds nothing will happen, if the model is null the array at given location will be null (deleted).

Parameters:
index - to place the model at
model - to place

resetQualityLevels

protected void resetQualityLevels(QM[] newLevels)
Parameters:
newLevels - an instantiated array of QualityModels (which may be null), if the given array is null nothing will happen.

getId

public final String getId()
Returns:
the id

setId

public final void setId(String id)
Parameters:
id - the id to set

getTime

public final String getTime()
Returns:
the time

setTime

public final void setTime(String time)
Parameters:
time - the time to set

getBbox

public final Envelope getBbox()
Returns:
the bbox

setBbox

public final void setBbox(Envelope bbox)
Parameters:
bbox - the bbox to set

sizeOf

public long sizeOf()
Specified by:
sizeOf in interface MemoryAware
Returns:
the approximate size in bytes of this world object. This value is not perfectly correct (references in the rendering.r3 package are called) but it will give an estimate of the amount of memory a worldobject uses.

getPosition

public float[] getPosition()
Specified by:
getPosition in interface PositionableModel
Returns:
the position of the implementing class.

getErrorScalar

public float getErrorScalar()
Specified by:
getErrorScalar in interface PositionableModel
Returns:
a scalar which is represents the 'error' of this positionable.

getGroundLevel

public float getGroundLevel()
Specified by:
getGroundLevel in interface PositionableModel
Returns:
a scalar which represents the 'groundlevel' of this positionable.

getObjectHeight

public float getObjectHeight()
Specified by:
getObjectHeight in interface PositionableModel
Returns:
a scalar which represents the 'height' of this positionable.

getType

public String getType()
Returns:
the type of this object, e.g. building or tv.

getName

public String getName()
Returns:
the name of this object,

getExternalReference

public final String getExternalReference()
Returns:
the externalReference

setType

public final void setType(String type)
Parameters:
type - the type to set

setName

public final void setName(String name)
Parameters:
name - the name to set

setExternalReference

public final void setExternalReference(String externalReference)
Parameters:
externalReference - the externalReference to set

getModelBBox

public float[] getModelBBox()
Specified by:
getModelBBox in interface PositionableModel
Returns:
the boundingbox of the model with float[0][0-3] the min, float[1][0-3] the max.


Copyright © 2011. All Rights Reserved.