org.vigia.client.driver.util
Class MovementProcessor

java.lang.Object
  extended by org.vigia.client.driver.util.MovementProcessor

public class MovementProcessor
extends java.lang.Object

Transforms coordinates into PTZ and stores the position of the user

Author:
Ada

Field Summary
protected  Coordinates c
          The coordinates of the user.
protected static int HYSTERESIS_X
          Hysteresis for the x coordinate.
protected static int HYSTERESIS_Y
          Hysteresis for the y coordinate.
protected static float HYSTERESIS_Z
          Hysteresis for the z coordinate.
protected  boolean init
          True if no movement has been processed
 
Constructor Summary
MovementProcessor()
          Constructor.
 
Method Summary
protected  int calculatePan(int x, int y, float z, int xVRes)
          Calculates the pan movement.
 PTZ calculatePTZ(Coordinates c, int xVRes, int yVRes)
          Calculates the ptz movement.
protected  int calculateTilt(int x, int y, float z, int yVRes)
          Calculates the tilt movement.
protected  int calculateZoom(float z)
          Calculates the zoom movement.
protected  boolean movePan(int x)
          Decides if a pan movement needs to be done.
protected  boolean moveTilt(int y)
          Decides if a tilt movement needs to be done.
protected  boolean moveZoom(float z)
          Decides if a zoom movement needs to be done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

c

protected Coordinates c
The coordinates of the user.


init

protected boolean init
True if no movement has been processed


HYSTERESIS_X

protected static final int HYSTERESIS_X
Hysteresis for the x coordinate.

See Also:
Constant Field Values

HYSTERESIS_Y

protected static final int HYSTERESIS_Y
Hysteresis for the y coordinate.

See Also:
Constant Field Values

HYSTERESIS_Z

protected static final float HYSTERESIS_Z
Hysteresis for the z coordinate.

See Also:
Constant Field Values
Constructor Detail

MovementProcessor

public MovementProcessor()
Constructor.

Method Detail

calculatePTZ

public PTZ calculatePTZ(Coordinates c,
                        int xVRes,
                        int yVRes)
Calculates the ptz movement.

Parameters:
c - the new coordinates of the user.
xVRes - IR virtual screen x resolution.
yVRes - IR virtual screen y resolution.
Returns:
the PTZ movement to be done by the remote camera, null if no movement needs to be done.

calculatePan

protected int calculatePan(int x,
                           int y,
                           float z,
                           int xVRes)
Calculates the pan movement.

Parameters:
x - the x coordinate.
y - the y coordinate.
z - the z coordinate.
xVRes - IR virtual screen x resolution.
Returns:
the calculated pan.

calculateTilt

protected int calculateTilt(int x,
                            int y,
                            float z,
                            int yVRes)
Calculates the tilt movement.

Parameters:
x - the x coordinate
y - the y coordinate.
z - the z coordinate.
yVRes - IR virtual screen y resolution.
Returns:
the calculated tilt.

calculateZoom

protected int calculateZoom(float z)
Calculates the zoom movement.

Parameters:
z - the z coordinate.
Returns:
the calculated zoom.

movePan

protected boolean movePan(int x)
Decides if a pan movement needs to be done.

Parameters:
x - the x coordinate.
Returns:
true if a pan movement needs to be done.

moveTilt

protected boolean moveTilt(int y)
Decides if a tilt movement needs to be done.

Parameters:
y - the y coordinate.
Returns:
true if a tilt movement needs to be done.

moveZoom

protected boolean moveZoom(float z)
Decides if a zoom movement needs to be done.

Parameters:
z - the z coordinate.
Returns:
true if a zoom movement needs to be done.