CursorMarkup

class Operators.Markup.CursorMarkup()

Base class for Measure Markup. It should not be used directly.

Constructors


Constructors

CursorMarkup.constructor(viewer, view)
Arguments
Return type

CursorMarkup

Methods

destroy

CursorMarkup.destroy()
Return type

void

enable

CursorMarkup.enable(enable)
Arguments
  • enable (boolean()) – None

Return type

void

getClassName

CursorMarkup.getClassName()

Gets the fully qualified class name for this markup item. E.g. “Communicator.Markup.Redline.RedlineCircle”

Returns

fully qualified class name

Return type

string

getMeasurementText

CursorMarkup.getMeasurementText()

Gets the text for this measurement. By default this will contain the measurement value and units for the model in the cases where the measurement is a distance. In other cases it will contain the angle in degrees.

Return type

string

getMeasurementValue

CursorMarkup.getMeasurementValue()

Returns the unit agnostic value for this measurement. In the case where this value represents distance, use [[getUnitMultiplier]] to determine the measurement units. In other cases, this value will be the angle measurement in degrees.

Returns

the measurement value

Return type

number

getName

CursorMarkup.getName()

Gets the name of this measurement.

Returns

the measurement name

Return type

string

getUnitMultiplier

CursorMarkup.getUnitMultiplier()

Returns the unit multiplier incorporated into the measurement value. This number is a multiplier of millimeters (for example inches will be 25.4). The default value is 1.0.

Return type

number

getVisibility

CursorMarkup.getVisibility()
Return type

boolean

hit

CursorMarkup.hit(_point, _view)
Arguments

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

Returns

boolean value indicating whether this item was picked

Return type

boolean

hitWithTolerance

CursorMarkup.hitWithTolerance(_point, _view, _pickTolerance)
Arguments
  • _point (Point2()) – None

  • _view (View()) – None

  • _pickTolerance (number()) – None

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

Returns

boolean value indicating whether this item was picked

Return type

boolean

isEnabled

CursorMarkup.isEnabled()
Return type

boolean

isMarkupValid

CursorMarkup.isMarkupValid()

Returns whether the measurement markup is valid. Override in subclasses when needed.

Return type

boolean

onDeselect

CursorMarkup.onDeselect()

Called when this markup item is deselected by the system

Return type

void

onSelect

CursorMarkup.onSelect()

Called when this markup item is selected by the system.

Return type

void

remove

CursorMarkup.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

setMeasurementText

CursorMarkup.setMeasurementText(measurementText)
Arguments
  • measurementText (string()) – the text to render with this measurement

Sets the measurement text that is rendered with this measurement.

Return type

void

setName

CursorMarkup.setName(name)
Arguments
  • name (string()) – the name to set

Sets the name of this measurement

Return type

void

setPosition

CursorMarkup.setPosition(point)
Arguments
Return type

void

setVisibility

CursorMarkup.setVisibility(visibility)
Arguments
  • visibility (boolean()) – None

Return type

void

toJson

CursorMarkup.toJson()

Creates an object ready for JSON serialization.

Returns

The prepared object.

Return type

object