ants.move.core.views.hook
Class HookView

java.lang.Object
  |
  +--ants.move.core.views.DynamicObject
        |
        +--ants.move.core.views.hook.HookView
All Implemented Interfaces:
HookListener, ViewInterface, VRMLEventListener

public class HookView
extends DynamicObject
implements ViewInterface, HookListener

Implementation of DynamicObject Hook.

Version:
1.10 Build 2000
Author:
Carles Pairot (cpairot@tinet.org), Oriol Montalà (omontala@tinet.org)

Constructor Summary
HookView()
          Sole & void constructor.
 
Method Summary
 void eventPerformed()
          Executed when a VRML Event is received.
 void hook(java.lang.String pos, java.lang.String ori)
          Hook
 void hookOrientationChanged(java.lang.String value)
          Change hook orientation
 void hookPositionChanged(java.lang.String value)
          Change hook position
 void init(java.util.Hashtable ht)
          Initializes necessary parameters to use this class.
 float to1d(float n)
          Trims a float to an only decimal digit.
 void unHook()
          Unhook
 
Methods inherited from class ants.move.core.views.DynamicObject
addListener, catchNode, getBrowser, getName, getNode, getVRMLNodeName, getZone, getZoneName, printMsg, setaddChValue, setaddChValue, setBrowser, setChNodes, setName, setreChValue, setreChValue, setVRMLNodeName, setZoneName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HookView

public HookView()
Sole & void constructor. Used when newInstance() method is called.
Parameters:
params - None
Throws:
exceptions - No exceptions thrown
Method Detail

init

public void init(java.util.Hashtable ht)
Initializes necessary parameters to use this class.
This is the way to implement a dynamicObject through DObjectInterface interface.
Specified by:
init in interface ViewInterface
Parameters:
z - Zone name
b - Reference to VRML browser
n - VRML Node name
d - Object name
s - Elvin4 session
r - Used to dynamically add VRML objects to the scene
Returns:
No return value
Throws:
exceptions - No exceptions thrown

to1d

public float to1d(float n)
Trims a float to an only decimal digit.
Parameters:
n - Number to trim
Returns:
Number trimmed
Throws:
exceptions - No exceptions thrown

eventPerformed

public void eventPerformed()
Executed when a VRML Event is received.
Updates hook's position.
Overrides:
eventPerformed in class DynamicObject
Parameters:
params - None
Returns:
No return value
Throws:
exceptions - No exceptions thrown

hook

public void hook(java.lang.String pos,
                 java.lang.String ori)
Description copied from interface: HookListener
Hook
Specified by:
hook in interface HookListener
Following copied from interface: ants.move.core.models.hook.HookListener
Parameters:
pos - position "x y z"
ori - rotation "x y z o"

unHook

public void unHook()
Description copied from interface: HookListener
Unhook
Specified by:
unHook in interface HookListener

hookPositionChanged

public void hookPositionChanged(java.lang.String value)
Description copied from interface: HookListener
Change hook position
Specified by:
hookPositionChanged in interface HookListener
Following copied from interface: ants.move.core.models.hook.HookListener
Parameters:
value - position "x y z"

hookOrientationChanged

public void hookOrientationChanged(java.lang.String value)
Description copied from interface: HookListener
Change hook orientation
Specified by:
hookOrientationChanged in interface HookListener
Following copied from interface: ants.move.core.models.hook.HookListener
Parameters:
value - rotation "x y z o"


Developers: Oriol Montala, Carles Pairot, Francesc Pinas2000 - 2002
Departament d'Enginyeria Informatica i Matematiques
Escola Tecnica Superior d'Enginyeria
Universitat Rovira i Virgili