Operator Reference

add_scene_3d_labelT_add_scene_3d_labelAddScene3dLabelAddScene3dLabeladd_scene_3d_label (Operator)

add_scene_3d_labelT_add_scene_3d_labelAddScene3dLabelAddScene3dLabeladd_scene_3d_label — Add a text label to a 3D scene.

Signature

add_scene_3d_label( : : Scene3D, Text, ReferencePoint, Position, RelatesTo : LabelIndex)

Herror T_add_scene_3d_label(const Htuple Scene3D, const Htuple Text, const Htuple ReferencePoint, const Htuple Position, const Htuple RelatesTo, Htuple* LabelIndex)

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)

def add_scene_3d_label(scene_3d: HHandle, text: MaybeSequence[str], reference_point: Sequence[Union[float, int]], position: Sequence[Union[float, int, str]], relates_to: Sequence[str]) -> int

Description

add_scene_3d_labeladd_scene_3d_labelAddScene3dLabelAddScene3dLabeladd_scene_3d_label adds a label with the text in TextTextTexttexttext to the 3D scene Scene3DScene3DScene3Dscene3Dscene_3d and returns its index in LabelIndexLabelIndexLabelIndexlabelIndexlabel_index.

The reference point of the label must be given as [X,Y,Z] point in the coordinate system of the 3D scene in ReferencePointReferencePointReferencePointreferencePointreference_point. It is valid to create labels without a reference point by passing an empty tuple to ReferencePointReferencePointReferencePointreferencePointreference_point, however RelatesToRelatesToRelatesTorelatesTorelates_to must be set to 'window'"window""window""window""window" in this case (see the description of RelatesToRelatesToRelatesTorelatesTorelates_to 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 RelatesToRelatesToRelatesTorelatesTorelates_to.

Labels can be positioned fixed in window coordinates or relative to the projection of the reference point. The two parameters PositionPositionPositionpositionposition and RelatesToRelatesToRelatesTorelatesTorelates_to are used for positioning.

Fixed positioning

If RelatesToRelatesToRelatesTorelatesTorelates_to 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 RelatesToRelatesToRelatesTorelatesTorelates_to 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_paramSetScene3dLabelParamSetScene3dLabelParamset_scene_3d_label_param 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

Scene3DScene3DScene3Dscene3Dscene_3d (input_control)  scene_3d HScene3D, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the 3D scene.

TextTextTexttexttext (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Text of the label.

Default: 'label' "label" "label" "label" "label"

ReferencePointReferencePointReferencePointreferencePointreference_point (input_control)  point-array HTupleSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Point of reference of the label.

Number of elements: 3

PositionPositionPositionpositionposition (input_control)  point-array HTupleSequence[Union[float, int, str]]HTupleHtuple (string / real / integer) (string / double / int / long) (HString / double / Hlong) (char* / double / Hlong)

Position of the label.

Default: '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"

RelatesToRelatesToRelatesTorelatesTorelates_to (input_control)  string-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Indicates fixed or relative positioning.

Number of elements: 1

Default: 'point' "point" "point" "point" "point"

List of values: 'point'"point""point""point""point", 'window'"window""window""window""window"

LabelIndexLabelIndexLabelIndexlabelIndexlabel_index (output_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Index of the new label in the 3D scene.

Result

add_scene_3d_labeladd_scene_3d_labelAddScene3dLabelAddScene3dLabeladd_scene_3d_label returns 2 ( H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Possible Predecessors

create_scene_3dcreate_scene_3dCreateScene3dCreateScene3dcreate_scene_3d

Possible Successors

set_scene_3d_label_paramset_scene_3d_label_paramSetScene3dLabelParamSetScene3dLabelParamset_scene_3d_label_param

See also

remove_scene_3d_instanceremove_scene_3d_instanceRemoveScene3dInstanceRemoveScene3dInstanceremove_scene_3d_instance

Module

3D Metrology