JavaView® v2.12

jv.project
Interface PvDisplayIf

All Superinterfaces:
java.util.EventListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, PsUpdateIf
All Known Implementing Classes:
PvDisplay

public interface PvDisplayIf
extends PsUpdateIf, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

This interface must be implemented by all displays to be registered in JavaView, and which want to display any of the geometries implementing the interface PgGeometryIf. Each geometry instance may be registered in a set of displays. If a geometry is modified then it must notify the associated displays via a call display.update(geometry) to invoke a repaint(). In response to this update the display calls the geometries paint(PvGeometryIf cont) method in which a container is filled with the modified data of the geometry.

Note: the get and set methods are currently replaced with isShowing... and show... methods. The state of this interface is therefore temporary.

Version:
15.03.01, 2.50 revised (kp) New method getCameras() added.
21.01.01, 2.40 revised (kp) New methods for positioning a background image added.
05.01.01, 2.30 revised (kp) Methods for z-buffered drawing added.
16.11.00, 2.20 revised (kp) New mode DUPLICATE added for reflection.
29.10.00, 2.10 revised (kp) New mode DELETE added.
29.09.00, 2.00 revised (kp) Many set/get methods renamed to show/isShowing.
29.09.00, 1.99 revised (kp) Renamed to PvDisplayIf from PgDisplayIf.
26.09.00, 1.90 revised (kp) Dependency on package jv.anim removed.
10.08.00, 1.80 revised (kp) Two methods for get/setting filename of background image removed.
28.07.00, 1.70 revised (kp) Implementation of mouse and key event interfaces added.
18.07.00, 1.50 revised (kp) Mode MODE_DISPLAY_PICK now returns display pick events and no geometries.
03.07.00, 1.40 revised (kp) Additional paint flags added.
06.05.00, 1.35 revised (kp) Number of methods to access PvPickListener reduced.
27.03.00, 1.31 revised (ep) changed return type of getCamera() to PvCameraIf.
07.02.00, 1.30 revised (kp) Additional mode to scale to specified rectangle added.
23.12.99, 1.20 revised (kp) Access to components of transformation matrix.
31.10.99, 1.10 revised (kp) Some methods added.
09.02.98, 1.00 created (kp)
Author:
Konrad Polthier
See Also:
PgGeometryIf, PsUpdateIf, PgGeometryIf.paint(PvGeometryIf)

Field Summary
static int CAMERA_MODEL
          Misused camera type in display, simulates transformation of modeling matrix of geometry.
static java.lang.String[] CAMERA_NAME
          Array of camera names.
static int CAMERA_ORTHO_XY
          Camera type and projection mode projecting orthogonally onto xy-plane.
static int CAMERA_ORTHO_XZ
          Camera type and projection mode projecting orthogonally onto xz-plane.
static int CAMERA_ORTHO_YZ
          Camera type and projection mode projecting orthogonally onto yz-plane.
static int CAMERA_PERSPECTIVE
          Camera type and projection mode allowing to arbitrary rotate camera.
static int IMAGE_CENTER
          Determines that a background image is positioned in the center of a display.
static int IMAGE_RESIZE
          Determines that a background image is resized to fill the display.
static int IMAGE_TESSELATE
          Determines that a background image is duplicated to fill the display.
static int MATRIX_AMBIENT
          Type of geometry ambient modeling matrix used by cameras and display.
static int MATRIX_INV_AMBIENT
          Type of inverse geometry ambient modeling matrix used by cameras and display.
static int MATRIX_INV_MODEL
          Type of inverse geometry modeling matrix used by cameras and display.
static int MATRIX_INV_PROJECT
          Type of inverse projection matrix used by cameras and display.
static int MATRIX_INV_PROJVIEW
          Type of inverse transformation matrix PV^-1 used by cameras and display.
static int MATRIX_INV_TRANS
          Type of inverse full transformation matrix PVM^-1 used by cameras and display.
static int MATRIX_INV_VIEW
          Type of inverse camera viewing matrix used by cameras and display.
static int MATRIX_MODEL
          Type of geometry modeling matrix used by cameras and display.
static int MATRIX_PROJECT
          Type of projection matrix used by cameras and display.
static int MATRIX_PROJVIEW
          Type of transformation matrix PV used by cameras and display.
static int MATRIX_TRANS
          Type of full transformation matrix PVM used by cameras and display.
static int MATRIX_VIEW
          Type of camera viewing matrix used by cameras and display.
static int MODE_ADD
          Major mode in display to add new points of geometries.
static int MODE_DELETE
          Major mode in display to delete items or geometries.
static int MODE_DISPLAY_PICK
          Major mode in display to select initial points in display without picking geometries.
static int MODE_DUPLICATE
          Major mode in display to duplicate geometries.
static int MODE_HIGHLIGHT
          Major mode in display to highlight items on geometries if they receive focus.
static int MODE_INITIAL_PICK
          Major mode in display to select initial points on geometries.
static int MODE_MARK
          Major mode in display to mark a set of points on geometries.
static int MODE_MARK_ELEMENTS
          Major mode in display to mark a set of elements on geometries.
static int MODE_ORBIT
          Major mode in display to rotate geometry.
static int MODE_PICK
          Major mode in display to pick and modify vertices.
static int MODE_SCALE
          Major mode in display to scale geometry by zooming.
static int MODE_SCALE_RECT
          Major mode in display to scale geometry by zooming into a specified rectangle.
static int MODE_TRANS
          Major mode in display to (x,y)-translate geometry.
static int MODE_TRANS_Z
          Major mode in display to z-translate geometry.
static int MODE_UNMARK
          Major mode in display to unmark a set of points on surfaces.
static int PAINT_ALL
          Enable drawing in display canvas, default enabled, otherwise no repaint of the display happens, and nothing is visible nor changes.
static int PAINT_ANTIALIAS
          Enable antialiasing of display.
static int PAINT_AXES
          Enable drawing of a coordinate axes around scene in the display.
static int PAINT_BACKGROUND
          Enable drawing of colored background.
static int PAINT_BACKIMAGE
          Enable drawing of background image.
static int PAINT_BNDBOX
          Enable drawing of bounding box of current geometry.
static int PAINT_BORDER
          Enable drawing of sunk border around display canvas.
static int PAINT_CENTER
          Enable drawing of center of active geometry.
static int PAINT_CLEAR_SCREEN
          Enable clearing of screen after each repaint.
static int PAINT_CROSS
          Enable drawing of cross at current cursor position.
static int PAINT_FRAME
          Enable drawing of a small coordinate frame in the lower left corner of the display.
static int PAINT_INFO
          Enable drawing of additional information close to cursor in overlay window.
static int PAINT_MAGNET
          Attach cursor to vertices of nearby.
static int PAINT_SINGLE
          Restrict drawing to a single geometry at the same time.
static int PAINT_ZOOM
          Scale transformation matrix to simulate floating point accuracy in pixel integers.
static int TRANSFORM_AMBIENT
          Viewing transformations affect the ambient modeling matrix of geometry.
static int TRANSFORM_CAMERA
          Viewing transformations affect the camera viewing matrix.
static int TRANSFORM_MODEL
          Viewing transformations affect the modeling matrix of geometry.
 
Method Summary
 void addCameraListener(PvCameraListenerIf listener)
          Add camera listener to receive camera events PvCameraEvent.
 boolean addGeometry(PgGeometryIf anObject)
          Register geometry in display.
 void addKeyListener(java.awt.event.KeyListener listener)
          Register a keyListener to receive keyboard events of JavaView.
 void addPickListener(PvPickListenerIf listener)
          Add pick listener to receive pick events PvPickEvent.
 boolean containsGeometry(PgGeometryIf anObject)
          Check whether geometry is registered in display.
 void enableClip(boolean aFlag)
          Deprecated. use #setEnabledClip
 void fit()
          Scale camera such that current geometries fit into display.
 java.awt.Color getBackgroundColor()
          Get color of background of display.
 java.awt.Image getBackgroundImage()
          Get background image of display canvas.
 PvCameraIf getCamera()
          Get current camera.
 PvCameraIf getCamera(int type)
          Get a camera object of given type if registered in display.
 PsPanel getCameraPanel()
          Get info panel of current camera.
 PvCameraIf[] getCameras()
          Get set of registered cameras.
 double getFarClip()
          Get far clip distance of current camera.
 java.awt.Color getForegroundColor()
          Get foreground color.
 java.awt.Frame getFrame()
          Get reference to container frame of display, e.g. to allow display to hide/show frame.
 PgGeometryIf[] getGeometries()
          Get all registered geometry in display.
 java.awt.Graphics getGraphics()
          General AWT getGraphics(Graphics) method included in interface to allow invocation from outside the display.
 java.awt.Image getImage()
          Get the rendered image of the scene.
 int getImageFitMode()
          Get the mode determining how a background image is scaled w.r.t. the display canvas.
 PsPanel getInfoPanel()
          Get info panel of display.
 int getMajorMode()
          Get current interaction mode.
 java.lang.String getName()
          Get name of dispay, e.g. used as title in info panel and hashtable of PvViewer.
 double getNearClip()
          Get near clip distance of current camera.
 int getNumGeometries()
          Get number of all registered geometry in display.
 PgGeometryIf getSelectedGeometry()
          Get selected geometry in display.
 java.awt.Dimension getSize()
          Get dimension with height and width of drawing canvas.
 PdMatrix getTransMatrix(int type)
          Get 4*4 transformation matrix or components from current camera and display.
 boolean hasCamera(int type)
          Determine whether a camera object of given type is registered in display.
 boolean hasCameraListener(PvCameraListenerIf listener)
          Check for a registered listener.
 boolean hasPaintTag(int flags)
          Deprecated. use individual isShowing...() methods.
 boolean hasPickListener(PvPickListenerIf listener)
          Check for a registered listener.
 boolean incrementAutoRotation()
          Do an increment of the auto-rotation animation.
 void init()
          Initialize and reset dispay.
 boolean isClip()
          Deprecated. use #isEnabledClip
 boolean isEnabledAnimation()
          Check whether auto-rotation is enabled.
 boolean isEnabledClip()
          Check whether clipping with front and back plane is enabled.
 boolean isEnabledPainters()
          Check whether painter's algorithm during drawing is enabled.
 boolean isEnabledUpdate()
          Determine whether update mechanism is enabled.
 boolean isEnabledZBuffer()
          Check whether z-buffered drawing is enabled.
 boolean isShowingAxes()
          Check whether axes of active geometry is currently showing.
 boolean isShowingBackImage()
          Check drawing of background image of display window.
 boolean isShowingBndBox()
          Check whether bounding box of active geometry is currently showing.
 boolean isShowingDepthcue()
          True if depthcue is enabled.
 boolean isShowingEdgeAura()
          Check flag of drawing of edges by one or both elements adjacent to an edge.
 boolean isShowingEdgesOnce()
          Check flag of drawing of edges by one or both elements adjacent to an edge.
 boolean isShowingFrame()
          Check whether coordinate frame is currently showing.
 boolean isShowingGrid()
          Check whether grid is currently showing.
 boolean isShowingMagnet()
          Check whether cursor attached to vertices if nearby.
 void releasePickFocus()
          Release pick focus, i.e. to be the unique listener who receives pick events.
 boolean removeCamera(int type)
          Remove camera from the list of installed camera to be current camera in the display.
 boolean removeCameraListener(PvCameraListenerIf listener)
          Remove a registered listener from list of registered listeners.
 void removeGeometries()
          Remove all geometries from display and remove any registered pick listener.
 boolean removeGeometry(PgGeometryIf anObject)
          Remove geometry from display.
 void removeKeyListener(java.awt.event.KeyListener listener)
          Remove a keyListener to receive keyboard events of JavaView.
 boolean removePickListener(PvPickListenerIf listener)
          Remove a registered listener from list of registered listeners.
 void requestPickFocus(PvPickListenerIf listener)
          Request pick focus, i.e. to be the unique listener who receives pick events.
 boolean selectCamera(int type)
          Select camera from the list of installed camera to be current camera in the display.
 boolean selectGeometry(PgGeometryIf anObject)
          Select geometry in display to receive pick events.
 void setAutoCenter(boolean flag)
          Set flag which determines whether camera will automatically center on geometry.
 void setAutoRotation(PdVector axis, double angle)
          Set axis and angle for auto-rotation.
 void setBackgroundColor(java.awt.Color aColor)
          Set color of background of display.
 void setBackgroundImage(java.awt.Image image)
          Set background image of display canvas.
 void setBackgroundImage(java.lang.String fileName)
          Set background image of display canvas.
 void setDrawingOrder(int order, PgGeometryIf geom)
          Choose z-order of geometry when drawn in display.
 void setEnabledAnimation(boolean aFlag)
          Enable and disable auto-rotation of scene.
 void setEnabledClip(boolean aFlag)
          Enable and disable clipping with front and back plane.
 void setEnabledPainters(boolean aFlag)
          Enable and disable painter's algorithm during drawing, i.e. a z-sort of drawing items.
 void setEnabledUpdate(boolean flag)
          Set flag which determines whether update mechanism is enabled.
 void setEnabledZBuffer(boolean aFlag)
          Enable and disable z-buffered drawing of scene.
 void setFarClip(double dist)
          Set far clip distance of current camera, works even if clipping is disabled.
 void setForegroundColor(java.awt.Color aColor)
          Set foreground color.
 void setFrame(java.awt.Frame frame)
          Set reference to container frame of display, e.g. to allow display to hide/show frame.
 void setImageFitMode(int mode)
          Set the mode determining how a background image is scaled w.r.t. the display canvas.
 void setMajorMode(int aMode)
          Switch between interaction modes like rotating or scaling, usually done interactively.
 void setName(java.lang.String name)
          Set name of dispay, e.g. used as title in info panel and hashtable of PvViewer.
 void setNearClip(double dist)
          Set near clip distance of current camera, works even if clipping is disabled.
 void setPaintTag(int flags, boolean val)
          Deprecated. use individual show...(boolean) methods.
 void setSizeWithinFrame(int width, int height)
          Set height and width of drawing canvas if canvas is inside a frame.
 void setTransMatrix(int type, PdMatrix mat)
          Set transformation matrix or components in current camera and display.
 void showAxes(boolean aFlag)
          Set visibility of axes active geometry, and create axes if not available.
 void showBackImage(boolean aFlag)
          Enable and disable drawing of background image of display window.
 void showBndBox(boolean aFlag)
          Set visibility of bounding box active geometry, and create bounding box if not available.
 void showDepthcue(boolean aFlag)
          Enable and disable depthcue drawing.
 void showEdgeAura(boolean aFlag)
          Enable and disable drawing of edges by one or both elements adjacent to an edge.
 void showEdgesOnce(boolean aFlag)
          Enable and disable drawing of edges by one or both elements adjacent to an edge.
 void showFrame(boolean aFlag)
          Set visibility of coordinate frame is shown, and create frame if not available.
 void showGrid(boolean aFlag)
          Set visibility of grid, and create grid if not available.
 void showMagnet(boolean aFlag)
          Attach cursor to vertices if nearby.
 void start()
          Start auto-rotation in viewer where a matrix is constantly multiplied to transformation matrix.
 void stop()
          Stop auto-rotation in viewer.
 boolean update(java.lang.Object event)
          Update mechanism of JavaView.
 
Methods inherited from interface jv.object.PsUpdateIf
getFather, setParent
 
Methods inherited from interface java.awt.event.KeyListener
keyPressed, keyReleased, keyTyped
 
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from interface java.awt.event.MouseMotionListener
mouseDragged, mouseMoved
 

Field Detail

MODE_ORBIT

public static final int MODE_ORBIT
Major mode in display to rotate geometry.

MODE_SCALE

public static final int MODE_SCALE
Major mode in display to scale geometry by zooming.

MODE_SCALE_RECT

public static final int MODE_SCALE_RECT
Major mode in display to scale geometry by zooming into a specified rectangle.

MODE_TRANS

public static final int MODE_TRANS
Major mode in display to (x,y)-translate geometry.

MODE_TRANS_Z

public static final int MODE_TRANS_Z
Major mode in display to z-translate geometry.

MODE_PICK

public static final int MODE_PICK
Major mode in display to pick and modify vertices.

MODE_INITIAL_PICK

public static final int MODE_INITIAL_PICK
Major mode in display to select initial points on geometries.

MODE_HIGHLIGHT

public static final int MODE_HIGHLIGHT
Major mode in display to highlight items on geometries if they receive focus.

MODE_DISPLAY_PICK

public static final int MODE_DISPLAY_PICK
Major mode in display to select initial points in display without picking geometries.

MODE_MARK

public static final int MODE_MARK
Major mode in display to mark a set of points on geometries.

MODE_MARK_ELEMENTS

public static final int MODE_MARK_ELEMENTS
Major mode in display to mark a set of elements on geometries.

MODE_UNMARK

public static final int MODE_UNMARK
Major mode in display to unmark a set of points on surfaces.

MODE_ADD

public static final int MODE_ADD
Major mode in display to add new points of geometries.

MODE_DELETE

public static final int MODE_DELETE
Major mode in display to delete items or geometries.

MODE_DUPLICATE

public static final int MODE_DUPLICATE
Major mode in display to duplicate geometries.

CAMERA_PERSPECTIVE

public static final int CAMERA_PERSPECTIVE
Camera type and projection mode allowing to arbitrary rotate camera.

CAMERA_ORTHO_XY

public static final int CAMERA_ORTHO_XY
Camera type and projection mode projecting orthogonally onto xy-plane.

CAMERA_ORTHO_XZ

public static final int CAMERA_ORTHO_XZ
Camera type and projection mode projecting orthogonally onto xz-plane.

CAMERA_ORTHO_YZ

public static final int CAMERA_ORTHO_YZ
Camera type and projection mode projecting orthogonally onto yz-plane.

CAMERA_MODEL

public static final int CAMERA_MODEL
Misused camera type in display, simulates transformation of modeling matrix of geometry.

CAMERA_NAME

public static final java.lang.String[] CAMERA_NAME
Array of camera names. Position of names must match the integer id's of PvDisplayIf.CAMERA_PERSPECTIVE etc.

TRANSFORM_CAMERA

public static final int TRANSFORM_CAMERA
Viewing transformations affect the camera viewing matrix.

TRANSFORM_MODEL

public static final int TRANSFORM_MODEL
Viewing transformations affect the modeling matrix of geometry.

TRANSFORM_AMBIENT

public static final int TRANSFORM_AMBIENT
Viewing transformations affect the ambient modeling matrix of geometry.

IMAGE_CENTER

public static final int IMAGE_CENTER
Determines that a background image is positioned in the center of a display.

IMAGE_TESSELATE

public static final int IMAGE_TESSELATE
Determines that a background image is duplicated to fill the display.

IMAGE_RESIZE

public static final int IMAGE_RESIZE
Determines that a background image is resized to fill the display.

MATRIX_TRANS

public static final int MATRIX_TRANS
Type of full transformation matrix PVM used by cameras and display.

MATRIX_PROJVIEW

public static final int MATRIX_PROJVIEW
Type of transformation matrix PV used by cameras and display.

MATRIX_PROJECT

public static final int MATRIX_PROJECT
Type of projection matrix used by cameras and display.

MATRIX_VIEW

public static final int MATRIX_VIEW
Type of camera viewing matrix used by cameras and display.

MATRIX_MODEL

public static final int MATRIX_MODEL
Type of geometry modeling matrix used by cameras and display.

MATRIX_INV_TRANS

public static final int MATRIX_INV_TRANS
Type of inverse full transformation matrix PVM^-1 used by cameras and display.

MATRIX_INV_PROJVIEW

public static final int MATRIX_INV_PROJVIEW
Type of inverse transformation matrix PV^-1 used by cameras and display.

MATRIX_INV_PROJECT

public static final int MATRIX_INV_PROJECT
Type of inverse projection matrix used by cameras and display.

MATRIX_INV_VIEW

public static final int MATRIX_INV_VIEW
Type of inverse camera viewing matrix used by cameras and display.

MATRIX_INV_MODEL

public static final int MATRIX_INV_MODEL
Type of inverse geometry modeling matrix used by cameras and display.

MATRIX_AMBIENT

public static final int MATRIX_AMBIENT
Type of geometry ambient modeling matrix used by cameras and display.

MATRIX_INV_AMBIENT

public static final int MATRIX_INV_AMBIENT
Type of inverse geometry ambient modeling matrix used by cameras and display.

PAINT_ALL

public static final int PAINT_ALL
Enable drawing in display canvas, default enabled, otherwise no repaint of the display happens, and nothing is visible nor changes. Clear this flag to prevent repainting of the display if a number of geometries must be updated at the same time. Further, when setting the tag again, then the display issues a repaint() command. Therefore, if the tag is set after the last of a sequence of geometry updates then the display repaints automatically.

PAINT_BACKGROUND

public static final int PAINT_BACKGROUND
Enable drawing of colored background. If disabled background is white.

PAINT_BORDER

public static final int PAINT_BORDER
Enable drawing of sunk border around display canvas.

PAINT_ZOOM

public static final int PAINT_ZOOM
Scale transformation matrix to simulate floating point accuracy in pixel integers. Required for PostScript printing to increase pixel accurracy.

HACK: This PostScript Driver temporarily scales all integer valued quantities during display by a factor of 1000 to increase accuracy. The variable PvThickGraphics.ZOOM is set to allow to adjust all 'thickness' sizes as well. The thickness sizes are not scaled by PostScript, so we must do it in PvThickGraphics by hand. This procedure is very error proneous.


PAINT_CROSS

public static final int PAINT_CROSS
Enable drawing of cross at current cursor position.

PAINT_BACKIMAGE

public static final int PAINT_BACKIMAGE
Enable drawing of background image.

PAINT_ANTIALIAS

public static final int PAINT_ANTIALIAS
Enable antialiasing of display. Currently not supported.

PAINT_BNDBOX

public static final int PAINT_BNDBOX
Enable drawing of bounding box of current geometry.

PAINT_INFO

public static final int PAINT_INFO
Enable drawing of additional information close to cursor in overlay window.

Note, drawing of additional information can cause the display refreshrate to slow down since after each mouse movement a complex pick event is generated by intersecting all geometries with a ray.


PAINT_FRAME

public static final int PAINT_FRAME
Enable drawing of a small coordinate frame in the lower left corner of the display.

PAINT_AXES

public static final int PAINT_AXES
Enable drawing of a coordinate axes around scene in the display.

PAINT_SINGLE

public static final int PAINT_SINGLE
Restrict drawing to a single geometry at the same time. Unsetting the flag allows multiple geometries to be visible at the same time, which is the default.

This flag only determines the number of visible geometries. Independent of this flag there may only be a single geometry active.


PAINT_MAGNET

public static final int PAINT_MAGNET
Attach cursor to vertices of nearby.

PAINT_CLEAR_SCREEN

public static final int PAINT_CLEAR_SCREEN
Enable clearing of screen after each repaint.

PAINT_CENTER

public static final int PAINT_CENTER
Enable drawing of center of active geometry.
Method Detail

getName

public java.lang.String getName()
Get name of dispay, e.g. used as title in info panel and hashtable of PvViewer.
Specified by:
getName in interface PsUpdateIf

setName

public void setName(java.lang.String name)
Set name of dispay, e.g. used as title in info panel and hashtable of PvViewer.

init

public void init()
Initialize and reset dispay.

update

public boolean update(java.lang.Object event)
Update mechanism of JavaView. Method included since JAX had problems.
Specified by:
update in interface PsUpdateIf
Following copied from interface: jv.object.PsUpdateIf
Parameters:
event - carries a lot of information
Returns:
true if event has been handled, otherwise false
See Also:
PsObject, PsUpdateIf.getFather(), PsUpdateIf.setParent(PsUpdateIf)

isEnabledUpdate

public boolean isEnabledUpdate()
Determine whether update mechanism is enabled.

setEnabledUpdate

public void setEnabledUpdate(boolean flag)
Set flag which determines whether update mechanism is enabled.

setAutoCenter

public void setAutoCenter(boolean flag)
Set flag which determines whether camera will automatically center on geometry.

getGraphics

public java.awt.Graphics getGraphics()
General AWT getGraphics(Graphics) method included in interface to allow invocation from outside the display.

addGeometry

public boolean addGeometry(PgGeometryIf anObject)
Register geometry in display.

containsGeometry

public boolean containsGeometry(PgGeometryIf anObject)
Check whether geometry is registered in display.

removeGeometry

public boolean removeGeometry(PgGeometryIf anObject)
Remove geometry from display.

removeGeometries

public void removeGeometries()
Remove all geometries from display and remove any registered pick listener.

selectGeometry

public boolean selectGeometry(PgGeometryIf anObject)
Select geometry in display to receive pick events.

getSelectedGeometry

public PgGeometryIf getSelectedGeometry()
Get selected geometry in display.

getNumGeometries

public int getNumGeometries()
Get number of all registered geometry in display. Method does not return any special geometries like bounding box, coordinate frames etc.

getGeometries

public PgGeometryIf[] getGeometries()
Get all registered geometry in display. Method does not return any special geometries like bounding box, coordinate frames etc.

fit

public void fit()
Scale camera such that current geometries fit into display.

getTransMatrix

public PdMatrix getTransMatrix(int type)
Get 4*4 transformation matrix or components from current camera and display. Allows to transform world coordinates into screen coordinates [0,0]*[width-1,height-1] of display.
Parameters:
type - Any matrix type jv.project.PvDisplayIf#MATRIX_...

setTransMatrix

public void setTransMatrix(int type,
                           PdMatrix mat)
Set transformation matrix or components in current camera and display. Allows to transform world coordinates into screen coordinates [0,0]*[width-1,height-1] of display.

Currently, not supported.

Parameters:
type - Any matrix type jv.project.PvDisplayIf#MATRIX_...

setDrawingOrder

public void setDrawingOrder(int order,
                            PgGeometryIf geom)
Choose z-order of geometry when drawn in display. For possible values see PvGeometryIf#DRAW_ORDER_*.
See Also:
PvGeometryIf

addCameraListener

public void addCameraListener(PvCameraListenerIf listener)
Add camera listener to receive camera events PvCameraEvent.
Parameters:
CameraListenerIf -  
Returns:
false if same instance already registered.
See Also:
hasCameraListener(PvCameraListenerIf), removeCameraListener(PvCameraListenerIf)

hasCameraListener

public boolean hasCameraListener(PvCameraListenerIf listener)
Check for a registered listener.
Parameters:
CameraListenerIf -  
Returns:
true if registered listener found.
See Also:
addCameraListener(PvCameraListenerIf), removeCameraListener(PvCameraListenerIf)

removeCameraListener

public boolean removeCameraListener(PvCameraListenerIf listener)
Remove a registered listener from list of registered listeners.
Parameters:
CameraListenerIf -  
Returns:
false if listener does not exists.
See Also:
addCameraListener(PvCameraListenerIf), hasCameraListener(PvCameraListenerIf)

addPickListener

public void addPickListener(PvPickListenerIf listener)
Add pick listener to receive pick events PvPickEvent.
Returns:
false if same instance already registered.
See Also:
#hasPickListeners(PvPickListener), #removePickListeners(PvPickListener)

hasPickListener

public boolean hasPickListener(PvPickListenerIf listener)
Check for a registered listener.
Returns:
true if registered listener found.
See Also:
addPickListener(PvPickListenerIf), #removePickListeners(PvPickListener)

removePickListener

public boolean removePickListener(PvPickListenerIf listener)
Remove a registered listener from list of registered listeners.
Parameters:
PickListener -  
Returns:
false if listener does not exists.
See Also:
addPickListener(PvPickListenerIf), #hasPickListeners(PvPickListener)

requestPickFocus

public void requestPickFocus(PvPickListenerIf listener)
Request pick focus, i.e. to be the unique listener who receives pick events. The focus should only be requested temporarily, and must be released after use.
Parameters:
PickListenerIf -  
See Also:
releasePickFocus()

releasePickFocus

public void releasePickFocus()
Release pick focus, i.e. to be the unique listener who receives pick events. The focus should only be requested temporarily, and must be released after use.
Parameters:
PickListenerIf -  
See Also:
requestPickFocus(PvPickListenerIf)

setMajorMode

public void setMajorMode(int aMode)
Switch between interaction modes like rotating or scaling, usually done interactively.

getMajorMode

public int getMajorMode()
Get current interaction mode.

addKeyListener

public void addKeyListener(java.awt.event.KeyListener listener)
Register a keyListener to receive keyboard events of JavaView.

removeKeyListener

public void removeKeyListener(java.awt.event.KeyListener listener)
Remove a keyListener to receive keyboard events of JavaView.

hasPaintTag

public boolean hasPaintTag(int flags)
Deprecated. use individual isShowing...() methods.

Check whether either of the bits in argument flags has been set. Possible arguments are all tags PgDisplay#PAINT_...

setPaintTag

public void setPaintTag(int flags,
                        boolean val)
Deprecated. use individual show...(boolean) methods.

Set and clear all bits in argument flags determining painting aspects in the display. Possible arguments are all tags PgDisplay#PAINT_...

isEnabledAnimation

public boolean isEnabledAnimation()
Check whether auto-rotation is enabled.

setEnabledAnimation

public void setEnabledAnimation(boolean aFlag)
Enable and disable auto-rotation of scene.

setAutoRotation

public void setAutoRotation(PdVector axis,
                            double angle)
Set axis and angle for auto-rotation. This data is valid until the user starts interacting with the display. The main use of this method is to specify an initial axis for an animation when the display opens.

incrementAutoRotation

public boolean incrementAutoRotation()
Do an increment of the auto-rotation animation.

start

public void start()
Start auto-rotation in viewer where a matrix is constantly multiplied to transformation matrix. Use #setAutoRotation to specify a rotation axis. Auto-rotation spawns a new thread.

stop

public void stop()
Stop auto-rotation in viewer. Use #start() to continue the animation.

isEnabledZBuffer

public boolean isEnabledZBuffer()
Check whether z-buffered drawing is enabled.

setEnabledZBuffer

public void setEnabledZBuffer(boolean aFlag)
Enable and disable z-buffered drawing of scene.

isShowingBackImage

public boolean isShowingBackImage()
Check drawing of background image of display window.

showBackImage

public void showBackImage(boolean aFlag)
Enable and disable drawing of background image of display window.

getImageFitMode

public int getImageFitMode()
Get the mode determining how a background image is scaled w.r.t. the display canvas.

setImageFitMode

public void setImageFitMode(int mode)
Set the mode determining how a background image is scaled w.r.t. the display canvas.

isShowingAxes

public boolean isShowingAxes()
Check whether axes of active geometry is currently showing.

showAxes

public void showAxes(boolean aFlag)
Set visibility of axes active geometry, and create axes if not available.

isShowingBndBox

public boolean isShowingBndBox()
Check whether bounding box of active geometry is currently showing.

showBndBox

public void showBndBox(boolean aFlag)
Set visibility of bounding box active geometry, and create bounding box if not available.

isShowingDepthcue

public boolean isShowingDepthcue()
True if depthcue is enabled. No depthcue for non-perspective projections. Depthcue is always switched off for non-perspective projections since they usually show planar geometries where depthcue makes not too much sense.

showDepthcue

public void showDepthcue(boolean aFlag)
Enable and disable depthcue drawing.

isShowingEdgeAura

public boolean isShowingEdgeAura()
Check flag of drawing of edges by one or both elements adjacent to an edge.

showEdgeAura

public void showEdgeAura(boolean aFlag)
Enable and disable drawing of edges by one or both elements adjacent to an edge.

isShowingEdgesOnce

public boolean isShowingEdgesOnce()
Check flag of drawing of edges by one or both elements adjacent to an edge.

showEdgesOnce

public void showEdgesOnce(boolean aFlag)
Enable and disable drawing of edges by one or both elements adjacent to an edge.

isShowingFrame

public boolean isShowingFrame()
Check whether coordinate frame is currently showing.

showFrame

public void showFrame(boolean aFlag)
Set visibility of coordinate frame is shown, and create frame if not available.

isShowingGrid

public boolean isShowingGrid()
Check whether grid is currently showing.

showGrid

public void showGrid(boolean aFlag)
Set visibility of grid, and create grid if not available.

isShowingMagnet

public boolean isShowingMagnet()
Check whether cursor attached to vertices if nearby.

showMagnet

public void showMagnet(boolean aFlag)
Attach cursor to vertices if nearby.

isEnabledPainters

public boolean isEnabledPainters()
Check whether painter's algorithm during drawing is enabled.

setEnabledPainters

public void setEnabledPainters(boolean aFlag)
Enable and disable painter's algorithm during drawing, i.e. a z-sort of drawing items.

isEnabledClip

public boolean isEnabledClip()
Check whether clipping with front and back plane is enabled.

setEnabledClip

public void setEnabledClip(boolean aFlag)
Enable and disable clipping with front and back plane.

isClip

public boolean isClip()
Deprecated. use #isEnabledClip

Check whether clipping with front and back plane is enabled.

enableClip

public void enableClip(boolean aFlag)
Deprecated. use #setEnabledClip

Enable and disable clipping with front and back plane.

getNearClip

public double getNearClip()
Get near clip distance of current camera. Returns a value even if clipping is disabled.

setNearClip

public void setNearClip(double dist)
Set near clip distance of current camera, works even if clipping is disabled.

getFarClip

public double getFarClip()
Get far clip distance of current camera. Returns a value even if clipping is disabled.

setFarClip

public void setFarClip(double dist)
Set far clip distance of current camera, works even if clipping is disabled.

getBackgroundColor

public java.awt.Color getBackgroundColor()
Get color of background of display. If background image is set, then color has no influence.

setBackgroundColor

public void setBackgroundColor(java.awt.Color aColor)
Set color of background of display. If background image is set, then color has no influence.

getForegroundColor

public java.awt.Color getForegroundColor()
Get foreground color. Currently neither defined nor used.

setForegroundColor

public void setForegroundColor(java.awt.Color aColor)
Set foreground color. Currently neither defined nor used.

getBackgroundImage

public java.awt.Image getBackgroundImage()
Get background image of display canvas.

setBackgroundImage

public void setBackgroundImage(java.awt.Image image)
Set background image of display canvas.

setBackgroundImage

public void setBackgroundImage(java.lang.String fileName)
Set background image of display canvas.
Parameters:
image - relative file name of image.

getCamera

public PvCameraIf getCamera()
Get current camera.

getCameras

public PvCameraIf[] getCameras()
Get set of registered cameras.

getCamera

public PvCameraIf getCamera(int type)
Get a camera object of given type if registered in display. Type is among PvDisplayIf#CAMERA_PERSPECTIVE, PvDisplayIf#CAMERA_ORTHO_XY, PvDisplayIf#CAMERA_ORTHO_XZ, PvDisplayIf#CAMERA_ORTHO_YZ, For a list of possible types see PvDisplayIf.

hasCamera

public boolean hasCamera(int type)
Determine whether a camera object of given type is registered in display. Type is among PvDisplayIf#CAMERA_PERSPECTIVE, PvDisplayIf#CAMERA_ORTHO_XY, PvDisplayIf#CAMERA_ORTHO_XZ, PvDisplayIf#CAMERA_ORTHO_YZ, For a list of possible types see PvDisplayIf.

selectCamera

public boolean selectCamera(int type)
Select camera from the list of installed camera to be current camera in the display. Type is among PvDisplayIf#CAMERA_PERSPECTIVE, PvDisplayIf#CAMERA_ORTHO_XY, PvDisplayIf#CAMERA_ORTHO_XZ, PvDisplayIf#CAMERA_ORTHO_YZ, For a list of possible types see PvDisplayIf.

removeCamera

public boolean removeCamera(int type)
Remove camera from the list of installed camera to be current camera in the display. Type is among PvDisplayIf#CAMERA_PERSPECTIVE, PvDisplayIf#CAMERA_ORTHO_XY, PvDisplayIf#CAMERA_ORTHO_XZ, PvDisplayIf#CAMERA_ORTHO_YZ, For a list of possible types see PvDisplayIf.

getCameraPanel

public PsPanel getCameraPanel()
Get info panel of current camera. Camera allocates panel if it does not exist.

getInfoPanel

public PsPanel getInfoPanel()
Get info panel of display. Display allocates panel if it does not exist.

getFrame

public java.awt.Frame getFrame()
Get reference to container frame of display, e.g. to allow display to hide/show frame.

setFrame

public void setFrame(java.awt.Frame frame)
Set reference to container frame of display, e.g. to allow display to hide/show frame.

getImage

public java.awt.Image getImage()
Get the rendered image of the scene.

getSize

public java.awt.Dimension getSize()
Get dimension with height and width of drawing canvas.

setSizeWithinFrame

public void setSizeWithinFrame(int width,
                               int height)
Set height and width of drawing canvas if canvas is inside a frame.

JavaView® v2.12

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