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

.. js:class:: Markup.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.
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~Markup.MarkupItem.constructor`
   
   .. rubric:: Properties
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:data:`~Markup.MarkupItem.uniqueId`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :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
============

.. js:method:: Markup.MarkupItem.constructor

   .. rst-class:: sig-pretty-signature
   
      | MarkupItem(): :js:class:`MarkupItem <Markup.MarkupItem>`
   
   **Returns**\ : :js:class:`MarkupItem <Markup.MarkupItem>`
   





Properties
==========

.. js:data:: Markup.MarkupItem.uniqueId

   .. rst-class:: sig-pretty-signature
   
      | uniqueId: *string*
   





Methods
=======

.. js:method:: Markup.MarkupItem.draw

   .. rst-class:: sig-pretty-signature
   
      | draw(**_renderer**\ : :js:class:`MarkupRenderer <Markup.MarkupRenderer>`\ , **_view**\ : :js:class:`~IView`\ ): *void*
   
   Called when the markup item should be redrawn on a specific view. This most typically happens when the scene is rendered.
   
   **Parameters**
   
      **_renderer**\ : :js:class:`MarkupRenderer <Markup.MarkupRenderer>`
   
      **_view**\ : :js:class:`~IView`
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.MarkupItem.getClassName

   .. rst-class:: sig-pretty-signature
   
      | getClassName(): *string*
   
   Gets the fully qualified class name for this markup item. E.g. "Communicator.Markup.Redline.RedlineCircle"
   
   **Returns**\ : *string*
   
      fully qualified class name
   
   



.. js:method:: Markup.MarkupItem.hit

   .. rst-class:: sig-pretty-signature
   
      | hit(**_point**\ : :js:class:`~Point2`\ , **_view**\ : :js:class:`~IView`\ ): *boolean*
   
   Called when a hit test is performed on this markup item.
   
   **Parameters**
   
      **_point**\ : :js:class:`~Point2`
   
      **_view**\ : :js:class:`~IView`
   
   
   **Returns**\ : *boolean*
   
      boolean value indicating whether this item was picked
   
   



.. js:method:: Markup.MarkupItem.hitWithTolerance

   .. rst-class:: sig-pretty-signature
   
      | hitWithTolerance(**_point**\ : :js:class:`~Point2`\ , **_view**\ : :js:class:`~IView`\ , **_pickTolerance**\ : *number*\ ): *boolean*
   
   Called when a hit test is performed on this markup item.
   
   **Parameters**
   
      **_point**\ : :js:class:`~Point2`
   
      **_view**\ : :js:class:`~IView`
   
      **_pickTolerance**\ : *number*
   
   
   **Returns**\ : *boolean*
   
      boolean value indicating whether this item was picked
   
   



.. js:method:: Markup.MarkupItem.onDeselect

   .. rst-class:: sig-pretty-signature
   
      | onDeselect(): *void*
   
   Called when this markup item is deselected by the system
   
   **Returns**\ : *void*
   



.. js:method:: Markup.MarkupItem.onSelect

   .. rst-class:: sig-pretty-signature
   
      | onSelect(**_view**\ : :js:class:`~IView`\ ): *void*
   
   Called when this markup item is selected by the system from a given view.
   
   **Parameters**
   
      **_view**\ : :js:class:`~IView`
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.MarkupItem.remove

   .. rst-class:: sig-pretty-signature
   
      | remove(**_view**\ : (*None* \| :js:class:`~IView`\ )): *void*
   
   Called when the MarkupItem is removed from a view from the system. Any cleanup that needs to be done should be performed in this method.
   
   **Parameters**
   
      **_view**\ : (*None* \| :js:class:`~IView`\ )
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.MarkupItem.toJson

   .. rst-class:: sig-pretty-signature
   
      | toJson(): *object*
   
   Creates an object ready for JSON serialization.
   
   **Returns**\ : *object*
   
      The prepared object.
   
   





