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

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

public class Sphere
extends Primitive
implements Serializable, Cloneable

This class represents a sphere (graphic object, leaf). A sphere is defined by it's radius. The divisions define the smoothness. Title : Earth Copyright : Copyright (c) 2001 Organisation : IGD FhG

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

Field Summary
private  int divisions_
          divisions
private  float radius_
          radius
 
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
Sphere()
          Creates and initializes a default sphere.
Sphere(float rad, int div)
          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 sphere
 int getDivisions()
          Returns the division
 float getRadius()
          Returns the radius
 int getSubType()
          Returns SUBTYPE_SPHERE
 int getType()
          Returns TYPE_LEAF
 boolean setDivisions(int div)
          Sets a new division (blocked by mutable).
 boolean setRadius(float rad)
          Sets a new radius (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


divisions_

private int divisions_
divisions

Constructor Detail

Sphere

public Sphere()
Creates and initializes a default sphere. radius=1, xdivision=10.


Sphere

public Sphere(float rad,
              int div)
Creates and initializes a cylinder with the given values.

Parameters:
rad - Radius
div - Division
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_SPHERE

Specified by:
getSubType in class ModelGraphObject
Returns:
SUBTYPE_SPHERE

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

setDivisions

public boolean setDivisions(int div)
Sets a new division (blocked by mutable). Released changes: CHANGE_UPDATE, CHANGE_SHAPE

Parameters:
div - division
Returns:
true on success.

getDivisions

public int getDivisions()
Returns the division

Returns:
Division

clone

public Object clone()
Clones this sphere

Overrides:
clone in class Primitive


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.