.. role:: ts-api-decorator

##################
ElementHighlighter
##################

.. js:module:: cee.usg
   :noindex:

.. container:: ts-api-section

   .. js:class:: ElementHighlighter

      Helper class for highlighting elements

      The class makes it easy to highlight an element by adding a tessellation of the element to a markup
      model, as well as creating a label with the element id/index.

      .. image:: ../../images/UsgElementHighligher.png





.. container:: api-index-section

   .. rubric:: Constructors

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

   * :js:meth:`~cee.usg.ElementHighlighter.constructor`



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~cee.usg.ElementHighlighter.addElementHighlight`
   * :js:meth:`~cee.usg.ElementHighlighter.addElementLabel`





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

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

.. container:: ts-api-section

   .. js:function:: ElementHighlighter.constructor( usgModel, markupModel)

      :param usgModel: None
      :type usgModel: UnstructGridModel
      :param markupModel: None
      :type markupModel: MarkupModel


      Setup the object with the unstruct grid model with the FEA model, and the Markup Model which will
      receive the highlight parts constructed from the usgModel.


      :rtype: ElementHighlighter



Methods
=======

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

addElementHighlight
-------------------

.. js:method:: ElementHighlighter.addElementHighlight( surfaceColor, state, partIndex, elementIndex)

   :param surfaceColor: None
   :type surfaceColor: Color3
   :param state: None
   :type state: State
   :param partIndex: None
   :type partIndex: number
   :param elementIndex: None
   :type elementIndex: number


   Add a part with the tessellation of the given element as a surface with the given color.
   The part will use eye lift to not interfere with the usg model.

   See example image above for how it will look


   :rtype: boolean

.. js:method:: ElementHighlighter.addElementHighlight( surfaceColor, hitItem)
   :noindex:

   :param surfaceColor: None
   :type surfaceColor: Color3
   :param hitItem: None
   :type hitItem: HitItem


   :rtype: boolean

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

addElementLabel
---------------

.. js:method:: ElementHighlighter.addElementLabel( state, partIndex, elementIndex, label)

   :param state: None
   :type state: State
   :param partIndex: None
   :type partIndex: number
   :param elementIndex: None
   :type elementIndex: number
   :param label: None
   :type label: string


   Add an element label based on either a hit item or specified by state, part and element index.

   See example image above for how it will look


   :rtype: boolean

.. js:method:: ElementHighlighter.addElementLabel( hitItem)
   :noindex:

   :param hitItem: None
   :type hitItem: HitItem


   :rtype: boolean

