Documentation of 'vgp.tutor.eventCamera.PjEventCamera' Java class
PjEventCamera ("JavaView Reference Manual")
"JavaView? v5.03.003"
vgp.tutor.eventCamera

Class PjEventCamera

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsTimeListenerIf, PsUpdateIf, PvCameraListenerIf, PvPickListenerIf


    public class PjEventCamera
    extends PjProject
    implements PvCameraListenerIf
    Demo project shows how to handle camera events issued from a JavaView display. In this example the events are used to steer the camera in a second window.

    The camera events from one window are used to steer the camera in the other window such that a stereo effect is produced. Note, the viewing direction of the left camera is slightly rotated around the up-vector of the camera by about 6 degrees.

    See Also:
    PvCameraEvent, PvCameraListenerIf, PvDisplayIf, Serialized Form
    Author:
    Konrad Polthier
    Version:
    05.11.06, 2.10 revised (kp) Appearance of surface adjusted.
    14.12.03, 2.00 revised (kp) Full revision.
    25.07.00, 1.00 created (kp)
    • Field Detail

      • STEREO_CROSS

        public static final int STEREO_CROSS
        Cross eye stereo projection.
        See Also:
        Constant Field Values
      • STEREO_PARALLEL

        public static final int STEREO_PARALLEL
        Parallel eye stereo projection.
        See Also:
        Constant Field Values
      • STEREO_REDGREEN

        public static final int STEREO_REDGREEN
        Red green painting of stereo projection.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PjEventCamera

        public PjEventCamera()
    • Method Detail

      • init

        public void init()
        Description copied from class: PjProject
        Initialize and reset project, stops the running animation if any. Does not reset any registered display nor geometry. They must be reset individually in each subclass.
        Overrides:
        init in class PjProject
      • start

        public void start()
        Description copied from class: PjProject
        Method is invoked during loading of a project in JavaView.

        If a project has an animation object, then the animation panel is shown when the project's this start() method is invoked during loading of the project. Use setAnimation(PsAnimation) to register an animation.

        If auto fit is enabled then scenery is scaled to fit in each display.

        Overrides:
        start in class PjProject
        See Also:
        PvViewerIf.start(), PjProject.isEnabledAutoFit()
      • reset

        public void reset()
      • update

        public boolean update(java.lang.Object event)
        Description copied from class: PsObject
        Update all inspector panels, send update to all registered update listeners and finally update parent. Each of those updates has this object as event independent of the argument of this method.

        Central update method of this object. Must be overwritten if this class receives unknown events, say, from new children. Any subclass must class invoke super.update(event) on all events it does handle itself.

        Specified by:
        update in interface PsUpdateIf
        Overrides:
        update in class PsObject
        Parameters:
        event - carries a lot of information
        Returns:
        true if event has been handled, otherwise false
        See Also:
        PsObject.setParent(PsUpdateIf), PsObject.getFather(), PsObject.addUpdateListener(PsUpdateIf)
      • getRightDisplay

        public PvDisplayIf getRightDisplay()
      • getStereoType

        public int getStereoType()
        Get type of stereo projection.
        Returns:
        stereo projection type, see STEREO_CROSS and similar.
      • setStereoType

        public void setStereoType(int type)
        Set type of stereo projection.
        Parameters:
        type - stereo projection type, see STEREO_CROSS and similar.
      • pickCamera

        public void pickCamera(PvCameraEvent pos)
        Get camera events resulting from picking the mouse. Use information about camera in one display to adjust the camera in the other window. But previously rotate the camera position around the line given by interest+t*upVector by -6 degrees.
        Specified by:
        pickCamera in interface PvCameraListenerIf
        Parameters:
        pos - Pick event issued by the display
        See Also:
        PvCameraListenerIf
      • dragCamera

        public void dragCamera(PvCameraEvent pos)
        Get camera events resulting from dragging the mouse. This method just calls the method pickCamera which does all the work.
        Specified by:
        dragCamera in interface PvCameraListenerIf
        Parameters:
        pos - Drag event issued by the display
        See Also:
        PvCameraListenerIf
"JavaView? v5.03.003"

"

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

Ads help maintain this website.