Reference Source
public class | source

AxisGizmoPlugin

Extends:

Plugin → AxisGizmoPlugin

Viewer plugin that shows the axii of the World-space coordinate system.

Usage

[Run this example]

import {Viewer, XKTLoaderPlugin, AxisGizmoPlugin} from "xeokit-sdk.es.js";

const viewer = new Viewer({
    canvasId: "myCanvas"
});

viewer.camera.eye = [-2.56, 8.38, 8.27];
viewer.camera.look = [13.44, 3.31, -14.83];
viewer.camera.up = [0.10, 0.98, -0.14];

const xktLoader = new XKTLoaderPlugin(viewer);

new AxisGizmoPlugin(viewer, {
    canvasId: "myAxisGizmoCanvas"
});

const model = xktLoader.load({
    id: "myModel",
    src: "../assets/models/xkt/Schependomlaan.xkt",
    edges: true
});

Constructor Summary

Public Constructor
public

constructor(viewer: Viewer, cfg: Object)

Method Summary

Public Methods
public

Destroys this AxisGizmoPlugin.

public

setVisible(visible: *)

Shows or hides this AxisGizmoPlugin.

Inherited Summary

From class Plugin
public

ID for this Plugin, unique within its Viewer.

public

The Viewer that contains this Plugin.

public

Destroys this Plugin and removes it from its Viewer.

public

error(msg: String)

Logs an error message to the JavaScript developer console, prefixed with the ID of this Plugin.

public

fire(event: String, value: Object, forget: Boolean)

Fires an event on this Plugin.

public

Returns true if there are any subscribers to the given event on this Plugin.

public

log(msg: String)

Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin.

public

off(subId: String)

Cancels an event subscription that was previously made with Plugin#on or Plugin#once.

public

on(event: String, callback: Function, scope: Object): String

Subscribes to an event on this Plugin.

public

once(event: String, callback: Function, scope: Object)

Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd.

public

scheduleTask(task: *)

Schedule a task to perform on the next browser interval

public

warn(msg: String)

Logs a warning message to the JavaScript developer console, prefixed with the ID of this Plugin.

Public Constructors

public constructor(viewer: Viewer, cfg: Object) source

Creates this Plugin and installs it into the given Viewer.

Override:

Plugin#constructor

Params:

NameTypeAttributeDescription
viewer Viewer

The Viewer.

cfg Object

Plugin configuration.

cfg.id String
  • optional
  • default: "AxisGizmo"

Optional ID for this plugin, so that we can find it within Viewer#plugins.

cfg.canvasId String
  • optional

ID of an existing HTML canvas to display the AxisGizmo - either this or canvasElement is mandatory. When both values are given, the element reference is always preferred to the ID.

cfg.canvasElement HTMLCanvasElement
  • optional

Reference of an existing HTML canvas to display the AxisGizmo - either this or canvasId is mandatory. When both values are given, the element reference is always preferred to the ID.

Public Methods

public destroy() source

Destroys this AxisGizmoPlugin.

Override:

Plugin#destroy

public setVisible(visible: *) source

Shows or hides this AxisGizmoPlugin.

Params:

NameTypeAttributeDescription
visible *