nl.tudelft.goal.ut2004.visualizer.timeline.map
Class MapViewpoint

Package class diagram package MapViewpoint
java.lang.Object
  extended by nl.tudelft.goal.ut2004.visualizer.timeline.map.MapViewpoint

public class MapViewpoint
extends Object

Representation of where is observer in map and where does he look, what is its POV angle ect.

Author:
Honza

Nested Class Summary
static interface MapViewpoint.ViewpointListener
           
 
Constructor Summary
MapViewpoint()
           
MapViewpoint(double x, double y, double z)
           
 
Method Summary
 void addViewpointListener(MapViewpoint.ViewpointListener listener)
           
 double getCenter2EyeDistance()
          Get distance from eye point to center point.
 cz.cuni.amis.pogamut.base3d.worldview.object.Location getEye()
           
 cz.cuni.amis.pogamut.base3d.worldview.object.Location getEye2Center()
           
 cz.cuni.amis.pogamut.base3d.worldview.object.Location getLocation()
           
 cz.cuni.amis.pogamut.base3d.worldview.object.Location getRightVector()
           
 javax.vecmath.Vector3d getUp()
           
 double getViewAngle()
           
 boolean isViewpointListener(MapViewpoint.ViewpointListener listener)
           
 void lookAt(cz.cuni.amis.pogamut.base3d.worldview.object.Location location, int axis, boolean upFlag)
          Set the viewpoint so it looks at specified location.
 void move(double deltaX, double deltaY, double deltaZ)
          Move center and eye by deltaX,Y,Z in worldspace.
 void move(cz.cuni.amis.pogamut.base3d.worldview.object.Location moveVec)
          Move center and eye in worldspace by the vector.
 void moveEye(cz.cuni.amis.pogamut.base3d.worldview.object.Location delta)
           
 void removeViewpointListener(MapViewpoint.ViewpointListener listener)
           
 void rotateCenter(cz.cuni.amis.pogamut.base3d.worldview.object.Location axis, double angle)
           
 void rotateEye(cz.cuni.amis.pogamut.base3d.worldview.object.Location axis, double angle)
          Rotate eye and up vectors around axis with origin in center by angle angle.
static cz.cuni.amis.pogamut.base3d.worldview.object.Location rotateVectorAroundAxis(cz.cuni.amis.pogamut.base3d.worldview.object.Location vector, cz.cuni.amis.pogamut.base3d.worldview.object.Location axis, double angle)
          Rotate by angle around vector axis.
 void setFromViewedBox(cz.cuni.amis.pogamut.unreal.communication.worldview.map.Box box)
           
 void setFrontView(cz.cuni.amis.pogamut.unreal.communication.worldview.map.Box box)
           
 void setLocation(cz.cuni.amis.pogamut.base3d.worldview.object.Location location)
           
 void setSideView(cz.cuni.amis.pogamut.unreal.communication.worldview.map.Box box)
           
 void setTopView(cz.cuni.amis.pogamut.unreal.communication.worldview.map.Box box)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapViewpoint

public MapViewpoint()

MapViewpoint

public MapViewpoint(double x,
                    double y,
                    double z)
Method Detail

moveEye

public void moveEye(cz.cuni.amis.pogamut.base3d.worldview.object.Location delta)

getLocation

public cz.cuni.amis.pogamut.base3d.worldview.object.Location getLocation()

getEye

public cz.cuni.amis.pogamut.base3d.worldview.object.Location getEye()

getUp

public javax.vecmath.Vector3d getUp()

getEye2Center

public cz.cuni.amis.pogamut.base3d.worldview.object.Location getEye2Center()

getCenter2EyeDistance

public double getCenter2EyeDistance()
Get distance from eye point to center point.

Returns:
distance from eye to center.

getRightVector

public cz.cuni.amis.pogamut.base3d.worldview.object.Location getRightVector()

setLocation

public void setLocation(cz.cuni.amis.pogamut.base3d.worldview.object.Location location)

setFromViewedBox

public void setFromViewedBox(cz.cuni.amis.pogamut.unreal.communication.worldview.map.Box box)

rotateEye

public void rotateEye(cz.cuni.amis.pogamut.base3d.worldview.object.Location axis,
                      double angle)
Rotate eye and up vectors around axis with origin in center by angle angle.

Parameters:
axis - angle how much rotate, in degress, by right hand, thumb direction of axis, plam in direction of angle
angle -

rotateCenter

public void rotateCenter(cz.cuni.amis.pogamut.base3d.worldview.object.Location axis,
                         double angle)

rotateVectorAroundAxis

public static cz.cuni.amis.pogamut.base3d.worldview.object.Location rotateVectorAroundAxis(cz.cuni.amis.pogamut.base3d.worldview.object.Location vector,
                                                                                           cz.cuni.amis.pogamut.base3d.worldview.object.Location axis,
                                                                                           double angle)
Rotate by angle around vector axis. Thumb of right hand in same direction as axis vector and closing palm shows direction of rotation.

Parameters:
vector -
axis -
angle - angle in degrees

setFrontView

public void setFrontView(cz.cuni.amis.pogamut.unreal.communication.worldview.map.Box box)

setSideView

public void setSideView(cz.cuni.amis.pogamut.unreal.communication.worldview.map.Box box)

setTopView

public void setTopView(cz.cuni.amis.pogamut.unreal.communication.worldview.map.Box box)

getViewAngle

public double getViewAngle()

move

public void move(cz.cuni.amis.pogamut.base3d.worldview.object.Location moveVec)
Move center and eye in worldspace by the vector.

Parameters:
moveVec - how much and in which direction should eye and center move

move

public void move(double deltaX,
                 double deltaY,
                 double deltaZ)
Move center and eye by deltaX,Y,Z in worldspace.

Parameters:
deltaX - how much should eye and center move along world x axis
deltaY - how much should eye and center move along world y axis
deltaZ - how much should eye and center move along world z axis

addViewpointListener

public void addViewpointListener(MapViewpoint.ViewpointListener listener)

isViewpointListener

public boolean isViewpointListener(MapViewpoint.ViewpointListener listener)

removeViewpointListener

public void removeViewpointListener(MapViewpoint.ViewpointListener listener)

lookAt

public void lookAt(cz.cuni.amis.pogamut.base3d.worldview.object.Location location,
                   int axis,
                   boolean upFlag)
Set the viewpoint so it looks at specified location. Set new center and update up angle.

Parameters:
location - location that should be in the middle of screen
axis - x = 0, y = 1, z = 2, which axis is up direction?
upFlag - is up at positive infinity of the axis (true) or negative infinity (false);


Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.