Class: xNavigationCube

xNavigationCube

This is a plugin for xViewer which renders interactive navigation cube. It is customizable in terms of alpha behaviour and its position on the viewer canvas. Use of plugin:

var cube = new xNavigationCube();
viewer.addPlugin(cube);

You can specify your own texture of the cube as an Image object argumen in constructor. If you don't specify any image default texture will be used (you can also use this one and enhance it if you want):

Cube texture

Constructor

new xNavigationCube(imageopt)

This is constructor of the Navigation Cube plugin for xBIM Viewer. It gets optional Image as an argument. The image will be used as a texture of the navigation cube. If you don't specify eny image default one will be used. Image has to be square and its size has to be power of 2.

Parameters:
Name Type Attributes Default Description
image Image <optional>
null

optional image to be used for a cube texture.

Members

activeAlpha :Number

Navigation cube has two transparency states. One is when user hovers over the cube and the second when the cursor is anywhere else. This is for the hovering shate and it should be a positive number between [0,1]. If the value is less than 1 cube will be semitransparent when user hovers over. Default value is 1.0.

Type:
  • Number

highlighting :Number

Active parts of the navigation cube are highlighted so that user can recognize which part is active. This should be a positive number between [0,2]. If the value is less than 1 active area is darker. If the value is greater than 1 active area is lighter. Default value is 1.2.

Type:
  • Number

passiveAlpha :Number

Navigation cube has two transparency states. One is when user hovers over the cube and the second when the cursor is anywhere else. This is for the non-hovering shate and it should be a positive number between [0,1]. If the value is less than 1 cube will be semitransparent when user is not hovering over. Default value is 0.3.

Type:
  • Number

position :Enum

It is possible to place navigation cube to any of the corners of the canvas using this property. Default value is cube.BOTTOM_RIGHT. Allowed values are cube.BOTTOM_RIGHT, cube.BOTTOM_LEFT, cube.TOP_RIGHT and cube.TOP_LEFT.

Type:
  • Enum

ratio :Number

Size of the cube relative to the size of viewer canvas. This has to be a positive number between [0,1] Default value is 0.15.

Type:
  • Number