Object Model Overview
The following figure describes the main interfaces made
available by the STK Esri Display Library, and their
relationships.
The
IAgEsri3dRendererFactory interface and
associated class provide access to the renderer (IAgEsri3dRenderer
interface) for a specific 3D view via the
GetRenderer method.
Once you get to the IAgEsri3dRenderer interface, you can:
- configure the renderer (Config
property),
- open/close map documents (OpenMapDocument,
CloseMapDocument methods),
- access the opened map document for manipulation using
ArcObjects (MapDocument property),
- manage the GIS selection (ClearSelection,
SelectFeature,
Select Features methods),
- manage the display (Refresh,
Pause/Resume,
ZoomToLayer,
FlashFeature,
FlashIdentifyObj methods),
- identify GIS features by using a specialized helper function on
top of the regular Arc engine's Identify capability (Identify
method),
- promote GIS features to STK objects (Promote
method),
- optimize cross-thread communication (DrawPause/DrawResume
methods), and
- make changes to the map document on the fly (StartMapEditing/StopMapEditing
methods).
The AgEsri3dRenderer
class also provides the following events:
The threading architecture has several implications for how to
interact with the Library programmatically:
- All the components in the library are apartment-threaded.
- All the components except for the context live in the main user
interface thread/apartment.
- The context (IAgEsri3dRendererContext
interface) lives in the GIS thread/apartment.
- The ArcObjects components are apartment-threaded as well. It is
recommended that you instantiate new ArcObjects in the GIS thread.
This can be achieved by using the
CreateObject method of the IAgEsri3dRendererContext interface
(this is conceptually similar to the IServerContext interface when
working with ArcGIS server).
- It is recommended that you avoid chatty calls between the 2
threads, and instead use coarse grained interfaces to limit the
number of marshalling round trips.
- In case chatty programming style cannot be avoided, use the
DrawPause and
DrawResume methods of the IAgEsri3dRenderer interface to speed
up round trips between the 2 threads. These methods basically
suspend the draw processing temporarily in the GIS thread, so that
it is only listening to incoming calls.
- Alternatively you can serialize components in order to perform
all the processing in a different thread. The LoadObject and
SaveObject methods of the IAgEsri3dRendererContext interface serve
that purpose (similarly to the
LoadObject and
SaveObject methods of the IServerContext interface when working
with ArcGIS server).
STK Programming Interface 11.0.1