add_scene_3d_labelT_add_scene_3d_labelAddScene3dLabelAddScene3dLabel (Operator)
Name
add_scene_3d_labelT_add_scene_3d_labelAddScene3dLabelAddScene3dLabel
— Add a text label to a 3D scene.
Signature
void AddScene3dLabel(const HTuple& Scene3D, const HTuple& Text, const HTuple& ReferencePoint, const HTuple& Position, const HTuple& RelatesTo, HTuple* LabelIndex)
Hlong HScene3D::AddScene3dLabel(const HTuple& Text, const HTuple& ReferencePoint, const HTuple& Position, const HTuple& RelatesTo) const
Hlong HScene3D::AddScene3dLabel(const HString& Text, const HTuple& ReferencePoint, const HTuple& Position, const HTuple& RelatesTo) const
Hlong HScene3D::AddScene3dLabel(const char* Text, const HTuple& ReferencePoint, const HTuple& Position, const HTuple& RelatesTo) const
Hlong HScene3D::AddScene3dLabel(const wchar_t* Text, const HTuple& ReferencePoint, const HTuple& Position, const HTuple& RelatesTo) const
(Windows only)
static void HOperatorSet.AddScene3dLabel(HTuple scene3D, HTuple text, HTuple referencePoint, HTuple position, HTuple relatesTo, out HTuple labelIndex)
int HScene3D.AddScene3dLabel(HTuple text, HTuple referencePoint, HTuple position, HTuple relatesTo)
int HScene3D.AddScene3dLabel(string text, HTuple referencePoint, HTuple position, HTuple relatesTo)
Description
add_scene_3d_labeladd_scene_3d_labelAddScene3dLabelAddScene3dLabelAddScene3dLabel
adds a label with the text in TextTextTextTexttext
to the
3D scene Scene3DScene3DScene3DScene3Dscene3D
and returns its index in LabelIndexLabelIndexLabelIndexLabelIndexlabelIndex
.
The reference point of the label must be given as [X,Y,Z] point in the
coordinate system of the 3D scene in ReferencePointReferencePointReferencePointReferencePointreferencePoint
.
It is valid to create labels without a reference
point by passing an empty tuple to ReferencePointReferencePointReferencePointReferencePointreferencePoint
, however
RelatesToRelatesToRelatesToRelatesTorelatesTo
must be set to 'window'"window""window""window""window" in this case
(see the description of RelatesToRelatesToRelatesToRelatesTorelatesTo
below).
If multiple label texts are supplied in TextTextTextTexttext
, multiple labels
are created. It is possible to set one reference
point for all labels or a specific reference point for each label.
The same applies to PositionPositionPositionPositionposition
and RelatesToRelatesToRelatesToRelatesTorelatesTo
.
Labels can be positioned fixed in window coordinates or relative to the
projection of the reference point. The two parameters PositionPositionPositionPositionposition
and RelatesToRelatesToRelatesToRelatesTorelatesTo
are used for positioning.
Fixed positioning
If RelatesToRelatesToRelatesToRelatesTorelatesTo
is set to 'window'"window""window""window""window", the Label is shown at
a fixed position in the window (or rendered image), even if the pose of the
3D scene is changed.
There are two ways to specify the position. You can either supply the
[Row,Column] coordinates of the top left corner of the label in
PositionPositionPositionPositionposition
or use one of the predefined positions:
'top_left'"top_left""top_left""top_left""top_left" |
'top'"top""top""top""top" |
'top_right'"top_right""top_right""top_right""top_right" |
'left'"left""left""left""left" |
'center'"center""center""center""center" |
'right'"right""right""right""right" |
'bottom_left'"bottom_left""bottom_left""bottom_left""bottom_left" |
'bottom'"bottom""bottom""bottom""bottom" |
'bottom_right'"bottom_right""bottom_right""bottom_right""bottom_right"
|
Relative positioning
If RelatesToRelatesToRelatesToRelatesTorelatesTo
is set to 'point'"point""point""point""point", the Label is shown at
a position relative to the projection of the reference point. This way,
the label moves with the reference point if the pose of the 3D scene is
changed.
There are two ways to specify the position. You can either supply the
[Row,Column] offset of the top left corner of the label in
PositionPositionPositionPositionposition
or use one of the predefined positions:
'top_left'"top_left""top_left""top_left""top_left" |
'top'"top""top""top""top" |
'top_right'"top_right""top_right""top_right""top_right" |
'left'"left""left""left""left" |
'center'"center""center""center""center" |
'right'"right""right""right""right" |
'bottom_left'"bottom_left""bottom_left""bottom_left""bottom_left" |
'bottom'"bottom""bottom""bottom""bottom" |
'bottom_right'"bottom_right""bottom_right""bottom_right""bottom_right"
|
The operator set_scene_3d_label_paramset_scene_3d_label_paramSetScene3dLabelParamSetScene3dLabelParamSetScene3dLabelParam
can be
used to change these values and to set other parameters such as the
label's color and font.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
Scene3DScene3DScene3DScene3Dscene3D
(input_control) scene_3d →
HScene3D, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the 3D scene.
TextTextTextTexttext
(input_control) string(-array) →
HTupleHTupleHtuple (string) (string) (HString) (char*)
Text of the label.
Default value:
'label'
"label"
"label"
"label"
"label"
ReferencePointReferencePointReferencePointReferencePointreferencePoint
(input_control) point-array →
HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Point of reference of the label.
Number of elements: 3
PositionPositionPositionPositionposition
(input_control) point-array →
HTupleHTupleHtuple (string / real / integer) (string / double / int / long) (HString / double / Hlong) (char* / double / Hlong)
Position of the label.
Default value:
'top'
"top"
"top"
"top"
"top"
List of values: 'bottom'"bottom""bottom""bottom""bottom", 'bottom_left'"bottom_left""bottom_left""bottom_left""bottom_left", 'bottom_right'"bottom_right""bottom_right""bottom_right""bottom_right", 'center'"center""center""center""center", 'left'"left""left""left""left", 'right'"right""right""right""right", 'top'"top""top""top""top", 'top_left'"top_left""top_left""top_left""top_left", 'top_right'"top_right""top_right""top_right""top_right"
RelatesToRelatesToRelatesToRelatesTorelatesTo
(input_control) string-array →
HTupleHTupleHtuple (string) (string) (HString) (char*)
Indicates fixed or relative positioning.
Number of elements: 1
Default value:
'point'
"point"
"point"
"point"
"point"
List of values: 'point'"point""point""point""point", 'window'"window""window""window""window"
LabelIndexLabelIndexLabelIndexLabelIndexlabelIndex
(output_control) integer →
HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Index of the new label in the 3D scene.
Result
add_scene_3d_labeladd_scene_3d_labelAddScene3dLabelAddScene3dLabelAddScene3dLabel
returns 2 (H_MSG_TRUE) if all parameters are correct.
If necessary, an exception is raised.
Possible Predecessors
create_scene_3dcreate_scene_3dCreateScene3dCreateScene3dCreateScene3d
Possible Successors
set_scene_3d_label_paramset_scene_3d_label_paramSetScene3dLabelParamSetScene3dLabelParamSetScene3dLabelParam
See also
remove_scene_3d_instanceremove_scene_3d_instanceRemoveScene3dInstanceRemoveScene3dInstanceRemoveScene3dInstance
Module
3D Metrology