ants.move.core.models.hook
Class HookModel

java.lang.Object
  |
  +--ants.core.Thing
        |
        +--ants.move.core.models.hook.HookModel
All Implemented Interfaces:
ants.core.Model, ants.core.PropertyChangeListener, ants.comm.RemoteEventListener, java.io.Serializable

public class HookModel
extends ants.core.Thing
implements ants.core.PropertyChangeListener

Implementation of Hook Model.

Version:
1.30 Build 2000
Author:
Carles Pairot (cpairot@tinet.org), Oriol Montalà (omontala@tinet.org)
See Also:
Serialized Form

Constructor Summary
HookModel()
          Sole & void constructor.
 
Method Summary
 void addHookListener(HookListener hList)
          Add new Hook listener
 void destroy()
          Destroy method
 float getHCamOri(int index)
          Get Camera orientation given an index coordinate.
 float getHCamPos(int index)
          Get Camera position given an index coordinate.
 boolean getHookBoolean()
           
 boolean getHooked()
          Get state
 java.lang.String getType()
          Tool type
 void init()
          Initialize model
 void movement(float[] posNow, float[] oriNow)
          Set hook movemenr
 void propertyChange(ants.core.PropertyChangeEvent evt)
          Method triggered in response to a property change.
 void removeHookListener(HookListener hList)
          Remove Hook listener
 void setBind(boolean value)
          Remotely Bind / Unbind Camera's Viewpoint.
 void setHCamOri(float[] value)
          Set Camera orientation.
 void setHCamPos(float[] value)
          Set Camera position.
 float to1d(float n)
          Trims a float to an only decimal digit.
 
Methods inherited from class ants.core.Thing
addPropertyChangeListener, addTokenToProperty, eventArrived, getContext, getDescription, getIndexedProperty, getIndexedProperty, getIndexedPropertyNames, getIndexedPropertySize, getName, getPlace, getProperty, getPropertyNames, getThingGateway, getThingId, incrementProperty, init, removePropertyChangeListener, setProperty, triggerEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HookModel

public HookModel()
Sole & void constructor.
Method Detail

init

public void init()
Initialize model
Overrides:
init in class ants.core.Thing

addHookListener

public void addHookListener(HookListener hList)
Add new Hook listener
Parameters:
hList - Class that implements HookListener interface

removeHookListener

public void removeHookListener(HookListener hList)
Remove Hook listener
Parameters:
hList - Class that implements HookListener interface

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

setBind

public void setBind(boolean value)
Remotely Bind / Unbind Camera's Viewpoint.
Parameters:
value - True if camera has to be bound

movement

public void movement(float[] posNow,
                     float[] oriNow)
Set hook movemenr
Parameters:
posNow - Position
oriNow - camera orientation

propertyChange

public void propertyChange(ants.core.PropertyChangeEvent evt)
Description copied from interface: ants.core.PropertyChangeListener
Method triggered in response to a property change.
Specified by:
propertyChange in interface ants.core.PropertyChangeListener
Following copied from interface: ants.core.PropertyChangeListener
Returns:
ants.core.PropertyChangeEvent A PropertyChangeEvent with property change information.

getHCamPos

public float getHCamPos(int index)
Get Camera position given an index coordinate.
Parameters:
index - Coordinate
Returns:
Camera's position on that coordinate
Throws:
exceptions - No exceptions thrown

getHCamOri

public float getHCamOri(int index)
Get Camera orientation given an index coordinate.
Parameters:
index - Coordinate
Returns:
Camera's orientation on that coordinate
Throws:
exceptions - No exceptions thrown

setHCamPos

public void setHCamPos(float[] value)
Set Camera position.
Parameters:
value - Camera's new position

setHCamOri

public void setHCamOri(float[] value)
Set Camera orientation.
Parameters:
value - Camera's new orientation

getHookBoolean

public boolean getHookBoolean()

getHooked

public boolean getHooked()
Get state
Returns:
True=Hooked Halse=Free

getType

public java.lang.String getType()
Tool type
Overrides:
getType in class ants.core.Thing
Returns:
HOOK

destroy

public void destroy()
Destroy method
Overrides:
destroy in class ants.core.Thing


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