|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Canvas
|
+--jv.viewer.PvDisplay
Display of JavaView for viewing and interaction with 3d geometries.
The display is subclass of an AWT canvas and fulfills the interface PvDisplayIf.
It may be included inside any Java containter with any layout manager.
A display may be obtained by three different ways:
PvViewer#getDisplay().
This mechanism avoids any need to connect the geometry of the current project or
viewer to the display.
Each class fulfilling the interface PvDisplayIf
can serve as a display in JavaView, e.g. the VRML export filter is an implementation
of this interface.
| Inner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
| Field Summary | |
protected static java.lang.String |
GEOM_AXES
Key identifying the special geometry axes. |
protected static java.lang.String |
GEOM_AXES_0
Key identifying the special geometry axes. |
protected static java.lang.String |
GEOM_AXES_1
Key identifying the special geometry axes. |
protected static java.lang.String |
GEOM_AXES_2
Key identifying the special geometry axes. |
protected static java.lang.String |
GEOM_BNDBOX
Key identifying the special geometry bounding box. |
protected static java.lang.String |
GEOM_FRAME
Key identifying the special geometry coordinate frame. |
protected static java.lang.String |
GEOM_XY_GRID
Key identifying the special geometry xy-grid. |
static int |
KEY_0
|
static int |
KEY_1
|
static int |
KEY_2
|
static int |
KEY_3
|
static int |
KEY_4
|
static int |
KEY_5
|
static int |
KEY_6
|
static int |
KEY_7
|
static int |
KEY_8
|
static int |
KEY_9
|
static int |
KEY_A
|
static int |
KEY_B
|
static int |
KEY_C
|
static int |
KEY_D
|
static int |
KEY_E
|
static int |
KEY_F
|
static int |
KEY_G
|
static int |
KEY_H
|
static int |
KEY_I
|
static int |
KEY_J
|
static int |
KEY_K
|
static int |
KEY_L
|
static int |
KEY_M
|
static int |
KEY_N
|
static int |
KEY_O
|
static int |
KEY_P
|
static int |
KEY_Q
|
static int |
KEY_R
|
static int |
KEY_S
|
static int |
KEY_T
|
static int |
KEY_U
|
static int |
KEY_V
|
static int |
KEY_W
|
static int |
KEY_X
|
static int |
KEY_Y
|
static int |
KEY_Z
|
protected int |
m_ambientProj
Projection from ambient space to R3 used in transformations of model. |
protected int |
m_ambientSpace
Ambient space used in transformations of model. |
protected PdColor |
m_backgroundColor
Background color of display canvas. |
java.lang.String |
m_backgroundImage
Background image for display. |
protected java.awt.Image |
m_backImage
Background image behind geometry. |
protected boolean |
m_bCentered
|
protected boolean |
m_bDrawing
Internal flag whether a thread is currently painting to display. |
protected boolean |
m_bEnableAnimation
Flag to enable auto-rotation. |
protected boolean |
m_bEnableSorting
Flag to enable depth sorting of elements for drawing. |
protected boolean |
m_bEnableTag
Flag to enable modification of tagged vertices and elements. |
protected boolean |
m_bEnableZBuffer
Flag to enable z-buffered drawing. |
protected boolean |
m_bFpsEnabled
true if measuring frames per second. |
protected boolean |
m_bIsEnabledUpdate
Flag determines whether update mechanism is enabled. |
protected boolean |
m_bMouseDown
Flag whether mouse has picked in the display. |
protected boolean |
m_bMouseInside
Flag whether mouse is currently inside the display. |
protected boolean |
m_bShowBackface
Flag to globally disable drawing faces whose normal points away from observer. |
protected boolean |
m_bShowBackImage
Flag to enable showing of a background image in display. |
protected boolean |
m_bShowDepthcue
Flag to enable drawing of items less intense if they are farther away from observer. |
protected boolean |
m_bShowEdgeAura
Flag to enable drawing of an aura around edges in background color. |
protected boolean |
m_bShowEdgesOnce
Flag to enable drawing of common face edges only once, requires neighbour information. |
protected boolean |
m_bShowGrid
Flag to enable showing of grid in xy-coordinate plane. |
protected boolean |
m_bTransformModel
Flag whether transformation of current model or camera is active. |
protected java.util.Hashtable |
m_camera
List of registered cameras. |
protected java.util.Vector |
m_cameraListener
List of camera listeners who will be notified when a camera event occurred. |
protected PsPanel |
m_cameraPanel
Info panel of camera, shared by different cameras. |
protected PvCamera |
m_currentCamera
Currently used camera in display. |
protected jv.viewer.PvGeometry |
m_currentGeom
Currently selected geometry container. |
protected java.awt.Dimension |
m_currLoc
Instance variables are 'int' |
protected double[] |
m_currNormLoc
Instance variables are 'double' |
java.lang.String |
m_defBackgroundImage
Default background image for display. |
protected int |
m_defModeMajor
Default major control mode, i.e. scale, shift, rot... |
protected static java.awt.Dimension |
m_defSize
Default height and width of display window, size of offscreen image. |
protected PdColor |
m_foregroundColor
Foreground color of overlay items such as coordinate axis. |
protected java.awt.Frame |
m_frame
Reference to container frame of display, e.g. to allow display to hide/show frame. |
protected PgGeometryIf |
m_geomIf
Associated geometry of currently selected geometry 'm_currentGeom'. |
protected PuInteger |
m_height
Height of display window, height of offscreen image. |
protected int |
m_imageFitMode
Mode determines how a background image is scaled w.r.t. display canvas. |
protected PsPanel |
m_infoPanel
Info panel of display. |
protected static java.lang.String[] |
m_majorModeMessage
Status message of modes available through PvDisplayIf. |
protected PiVector |
m_markBox
Selected rectangle in screen coordinates during mark-mode. |
protected java.awt.MenuItem[] |
m_menuItem
Array with popup menu items. |
protected static java.lang.String[] |
m_minorModeMessage
Status message of modes not available through PvDisplayIf. |
protected int |
m_mode
Control mode, i.e. scale, shift, rot... |
static int |
M_MODE_ADD
|
protected static int |
M_MODE_ADD_ELEMENT
Minor mode in display to add new elements to selected geometry. |
protected static int |
M_MODE_CENTER
|
static int |
M_MODE_DELETE
|
static int |
M_MODE_DISPLAY_PICK
|
static int |
M_MODE_DUPLICATE
|
protected static int |
M_MODE_FOCUS
|
static int |
M_MODE_HIGHLIGHT
|
static int |
M_MODE_INITIAL_PICK
|
static int |
M_MODE_MARK
|
static int |
M_MODE_MARK_ELEMENTS
|
static int |
M_MODE_ORBIT
|
static int |
M_MODE_PICK
|
protected static int |
M_MODE_RESET
|
static int |
M_MODE_SCALE
|
static int |
M_MODE_SCALE_RECT
|
protected static int |
M_MODE_START
|
protected static int |
M_MODE_STOP
|
static int |
M_MODE_TRANS
|
static int |
M_MODE_TRANS_Z
|
static int |
M_MODE_UNMARK
|
protected jv.viewer.PvModelCamera |
m_modelCamera
Camera used for modeling transformations of geometry. |
protected int |
m_modeMajor
Major control mode, i.e. scale, shift, rot... |
protected java.lang.String |
m_name
|
protected int |
m_nHeight
Height of display window, height of offscreen image. |
protected int |
m_nWidth
Width of display window, width of offscreen image. |
protected PsUpdateIf |
m_parent
|
protected PdVector |
m_pick
Pick coordinates of picking in screen coordinates (x,y): m_pick.set(x, y, 0., 1.). |
protected int |
m_pickedVertex
Index of picked vertex in global vertex array of current geometry. |
protected PvPickListenerIf |
m_pickFocus
Listener who has requested the pick focus to be the only receiver of pick events. |
protected java.util.Vector |
m_pickListener
List of pick listeners who will be notified when a pick event occurred. |
protected java.awt.PopupMenu |
m_popup
Popup menu to select mouse interaction mode like orbit, scale, translate etc. |
protected PvScene |
m_scene
Scene of display containing all geometries. |
protected int |
m_sceneFlags
Flags determining what is painted. |
protected PuInteger |
m_sleep
Sleeping period of auto-animation thread between two repaint(). |
protected java.util.Hashtable |
m_specialGeom
Hashtable contains all active special geometries such as bounding box, grid, or coordinate frame. |
protected static boolean |
M_SWITCH_DCUE
|
protected static boolean |
M_SWITCH_GRID
|
protected static boolean |
M_SWITCH_HIDD
|
protected java.lang.Thread |
m_thread
Thread created in auto-rotate mode. |
protected PvViewerIf |
m_viewer
|
protected PuInteger |
m_width
Width of display window, width of offscreen image. |
protected PdVector |
m_worldPick
4D world coordinates of hit during picking obtained from current hit point in screen coordinates by applying inverse of transformation matrix. |
protected static float |
PS_ZOOM
Zoom factor of each pixel quantity if PostScript printing is enabled. |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
PvDisplay()
Constructor of display without viewer as parent. |
|
PvDisplay(java.applet.Applet applet,
java.awt.Frame frame)
Constructor of display inside applet, or inside frame if applet is null. |
|
PvDisplay(PvViewerIf viewer)
Constructor of display with given argument viewer as parent. |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent event)
|
int |
addCamera(java.lang.String aName,
PvCamera aCamera)
Add new camera and make it accessible under the given name. |
void |
addCameraListener(PvCameraListenerIf listener)
Add camera listener to receive camera events PvCameraEvent. |
boolean |
addGeometry(PgGeometryIf aGeom)
Add geometry to display. |
void |
addPickListener(PvPickListenerIf listener)
Add pick listener to receive pick events PvPickEvent. |
void |
center()
Center geometry in window, do no scaling |
boolean |
containsGeometry(PgGeometryIf aGeom)
Check whether geometry is registered in display. |
void |
enableClip(boolean aFlag)
Deprecated. use #setEnabledClip |
protected void |
enableTransformModel(boolean aFlag)
Enable transformation of modeling matrix M of single geometry rather than transforming the whole scene by modifying project P and view V matrices. |
void |
fit()
Center and scale camera such that geometry fits exactly into window. |
protected PgGeometryIf[] |
getAllGeometries()
Get array with all geometries including registered and special geometries. |
protected jv.viewer.PvGeometry[] |
getAllGeometryContainers()
Get array with all geometry containers including registered and special geometries. |
int |
getAmbientProjection()
Get projection mode of ambient space used in model transformations. |
int |
getAmbientSpace()
Get ambient space used in model transformations. |
java.awt.Color |
getBackgroundColor()
Get color of background of display. |
java.awt.Image |
getBackgroundImage()
Make image of display available to outside world. |
java.lang.String |
getBackgroundImageFile()
Get filename of background image of display canvas. |
PvCameraIf |
getCamera()
Get current camera object. |
PvCamera |
getCamera(int type)
Get a camera object by type. |
PsPanel |
getCameraPanel()
Get info panel of current camera. |
protected int |
getCurrentCameraType()
Get type of current camera, for example, perspective, xy-projection etc. |
double |
getFarClip()
Get far clip distance of current camera. |
PsUpdateIf |
getFather()
Get father of display. |
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 array with registered geometries. |
protected jv.viewer.PvGeometry[] |
getGeometryContainers()
Get array with registered geometry containers. |
java.awt.Image |
getImage()
Make image of display available to outside world. |
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.awt.Dimension |
getMinimumSize()
Assure correct horizontal size of all project panels. |
java.lang.String |
getName()
Get name of this display. |
double |
getNearClip()
Get near clip distance of current camera. |
PvPickEvent |
getPickEvent(int x,
int y)
Find intersection of ray through pick locus on registered geometries. |
java.awt.Point |
getPosition(int xPos,
int yPos)
Get upper left corner of frame. |
java.awt.Dimension |
getPreferredSize()
Assure correct horizontal size of all project panels. |
PgGeometryIf |
getSelectedGeometry()
Get currently selected geometry. |
java.awt.Dimension |
getSize()
Get height of drawing canvas. |
PdMatrix |
getTransMatrix(int type)
Get 4*4 transformation matrix or components from current camera and display. |
protected int[][] |
getZBuffer()
Get z-buffer array with depth information of each pixel. |
boolean |
hasCameraListener(PvCameraListenerIf listener)
Check for a registered listener. |
boolean |
hasPaintTag(int flags)
Check whether either if the bits in parameter has been set. |
protected java.awt.Frame |
hasParentFrame()
Check whether display is embedded in a browser or a separate frame. |
boolean |
hasPickListener(PvPickListenerIf listener)
Check for a registered listener. |
boolean |
incrementAutoRotation()
Do a single increment of auto-rotation animaton. |
void |
init()
Initialize and reset dispay. |
boolean |
isClip()
Deprecated. use #isEnabledClip |
boolean |
isEnabledAnimation()
Check whether auto-rotation is enabled. |
boolean |
isEnabledClearScreen()
Check whether screen is cleared after each repaint. |
boolean |
isEnabledClip()
Check whether clipping with front and back plane is enabled. |
boolean |
isEnabledPainters()
Check whether painter's algorithm during drawing is enabled. |
boolean |
isEnabledTags()
Determine whether tag mode is enabled to move marked elements. |
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. |
protected boolean |
isTransformModel()
Check whether transformation of current model is active, i.e. of model matrix. |
void |
keyPressed(java.awt.event.KeyEvent event)
|
void |
keyReleased(java.awt.event.KeyEvent event)
|
void |
keyTyped(java.awt.event.KeyEvent event)
|
void |
mouseClicked(java.awt.event.MouseEvent event)
|
void |
mouseDragged(java.awt.event.MouseEvent event)
|
void |
mouseEntered(java.awt.event.MouseEvent event)
|
void |
mouseExited(java.awt.event.MouseEvent event)
|
void |
mouseMoved(java.awt.event.MouseEvent event)
|
void |
mousePressed(java.awt.event.MouseEvent event)
Do not react on popup events or other than left mouse clicks. |
void |
mouseReleased(java.awt.event.MouseEvent event)
|
protected static void |
normalizedCoordsFromViewport(double[] norm,
int x,
int y,
int width,
int height)
Convert mouse position (x,y) within the viewport = [0,width-1]x[0,height-1] to normalized coordinates such that left lower corner of window is (0,0) in pixel coordinates and it becomes the origin in normalized coordinates. |
void |
paint(java.awt.Graphics g)
Override Canvas.paint(g) to initiate redrawing of geometries. |
protected void |
paintGeom(java.awt.Graphics g)
Redraw geometries in the backscreen image buffer. |
void |
processMouseEvent(java.awt.event.MouseEvent event)
|
void |
releasePickFocus()
Release pick focus, i.e. to be the unique listener who receives pick events. |
boolean |
removeCamera(int type)
Remove camera from list of registered cameras. |
boolean |
removeCameraListener(PvCameraListenerIf listener)
Remove a registered listener from list of registered listeners. |
void |
removeGeometries()
Remove all geometries from list of registered geometries. |
boolean |
removeGeometry(PgGeometryIf aGeom)
Remove geometry from list of registered geometries. |
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. |
void |
resetTransformModel()
Reset model matrix of current model and modelCamera. |
protected void |
resetZBuffer()
Reset z-buffer to lowest integer height. |
void |
run()
Do the animation by incrementing the transformation matrix with the last action. |
boolean |
selectCamera(int type)
Select current camera used in dispay by id. |
boolean |
selectGeometry(PgGeometryIf aGeom)
Select geometry to be active and receive pick events. |
void |
setAmbientProjection(int mode)
Set projection mode of ambient space used in model transformations. |
void |
setAmbientSpace(int mode)
Set ambient space used in model transformations. |
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 anImage)
Set background image of display canvas. |
void |
setBackgroundImage(java.lang.String fileName)
Set filename of background image of display canvas. |
protected void |
setCurrentMajorMode(int mode)
|
static void |
setDefaultSize(java.awt.Dimension size)
Set default dimension of drawing canvas from outside. |
void |
setDrawingOrder(int order,
PgGeometryIf aGeom)
Choose z-order of geometry when drawn in display. |
void |
setEnabledAnimation(boolean aFlag)
Enable and disable auto-rotation of scene. |
void |
setEnabledClearScreen(boolean aFlag)
Enable clearing of screen after each repaint. |
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 |
setEnabledTags(boolean aFlag)
Enable and disable tag mode to move marked elements. |
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 mode)
Switch between interaction modes like rotating or scaling, usually done interactively. |
void |
setName(java.lang.String aName)
Set name of this display. |
void |
setNearClip(double dist)
Set near clip distance of current camera, works even if clipping is disabled. |
void |
setPaintTag(int flags,
boolean val)
Set all bits which are set in parameter. |
void |
setParent(PsUpdateIf father)
Set father of display which receives update events when current class has changed. |
void |
setPosition(int xPos,
int yPos)
Set position of upper left corner of frame from outside. |
void |
setSizeWithinFrame(int width,
int height)
Set dimension of display which is included in a parent frame. |
void |
setTransMatrix(int type,
PdMatrix mat)
Set transformation matrices PV, P, V and their inverses 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 animation by creating a new thread |
void |
stop()
Stop animation by stopping the thread. |
void |
update(java.awt.Graphics g)
Override Component.update(g) to initiate redrawing of geometries. |
boolean |
update(java.lang.Object event)
Handle update events sent to display by JavaView. |
protected void |
updateCameraListener(int state)
|
protected boolean |
updatePosition(int x,
int y)
Check whether current mouse position has changed and store new position. |
| Methods inherited from class java.awt.Canvas |
addNotify, getAccessibleContext |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getParent, getPeer, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jv.project.PvDisplayIf |
addKeyListener, getGraphics, removeKeyListener |
| Field Detail |
public static final int KEY_0
public static final int KEY_1
public static final int KEY_2
public static final int KEY_3
public static final int KEY_4
public static final int KEY_5
public static final int KEY_6
public static final int KEY_7
public static final int KEY_8
public static final int KEY_9
public static final int KEY_A
public static final int KEY_B
public static final int KEY_C
public static final int KEY_D
public static final int KEY_E
public static final int KEY_F
public static final int KEY_G
public static final int KEY_H
public static final int KEY_I
public static final int KEY_J
public static final int KEY_K
public static final int KEY_L
public static final int KEY_M
public static final int KEY_N
public static final int KEY_O
public static final int KEY_P
public static final int KEY_Q
public static final int KEY_R
public static final int KEY_S
public static final int KEY_T
public static final int KEY_U
public static final int KEY_V
public static final int KEY_W
public static final int KEY_X
public static final int KEY_Y
public static final int KEY_Z
public static final int M_MODE_ORBIT
public static final int M_MODE_SCALE
public static final int M_MODE_SCALE_RECT
public static final int M_MODE_TRANS
public static final int M_MODE_TRANS_Z
public static final int M_MODE_PICK
public static final int M_MODE_INITIAL_PICK
public static final int M_MODE_HIGHLIGHT
public static final int M_MODE_DISPLAY_PICK
public static final int M_MODE_MARK
public static final int M_MODE_MARK_ELEMENTS
public static final int M_MODE_UNMARK
public static final int M_MODE_ADD
public static final int M_MODE_DELETE
public static final int M_MODE_DUPLICATE
protected static final int M_MODE_ADD_ELEMENT
public java.lang.String m_defBackgroundImage
public java.lang.String m_backgroundImage
protected static final java.lang.String[] m_majorModeMessage
protected static final int M_MODE_RESET
protected static final int M_MODE_CENTER
protected static final int M_MODE_FOCUS
protected static final int M_MODE_START
protected static final int M_MODE_STOP
protected static final java.lang.String[] m_minorModeMessage
protected static final boolean M_SWITCH_GRID
protected static final boolean M_SWITCH_DCUE
protected static final boolean M_SWITCH_HIDD
protected boolean m_bMouseInside
protected boolean m_bMouseDown
protected java.lang.String m_name
protected boolean m_bIsEnabledUpdate
protected transient java.awt.Frame m_frame
protected transient PsUpdateIf m_parent
protected transient PvViewerIf m_viewer
protected java.util.Hashtable m_camera
protected PvCamera m_currentCamera
protected PsPanel m_cameraPanel
protected PsPanel m_infoPanel
protected PvScene m_scene
protected jv.viewer.PvGeometry m_currentGeom
protected PgGeometryIf m_geomIf
protected boolean m_bCentered
protected static final java.lang.String GEOM_AXES
protected static final java.lang.String GEOM_AXES_0
protected static final java.lang.String GEOM_AXES_1
protected static final java.lang.String GEOM_AXES_2
protected static final java.lang.String GEOM_BNDBOX
protected static final java.lang.String GEOM_FRAME
protected static final java.lang.String GEOM_XY_GRID
protected java.util.Hashtable m_specialGeom
protected int m_mode
protected int m_modeMajor
protected int m_defModeMajor
protected jv.viewer.PvModelCamera m_modelCamera
protected boolean m_bTransformModel
protected int m_ambientSpace
protected int m_ambientProj
protected transient java.util.Vector m_cameraListener
protected transient java.util.Vector m_pickListener
protected transient PvPickListenerIf m_pickFocus
protected int m_pickedVertex
protected PdVector m_pick
protected PiVector m_markBox
protected PdVector m_worldPick
protected java.awt.Dimension m_currLoc
protected double[] m_currNormLoc
protected int m_imageFitMode
protected transient java.awt.Image m_backImage
protected int m_nHeight
protected int m_nWidth
protected static java.awt.Dimension m_defSize
protected PuInteger m_height
protected PuInteger m_width
protected int m_sceneFlags
protected static float PS_ZOOM
m_bZoom is enabled.protected PdColor m_foregroundColor
protected PdColor m_backgroundColor
protected boolean m_bShowBackface
protected boolean m_bShowBackImage
protected boolean m_bShowDepthcue
protected boolean m_bShowEdgesOnce
protected boolean m_bShowEdgeAura
protected boolean m_bShowGrid
protected boolean m_bEnableSorting
protected boolean m_bEnableTag
protected boolean m_bEnableZBuffer
protected transient java.lang.Thread m_thread
protected boolean m_bEnableAnimation
protected boolean m_bDrawing
protected PuInteger m_sleep
protected boolean m_bFpsEnabled
true if measuring frames per second.protected transient java.awt.PopupMenu m_popup
protected transient java.awt.MenuItem[] m_menuItem
| Constructor Detail |
public PvDisplay()
public PvDisplay(PvViewerIf viewer)
viewer - parent of display to handle certain events like export.
public PvDisplay(java.applet.Applet applet,
java.awt.Frame frame)
applet - which is container of displayframe - which contains applet, or is container of display| Method Detail |
public void init()
PvDisplayIfinit in interface PvDisplayIfpublic java.lang.String getName()
getName in interface PvDisplayIfgetName in class java.awt.Componentpublic void setName(java.lang.String aName)
setName in interface PvDisplayIfsetName in class java.awt.Componentpublic java.awt.Frame getFrame()
getFrame in interface PvDisplayIfpublic void setFrame(java.awt.Frame frame)
setFrame in interface PvDisplayIfpublic void addPickListener(PvPickListenerIf listener)
PvPickEvent.addPickListener in interface PvDisplayIfPickListenerIf - hasPickListener(PvPickListenerIf),
removePickListener(PvPickListenerIf)public boolean hasPickListener(PvPickListenerIf listener)
hasPickListener in interface PvDisplayIfPickListenerIf - true if registered listener found.addPickListener(PvPickListenerIf),
removePickListener(PvPickListenerIf)public boolean removePickListener(PvPickListenerIf listener)
removePickListener in interface PvDisplayIfPickListenerIf - false if listener does not exists.addPickListener(PvPickListenerIf),
hasPickListener(PvPickListenerIf)public void addCameraListener(PvCameraListenerIf listener)
PvCameraEvent.addCameraListener in interface PvDisplayIfCameraListenerIf - false if same instance already registered.hasCameraListener(PvCameraListenerIf),
removeCameraListener(PvCameraListenerIf)public boolean hasCameraListener(PvCameraListenerIf listener)
hasCameraListener in interface PvDisplayIfCameraListenerIf - true if registered listener found.addCameraListener(PvCameraListenerIf),
removeCameraListener(PvCameraListenerIf)public boolean removeCameraListener(PvCameraListenerIf listener)
removeCameraListener in interface PvDisplayIfCameraListenerIf - false if listener does not exists.addCameraListener(PvCameraListenerIf),
hasCameraListener(PvCameraListenerIf)public void requestPickFocus(PvPickListenerIf listener)
requestPickFocus in interface PvDisplayIfPickListenerIf - releasePickFocus()public void releasePickFocus()
releasePickFocus in interface PvDisplayIfPickListenerIf - requestPickFocus(PvPickListenerIf)public boolean addGeometry(PgGeometryIf aGeom)
After the first geometry is added, the display performs a fit() operation to center and scale the camera such that the geometry is completely visible in the display.
The first geometry added to a display automatically becomes the
active geometry. After having added several geometries the active
geometry may be selected with selectGeometry().
Note, default drawing order is PvGeometryIf#DRAW_ORDER_STANDARD which means, that z-depth of geometry elements
are orderer in comparison with all other geometries. Except, if drawing order
is PvGeometryIf#DRAW_ORDER_FRONT or PvGeometryIf.DRAW_ORDER_BACK then
no comparison is done during display. Use method #setDrawingOrder(int, jv.project.PgGeometryIf) to modify the drawing order of
a geometry after it has been added to the display.
addGeometry in interface PvDisplayIfpublic void removeGeometries()
removeGeometries in interface PvDisplayIfpublic boolean removeGeometry(PgGeometryIf aGeom)
If the currently active geometry is removed, then the first geometry becomes active.
removeGeometry in interface PvDisplayIfpublic boolean selectGeometry(PgGeometryIf aGeom)
selectGeometry in interface PvDisplayIfpublic boolean containsGeometry(PgGeometryIf aGeom)
containsGeometry in interface PvDisplayIfprotected jv.viewer.PvGeometry[] getAllGeometryContainers()
protected jv.viewer.PvGeometry[] getGeometryContainers()
protected PgGeometryIf[] getAllGeometries()
public PgGeometryIf[] getGeometries()
getGeometries in interface PvDisplayIfpublic PgGeometryIf getSelectedGeometry()
getSelectedGeometry in interface PvDisplayIfpublic void center()
public void fit()
fit in interface PvDisplayIfpublic java.awt.Color getBackgroundColor()
getBackgroundColor in interface PvDisplayIfpublic void setBackgroundColor(java.awt.Color aColor)
setBackgroundColor in interface PvDisplayIfpublic java.awt.Color getForegroundColor()
getForegroundColor in interface PvDisplayIfpublic void setForegroundColor(java.awt.Color aColor)
setForegroundColor in interface PvDisplayIfpublic boolean isEnabledAnimation()
isEnabledAnimation in interface PvDisplayIfpublic void setEnabledAnimation(boolean aFlag)
setEnabledAnimation in interface PvDisplayIfpublic int getAmbientSpace()
public void setAmbientSpace(int mode)
public int getAmbientProjection()
public void setAmbientProjection(int mode)
protected boolean isTransformModel()
protected void enableTransformModel(boolean aFlag)
public void resetTransformModel()
public int getImageFitMode()
getImageFitMode in interface PvDisplayIfpublic void setImageFitMode(int mode)
setImageFitMode in interface PvDisplayIfpublic boolean isShowingBackImage()
isShowingBackImage in interface PvDisplayIfpublic void showBackImage(boolean aFlag)
showBackImage in interface PvDisplayIfpublic 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.isShowingDepthcue in interface PvDisplayIfpublic void showDepthcue(boolean aFlag)
showDepthcue in interface PvDisplayIfpublic boolean isShowingEdgesOnce()
isShowingEdgesOnce in interface PvDisplayIfpublic void showEdgesOnce(boolean aFlag)
showEdgesOnce in interface PvDisplayIfpublic boolean isShowingEdgeAura()
isShowingEdgeAura in interface PvDisplayIfpublic void showEdgeAura(boolean aFlag)
showEdgeAura in interface PvDisplayIf
public void setDrawingOrder(int order,
PgGeometryIf aGeom)
PvGeometryIf#DRAW_ORDER_STANDARD.setDrawingOrder in interface PvDisplayIfPvGeometryIfpublic boolean isShowingGrid()
isShowingGrid in interface PvDisplayIfpublic void showGrid(boolean aFlag)
showGrid in interface PvDisplayIfpublic boolean isShowingFrame()
isShowingFrame in interface PvDisplayIfpublic void showFrame(boolean aFlag)
showFrame in interface PvDisplayIfpublic boolean isShowingBndBox()
isShowingBndBox in interface PvDisplayIfpublic void showBndBox(boolean aFlag)
showBndBox in interface PvDisplayIfpublic boolean isEnabledClearScreen()
public void setEnabledClearScreen(boolean aFlag)
public boolean isShowingAxes()
isShowingAxes in interface PvDisplayIfpublic void showAxes(boolean aFlag)
showAxes in interface PvDisplayIfpublic boolean isShowingMagnet()
isShowingMagnet in interface PvDisplayIfpublic void showMagnet(boolean aFlag)
showMagnet in interface PvDisplayIfprotected int[][] getZBuffer()
protected void resetZBuffer()
public boolean isEnabledZBuffer()
isEnabledZBuffer in interface PvDisplayIfpublic void setEnabledZBuffer(boolean aFlag)
setEnabledZBuffer in interface PvDisplayIfpublic boolean isEnabledTags()
public void setEnabledTags(boolean aFlag)
public boolean isEnabledPainters()
isEnabledPainters in interface PvDisplayIfpublic void setEnabledPainters(boolean aFlag)
setEnabledPainters in interface PvDisplayIfpublic boolean isEnabledClip()
isEnabledClip in interface PvDisplayIfpublic void setEnabledClip(boolean aFlag)
setEnabledClip in interface PvDisplayIfpublic boolean isClip()
#isEnabledClip
isClip in interface PvDisplayIfpublic void enableClip(boolean aFlag)
#setEnabledClip
enableClip in interface PvDisplayIfpublic double getNearClip()
getNearClip in interface PvDisplayIfpublic void setNearClip(double dist)
setNearClip in interface PvDisplayIfpublic double getFarClip()
getFarClip in interface PvDisplayIfpublic void setFarClip(double dist)
setFarClip in interface PvDisplayIfpublic PdMatrix getTransMatrix(int type)
getTransMatrix in interface PvDisplayIfjv.project.PvDisplayIftype - Any matrix type jv.project.PvDisplayIf#MATRIX_...
public void setTransMatrix(int type,
PdMatrix mat)
Modeling matrix should be set in original geometry model.
setTransMatrix in interface PvDisplayIfjv.project.PvDisplayIftype - Any matrix type jv.project.PvDisplayIf#MATRIX_...
public int addCamera(java.lang.String aName,
PvCamera aCamera)
public PvCameraIf getCamera()
getCamera in interface PvDisplayIfprotected int getCurrentCameraType()
PvDisplayIf#CAMERA_PERSPECTIVE,
PvDisplayIf#CAMERA_ORTHO_XY,
PvDisplayIf#CAMERA_ORTHO_XZ,
PvDisplayIf#CAMERA_ORTHO_YZ,
For a list of possible type see PvDisplayIf.public PvCamera getCamera(int type)
PvDisplayIf#CAMERA_PERSPECTIVE,
PvDisplayIf#CAMERA_ORTHO_XY,
PvDisplayIf#CAMERA_ORTHO_XZ,
PvDisplayIf#CAMERA_ORTHO_YZ,
For a list of possible type see PvDisplayIf.type - of cameranull if argument out of bounds or camera not found.public boolean selectCamera(int type)
PvDisplayIf#CAMERA_PERSPECTIVE,
PvDisplayIf#CAMERA_ORTHO_XY,
PvDisplayIf#CAMERA_ORTHO_XZ,
PvDisplayIf#CAMERA_ORTHO_YZ,
For a list of possible type see PvDisplayIf.selectCamera in interface PvDisplayIftype - of camerafalse if type is outOfBounds.public boolean removeCamera(int type)
PvDisplayIf#CAMERA_PERSPECTIVE,
PvDisplayIf#CAMERA_ORTHO_XY,
PvDisplayIf#CAMERA_ORTHO_XZ,
PvDisplayIf#CAMERA_ORTHO_YZ,
For a list of possible type see PvDisplayIf.type - of cameratrue if camera was found and successfully removed.
public java.awt.Point getPosition(int xPos,
int yPos)
public void setPosition(int xPos,
int yPos)
public java.awt.Dimension getSize()
getSize in interface PvDisplayIfgetSize in class java.awt.Component
public void setSizeWithinFrame(int width,
int height)
#setSize(Dimension)
resp. #setSize(int, int).
Size of parent frame is the size of the display plus the its border margins.setSizeWithinFrame in interface PvDisplayIfwidth - width of display area, not of parent frameheight - height of display area, not of parent framepublic static void setDefaultSize(java.awt.Dimension size)
protected java.awt.Frame hasParentFrame()
public PsUpdateIf getFather()
getFather in interface PsUpdateIfjv.object.PsUpdateIfPsUpdateIf.setParent(PsUpdateIf),
PsUpdateIf.update(Object)public void setParent(PsUpdateIf father)
setParent in interface PsUpdateIfjv.object.PsUpdateIfaParent - will receive events which this does not handlePsUpdateIf.getFather(),
PsUpdateIf.update(Object)public boolean isEnabledUpdate()
isEnabledUpdate in interface PvDisplayIfpublic void setEnabledUpdate(boolean flag)
setEnabledUpdate in interface PvDisplayIfpublic boolean update(java.lang.Object event)
update in interface PvDisplayIfjv.object.PsUpdateIfevent - carries a lot of informationPsObject,
PsUpdateIf.getFather(),
PsUpdateIf.setParent(PsUpdateIf)public boolean hasPaintTag(int flags)
hasPaintTag in interface PvDisplayIfsetPaintTag(int, boolean)
public void setPaintTag(int flags,
boolean val)
jv.project.PvDisplayIf
for a list of possible flags.
Special flag for internal purpose is 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.
Setting flag PvDisplayIf#PAINT_ALL
invokes a repaint() of the display, just for convience.
setPaintTag in interface PvDisplayIfhasPaintTag(int)protected void paintGeom(java.awt.Graphics g)
public void paint(java.awt.Graphics g)
Canvas.paint(g) to initiate redrawing of geometries.paint in class java.awt.Canvaspublic void update(java.awt.Graphics g)
Component.update(g) to initiate redrawing of geometries.update in class java.awt.Componentpublic java.awt.Image getImage()
getImage in interface PvDisplayIfpublic java.awt.Image getBackgroundImage()
getBackgroundImage in interface PvDisplayIfpublic void setBackgroundImage(java.awt.Image anImage)
setBackgroundImage in interface PvDisplayIfpublic java.lang.String getBackgroundImageFile()
public void setBackgroundImage(java.lang.String fileName)
setBackgroundImage in interface PvDisplayIffileName - relative file name of image.
protected static void normalizedCoordsFromViewport(double[] norm,
int x,
int y,
int width,
int height)
Usage:
public boolean mouseDrag(Event event, int x, int y) {
normalizedCoordsFromViewport(normPosition, x, y, width, height);
protected boolean updatePosition(int x,
int y)
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListenerpublic void processMouseEvent(java.awt.event.MouseEvent event)
processMouseEvent in class java.awt.Componentpublic void mousePressed(java.awt.event.MouseEvent event)
mousePressed in interface java.awt.event.MouseListenerprotected void updateCameraListener(int state)
state - current state of mouse using MOUSE_PICKED, MOUSE_DRAGGEDpublic void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseReleased(java.awt.event.MouseEvent event)
mouseReleased in interface java.awt.event.MouseListener
public PvPickEvent getPickEvent(int x,
int y)
public void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void mouseEntered(java.awt.event.MouseEvent event)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent event)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseClicked(java.awt.event.MouseEvent event)
mouseClicked in interface java.awt.event.MouseListenerpublic int getMajorMode()
PvDisplayIfgetMajorMode in interface PvDisplayIfpublic void setMajorMode(int mode)
PvDisplayIfsetMajorMode in interface PvDisplayIfprotected void setCurrentMajorMode(int mode)
public void keyTyped(java.awt.event.KeyEvent event)
keyTyped in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent event)
keyReleased in interface java.awt.event.KeyListenerpublic void keyPressed(java.awt.event.KeyEvent event)
keyPressed in interface java.awt.event.KeyListenerpublic PsPanel getInfoPanel()
getInfoPanel in interface PvDisplayIfpublic PsPanel getCameraPanel()
getCameraPanel in interface PvDisplayIfpublic java.awt.Dimension getMinimumSize()
getMinimumSize in class java.awt.Componentpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class java.awt.Componentpublic void start()
start in interface PvDisplayIfpublic void stop()
stop in interface PvDisplayIf
public void setAutoRotation(PdVector axis,
double angle)
setAutoRotation in interface PvDisplayIfpublic boolean incrementAutoRotation()
incrementAutoRotation in interface PvDisplayIfpublic void run()
run in interface java.lang.Runnable
|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||