Returns an active reference to the attachment appearance settings for this part.
Length in pixels of the line that attaches the label to its 3D position
Custom data for the part. This field is not used by C3.
Draw mode for the labels in this part
Returns an active reference to the appearance settings for the labels in this part.
Point where the attachment line meets the label
The number of labels in the part.
Adds the given text to the part, placing it at the given position. Returns the index of the new label.
Deletes all text labels from the part.
Deletes the text label at the given index.
Gets the offset direction of the label at the given index.
Gets the offset position of the label at the given index.
Gets the position of the label at the given index.
Gets the text of the label at the given index.
Picking
Sets the offset direction of the label at the given index.
Sets the offset position of the label at the given index.
Example: Move a label with the mouse
private onMouseMove(event: MouseEvent) {
const label = this.m_pickingLabelPart;
if (label && event.ctrlKey) {
const view = this.m_viewer.getViewAt(0);
const labelPos = label.getLabelPosition(0);
// Keep label in the same distance from the camera
const labelDepth = view.camera.project(labelPos).z;
const oglWinPos = this.m_viewer.oglWinPosFromClientCoord(event.x, event.y);
const labelOffsetPos = view.camera.unproject(
{x: oglWinPos.x, y: oglWinPos.y, z: labelDepth});
label.setLabelOffsetPosition(0, labelOffsetPos);
}
}
Sets the position of the label at the given index.
Sets the text of the label at the given index.
Generated using TypeDoc
Defines positioned text labels that can be shown in a MarkupModel.
Use MarkupModel.addLabelsPart to create a new instance of this class.
Some examples of different label styles: