.. role:: ts-api-decorator

############
CursorMarkup
############

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

.. container:: ts-api-section

   .. js:class:: CursorMarkup

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



.. container:: api-index-section

   .. rubric:: Constructors

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

   * :js:meth:`~Operators.Markup.CursorMarkup.constructor`



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~Operators.Markup.CursorMarkup.destroy`
   * :js:meth:`~Operators.Markup.CursorMarkup.enable`
   * :js:meth:`~Operators.Markup.CursorMarkup.getClassName`
   * :js:meth:`~Operators.Markup.CursorMarkup.getMeasurementText`
   * :js:meth:`~Operators.Markup.CursorMarkup.getMeasurementValue`
   * :js:meth:`~Operators.Markup.CursorMarkup.getName`
   * :js:meth:`~Operators.Markup.CursorMarkup.getUnitMultiplier`
   * :js:meth:`~Operators.Markup.CursorMarkup.getVisibility`
   * :js:meth:`~Operators.Markup.CursorMarkup.hit`
   * :js:meth:`~Operators.Markup.CursorMarkup.hitWithTolerance`
   * :js:meth:`~Operators.Markup.CursorMarkup.isEnabled`
   * :js:meth:`~Operators.Markup.CursorMarkup.isMarkupValid`
   * :js:meth:`~Operators.Markup.CursorMarkup.onDeselect`
   * :js:meth:`~Operators.Markup.CursorMarkup.onSelect`
   * :js:meth:`~Operators.Markup.CursorMarkup.remove`
   * :js:meth:`~Operators.Markup.CursorMarkup.setMeasurementText`
   * :js:meth:`~Operators.Markup.CursorMarkup.setName`
   * :js:meth:`~Operators.Markup.CursorMarkup.setPosition`
   * :js:meth:`~Operators.Markup.CursorMarkup.setVisibility`
   * :js:meth:`~Operators.Markup.CursorMarkup.toJson`





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

Constructors
============

.. container:: ts-api-section

   .. js:function:: CursorMarkup.constructor( viewer, view)

      :param viewer: None
      :type viewer: WebViewer
      :param view: None
      :type view: View


      :rtype: CursorMarkup



Methods
=======

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

destroy
-------

.. js:method:: CursorMarkup.destroy()



   :rtype: void

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

enable
------

.. js:method:: CursorMarkup.enable( enable)

   :param enable: None
   :type enable: boolean


   :rtype: void

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

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

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


   :rtype: string

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

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

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


   :rtype: number

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

getName
-------

.. js:method:: CursorMarkup.getName()



   Gets the name of this measurement.

   :returns: the measurement name


   :rtype: string

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

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

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


   :rtype: number

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

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

.. js:method:: CursorMarkup.getVisibility()



   :rtype: boolean

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

hit
---

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

isEnabled
---------

.. js:method:: CursorMarkup.isEnabled()



   :rtype: boolean

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

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

.. js:method:: CursorMarkup.isMarkupValid()



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


   :rtype: boolean

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

onDeselect
----------

.. js:method:: CursorMarkup.onDeselect()



   Called when this markup item is deselected by the system


   :rtype: void

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

onSelect
--------

.. js:method:: CursorMarkup.onSelect()



   Called when this markup item is selected by the system.


   :rtype: void

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

remove
------

.. js:method:: CursorMarkup.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:: CursorMarkup.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:: CursorMarkup.setName( name)

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


   Sets the name of this measurement


   :rtype: void

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

setPosition
-----------

.. js:method:: CursorMarkup.setPosition( point)

   :param point: None
   :type point: Point2


   :rtype: void

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

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

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

   :param visibility: None
   :type visibility: boolean


   :rtype: void

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

toJson
------

.. js:method:: CursorMarkup.toJson()



   Creates an object ready for JSON serialization.

   :returns: The prepared object.


   :rtype: object

