.. role:: ts-api-decorator

################
FloorplanManager
################

.. js:module:: Floorplan
   :noindex:

.. container:: ts-api-section

   .. js:class:: FloorplanManager

      Main interface into the 2D floorplan functionality for the viewer.
      Can show a 2-dimensional floorplan of a BIM-enabled model. The floorplan display will
      include an avatar that represents the camera position of the 3D view.



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~Floorplan.FloorplanManager.activate`
   * :js:meth:`~Floorplan.FloorplanManager.deactivate`
   * :js:meth:`~Floorplan.FloorplanManager.getAvatarNodeId`
   * :js:meth:`~Floorplan.FloorplanManager.getConfiguration`
   * :js:meth:`~Floorplan.FloorplanManager.getCurrentFloorNodeId`
   * :js:meth:`~Floorplan.FloorplanManager.getFloorLock`
   * :js:meth:`~Floorplan.FloorplanManager.insideOverlay`
   * :js:meth:`~Floorplan.FloorplanManager.isActive`
   * :js:meth:`~Floorplan.FloorplanManager.setAutoActivate`
   * :js:meth:`~Floorplan.FloorplanManager.setAvatarColor`
   * :js:meth:`~Floorplan.FloorplanManager.setAvatarOpacity`
   * :js:meth:`~Floorplan.FloorplanManager.setAvatarOutlineColor`
   * :js:meth:`~Floorplan.FloorplanManager.setAvatarScale`
   * :js:meth:`~Floorplan.FloorplanManager.setBackgroundColor`
   * :js:meth:`~Floorplan.FloorplanManager.setBackgroundOpacity`
   * :js:meth:`~Floorplan.FloorplanManager.setBorderColor`
   * :js:meth:`~Floorplan.FloorplanManager.setBorderOpacity`
   * :js:meth:`~Floorplan.FloorplanManager.setConfiguration`
   * :js:meth:`~Floorplan.FloorplanManager.setCustomAvatar`
   * :js:meth:`~Floorplan.FloorplanManager.setFixedAvatarScale`
   * :js:meth:`~Floorplan.FloorplanManager.setFloorLock`
   * :js:meth:`~Floorplan.FloorplanManager.setFloorplanOrientation`
   * :js:meth:`~Floorplan.FloorplanManager.setOverlayAnchor`
   * :js:meth:`~Floorplan.FloorplanManager.setOverlayFeetPerPixel`
   * :js:meth:`~Floorplan.FloorplanManager.setOverlayOffset`
   * :js:meth:`~Floorplan.FloorplanManager.setOverlaySize`
   * :js:meth:`~Floorplan.FloorplanManager.setTrackCameraEnabled`
   * :js:meth:`~Floorplan.FloorplanManager.setUseTightBoundings`
   * :js:meth:`~Floorplan.FloorplanManager.setZoomLevel`
   * :js:meth:`~Floorplan.FloorplanManager.snapAvatarToPoint`





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

Methods
=======

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

activate
--------

.. js:method:: FloorplanManager.activate()



   Activate the floorplan overlay.


   :rtype: Promise <void>

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

deactivate
----------

.. js:method:: FloorplanManager.deactivate()



   Deactivate the floorplan overlay. Once explicitly deactivated via this call, auto-activation
    will be suppressed for any new model that is loaded. Auto-activation can be reenabled by
    calling [[setAutoActivate]].


   :rtype: Promise <void>

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

getAvatarNodeId
---------------

.. js:method:: FloorplanManager.getAvatarNodeId()



   Gets the [[NodeId]] of the floorplan avatar.


   :rtype: null | number

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

getConfiguration
----------------

.. js:method:: FloorplanManager.getConfiguration()



   Returns a copy of the current floorplan configuration.


   :rtype: FloorplanConfig

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

getCurrentFloorNodeId
---------------------

.. js:method:: FloorplanManager.getCurrentFloorNodeId()



   Gets the [[NodeId]] of the current storey.


   :rtype: null | number

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

getFloorLock
------------

.. js:method:: FloorplanManager.getFloorLock()



   Returns ``true`` if displayed floor has been locked with [[setFloorLock]].


   :rtype: boolean

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

insideOverlay
-------------

.. js:method:: FloorplanManager.insideOverlay( point)

   :param point: None
   :type point: Point2


   Returns ``true`` if the given point is inside the floorplan overlay and ``false`` otherwise.


   :rtype: boolean

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

isActive
--------

.. js:method:: FloorplanManager.isActive()



   Returns ``true`` if the [[FloorplanManager]] is fully active.


   :rtype: boolean

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

setAutoActivate
---------------

.. js:method:: FloorplanManager.setAutoActivate( autoActivate)

   :param autoActivate: None
   :type autoActivate: FloorplanAutoActivation


   Sets the auto-activate capability for any models loaded after this call. See [[FloorplanConfig.autoActivate]] for detailed information.


   :rtype: Promise <void>

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

setAvatarColor
--------------

.. js:method:: FloorplanManager.setAvatarColor( color)

   :param color: None
   :type color: Color


   Sets the avatar primary color. See [[FloorplanConfig.avatarColor]] for detailed information.


   :rtype: Promise <void>

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

setAvatarOpacity
----------------

.. js:method:: FloorplanManager.setAvatarOpacity( opacity)

   :param opacity: None
   :type opacity: number


   Sets the avatar opacity. See [[FloorplanConfig.avatarOpacity]] for detailed information.


   :rtype: Promise <void>

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

setAvatarOutlineColor
---------------------

.. js:method:: FloorplanManager.setAvatarOutlineColor( color)

   :param color: None
   :type color: Color


   Sets the avatar outline color. See [[FloorplanConfig.avatarOutlineColor]] for detailed information.


   :rtype: Promise <void>

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

setAvatarScale
--------------

.. js:method:: FloorplanManager.setAvatarScale( scale)

   :param scale: None
   :type scale: number


   Sets the avatar scale. See [[FloorplanConfig.avatarScale]] for detailed information.


   :rtype: Promise <void>

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

setBackgroundColor
------------------

.. js:method:: FloorplanManager.setBackgroundColor( color)

   :param color: None
   :type color: Color


   Sets the overlay background color. See [[FloorplanConfig.backgroundColor]] for detailed information.


   :rtype: Promise <void>

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

setBackgroundOpacity
--------------------

.. js:method:: FloorplanManager.setBackgroundOpacity( opacity)

   :param opacity: None
   :type opacity: number


   Sets the overlay background opacity. See [[FloorplanConfig.backgroundOpacity]] for detailed information.


   :rtype: Promise <void>

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

setBorderColor
--------------

.. js:method:: FloorplanManager.setBorderColor( color)

   :param color: None
   :type color: Color


   Sets the overlay border color. See [[FloorplanConfig.borderColor]] for detailed information.


   :rtype: Promise <void>

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

setBorderOpacity
----------------

.. js:method:: FloorplanManager.setBorderOpacity( opacity)

   :param opacity: None
   :type opacity: number


   Sets the overlay border opacity. See [[FloorplanConfig.borderOpacity]] for detailed information.


   :rtype: Promise <void>

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

setConfiguration
----------------

.. js:method:: FloorplanManager.setConfiguration( config)

   :param config: None
   :type config: FloorplanConfig


   Updates the floorplan to use the given configuration. This function allows
   the user to set all configuration values with a single operation. There are
   also ``set<config-value>()`` functions for easily setting individual configuration
   values.

   Note that when using this function, all settings in the given configuration are
   used and thus overwrite any individual settings changed with a prior
   ``set<config-value>()`` call.

   All values from the passed configuration will be copied as part of this operation.


   :rtype: Promise <void>

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

setCustomAvatar
---------------

.. js:method:: FloorplanManager.setCustomAvatar( customAvatarNodeId)

   :param customAvatarNodeId: None
   :type customAvatarNodeId: null | number


   Sets a custom avatar. See [[FloorplanConfig.customAvatar]] for detailed information.


   :rtype: Promise <void>

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

setFixedAvatarScale
-------------------

.. js:method:: FloorplanManager.setFixedAvatarScale( fixedScale)

   :param fixedScale: None
   :type fixedScale: boolean


   Sets the avatar size to fixed scale. See [[FloorplanConfig.fixedAvatarScale]] for detailed information.


   :rtype: Promise <void>

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

setFloorLock
------------

.. js:method:: FloorplanManager.setFloorLock( lock)

   :param lock: None
   :type lock: boolean


   Locks floorplan to current floor such that changing floors will not change the displayed floorplan.


   :rtype: Promise <void>

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

setFloorplanOrientation
-----------------------

.. js:method:: FloorplanManager.setFloorplanOrientation( orientation)

   :param orientation: None
   :type orientation: FloorplanOrientation


   Sets the floorplan display orientation. See [[FloorplanConfig.floorplanOrientation]] for detailed information.


   :rtype: Promise <void>

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

setOverlayAnchor
----------------

.. js:method:: FloorplanManager.setOverlayAnchor( anchor)

   :param anchor: None
   :type anchor: OverlayAnchor


   Sets the anchor position of the floorplan overlay window. See [[FloorplanConfig.overlayAnchor]] for detailed information.


   :rtype: Promise <void>

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

setOverlayFeetPerPixel
----------------------

.. js:method:: FloorplanManager.setOverlayFeetPerPixel( feetPerPixel)

   :param feetPerPixel: None
   :type feetPerPixel: number


   Sets the overlay scaling. See [[FloorplanConfig.overlayFeetPerPixel]] for detailed information.


   :rtype: Promise <void>

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

setOverlayOffset
----------------

.. js:method:: FloorplanManager.setOverlayOffset( offset)

   :param offset: None
   :type offset: Point2


   Sets the offset position of the floorplan overlay window. See [[FloorplanConfig.overlayOffset]] for detailed information.


   :rtype: Promise <void>

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

setOverlaySize
--------------

.. js:method:: FloorplanManager.setOverlaySize( size, widthUnits, heightUnits)

   :param size: None
   :type size: Point2
   :param widthUnits: None
   :type widthUnits: OverlayUnit
   :param heightUnits: None
   :type heightUnits: OverlayUnit


   Sets the size of the floorplan overlay window. See [[FloorplanConfig.overlaySize]] for detailed information.


   :rtype: Promise <void>

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

setTrackCameraEnabled
---------------------

.. js:method:: FloorplanManager.setTrackCameraEnabled( enabled)

   :param enabled: None
   :type enabled: boolean


   Sets the floorplan tracking mode. See [[FloorplanConfig.trackCameraEnabled]] for detailed information.


   :rtype: Promise <void>

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

setUseTightBoundings
--------------------

.. js:method:: FloorplanManager.setUseTightBoundings( tightBoundings)

   :param tightBoundings: None
   :type tightBoundings: boolean


   Makes floorplans use tight boundings during creation which can result in a better fit for the overlay.
   This involves recreating any already existing floorplans.
   This can be significantly more time consuming than using loose boundings if your floors are complex.
   Defaults to ``false``.


   :rtype: Promise <void>

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

setZoomLevel
------------

.. js:method:: FloorplanManager.setZoomLevel( zoomLevel)

   :param zoomLevel: None
   :type zoomLevel: number


   Sets the overlay zoom level. See [[FloorplanConfig.zoomLevel]] for detailed information.


   :rtype: Promise <void>

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

snapAvatarToPoint
-----------------

.. js:method:: FloorplanManager.snapAvatarToPoint( point)

   :param point: Point in canvas within overlay
   :type point: Point2


   Moves the camera such that the avatar will appear at the provided point on the overlay.
   This is only available when the floorplan is not tracking the camera.


   :rtype: void

