@x-viewer/plugins 0.11.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +99 -99
- package/dist/types/axis-gizmo/AxisGizmoPlugin.d.ts +0 -26
- package/dist/types/axis-gizmo/CoordinateAxes.d.ts +1 -14
- package/dist/types/bottom-bar/BottomBarPlugin.d.ts +0 -6
- package/dist/types/context-menu/Constants.d.ts +4 -4
- package/dist/types/context-menu/ContextMenuPlugin.d.ts +1 -12
- package/dist/types/context-menu/Locale.d.ts +1 -1
- package/dist/types/dat-gui/Viewer3dDatGui.d.ts +1 -1
- package/dist/types/explode/ExplodePlugin.d.ts +1 -1
- package/dist/types/explode/ObjectExploder.d.ts +1 -1
- package/dist/types/export/ExportPlugin.d.ts +2 -2
- package/dist/types/ground-shaow/GroundShadowPlugin.d.ts +0 -6
- package/dist/types/hotpoint/HotpointPlugin.d.ts +1 -1
- package/dist/types/layer-manager/LayerManagerPlugin.d.ts +1 -2
- package/dist/types/local-model-uploader/IUploader.d.ts +1 -1
- package/dist/types/local-model-uploader/LocalDxfUploader.d.ts +1 -10
- package/dist/types/local-model-uploader/LocalModelUploader.d.ts +1 -7
- package/dist/types/markups/ArrowMarkup.d.ts +0 -2
- package/dist/types/markups/BaseMarkup.d.ts +0 -1
- package/dist/types/markups/CloudRectMarkup.d.ts +0 -1
- package/dist/types/markups/CloudRectWithTextMarkup.d.ts +0 -7
- package/dist/types/markups/LeaderLineMarkup.d.ts +0 -4
- package/dist/types/markups/MarkupPlugin.d.ts +0 -21
- package/dist/types/measurements/AreaMeasurement.d.ts +0 -4
- package/dist/types/measurements/BaseMeasurement.d.ts +1 -2
- package/dist/types/measurements/DistanceMeasureDrawable.d.ts +0 -2
- package/dist/types/measurements/DistanceMeasurement.d.ts +0 -4
- package/dist/types/measurements/Locale.d.ts +1 -1
- package/dist/types/measurements/MeasurementPlugin.d.ts +1 -21
- package/dist/types/nav-cube/Locale.d.ts +1 -1
- package/dist/types/nav-cube/NavCubePlugin.d.ts +1 -2
- package/dist/types/overview-map/OverviewMapPlugin.d.ts +0 -2
- package/dist/types/property/Locale.d.ts +1 -1
- package/dist/types/property/PropertyPlugin.d.ts +1 -15
- package/dist/types/screenshot/ScreenshotPlugin.d.ts +4 -14
- package/dist/types/sections/BaseSection.d.ts +1 -1
- package/dist/types/sections/Locale.d.ts +1 -1
- package/dist/types/sections/SectionPlugin.d.ts +1 -13
- package/dist/types/settings-2d/Locale.d.ts +1 -1
- package/dist/types/settings-2d/Settings2dPlugin.d.ts +2 -4
- package/dist/types/settings-3d/Locale.d.ts +1 -1
- package/dist/types/settings-3d/Settings3dPlugin.d.ts +1 -8
- package/dist/types/skybox/SkyboxPlugin.d.ts +0 -4
- package/dist/types/stats/StatsPlugin.d.ts +0 -1
- package/dist/types/toolbars/Locale.d.ts +1 -1
- package/dist/types/toolbars/MarkupToolbar.d.ts +3 -3
- package/dist/types/toolbars/Toolbar.config.d.ts +2 -2
- package/dist/types/toolbars/Toolbar.constants.d.ts +1 -1
- package/dist/types/toolbars/Toolbar.d.ts +1 -1
- package/dist/types/toolbars/Viewer2dToolbarPlugin.d.ts +1 -2
- package/dist/types/toolbars/Viewer3dToolbarPlugin.d.ts +1 -3
- package/dist/types/tree-view/Locale.d.ts +1 -1
- package/dist/types/tree-view/TreeViewPlugin.d.ts +1 -26
- package/dist/types/view-cube/Locale.d.ts +1 -1
- package/dist/types/view-cube/ViewCubePlugin.d.ts +1 -41
- package/package.json +1 -1
|
@@ -13,27 +13,15 @@ export declare enum SectionType {
|
|
|
13
13
|
* Section plugin config.
|
|
14
14
|
*/
|
|
15
15
|
export interface SectionPluginConfig extends Partial<PluginConfig> {
|
|
16
|
-
language?: "
|
|
16
|
+
language?: "en" | "zh";
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Section plugin, can be used by Viewer3d and BimTilesViewer.
|
|
20
20
|
*/
|
|
21
21
|
export declare class SectionPlugin extends Plugin {
|
|
22
22
|
static readonly DEFAULT_ID = "SectionPlugin";
|
|
23
|
-
private cfg;
|
|
24
|
-
private sections;
|
|
25
|
-
private activeSectionType?;
|
|
26
|
-
private lastRenderAutoClear;
|
|
27
|
-
private backMaterial?;
|
|
28
|
-
private frontMaterial?;
|
|
29
|
-
private enableSelection?;
|
|
30
23
|
constructor(viewer: BaseViewer, cfg?: SectionPluginConfig);
|
|
31
|
-
private initLocalization;
|
|
32
24
|
protected get raycaster(): THREE.Raycaster;
|
|
33
|
-
private onBeforeRender;
|
|
34
|
-
private onAfterRender;
|
|
35
|
-
private createCapStencilMaterials;
|
|
36
|
-
private render;
|
|
37
25
|
/**
|
|
38
26
|
* Activates one of "ObjectsBoxSection", "AxisPlaneSection" or "PickPlaneSection" Section
|
|
39
27
|
* @param {SectionType} type
|
|
@@ -7,12 +7,12 @@ export interface Settings2dPluginConfig extends Partial<PluginConfig> {
|
|
|
7
7
|
/**
|
|
8
8
|
* Container div id.
|
|
9
9
|
*/
|
|
10
|
-
containerId
|
|
10
|
+
containerId?: string;
|
|
11
11
|
/**
|
|
12
12
|
* If panel is visible. It is visible by default.
|
|
13
13
|
*/
|
|
14
14
|
visible?: boolean;
|
|
15
|
-
language?: "
|
|
15
|
+
language?: "en" | "zh";
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Setting 2d plugin events.
|
|
@@ -35,10 +35,8 @@ export declare class Settings2dPlugin extends Plugin<Settings2dPluginEvents> {
|
|
|
35
35
|
protected content?: HTMLDivElement;
|
|
36
36
|
constructor(viewer: Viewer2d, cfg?: Settings2dPluginConfig);
|
|
37
37
|
protected init(): void;
|
|
38
|
-
private initLocalization;
|
|
39
38
|
setVisible(visible: boolean): void;
|
|
40
39
|
isVisible(): boolean;
|
|
41
|
-
private onClose;
|
|
42
40
|
destroy(): void;
|
|
43
41
|
addContent(): void;
|
|
44
42
|
protected addEventHandlers(): void;
|
|
@@ -12,7 +12,7 @@ export interface Settings3dPluginConfig extends Partial<PluginConfig> {
|
|
|
12
12
|
* If panel is visible. It is visible by default.
|
|
13
13
|
*/
|
|
14
14
|
visible?: boolean;
|
|
15
|
-
language?: "
|
|
15
|
+
language?: "en" | "zh";
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Setting 3d plugin events.
|
|
@@ -33,17 +33,10 @@ export declare class Settings3dPlugin extends Plugin<Settings3dPluginEvents> {
|
|
|
33
33
|
protected basePanel?: BasePanel;
|
|
34
34
|
protected container?: HTMLDivElement;
|
|
35
35
|
protected content?: HTMLDivElement;
|
|
36
|
-
private skyboxPlugin;
|
|
37
|
-
private groundGridPlugin;
|
|
38
|
-
private groundShadowPlugin;
|
|
39
|
-
private viewCubePlugin;
|
|
40
|
-
private axisGizmoPlugin;
|
|
41
36
|
constructor(viewer: Viewer3d, cfg?: Settings3dPluginConfig);
|
|
42
37
|
protected init(): void;
|
|
43
|
-
private initLocalization;
|
|
44
38
|
setVisible(visible: boolean): void;
|
|
45
39
|
isVisible(): boolean;
|
|
46
|
-
private onClose;
|
|
47
40
|
destroy(): void;
|
|
48
41
|
addContent(): void;
|
|
49
42
|
protected addEventHandlers(): void;
|
|
@@ -37,10 +37,6 @@ export declare class SkyboxPlugin extends Plugin {
|
|
|
37
37
|
* Sets skybox by cube texture (6 images).
|
|
38
38
|
*/
|
|
39
39
|
setSkyboxByCubeTexture(urls: string[]): void;
|
|
40
|
-
/**
|
|
41
|
-
* Updates gradient color skybox when models' bbox changed.
|
|
42
|
-
*/
|
|
43
|
-
private updateGradientColorSkybox;
|
|
44
40
|
destroy(): void;
|
|
45
41
|
/**
|
|
46
42
|
* Converts rgb color number array to THREE.Color.
|
|
@@ -2,15 +2,15 @@ import { type BaseViewer } from "@x-viewer/core";
|
|
|
2
2
|
import { Toolbar } from "./Toolbar";
|
|
3
3
|
import { ToolbarConfig, ToolbarMenuId } from "./Toolbar.constants";
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
5
|
+
* @hidden
|
|
6
6
|
*/
|
|
7
7
|
export declare const DefaultMarkupToolbarConfig: ToolbarConfig;
|
|
8
8
|
/**
|
|
9
|
-
* @
|
|
9
|
+
* @hidden
|
|
10
10
|
*/
|
|
11
11
|
export declare const MarkupGroupConfig: ToolbarMenuId[][];
|
|
12
12
|
/**
|
|
13
|
-
* @
|
|
13
|
+
* @hidden
|
|
14
14
|
*/
|
|
15
15
|
export declare class MarkupToolbar extends Toolbar {
|
|
16
16
|
constructor(viewer: BaseViewer, menuCfg: ToolbarConfig, groupCfg?: ToolbarMenuId[][] | string[][]);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ToolbarConfig } from "./Toolbar.constants";
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @hidden
|
|
4
4
|
*/
|
|
5
5
|
export declare const DefaultViewer3dToolbarConfig: ToolbarConfig;
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
7
|
+
* @hidden
|
|
8
8
|
*/
|
|
9
9
|
export declare const DefaultViewer2dToolbarConfig: ToolbarConfig;
|
|
@@ -5,7 +5,7 @@ import { ToolbarConfig, ToolbarMenuId } from "./Toolbar.constants";
|
|
|
5
5
|
* Viewer2d toolbar plugin config.
|
|
6
6
|
*/
|
|
7
7
|
export interface Viewer2dToolbarPluginConfig extends Partial<PluginConfig> {
|
|
8
|
-
language?: "
|
|
8
|
+
language?: "en" | "zh";
|
|
9
9
|
menuConfig: ToolbarConfig;
|
|
10
10
|
groupConfig?: ToolbarMenuId[][] | string[][];
|
|
11
11
|
markupMenuCfg?: ToolbarConfig;
|
|
@@ -20,7 +20,6 @@ export declare class Viewer2dToolbarPlugin extends Plugin {
|
|
|
20
20
|
protected toolbar: Toolbar;
|
|
21
21
|
protected markupToolbar?: Toolbar;
|
|
22
22
|
constructor(viewer: BaseViewer, cfg?: Viewer2dToolbarPluginConfig);
|
|
23
|
-
private initLocalization;
|
|
24
23
|
getToolbar(): Toolbar;
|
|
25
24
|
getMarkupToolbar(): Toolbar | undefined;
|
|
26
25
|
/**
|
|
@@ -5,7 +5,7 @@ import { ToolbarConfig, ToolbarMenuId } from "./Toolbar.constants";
|
|
|
5
5
|
* Viewer3d toolbar plugin config.
|
|
6
6
|
*/
|
|
7
7
|
export interface Viewer3dToolbarPluginConfig extends Partial<PluginConfig> {
|
|
8
|
-
language?: "
|
|
8
|
+
language?: "en" | "zh";
|
|
9
9
|
menuConfig: ToolbarConfig;
|
|
10
10
|
groupConfig?: ToolbarMenuId[][] | string[][];
|
|
11
11
|
}
|
|
@@ -15,9 +15,7 @@ export interface Viewer3dToolbarPluginConfig extends Partial<PluginConfig> {
|
|
|
15
15
|
export declare class Viewer3dToolbarPlugin extends Plugin {
|
|
16
16
|
static readonly DEFAULT_ID = "Viewer3dToolbarPlugin";
|
|
17
17
|
protected cfg: Viewer3dToolbarPluginConfig;
|
|
18
|
-
private toolbar;
|
|
19
18
|
constructor(viewer: BaseViewer, cfg?: Viewer3dToolbarPluginConfig);
|
|
20
|
-
private initLocalization;
|
|
21
19
|
getToolbar(): Toolbar;
|
|
22
20
|
/**
|
|
23
21
|
* Sets a menu item to be active or inactive.
|
|
@@ -12,7 +12,7 @@ export interface TreeViewPluginConfig extends Partial<PluginConfig> {
|
|
|
12
12
|
* If panel is visible. It is visible by default.
|
|
13
13
|
*/
|
|
14
14
|
visible?: boolean;
|
|
15
|
-
language?: "
|
|
15
|
+
language?: "en" | "zh";
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Tree view plugin events.
|
|
@@ -35,37 +35,12 @@ export declare class TreeViewPlugin extends Plugin<TreeViewPluginEvents> {
|
|
|
35
35
|
protected lastHighlightedObject?: THREE.Object3D;
|
|
36
36
|
constructor(viewer: Viewer3d, cfg?: TreeViewPluginConfig);
|
|
37
37
|
protected updateContent(): void;
|
|
38
|
-
private initLocalization;
|
|
39
38
|
setVisible(visible: boolean): void;
|
|
40
39
|
isVisible(): boolean;
|
|
41
40
|
protected onModelLoadOrRemove: () => void;
|
|
42
41
|
protected onObjectSelected: (evt: THREE.Object3D) => void;
|
|
43
42
|
protected onObjectDeselected: (evt: THREE.Object3D) => void;
|
|
44
|
-
private onClose;
|
|
45
43
|
destroy(): void;
|
|
46
44
|
protected addContent(): void;
|
|
47
|
-
private buildTreeForNodeRecursive;
|
|
48
|
-
private selectTreeNodeAndHighlightSceneObject;
|
|
49
|
-
private highlightTreeNodeBySceneObject;
|
|
50
|
-
private highlightSceneObject;
|
|
51
|
-
private focusSceneObject;
|
|
52
|
-
/**
|
|
53
|
-
* Recursively update all children visibility and their checkboxes.
|
|
54
|
-
*/
|
|
55
|
-
private updateChildrenVisibility;
|
|
56
|
-
/**
|
|
57
|
-
* Update parent checkbox state (checked/unchecked/indeterminate) based on children.
|
|
58
|
-
*/
|
|
59
|
-
private updateParentVisibility;
|
|
60
|
-
private handleSingleClick;
|
|
61
|
-
private handleDoubleClick;
|
|
62
|
-
private handleClick;
|
|
63
|
-
private IsModelNode;
|
|
64
|
-
private showPopMenu;
|
|
65
|
-
private getClosestParentTreeNode;
|
|
66
|
-
/**
|
|
67
|
-
* Find Object3D by uuid in all loaded models.
|
|
68
|
-
*/
|
|
69
|
-
private findObjectByUuid;
|
|
70
45
|
}
|
|
71
46
|
export {};
|
|
@@ -1,55 +1,15 @@
|
|
|
1
1
|
import { type BaseViewer, Plugin, PluginConfig } from "@x-viewer/core";
|
|
2
2
|
export interface ViewCubePluginConfig extends Partial<PluginConfig> {
|
|
3
3
|
containerId?: string;
|
|
4
|
-
language?: "
|
|
4
|
+
language?: "en" | "zh";
|
|
5
5
|
showAxes?: boolean;
|
|
6
6
|
lineColor?: number;
|
|
7
7
|
}
|
|
8
8
|
export declare class ViewCubePlugin extends Plugin {
|
|
9
9
|
static readonly DEFAULT_ID = "ViewCubePlugin";
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
private cfg;
|
|
14
|
-
private container;
|
|
15
|
-
private scene?;
|
|
16
|
-
private camera?;
|
|
17
|
-
private renderer?;
|
|
18
|
-
private directionalLight?;
|
|
19
|
-
private width;
|
|
20
|
-
private height;
|
|
21
|
-
private requestAnimationFrameHandle?;
|
|
22
|
-
private pickManager;
|
|
23
|
-
private renderEnabled;
|
|
24
|
-
private inputManager?;
|
|
25
|
-
private viewCube?;
|
|
26
|
-
private lastCoords?;
|
|
27
10
|
constructor(viewer: BaseViewer, cfg?: ViewCubePluginConfig);
|
|
28
11
|
get viewerContainer(): HTMLElement;
|
|
29
|
-
private init;
|
|
30
|
-
private initLocalization;
|
|
31
|
-
private initScene;
|
|
32
|
-
private initCamera;
|
|
33
|
-
private initRenderer;
|
|
34
|
-
private initLights;
|
|
35
|
-
private initViewCube;
|
|
36
|
-
private initEvents;
|
|
37
12
|
setVisible(visible: boolean): void;
|
|
38
13
|
isVisible(): boolean;
|
|
39
|
-
private onPointerDown;
|
|
40
|
-
private onPointerMove;
|
|
41
|
-
private onPointerleave;
|
|
42
|
-
private onClick;
|
|
43
|
-
private updateViewerCamera;
|
|
44
|
-
private updateActivateMeshName;
|
|
45
|
-
private updateCameraAndMeshName;
|
|
46
|
-
/**
|
|
47
|
-
* Update viewCube according to camera direction.
|
|
48
|
-
* Camera's direction is the only input factor for this class. It always look at the origin.
|
|
49
|
-
* @param direction
|
|
50
|
-
*/
|
|
51
|
-
private updateCameraDirection;
|
|
52
|
-
private animate;
|
|
53
|
-
private zoomToBBox;
|
|
54
14
|
destroy(): void;
|
|
55
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-viewer/plugins",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Plugin package providing extensible functionality modules for x-viewer. Includes measurement tools, markup annotations, section planes, toolbars, layer management, export/screenshot capabilities, and various UI enhancements.",
|
|
5
5
|
"author": "x-viewer",
|
|
6
6
|
"license": "UNLICENSED",
|