Plugin Samples

Sample applications that demonstrate some of those Plugin technologies follow.

Note: On windows the code samples included in the STK install are read only. If you wish to work with one of the samples, you should copy the appropriate directory to an area on the local machine where you have write permissions, and then mark the files writable before trying to compile them.

Registering Windows Script and Binary COM Component Plugins on Vista with UAC Enabled

If User Account Control (UAC) is enabled on Vista, and you attempt to register a Windows Script or binary COM Component plugin, you will receive the following error:

The module C:\Windows\<system32 or syswow64>\scrobj.dll was loaded but the call to DllRegisterServer failed with error code 0x80070005.

Use the following workaround to register the plugin:

  1. Run the command in elevated mode. Right click on "Command Prompt" and select "Run as Administrator".
  2. Navigate to the directory containing the plugin(s) that you want to register.
  3. Select one of the following:

Constraints

All code samples for extending constraints are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/Constraints/<Language>/<Project>
Language Project Description
C++ Range Simply uses the range between objects as its metric. Of course, such a metric is already available in STK, but this code is meant to demonstrate registration issues, not computational complexity. It is registered on only a handful of possible STK Object pairings.
Language Project Description
C# NIIRS Calculates a modified form of the NIIRS image quality metric, useful when evaluating optical instruments. This version of the GSD equation is parameterized in terms of Q (the optical ratio), lamba (wavelength), and D (optical diameter). These parameter values are made available for the user to edit. The constraint has been registered only for Facilities and Targets performing access to Sensors. This example is best suited for use as a Figure of Merit metric for Coverage computations.
Range Simply uses the range between objects as its metric. Of course, such a metric is already available in STK, but this code is meant to demonstrate registration issues, not computational complexity. It is registered on only a handful of possible STK Object pairings.
Language Project Description
Visual Basic Range Simply uses the range between objects as its metric. Of course, such a metric is already available in STK, but this code is meant to demonstrate registration issues, not computational complexity. It is registered on only a handful of possible STK Object pairings.
Language Project Description
WSC AccessConstraint.JScript.RangeExample Simply uses the range between objects as its metric. Of course, such a metric is already available in STK, but this code is meant to demonstrate registration issues, not computational complexity. It is registered on only a handful of possible STK Object pairings.
AccessConstraint.MATLAB.RangeExample Simply uses the range between objects as its metric. Of course, such a metric is already available in STK, but this code is meant to demonstrate registration issues, not computational complexity. It is registered on only a handful of possible STK Object pairings.
Language Project Description
Java

Note: For instructions on configuring the Java samples with the Eclipse IDE, click here.

Extend_STK_Plugin_AccessConstraint_Common Sample code shared for Access Constraint Java plugins.
Extend_STK_Plugin_AccessConstraint_Config Demonstrates how to use the IAgUtPluginConfig and IAgAttrBuilder interfaces to provide configurable variables via the STK GUI for use in the runtime access computations.
Extend_STK_Plugin_AccessConstraint_NIIRS Calculates a modified form of the NIIRS image quality metric, useful when evaluating optical instruments. This version of the GSD equation is parameterized in terms of Q (the optical ratio), lamba (wavelength), and D (optical diameter). These parameter values are made available for the user to edit. The constraint has been registered only for Facilities and Targets performing access to Sensors. This example is best suited for use as a Figure of Merit metric for Coverage computations.
Extend_STK_Plugin_AccessConstraint_Range Simply uses the range between objects as its metric. Of course, such a metric is already available in STK, but this code is meant to demonstrate registration issues, not computational complexity. It is registered on only a handful of possible STK Object pairings.

Astrogator Attitude Controllers

All code samples for Astrogator attitude controllers are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/Gator.AttitudeControllers/<Language>/<Project>
Language Project Description
C++ Gen Computes the attitude of the body with respect to VNC axes using a Euler 321 sequence of rotations for yaw, pitch, and roll. Both yaw and pitch are modeled to grow with time since segment start, using user specified coefficients, and oscillate with user specified amplitude using the argument of latitude as the oscillation angle. The argument of latitude is obtained as a Calc Object from the Astrogator Component Browser.
Language Project Description
C# Gen Computes the attitude of the body with respect to VNC axes using a Euler 321 sequence of rotations for yaw, pitch, and roll. Both yaw and pitch are modeled to grow with time since segment start, using user specified coefficients, and oscillate with user specified amplitude using the argument of latitude as the oscillation angle. The argument of latitude is obtained as a Calc Object from the Astrogator Component Browser.
Language Project Description
WSC JScript.Example1.AttitudeController Computes the attitude of the body with respect to VNC axes using a Euler 321 sequence of rotations for yaw, pitch, and roll. Both yaw and pitch are modeled to grow with time since segment start, using user specified coefficients, and oscillate with user specified amplitude using the argument of latitude as the oscillation angle. The argument of latitude is obtained as a Calc Object from the Astrogator Component Browser.
MATLAB.Example1.AttitudeController Computes the attitude of the body with respect to VNC axes using a Euler 321 sequence of rotations for yaw, pitch, and roll. Both yaw and pitch are modeled to grow with time since segment start, using user specified coefficients, and oscillate with user specified amplitude using the argument of latitude as the oscillation angle. The argument of latitude is obtained as a Calc Object from the Astrogator Component Browser.
VBScript.Example1.AttitudeController Computes the attitude of the body with respect to VNC axes using a Euler 321 sequence of rotations for yaw, pitch, and roll. Both yaw and pitch are modeled to grow with time since segment start, using user specified coefficients, and oscillate with user specified amplitude using the argument of latitude as the oscillation angle. The argument of latitude is obtained as a Calc Object from the Astrogator Component Browser.

Astrogator Engine Models

All code samples for Astrogator engine models are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/Gator.EngineModels/<Language>/<Project>
Language Project Description
C++ Gen Computes thrust and Isp. Isp is specified by the user. Thrust is computed to grow with time since segment start, using user specified coefficients, and oscillate with user specified amplitude using the argument of latitude as the oscillation angle. The argument of latitude is obtained as a Calc Object from the Astrogator Component Browser. This sample serves as a demonstration of the capability and is not representative of any particular desired engine performance.
Language Project Description
C# Gen Computes thrust and Isp. Isp is specified by the user. Thrust is computed to grow with time since segment start, using user specified coefficients, and oscillate with user specified amplitude using the argument of latitude as the oscillation angle. The argument of latitude is obtained as a Calc Object from the Astrogator Component Browser. This sample serves as a demonstration of the capability and is not representative of any particular desired engine performance.
Language Project Description
WSC JScript.Example1.EngineModel Computes thrust and Isp. Isp is specified by the user. Thrust is computed to grow with time since segment start, using user specified coefficients, and oscillate with user specified amplitude using the argument of latitude as the oscillation angle. The argument of latitude is obtained as a Calc Object from the Astrogator Component Browser. This sample serves as a demonstration of the capability and is not representative of any particular desired engine performance.
MATLAB.Example1.EngineModel Computes thrust and Isp. Isp is specified by the user. Thrust is computed to grow with time since segment start, using user specified coefficients, and oscillate with user specified amplitude using the argument of latitude as the oscillation angle. The argument of latitude is obtained as a Calc Object from the Astrogator Component Browser. This sample serves as a demonstration of the capability and is not representative of any particular desired engine performance.
VBScript.Example1.EngineModel Computes thrust and Isp. Isp is specified by the user. Thrust is computed to grow with time since segment start, using user specified coefficients, and oscillate with user specified amplitude using the argument of latitude as the oscillation angle. The argument of latitude is obtained as a Calc Object from the Astrogator Component Browser. This sample serves as a demonstration of the capability and is not representative of any particular desired engine performance.

Astrogator Searches

All code samples for Astrogator searches are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/Gator.Search/<Language>/<Project>
Language Project Description
C++ Gen A plugin search profile that uses a bisection method to target a value. These plugins use the Astrogator search plugin interface, IAgPluginSearch.
Language Project Description
C# Gen A plugin search profile that uses a bisection method to target a value. These plugins use the Astrogator search plugin interface, IAgPluginSearch.
Language Project Description
MATLAB Gen A plugin search profile that uses a bisection method to target a value. These plugins use the Astrogator search plugin interface, IAgPluginSearch.
Language Project Description
WSC JScript.SearchControlRealExample A plugin that configures a control for use with the SearchExample plugin. This plugin implements the Astrogator IAgSearchControlReal plugin interface.
JScript.SearchExample A plugin search profile that uses a bisection method to target a value. These plugins use the Astrogator search plugin interface, IAgPluginSearch.
JScript.SearchResultExample A plugin that configures a result for use with the SearchExample plugin. This plugin implements the Astrogator IAgSearchResults plugin interface.
VBScript.SearchControlRealExample A plugin that configures a control for use with the SearchExample plugin. This plugin implements the Astrogator IAgSearchControlReal plugin interface.
VBScript.SearchExample A plugin search profile that uses a bisection method to target a value. These plugins use the Astrogator search plugin interface, IAgPluginSearch.
VBScript.SearchResultExample A plugin that configures a result for use with the SearchExample plugin. This plugin implements the Astrogator IAgSearchResults plugin interface.

Astrogator Equation of Motion Function

All code samples for Equation of Motion (EOM) Functions are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/Gator.EOMFunctions/<Language>/<Project>
Language Project Description
C++ Gen A plugin that uses the Equations of Motion (EOM) function to give the derivative of four user variables: effective impulse, and the x-, y-, and z-components of integrated delta-V. This plugin uses the Astrogator plugin interface, IAgAsEOMFuncPlugin.
Language Project Description
C# Gen A plugin that uses the Equations of Motion (EOM) function to give the derivative of four user variables: effective impulse, and the x-, y-, and z-components of integrated delta-V. This plugin uses the Astrogator plugin interface, IAgAsEOMFuncPlugin.
Language Project Description
Visual Basic Gen A plugin that uses the Equations of Motion (EOM) function to give the derivative of four user variables: effective impulse, and the x-, y-, and z-components of integrated delta-V. This plugin uses the Astrogator plugin interface, IAgAsEOMFuncPlugin.
Language Project Description
WSC JScript.Example1.EOMFunc A plugin that uses the Equations of Motion (EOM) function to give the derivative of four user variables: effective impulse, and the x-, y-, and z-components of integrated delta-V. This plugin uses the Astrogator plugin interface, IAgAsEOMFuncPlugin.
VBScript.Example1.EOMFunc A plugin that uses the Equations of Motion (EOM) function to give the derivative of four user variables: effective impulse, and the x-, y-, and z-components of integrated delta-V. This plugin uses the Astrogator plugin interface, IAgAsEOMFuncPlugin.

HPOP Force Models

All code samples for HPOP force models are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/HPOP.ForceModels/<Language>/<Project>
Language Project Description
C++ Gen Adds additional constant acceleration in a user chosen reference frame (i.e., a maneuver without mass loss effects), and models a oscillating solar radiation pressure area. The oscillation angle is determined as the angle between the current position vector and a specified Vector from the Vector Geometry Tool.
MyPlugin Template for building a C++ HPOP Force Model plugin.
Language Project Description
C# Gen Adds additional constant acceleration in a user chosen reference frame (i.e., a maneuver without mass loss effects), and models a oscillating solar radiation pressure area. The oscillation angle is determined as the angle between the current position vector and a specified Vector from the Vector Geometry Tool.
MyPlugin Template for building a C++ HPOP Force Model plugin.
Srp Computes a model of solar radiation pressure for a TDRS spacecraft, using both specular and diffuse reflectivity effects.
Language Project Description
Visual Basic Gen Adds additional constant acceleration in a user chosen reference frame (i.e., a maneuver without mass loss effects), and models a oscillating solar radiation pressure area. The oscillation angle is determined as the angle between the current position vector and a specified Vector from the Vector Geometry Tool.
Srp Computes a model of solar radiation pressure for a TDRS spacecraft, using both specular and diffuse reflectivity effects.
Language Project Description
WSC JScript.Example1.Hpop Adds additional constant acceleration in a user chosen reference frame (i.e., a maneuver without mass loss effects), and models a oscillating solar radiation pressure area. The oscillation angle is determined as the angle between the current position vector and a specified Vector from the Vector Geometry Tool.
MATLAB.Example1.Hpop Adds additional constant acceleration in a user chosen reference frame (i.e., a maneuver without mass loss effects), and models a oscillating solar radiation pressure area. The oscillation angle is determined as the angle between the current position vector and a specified Vector from the Vector Geometry Tool.
MyPlugin.Hpop Template for building a C++ HPOP Force Model plugin.
Perl.Example1.Hpop Adds additional constant acceleration in a user chosen reference frame (i.e., a maneuver without mass loss effects), and models a oscillating solar radiation pressure area. The oscillation angle is determined as the angle between the current position vector and a specified Vector from the Vector Geometry Tool.
Perl.SRPExample1.Hpop Computes a model of solar radiation pressure for a TDRS spacecraft, using both specular and diffuse reflectivity effects.
VBScript.Example1.Hpop Adds additional constant acceleration in a user chosen reference frame (i.e., a maneuver without mass loss effects), and models a oscillating solar radiation pressure area. The oscillation angle is determined as the angle between the current position vector and a specified Vector from the Vector Geometry Tool.

Solar Pressure Light Reflection

All code samples for extending Solar Pressure Light Reflection Plugins are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/SRP.LightReflection/<Language>/<Project>
Language Project Description
C# Spherical Model The light reflectance being modeled is that of a sphere.
Language Project Description
WSC 2 Plate Reflectance Model Computes Reflectance and Partials in Body Coordinates. This model solves for 2 scale parameters, one for each plate.
Spherical Model The light reflectance being modeled is that of a sphere.

 

Drag Models

All code samples for extending Drag Model Plugins are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/DragModels/<Language>/<Project>
Language Project Description
WSC Lift The atmospheric reflectance being modeled has components of lift and drag.
N-Plate N plate drag model. This model uses a 6-sided cube, 20 m^2 per side
Spherical The drag being modeled is that of a sphere.

Radar Plugins

All code samples for Radar plugins are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/Radar/<project name>/<Language>/<Project>
Language Project Description
C++ Clutter Geometry A plugin that enables you to configure the clutter geometry algorithm. The clutter geometry algorithm determines the location of each clutter point relative to the radar.
Clutter Map A plugin that enables you to apply your own clutter database to clutter computations for a Radar.
RCS A plugin that is used for modeling the time dynamic, aspect dependent RCS and the reflected polarization of the Radar signal.
C# Clutter Geometry This plugin enables you to configure the clutter geometry algorithm. The clutter geometry algorithm determines the location of each clutter point relative to the radar.
Clutter Map A plugin that enables you to apply your own clutter database to clutter computations for a Radar.
RCS A plugin that is used for modeling the time dynamic, aspect dependent RCS and the reflected polarization of the Radar signal.
wsc Clutter Geometry This plugin enables you to configure the clutter geometry algorithm. The clutter geometry algorithm determines the location of each clutter point relative to the radar.
Clutter Map A plugin that enables you to apply your own clutter database to clutter computations for a Radar.
RCS A plugin that is used for modeling the time dynamic, aspect dependent RCS and the reflected polarization of the Radar signal.

UI Plugins

All code samples for extending UI Plugins are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/Ui.Plugins/<Language>/<Project>
Language Project Description
C# Basic Adds a toolbar button, context menu, custom user interface, progress bar, and custom configuration page.
GfxAnalysis Contains a custom user interface that opens a scenario, adds a satellite, adds a sensor, and allows you to select an analysis to run on the objects. It shows the user how you can use the Object Model from a plugin.
RectangularSensorPlugin Adds a ProjectionStream to a rectangular sensors.
VgtGridPlugin Adds a spatial grid around an object.
Language Project Description
Visual Basic Basic Adds a toolbar button, context menu, custom user interface, progress bar, and custom configuration page.
Color Changer Allows the user to select multiple items in the Object Browser and change the items color with a color ramp or an explicit color. It shows the user how to use the Object Model from a plugin.

 

Graphics Plugins

All code samples for extending Graphics Plugins are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/Graphics/<Language>/<Project>
Language Project Description
C# OpenStreetMapPlugin Streams imagery from OpenStreetMap onto the globe.
ProjectionRasterStreamPlugin Projects a raster stream (video) onto a surface, such as terrian or a model, or the far end of a frustum.
Language Project Description
Visual Basic OpenStreetMapPlugin Streams imagery from OpenStreetMap onto the globe.
ProjectionRasterStreamPlugin Projects a raster stream (video) onto a surface, such as terrian or a model, or the far end of a frustum.
Language Project Description
Java

Note: For instructions on configuring the Java samples with the Eclipse IDE, click here.

Extend_STK_Plugin_Graphics_Common Sample code shared for Graphics Java plugins.
Extend_STK_Plugin_Graphics_ProjectionStream_Basic Demonstrates how to create a Graphics Projection Stream plugin that can display a custom configurable (via file path) raster and project it into the 3D graphics visualization space.
Extend_STK_Plugin_Graphics_RasterStream_Basic Demonstrates how to create a Graphics Raster Stream plugin that can display a custom configurable (via file path) raster as a layer within the 3D graphics visualization.
Extend_STK_Plugin_Graphics_CustomImageGlobeOverlay_OpenStreetMap Demonstrates how to create a Graphics Custom Image Globe Overlay using Open Street Map online tile urls within the 3D graphics visualization.

 

VGT Plugins

All code samples for extending VGT types are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/VGT.Plugins/<Language>/<Project>
Language Project Description
C++ Axes Rotates the ICRF VGT axes on the object by 30 degrees.
CalcScalar Add "Trajectory(CBF).Cartesian.X” and “Trajectory(CBF).Cartesian.Z”
Point Compute object's altitude and divide it by 2.
Vector Compute the average position of the Sun and Moon displacement vectors.
Language Project Description
C# Axes Rotates the ICRF VGT axes on the object by 30 degrees.
CalcScalar Add "Trajectory(CBF).Cartesian.X” and “Trajectory(CBF).Cartesian.Z”
Point Compute object's altitude and divide it by 2.
Vector Compute the average position of the Sun and Moon displacement vectors.
Language Project Description
Visual Basic Axes Rotates the ICRF VGT axes on the object by 30 degrees.
CalcScalar Add "Trajectory(CBF).Cartesian.X” and “Trajectory(CBF).Cartesian.Z”
Point Compute object's altitude and divide it by 2.
Vector Compute the average position of the Sun and Moon displacement vectors.
Language Project Description
WSC VGT.Axes.JScript.Example1 Rotates the ICRF VGT axes on the object by 30 degrees.
VGT.Axes.Perl.Example1 Rotates the ICRF VGT axes on the object by 30 degrees.
VGT.Axes.VBScript.Example1 Rotates the ICRF VGT axes on the object by 30 degrees.
VGT.CalcScalar.JScript.Example1 Add "Trajectory(CBF).Cartesian.X” and “Trajectory(CBF).Cartesian.Z”
VGT.CalcScalar.Perl.Example1 Add "Trajectory(CBF).Cartesian.X” and “Trajectory(CBF).Cartesian.Z”
VGT.CalcScalar.VBScript.Example1 Add "Trajectory(CBF).Cartesian.X” and “Trajectory(CBF).Cartesian.Z”
VGT.Point.JScript.Example1 Compute object's altitude and divide it by 2.
VGT.Point.Perl.Example1 Compute object's altitude and divide it by 2.
VGT.Point.VBScript.Example1 Compute object's altitude and divide it by 2.
VGT.Vector.JScript.Example1 Compute the average position of the Sun and Moon displacement vectors.
VGT.Vector.Perl.Example1 Compute the average position of the Sun and Moon displacement vectors.
VGT.Vector.VBScript.Example1 Compute the average position of the Sun and Moon displacement vectors.

 

Ephemeris File Reader

All code samples for reading ephemeris files are organized by programming language and project name in the Extend area as outlined below.

<STK install folder>/CodeSamples/Extend/EphemerisFileReader/<Language>/<Project>
Language Project Description
C# EphemerisFileReader Demonstrates reading ephemeris into STK by parsing an example data report style.
Language Project Description
WSC JScript.Example.EphemerisFileReader Demonstrates reading ephemeris into STK by parsing an example data report style.
VBScript.Example.EphemerisFileReader Demonstrates reading ephemeris into STK by parsing an example data report style.

 

STK Programming Interface 11.0.1