|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.analyst3d.SceneGraph
public class SceneGraph
A container for recording data and events that occur in a scene.
SceneGraph is to Scene what MapDisplay is to Map. It's associated with a Scene object, either in ArcScene or in a scene viewer control (or a later version scene control). It handles most of the 3D rendering operations and makes the drawing more efficient.
Constructor Summary | |
---|---|
SceneGraph()
Constructs a SceneGraph using ArcGIS Engine. |
|
SceneGraph(Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. SceneGraph theSceneGraph = (SceneGraph) obj; |
Method Summary | |
---|---|
short |
addCache()
Creates a new cache and return its ID. |
void |
addFlashFeature(IGeometry pGeometry)
Adds a feature shape to the flash list. |
void |
addISceneGraphEventsDispListener(ISceneGraphEventsDisp theListener)
addISceneGraphEventsDispListener. |
void |
addISceneGraphEventsListener(ISceneGraphEvents theListener)
addISceneGraphEventsListener. |
void |
addITimeDisplayEventsListener(ITimeDisplayEvents theListener)
addITimeDisplayEventsListener. |
void |
addSimpleActor(ISceneRenderer pRecorder,
IGeoDataset pGeoDataset)
Constructs a simple actor (layer visualization subgraph). |
void |
addSimpleGraphics(ISceneRenderer pRecorder)
Constructs a simple graphics node. |
void |
afterDraw(IActiveViewEventsAfterDrawEvent theEvent)
Fired after the specified phase is drawn. |
void |
afterItemDraw(IActiveViewEventsAfterItemDrawEvent theEvent)
Fired after an individual view item is drawn. |
void |
beginCompositeActor(ICompositeLayer pGroupLayer)
Creates a composite layer node and notifies the scene graph that subsequent actors must be added as children. |
void |
clear(boolean bKeepBasicGraph)
Resets the scene graph. |
void |
contentsChanged(IActiveViewEventsContentsChangedEvent theEvent)
Fired when the contents of the view changes. |
void |
contentsCleared(IActiveViewEventsContentsClearedEvent theEvent)
Fired when the contents of the view is cleared. |
void |
doScroll(int xDelta,
int yDelta,
boolean updateScreen)
Scrolls the screen by the specified amount. |
void |
drawCache(int hDC,
short index,
tagRECT deviceRect,
tagRECT cacheRect)
Draws the specified screen cache to the specified window device context. |
void |
drawMultipoint(IGeometry multipoint)
Draws specified multipoint on the display. |
void |
drawPoint(IGeometry point)
Draws specified point on the display. |
void |
drawPolygon(IGeometry polygon)
Draws specified polygon on the display. |
void |
drawPolyline(IGeometry polyline)
Draws specified line on the display. |
void |
drawRectangle(IEnvelope rectangle)
Draws specified rectangle on the display. |
void |
drawText(IGeometry shape,
String text)
Draws specified text on the display. |
void |
endCompositeActor()
Notifies the scene graph that the definition of a group layer has ended. |
void |
enumConnectionPoints(IEnumConnectionPoints[] ppEnum)
enumConnectionPoints |
boolean |
equals(Object o)
Compare this object with another |
void |
findConnectionPoint(GUID riid,
IConnectionPoint[] ppCP)
findConnectionPoint |
ISceneViewer |
findViewer(String caption)
Finds the Viewer. |
void |
finishDrawing()
Completes drawing. |
void |
finishFeedback()
Ends feedback drawing. |
void |
flashFeatures()
Redraws viewers flashing the features in the flash list. |
void |
flashGeometry(Object pOwner,
Object feature)
Flashes a feature shape. |
void |
flashLocation(IPoint pGeometry)
Redraws viewers flashing the given location. |
void |
focusMapChanged(IActiveViewEventsFocusMapChangedEvent theEvent)
Fired when a new map is made active. |
void |
frameScrolled(int x,
int y)
Call on frame display when container is scrolled. |
short |
getActiveCache()
Screen cache where drawing occurs. |
ISceneViewer |
getActiveViewer()
The active viewer. |
IArray |
getAllViewers()
Returns all registered Viewers. |
void |
getBackgroundColor(float[] pRed,
float[] pGreen,
float[] pBlue)
Returns the background color. |
int |
getBackgroundRGB()
The RGB value of the background color. |
short |
getCacheCount()
Number of screen caches. |
int |
getCacheMemDC(short index)
Memory device context for the specified screen cache. |
ITrackCancel |
getCancelTracker()
Cancel tracker that is associated with the display. |
IEnvelope |
getClipEnvelope()
The bounds of the invalid region. |
ISet |
getClipEnvelopes()
The invalid region as a set of envelopes. |
IGeometry |
getClipGeometry()
User-specified clip shape. |
static String |
getClsid()
getClsid. |
int |
getContrast()
The contrast coefficient. |
IDisplayTransformation |
getDisplayTransformation()
The transformation used by the display. |
void |
getDrawingOffset(int[] x,
int[] y)
The offset between the device origin and the active cache origin. |
void |
getDrawingTimeInfo(double[] pLastFrameDuration,
double[] pMeanFrameRate)
Returns the duration in seconds of last redraw and the average number of frames per second. |
IEnvelope |
getExtent()
The extent of the scene graph content. |
IDisplayFilter |
getFilter()
Display filter. |
IEnvelope |
getGeographySelectionExtent()
The volumetric bounding box of selected features. |
int |
getHDC()
The device context that the display is currently drawing to. |
int |
getHPalette()
Palette. |
int |
getHWnd()
Associated window handle. |
IIlluminationProps |
getIlluminationProps()
Illumination properties used by the display. |
void |
getMaxTextureSize(int[] pMaxTextureWidth,
int[] pMaxTextureHeight)
The limit for the size of a single texture. |
IEnvelope |
getOwnerExtent(Object pOwner,
boolean bSelectionOnly)
The full or selected extent of a layer. |
void |
getOwnerSymbols(Object pOwner,
IArray[] ppSymbols,
ILongArray[] ppDisplayListIDs)
Returns an array containing all symbols used in a layer and their corresponding display list identifications. |
void |
getOwnerTransparency(Object pObject,
int[] pTranspPercent)
Get the transparency percentage of an owner as stored in the scene graph. |
IScene |
getScene()
The scene. |
int |
getScreenPickTolerance()
The tolerance in pixels used when picking. |
IColor |
getSelectionColor()
The selection color. |
IVector3D |
getSunVector()
The sun vector. |
float |
getSymbolScale()
The scale for point size and line width of symbols. |
double |
getVerticalExaggeration()
The vertical exaggeration factor. |
int |
getWindowDC()
Device context for the associated window. |
int |
hashCode()
the hashcode for this object |
void |
interfaceSupportsErrorInfo(GUID riid)
interfaceSupportsErrorInfo |
void |
invalidate(IEnvelope rect,
boolean erase,
short cacheIndex)
Cause the specified area of the specified cache to redraw. |
void |
invalidate(Object pObject,
boolean bInvalidateGeography,
boolean bInvalidateSelection)
Invalidates acts representing an object. |
boolean |
isCacheDirty(short cacheIndex)
Indicates if the specified cache needs refreshing. |
boolean |
isEmpty()
Indicates if the content of the scene graph is empty. |
boolean |
isFirstCacheTransparent()
Indicates if the bottom cache is transparent. |
boolean |
isFramed()
Indicates if drawing occurs in a frame rather than on the whole window. |
boolean |
isGestureEnabled()
Indicates if the mouse gestures are supported. |
boolean |
isImmediateMode()
Indicates if immediate-mode rendering for the whole scene is being used. |
boolean |
isNavigating()
Indicates if the scene graph is in navigation mode. |
boolean |
isRecordingMessageEnabled()
Indicates if the scene graph provides visual feedback during recording. |
boolean |
isScaleContents()
Indicates if the contents of the screen scale when a resize occurs. |
boolean |
isSuppressEvents()
Indicates if display object suppresses events. |
boolean |
isSuppressResize()
Indicates if display resizing is suppressed. |
boolean |
isUseScrollbars()
Indicates if scrollbars should appear. |
void |
itemAdded(IActiveViewEventsItemAddedEvent theEvent)
Fired when an item is added to the view. |
void |
itemDeleted(IActiveViewEventsItemDeletedEvent theEvent)
Fired when an item is deleted from the view. |
void |
itemReordered(IActiveViewEventsItemReorderedEvent theEvent)
Fired when a view item is reordered. |
void |
locate(ISceneViewer pViewer,
int x,
int y,
int mode,
boolean bGetTransformed,
IPoint[] ppPt,
Object[] ppOwner,
Object[] ppObject)
Locates a single object. |
void |
locateMultiple(ISceneViewer pViewer,
int x,
int y,
int mode,
boolean bGetTransformed,
IHit3DSet[] ppHits)
Locates multiple objects. |
void |
lockViewers(boolean lock)
Locks the viewer cameras in position. |
void |
panMoveTo(IPoint mouseLocation)
Pans to a new point. |
void |
panStart(IPoint mouseLocation)
Prepares display for panning. |
IEnvelope |
panStop()
Stops panning and returns new visible bounds. |
void |
progress(int vertexCount)
Call frequently during drawing process. |
void |
putMaxTextureSize(int maxTextureWidth,
int maxTextureHeight)
The limit for the size of a single texture. |
void |
recordSymbol(ISymbol pSymbol,
int glList,
boolean bIsExtruded,
boolean bLighting,
int layerTransparencyPercent,
boolean bOptimizeState)
Creates the display list with the given identification for the symbol and its extrusion state (for points and lines). |
void |
refreshViewers()
Redraws all viewers. |
void |
registerViewer(ISceneViewer pViewer)
Adds a viewer to the scene graph. |
void |
remove(Object pObject,
boolean bUpdateExtent)
Removes actors representing an object. |
void |
removeAllCaches()
Removes all caches. |
void |
removeCache(short cacheID)
Removes the specified cache. |
void |
removeISceneGraphEventsDispListener(ISceneGraphEventsDisp theListener)
removeISceneGraphEventsDispListener. |
void |
removeISceneGraphEventsListener(ISceneGraphEvents theListener)
removeISceneGraphEventsListener. |
void |
removeITimeDisplayEventsListener(ITimeDisplayEvents theListener)
removeITimeDisplayEventsListener. |
void |
replayFrame(ICamera camera)
Uses the camera to redraw a frame. |
void |
rotateMoveTo(IPoint pPoint)
Rotates to new point. |
void |
rotateStart(IPoint mousePt,
IPoint centerPt)
Prepares display for rotating. |
double |
rotateStop()
Stops rotating and returns new angle. |
void |
rotateTimer()
Draws the rotated display. |
void |
selectionChanged(IActiveViewEventsSelectionChangedEvent theEvent)
Call this function to fire the selection changed event. |
void |
selectionChanged(ISceneRendererEventsSelectionChangedEvent theEvent)
Fired when the selection is changed. |
void |
setActiveCache(short index)
Screen cache where drawing occurs. |
void |
setActiveViewerByRef(ISceneViewer ppViewer)
The active viewer. |
void |
setBackgroundColor(float red,
float green,
float blue)
Sets the background color. |
void |
setBackgroundRGB(int rGB)
The RGB value of the background color. |
void |
setCancelTrackerByRef(ITrackCancel cancelTracker)
Cancel tracker that is associated with the display. |
void |
setClipGeometry(IGeometry geometry)
User-specified clip shape. |
void |
setContrast(int pContrast)
The contrast coefficient. |
void |
setDisplayTransformation(IDisplayTransformation displayTransformation)
The transformation used by the display. |
void |
setFilterByRef(IDisplayFilter filter)
Display filter. |
void |
setGestureEnabled(boolean pbEnabled)
Indicates if the mouse gestures are supported. |
void |
setHPalette(int hPalette)
Palette. |
void |
setHWnd(int hWnd)
Associated window handle. |
void |
setIlluminationProps(IIlluminationProps illuminationProps)
Illumination properties used by the display. |
void |
setImmediateMode(boolean pbIsAllImmediate)
Indicates if immediate-mode rendering for the whole scene is being used. |
void |
setIsFirstCacheTransparent(boolean flag)
Indicates if the bottom cache is transparent. |
void |
setIsFramed(boolean flag)
Indicates if drawing occurs in a frame rather than on the whole window. |
void |
setIsNavigating(boolean pbIsNavigating)
Indicates if the scene graph is in navigation mode. |
void |
setIsRecordingMessageEnabled(boolean pbIsEnabled)
Indicates if the scene graph provides visual feedback during recording. |
void |
setOwnerDepthPriority(Object pObject,
short depthPriority)
Sets the depth offset of layers. |
void |
setOwnerExtrusion(Object pObject,
boolean rhs2)
The scene graph information about a layer extrusion. |
void |
setOwnerFaceCulling(Object pObject,
int cullingMode)
Sets retained or immediate mode for the owner. |
void |
setOwnerImmediateMode(Object pObject,
boolean bIsLayerImmediate)
Sets retained or immediate mode for the owner. |
void |
setOwnerLightingOption(Object pObject,
boolean lighting)
Sets the lighting state of layers. |
void |
setOwnerNavigationVisibility(Object pObject,
boolean visibleWhenNavigating,
boolean visibleWhenStill)
Sets the visibility of layers depending on navigating state. |
void |
setOwnerShadingMode(Object pObject,
boolean bIsSmooth)
Sets the shading mode (smooth or flat) of layers. |
void |
setOwnerTimeThreshold(Object pObject,
double timeThreshold)
Sets the time threshold to use lowest level of detail in layers when navigating. |
void |
setOwnerTransparencyState(Object pObject,
boolean bIsTransparent)
Sets transparency enabling flag for the owner. |
void |
setOwnerVisibility(Object pObject,
boolean visible)
Sets the visibility of acts representing an object. |
void |
setScaleContents(boolean flag)
Indicates if the contents of the screen scale when a resize occurs. |
void |
setSceneByRef(IScene pVal)
The scene. |
void |
setScreenPickTolerance(int pixels)
The tolerance in pixels used when picking. |
void |
setScrollbarHandles(int hWndHorzScrollbar,
int hWndVertScrollbar)
Optionally specify application supplied scrollbars. |
void |
setSelectionColorByRef(IColor pSelectionColor)
The selection color. |
void |
setSunVector(IVector3D ppSun)
The sun vector. |
void |
setSuppressEvents(boolean suppressEvents)
Indicates if display object suppresses events. |
void |
setSuppressResize(boolean suppressResize)
Indicates if display resizing is suppressed. |
void |
setSymbol(ISymbol sym)
Sets the symbol used for drawing. |
void |
setSymbolScale(float scale)
The scale for point size and line width of symbols. |
void |
setUseScrollbars(boolean flag)
Indicates if scrollbars should appear. |
void |
setVerticalExaggeration(double pZFactor)
The vertical exaggeration factor. |
void |
spatialReferenceChanged(IActiveViewEventsSpatialReferenceChangedEvent theEvent)
Fired when the spatial reference is changed. |
void |
startDrawing(int hDC,
short cacheID)
Prepare the display for drawing. |
void |
startFeedback()
Prepare the display for drawing selection/rubberbanding. |
void |
startRecording()
Starts recording all output to the recording cache. |
void |
stopRecording()
Stops recording to the recording cache. |
void |
trackPan()
Interactively pans the screen. |
void |
trackRotate()
Interactively rotates the screen. |
void |
unregisterViewer(ISceneViewer pViewer)
Removes a viewer from the scene graph. |
void |
updateWindow()
Forces a redraw. |
void |
validate(short cacheIndex)
Clear dirty flag for specified cache. |
void |
viewRefreshed(IActiveViewEventsViewRefreshedEvent theEvent)
Fired when view is refreshed before draw happens. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef |
---|
getJintegraDispatch, release |
Constructor Detail |
---|
public SceneGraph() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic SceneGraph(Object obj) throws IOException
SceneGraph theSceneGraph = (SceneGraph) obj;
obj
to SceneGraph
.
obj
- an object returned from ArcGIS Engine or Server
IOException
- if there are interop problemsMethod Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void addISceneGraphEventsDispListener(ISceneGraphEventsDisp theListener) throws IOException
theListener
- An object that implements the com.esri.arcgis.analyst3d.ISceneGraphEventsDisp interface.
IOException
- If there are communications problems.public void removeISceneGraphEventsDispListener(ISceneGraphEventsDisp theListener) throws IOException
theListener
- An object that implements the com.esri.arcgis.analyst3d.ISceneGraphEventsDisp interface.
IOException
- If there are communications problems.public void addISceneGraphEventsListener(ISceneGraphEvents theListener) throws IOException
theListener
- An object that implements the com.esri.arcgis.analyst3d.ISceneGraphEvents interface.
IOException
- If there are communications problems.public void removeISceneGraphEventsListener(ISceneGraphEvents theListener) throws IOException
theListener
- An object that implements the com.esri.arcgis.analyst3d.ISceneGraphEvents interface.
IOException
- If there are communications problems.public void addITimeDisplayEventsListener(ITimeDisplayEvents theListener) throws IOException
theListener
- An object that implements the com.esri.arcgis.display.ITimeDisplayEvents interface.
IOException
- If there are communications problems.public void removeITimeDisplayEventsListener(ITimeDisplayEvents theListener) throws IOException
theListener
- An object that implements the com.esri.arcgis.display.ITimeDisplayEvents interface.
IOException
- If there are communications problems.public void contentsChanged(IActiveViewEventsContentsChangedEvent theEvent) throws IOException, AutomationException
The Map object fires this event when a new document is loaded. Adding a new layer to a Map does not trigger this event.
The PageLayout object fires the event when IGraphicsContainer::DeleteAllElements in called and when a new document is loaded.
contentsChanged
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IActiveView.contentsChanged()
public void contentsCleared(IActiveViewEventsContentsClearedEvent theEvent) throws IOException, AutomationException
contentsCleared
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void itemAdded(IActiveViewEventsItemAddedEvent theEvent) throws IOException, AutomationException
The Map fires the event every time a new layer is added.
The PageLayout fires this event whenever a new element is added to the layout. Elements include not only graphics but data frames as well.
itemAdded
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void itemDeleted(IActiveViewEventsItemDeletedEvent theEvent) throws IOException, AutomationException
The PageLayout object fires this event whenever elements are deleted from the layout.
The Map object fires this event when a layer is removed.
itemDeleted
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void itemReordered(IActiveViewEventsItemReorderedEvent theEvent) throws IOException, AutomationException
The Map objects only fire this event whenever IMap::MoveLayer is called. In the ArcMap application, this occurs when you reorder layers in the table of contents. The Map will also fire this event when new layers are added.
The PageLayout object fires this event when changing the order of graphics. For example, IGraphicsContainer::BringToFront, PutElementOrder, SendToBack, SendBackward, and BringForward all fire this event. These functions are on ArcMap's Drawing menu under the Order pull right menu. Although the Map object is also a graphics container, it does not fire this event when its graphics are reordered.
itemReordered
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void selectionChanged(IActiveViewEventsSelectionChangedEvent theEvent) throws IOException, AutomationException
selectionChanged
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void viewRefreshed(IActiveViewEventsViewRefreshedEvent theEvent) throws IOException, AutomationException
Method that gets fired in response to IActiveView::Refresh and IActiveView::PartialRefresh.
This event is useful in the case where you're watching for something to change in the view and there aren't any specific events for that change (e.g. ContentsChanged, ItemAdded). You can always listen for this method as a last resort. Care must be taken however to be very efficient in your implementation of this event because it will be called quite often.
The event parameters directly coincide with the arguments to IActiveView::PartialRefresh. For additional information about the arguments, see the help for that method.
If the event object connects to both the layout and a map, then the view parameter tells you which object initiated the event.
In an implementation of this method you typically want to check the phase and respond to only one. Otherwise, your code will execute multiple times per drawing sequence.
viewRefreshed
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void afterDraw(IActiveViewEventsAfterDrawEvent theEvent) throws IOException, AutomationException
afterDraw
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void afterItemDraw(IActiveViewEventsAfterItemDrawEvent theEvent) throws IOException, AutomationException
AfterItemDraw can be used to execute after each individual item has drawn. Event firing can be an expensive operation (time consuming) when there are many layers in a map, however. As a result, the AfterItemDraw event is only fired when the IViewManger::VerboseEvents property is set to True. By default this property is False.
afterItemDraw
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void focusMapChanged(IActiveViewEventsFocusMapChangedEvent theEvent) throws IOException, AutomationException
focusMapChanged
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void spatialReferenceChanged(IActiveViewEventsSpatialReferenceChangedEvent theEvent) throws IOException, AutomationException
spatialReferenceChanged
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void selectionChanged(ISceneRendererEventsSelectionChangedEvent theEvent) throws IOException, AutomationException
selectionChanged
in interface ISceneRendererEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IScene getScene() throws IOException, AutomationException
getScene
in interface ISceneGraph
getScene
in interface IViewers3D
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSceneByRef(IScene pVal) throws IOException, AutomationException
setSceneByRef
in interface ISceneGraph
setSceneByRef
in interface IViewers3D
pVal
- A reference to a com.esri.arcgis.analyst3d.IScene (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isEmpty() throws IOException, AutomationException
isEmpty
in interface ISceneGraph
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addSimpleGraphics(ISceneRenderer pRecorder) throws IOException, AutomationException
addSimpleGraphics
in interface ISceneGraph
pRecorder
- A reference to a com.esri.arcgis.analyst3d.ISceneRenderer (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addSimpleActor(ISceneRenderer pRecorder, IGeoDataset pGeoDataset) throws IOException, AutomationException
addSimpleActor
in interface ISceneGraph
pRecorder
- A reference to a com.esri.arcgis.analyst3d.ISceneRenderer (in)pGeoDataset
- A reference to a com.esri.arcgis.geodatabase.IGeoDataset (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void beginCompositeActor(ICompositeLayer pGroupLayer) throws IOException, AutomationException
beginCompositeActor
in interface ISceneGraph
pGroupLayer
- A reference to a com.esri.arcgis.carto.ICompositeLayer (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void endCompositeActor() throws IOException, AutomationException
endCompositeActor
in interface ISceneGraph
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void remove(Object pObject, boolean bUpdateExtent) throws IOException, AutomationException
remove
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)bUpdateExtent
- The bUpdateExtent (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void invalidate(Object pObject, boolean bInvalidateGeography, boolean bInvalidateSelection) throws IOException, AutomationException
The Invalidate method of the SceneGraph is used to ensure a full re-recording of the contents of the invalidated object, such as a viewer.
invalidate
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)bInvalidateGeography
- The bInvalidateGeography (in)bInvalidateSelection
- The bInvalidateSelection (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setImmediateMode(boolean pbIsAllImmediate) throws IOException, AutomationException
setImmediateMode
in interface ISceneGraph
pbIsAllImmediate
- The pbIsAllImmediate (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isImmediateMode() throws IOException, AutomationException
isImmediateMode
in interface ISceneGraph
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setOwnerVisibility(Object pObject, boolean visible) throws IOException, AutomationException
setOwnerVisibility
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)visible
- The visible (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setOwnerNavigationVisibility(Object pObject, boolean visibleWhenNavigating, boolean visibleWhenStill) throws IOException, AutomationException
setOwnerNavigationVisibility
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)visibleWhenNavigating
- The visibleWhenNavigating (in)visibleWhenStill
- The visibleWhenStill (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setOwnerLightingOption(Object pObject, boolean lighting) throws IOException, AutomationException
setOwnerLightingOption
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)lighting
- The lighting (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setOwnerShadingMode(Object pObject, boolean bIsSmooth) throws IOException, AutomationException
setOwnerShadingMode
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)bIsSmooth
- The bIsSmooth (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setOwnerDepthPriority(Object pObject, short depthPriority) throws IOException, AutomationException
setOwnerDepthPriority
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)depthPriority
- The depthPriority (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setOwnerTimeThreshold(Object pObject, double timeThreshold) throws IOException, AutomationException
setOwnerTimeThreshold
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)timeThreshold
- The timeThreshold (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setOwnerImmediateMode(Object pObject, boolean bIsLayerImmediate) throws IOException, AutomationException
setOwnerImmediateMode
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)bIsLayerImmediate
- The bIsLayerImmediate (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setOwnerFaceCulling(Object pObject, int cullingMode) throws IOException, AutomationException
setOwnerFaceCulling
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)cullingMode
- A com.esri.arcgis.analyst3d.esri3DFaceCulling constant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setOwnerTransparencyState(Object pObject, boolean bIsTransparent) throws IOException, AutomationException
setOwnerTransparencyState
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)bIsTransparent
- The bIsTransparent (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getOwnerTransparency(Object pObject, int[] pTranspPercent) throws IOException, AutomationException
getOwnerTransparency
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)pTranspPercent
- The pTranspPercent (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setOwnerExtrusion(Object pObject, boolean rhs2) throws IOException, AutomationException
setOwnerExtrusion
in interface ISceneGraph
pObject
- A reference to another Object (IUnknown) (in)rhs2
- The rhs2 (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IEnvelope getExtent() throws IOException, AutomationException
getExtent
in interface ISceneGraph
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IEnvelope getGeographySelectionExtent() throws IOException, AutomationException
getGeographySelectionExtent
in interface ISceneGraph
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IEnvelope getOwnerExtent(Object pOwner, boolean bSelectionOnly) throws IOException, AutomationException
getOwnerExtent
in interface ISceneGraph
pOwner
- A reference to another Object (IUnknown) (in)bSelectionOnly
- The bSelectionOnly (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void registerViewer(ISceneViewer pViewer) throws IOException, AutomationException
registerViewer
in interface ISceneGraph
registerViewer
in interface IViewers3D
pViewer
- A reference to a com.esri.arcgis.analyst3d.ISceneViewer (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void unregisterViewer(ISceneViewer pViewer) throws IOException, AutomationException
unregisterViewer
in interface ISceneGraph
unregisterViewer
in interface IViewers3D
pViewer
- A reference to a com.esri.arcgis.analyst3d.ISceneViewer (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public ISceneViewer findViewer(String caption) throws IOException, AutomationException
findViewer
in interface ISceneGraph
findViewer
in interface IViewers3D
caption
- The caption (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IArray getAllViewers() throws IOException, AutomationException
getAllViewers
in interface ISceneGraph
getAllViewers
in interface IViewers3D
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setActiveViewerByRef(ISceneViewer ppViewer) throws IOException, AutomationException
setActiveViewerByRef
in interface ISceneGraph
setActiveViewerByRef
in interface IViewers3D
ppViewer
- A reference to a com.esri.arcgis.analyst3d.ISceneViewer (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public ISceneViewer getActiveViewer() throws IOException, AutomationException
getActiveViewer
in interface ISceneGraph
getActiveViewer
in interface IViewers3D
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void replayFrame(ICamera camera) throws IOException, AutomationException
replayFrame
in interface ISceneGraph
replayFrame
in interface IViewers3D
camera
- A reference to a com.esri.arcgis.analyst3d.ICamera (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void refreshViewers() throws IOException, AutomationException
refreshViewers
in interface ISceneGraph
refreshViewers
in interface IViewers3D
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setBackgroundColor(float red, float green, float blue) throws IOException, AutomationException
setBackgroundColor
in interface ISceneGraph
setBackgroundColor
in interface IViewers3D
red
- The red (in)green
- The green (in)blue
- The blue (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getBackgroundColor(float[] pRed, float[] pGreen, float[] pBlue) throws IOException, AutomationException
getBackgroundColor
in interface ISceneGraph
getBackgroundColor
in interface IViewers3D
pRed
- The pRed (out: use single element array)pGreen
- The pGreen (out: use single element array)pBlue
- The pBlue (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSelectionColorByRef(IColor pSelectionColor) throws IOException, AutomationException
setSelectionColorByRef
in interface ISceneGraph
pSelectionColor
- A reference to a com.esri.arcgis.display.IColor (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IColor getSelectionColor() throws IOException, AutomationException
getSelectionColor
in interface ISceneGraph
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isNavigating() throws IOException, AutomationException
isNavigating
in interface ISceneGraph
isNavigating
in interface IViewers3D
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setIsNavigating(boolean pbIsNavigating) throws IOException, AutomationException
setIsNavigating
in interface ISceneGraph
setIsNavigating
in interface IViewers3D
pbIsNavigating
- The pbIsNavigating (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setGestureEnabled(boolean pbEnabled) throws IOException, AutomationException
setGestureEnabled
in interface ISceneGraph
setGestureEnabled
in interface IViewers3D
pbEnabled
- The pbEnabled (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isGestureEnabled() throws IOException, AutomationException
isGestureEnabled
in interface ISceneGraph
isGestureEnabled
in interface IViewers3D
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void locate(ISceneViewer pViewer, int x, int y, int mode, boolean bGetTransformed, IPoint[] ppPt, Object[] ppOwner, Object[] ppObject) throws IOException, AutomationException
locate
in interface ISceneGraph
pViewer
- A reference to a com.esri.arcgis.analyst3d.ISceneViewer (in)x
- The x (in)y
- The y (in)mode
- A com.esri.arcgis.analyst3d.esriScenePickMode constant (in)bGetTransformed
- The bGetTransformed (in)ppPt
- A reference to a com.esri.arcgis.geometry.IPoint (out: use single element array)ppOwner
- A reference to another Object (IUnknown) (out: use single element array)ppObject
- A reference to another Object (IUnknown) (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void locateMultiple(ISceneViewer pViewer, int x, int y, int mode, boolean bGetTransformed, IHit3DSet[] ppHits) throws IOException, AutomationException
locateMultiple
in interface ISceneGraph
pViewer
- A reference to a com.esri.arcgis.analyst3d.ISceneViewer (in)x
- The x (in)y
- The y (in)mode
- A com.esri.arcgis.analyst3d.esriScenePickMode constant (in)bGetTransformed
- The bGetTransformed (in)ppHits
- A reference to a com.esri.arcgis.analyst3d.IHit3DSet (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public double getVerticalExaggeration() throws IOException, AutomationException
getVerticalExaggeration
in interface ISceneGraph
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setVerticalExaggeration(double pZFactor) throws IOException, AutomationException
setVerticalExaggeration
in interface ISceneGraph
pZFactor
- The pZFactor (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IVector3D getSunVector() throws IOException, AutomationException
getSunVector
in interface ISceneGraph
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSunVector(IVector3D ppSun) throws IOException, AutomationException
setSunVector
in interface ISceneGraph
ppSun
- A reference to a com.esri.arcgis.geometry.IVector3D (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getContrast() throws IOException, AutomationException
getContrast
in interface ISceneGraph
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setContrast(int pContrast) throws IOException, AutomationException
setContrast
in interface ISceneGraph
pContrast
- The pContrast (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void clear(boolean bKeepBasicGraph) throws IOException, AutomationException
clear
in interface ISceneGraph
bKeepBasicGraph
- The bKeepBasicGraph (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void lockViewers(boolean lock) throws IOException, AutomationException
lockViewers
in interface ISceneGraph
lock
- The lock (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getDrawingTimeInfo(double[] pLastFrameDuration, double[] pMeanFrameRate) throws IOException, AutomationException
getDrawingTimeInfo
in interface ISceneGraph
pLastFrameDuration
- The pLastFrameDuration (out: use single element array)pMeanFrameRate
- The pMeanFrameRate (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getOwnerSymbols(Object pOwner, IArray[] ppSymbols, ILongArray[] ppDisplayListIDs) throws IOException, AutomationException
getOwnerSymbols
in interface ISceneGraph
pOwner
- A reference to another Object (IUnknown) (in)ppSymbols
- A reference to a com.esri.arcgis.system.IArray (out: use single element array)ppDisplayListIDs
- A reference to a com.esri.arcgis.system.ILongArray (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void recordSymbol(ISymbol pSymbol, int glList, boolean bIsExtruded, boolean bLighting, int layerTransparencyPercent, boolean bOptimizeState) throws IOException, AutomationException
This method provides a mechnism for a quick update on the display of system symbols in the SceneGraph. The purpose of this method is to capture a changed symbol state of a layer for a possible redraw to reflect the change.
recordSymbol
in interface ISceneGraph
pSymbol
- A reference to a com.esri.arcgis.display.ISymbol (in)glList
- The glList (in)bIsExtruded
- The bIsExtruded (in)bLighting
- The bLighting (in)layerTransparencyPercent
- The layerTransparencyPercent (in)bOptimizeState
- The bOptimizeState (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isRecordingMessageEnabled() throws IOException, AutomationException
isRecordingMessageEnabled
in interface ISceneGraph
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setIsRecordingMessageEnabled(boolean pbIsEnabled) throws IOException, AutomationException
setIsRecordingMessageEnabled
in interface ISceneGraph
pbIsEnabled
- The pbIsEnabled (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void interfaceSupportsErrorInfo(GUID riid) throws IOException, AutomationException
Indicates whether the interface supports IErrorInfo.
interfaceSupportsErrorInfo
in interface ISupportErrorInfo
riid
- A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void enumConnectionPoints(IEnumConnectionPoints[] ppEnum) throws IOException, AutomationException
IConnectionPointContainer is a Microsoft interface. Please refer to MSDN for information about this interface.
enumConnectionPoints
in interface IConnectionPointContainer
ppEnum
- A reference to a com.esri.arcgis.display.IEnumConnectionPoints (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void findConnectionPoint(GUID riid, IConnectionPoint[] ppCP) throws IOException, AutomationException
IConnectionPointContainer is a Microsoft interface. Please refer to MSDN for information about this interface.
findConnectionPoint
in interface IConnectionPointContainer
riid
- A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)ppCP
- A reference to a com.esri.arcgis.display.IConnectionPoint (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setHWnd(int hWnd) throws IOException, AutomationException
setHWnd
in interface IScreenDisplay
setHWnd
in interface IScreenDisplay2
hWnd
- The hWnd (A COM typedef) (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getHWnd() throws IOException, AutomationException
The hWnd property tells ScreenDisplay objects which window to draw in. When a new view (a Map or PageLayout) is created and activated (IActiveView::Activate), a related ScreenDisplay is created and its hWnd is set to that of the main application. Data windows, such as the MapInsetWindow, also have a related ScreenDisplay object and in this case the ScreenDisplay's hWnd property is set so that all drawing will occur in the data window and not the main application window.
Several Windows API calls require an hWnd in order to perform their operation; this property provides the hWnd for the ScreenDisplay object you are currently working with. For example, several of ArcMap's zoom commands use the Windows API function 'GetClientRect' to get the coordinates of the main window's client area. GetClientRect requires the hWnd of the window of interest and in ArcMap's case, IScreenDisplay::hWnd holds this.
getHWnd
in interface IScreenDisplay
getHWnd
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getWindowDC() throws IOException, AutomationException
This property is a Windows operating environment device context handle. The Windows operating environment manages the system display by assigning a device context for each window in the application. You can use the WindowDC property to refer to the handle for an object's device context.
This property does not provide a value to pass to IDisplay::StartDrawing. Instead, call IDisplay::StartDrawing with a value of 0 for the hDC as this will automatically use the Windows API function GetDC to populate IScreenDisplay::WindowDC with the hDC of the main display and drawing will occur there.
The value of the WindowDC property can change while an application runs, so do not store the value in a variable; instead, use the WindowDC property each time you need it.
getWindowDC
in interface IScreenDisplay
getWindowDC
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public short addCache() throws IOException, AutomationException
ScreenDisplay objects make it possible for clients to create any number of caches. A cache is an off screen bitmap representing the application's window. Instead of drawing directly to the screen, graphics are drawn into caches, then the caches are drawn on the screen. When the application's window is obscured and requires redrawing, it done so from the caches instead of from a database. In this way, caches improve drawing performance - bitmap rendering is faster than reading and displaying data from a database.
In general, a Map object creates three caches: one for all the layers, another if there are annotation or graphics, and a third cache if there is a feature selection. A layer can create its own private cache if it sets ILayer::Cached equal to TRUE. In this case, the Map will create a separate cache for the layer and groups the layers above and below it into different caches.
The AppDisplay object has no implementation for this method.
addCache
in interface IScreenDisplay
addCache
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void removeCache(short cacheID) throws IOException, AutomationException
Use this method to remove a cache that is no longer needed. For example, calling the IActiveView::PartialRefresh method on a Map object will delete the Map's selection cache if one exists and there are no features selected.
The AppDisplay object has no implementation for this method.
removeCache
in interface IScreenDisplay
removeCache
in interface IScreenDisplay2
cacheID
- The cacheID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public short getCacheCount() throws IOException, AutomationException
Use this property to loop through all of the available screen caches. For example, if you Invalidate using esriAllScreenCaches, this property is used to loop through all of the caches to invalidate each one.
The AppDisplay object has no implementation for this method.
getCacheCount
in interface IScreenDisplay
getCacheCount
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void removeAllCaches() throws IOException, AutomationException
Use this property to clear all of the screen caches the current object has. For example, when a Map is deactivated (IActiveView::Deactivate) it uses this property to remove all of its caches.
The AppDisplay object has no implementation for this method.
removeAllCaches
in interface IScreenDisplay
removeAllCaches
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getCacheMemDC(short index) throws IOException, AutomationException
getCacheMemDC
in interface IScreenDisplay
getCacheMemDC
in interface IScreenDisplay2
index
- The index (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setActiveCache(short index) throws IOException, AutomationException
setActiveCache
in interface IScreenDisplay
setActiveCache
in interface IScreenDisplay2
index
- The index (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public short getActiveCache() throws IOException, AutomationException
getActiveCache
in interface IScreenDisplay
getActiveCache
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setIsFirstCacheTransparent(boolean flag) throws IOException, AutomationException
setIsFirstCacheTransparent
in interface IScreenDisplay
setIsFirstCacheTransparent
in interface IScreenDisplay2
flag
- The flag (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isFirstCacheTransparent() throws IOException, AutomationException
isFirstCacheTransparent
in interface IScreenDisplay
isFirstCacheTransparent
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IScreenDisplay.isFramed()
public void startRecording() throws IOException, AutomationException
In addition to the caches clients create, the ScreenDisplay object also provides a recording cache that accumulates all drawing that happens on the display. This recording cache is used to redraw the application when the application is moved or exposed or when drawing rubber banding.
Note, StartRecording and StopRecording are exposed for developers creating custom applications that draw from multiple caches and need to refresh quickly. If you are working with ArcMap or even the Map object, leave all cache management up to the Map.
Use StartRecording to let the display know exactly what to record. Use DrawCache(esriScreenRecording) to display the recording cache. Use CacheMemDC(esriScreenRecording) to get a handle to the memory device context for the recording bitmap.
The following C++ code excerpt is a drawing sequence example that uses StartRecording.
VARIANT_BOOL isCacheDirty;
m_ipScreen->IsCacheDirty(esriScreenRecording, &isCacheDirty);
if (isCacheDirty) // draw from scratch
{
m_ipScreen->StartRecording();
m_ipScreen->StartDrawing((OLE_HANDLE)hPaintDC, esriNoScreenCache);
DrawContents();
m_ipScreen->FinishDrawing();
m_ipScreen->StopRecording();
}
else // draw from offscreen bitmap
{
m_ipScreen->DrawCache((OLE_HANDLE)hPaintDC, esriScreenRecording, 0, 0);
}
The following java code gives you an example drawing sequence.
IScreenDisplay pScreen; boolean isCacheDirty = pScreen.isCacheDirty(esriScreenRecording); if (isCacheDirty) // draw from scratch { IDisplay pIDisplay = new IDisplayProxy(pScreen); pScreen.startRecording(); pIDisplay.startDrawing((int)hPaintDC, esriNoScreenCache); DrawContents(); pScreen.finishDrawing(); pScreen.stopRecording(); } else // draw from offscreen bitmap { pScreen.drawCache((int)hPaintDC, esriScreenRecording, 0, 0); }
startRecording
in interface IScreenDisplay
startRecording
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void stopRecording() throws IOException, AutomationException
In addition to the caches clients create, the ScreenDisplay object also provides a recording cache that accumulates all drawing that happens on the display. This recording cache is used to redraw the application when the application is moved or exposed or when drawing rubber banding.
Note, StartRecording and StopRecording are exposed for developers creating custom applications that draw from multiple caches and need to refresh quickly. If you are working with ArcMap or even the Map object, leave all cache management up to the Map.
Use StartRecording to let the display know exactly what to record. Use DrawCache(esriScreenRecording) to display the recording cache. Use CacheMemDC(esriScreenRecording) to get a handle to the memory device context for the recording bitmap.
The following C++ code excerpt is a drawing sequence example that uses StartRecording.
VARIANT_BOOL isCacheDirty;
m_ipScreen->IsCacheDirty(esriScreenRecording, &isCacheDirty);
if (isCacheDirty) // draw from scratch
{
m_ipScreen->StartRecording();
m_ipScreen->StartDrawing((OLE_HANDLE)hPaintDC, esriNoScreenCache);
DrawContents();
m_ipScreen->FinishDrawing();
m_ipScreen->StopRecording();
}
else // draw from offscreen bitmap
{
m_ipScreen->DrawCache((OLE_HANDLE)hPaintDC, esriScreenRecording, 0, 0);
}
The following java code gives you an example drawing sequence.
IScreenDisplay pScreen; boolean isCacheDirty = pScreen.isCacheDirty(esriScreenRecording); if (isCacheDirty) // draw from scratch { IDisplay pIDisplay = new IDisplayProxy(pScreen); pScreen.startRecording(); pIDisplay.startDrawing((int)hPaintDC, esriNoScreenCache); DrawContents(); pScreen.finishDrawing(); pScreen.stopRecording(); } else // draw from offscreen bitmap { pScreen.drawCache((int)hPaintDC, esriScreenRecording, 0, 0); }
stopRecording
in interface IScreenDisplay
stopRecording
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setUseScrollbars(boolean flag) throws IOException, AutomationException
setUseScrollbars
in interface IScreenDisplay
setUseScrollbars
in interface IScreenDisplay2
flag
- The flag (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isUseScrollbars() throws IOException, AutomationException
IActiveView::ShowScrollBars redirects all its calls to this property.
Changes to this property are not reflected until the active view changes. For example, when in layout view in ArcMap, programmatically changing the PageLayout to not show its scrollbars will have no effect until the next time the active view is set to the PageLayout; calling IActiveView::Refresh has no effect.
ArcMap uses this property to hide the Map's scroll bars when in layout view. Programmatically trying to display a Map's scroll bar in layout view will have no effect; for Map's this setting is only honored in data view and again it requires an active view change before the setting is reflected in the applications window.
isUseScrollbars
in interface IScreenDisplay
isUseScrollbars
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setScrollbarHandles(int hWndHorzScrollbar, int hWndVertScrollbar) throws IOException, AutomationException
setScrollbarHandles
in interface IScreenDisplay
setScrollbarHandles
in interface IScreenDisplay2
hWndHorzScrollbar
- The hWndHorzScrollbar (A COM typedef) (in)hWndVertScrollbar
- The hWndVertScrollbar (A COM typedef) (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setScaleContents(boolean flag) throws IOException, AutomationException
setScaleContents
in interface IScreenDisplay
setScaleContents
in interface IScreenDisplay2
flag
- The flag (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isScaleContents() throws IOException, AutomationException
If a Map's ScaleContents property is set to TRUE, when its display is resized, the area shown stays the same and the scale changes. When set to FALSE, the scale of the Map stays the same and the area shown changes.
The PageLayout object works similarly. If set to TRUE, the contents are stretched when the display is resized. The scale of all maps changes. When set to FALSE, the page remains the same size.
In ArcMap, on the Tools/Options menu, there are check boxes for controlling this property for the data and layout view.
isScaleContents
in interface IScreenDisplay
isScaleContents
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSuppressResize(boolean suppressResize) throws IOException, AutomationException
setSuppressResize
in interface IScreenDisplay
setSuppressResize
in interface IScreenDisplay2
suppressResize
- The suppressResize (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isSuppressResize() throws IOException, AutomationException
isSuppressResize
in interface IScreenDisplay
isSuppressResize
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isFramed() throws IOException, AutomationException
When creating a custom application, if you want the display to take over the window it's drawing in, set IsFramed to FALSE. This will add scrollbars (IScreenDisplay::UseScrollBars = TRUE) as necessary and keeps the device frame in sync with the window extent. Setting IsFramed to TRUE means that the display is drawing on some extent within the window. In this case, it won't show scrollbars and it won't automatically update the device frame.
For example, in the ArcMap application, in layout view where each Map resides inside a separate MapFrame, each Map has it IsFramed property set to TRUE. In data view, the opposite is true, a Map's display fits the entire window; in this view, all Map's have IsFramed set to FALSE, not just the focus map.
The IsFramed property also sets the IsFirstCacheTransparent property. When a Map is drawing in layout view, the PageLayout object has its ScreenDisplay and each Map has its own separate ScreenDisplay. This means that the layout has it's display cache(s) and the maps have their own. If the bottom cache of each map was opaque, you wouldn't be able to see through a map onto layout elements below it. Setting IsFirstCacheTransparent on the maps in layout view lets you see through the maps.
If you are working with Map's inside of ArcMap these settings should not be touched. Only use this property when building a low level application that uses a display to draw on a frame on a window.
isFramed
in interface IScreenDisplay
isFramed
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IScreenDisplay
public void setIsFramed(boolean flag) throws IOException, AutomationException
setIsFramed
in interface IScreenDisplay
setIsFramed
in interface IScreenDisplay2
flag
- The flag (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public ITrackCancel getCancelTracker() throws IOException, AutomationException
getCancelTracker
in interface IScreenDisplay
getCancelTracker
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setCancelTrackerByRef(ITrackCancel cancelTracker) throws IOException, AutomationException
setCancelTrackerByRef
in interface IScreenDisplay
setCancelTrackerByRef
in interface IScreenDisplay2
cancelTracker
- A reference to a com.esri.arcgis.system.ITrackCancel (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void invalidate(IEnvelope rect, boolean erase, short cacheIndex) throws IOException, AutomationException
Use Invalidate to refresh a specific region on the display. For example, if you add a new feature, only the extent of the new feature requires refreshing; the remainder of the display can redraw from cache.
The rect parameter specifies the region to update. Use 'Nothing' in Visual Basic or a zero in C++ to invalidate the entire display.
Erase specifies whether or not the background within the update region is erased when the update region is processed. Usually this is set to TRUE.
CacheIndex controls which cache to update. Use IActiveView::ScreenCacheID to get the cache index for a specific draw phase. The valid draw phases are held in the esriViewDrawPhase enumeration and are as follows:
0 - esriViewNone
1 - esriViewBackground
2 - esriViewGeography
4 - esriViewGeoSelection
8 - esriViewGraphics
16 - esriViewGraphicSelection
32 - esriviewForeground
You can also specify esriAllScreenCaches, esriNoScreenCache, and esriScreenRecording.
Invalidate sets the cache(s) as dirty. Use IsCacheDirty to check the state of a particular cache.
After completion, Invalidate fires the IDisplayEvents::DisplayInvalidated event.
IActiveView::PartialRefresh has similar parameters and itself calls Invalidate. Use this method instead as much as possible as it automatically determines the cache index based on the phase provided.
invalidate
in interface IScreenDisplay
invalidate
in interface IScreenDisplay2
rect
- A reference to a com.esri.arcgis.geometry.IEnvelope (in)erase
- The erase (in)cacheIndex
- The cacheIndex (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.esriViewDrawPhase
,
IGlobeLayerProperties2
,
IActiveView.partialRefresh(int, java.lang.Object, com.esri.arcgis.geometry.IEnvelope)
,
IScreenDisplay.invalidate(com.esri.arcgis.geometry.IEnvelope, boolean, short)
,
IActiveView.getScreenCacheID(int, java.lang.Object)
,
IActiveView.refresh()
public boolean isCacheDirty(short cacheIndex) throws IOException, AutomationException
When drawing, use this property to check if a particular cache is dirty. If a cache is not dirty (FALSE), redraw the cache; if the cache is dirty (TRUE), redraw from scratch.
isCacheDirty
in interface IScreenDisplay
isCacheDirty
in interface IScreenDisplay2
cacheIndex
- The cacheIndex (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void drawCache(int hDC, short index, tagRECT deviceRect, tagRECT cacheRect) throws IOException, AutomationException
Redrawing data from scratch is time consuming compared to drawing data that has been cached in an off-screen bitmap. If a particular cache return FALSE for IsCacheDirty, use DrawCache to instantly redraw the bitmap.
Use the CacheMemDC property to get the desired cache's hDC.
drawCache
in interface IScreenDisplay
drawCache
in interface IScreenDisplay2
hDC
- The hDC (A COM typedef) (in)index
- The index (in)deviceRect
- A Structure: com.esri.arcgis.system.tagRECT (in)cacheRect
- A Structure: com.esri.arcgis.system.tagRECT (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void doScroll(int xDelta, int yDelta, boolean updateScreen) throws IOException, AutomationException
ArcMap's scroll bars call this method to scroll the current display. The updateScreen parameter specifies whether or not the display will be refreshed after the scroll.
The following example shows how this method can be used.
MapControl mapControl;IActiveView pActiveView = mapControl.getActiveView();IDisplayTransformation pDisplayTransform =pActiveView.getScreenDisplay().getDisplayTransformation()IScreenDisplay pScreenDisplay = pActiveView.getScreenDisplay();pScreenDisplay.doScroll( 100, 100, true );
doScroll
in interface IScreenDisplay
doScroll
in interface IScreenDisplay2
xDelta
- The xDelta (in)yDelta
- The yDelta (in)updateScreen
- The updateScreen (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void trackPan() throws IOException, AutomationException
There are two approaches to panning - this method, and the group PanStart, PanMoveTo, and PanStop. This method is the easiest to use as it takes care of all the mouse events and refreshing the display when pan is complete.
Call this method in the mouse down event and make certain you have a reference to the correct ScreenDisplay object. For example, if you are in layout view and you want to pan just the focus map, do not use the ScreenDisplay object associated with IMxDocument::ActiveView. Instead, get the focus Map via IMxDocument::FocusMap, and then get its ScreenDisplay.
MapControl mapControl;IActiveView pActiveView = mapControl.getActiveView();IScreenDisplay pScreenDisplay = pActiveView.getScreenDisplay();pScreenDisplay.trackPan();
trackPan
in interface IScreenDisplay
trackPan
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IScreenDisplay.panMoveTo(com.esri.arcgis.geometry.IPoint)
,
IScreenDisplay.panStart(com.esri.arcgis.geometry.IPoint)
,
IScreenDisplay.panStop()
public void panStart(IPoint mouseLocation) throws IOException, AutomationException
Call PanStart to initiate panning. The required point parameter specifies the pan's starting point. Call PanMoveTo next to specify a destination point.
The typical sequence for using the pan methods is as follows:
See TrackPan for an alternative panning approach.
panStart
in interface IScreenDisplay
panStart
in interface IScreenDisplay2
mouseLocation
- A reference to a com.esri.arcgis.geometry.IPoint (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IScreenDisplay.panMoveTo(com.esri.arcgis.geometry.IPoint)
,
IScreenDisplay.panStart(com.esri.arcgis.geometry.IPoint)
,
IScreenDisplay.panStop()
,
IScreenDisplay.trackPan()
public void panMoveTo(IPoint mouseLocation) throws IOException, AutomationException
PanMoveTo pans the display by calculating an offset distance between the start point supplied to PanStart and the destination point provided to this method. The recording cache is automatically redrawn each time PanMoveTo is called. Use the envelope PanStop returns to truly refresh the display.
The typical sequence for using the pan methods is as follows:
See TrackPan for an alternative panning approach.
panMoveTo
in interface IScreenDisplay
panMoveTo
in interface IScreenDisplay2
mouseLocation
- A reference to a com.esri.arcgis.geometry.IPoint (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IScreenDisplay.panMoveTo(com.esri.arcgis.geometry.IPoint)
,
IScreenDisplay.panStart(com.esri.arcgis.geometry.IPoint)
,
IScreenDisplay.panStop()
,
IScreenDisplay.trackPan()
public IEnvelope panStop() throws IOException, AutomationException
PanStop creates an Envelope that should be used to reset the extent of the active view. Because PanMoveTo redraws only the recording cache (bitmap), there are typically blank areas in the display. Call IActiveView::Refresh after calling PanStop to invalidate the entire display.
The typical sequence for using the pan methods is as follows:
See TrackPan for an alternative panning approach.
panStop
in interface IScreenDisplay
panStop
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IScreenDisplay.panMoveTo(com.esri.arcgis.geometry.IPoint)
,
IScreenDisplay.panStart(com.esri.arcgis.geometry.IPoint)
,
com.esri.arcgis.display.IActiveView
,
IScreenDisplay.panStop()
,
IScreenDisplay.trackPan()
public void trackRotate() throws IOException, AutomationException
There are two approaches to rotating the display - this method and the group RotateStart, RotateMoveTo, RotateTimer, and RotateStop. This method is the easiest to use as it takes care of all the mouse events automatically, performs the final display rotation, and invalidates the display.
Call this method in the mouse down event and make certain you have a reference to the correct ScreenDisplay object. For example, if you are in layout view and you want to pan just the focus map, do not use the ScreenDisplay object associated with IMxDocument::ActiveView. Instead, get the focus Map via IMxDocument::FocusMap, and then get its ScreenDisplay.
The following java code excerpt shows this.
MapControl mapControl;IActiveView pActiveView = mapControl.getActiveView();IScreenDisplay pScreenDisplay = pActiveView.getScreenDisplay();pScreenDisplay.trackRotate();
trackRotate
in interface IScreenDisplay
trackRotate
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void rotateStart(IPoint mousePt, IPoint centerPt) throws IOException, AutomationException
Call RotateStart to initiate rotating the display. The required point parameter specifies the starting point of the rotation. Call RotateMoveTo next to specify the rotation destination point, a rotation angle is calculated based on these two points.
The typical sequence for using the rotate methods is as follows:
See TrackRotate for an alternative rotating approach.
rotateStart
in interface IScreenDisplay
rotateStart
in interface IScreenDisplay2
mousePt
- A reference to a com.esri.arcgis.geometry.IPoint (in)centerPt
- A reference to a com.esri.arcgis.geometry.IPoint (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IScreenDisplay.rotateTimer()
,
IDisplayTransformation.getRotation()
,
IScreenDisplay.rotateMoveTo(com.esri.arcgis.geometry.IPoint)
,
IScreenDisplay.rotateStop()
,
IScreenDisplay.rotateStart(com.esri.arcgis.geometry.IPoint, com.esri.arcgis.geometry.IPoint)
public void rotateMoveTo(IPoint pPoint) throws IOException, AutomationException
RotateMoveTo rotates the display based on the calculated angle between the start point supplied to RotateStart and the destination point provided to this method. Next call RotateTimer to show the rotation degree readout and repaint the display from cache.
The typical sequence for using the rotate methods is as follows:
See TrackRotate for an alternative rotating approach.
rotateMoveTo
in interface IScreenDisplay
rotateMoveTo
in interface IScreenDisplay2
pPoint
- A reference to a com.esri.arcgis.geometry.IPoint (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IScreenDisplay.rotateTimer()
,
IDisplayTransformation.getRotation()
,
IScreenDisplay.rotateMoveTo(com.esri.arcgis.geometry.IPoint)
,
IScreenDisplay.rotateStop()
,
IScreenDisplay.rotateStart(com.esri.arcgis.geometry.IPoint, com.esri.arcgis.geometry.IPoint)
public void rotateTimer() throws IOException, AutomationException
RotateTimer shows the rotation degree readout and repaints the display from cache.
The typical sequence for using the rotate methods is as follows:
See TrackRotate for an alternative rotating approach.
rotateTimer
in interface IScreenDisplay
rotateTimer
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IScreenDisplay.rotateTimer()
,
IDisplayTransformation.getRotation()
,
IScreenDisplay.rotateMoveTo(com.esri.arcgis.geometry.IPoint)
,
IScreenDisplay.rotateStop()
,
IScreenDisplay.rotateStart(com.esri.arcgis.geometry.IPoint, com.esri.arcgis.geometry.IPoint)
public double rotateStop() throws IOException, AutomationException
RotateStop returns the final rotation angle. You must call IDisplayTransformation::Rotation with the final rotation angle to actually rotate the display.
The typical sequence for using the rotate methods is as follows:
See TrackRotate for an alternative rotating approach.
rotateStop
in interface IScreenDisplay
rotateStop
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IScreenDisplay.rotateTimer()
,
IDisplayTransformation.getRotation()
,
IScreenDisplay.rotateMoveTo(com.esri.arcgis.geometry.IPoint)
,
IScreenDisplay.rotateStop()
,
IScreenDisplay.rotateStart(com.esri.arcgis.geometry.IPoint, com.esri.arcgis.geometry.IPoint)
public void updateWindow() throws IOException, AutomationException
Use UpdateWindow to process pending Windows WM_PAINT messages immediately. This may be the case if you have a routine that takes a long time to execute and you need the window to refresh while the code executes. Typically, no drawing will occur until all your code has been executed and control returns to the ArcMap's message loop and the WM_PAINT message is handled. UpdateWindow forces the window to invalidate by sending a WM_PAINT message directly to the window; the normal ArcMap message queue is bypassed.
See UpdateWindow in MSDN for more information.
updateWindow
in interface IScreenDisplay
updateWindow
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IDisplayTransformation getDisplayTransformation() throws IOException, AutomationException
getDisplayTransformation
in interface IDisplay
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setDisplayTransformation(IDisplayTransformation displayTransformation) throws IOException, AutomationException
setDisplayTransformation
in interface IDisplay
displayTransformation
- A reference to a com.esri.arcgis.display.IDisplayTransformation (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IEnvelope getClipEnvelope() throws IOException, AutomationException
getClipEnvelope
in interface IDisplay
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public ISet getClipEnvelopes() throws IOException, AutomationException
getClipEnvelopes
in interface IDisplay
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IGeometry getClipGeometry() throws IOException, AutomationException
Use the ClipGeometry property to shape the area data is drawn in. For example, if you had a map of the United States that contained many layers, you could set the ClipGeometry property on the focus Map's ScreenDisplay object equal to the geometry of a particular state thereby telling the map to only draw the data falling within the particular state's area. The ClipGeometry is used to cookie-cut all data before it is drawn.
See IMap::ClipGeometry for a more information and a sample.
getClipGeometry
in interface IDisplay
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setClipGeometry(IGeometry geometry) throws IOException, AutomationException
setClipGeometry
in interface IDisplay
geometry
- A reference to a com.esri.arcgis.geometry.IGeometry (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isSuppressEvents() throws IOException, AutomationException
For example, IScreenDisplay::StartDrawing sets SuppressEvents to TRUE and FinishDrawing sets it back to FALSE, this prevents all transform events from firing during the drawing.
SuppressEvents is set to FALSE by default.
isSuppressEvents
in interface IDisplay
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSuppressEvents(boolean suppressEvents) throws IOException, AutomationException
setSuppressEvents
in interface IDisplay
suppressEvents
- The suppressEvents (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IDisplayFilter getFilter() throws IOException, AutomationException
getFilter
in interface IDisplay
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setFilterByRef(IDisplayFilter filter) throws IOException, AutomationException
setFilterByRef
in interface IDisplay
filter
- A reference to a com.esri.arcgis.display.IDisplayFilter (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getHPalette() throws IOException, AutomationException
getHPalette
in interface IDisplay
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setHPalette(int hPalette) throws IOException, AutomationException
setHPalette
in interface IDisplay
hPalette
- The hPalette (A COM typedef) (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void startDrawing(int hDC, short cacheID) throws IOException, AutomationException
StartDrawing and FinishDrawing are used to manage clipping, symbols, and caching. Call StartDrawing and FinishDrawing anytime you want to draw to a device such as a display, printer, or cache (bitmap). However, if you are drawing in response to IActiveViewEvents::AfterDraw, the Map object automatically makes these calls for you.
StartDrawing has two parameters: hDc and cacheID. The hDc parameter specifies the target device where drawing will occur, usually a display, printer, or bitmap. The cacheID parameter activates a specific cache. In most cases, esriNoScreenCache should be used.
Specifying a cache sets it as the screen's active cache. When esriNoScreenCache is used, it sets the display's active cache to zero and drawing occurs directly in the device. Specify a cache when you don't want to draw to a screen directly and you instead want to draw to a cache (bitmap) that may ultimately be copied to the screen. For example, when ArcMap draws geography, it draws it to a specific cache and then the cache is copied to the screen. When the screen repaints, instead of drawing all the data from scratch again, the software checks if the cache is dirty or not and simply redraws the bitmap to save time if it can. When drawing to a cache, the hDc parameter should be the device context of the bitmap, use the IScreenDisplay::CacheMemDC property to get a particular cache's hDC.
Each time you need to change the cache you are drawing to, you must do so inside a new StartDrawing / FinishDrawing block. For example, ArcMap usually creates three caches: one for geography layers, one for graphics and annotation, and one for selections. ArcMap draws each of these phases within a separate StartDrawing / FinishDrawing block.
There are times when may need to draw shapes directly to screen without having them become part of a display cache. For example, drawing moving objects. In these cases, use IScreenDisplay::WindowDC to get the device context of the display and esriNoScreenCache as the cacheID.
If a zero is specified for the hDc parameter, the Windows API function GetDC is used to populate IScreenDisplay::WindowDC with the hDC of the main display and drawing is sent here.
StartDrawing fires the IDisplayEvents::DisplayStarted event.The following java code gives you an example drawing sequence.
<font face=”Courier New” size=2>
<pre>
IScreenDisplay pScreen;
boolean isCacheDirty = pScreen.isCacheDirty(esriScreenRecording);
if (isCacheDirty) // draw from scratch
{
IDisplay pIDisplay = new IDisplayProxy(pScreen);
pScreen.startRecording();
pIDisplay.startDrawing((int)hPaintDC, esriNoScreenCache);
DrawContents();
pScreen.finishDrawing();
pScreen.stopRecording();
} else // draw from offscreen bitmap
{
pScreen.drawCache((int)hPaintDC, esriScreenRecording, 0, 0);
}
</pre>
</font>
startDrawing
in interface IDisplay
hDC
- The hDC (A COM typedef) (in)cacheID
- The cacheID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplay.finishDrawing()
public int getHDC() throws IOException, AutomationException
Returns the device context specified to StartDrawing. This may be the device context of a display, cache (bitmap), or some other device such as a printer. As StartDrawing is called frequently throughout the drawing pipeline, the hDc property continually changes and is therefore safe to use only within a single StartDrawing / FinishDrawing block.
This property does not provide a value to pass to IDisplay::StartDrawing. Instead, call IDisplay::StartDrawing with a value of 0 for the hDC as this will automatically use the Windows API function GetDC to populate IScreenDisplay::WindowDC with the hDC of the main display and drawing will occur there.
getHDC
in interface IDisplay
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void finishDrawing() throws IOException, AutomationException
finishDrawing
in interface IDisplay
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplay.startDrawing(int, short)
public void progress(int vertexCount) throws IOException, AutomationException
progress
in interface IDisplay
vertexCount
- The vertexCount (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void drawPoint(IGeometry point) throws IOException, AutomationException
DrawPoint draws a Point object with the symbol that must be specified before hand with the SetSymbol method. All draw methods must be enclosed between the calls to StartDrawing and FinishDrawing unless you are drawing in response to the IActiveViewEvents::AfterDraw event.
drawPoint
in interface IDisplay
point
- A reference to a com.esri.arcgis.geometry.IGeometry (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplay.startDrawing(int, short)
public void drawMultipoint(IGeometry multipoint) throws IOException, AutomationException
drawMultipoint
in interface IDisplay
multipoint
- A reference to a com.esri.arcgis.geometry.IGeometry (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplay.startDrawing(int, short)
public void drawRectangle(IEnvelope rectangle) throws IOException, AutomationException
drawRectangle
in interface IDisplay
rectangle
- A reference to a com.esri.arcgis.geometry.IEnvelope (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplay.startDrawing(int, short)
public void drawPolyline(IGeometry polyline) throws IOException, AutomationException
drawPolyline
in interface IDisplay
polyline
- A reference to a com.esri.arcgis.geometry.IGeometry (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplay.startDrawing(int, short)
public void drawPolygon(IGeometry polygon) throws IOException, AutomationException
drawPolygon
in interface IDisplay
polygon
- A reference to a com.esri.arcgis.geometry.IGeometry (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplay.startDrawing(int, short)
public void drawText(IGeometry shape, String text) throws IOException, AutomationException
drawText
in interface IDisplay
shape
- A reference to a com.esri.arcgis.geometry.IGeometry (in)text
- The text (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplay.startDrawing(int, short)
public void setSymbol(ISymbol sym) throws IOException, AutomationException
setSymbol
in interface IDisplay
sym
- A reference to a com.esri.arcgis.display.ISymbol (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IIlluminationProps getIlluminationProps() throws IOException, AutomationException
getIlluminationProps
in interface IDisplay
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setIlluminationProps(IIlluminationProps illuminationProps) throws IOException, AutomationException
setIlluminationProps
in interface IDisplay
illuminationProps
- A reference to a com.esri.arcgis.display.IIlluminationProps (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setBackgroundRGB(int rGB) throws IOException, AutomationException
setBackgroundRGB
in interface IScreenDisplay2
rGB
- The rGB (A COM typedef) (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getBackgroundRGB() throws IOException, AutomationException
getBackgroundRGB
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getDrawingOffset(int[] x, int[] y) throws IOException, AutomationException
getDrawingOffset
in interface IScreenDisplay2
x
- The x (out: use single element array)y
- The y (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void validate(short cacheIndex) throws IOException, AutomationException
validate
in interface IScreenDisplay2
cacheIndex
- The cacheIndex (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void startFeedback() throws IOException, AutomationException
startFeedback
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void finishFeedback() throws IOException, AutomationException
finishFeedback
in interface IScreenDisplay2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void frameScrolled(int x, int y) throws IOException, AutomationException
frameScrolled
in interface IScreenDisplay2
x
- The x (in)y
- The y (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setScreenPickTolerance(int pixels) throws IOException, AutomationException
setScreenPickTolerance
in interface IDisplay3D
pixels
- The pixels (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getScreenPickTolerance() throws IOException, AutomationException
getScreenPickTolerance
in interface IDisplay3D
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSymbolScale(float scale) throws IOException, AutomationException
setSymbolScale
in interface IDisplay3D
scale
- The scale (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public float getSymbolScale() throws IOException, AutomationException
getSymbolScale
in interface IDisplay3D
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void putMaxTextureSize(int maxTextureWidth, int maxTextureHeight) throws IOException, AutomationException
putMaxTextureSize
in interface IDisplay3D
maxTextureWidth
- The maxTextureWidth (in)maxTextureHeight
- The maxTextureHeight (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getMaxTextureSize(int[] pMaxTextureWidth, int[] pMaxTextureHeight) throws IOException, AutomationException
getMaxTextureSize
in interface IDisplay3D
pMaxTextureWidth
- The pMaxTextureWidth (out: use single element array)pMaxTextureHeight
- The pMaxTextureHeight (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addFlashFeature(IGeometry pGeometry) throws IOException, AutomationException
addFlashFeature
in interface IDisplay3D
pGeometry
- A reference to a com.esri.arcgis.geometry.IGeometry (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void flashFeatures() throws IOException, AutomationException
flashFeatures
in interface IDisplay3D
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void flashLocation(IPoint pGeometry) throws IOException, AutomationException
flashLocation
in interface IDisplay3D
pGeometry
- A reference to a com.esri.arcgis.geometry.IPoint (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void flashGeometry(Object pOwner, Object feature) throws IOException, AutomationException
flashGeometry
in interface IDisplay3D
pOwner
- A reference to another Object (IUnknown) (in)feature
- A reference to another Object (IUnknown) (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |