.. role:: ts-api-decorator

##########
MarkupItem
##########

.. js:module:: Markup
   :noindex:

.. container:: ts-api-section

   .. js:class:: MarkupItem

      This is a base class for all markup items that are overlayed over the viewer.
      Inherit from this class or provide an identical interface when creating custom markup items.



.. container:: api-index-section

   .. rubric:: Constructors

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

   * :js:meth:`~Markup.MarkupItem.constructor`



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~Markup.MarkupItem.draw`
   * :js:meth:`~Markup.MarkupItem.getClassName`
   * :js:meth:`~Markup.MarkupItem.hit`
   * :js:meth:`~Markup.MarkupItem.hitWithTolerance`
   * :js:meth:`~Markup.MarkupItem.onDeselect`
   * :js:meth:`~Markup.MarkupItem.onSelect`
   * :js:meth:`~Markup.MarkupItem.remove`
   * :js:meth:`~Markup.MarkupItem.toJson`





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

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

.. container:: ts-api-section

   .. js:function:: MarkupItem.constructor()



      :rtype: MarkupItem



Methods
=======

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

draw
----

.. js:method:: MarkupItem.draw( _renderer, _view)

   :param _renderer: None
   :type _renderer: MarkupRenderer
   :param _view: None
   :type _view: View


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


   :rtype: void

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

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

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

hit
---

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

onDeselect
----------

.. js:method:: MarkupItem.onDeselect()



   Called when this markup item is deselected by the system


   :rtype: void

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

onSelect
--------

.. js:method:: MarkupItem.onSelect()



   Called when this markup item is selected by the system.


   :rtype: void

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

remove
------

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

toJson
------

.. js:method:: MarkupItem.toJson()



   Creates an object ready for JSON serialization.

   :returns: The prepared object.


   :rtype: object

