Primitive Manager

The primitive manager contains spatial data structures used to efficiently render primitives. Once a primitive is initialized, it must be added to the primitive manager before it will be rendered. For example:

[C#] Copy Code
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager;
IAgStkGraphicsPolylinePrimitive polyline = manager.Initializers.PolylinePrimitive.Initialize();
Array positions = new object[]
{
     0, 0, 0,
     0.017, 0, 0
};

polyline.SetCartographic("Earth", ref positions);
manager.Primitives.Add((IAgStkGraphicsPrimitive)polyline);

Once added to the manager, primitives are rendered the next time the scene is redrawn. This will happen when the user clicks a mouse button or the animation time changes. The scene can also be redrawn explicitly:

[C#] Copy Code
manager.Render(); // Redraw every 3D scene
manager.Scenes[0].Render(); // Redraw just one 3D scene

For best performance, add several primitives to the manager and only redraw the scene once after adding all the primitives.

When a primitive should no longer be rendered, remove it from the manager:

[C#] Copy Code
manager.Primitives.Remove((IAgStkGraphicsPrimitive)polyline);

STK Programming Interface 11.0.1