simbad.sim
Class Device

java.lang.Object
  extended bysimbad.sim.BaseObject
      extended bysimbad.sim.Device
Direct Known Subclasses:
ActuatorDevice, SensorDevice

public abstract class Device
extends simbad.sim.BaseObject

A abstract device, base class for sensorDevice and ActuatorDevice. The class manages an update rate which will be used by the simulator.


Method Summary
 void attach()
          Re-add object to the scenegraph.
 javax.swing.JPanel createInspectorPanel()
          Creates the panel associated to the device.
 void detach()
          Removes object from the scenegraph.
 boolean getCanBeTraversed()
          Gets the canBeTraversed Flag.
 java.lang.String getName()
           
 void getRotationTransform(javax.media.j3d.Transform3D t)
          Obtain rotation transform.
 void getTranslationTransform(javax.media.j3d.Transform3D t)
          Obtain translation transform.
 double getUpdatePerSecond()
          Returns the number of updates per second requested for this sensor.
 void rotateY(double angle)
          Rotates (relative to current rotation) the object about Y axis.
 void setCanBeTraversed(boolean canbetraversed)
          Sets the canBeTraversed Flag.
 void setColor(javax.vecmath.Color3f color)
          Change the color while the simulation is running.
 void setUpdateOnEachFrame(boolean on)
          Sets if update happens on each frame .
 void setUpdatePerSecond(double ups)
          Sets the number of update per seconds for this sensor.
 void translateTo(javax.vecmath.Vector3d t)
          Translates (relative to current pos) the object to given position.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Returns:
device's name .

createInspectorPanel

public javax.swing.JPanel createInspectorPanel()
Creates the panel associated to the device. This panel can be inserted in the inspector window for monitoring.

Returns:
the JPanel. null if no panel can be associated

setUpdatePerSecond

public void setUpdatePerSecond(double ups)
Sets the number of update per seconds for this sensor.


setUpdateOnEachFrame

public void setUpdateOnEachFrame(boolean on)
Sets if update happens on each frame .


getUpdatePerSecond

public double getUpdatePerSecond()
Returns the number of updates per second requested for this sensor.

Returns:
requested number of update per second (in virtual time).

translateTo

public void translateTo(javax.vecmath.Vector3d t)
Translates (relative to current pos) the object to given position.


rotateY

public void rotateY(double angle)
Rotates (relative to current rotation) the object about Y axis.


getTranslationTransform

public void getTranslationTransform(javax.media.j3d.Transform3D t)
Obtain translation transform.


getRotationTransform

public void getRotationTransform(javax.media.j3d.Transform3D t)
Obtain rotation transform.


detach

public void detach()
Removes object from the scenegraph.


attach

public void attach()
Re-add object to the scenegraph.


setCanBeTraversed

public void setCanBeTraversed(boolean canbetraversed)
Sets the canBeTraversed Flag.


getCanBeTraversed

public boolean getCanBeTraversed()
Gets the canBeTraversed Flag.


setColor

public void setColor(javax.vecmath.Color3f color)
Change the color while the simulation is running.