Description
Renders filled solid objects and their outlines. Example solids include boxes and ellipsoids. Various effects are supported, such as displaying the solid's silhouette, and hiding the outline of the backside of the solid. In cases where you just want to visualize a solid's fill or outline, a
Triangle Mesh Primitive or
Polyline Primitive can be used for reduced overhead.
Public Methods
Set | Defines the solid using the specified parameters. The solid is rendered in the primitive's Reference Frame. |
SetWithResult | Defines the solid using the specified solidTriangulatorResult. The solid is rendered in the primitive's Reference Frame. |
Public Properties
AffectedByLighting | Gets or sets whether the primitive is affected by lighting. |
BackLineColor | Gets or sets the back line's color. |
BackLineTranslucency | Gets or sets the back line's translucency. Translucency is between 0 and 1 , where 0 is opaque and 1 is transparent. |
BackLineWidth | Gets or sets the back line's width, in pixels. |
DisplayFill | Gets or sets whether the solid's fill is displayed. |
DisplayOutline | Gets or sets whether the solid's outline is displayed. |
DisplaySilhouette | Gets or sets whether the solid's silhouette is displayed. |
MaximumSilhouetteWidthSupported | Gets the maximum silhouette width, in pixels, supported by the video card. |
MinimumSilhouetteWidthSupported | Gets the minimum silhouette width, in pixels, supported by the video card. |
OutlineAppearance | Gets or sets the outline's appearance. |
OutlineColor | Gets or sets the outline's color. |
OutlineTranslucency | Gets or sets the outline's translucency. Translucency is between 0 and 1 , where 0 is opaque and 1 is transparent. |
OutlineWidth | Gets or sets the outline's width, in pixels. |
Position | Gets or sets the solid's position. The position is defined in the solid's Reference Frame. The array contains the components of the position in the order x, y, z. |
Rotation | Gets or sets the rotation applied to the solid before rendering. |
Scale | Gets or sets a non-uniform scale that is applied to the solid to increase or decrease its rendered size. The array contains the scale for each component of the size in the order x scale, y scale, z scale. |
SetHint | Gets the primitive's Set Hint. See the Set Hint Performance Overview for selecting an appropriate value to construct the primitive with. |
SilhouetteColor | Gets or sets the silhouette's color. |
SilhouetteTranslucency | Gets or sets the silhouette's translucency. Translucency is between 0 and 1 , where 0 is opaque and 1 is transparent. |
SilhouetteWidth | Gets or sets the silhouette' width, in pixels. |
Interfaces
CoClasses that Implement IAgStkGraphicsSolidPrimitive
Example
Z-order primitives on the surface
[C#] |
---|
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager;
IAgStkGraphicsTriangleMeshPrimitive pennsylvania = manager.Initializers.TriangleMeshPrimitive.Initialize();
pennsylvania.SetTriangulator((IAgStkGraphicsTriangulatorResult)manager.Initializers.SurfacePolygonTriangulator.Compute(
"Earth", ref pennsylvaniaPositions));
((IAgStkGraphicsPrimitive)pennsylvania).Color = Color.Yellow;
IAgStkGraphicsTriangleMeshPrimitive areaCode610 = manager.Initializers.TriangleMeshPrimitive.Initialize();
areaCode610.SetTriangulator((IAgStkGraphicsTriangulatorResult)manager.Initializers.SurfacePolygonTriangulator.Compute(
"Earth", ref areaCode610Positions));
((IAgStkGraphicsPrimitive)areaCode610).Color = Color.DarkRed;
IAgStkGraphicsTriangleMeshPrimitive areaCode215 = manager.Initializers.TriangleMeshPrimitive.Initialize();
areaCode215.SetTriangulator((IAgStkGraphicsTriangulatorResult)manager.Initializers.SurfacePolygonTriangulator.Compute(
"Earth", ref areaCode215Positions));
((IAgStkGraphicsPrimitive)areaCode215).Color = Color.Green;
IAgStkGraphicsPolylinePrimitive schuylkillRiver = manager.Initializers.PolylinePrimitive.Initialize();
schuylkillRiver.Set(ref schuylkillPositions);
((IAgStkGraphicsPrimitive)schuylkillRiver).Color = Color.Blue;
schuylkillRiver.Width = 2;
IAgStkGraphicsCompositePrimitive composite = manager.Initializers.CompositePrimitive.Initialize();
composite.Add((IAgStkGraphicsPrimitive)pennsylvania);
composite.Add((IAgStkGraphicsPrimitive)areaCode610);
composite.Add((IAgStkGraphicsPrimitive)areaCode215);
composite.Add((IAgStkGraphicsPrimitive)schuylkillRiver);
manager.Primitives.Add((IAgStkGraphicsPrimitive)composite);
|
|
Draw a box
[C#] |
---|
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager;
Array size = new object[] {1000, 1000, 2000 };
IAgStkGraphicsSolidTriangulatorResult result = manager.Initializers.BoxTriangulator.Compute(ref size);
IAgStkGraphicsSolidPrimitive solid = manager.Initializers.SolidPrimitive.Initialize();
((IAgStkGraphicsPrimitive)solid).ReferenceFrame = system;
solid.SetWithResult(result);
manager.Primitives.Add((IAgStkGraphicsPrimitive)solid);
|
|
Draw a cylinder
[C#] |
---|
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager;
IAgStkGraphicsSolidTriangulatorResult result = manager.Initializers.CylinderTriangulator.CreateSimple(1000, 2000);
IAgStkGraphicsSolidPrimitive solid = manager.Initializers.SolidPrimitive.Initialize();
((IAgStkGraphicsPrimitive)solid).ReferenceFrame = system;
((IAgStkGraphicsPrimitive)solid).Color = Color.Yellow;
solid.OutlineColor = Color.Black;
solid.OutlineWidth = 2;
solid.OutlineAppearance = AgEStkGraphicsOutlineAppearance.eStkGraphicsStylizeBackLines;
solid.BackLineColor = Color.Black;
solid.BackLineWidth = 1;
solid.SetWithResult(result);
manager.Primitives.Add((IAgStkGraphicsPrimitive)solid);
|
|
Draw an ellipsoid
[C#] |
---|
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager;
Array radii = new object[] {2000, 1000, 1000 };
IAgStkGraphicsSolidTriangulatorResult result = manager.Initializers.EllipsoidTriangulator.ComputeSimple(ref radii);
IAgStkGraphicsSolidPrimitive solid = manager.Initializers.SolidPrimitive.Initialize();
((IAgStkGraphicsPrimitive)solid).ReferenceFrame = system;
((IAgStkGraphicsPrimitive)solid).Color = Color.Orange;
((IAgStkGraphicsPrimitive)solid).Translucency = 0.3f;
solid.OutlineAppearance = AgEStkGraphicsOutlineAppearance.eStkGraphicsFrontLinesOnly;
solid.OutlineColor = Color.Blue;
solid.OutlineWidth = 2;
solid.DisplaySilhouette = true;
solid.SetWithResult(result);
manager.Primitives.Add((IAgStkGraphicsPrimitive)solid);
|
|
Z-order primitives on the surface
[Visual Basic .NET] |
---|
Dim manager As IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario, IAgScenario).SceneManager
Dim pennsylvania As IAgStkGraphicsTriangleMeshPrimitive = manager.Initializers.TriangleMeshPrimitive.Initialize()
pennsylvania.SetTriangulator(DirectCast(manager.Initializers.SurfacePolygonTriangulator.Compute("Earth", pennsylvaniaPositions), IAgStkGraphicsTriangulatorResult))
DirectCast(pennsylvania, IAgStkGraphicsPrimitive).Color = Color.Yellow
Dim areaCode610 As IAgStkGraphicsTriangleMeshPrimitive = manager.Initializers.TriangleMeshPrimitive.Initialize()
areaCode610.SetTriangulator(DirectCast(manager.Initializers.SurfacePolygonTriangulator.Compute("Earth", areaCode610Positions), IAgStkGraphicsTriangulatorResult))
DirectCast(areaCode610, IAgStkGraphicsPrimitive).Color = Color.DarkRed
Dim areaCode215 As IAgStkGraphicsTriangleMeshPrimitive = manager.Initializers.TriangleMeshPrimitive.Initialize()
areaCode215.SetTriangulator(DirectCast(manager.Initializers.SurfacePolygonTriangulator.Compute("Earth", areaCode215Positions), IAgStkGraphicsTriangulatorResult))
DirectCast(areaCode215, IAgStkGraphicsPrimitive).Color = Color.Green
Dim schuylkillRiver As IAgStkGraphicsPolylinePrimitive = manager.Initializers.PolylinePrimitive.Initialize()
schuylkillRiver.Set(schuylkillPositions)
DirectCast(schuylkillRiver, IAgStkGraphicsPrimitive).Color = Color.Blue
schuylkillRiver.Width = 2
Dim composite As IAgStkGraphicsCompositePrimitive = manager.Initializers.CompositePrimitive.Initialize()
composite.Add(DirectCast(pennsylvania, IAgStkGraphicsPrimitive))
composite.Add(DirectCast(areaCode610, IAgStkGraphicsPrimitive))
composite.Add(DirectCast(areaCode215, IAgStkGraphicsPrimitive))
composite.Add(DirectCast(schuylkillRiver, IAgStkGraphicsPrimitive))
manager.Primitives.Add(DirectCast(composite, IAgStkGraphicsPrimitive))
|
|
Draw a box
[Visual Basic .NET] |
---|
Dim manager As IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario, IAgScenario).SceneManager
Dim pos As Array = New Object() {1000, 1000, 2000}
Dim result As IAgStkGraphicsSolidTriangulatorResult = manager.Initializers.BoxTriangulator.Compute(pos)
Dim solid As IAgStkGraphicsSolidPrimitive = manager.Initializers.SolidPrimitive.Initialize()
DirectCast(solid, IAgStkGraphicsPrimitive).ReferenceFrame = system
solid.SetWithResult(result)
manager.Primitives.Add(DirectCast(solid, IAgStkGraphicsPrimitive))
|
|
Draw a cylinder
[Visual Basic .NET] |
---|
Dim manager As IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario, IAgScenario).SceneManager
Dim result As IAgStkGraphicsSolidTriangulatorResult = manager.Initializers.CylinderTriangulator.CreateSimple(1000, 2000)
Dim solid As IAgStkGraphicsSolidPrimitive = manager.Initializers.SolidPrimitive.Initialize()
DirectCast(solid, IAgStkGraphicsPrimitive).ReferenceFrame = system
DirectCast(solid, IAgStkGraphicsPrimitive).Color = Color.Yellow
solid.OutlineColor = Color.Black
solid.OutlineWidth = 2
solid.OutlineAppearance = AgEStkGraphicsOutlineAppearance.eStkGraphicsStylizeBackLines
solid.BackLineColor = Color.Black
solid.BackLineWidth = 1
solid.SetWithResult(result)
manager.Primitives.Add(DirectCast(solid, IAgStkGraphicsPrimitive))
|
|
Draw an ellipsoid
[Visual Basic .NET] |
---|
Dim manager As IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario, IAgScenario).SceneManager
Dim radii As Array = New Object() {2000, 1000, 1000}
Dim result As IAgStkGraphicsSolidTriangulatorResult = manager.Initializers.EllipsoidTriangulator.ComputeSimple(radii)
Dim solid As IAgStkGraphicsSolidPrimitive = manager.Initializers.SolidPrimitive.Initialize()
DirectCast(solid, IAgStkGraphicsPrimitive).ReferenceFrame = DirectCast(system, IAgCrdnSystem)
DirectCast(solid, IAgStkGraphicsPrimitive).Color = Color.Orange
DirectCast(solid, IAgStkGraphicsPrimitive).Translucency = 0.3F
solid.OutlineAppearance = AgEStkGraphicsOutlineAppearance.eStkGraphicsFrontLinesOnly
solid.OutlineColor = Color.Blue
solid.OutlineWidth = 2
solid.DisplaySilhouette = True
solid.SetWithResult(result)
manager.Primitives.Add(DirectCast(solid, IAgStkGraphicsPrimitive))
|
|
Draw a Solid Box Primitive and set properties
[Python - STK API] |
---|
# IAgScenario scenario: Scenario object
manager = scenario.SceneManager
originBox = root.ConversionUtility.NewPositionOnEarth()
originBox.AssignGeodetic(0, 3, 100)
orientBox = root.ConversionUtility.NewOrientation()
orientBox.AssignAzEl(0, 0, AgEAzElAboutBoresight.eAzElAboutBoresightRotate)
size = [[100], [100], [200]]
result = manager.Initializers.BoxTriangulator.Compute(size)
solidBox = manager.Initializers.SolidPrimitive.Initialize()
solidBox.ReferenceFrame = root.CentralBodies.Earth.Vgt.Systems.Item('Fixed')
solidBox.Position = originBox.QueryCartesianArray()
solidBox.SetWithResult(result)
solidBox.Color = Colors.Red
solidBox.OutlineColor = Colors.Cyan
solidBox.Translucency = .75
solidBox.Rotation = orientBox
manager.Primitives.Add(solidBox)
manager.Render()
|
|
Draw a Solid Ellipsoid Primitive and set properties
[Python - STK API] |
---|
# IAgScenario scenario: Scenario object
manager = scenario.SceneManager
originEllipsoid = root.ConversionUtility.NewPositionOnEarth()
originEllipsoid.AssignGeodetic(0, 5, 100)
orientEllipsoid = root.ConversionUtility.NewOrientation()
orientEllipsoid.AssignAzEl(0, 0, AgEAzElAboutBoresight.eAzElAboutBoresightRotate)
radii = [[200], [100], [100]]
ellipsoid = manager.Initializers.EllipsoidTriangulator.ComputeSimple(radii)
solidEllipsoid = manager.Initializers.SolidPrimitive.Initialize()
solidEllipsoid.ReferenceFrame = root.CentralBodies.Earth.Vgt.Systems.Item('Fixed') # vgtSat.Systems.Item('Body')
solidEllipsoid.Position = originEllipsoid.QueryCartesianArray()
solidEllipsoid.SetWithResult(ellipsoid)
solidEllipsoid.Color = Colors.White
solidEllipsoid.OutlineColor = Colors.DeepPink
solidEllipsoid.Translucency = .75
solidEllipsoid.Rotation = orientEllipsoid
manager.Primitives.Add(solidEllipsoid)
manager.Render()
|
|
Draw a Solid Cylinder Primitive and set properties
[Python - STK API] |
---|
# IAgScenario scenario: Scenario object
manager = scenario.SceneManager
originCylinder = root.ConversionUtility.NewPositionOnEarth()
originCylinder.AssignGeodetic(0, 7, 100)
orientCylinder = root.ConversionUtility.NewOrientation()
orientCylinder.AssignAzEl(0, 0, AgEAzElAboutBoresight.eAzElAboutBoresightRotate)
cylinder = manager.Initializers.CylinderTriangulator.CreateSimple(200, 100)
solidCylinder = manager.Initializers.SolidPrimitive.Initialize()
solidCylinder.ReferenceFrame = root.CentralBodies.Earth.Vgt.Systems.Item('Fixed')
solidCylinder.Position = originCylinder.QueryCartesianArray()
solidCylinder.SetWithResult(cylinder)
solidCylinder.Color = Colors.Lime
solidCylinder.OutlineColor = Colors.Blue
solidCylinder.OutlineWidth = 3
solidCylinder.Translucency = .75
solidCylinder.Rotation = orientCylinder
manager.Primitives.Add(solidCylinder)
manager.Render()
|
|
Draw a Solid Box Primitive and set properties
[MATLAB] |
---|
% IAgScenario scenario: Scenario object
manager = scenario.SceneManager;
originBox = root.ConversionUtility.NewPositionOnEarth();
originBox.AssignGeodetic(0, 3, 100);
orientBox = root.ConversionUtility.NewOrientation();
orientBox.AssignAzEl(0, 0, 'eAzElAboutBoresightRotate');
size = {100; 100; 200};
result = manager.Initializers.BoxTriangulator.Compute(size);
solidBox = manager.Initializers.SolidPrimitive.Initialize();
solidBox.ReferenceFrame = root.CentralBodies.Earth.Vgt.Systems.Item('Fixed');
solidBox.Position = originBox.QueryCartesianArray;
solidBox.SetWithResult(result);
solidBox.Color = 255;
solidBox.OutlineColor = 16776974;
solidBox.Translucency = .75;
solidBox.Rotation = orientBox;
manager.Primitives.Add(solidBox);
manager.Render();
|
|
Draw a Solid Ellipsoid Primitive and set properties
[MATLAB] |
---|
% IAgScenario scenario: Scenario object
manager = scenario.SceneManager;
originEllipsoid = root.ConversionUtility.NewPositionOnEarth();
originEllipsoid.AssignGeodetic(0, 5, 100);
orientEllipsoid = root.ConversionUtility.NewOrientation();
orientEllipsoid.AssignAzEl(0, 0, 'eAzElAboutBoresightRotate');
radii = {200; 100; 100};
ellipsoid = manager.Initializers.EllipsoidTriangulator.ComputeSimple(radii);
solidEllipsoid = manager.Initializers.SolidPrimitive.Initialize();
solidEllipsoid.ReferenceFrame = root.CentralBodies.Earth.Vgt.Systems.Item('Fixed'); % vgtSat.Systems.Item('Body');
solidEllipsoid.Position = originEllipsoid.QueryCartesianArray;
solidEllipsoid.SetWithResult(ellipsoid);
solidEllipsoid.Color = 16777215;
solidEllipsoid.OutlineColor = 15863551;
solidEllipsoid.Translucency = .75;
solidEllipsoid.Rotation = orientEllipsoid;
manager.Primitives.Add(solidEllipsoid);
manager.Render();
|
|
Draw a Solid Cylinder Primitive and set properties
[MATLAB] |
---|
% IAgScenario scenario: Scenario object
manager = scenario.SceneManager;
originCylinder = root.ConversionUtility.NewPositionOnEarth();
originCylinder.AssignGeodetic(0, 7, 100);
orientCylinder = root.ConversionUtility.NewOrientation();
orientCylinder.AssignAzEl(0, 0, 'eAzElAboutBoresightRotate');
cylinder = manager.Initializers.CylinderTriangulator.CreateSimple(200, 100);
solidCylinder = manager.Initializers.SolidPrimitive.Initialize();
solidCylinder.ReferenceFrame = root.CentralBodies.Earth.Vgt.Systems.Item('Fixed');
solidCylinder.Position = originCylinder.QueryCartesianArray;
solidCylinder.SetWithResult(cylinder);
solidCylinder.Color = 65280;
solidCylinder.OutlineColor = 16711680;
solidCylinder.OutlineWidth = 3;
solidCylinder.Translucency = .75;
solidCylinder.Rotation = orientCylinder;
manager.Primitives.Add(solidCylinder);
manager.Render();
|
|
See Also