AGI STK Graphics 11 Send comments on this topic.
IAgStkGraphicsPolylinePrimitive Interface





Description

Renders a polyline in the 3D scene. Each line segment may have a different color. A polyline can be constructed with a Position Interpolator to render great arcs or rhumb lines.

Object Model


Public Methods

Public Method Set Defines the positions for a polyline primitive. The polyline is rendered in it's Reference Frame.
Public Method SetCartographic For convenience. Defines the positions of a polyline using Cartographic positions. Longitude and latitude are in radians, and altitude is in meters. This is equivalent to converting each position in positions to Cartesian and calling Set.
Public Method SetCartographicWithColors For convenience. Defines the positions and colors of a polyline using Cartographic positions. Longitude and latitude are in radians, and altitude is in meters. This is equivalent to converting each position in positions to Cartesian and calling Set.
Public Method SetCartographicWithColorsAndHint For convenience. Defines the positions and colors of a polyline using Cartographic positions. Longitude and latitude are in radians, and altitude is in meters. renderPassHint is provided for efficiency. This is equivalent to converting each position in positions to Cartesian and calling Set.
Public Method SetPartial Updates a subset of positions in a polyline.
Public Method SetPartialCartographic For convenience. Updates a subset of positions in a polyline using Cartographic positions. Longitude and latitude are in radians, and altitude is in meters. This is equivalent to converting each position in positions to Cartesian and calling SetPartial
Public Method SetPartialCartographicWithColors For convenience. Updates a subset of positions and/or colors in a polyline using Cartographic positions. Longitude and latitude are in radians, and altitude is in meters. This is equivalent to converting each position in positions to Cartesian and calling SetPartial
Public Method SetPartialCartographicWithColorsIndicesOrderAndRenderPass For convenience. Updates a subset of positions and/or colors in a polyline using Cartographic positions. Longitude and latitude are in radians, and altitude is in meters. This is equivalent to converting each position in positions to Cartesian and calling SetPartial
Public Method SetPartialCartographicWithIndicesOrder For convenience. Updates a subset of positions in a polyline using Cartographic positions. Longitude and latitude are in radians, and altitude is in meters. This is equivalent to converting each position in positions to Cartesian and calling SetPartial
Public Method SetPartialWithColors Updates a subset of positions and/or colors in a polyline.
Public Method SetPartialWithColorsIndicesOrderAndRenderPassHint Updates a subset of positions and/or colors in a polyline.
Public Method SetPartialWithIndicesOrder Updates a subset of positions in a polyline.
Public Method SetSubset Defines the positions of a polyline using a subset of input positions.
Public Method SetSubsetCartographic For convenience. Defines the positions of a polyline using a subset of input Cartographic positions. Longitude and latitude are in radians, and altitude is in meters. This is equivalent to converting the subset of positions to Cartesian and calling SetSubset.
Public Method SetWithColors Defines the positions and colors of a polyline. The polyline is rendered in it's Reference Frame.
Public Method SetWithColorsAndHint Defines the positions and colors of a polyline. The polyline is rendered in it's Reference Frame. renderPassHint is provided for efficiency.
Public Method SetWithSolidTriangulatorResult Defines the positions of a polyline using the outline positions of the specified solidTriangulatorResult.
Public Method SetWithSurfaceShapesResult Defines the positions of a polyline using the positions of the specified surfaceShapesResult.
Public Method SetWithSurfaceTriangulatorResult Defines the positions of a polyline using the boundary positions of the specified surfaceTriangulatorResult.

Public Properties

Public Property CentralBodyClipped Gets or sets whether the polyline will be clipped by the central body.
Public Property DisplayOutline Gets or sets whether an outline is rendered around the polyline.
Public Property MaximumWidthSupported Gets the maximum width, in pixels, supported by the video card.
Public Property MinimumWidthSupported Gets the minimum width, in pixels, supported by the video card.
Public Property OutlineColor Gets or sets the outline's color.
Public Property OutlineTranslucency Gets or sets the translucency of the outline. Translucency is between 0 and 1, where 0 is opaque and 1 is transparent.
Public Property OutlineWidth Gets or sets the width, in pixels, of the outline around the polyline.
Public Property PerItemPickingEnabled Gets or sets whether individual line indices will be included in the PickResults returned from the Scene's Pick method. Each line index that is picked will be returned as a BatchPrimitiveIndex.
Public Property PolylineType Gets how the polyline interprets the positions passed to Set methods.
Public Property PositionInterpolator Gets the Position Interpolator applied to positions passed to Set, SetCartographic, SetSubset, and SetSubsetCartographic methods. When this property is null, linear interpolation is used.
Public Property SetHint Gets the primitive's Set Hint. See the Set Hint Performance Overview for selecting an appropriate value to construct the primitive with.
Public Property Width Gets or sets the line width, in pixels.

Example

Draw a STK area target outline on the globe
[C#] Copy Code
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager; 
 
IAgStkGraphicsPolylinePrimitive line = manager.Initializers.PolylinePrimitive.Initialize(); 
line.Set(ref positions); 
line.Width = 2
((IAgStkGraphicsPrimitive)line).Color = Color.Yellow; 
line.DisplayOutline = true
line.OutlineWidth = 2
line.OutlineColor = Color.Black; 
 
manager.Primitives.Add((IAgStkGraphicsPrimitive)line); 
 

Draw the outline of a circle on the globe
[C#] Copy Code
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager; 
Array center = new object[] { 39.88, -75.250.0 }; // Philadelphia 
 
IAgStkGraphicsSurfaceShapesResult shape = manager.Initializers.SurfaceShapes.ComputeCircleCartographic("Earth"ref center, 10000); 
Array positions = shape.Positions; 
 
IAgStkGraphicsPolylinePrimitive line = manager.Initializers.PolylinePrimitive.InitializeWithType(shape.PolylineType); 
line.Set(ref positions); 
line.Width = 2
((IAgStkGraphicsPrimitive)line).Color = Color.White; 
 
manager.Primitives.Add((IAgStkGraphicsPrimitive)line); 
 

Draw a line between two points
[C#] Copy Code
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager; 
Array philadelphia = new object[] 

    39.88
    -75.25
    3000.0 
}; 
Array washingtonDC = new object[] 

    38.85
    -77.04
    3000.0 
}; 
 
Array positions = new object[6]; 
philadelphia.CopyTo(positions, 0); 
washingtonDC.CopyTo(positions, 3); 
 
IAgStkGraphicsPolylinePrimitive line = manager.Initializers.PolylinePrimitive.Initialize(); 
line.SetCartographic("Earth"ref positions); 
manager.Primitives.Add((IAgStkGraphicsPrimitive)line); 
 

Draw the outline of an ellipse on the globe
[C#] Copy Code
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager; 
Array center = new object[] { 38.85, -77.043000.0 }; // Washington, DC 
 
IAgStkGraphicsSurfaceShapesResult shape = manager.Initializers.SurfaceShapes.ComputeEllipseCartographic( 
    "Earth"ref center, 450003000045); 
Array positions = shape.Positions; 
 
IAgStkGraphicsPolylinePrimitive line = manager.Initializers.PolylinePrimitive.InitializeWithType(shape.PolylineType); 
line.Set(ref positions); 
((IAgStkGraphicsPrimitive)line).Color = Color.Cyan; 
 
manager.Primitives.Add((IAgStkGraphicsPrimitive)line); 
 

Draw a great arc on the globe
[C#] Copy Code
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager; 
Array washingtonDC = new object[] 

    38.85
    -77.04
    0.0 
}; 
Array newOrleans = new object[] 

    29.98
    -90.25
    0.0 
}; 
 
Array positions = new object[6]; 
washingtonDC.CopyTo(positions, 0); 
newOrleans.CopyTo(positions, 3); 
 
IAgStkGraphicsPositionInterpolator interpolator = manager.Initializers.GreatArcInterpolator.Initialize() as IAgStkGraphicsPositionInterpolator; 
IAgStkGraphicsPolylinePrimitive line = manager.Initializers.PolylinePrimitive.InitializeWithInterpolator(interpolator); 
line.SetCartographic("Earth"ref positions); 
 
manager.Primitives.Add((IAgStkGraphicsPrimitive)line); 
 

Draw a rhumb line on the globe
[C#] Copy Code
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager; 
Array newOrleans = new object[] 

    29.98
    -90.25
    0.0 
}; 
Array sanJose = new object[] 

    37.37
    -121.92
    0.0 
}; 
 
Array positions = new object[6]; 
newOrleans.CopyTo(positions, 0); 
sanJose.CopyTo(positions, 3); 
 
IAgStkGraphicsPositionInterpolator interpolator = manager.Initializers.RhumbLineInterpolator.Initialize() as IAgStkGraphicsPositionInterpolator; 
IAgStkGraphicsPolylinePrimitive line = manager.Initializers.PolylinePrimitive.InitializeWithInterpolator(interpolator); 
line.SetCartographic("Earth"ref positions); 
manager.Primitives.Add((IAgStkGraphicsPrimitive)line); 
 

Draw a STK area target outline on the globe
[Visual Basic .NET] Copy Code
Dim manager As IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario, IAgScenario).SceneManager

Dim line As IAgStkGraphicsPolylinePrimitive = manager.Initializers.PolylinePrimitive.Initialize()

line.Set(positions)
line.Width = 2
DirectCast(line, IAgStkGraphicsPrimitive).Color = Color.Yellow
line.DisplayOutline = True
line.OutlineWidth = 2
line.OutlineColor = Color.Black

manager.Primitives.Add(DirectCast(line, IAgStkGraphicsPrimitive))

Draw the outline of a circle on the globe
[Visual Basic .NET] Copy Code
Dim manager As IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario, IAgScenario).SceneManager
Dim philadelphia As Array = New Object() {39.88, -75.25, 0.0}

Dim shape As IAgStkGraphicsSurfaceShapesResult = manager.Initializers.SurfaceShapes.ComputeCircleCartographic("Earth", philadelphia, 10000)
Dim positions As Array = shape.Positions

Dim line As IAgStkGraphicsPolylinePrimitive = manager.Initializers.PolylinePrimitive.InitializeWithType(shape.PolylineType)
line.Set(positions)
line.Width = 2
DirectCast(line, IAgStkGraphicsPrimitive).Color = Color.White

manager.Primitives.Add(DirectCast(line, IAgStkGraphicsPrimitive))

Draw a line between two points
[Visual Basic .NET] Copy Code
Dim manager As IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario, IAgScenario).SceneManager
Dim philadelphia As Array = New Object() {39.88, -75.25, 3000.0}
Dim washingtonDC As Array = New Object() {38.85, -77.04, 3000.0}

Dim positions As Array = New Object(5) {}
philadelphia.CopyTo(positions, 0)
washingtonDC.CopyTo(positions, 3)

Dim line As IAgStkGraphicsPolylinePrimitive = manager.Initializers.PolylinePrimitive.Initialize()
'$planetName$Name of the planet to place primitive$
line.SetCartographic("Earth", positions)
manager.Primitives.Add(DirectCast(line, IAgStkGraphicsPrimitive))

Draw the outline of an ellipse on the globe
[Visual Basic .NET] Copy Code
Dim manager As IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario, IAgScenario).SceneManager
Dim washingtonDC As Array = New Object() {38.85, -77.04, 3000.0}

Dim shape As IAgStkGraphicsSurfaceShapesResult = manager.Initializers.SurfaceShapes.ComputeEllipseCartographic("Earth", washingtonDC, 45000, 30000, 45)
Dim positions As Array = shape.Positions

Dim line As IAgStkGraphicsPolylinePrimitive = manager.Initializers.PolylinePrimitive.InitializeWithType(shape.PolylineType)
line.Set(positions)
DirectCast(line, IAgStkGraphicsPrimitive).Color = Color.Cyan

manager.Primitives.Add(DirectCast(line, IAgStkGraphicsPrimitive))

Draw a great arc on the globe
[Visual Basic .NET] Copy Code
Dim manager As IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario, IAgScenario).SceneManager
Dim washingtonDC As Array = New Object() {38.85, -77.04, 0.0}
Dim newOrleans As Array = New Object() {29.98, -90.25, 0.0}

Dim positions As Array = New Object(5) {}
washingtonDC.CopyTo(positions, 0)
newOrleans.CopyTo(positions, 3)

Dim interpolator As IAgStkGraphicsPositionInterpolator = TryCast(manager.Initializers.GreatArcInterpolator.Initialize(), IAgStkGraphicsPositionInterpolator)
Dim line As IAgStkGraphicsPolylinePrimitive = manager.Initializers.PolylinePrimitive.InitializeWithInterpolator(interpolator)
line.SetCartographic("Earth", positions)

manager.Primitives.Add(DirectCast(line, IAgStkGraphicsPrimitive))

Draw a rhumb line on the globe
[Visual Basic .NET] Copy Code
Dim manager As IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario, IAgScenario).SceneManager
Dim newOrleans As Array = New Object() {29.98, -90.25, 0.0}
Dim sanJose As Array = New Object() {37.37, -121.92, 0.0}

Dim positions As Array = New Object(5) {}
newOrleans.CopyTo(positions, 0)
sanJose.CopyTo(positions, 3)

Dim interpolator As IAgStkGraphicsPositionInterpolator = TryCast(manager.Initializers.RhumbLineInterpolator.Initialize(), IAgStkGraphicsPositionInterpolator)
Dim line As IAgStkGraphicsPolylinePrimitive = manager.Initializers.PolylinePrimitive.InitializeWithInterpolator(interpolator)
line.SetCartographic("Earth", positions)
manager.Primitives.Add(DirectCast(line, IAgStkGraphicsPrimitive))

Draw a new Polyline Primitive
[MATLAB] Copy Code
% IAgScenario scenario: Scenario object 
% 3(n) x 1 cell result: cell of LLA values 
% Create a polyline primitive and sets properties 
manager = scenario.SceneManager; 
polyline = manager.Initializers.PolylinePrimitive.InitializeWithType('eStkGraphicsPolylineTypeLineStrip'); 
polyline.SetCartographic('Earth', result); 
polyline.Color = 255; % Red 
polyline.Width = 3; 
polyline.Translucency = 0; 
polyline.Display = true; 
polyline.DisplayOutline = false; 
manager.Primitives.Add(polyline); 
manager.Render; 
 
%% 
path = manager.Initializers.PathPrimitive.Initialize(); 
path.Width = 2; 
 
interpolator = manager.Initializers.GreatArcInterpolator.InitializeWithCentralBody('Earth'); 
interpolator.Granularity = 1; 
interpolator.PolylineType(1); 
 
result = interpolator.Interpolate({2.383;13.049;10;0.054;35.919;10}); 
%path.AddRangeToFront(reshape(result,length(result)/3,3)); 
 
counter = 1; 
for i=counter:3:length(result) 
    cartesian = root.ConversionUtility.ConvertPositionArray('eGeodetic',{result{i}, result{i+1}, result{i+2}},'eCartesian'); 
    pt = manager.Initializers.PathPoint.Initialize; 
    pt.Position = cartesian'; 
    pt.Translucency = .25; 
 
    counter = counter + 1; 
    if (rem(counter,2) == 0) 
        pt.Color = 255; 
    else 
        pt.Color = 65280; 
    end 
    path.AddBack(pt); 
end 
 
manager.Primitives.Add(path); 
manager.Render; 
 
 

See Also

CoClasses that Implement IAgStkGraphicsPolylinePrimitive

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1