public class SceneControl extends Canvas implements IDisposable
一个三维场景窗口(SceneControl)对应一个三维场景(Scene),即一个三维场景窗口中只能显示一个三维场景。
三维场景控件是通过对三维模型的可视化表达,即以视觉化的形式将它们表现出来,可以为用户提供一些二维地图数据无法直接提供的信息。三维可视化广泛应用于医学、军事、地质、勘探等领域。在三维GIS中,三维数据可视化可以真实地表现空间数据、逼真地模拟仿真地理信息现实,进而可以直观地展现用户感兴趣的数据。
在三维窗口中,滚动鼠标滚轮,可以进行三维场景的放大或缩小的操作;按住鼠标滚轮进行上下拖动,可以对三维场景的进行倾斜操作,如果按住鼠标滚轮进行左右拖动,可以对三维场景进行旋转,另外,使用shift+光标键(上下光标键和左右光标键)也可以实现三维场景的倾斜和旋转操作。
注意:当用户使用该三维场景控件对象进行编程时,如果将 Workspace 与 SceneControl 建立了关联,那么在进行对象的关闭时,一定需要注意关闭的顺序,如下:
1、关闭scene 对象;
2、关闭SceneControl对象;
3、关闭Workspace对象。
限定符和类型 | 类和说明 |
---|---|
static class |
SceneControl.Cursors
该类为 SceneControl 类的内部类,主要提供三维场景窗口中的默认光标。
|
Component.BaselineResizeBehavior
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
构造器和说明 |
---|
SceneControl()
默认构造函数,构造一个新的
SceneControl 对象。 |
SceneControl(SceneType sceneType)
根据指定的sceneType构造一个新的SceneControl对象。
|
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
public SceneControl()
SceneControl
对象。public SceneControl(SceneType sceneType)
sceneType
- 指定的场景类型。public long get_mHandle()
public boolean isKeyboardNavigationEnabled()
public void setKeyboardNavigationEnabled(boolean value)
value
- 一个布尔值指定是否可以通过键盘进行导航漫游。public boolean isMouseNavigationEnabled()
该方法决定了三维场景控件在运行的时候是否通过鼠标来进行导航漫游。当本方法返回值为 true 的时候,用户可以使用鼠标左键进行上下左右的导航显示,使用鼠标右键进行放大和缩小的漫游显示。
public void setMouseNavigationEnabled(boolean value)
该方法决定了三维场景控件在运行的时候是否通过鼠标来进行导航漫游。当本方法返回值为 true 的时候,用户可以使用鼠标左键进行上下左右的导航显示,使用鼠标右键进行放大和缩小的漫游显示。
value
- 一个布尔值指定是否可以通过鼠标进行导航漫游。public void setInteractionMode(InteractionMode3D value)
通过该方法,可以实现在自定义鼠标、键盘的模式下与当前场景控件的交换操作。
value
- 当前三维场景控件的互操作模式。public InteractionMode3D getInteractionMode()
public boolean isWaitCursorEnabled()
public void setWaitCursorEnabled(boolean waitCursorEnabled)
waitCursorEnabled
- 当前场景窗口的等待光标是否有效。public boolean isCursorCustomized()
public void setCursorCustomized(boolean cursorCustomized)
cursorCustomized
- 当前场景控件的光标变化是否自定义。public boolean isAlwaysUpdate()
public void setAlwaysUpdate(boolean value)
value
- 一个布尔值,返回 true 时,表示失去焦点时不停止更新,返回 false时,表示失去焦时停止更新数据。public boolean isStatusBarVisible()
public void setStatusBarVisible(boolean value)
value
- 一个布尔值指定状态条是否可见。public boolean isFPSVisible()
public void setFPSVisible(boolean value)
value
- 三维场景控件的帧率信息是否可见。public int getLayerIDUnit()
public void setLayerIDUnit(int value)
value
- 2^value。public void setCameraZoomFactor(double value)
value
- 球面相机缩进倍率。IllegalStateException
- 当前对象已被释放。public double getCameraZoomFactor()
IllegalStateException
- 当前对象已被释放。public Action3D getAction()
Action3D
。Action3D.PAN
。public void setAction(Action3D value)
Action3D
。value
- 三维场景操作状态。public TrackMode3D getTrackMode3D()
public void setTrackMode3D(TrackMode3D mode3D)
public NavigationControl getNavigationControl()
NavigationControl
对象的默认值。public Layer3D[] getEditableLayers()
public Layer3D getActiveEditableLayer()
MapControl.isMultiLayerEditEnabled()
的返回值为 true),则当前可编辑图层的默认值为可编辑图层的第一个图层,对对象的绘制和粘贴操作只作用在该图层上,而非所有的可编辑图层上。public void setActiveEditableLayer(Layer3D layer3D)
MapControl.isMultiLayerEditEnabled()
的返回值为 true),则当前可编辑图层的默认值为可编辑图层的第一个图层,对对象的绘制和粘贴操作只作用在该图层上,而非所有的可编辑图层上。layer3D
- 设置当前可编辑的图层。public double getPanDatumPlane()
漫游观察三维场景中高空物体时,物体偏移角度会随着其离地面的高度而增大,通过设置基准面,使其以基准面为参考平面进行漫游,可以减小这种偏移,便于观察。
public void setPanDatumPlane(double value)
漫游观察三维场景中高空物体时,物体偏移角度会随着其离地面的高度而增大,通过设置基准面,使其以基准面为参考平面进行漫游,可以减小这种偏移,便于观察。
value
- 漫游基准面。单位为米。public void dispose()
dispose
在接口中 IDisposable
public void doKeyDown(KeyEvent e)
e
- 执行操作需要的参数。public void doKeyUp(KeyEvent e)
public void doMouseDown(MouseEvent e)
e
- 执行操作需要的参数。public void doMouseUp(MouseEvent e)
e
- 执行操作需要的参数。public void doMouseMove(MouseEvent e)
e
- 执行操作需要的参数。public void doMouseWheel(MouseWheelEvent e)
e
- 执行操作需要的参数。public boolean isDynamicSelection()
public void setDynamicSelection(boolean value)
value
- 指定是否动态高亮显示。public boolean isStatusBarShowAltitude()
public void setStatusBarShowAltitude(boolean value)
value
- 指定是否显示高度。public SnapMode3D getSnapMode()
public void setSnapMode(SnapMode3D value)
public boolean isAlwaysActive()
public void setAlwaysActive(boolean alwaysActive)
alwaysActive
- public void addTrackingListener(Tracking3DListener l)
Tracking3DEvent
)的监听器。
在三维场景窗口的跟踪图层中鼠标交互绘制几何对象时触发该三维场景窗口跟踪事件。
l
- 一个用于接收三维场景窗口的跟踪图层中鼠标交互绘制事件的监听器。public void removeTrackingListener(Tracking3DListener l)
Tracking3DEvent
)的监听器。
在三维场景窗口的跟踪图层中鼠标交互绘制几何对象时触发该三维场景窗口跟踪事件。
l
- 一个用于接收三维场景窗口的跟踪图层中鼠标交互绘制事件的监听器。public void addTrackedListener(Tracked3DListener l)
Tracked3DEvent
)的监听器。
在三维场景窗口的跟踪图层中鼠标交互绘制几何对象结束时触发该三维场景窗口跟踪事件。
l
- 一个用于接收三维场景窗口的跟踪图层中鼠标交互绘制结束事件的监听器。public void removeTrackedListener(Tracked3DListener l)
Tracked3DEvent
)的监听器。
在三维场景窗口的跟踪图层中鼠标交互绘制几何对象结束时触发该三维场景窗口跟踪事件。
l
- 一个用于接收三维场景窗口的跟踪图层中鼠标交互绘制结束事件的监听器。public void addActionChangedListener(Action3DChangedListener l)
public void removeActionChangedListener(Action3DChangedListener l)
public void addObjectSelectedListener(ObjectSelectedListener l)
ObjectSelectedEvent
)的监听器。l
- 一个用于接收对象被选中事件的监听器。public void removeObjectSelectedListener(ObjectSelectedListener l)
ObjectSelectedEvent
)的监听器。l
- 一个用于接收对象被选中事件的监听器。public void addLoadSceneListener(SceneLoadedListener l)
public void removeLoadSceneListener(SceneLoadedListener l)
public void addObjectSelectChangedListener(ObjectSelectChangedListener l)
public void removeObjectSelectChangedListener(ObjectSelectChangedListener l)
public void addmodelingObjectSelectdListener(ObjectSelectedListener l)
ObjectSelectedEvent
)的监听器。l
- 一个用于接收对象被选中事件的监听器。public void removemodelingObjectSelectdListener(ObjectSelectedListener l)
ObjectSelectedEvent
)的监听器。l
- 一个用于接收对象被选中事件的监听器。public void addmodelingObjectSelectChangedListener(ObjectSelectedListener l)
ObjectSelectedEvent
)的监听器。l
- 一个用于接收对象被选中事件的监听器。public void removemodelingObjectSelectChangedListener(ObjectSelectedListener l)
ObjectSelectedEvent
)的监听器。l
- 一个用于接收对象被选中事件的监听器。public void addObjectModifiedListener(ObjectModifiedListener l)
public void removeObjectModifiedListener(ObjectModifiedListener l)
public void addObjectSetVertexAddListener(ObjectSetVertexAddListener l)
public void removeObjectSetVertexAddListener(ObjectSetVertexAddListener l)
public void addObjectAddedListener(ObjectAddedListener l)
public void removeObjectAddedListener(ObjectAddedListener l)
public void addObjectDeletingListener(ObjectDeletingListener l)
public void addObjectDeletedListener(ObjectDeletedListener l)
public void removeObjectDeletingListener(ObjectDeletingListener l)
public void removeObjectDeletedListener(ObjectDeletedListener l)
public void addObjectModifyingListener(ObjectModifyingListener l)
public void removeObjectModifyingListener(ObjectModifyingListener l)
public void mouseWheelMoved(MouseWheelEvent e)
public void keyPressed(KeyEvent e)
public void keyReleased(KeyEvent e)
public void mouseDragged(MouseEvent e)
public void mousePressed(MouseEvent e)
public void mouseReleased(MouseEvent e)
@Deprecated public void SetActionGraphicObject3D(ActionGraphicObject action3D)
public void setActionGraphicObject3D(ActionGraphicObject action3D)
public ActionGraphicObject getActionGraphicObject3D()
Copyright © 2021–2024 SuperMap. All rights reserved.