import { Viewer } from "../../viewer"; import { IPlugin } from "../plugin"; import { ProductIdentity } from "../../common/product-identity"; export declare class NavigationCube implements IPlugin { /** * This is constructor of the Navigation Cube plugin for {@link Viewer xBIM Viewer}. It gets optional Image as an argument. * The images will be used as a texture of the navigation cube. If you don't specify eny images default one will be used. * Image has to be square and its size has to be power of 2. * @name NavigationCube * @constructor * @classdesc This is a plugin for Viewer 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 NavigationCube(); * viewer.addPlugin(cube); * * You can specify your own texture of the cube as an [Image](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image) * object argument in constructor. If you don't specify any images default texture will be used (you can also use this one and enhance it if you want): * * ![Cube texture](cube_texture.png) * * @param {Image} [image = null] - optional images to be used for a cube texture. */ constructor(image?: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement); private _image; private TOP; private BOTTOM; private LEFT; private RIGHT; private FRONT; private BACK; private TOP_LEFT_FRONT; private TOP_RIGHT_FRONT; private TOP_LEFT_BACK; private TOP_RIGHT_BACK; private BOTTOM_LEFT_FRONT; private BOTTOM_RIGHT_FRONT; private BOTTOM_LEFT_BACK; private BOTTOM_RIGHT_BACK; private TOP_LEFT; private TOP_RIGHT; private TOP_FRONT; private TOP_BACK; private BOTTOM_LEFT; private BOTTOM_RIGHT; private BOTTOM_FRONT; private BOTTOM_BACK; private FRONT_RIGHT; private FRONT_LEFT; private BACK_RIGHT; private BACK_LEFT; private _initialized; private _modelId; private _region; /** * 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. * @member {Number} NavigationCube#ratio */ ratio: number; /** * Minimum size of the cube when scaling the view. Default is 50px * @member {Number} NavigationCube#minSize */ minSize: number; /** * Maximum size of the cube when scaling the view. Default is 200px * @member {Number} NavigationCube#maxSize */ maxSize: 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. * @member {Number} NavigationCube#highlighting */ highlighting: 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 state, 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. * @member {Number} NavigationCube#activeAlpha */ 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 non-hovering state, 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.7. * @member {Number} NavigationCube#passiveAlpha */ passiveAlpha: number; /** * 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. * @member {Enum} NavigationCube#position */ position: number; /** * True north correction to be applied to navigation cube both for visualization and for navigation. Value should be in degrees. Default is 0. * @member {Enum} NavigationCube#trueNorth */ trueNorth: number; /** * Set this to true to stop rendering of this plugin * @member {boolean} NavigationCube#stopped */ get stopped(): boolean; set stopped(value: boolean); private _stopped; private viewer; private _shader; private _alpha; private _selection; private _pMatrixUniformPointer; private _rotationUniformPointer; private _colourCodingUniformPointer; private _alphaUniformPointer; private _selectionUniformPointer; private _textureUniformPointer; private _highlightingUniformPointer; private _vertexAttrPointer; private _texCoordAttrPointer; private _idAttrPointer; private _indexBuffer; private _vertexBuffer; private _texCoordBuffer; private _idBuffer; private _texture; private _drag; private _originalNavigation; init(viewer: Viewer): void; onBeforeDraw(width: number, height: number): void; onBeforePick(identity: ProductIdentity): boolean; onAfterDraw(width: number, height: number): void; onBeforeDrawId(): void; onAfterDrawId(): void; onAfterDrawModelId(): void; private getId; private setActive; private isInRegion; private _initShader; private draw; vertices: Float32Array; private indices; private txtCoords; private ids; }