.. role:: ts-api-decorator

#############
MeasureMarkup
#############

.. js:module:: Operators.Markup.Measure
   :noindex:

.. container:: ts-api-section

   .. js:class:: MeasureMarkup

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



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.getClassName`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.getMeasurementText`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.getMeasurementValue`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.getName`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.getUnitMultiplier`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.getVisibility`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.hit`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.hitWithTolerance`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.isMarkupValid`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.onDeselect`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.onSelect`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.remove`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.setMeasurementText`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.setName`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.setVisibility`
   * :js:meth:`~Operators.Markup.Measure.MeasureMarkup.toJson`





------------

Methods
=======

.. rst-class:: ts-api-section

getClassName
------------

.. js:method:: MeasureMarkup.getClassName()



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

   :returns: fully qualified class name


   :rtype: string

.. rst-class:: ts-api-section

getMeasurementText
------------------

.. js:method:: 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.


   :rtype: string

.. rst-class:: ts-api-section

getMeasurementValue
-------------------

.. js:method:: 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.

   :returns: the measurement value


   :rtype: number

.. rst-class:: ts-api-section

getName
-------

.. js:method:: MeasureMarkup.getName()



   Gets the name of this measurement.

   :returns: the measurement name


   :rtype: string

.. rst-class:: ts-api-section

getUnitMultiplier
-----------------

.. js:method:: 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 is ``1.0``.


   :rtype: number

.. rst-class:: ts-api-section

getVisibility
-------------

.. js:method:: MeasureMarkup.getVisibility()



   :rtype: boolean

.. rst-class:: ts-api-section

hit
---

.. js:method:: MeasureMarkup.hit( _point, _view)

   :param _point: None
   :type _point: Point2
   :param _view: None
   :type _view: View


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

   :returns: boolean value indicating whether this item was picked


   :rtype: boolean

.. rst-class:: ts-api-section

hitWithTolerance
----------------

.. js:method:: MeasureMarkup.hitWithTolerance( _point, _view, _pickTolerance)

   :param _point: None
   :type _point: Point2
   :param _view: None
   :type _view: View
   :param _pickTolerance: None
   :type _pickTolerance: number


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

   :returns: boolean value indicating whether this item was picked


   :rtype: boolean

.. rst-class:: ts-api-section

isMarkupValid
-------------

.. js:method:: MeasureMarkup.isMarkupValid()



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


   :rtype: boolean

.. rst-class:: ts-api-section

onDeselect
----------

.. js:method:: MeasureMarkup.onDeselect()



   Called when this markup item is deselected by the system


   :rtype: void

.. rst-class:: ts-api-section

onSelect
--------

.. js:method:: MeasureMarkup.onSelect()



   Called when this markup item is selected by the system.


   :rtype: void

.. rst-class:: ts-api-section

remove
------

.. js:method:: MeasureMarkup.remove()



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


   :rtype: void

.. rst-class:: ts-api-section

setMeasurementText
------------------

.. js:method:: MeasureMarkup.setMeasurementText( measurementText)

   :param measurementText: the text to render with this measurement
   :type measurementText: string


   Sets the measurement text that is rendered with this measurement.


   :rtype: void

.. rst-class:: ts-api-section

setName
-------

.. js:method:: MeasureMarkup.setName( name)

   :param name: the name to set
   :type name: string


   Sets the name of this measurement


   :rtype: void

.. rst-class:: ts-api-section

setVisibility
-------------

.. js:method:: MeasureMarkup.setVisibility( visibility)

   :param visibility: None
   :type visibility: boolean


   :rtype: void

.. rst-class:: ts-api-section

toJson
------

.. js:method:: MeasureMarkup.toJson()



   Creates an object ready for JSON serialization.

   :returns: The prepared object.


   :rtype: object

