import {ZonesPlugin} from '@xeokit/xeokit-sdk/src/plugins/ZonesPlugin/ZonesPlugin.js'
ZonesPlugin
Extends:
ZonesPlugin documentation to be added, mostly compatible with DistanceMeasurementsPlugin.
Constructor Summary
Public Constructor | ||
public |
constructor(viewer: Viewer, cfg: Object) |
Member Summary
Public Members | ||
public |
defaultColor: * |
|
public |
zIndex: * |
|
public get |
zones: {String: Zone} Gets the existing Zones, each mapped to its Zone#id. |
Method Summary
Public Methods | ||
public |
createZone(params: Object): Zone Creates a Zone. |
|
public |
destroy() Destroys this ZonesPlugin. |
Inherited Summary
From class Plugin | ||
public |
ID for this Plugin, unique within its Viewer. |
|
public |
The Viewer that contains this Plugin. |
|
public |
destroy() Destroys this Plugin and removes it from its Viewer. |
|
public |
Logs an error message to the JavaScript developer console, prefixed with the ID of this Plugin. |
|
public |
Fires an event on this Plugin. |
|
public |
Returns true if there are any subscribers to the given event on this Plugin. |
|
public |
Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin. |
|
public |
Cancels an event subscription that was previously made with Plugin#on or Plugin#once. |
|
public |
Subscribes to an event on this Plugin. |
|
public |
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 |
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#constructorParams:
Name | Type | Attribute | Description |
viewer | Viewer | The Viewer. |
|
cfg | Object |
|
Plugin configuration. |
cfg.id | String |
|
Optional ID for this plugin, so that we can find it within Viewer#plugins. |
cfg.container | HTMLElement |
|
Container DOM element for markers and labels. Defaults to |
cfg.defaultColor | string |
|
The default color of the length dots, wire and label. |
cfg.zIndex | number |
|
If set, the wires, dots and labels will have this zIndex (+1 for dots and +2 for labels). |
cfg.pointerLens | PointerCircle |
|
A PointerLens to help the user position the pointer. This can be shared with other plugins. |
Public Methods
public createZone(params: Object): Zone source
Creates a Zone.
The Zone is then registered by Zone#id in ZonesPlugin#zones.
Params:
Name | Type | Attribute | Description |
params | Object | Zone configuration. |
|
params.id | String | Unique ID to assign to Zone#id. The Zone will be registered by this in ZonesPlugin#zones and Scene.components. Must be unique among all components in the Viewer. |
|
params.origin.worldPos | Number[] | Origin World-space 3D position. |
|
params.origin.entity | Entity | Origin Entity. |
|
params.target.worldPos | Number[] | Target World-space 3D position. |
|
params.target.entity | Entity | Target Entity. |
|
params.color | string |
|
The color of the length dot, wire and label. |
Return:
Zone | The new Zone. |
public destroy() source
Destroys this ZonesPlugin.
Destroys all Zones first.