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

.. js:class:: wv.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:`~wv.Markup.MarkupItem.constructor`
   
   .. rubric:: Properties
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:data:`~wv.Markup.MarkupItem.uniqueId`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~wv.Markup.MarkupItem.draw`
   * :js:meth:`~wv.Markup.MarkupItem.getClassName`
   * :js:meth:`~wv.Markup.MarkupItem.hit`
   * :js:meth:`~wv.Markup.MarkupItem.hitWithTolerance`
   * :js:meth:`~wv.Markup.MarkupItem.onDeselect`
   * :js:meth:`~wv.Markup.MarkupItem.onSelect`
   * :js:meth:`~wv.Markup.MarkupItem.remove`
   * :js:meth:`~wv.Markup.MarkupItem.toJson`
   
   



.. rst-class:: kind-group kind-constructors

.. rubric:: Constructors
   :class: kind-group-title


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

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



.. rst-class:: kind-group kind-properties

.. rubric:: Properties
   :class: kind-group-title


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

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



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


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

      .. rst-class:: sig-pretty-signature
      
         | draw(**_renderer**\ : :js:class:`MarkupRenderer <wv.Markup.MarkupRenderer>`\ , **_view**\ : :js:class:`IView <wv.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 <wv.Markup.MarkupRenderer>`
      
      
            renderer engine to draw.
      
      
         **_view**\ : :js:class:`IView <wv.IView>`
      
      
            the view to draw on.
      
      
      
      **Returns**\ : *void*
      



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

      .. rst-class:: sig-pretty-signature
      
         | hit(**_point**\ : :js:class:`Point2 <wv.Point2>`\ , **_view**\ : :js:class:`IView <wv.IView>`\ ): *boolean*
      
      Called when a hit test is performed on this markup item.
      
      **Parameters**
      
      
         **_point**\ : :js:class:`Point2 <wv.Point2>`
      
      
            position in window where the hit test is being performed.
      
      
         **_view**\ : :js:class:`IView <wv.IView>`
      
      
            the projection where the hit test occurred.
      
      
      
      **Returns**\ : *boolean*
      
      
         boolean value indicating whether this item was picked
      
      



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

      .. rst-class:: sig-pretty-signature
      
         | hitWithTolerance(**_point**\ : :js:class:`Point2 <wv.Point2>`\ , **_view**\ : :js:class:`IView <wv.IView>`\ , **_pickTolerance**\ : *number*\ ): *boolean*
      
      Called when a hit test is performed on this markup item.
      
      **Parameters**
      
      
         **_point**\ : :js:class:`Point2 <wv.Point2>`
      
      
            position in window where the hit test is being performed.
      
      
         **_view**\ : :js:class:`IView <wv.IView>`
      
      
            the projection where the hit test occurred.
      
      
         **_pickTolerance**\ : *number*
      
      
            amount of tolerance allowed for a hit in pixels.
      
      
      
      **Returns**\ : *boolean*
      
      
         boolean value indicating whether this item was picked
      
      



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

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



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

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



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

      .. rst-class:: sig-pretty-signature
      
         | remove(**_view**\ : (*None* | :js:class:`IView <wv.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 <wv.IView>`\ )
      
      
            the view to remove from, null if removed from everywhere.
      
      
      
      **Returns**\ : *void*
      



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

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




