SelectionShapeModel
- class omni.kit.manipulator.selection.SelectionShapeModel(*args, **kwargs)
Bases:
AbstractManipulatorModel
A model to handle the selection region in a manipulator.
This model manages the selection shapes such as rectangles and supports querying and setting their properties. It provides a way to interact with the selection shapes using named manipulator items and supports both integer and float values.
- Parameters
\*args – Variable length argument list which will be forwarded to execute.
**kwargs – Arbitrary keyword arguments that will be forwarded to execute.
Methods
__init__
(*args, **kwargs)Initializes the selection shape model with default values.
get_as_floats
(name)Gets the value of the specified item as a sequence of floats.
get_as_ints
(name)Gets the value of the specified item as a sequence of integers.
get_item
(name)Retrieves the manipulator item associated with the given name.
set_floats
(name, values)Sets a sequence of floats for the specified item.
set_ints
(name, values)Sets a sequence of integers for the specified item.
- __init__(*args, **kwargs)
Initializes the selection shape model with default values.
This creates a set of manipulator items to store selection shape data.
- Parameters
\*args – Variable length argument list which will be forwarded to execute.
**kwargs – Arbitrary keyword arguments that will be forwarded to execute.
- get_as_floats(name: str) List[float]
Gets the value of the specified item as a sequence of floats.
If the item is ‘ndc_rect’, computes the rectangle’s coordinates from ‘ndc_start’ and ‘ndc_current’.
- Parameters
name (str) – The name of the item to retrieve the value from.
- Returns
The values of the item as a list of floats, or the computed rectangle coordinates.
- Return type
List[float]
- get_as_ints(name: str) List[int]
Gets the value of the specified item as a sequence of integers.
- Parameters
name (str) – The name of the item to retrieve the value from.
- Returns
The values of the item as a list of integers.
- Return type
List[int]
- get_item(name: str) <omni.ui_scene._scene.AbstractManipulatorItem object at 0x7f85841060f0>
Retrieves the manipulator item associated with the given name.
- Parameters
name (str) – The name of the item to retrieve.
- Returns
The corresponding manipulator item.
- Return type
sc.AbstractManipulatorItem
- set_floats(name: str, values: Sequence[int])
Sets a sequence of floats for the specified item.
- Parameters
name (str) – The name of the item to update.
values (Sequence[int]) – A sequence of floats to set for the item.
- set_ints(name: str, values: Sequence[int])
Sets a sequence of integers for the specified item.
- Parameters
name (str) – The name of the item to update.
values (Sequence[int]) – A sequence of integers to set for the item.