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





Description

Renders one or more strings in the 3D scene.

For best performance, avoid creating lots of batches with only a few strings each. See the Batching Performance Overview.

Object Model




Public Methods

Public Method Set Defines the positions and text of strings in a text batch. The strings are rendered in the primitive's Reference Frame.
Public Method SetCartographic For convenience. Defines the positions and text of strings in a text batch 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 SetCartographicWithOptionalParameters For convenience. Defines the positions, text, and optional parameters of strings in a text batch 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 SetCartographicWithOptionalParametersAndRenderPass For convenience. Defines the positions, text, and optional parameters of strings in a text batch 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 SetPartial Updates a subset of positions and/or text in a text batch.
Public Method SetPartialCartographic For convenience. Updates a subset of positions and/or text in a text batch 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 Partial.
Public Method SetPartialCartographicWithIndicesOrder For convenience. Updates a subset of positions and/or text in a text batch 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 Partial.
Public Method SetPartialCartographicWithOptionalParameters For convenience. Updates a subset of positions, text, and/or per-string parameters in a text batch 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 Partial.
Public Method SetPartialCartographicWithOptionalParametersIndicesOrderAndRenderPass For convenience. Updates a subset of positions, text, and/or per-string parameters in a text batch 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 Partial.
Public Method SetPartialWithIndicesOrder Updates a subset of positions and/or text in a text batch.
Public Method SetPartialWithOptionalParameters Updates a subset of positions, text, and/or optional per-string parameters in a text batch.
Public Method SetPartialWithOptionalParametersIndicesOrderAndRenderPass Updates a subset of positions, text, and/or optional per-string parameters in a text batch.
Public Method SetWithOptionalParameters Defines the positions, text, and optional parameters of strings in a text batch. The strings are rendered in the primitive's Reference Frame.
Public Method SetWithOptionalParametersAndRenderPass Defines the positions, text, and optional parameters of strings in a text batch. The strings are rendered in the primitive's Reference Frame. renderPassHint is provided for efficiency.

Public Properties

Public Property AlignToPixel Gets or sets whether the screen space position of each string is aligned to a pixel.
Public Property BoundingSphereScale Gets or sets the scale applied to the radius of this primitive's bounding sphere.
Public Property DistanceDisplayConditionPerString Gets or sets a Distance Display Condition that is evaluated per string in the text batch during rendering. This is different than Display Condition, which is evaluated once for the entire text batch. When DistanceDisplayConditionPerString is null, no per string display condition is evaluated.
Public Property Font Gets the font used to render the text batch.
Public Property OutlineColor Gets or sets the text's outline color.
Public Property OutlineTranslucency Gets or sets the text's outline translucency. Translucency is between 0 and 1, where 0 is opaque and 1 is transparent.
Public Property PerItemPickingEnabled Gets or sets whether individual text indices will be included in the PickResults returned from the Scene's Pick method. Each text index that is picked will be returned as a BatchPrimitiveIndex.
Public Property RenderInScreenSpace Gets or sets whether the primitive is positioned and rendered in screen space coordinates.
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 TextureFilter Gets or sets the filter used to filter the texture-based Font.

Example

Draw a set of strings
[C#] Copy Code
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager; 
 
Array text = new object[] 

    "Philadelphia"
    "Washington, D.C."
    "New Orleans"
    "San Jose" 
}; 
 
Array positions = new object[] 

    39.88, -75.250,    // Philadelphia 
    38.85, -77.040// Washington, D.C. 
    29.98, -90.250// New Orleans 
    37.37, -121.920    // San Jose 
}; 
 
IAgStkGraphicsGraphicsFont font = manager.Initializers.GraphicsFont.InitializeWithNameSizeFontStyleOutline("MS Sans Serif"12, AgEStkGraphicsFontStyle.eStkGraphicsFontStyleBold, true); 
IAgStkGraphicsTextBatchPrimitive textBatch = manager.Initializers.TextBatchPrimitive.InitializeWithGraphicsFont(font); 
((IAgStkGraphicsPrimitive)textBatch).Color = Color.White; 
textBatch.OutlineColor = Color.Red; 
textBatch.SetCartographic("Earth"ref positions, ref text); 
 
manager.Primitives.Add((IAgStkGraphicsPrimitive)textBatch); 
 

Draw a set of uniquely colored strings
[C#] Copy Code
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager; 
Array strings = new object[] 

    "San Francisco"
    "Sacramento"
    "Los Angeles"
    "San Diego" 
}; 
 
Array positions = new object[] 

    37.62, -122.380.0
    38.52, -121.500.0
    33.93, -118.400.0
    32.82, -117.130.0 
}; 
 
Array colors = new object[] 

    (uint)Color.Red.ToArgb(), 
    (uint)Color.Green.ToArgb(), 
    (uint)Color.Blue.ToArgb(), 
    (uint)Color.White.ToArgb() 
}; 
 
IAgStkGraphicsTextBatchPrimitiveOptionalParameters parameters = manager.Initializers.TextBatchPrimitiveOptionalParameters.Initialize(); 
parameters.SetColors(ref colors); 
 
IAgStkGraphicsGraphicsFont font = manager.Initializers.GraphicsFont.InitializeWithNameSizeFontStyleOutline("MS Sans Serif"12, AgEStkGraphicsFontStyle.eStkGraphicsFontStyleBold, false); 
IAgStkGraphicsTextBatchPrimitive textBatch = manager.Initializers.TextBatchPrimitive.InitializeWithGraphicsFont(font); 
textBatch.SetCartographicWithOptionalParameters("Earth"ref positions, ref strings, parameters); 
 
manager.Primitives.Add((IAgStkGraphicsPrimitive)textBatch); 
 

Draw a set of strings in various languages
[C#] Copy Code
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager; 
// 
// Create the strings 
// 
char[] german = {