TextBatchPrimitive#
- class ansys.stk.core.graphics.TextBatchPrimitive#
Bases:
IPrimitive
Render 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.
Overview#
Define the positions and text of strings in a text batch. The strings are rendered in the primitiveโs reference frame. |
|
Define the positions, text, and optional parameters of strings in a text batch. The strings are rendered in the primitiveโs reference frame. |
|
Define 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. |
|
For convenience. Defines the positions and text of strings in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling Set. |
|
For convenience. Defines the positions, text, and optional parameters of strings in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling Set. |
|
For convenience. Defines the positions, text, and optional parameters of strings in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling Set. |
|
Update a subset of positions and/or text in a text batch. |
|
Update a subset of positions and/or text in a text batch. |
|
Update a subset of positions, text, and/or optional per-string parameters in a text batch. |
|
|
Update a subset of positions, text, and/or optional per-string parameters in a text batch. |
For convenience. Updates a subset of positions and/or text in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling SetPartial. |
|
For convenience. Updates a subset of positions and/or text in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling SetPartial. |
|
For convenience. Updates a subset of positions, text, and/or per-string parameters in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling SetPartial. |
|
|
For convenience. Updates a subset of positions, text, and/or per-string parameters in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling SetPartial. |
Get the primitiveโs set hint. See the Set Hint Performance Overview for selecting an appropriate value to construct the primitive with. |
|
Get or set the scale applied to the radius of this primitiveโs bounding sphere. |
|
Get the font used to render the text batch. |
|
Get or set the textโs outline color. |
|
Get or set the textโs outline translucency. Translucency is between 0 and 1, where 0 is opaque and 1 is transparent. |
|
Get or set whether the screen space position of each string is aligned to a pixel. |
|
Get or set 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โฆ |
|
Get or set whether individual text indices will be included in the pick results returned from the sceneโs Pick method. Each text index that is picked will be returned as a batch primitive index. |
|
Get or set the filter used to filter the texture-based font. |
|
Get or set whether the primitive is positioned and rendered in screen space coordinates. |
Examples#
Draw a new Text Primitive
# Scenario scenario: Scenario object
manager = scenario.scene_manager
font = manager.initializers.graphics_font.initialize_with_name_size_font_style_outline(
"MS Sans Serif", 24, FontStyle.BOLD, True
)
textBatch = manager.initializers.text_batch_primitive.initialize_with_graphics_font(font)
textBatch.set_cartographic("Earth", [[0], [0], [0]], ["Example Text"]) # Lat, Lon, Alt
manager.primitives.add(textBatch)
Import detail#
from ansys.stk.core.graphics import TextBatchPrimitive
Property detail#
- property TextBatchPrimitive.set_hint: SetHint#
Get the primitiveโs set hint. See the Set Hint Performance Overview for selecting an appropriate value to construct the primitive with.
- property TextBatchPrimitive.bounding_sphere_scale: float#
Get or set the scale applied to the radius of this primitiveโs bounding sphere.
- property TextBatchPrimitive.font: GraphicsFont#
Get the font used to render the text batch.
- property TextBatchPrimitive.outline_translucency: float#
Get or set the textโs outline translucency. Translucency is between 0 and 1, where 0 is opaque and 1 is transparent.
- property TextBatchPrimitive.align_to_pixel: bool#
Get or set whether the screen space position of each string is aligned to a pixel.
- property TextBatchPrimitive.distance_display_condition_per_string: DistanceDisplayCondition#
Get or set 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โฆ
- property TextBatchPrimitive.per_item_picking_enabled: bool#
Get or set whether individual text indices will be included in the pick results returned from the sceneโs Pick method. Each text index that is picked will be returned as a batch primitive index.
- property TextBatchPrimitive.texture_filter: TextureFilter2D#
Get or set the filter used to filter the texture-based font.
Method detail#
- TextBatchPrimitive.set(self, positions: list, text: list) None #
Define the positions and text of strings in a text batch. The strings are rendered in the primitiveโs reference frame.
- TextBatchPrimitive.set_with_optional_parameters(self, positions: list, text: list, optional_parameters: TextBatchPrimitiveOptionalParameters) None #
Define the positions, text, and optional parameters of strings in a text batch. The strings are rendered in the primitiveโs reference frame.
- TextBatchPrimitive.set_with_optional_parameters_and_render_pass(self, positions: list, text: list, optional_parameters: TextBatchPrimitiveOptionalParameters, render_pass_hint: RenderPassHint) None #
Define 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.
- TextBatchPrimitive.set_cartographic(self, central_body: str, positions: list, text: list) None #
For convenience. Defines the positions and text of strings in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling Set.
- TextBatchPrimitive.set_cartographic_with_optional_parameters(self, central_body: str, positions: list, text: list, optional_parameters: TextBatchPrimitiveOptionalParameters) None #
For convenience. Defines the positions, text, and optional parameters of strings in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling Set.
- TextBatchPrimitive.set_cartographic_with_optional_parameters_and_render_pass(self, central_body: str, positions: list, text: list, optional_parameters: TextBatchPrimitiveOptionalParameters, render_pass_hint: RenderPassHint) None #
For convenience. Defines the positions, text, and optional parameters of strings in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling Set.
- TextBatchPrimitive.set_partial(self, positions: list, text: list, indices: list) None #
Update a subset of positions and/or text in a text batch.
- TextBatchPrimitive.set_partial_with_indices_order(self, positions: list, text: list, indices: list, indices_order_hint: PrimitiveIndicesOrderHint) None #
Update a subset of positions and/or text in a text batch.
- TextBatchPrimitive.set_partial_with_optional_parameters(self, positions: list, text: list, optional_parameters: TextBatchPrimitiveOptionalParameters, indices: list) None #
Update a subset of positions, text, and/or optional per-string parameters in a text batch.
- TextBatchPrimitive.set_partial_with_optional_parameters_indices_order_and_render_pass(self, positions: list, text: list, optional_parameters: TextBatchPrimitiveOptionalParameters, indices: list, indices_order_hint: PrimitiveIndicesOrderHint, render_pass_hint: RenderPassHint) None #
Update a subset of positions, text, and/or optional per-string parameters in a text batch.
- TextBatchPrimitive.set_partial_cartographic(self, central_body: str, positions: list, text: list, indices: list) None #
For convenience. Updates a subset of positions and/or text in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling SetPartial.
- TextBatchPrimitive.set_partial_cartographic_with_indices_order(self, central_body: str, positions: list, text: list, indices: list, indices_order_hint: PrimitiveIndicesOrderHint) None #
For convenience. Updates a subset of positions and/or text in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling SetPartial.
- TextBatchPrimitive.set_partial_cartographic_with_optional_parameters(self, central_body: str, positions: list, text: list, optional_parameters: TextBatchPrimitiveOptionalParameters, indices: list) None #
For convenience. Updates a subset of positions, text, and/or per-string parameters in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling SetPartial.
- TextBatchPrimitive.set_partial_cartographic_with_optional_parameters_indices_order_and_render_pass(self, central_body: str, positions: list, text: list, optional_parameters: TextBatchPrimitiveOptionalParameters, indices: list, indices_order_hint: PrimitiveIndicesOrderHint, render_pass_hint: RenderPassHint) None #
For convenience. Updates a subset of positions, text, and/or per-string parameters in a text batch using cartographic positions. This is equivalent to converting each position in positions to cartesian and calling SetPartial.