The UI plugins framework consists of a hosting environment and the hosted components discovered and loaded at run-time. A hosted component, or plugin, is a COM object that implements interfaces required by the hosted environment to invoke the object's methods at run-time. Plugins may be implemented in a variety of languages (Visual Basic, Visual C#, C++, etc.) that support COM interfaces. The hosting environment is a GUI or GUI-less application that makes use of the UI plugins framework. A hosting environment is responsible for activation and management of the lifetime of the plugins. In addition, a hosted environment supplies information about itself and its capabilities to the plugins during their initialization.
To create a UI plugin you need to implement a few interfaces
from the AgUiPlugins
library (AGI.Ui.Plugins
namespace). You can implement the AgUiPlugins interface from any
technology where it is possible to implement COM interfaces.
The first figure outlines the most significant UI plugin interfaces:
The figure below outlines the methods an properties associated with the most significant UI plugin interfaces:
User interface (UI) Plugins can access and manipulate the STK scenario and objects using the STK Object Model. The STK Object Model can be accessed by interrogating the UI Plugin object site. At this time the STK Object Model is only available for the UI Plugins running inside STK.
using AGI.STKObjects;
using AGI.Ui.Plugins;
using AGI.Ui.Application;
void IAgUiPlugin.OnStartup(IAgUiPluginSite pSite)
{AgUiApplication oApp = pSite.Application as AgUiApplication;
if (oApp != null)
{IAgStkObjectRoot root = oApp.Personality2 as IAgStkObjectRoot;}}
STK Programming Interface 11.0.1