add_scene_3d_labelT_add_scene_3d_labelAddScene3dLabelAddScene3dLabeladd_scene_3d_label添加场景三维标签(算子)

名称

add_scene_3d_labelT_add_scene_3d_labelAddScene3dLabelAddScene3dLabeladd_scene_3d_label — 向三维场景添加文本标签。

签名

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)

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)

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

描述

add_scene_3d_labeladd_scene_3d_labelAddScene3dLabelAddScene3dLabelAddScene3dLabeladd_scene_3d_label 向 3D 场景 Scene3DScene3DScene3DScene3Dscene3Dscene_3d 中添加一个带有文本 TextTextTextTexttexttext 的标签,并将该标签的索引值存储在 LabelIndexLabelIndexLabelIndexLabelIndexlabelIndexlabel_index 中。

标签的参考点必须在 ReferencePointReferencePointReferencePointReferencePointreferencePointreference_point 中以 [X,Y,Z] 形式指定为 3D 场景坐标系中的点。通过向 ReferencePointReferencePointReferencePointReferencePointreferencePointreference_point 传递空元组可创建无参考点的标签,但此时必须将 RelatesToRelatesToRelatesToRelatesTorelatesTorelates_to 设置为 'window'"window""window""window""window""window" (详见下文 RelatesToRelatesToRelatesToRelatesTorelatesTorelates_to 说明)。

如果 TextTextTextTexttexttext 中提供多个标签文本,则会创建多个标签。可以为所有标签设置一个参考点,也可以为每个标签设置特定的参考点。同样的情况也适用于 PositionPositionPositionPositionpositionpositionRelatesToRelatesToRelatesToRelatesTorelatesTorelates_to

标签可以固定在窗口坐标系中,也可以相对于参考点的投影进行定位。两个参数 PositionPositionPositionPositionpositionpositionRelatesToRelatesToRelatesToRelatesTorelatesTorelates_to 用于定位。

固定定位

如果 RelatesToRelatesToRelatesToRelatesTorelatesTorelates_to 设置为 'window'"window""window""window""window""window",则标签将在窗口(或渲染图像)中固定位置显示,即使 3D 场景的姿态发生变化亦然。位置指定有两种方式。您可以在 PositionPositionPositionPositionpositionposition 中提供标签左上角的 [Row,Column] 坐标或使用预定义位置之一:

'top_left'"top_left""top_left""top_left""top_left""top_left" 'top'"top""top""top""top""top" 'top_right'"top_right""top_right""top_right""top_right""top_right"
'left'"left""left""left""left""left" 'center'"center""center""center""center""center" 'right'"right""right""right""right""right"
'bottom_left'"bottom_left""bottom_left""bottom_left""bottom_left""bottom_left" 'bottom'"bottom""bottom""bottom""bottom""bottom" 'bottom_right'"bottom_right""bottom_right""bottom_right""bottom_right""bottom_right"

相对定位

如果 RelatesToRelatesToRelatesToRelatesTorelatesTorelates_to 设置为 'point'"point""point""point""point""point",标签将显示在参考点投影的相对位置。这样,当 3D 场景姿态改变时,标签会随参考点一同移动。位置指定有两种方式。您可以在 PositionPositionPositionPositionpositionposition 中提供标签左上角的 [Row,Column] 偏移量或使用预定义位置之一:

'top_left'"top_left""top_left""top_left""top_left""top_left" 'top'"top""top""top""top""top" 'top_right'"top_right""top_right""top_right""top_right""top_right"
'left'"left""left""left""left""left" 'center'"center""center""center""center""center" 'right'"right""right""right""right""right"
'bottom_left'"bottom_left""bottom_left""bottom_left""bottom_left""bottom_left" 'bottom'"bottom""bottom""bottom""bottom""bottom" 'bottom_right'"bottom_right""bottom_right""bottom_right""bottom_right""bottom_right"

算子 set_scene_3d_label_paramset_scene_3d_label_paramSetScene3dLabelParamSetScene3dLabelParamSetScene3dLabelParamset_scene_3d_label_param 可用于更改这些值,并设置其他参数,例如标签的颜色和字体。

执行信息

参数

Scene3DScene3DScene3DScene3Dscene3Dscene_3d (输入控制)  scene_3d HScene3D, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

3D 场景的句柄。

TextTextTextTexttexttext (输入控制)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

标签文本。

默认值: 'label' "label" "label" "label" "label" "label"

ReferencePointReferencePointReferencePointReferencePointreferencePointreference_point (输入控制)  point-array HTupleSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

标签的参考点。

元素数量: 3

PositionPositionPositionPositionpositionposition (输入控制)  point-array HTupleSequence[Union[float, int, str]]HTupleHtuple (string / real / integer) (string / double / int / long) (HString / double / Hlong) (char* / double / Hlong)

标签的位置。

默认值: 'top' "top" "top" "top" "top" "top"

值列表: 'bottom'"bottom""bottom""bottom""bottom""bottom", 'bottom_left'"bottom_left""bottom_left""bottom_left""bottom_left""bottom_left", 'bottom_right'"bottom_right""bottom_right""bottom_right""bottom_right""bottom_right", 'center'"center""center""center""center""center", 'left'"left""left""left""left""left", 'right'"right""right""right""right""right", 'top'"top""top""top""top""top", 'top_left'"top_left""top_left""top_left""top_left""top_left", 'top_right'"top_right""top_right""top_right""top_right""top_right"

RelatesToRelatesToRelatesToRelatesTorelatesTorelates_to (输入控制)  string-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

表示固定或相对定位。

元素数量: 1

默认值: 'point' "point" "point" "point" "point" "point"

值列表: 'point'"point""point""point""point""point", 'window'"window""window""window""window""window"

LabelIndexLabelIndexLabelIndexLabelIndexlabelIndexlabel_index (输出控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

3D 场景中新标签的索引。

结果

add_scene_3d_labeladd_scene_3d_labelAddScene3dLabelAddScene3dLabelAddScene3dLabeladd_scene_3d_label 在所有参数正确时返回 2 ( H_MSG_TRUE )。如有必要,则抛出异常。

可能的前趋

create_scene_3dcreate_scene_3dCreateScene3dCreateScene3dCreateScene3dcreate_scene_3d

可能的后继

set_scene_3d_label_paramset_scene_3d_label_paramSetScene3dLabelParamSetScene3dLabelParamSetScene3dLabelParamset_scene_3d_label_param

另见

remove_scene_3d_instanceremove_scene_3d_instanceRemoveScene3dInstanceRemoveScene3dInstanceRemoveScene3dInstanceremove_scene_3d_instance

模块

三维计量