MeasureMarkup
- class Communicator.Markup.Measure.MeasureMarkup()
Base class for Measure Markup. It should not be used directly.
Methods
Methods
forJson
- MeasureMarkup.forJson()
- Deprecated
Use
toJson
instead.- Return type
Object
getClassName
- MeasureMarkup.getClassName()
Gets the fully qualified class name for this markup item. E.g. “Communicator.Markup.Redline.RedlineCircle”
- Return type
string
- Returns
fully qualified class name
getMeasurementText
- MeasureMarkup.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
- MeasureMarkup.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.- Return type
number
- Returns
the measurement value
getName
- MeasureMarkup.getName()
Gets the name of this measurement.
- Return type
string
- Returns
the measurement name
getUnitMultiplier
- MeasureMarkup.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 is1.0
.- Return type
number
getVisibility
- MeasureMarkup.getVisibility()
- Return type
boolean
hit
hitWithTolerance
- MeasureMarkup.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
isMarkupValid
- MeasureMarkup.isMarkupValid()
Returns whether the measurement markup is valid. Override in subclasses when needed.
- Return type
Boolean
onDeselect
- MeasureMarkup.onDeselect()
Called when this markup item is deselected by the system
- Return type
void
onSelect
- MeasureMarkup.onSelect()
Called when this markup item is selected by the system.
- Return type
void
remove
- MeasureMarkup.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
- MeasureMarkup.setMeasurementText(measurementText)
Sets the measurement text that is rendered with this measurement.
- Arguments
measurementText (
string()
) – the text to render with this measurement
- Return type
void
setName
- MeasureMarkup.setName(name)
Sets the name of this measurement
- Arguments
name (
string()
) – the name to set
- Return type
void
setVisibility
- MeasureMarkup.setVisibility(visibility)
- Arguments
visibility (
boolean()
) –
- Return type
void
toJson
- MeasureMarkup.toJson()
Creates an object ready for JSON serialization.
- Return type
Object
- Returns
The prepared object.