ants.move.core.models.camera
Class CameraModel

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

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

Implementation of DynamicObject Camera.

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

Constructor Summary
CameraModel()
          Void constructor
 
Method Summary
 void addCameraListener(CameraListener cList)
          Add new cameraListener
 void destroy()
          Destroy method
 java.lang.String getBound()
          Get Bound
 float getCamOri(int index)
          Get Camera orientation given an index coordinate.
 float getCamPos(int index)
          Get Camera position given an index coordinate.
 java.lang.String getType()
          Tool type
 void init()
          Initialize model
 void lockPosition()
          Lock camera position
 void propertyChange(ants.core.PropertyChangeEvent evt)
          Method triggered in response to a property change.
 void removeCameraListener(CameraListener cList)
          Remove Cameralistener
 void setBind(boolean value)
          Remotely Bind / Unbind Camera's Viewpoint.
 void setCamOri(float[] value)
          Set Camera orientation.
 void setCamPos(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

CameraModel

public CameraModel()
Void constructor
Method Detail

init

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

addCameraListener

public void addCameraListener(CameraListener cList)
Add new cameraListener
Parameters:
cList - Listener

removeCameraListener

public void removeCameraListener(CameraListener cList)
Remove Cameralistener
Parameters:
cList - listener

lockPosition

public void lockPosition()
Lock camera position

to1d

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

setBind

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

getBound

public java.lang.String getBound()
Get Bound
Returns:
Return if camera is bound "true" or "false"

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.

getCamPos

public float getCamPos(int index)
Get Camera position given an index coordinate.
Parameters:
index - Coordinate
Returns:
Camera's position on that coordinate

getCamOri

public float getCamOri(int index)
Get Camera orientation given an index coordinate.
Parameters:
index - Coordinate
Returns:
Camera's orientation on that coordinate

setCamPos

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

setCamOri

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

getType

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

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