LineMarkup

class Communicator.Markup.Line.LineMarkup()

This class is for 3D line markup items.

Constructors

Properties


Constructors

LineMarkup.constructor(viewer[, firstPoint[, secondPoint[, firstNodeId[, secondNodeId]]]])
Arguments
Return type

LineMarkup()

Properties

LineMarkup.className
Type

string

Methods

draw

LineMarkup.draw()

Called when the markup item should be redrawn on the screen. This most typically happens when the scene is rendered.

Return type

void

forJson

LineMarkup.forJson()
Deprecated

Use toJson instead.

Return type

Object

getClassName

LineMarkup.getClassName()

Returns the class name for this markup item.

Return type

string

getFirstNodeId

LineMarkup.getFirstNodeId()

Gets the NodeId of the part associated with the first line point

Return type

NodeId | null

getFirstPoint

LineMarkup.getFirstPoint()

Gets the first point on the line.

Return type

Point3() | null

Returns

the first point, or null if none is set.

getId

LineMarkup.getId()

Returns a unique markup id for this line.

Return type

Uuid

getLineColor

LineMarkup.getLineColor()

Gets the line color.

Return type

Color()

getLineOpacity

LineMarkup.getLineOpacity()

Gets the line opacity.

Return type

number

getLinePattern

LineMarkup.getLinePattern()

Gets the line pattern.

Return type

LinePattern | null

getLinePatternLength

LineMarkup.getLinePatternLength()

Gets the length of a single repetition of the line pattern.

Return type

number | null

getLinePatternLengthUnit

LineMarkup.getLinePatternLengthUnit()

Gets the unit in which the line pattern length is measured.

Return type

LinePatternLengthUnit | null

getNodeId

LineMarkup.getNodeId()

Gets the node id associated with the line markup.

Return type

number | null

getSecondNodeId

LineMarkup.getSecondNodeId()

Gets the NodeId of the part associated with the second line point

Return type

NodeId | null

getSecondPoint

LineMarkup.getSecondPoint()

Gets the second point on the line.

Return type

Point3() | null

Returns

the second point, or null if none is set.

hit

LineMarkup.hit(point)

Called when a hit test is performed on this markup item.

Arguments
  • point (Point2()) – position in window where the hit test is being performed.

Return type

boolean

Returns

boolean value indicating whether this item was picked

hitWithTolerance

LineMarkup.hitWithTolerance(point, pickTolerance)

Called when a hit test is performed on this markup item.

Arguments
  • point (Point2()) – position in window where the hit test is being performed.

  • pickTolerance (number()) – amount of tolerance allowed for a hit in pixels.

Return type

boolean

Returns

boolean value indicating whether this item was picked

onDeselect

LineMarkup.onDeselect()

Called when this markup item is deselected by the system

Return type

void

onSelect

LineMarkup.onSelect()

Called when this markup item is selected by the system.

Return type

void

remove

LineMarkup.remove()

Called when the MarkupItem is removed from the system. Any cleanup that needs to be done should be performed in this method.

Return type

void

removeLine

LineMarkup.removeLine()

Removes the line geometry from the scene.

Return type

Promise <void>

setFirstNodeId

LineMarkup.setFirstNodeId(nodeId)

Sets the NodeId of the part associated with the first line point

Arguments
Return type

void

setFirstPoint

LineMarkup.setFirstPoint(firstPoint)

Sets the first point on the line.

Arguments
Return type

void

setId

LineMarkup.setId(id)

Sets a markup id for this line.

Arguments
Return type

void

setLineColor

LineMarkup.setLineColor(color)

Sets the line color.

Arguments
Return type

void

setLineOpacity

LineMarkup.setLineOpacity(opacity)

Sets the line opacity.

Arguments
  • opacity (number()) –

Return type

void

setLinePattern

LineMarkup.setLinePattern(pattern, patternLength, patternLengthUnit)

Sets the line pattern.

Arguments
  • pattern (LinePattern) – The line pattern.

  • patternLength (number()) – The length of a single repetition of the line pattern.

  • patternLengthUnit (LinePatternLengthUnit) – The unit in which the pattern length is measured.

Return type

void

setSecondNodeId

LineMarkup.setSecondNodeId(nodeId)

Sets the NodeId of the part associated with the second line point

Arguments
Return type

void

setSecondPoint

LineMarkup.setSecondPoint(secondPoint)

Sets the second point on the line.

Arguments
Return type

void

toJson

LineMarkup.toJson()

Creates an object ready for JSON serialization.

Return type

Object

Returns

The prepared object.

updateLine

LineMarkup.updateLine()

Draws updated line geometry in the scene.

Return type

Promise <void>

static fromJson

LineMarkup.fromJson(objData, viewer)

Creates a new LineMarkup from an object given by toJson

Arguments
Return type

Promise <LineMarkup()>

Returns

The prepared object.