public class Ilv3DView extends JPanel implements GLEventListener
Ilv3DModel
.JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static Ilv3DFloatVector |
UP_VECTOR
The vector representing the vertical axis of the 3D model (that is, the
altitude axis).
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
Ilv3DView(Ilv3DModel model3D)
Constructs an
Ilv3DView that renders the specified
Ilv3DModel . |
Ilv3DView(Ilv3DModel model3D,
boolean useSwingJPanel)
Constructs an
Ilv3DView that renders the specified
Ilv3DModel . |
Modifier and Type | Method and Description |
---|---|
void |
display(GLAutoDrawable autoDrawable)
GLEventListener implementation.
|
void |
dispose(GLAutoDrawable drawable) |
protected void |
draw3DComponents(GL2 gl)
Renders 3D components of the associated
Ilv3DModel . |
protected void |
draw3DSymbols(GL2 gl)
Renders 3D symbols of the associated
Ilv3DModel . |
protected void |
drawTerrainTiles(GL2 gl)
Renders the terrain contained in the associated
Ilv3DModel . |
Ilv3DCoordinateConverter |
get3DCoordinateConverter()
Returns the
Ilv3DCoordinateConverter currently used by this
view. |
Ilv3DModel |
get3DModel()
Returns the
Ilv3DModel associated with this
Ilv3DView . |
Ilv3DCamera |
getCamera()
Returns the
Ilv3DCamera associated with this
Ilv3DView . |
Thread |
getCameraMovingThread()
Return the thread that moves the camera during a fly through.
|
Ilv3DViewControlUI |
getControlUI()
Returns the UI panel containing the settings for the appearance and the
performances of this
Ilv3DView . |
double |
getExaggeration()
Returns the height exaggeration factor of this view used to bring out the
relief of the terrain.
|
Component |
getGLComponent()
Returns the internal component used to draw GL objects.
|
double |
getLightElevationAngle()
Returns the light elevation angle, in radians, measured from the
horizontal plane.
|
double |
getLightOrientationAngle()
Returns the light horizontal orientation angle (that is, the azimuth), in
radians, measured from the north.
|
static int |
getMaximumSupportedTextureSize()
Returns the maximum supported size for textures, as returned by the
current OpenGL implementation.
|
int |
getTargetFrameRate()
Returns the desired frame rate.
|
float |
getTerrainPrecisionFactor()
Returns the terrain precision factor.
|
void |
init(GLAutoDrawable autoDrawable)
GLEventListener implementation.
|
boolean |
isBilinearFiltering()
Indicates that bilinear filtering is active.
|
boolean |
isContinuousRefresh()
Returns whether this view continously refreshes its content (at the
specified target frame rate), or refreshes only on calls to the
refresh() method. |
boolean |
isSmoothShading()
Returns whether the terrain is shaded using a Gouraud algorithm or not.
|
protected boolean |
isTileVisible(Ilv3DTile tile,
Ilv3DCamera camera1)
Computes whether the specified tile is visible given the specified camera
position.
|
boolean |
isUseLighting()
Returns whether this
Ilv3DView renders the terrain using
lighting or not. |
boolean |
isUseTexturing()
Returns whether this
Ilv3DView renders the terrain with
applied texture or not. |
boolean |
isWireFrameMode()
Returns whether this
Ilv3DView is rendered in wire frame
mode or not. |
void |
refresh()
Schedules a view redraw as soon as possible.
|
void |
registerFlyThrough(IlvMapLayer flyThoughLayer,
IlvFlyThroughAction action)
Registers or changes the fly through action to execute for the specified
map layer.
|
void |
resetCameraPosition()
Resets the camera position to the default location, that is, above the
terrain, looking at its center, and along its vertical axis.
|
void |
reshape(GLAutoDrawable autoDrawable,
int x,
int y,
int width,
int height)
GLEventListener implementation.
|
void |
set3DModel(Ilv3DModel model3D)
Sets the
Ilv3DModel to render. |
void |
setBilinearFiltering(boolean isBilinearFiltering)
Sets the state of bilinear filtering for this
Ilv3DView . |
void |
setCameraMovingThread(Thread thread)
Sets a thread that starts camera motion actions and then starts the
thread.
|
void |
setContinuousRefresh(boolean continuousRefresh)
Sets whether this view continuously refreshes its content (at the
specified target frame rate), or refreshes only on calls to the
refresh() method. |
void |
setHeightExaggeration(double exaggerationFactor)
Sets the height exaggeration factor of this view.
|
void |
setLightElevationAngle(double lightElevationAngle)
Sets the light elevation angle, in radians, measured from the horizontal
plane.
|
void |
setLightOrientationAngle(double lightOrientationAngle)
Sets the light horizontal orientation angle (that is, the azimuth), in
radians, measured from the north.
|
void |
setSmoothShading(boolean isSmoothShading)
Sets whether the terrain is shaded using a Gouraud algorithm or not.
|
void |
setTargetFrameRate(int targetFrameRate)
Sets the desired frame rate that this
Ilv3DView should try
to achieve. |
void |
setTerrainPrecisionFactor(float terrainPrecisionFactor)
Sets the terrain precision factor.
|
void |
setUseLighting(boolean isUseLighting)
Sets whether this
Ilv3DView renders the terrain using
lighting or not. |
void |
setUseTexturing(boolean isUseTexturing)
Sets whether this
Ilv3DView renders the terrain with applied
texture or not. |
void |
setWireFrameMode(boolean wireFrame)
Sets whether this
Ilv3DView is rendered in wire frame mode
or not. |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final Ilv3DFloatVector UP_VECTOR
public Ilv3DView(Ilv3DModel model3D)
Ilv3DView
that renders the specified
Ilv3DModel
.model3D
- The associated Ilv3DModel
to render.public Ilv3DView(Ilv3DModel model3D, boolean useSwingJPanel)
Ilv3DView
that renders the specified
Ilv3DModel
.model3D
- The associated Ilv3DModel
to render.useSwingJPanel
- sets whether this Ilv3DView
should render the 3D
scene in a lightweight Swing component.public void display(GLAutoDrawable autoDrawable)
display
in interface GLEventListener
GLEventListener.display(com.jogamp.opengl.GLAutoDrawable)
protected void drawTerrainTiles(GL2 gl)
Ilv3DModel
.gl
- The OpenGL context to render into.public void init(GLAutoDrawable autoDrawable)
init
in interface GLEventListener
GLEventListener.init(com.jogamp.opengl.GLAutoDrawable)
public void reshape(GLAutoDrawable autoDrawable, int x, int y, int width, int height)
reshape
in interface GLEventListener
GLEventListener.reshape(com.jogamp.opengl.GLAutoDrawable,
int, int, int, int)
protected void draw3DComponents(GL2 gl)
Ilv3DModel
.gl
- The OpenGL context to render into.protected void draw3DSymbols(GL2 gl)
Ilv3DModel
.gl
- The OpenGL context to render into.public Ilv3DModel get3DModel()
Ilv3DModel
associated with this
Ilv3DView
.Ilv3DModel
associated with this
Ilv3DView
.public Ilv3DCamera getCamera()
Ilv3DCamera
associated with this
Ilv3DView
. This Ilv3DCamera
is the eye point
through which the Ilv3DModel
is rendered.Ilv3DCamera
associated with this
Ilv3DView
.public Thread getCameraMovingThread()
cameraMovingThread
.public Component getGLComponent()
Ilv3DView
where OpenGL rendering is done.public Ilv3DViewControlUI getControlUI()
Ilv3DView
.Ilv3DViewControlUI
associated with this view.public Ilv3DCoordinateConverter get3DCoordinateConverter()
Ilv3DCoordinateConverter
currently used by this
view.Ilv3DCoordinateConverter
currently used by this
view to render the Ilv3DModel
.public double getExaggeration()
public int getTargetFrameRate()
Ilv3DView
should
try to achieve.public float getTerrainPrecisionFactor()
public boolean isBilinearFiltering()
Ilv3DView
.
If true
, the terrain texture should be filtered,
otherwise false
.protected boolean isTileVisible(Ilv3DTile tile, Ilv3DCamera camera1)
tile
- The Ilv3DTile
whose visibility is checked.camera1
- The Ilv3DCamera
through which the scene is
viewed.true
, the tile is visible through the camera,
otherwise false
.public boolean isWireFrameMode()
Ilv3DView
is rendered in wire frame
mode or not.true
, the whole scene is rendered in wire frame.public void registerFlyThrough(IlvMapLayer flyThoughLayer, IlvFlyThroughAction action)
Ilv3DViewControlUI
class contains a
Hashtable
containing the current fly through actions
attached to each registered map layer.flyThoughLayer
- Terrain analysis layer containing the fly through polyline and
style.action
- The action to be started.public void resetCameraPosition()
public void set3DModel(Ilv3DModel model3D)
Ilv3DModel
to render.model3D
- The Ilv3DModel
to render.public void setBilinearFiltering(boolean isBilinearFiltering)
Ilv3DView
.isBilinearFiltering
- If true
, the terrain texture should be filtered,
otherwise false
.public void setCameraMovingThread(Thread thread)
thread
- Camera Moving Thread.IllegalStateException
- if a thread is already set.public void setHeightExaggeration(double exaggerationFactor)
exaggerationFactor
- The height multiplication factor.public void setTargetFrameRate(int targetFrameRate)
Ilv3DView
should try
to achieve.targetFrameRate
- The desired frame rate for this Ilv3DView
.public void setTerrainPrecisionFactor(float terrainPrecisionFactor)
terrainPrecisionFactor
- The terrain precision factor.public void setWireFrameMode(boolean wireFrame)
Ilv3DView
is rendered in wire frame mode
or not.wireFrame
- If true
, the whole scene is rendered in wire
frame.public void refresh()
public static int getMaximumSupportedTextureSize()
public boolean isContinuousRefresh()
refresh()
method. This saves CPU time, but requires a manual
refresh of the view.true
, the view continuously refreshes its
content.public void setContinuousRefresh(boolean continuousRefresh)
refresh()
method. This saves CPU time, but requires a manual
refresh of the view.continuousRefresh
- If true
, the view continously refreshes its
content.public boolean isUseLighting()
Ilv3DView
renders the terrain using
lighting or not.true
, the terrain should be lit.public void setUseLighting(boolean isUseLighting)
Ilv3DView
renders the terrain using
lighting or not.isUseLighting
- If true
, the terrain should be lit.public boolean isUseTexturing()
Ilv3DView
renders the terrain with
applied texture or not.true
, the terrain is textured.public void setUseTexturing(boolean isUseTexturing)
Ilv3DView
renders the terrain with applied
texture or not.isUseTexturing
- If true
, the terrain is textured.public boolean isSmoothShading()
true
, the terrain is Gouraud shaded.public void setSmoothShading(boolean isSmoothShading)
isSmoothShading
- If true
, the terrain is Gouraud shaded, otherwise
it is flat shaded.public double getLightElevationAngle()
public void setLightElevationAngle(double lightElevationAngle)
lightElevationAngle
- The elevation angle in radians.public double getLightOrientationAngle()
public void setLightOrientationAngle(double lightOrientationAngle)
lightOrientationAngle
- The orientation angle in radians.public void dispose(GLAutoDrawable drawable)
dispose
in interface GLEventListener
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.