JavaView® v2.00.008

jv.project
Class PvCameraEvent

java.lang.Object
  |
  +--jv.project.PvCameraEvent
All Implemented Interfaces:
java.io.Serializable

public final class PvCameraEvent
extends java.lang.Object
implements java.io.Serializable

Information about camera whenever mouse position has changed to be sent to a listener from a display.

Version:
25.07.00, 1.00 revised (kp) 25.07.00, 1.00 created (kp)
Author:
Konrad Polthier
See Also:
PvPickListenerIf, PvCameraIf, PvDisplayIf, Serialized Form

Field Summary
protected  PvCameraIf m_camera
          Current camera of display.
protected  int m_dim
          Dimension of vertex in world coordinates.
protected  PvDisplayIf m_display
          Display where pick event occurred.
protected  java.awt.Point m_location
          Position of cursor in pixel coordinates of drawing canvas.
protected  PdVector m_vertex
          Vertex representing a world point under the mouse position.
 
Constructor Summary
PvCameraEvent(PvDisplayIf disp, int dim)
          Constructor with dimension of scene shown in display, usually dim=3.
 
Method Summary
 int getDimOfVertex()
          Get dimension of scene position of cursor in world coordinate of scene in display.
 PdVector getInterest()
          Get position at which camera is directed, i.e. the point of interest.
 java.awt.Point getLocation()
          Get position of cursor in pixel coordinates of drawing canvas of event.
 PdVector getPosition()
          Get position of camera in world coordinates.
 int getProjectionMode()
          Get projection mode of the camera, for example, perspective, xy-projection etc.
 double getRoll()
          Get angle which camera is rotated around viewing direction against default position.
 double getScale()
          Get zoom factor of camera.
 PvDisplayIf getSource()
          Get source display where this event occurred.
 PdVector getUpVector()
          Get up vector as second row of viewing matrix divided by scaling factor.
 PdVector getVertex()
          Get position of cursor in world coordinate of scene in display.
 PdVector getViewDir()
          Get normalized viewing direction as the vector pointing from the camera to its interest.
 void setCamera(PvCameraIf camera)
          Assign current camera of display when this event occurred.
 void setLocation(java.awt.Point pos)
          Set position of cursor in pixel coordinates of drawing canvas of event.
 void setVertex(PdVector vertex)
          Set position of cursor in world coordinate of scene in display.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_display

protected PvDisplayIf m_display
Display where pick event occurred.

m_camera

protected PvCameraIf m_camera
Current camera of display.

m_location

protected java.awt.Point m_location
Position of cursor in pixel coordinates of drawing canvas.

m_dim

protected int m_dim
Dimension of vertex in world coordinates.

m_vertex

protected PdVector m_vertex
Vertex representing a world point under the mouse position.
Constructor Detail

PvCameraEvent

public PvCameraEvent(PvDisplayIf disp,
                     int dim)
Constructor with dimension of scene shown in display, usually dim=3.
Parameters:
disp - Display where this event occurred
dim - Dimension of world coordinates in scene
Method Detail

getSource

public PvDisplayIf getSource()
Get source display where this event occurred.
Returns:
display where this event occurred

getDimOfVertex

public int getDimOfVertex()
Get dimension of scene position of cursor in world coordinate of scene in display.
Returns:
Dimension of scene.

getLocation

public java.awt.Point getLocation()
Get position of cursor in pixel coordinates of drawing canvas of event.
Returns:
Location of mouse cursor in 2d pixel coordinates

setLocation

public void setLocation(java.awt.Point pos)
Set position of cursor in pixel coordinates of drawing canvas of event.
Parameters:
Location - of mouse cursor in 2d pixel coordinates

getVertex

public PdVector getVertex()
Get position of cursor in world coordinate of scene in display.
Returns:
World coordinates of mouse position in scene.

setVertex

public void setVertex(PdVector vertex)
Set position of cursor in world coordinate of scene in display.
Parameters:
World - coordinates of mouse position in scene.

setCamera

public void setCamera(PvCameraIf camera)
Assign current camera of display when this event occurred.
Parameters:
camera - Active camera of display to be queried for information.

getProjectionMode

public int getProjectionMode()
Get projection mode of the camera, for example, perspective, xy-projection etc. For a list of possible type see PvDisplayIf#CAMERA_ORTHO_XY.
Returns:
current projection mode
See Also:
PvDisplayIf

getScale

public double getScale()
Get zoom factor of camera.
Returns:
zoom factor of camera.

getRoll

public double getRoll()
Get angle which camera is rotated around viewing direction against default position. The default position depends on the projection mode of the camera.

Mathematically, the roll is the angle between the two planes p1=(viewDir, defaultUpVector) and p2=(viewDir, upVector). The defaultUpVector depends on the projection mode, in xy-projection mode we have defaultUpVector=(0,1,0) since camera look down the negative z-axis and the positiv y-axis is showing upward.

See Also:
#setRoll(double)

getInterest

public PdVector getInterest()
Get position at which camera is directed, i.e. the point of interest.
Returns:
3d-coordinates of interest in world coordinates.

getPosition

public PdVector getPosition()
Get position of camera in world coordinates.
Returns:
3d-position of camera in world coordinates.

getViewDir

public PdVector getViewDir()
Get normalized viewing direction as the vector pointing from the camera to its interest.
Returns:
normalized viewing direction in world coordinates

getUpVector

public PdVector getUpVector()
Get up vector as second row of viewing matrix divided by scaling factor.
Returns:
normalized up vector of camera in world coordinates.

JavaView® v2.00.008

The software JavaView® is copyright protected. All Rights Reserved.