de.fhg.igd.earth.model.graph
Class Box

java.lang.Object
  extended byde.fhg.igd.earth.model.graph.ProjectorObject
      extended byde.fhg.igd.earth.model.graph.ModelGraphObject
          extended byde.fhg.igd.earth.model.graph.Node
              extended byde.fhg.igd.earth.model.graph.Leaf
                  extended byde.fhg.igd.earth.model.graph.Shape
                      extended byde.fhg.igd.earth.model.graph.Primitive
                          extended byde.fhg.igd.earth.model.graph.Box
All Implemented Interfaces:
Cloneable, Serializable

public class Box
extends Primitive
implements Serializable, Cloneable

This class represents a box (graphic object, leaf). A box is defined by xdim, ydim and zdim. Title : Earth Copyright : Copyright (c) 2001 Organisation : IGD FhG

Version:
: 1.0
Author:
: Werner Beutel
See Also:
Serialized Form

Field Summary
private  float xdim_
          width
private  float ydim_
          height
private  float zdim_
          depth
 
Fields inherited from class de.fhg.igd.earth.model.graph.Shape
CULL_BACKFACE, CULL_FRONTFACE, CULL_NONE, STYLE_SOLID, STYLE_TEXTURE, STYLE_WIRE_FRAME
 
Fields inherited from class de.fhg.igd.earth.model.graph.Leaf
 
Fields inherited from class de.fhg.igd.earth.model.graph.Node
boundless_, collidable_, icon_, parent_, pickable_
 
Fields inherited from class de.fhg.igd.earth.model.graph.ModelGraphObject
CHANGE_AddChild, CHANGE_Anything, CHANGE_Appearance, CHANGE_Color, CHANGE_Create, CHANGE_Delete, CHANGE_Focus, CHANGE_HistoryGroup, CHANGE_InfoTable, CHANGE_Object, CHANGE_RemoveChild, CHANGE_Shape, CHANGE_Trace, CHANGE_Update, CHANGE_Visibility, changes_, infoTable_, mutable_, name_, subChanges_, SUBTYPE_BackGround, SUBTYPE_Box, SUBTYPE_BranchGroup, SUBTYPE_Cone, SUBTYPE_Cylinder, SUBTYPE_DetailGroup, SUBTYPE_DistanceDetailGroup, SUBTYPE_Group, SUBTYPE_HistoryGroup, SUBTYPE_LatchGroup, SUBTYPE_ModelGraph, SUBTYPE_Polygon, SUBTYPE_Primitive, SUBTYPE_Sphere, SUBTYPE_Text, SUBTYPE_TransformGroup, SUBTYPE_WireBoxGroup, timeStamp_, trace_, traceable_, TYPE_Group, TYPE_Leaf
 
Fields inherited from class de.fhg.igd.earth.model.graph.ProjectorObject
projectorObject_
 
Constructor Summary
Box()
          Creates a default box.
Box(float dim)
          Creates a box with xdim=ydim=zdim = dim.
Box(float xdim, float ydim, float zdim)
          Creates a box with the given dimensions.
 
Method Summary
protected  void calcBoundingBox(cBoundingBox boundingBox)
          Calculates the bounding box of this box.
 Object clone()
          Clones this box
 int getSubType()
          Returns SUBTYPE_BOX
 int getType()
          Returns TYPE_LEAF
 float getXdim()
          Returns the x-Dimension.
 float getYdim()
          Returns the y-Dimension.
 float getZdim()
          Returns the z-Dimension.
 boolean setDimensions(float xdim, float ydim, float zdim)
          Sets new dimensions (blocked by mutable).
 
Methods inherited from class de.fhg.igd.earth.model.graph.Shape
getColor, getCullingMode, getHighLight, getHighLightColor, getImage, getStyle, getTransparency, setColor, setCullingMode, setHighLight, setHighLightColor, setImage, setStyle, setTransparency
 
Methods inherited from class de.fhg.igd.earth.model.graph.Leaf
createLeafList, createSubGroupList, createSubNodeList, detach, getVisible, searchDown, searchDown, searchDown, searchDown, searchDownInserter, searchDownInserter, setMutable, setVisible
 
Methods inherited from class de.fhg.igd.earth.model.graph.Node
broadcastCreation, broadcastResetChanges, createParentGroupList, delete, delete, getBoundingBox, getBoundless, getBranchGroup, getCollidable, getGroup, getIcon, getLeafList, getModelGraph, getParent, getParentGroupList, getPickable, getSubGroupList, getSubNodeList, isFocused, move, move, moveTo, publishChanges, resetProjectorObject, searchUp, searchUp, searchUp, searchUp, setBoundless, setCollidable, setIcon, setParent, setPickable
 
Methods inherited from class de.fhg.igd.earth.model.graph.ModelGraphObject
anyChanges, anySubChanges, getChanges, getChanges, getInfoTable, getInfoTableElements, getInfoTableKeys, getInfoTableSize, getInfoTableValues, getMutable, getName, getSubChanges, getSubChanges, getSubTypeName, getTimeStamp, getTrace, getTraceable, putInfo, resetChanges, setChanges, setInfoTable, setName, setSubChanges, setTrace, VectorClone
 
Methods inherited from class de.fhg.igd.earth.model.graph.ProjectorObject
getProjectorObject, setProjectorObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xdim_

private float xdim_
width


ydim_

private float ydim_
height


zdim_

private float zdim_
depth

Constructor Detail

Box

public Box()
Creates a default box. xdim=ydim=zdim=1.


Box

public Box(float dim)
Creates a box with xdim=ydim=zdim = dim.

Parameters:
dim - Dimension

Box

public Box(float xdim,
           float ydim,
           float zdim)
Creates a box with the given dimensions.

Parameters:
xdim - x-Dimension
ydim - y-Dimension
zdim - z-Dimension
Method Detail

calcBoundingBox

protected void calcBoundingBox(cBoundingBox boundingBox)
Calculates the bounding box of this box. This method is used by getBoundingBox().

Specified by:
calcBoundingBox in class Node
Parameters:
boundingBox - which will be combined with

getType

public int getType()
Returns TYPE_LEAF

Specified by:
getType in class ModelGraphObject
Returns:
TYPE_LEAF

getSubType

public int getSubType()
Returns SUBTYPE_BOX

Specified by:
getSubType in class ModelGraphObject
Returns:
SUBTYPE_BOX

setDimensions

public boolean setDimensions(float xdim,
                             float ydim,
                             float zdim)
Sets new dimensions (blocked by mutable). Released changes: CHANGE_UPDATE, CHANGE_SHAPE

Parameters:
xdim - x-Dimension
ydim - y-Dimension
zdim - z-Dimension
Returns:
true on success.

getXdim

public float getXdim()
Returns the x-Dimension.

Returns:
x-Dimension

getYdim

public float getYdim()
Returns the y-Dimension.

Returns:
y-Dimension

getZdim

public float getZdim()
Returns the z-Dimension.

Returns:
z-Dimension

clone

public Object clone()
Clones this box

Overrides:
clone in class Primitive


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.