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.
  See Also:
    `PvPickListenerIf`, `PvCameraIf`, `PvDisplayIf`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PvCameraEvent(PvDisplayIf disp, int dim)` Constructor with dimension of scene shown in display, usually dim=3.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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:
        `pos` - 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:
        `vertex` - 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 `PvCameraIf#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 positive y-axis is showing upward.

      Returns:
        current angle of camera up vector with reference up-vector.

    - #### 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.

"

The software JavaView? is copyright protected. All Rights Reserved.
"