OverlayManager

class Communicator.OverlayManager()

The OverlayManager exposes functionality for creating overlays that are layered on top of the 3d scene. More information can be found here. An overlay defines a viewport on the screen with an associated camera. These overlays are useful for creating axis triads, navigational cubes, or similar elements. The overlays are not designed to create multiple views of a model. Therefore, inserting large amounts of geometry into overlays isn’t recommended.


Methods

addNodes

Communicator.OverlayManager.addNodes(index, nodes)

Adds nodes into the overlay at the given index. They will no longer be rendered in the main window or any other overlay. This method should not be called before the model structure ready callback has been triggered.

Arguments
  • index (Communicator.OverlayIndex()) – the overlay index to add nodes into.

  • nodes ([Communicator.NodeId]()) – the nodes to add into the overlay.

Return type

Communicator.DeprecatedPromise

destroy

Communicator.OverlayManager.destroy(index)

Removes an overlay from the system. All nodes that have been assigned to this overlay will be returned to the default view.

Arguments
  • index (Communicator.OverlayIndex()) – the index of the overlay to destroy.

Return type

Communicator.DeprecatedPromise

getViewportAnchor

Communicator.OverlayManager.getViewportAnchor(index)

Get the anchor point of the viewport with the supplied index, or null if none has been set.

Arguments
  • index (Communicator.OverlayIndex()) – The index of the overlay to get the anchor of.

Return type

{  }

getViewportPixelOffsetInCanvas

Communicator.OverlayManager.getViewportPixelOffsetInCanvas(index)

Gets the calculated position of the upper-left corner of the viewport with the supplied index, or null if none has been set.

Arguments
  • index (Communicator.OverlayIndex()) – The index of the overlay to get the offset of

Return type

{  }

getViewportPixelPosition

Communicator.OverlayManager.getViewportPixelPosition(index)

Gets position in pixels of the viewport with the supplied index, or null if none has been set. Note: This does not take the anchor point into account

Arguments
  • index (Communicator.OverlayIndex()) – The index of the overlay to get the position of.

Return type

{  }

getViewportPixelSize

Communicator.OverlayManager.getViewportPixelSize(index)

Gets size in pixels of the viewport with the supplied index, or null if none has been set.

Arguments
  • index (Communicator.OverlayIndex()) – The index of the overlay to get the size of.

Return type

{  }

maxIndex

Communicator.OverlayManager.maxIndex()

Gets the maximum index value that can be used for indexing overlays.

Return type

Communicator.OverlayIndex

Returns

the maximum index value.

setCamera

Communicator.OverlayManager.setCamera(index, camera)

Sets the camera for the given index.

Arguments
Return type

Communicator.DeprecatedPromise

setViewport

Communicator.OverlayManager.setViewport(index, anchor, x, xUnit, y, yUnit, width, widthUnit, height, heightUnit)

Creates an overlay or updates an existing one.

Arguments
  • index (Communicator.OverlayIndex()) – the index of the overlay. This value may be any number between 1 and maxIndex(). If No overlay exists for this index one will be created.

  • anchor (Communicator.OverlayAnchor()) – the anchor point for the viewport.

  • x (number()) – the x value of the viewport location.

  • xUnit (Communicator.OverlayUnit()) – the unit type of the x parameter.

  • y (number()) – the y value of the viewport location.

  • yUnit (Communicator.OverlayUnit()) – the unit type of the y parameter.

  • width (number()) –

  • widthUnit (Communicator.OverlayUnit()) –

  • height (number()) –

  • heightUnit (Communicator.OverlayUnit()) –

Return type

Communicator.DeprecatedPromise

setVisibility

Communicator.OverlayManager.setVisibility(index, visibility)

Sets the visibility state for the given viewport.

Arguments
  • index (Communicator.OverlayIndex()) – the overlay index.

  • visibility (boolean()) – boolean value indicating whether the overlay should be rendered.

Return type

Communicator.DeprecatedPromise