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

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.Cylinder
All Implemented Interfaces:
Cloneable, Serializable

public class Cylinder
extends Primitive
implements Serializable, Cloneable

This class represents a cylinder (graphic object, leaf). A cylinder is defined by it's radius and it's height. Also you can define divisions. As higher the division value as smoother the cylinder will be created. Title : Earth Copyright : Copyright (c) 2001 Organisation : IGD FhG

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

Field Summary
private  float height_
          height
private  float radius_
          radius
private  int xdivision_
          x-division
private  int ydivision_
          y-division
 
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
Cylinder()
          Creates and initializes a default cylinder.
Cylinder(float rad, float h, int xdiv, int ydiv)
          Creates and initializes a cylinder with the given values.
 
Method Summary
protected  void calcBoundingBox(cBoundingBox boundingBox)
          Calculates the bounding box of this cylinder.
 Object clone()
          Clones this cylinder
 float getHeight()
          Returns the height
 float getRadius()
          Returns the radius
 int getSubType()
          Returns SUBTYPE_CYLINDER
 int getType()
          Returns TYPE_LEAF
 int getXdiv()
          Returns the xdivision
 int getYdiv()
          Returns the ydivision
 boolean setHeight(float h)
          Sets a new height (blocked by mutable).
 boolean setRadius(float rad)
          Sets a new radius (blocked by mutable).
 boolean setXdivision(int xdiv)
          Sets a new xdivision (blocked by mutable).
 boolean setYdiv(int ydiv)
          Sets a new ydivision (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

radius_

private float radius_
radius


height_

private float height_
height


xdivision_

private int xdivision_
x-division


ydivision_

private int ydivision_
y-division

Constructor Detail

Cylinder

public Cylinder()
Creates and initializes a default cylinder. radius=1, height=1, xdivision=10, ydivision=10.


Cylinder

public Cylinder(float rad,
                float h,
                int xdiv,
                int ydiv)
Creates and initializes a cylinder with the given values.

Parameters:
rad - Radius
h - Height
xdiv - xdivision
ydiv - ydivision
Method Detail

calcBoundingBox

protected void calcBoundingBox(cBoundingBox boundingBox)
Calculates the bounding box of this cylinder. This method is used by Node.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_CYLINDER

Specified by:
getSubType in class ModelGraphObject
Returns:
SUBTYPE_CYLINDER

setRadius

public boolean setRadius(float rad)
Sets a new radius (blocked by mutable). Released changes: CHANGE_UPDATE, CHANGE_SHAPE

Parameters:
rad - Radius
Returns:
true on success.

getRadius

public float getRadius()
Returns the radius

Returns:
Radius

setHeight

public boolean setHeight(float h)
Sets a new height (blocked by mutable). Released changes: CHANGE_UPDATE, CHANGE_SHAPE

Parameters:
h - Height
Returns:
true on success.

getHeight

public float getHeight()
Returns the height

Returns:
Height

setXdivision

public boolean setXdivision(int xdiv)
Sets a new xdivision (blocked by mutable). Released changes: CHANGE_UPDATE, CHANGE_SHAPE

Parameters:
xdiv - xdivision
Returns:
true on success.

getXdiv

public int getXdiv()
Returns the xdivision

Returns:
xdivision

setYdiv

public boolean setYdiv(int ydiv)
Sets a new ydivision (blocked by mutable). Released changes: CHANGE_UPDATE, CHANGE_SHAPE

Parameters:
ydiv - ydivision
Returns:
true on success.

getYdiv

public int getYdiv()
Returns the ydivision

Returns:
ydivision

clone

public Object clone()
Clones this cylinder

Overrides:
clone in class Primitive


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.