.. role:: ts-api-decorator

###############
NoteTextManager
###############

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

.. container:: ts-api-section

   .. js:class:: NoteTextManager

      The markup manager exports JSON data for markup in the scene. By default, it will export "views", "notes", "measurement", and "lines".
      To add a custom markup class to be exported and imported along with other markup items, you can register a custom markup type manager.

      The custom markup manager needs two functions:
      - exportMarkup creates an array of JSON markup data.
      - loadData takes an array of JSON markup data and creates markup items.



.. container:: api-index-section

   .. rubric:: Constructors

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

   * :js:meth:`~Operators.Markup.Note.NoteTextManager.constructor`



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~Operators.Markup.Note.NoteTextManager.addNote`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.checkPinInstance`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.explode`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.exportMarkup`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.findById`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.getActiveItem`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.getActiveItemHandle`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.getExplodeActive`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.getIsolateActive`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.getNoteTextElement`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.getNoteTextList`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.getPinSphereMeshId`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.getPinStemMeshId`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.loadData`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.removeNote`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.selectPin`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.setActiveItem`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.setActiveItemHandle`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.setIsolateActive`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.setNoteTextElement`
   * :js:meth:`~Operators.Markup.Note.NoteTextManager.updatePinVisibility`





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

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

.. container:: ts-api-section

   .. js:function:: NoteTextManager.constructor( viewer)

      :param viewer: None
      :type viewer: WebViewer


      :rtype: NoteTextManager



Methods
=======

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

addNote
-------

.. js:method:: NoteTextManager.addNote( note)

   :param note: NoteText to be added to the manager
   :type note: NoteText


   Adds a note and makes it active


   :rtype: void

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

checkPinInstance
----------------

.. js:method:: NoteTextManager.checkPinInstance( nodeId)

   :param nodeId: NodeId to be checked
   :type nodeId: number


   Checks if a nodeId is part of a note pin


   :rtype: boolean

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

explode
-------

.. js:method:: NoteTextManager.explode( magnitude)

   :param magnitude: Explosion magnitude
   :type magnitude: number


   Sets manager explode state based on explosion magnitude. Active explosion hides note pins


   :rtype: Promise <void>

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

exportMarkup
------------

.. js:method:: NoteTextManager.exportMarkup()



   Exports note texts to an array of JSON Objects that can be restored via [[loadData]]

   :returns: Array of JSON objects representing notes


   :rtype: [object]

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

findById
--------

.. js:method:: NoteTextManager.findById( id)

   :param id: UUID to check
   :type id: string


   Checks if a UUID is associated with any existing notes


   :rtype: boolean

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

getActiveItem
-------------

.. js:method:: NoteTextManager.getActiveItem()



   Get the currently active note text

   :returns: Currently active note text


   :rtype: null | NoteText

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

getActiveItemHandle
-------------------

.. js:method:: NoteTextManager.getActiveItemHandle()



   Get the active handle string, such as the one returned by [[MarkupManager.registerMarkup]]

   :returns: Active handle string


   :rtype: null | string

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

getExplodeActive
----------------

.. js:method:: NoteTextManager.getExplodeActive()



   Gets managers explosion state. Active explosion hides note pins


   :rtype: boolean

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

getIsolateActive
----------------

.. js:method:: NoteTextManager.getIsolateActive()



   Gets whether an isolate is currently active or not

   :returns: isolate status


   :rtype: boolean

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

getNoteTextElement
------------------

.. js:method:: NoteTextManager.getNoteTextElement()



   Retrieves the note text element

   :returns: note text element


   :rtype: NoteTextElement

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

getNoteTextList
---------------

.. js:method:: NoteTextManager.getNoteTextList()



   Gets an array of all NoteText items that have been added to the manager

   :returns: array of all NoteText items


   :rtype: [NoteText]

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

getPinSphereMeshId
------------------

.. js:method:: NoteTextManager.getPinSphereMeshId()



   Retrieves the mesh id of the spherical head of the note pin, if there is one

   :returns: MeshId of the note pin sphere, or null if there is none


   :rtype: null | MeshId

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

getPinStemMeshId
----------------

.. js:method:: NoteTextManager.getPinStemMeshId()



   Retrieves the mesh id of the stem of the note pin, if there is one

   :returns: MeshId of the note pin stem, or null if there is none


   :rtype: null | MeshId

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

loadData
--------

.. js:method:: NoteTextManager.loadData( notes)

   :param notes: JSON note data iterable
   :type notes: any


   Loads notes from an iterable of JSON data like that returned by [[exportMarkup]]


   :rtype: Promise <[boolean]>

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

removeNote
----------

.. js:method:: NoteTextManager.removeNote( note)

   :param note: NoteText to be removed from the manager
   :type note: NoteText


   Removes a note from the manager


   :rtype: void

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

selectPin
---------

.. js:method:: NoteTextManager.selectPin( selection)

   :param selection: SelectionItem to attempt to find note from
   :type selection: SelectionItem


   Attempts to set the active note to the one associated with the
   pins elected by the provided [[SelectionItem]]


   :rtype: boolean

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

setActiveItem
-------------

.. js:method:: NoteTextManager.setActiveItem( activeItem)

   :param activeItem: note text to be marked as currently active
   :type activeItem: null | NoteText


   Sets a new currently active note text


   :rtype: void

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

setActiveItemHandle
-------------------

.. js:method:: NoteTextManager.setActiveItemHandle( activeItemHandle)

   :param activeItemHandle: Active handle string
   :type activeItemHandle: null | string


   Set the active handle string, should be provided by [[MarkupManager.registerMarkup]]


   :rtype: void

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

setIsolateActive
----------------

.. js:method:: NoteTextManager.setIsolateActive( isolateActive)

   :param isolateActive: None
   :type isolateActive: boolean


   Sets whether an isolate is currently active or not


   :rtype: void

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

setNoteTextElement
------------------

.. js:method:: NoteTextManager.setNoteTextElement( noteTextElement)

   :param noteTextElement: None
   :type noteTextElement: NoteTextElement


   Sets the note text element


   :rtype: void

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

updatePinVisibility
-------------------

.. js:method:: NoteTextManager.updatePinVisibility()



   Updates note pin visibility based on manager state (namely the current explode state)


   :rtype: Promise <void>

