Overlay

class cee.Overlay()

Manages 2d overlay items in a View.

Overlay items are 2d items drawn in the view together with the 3d model, for example color legends, navigation cube, step text and info box.

You can access the overlay object with the View.overlay property.


Accessors

cee.Overlay.autoAppendModelInfoToInfoBox

Whether information from the models should be appended to the info box

cee.Overlay.infoBoxPosition

The position of the info box.

cee.Overlay.infoBoxVisible

The visibility of the info box (the blue box in the bottom right corner) in the view

cee.Overlay.legendsPosition

The position of the legends.

cee.Overlay.maximumLegendHeight

The maximum height of the legends (color legends and category legends).

Legends are sized to fit the view, depending on the view height and the number of legends. This property controls the maximum height a legend can have.

The value of this property is in device pixels, so it’s multiplied by the display’s pixelScaleFactor to give the native (full resolution) pixel height.

cee.Overlay.modelColorLegendsVisible

The visibility of the color legend overlay items for models (currently only for RemoteModel).

cee.Overlay.navigationCubeHomeDirection

The view direction to set when the “Home” button on the navigation cube is pressed

cee.Overlay.navigationCubeHomeEye

The view eye position to set when the “Home” button on the navigation cube is pressed If undefined then eye position is set automatically to fit view

cee.Overlay.navigationCubeHomeUp

The up direction to set when the “Home” button on the navigation cube is pressed

cee.Overlay.navigationCubePosition

The position of the navigation cube.

cee.Overlay.navigationCubeVisible

The visibility of the navigation cube in the view

cee.Overlay.stepTextVisible

The visibility of the step text (the text at the bottom of the view displaying the current step for RemoteModels)

Methods

addCustomCategoryLegend

cee.Overlay.addCustomCategoryLegend(categories, colors, legendTitle, resultId)

Adds a category legend to the view.

Arguments
  • categories ([string]) –

  • colors (ArrayLike[cee.Color3Like]) –

  • legendTitle (string) –

  • resultId (number) –

Return type

void

The category legend shows each color with its corresponding descriptive text.

Note that the categories and colors arrays must have the same length.

Legends can be removed with the removeAllCustomLegends method.

addCustomColorLegend

cee.Overlay.addCustomColorLegend(legend)

Adds a color legend displaying the settings of the given scalar mapper.

Arguments
Return type

void

Legends can be removed with the removeAllCustomLegends method.

addCustomColorLegendForScalarMapper

cee.Overlay.addCustomColorLegendForScalarMapper(scalarMapper, legendTitle, resultId)

Adds a color legend displaying the settings of the given scalar mapper.

Arguments
Return type

void

Legends can be removed with the removeAllCustomLegends method.

The resultId parameter is an optional user defined id identifying the scalar mapper. This id will be passed to the legend picked handler when the user clicks on the color legend. See Viewer.setColorLegendClickHandler and ColorLegendClickedHandler for more information.

configureNavigationCube

cee.Overlay.configureNavigationCube(faceNames, faceColors, axisLabels)

Configure the navigation cube

Arguments
  • faceNames ([string]) –

  • faceColors ([cee.Color3Like]) –

  • axisLabels ([string]) –

Return type

void

faceNames: Must contain 6 values, names for: Pos_X, Neg_X, Pos_Y, Neg_Y, Pos_Z, Neg_Z faceColors: null or 6 values, colors for: Pos_X, Neg_X, Pos_Y, Neg_Y, Pos_Z, Neg_Z axisLabels: null (defaults to x,y,z) or 3 values, names for X_AXIS, Y_AXIS, Z_AXIS

removeAllCustomLegends

cee.Overlay.removeAllCustomLegends()

Removes all custom legends from the view.

Return type

void

This method will remove all legends added with the addCustomColorLegendForScalarMapper and addCustomCategoryLegend methods.

setInfoBoxAppearance

cee.Overlay.setInfoBoxAppearance(backgroundColor, textColor, borderColor)

Sets the appearance of the info box.

Arguments
Return type

void

setInfoBoxContent

cee.Overlay.setInfoBoxContent(content)

Sets the text to show in the info box.

Arguments
  • content (string) –

Return type

void

Note that any information from the models will be appended to the given string unless autoAppendModelInfoToInfoBox is set to false.

setStepTextContent

cee.Overlay.setStepTextContent(content)

Sets the text to show in as the step info.

Arguments
  • content (string) –

Return type

void

This will remove any automatic step info from the Remote Model.

viewConfigurationFromNavigationCubeItem

cee.Overlay.viewConfigurationFromNavigationCubeItem(item)

Get the view direction and up vector based on the navigation cube item

Arguments
  • item (cee.NavigationCubeItem) –

Return type

cee.NavigationCubeViewConfiguration