@x-viewer/plugins 0.9.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.
Files changed (123) hide show
  1. package/README.md +3 -0
  2. package/dist/index.esm.js +264 -0
  3. package/dist/types/axis-gizmo/AxisGizmoPlugin.d.ts +51 -0
  4. package/dist/types/axis-gizmo/CoordinateAxes.d.ts +14 -0
  5. package/dist/types/axis-gizmo/index.d.ts +2 -0
  6. package/dist/types/bottom-bar/BottomBarPlugin.d.ts +42 -0
  7. package/dist/types/bottom-bar/index.d.ts +2 -0
  8. package/dist/types/context-menu/Constants.d.ts +34 -0
  9. package/dist/types/context-menu/ContextMenu.config.d.ts +2 -0
  10. package/dist/types/context-menu/ContextMenuPlugin.d.ts +36 -0
  11. package/dist/types/context-menu/Locale.d.ts +48 -0
  12. package/dist/types/context-menu/index.d.ts +4 -0
  13. package/dist/types/dat-gui/Viewer3dDatGui.d.ts +66 -0
  14. package/dist/types/dat-gui/index.d.ts +1 -0
  15. package/dist/types/explode/ExplodePlugin.d.ts +46 -0
  16. package/dist/types/explode/ObjectExploder.d.ts +48 -0
  17. package/dist/types/explode/index.d.ts +1 -0
  18. package/dist/types/export/ExportPlugin.d.ts +53 -0
  19. package/dist/types/export/index.d.ts +2 -0
  20. package/dist/types/ground-grass/GroundGrassPlugin.d.ts +45 -0
  21. package/dist/types/ground-grass/index.d.ts +1 -0
  22. package/dist/types/ground-grid/GroundGridPlugin.d.ts +46 -0
  23. package/dist/types/ground-grid/index.d.ts +1 -0
  24. package/dist/types/ground-shaow/GroundShadowPlugin.d.ts +64 -0
  25. package/dist/types/ground-shaow/index.d.ts +1 -0
  26. package/dist/types/hotpoint/HotpointPlugin.d.ts +103 -0
  27. package/dist/types/hotpoint/index.d.ts +1 -0
  28. package/dist/types/index.d.ts +27 -0
  29. package/dist/types/layer-manager/LayerManagerPlugin.d.ts +51 -0
  30. package/dist/types/layer-manager/index.d.ts +2 -0
  31. package/dist/types/local-model-uploader/IUploader.d.ts +19 -0
  32. package/dist/types/local-model-uploader/LocalDxfUploader.d.ts +22 -0
  33. package/dist/types/local-model-uploader/LocalModelUploader.d.ts +24 -0
  34. package/dist/types/local-model-uploader/index.d.ts +3 -0
  35. package/dist/types/markups/ArrowMarkup.d.ts +12 -0
  36. package/dist/types/markups/BaseMarkup.d.ts +33 -0
  37. package/dist/types/markups/CircleMarkup.d.ts +12 -0
  38. package/dist/types/markups/CloudLineMarkup.d.ts +10 -0
  39. package/dist/types/markups/CloudRectMarkup.d.ts +11 -0
  40. package/dist/types/markups/CloudRectWithTextMarkup.d.ts +42 -0
  41. package/dist/types/markups/Constants.d.ts +17 -0
  42. package/dist/types/markups/DotMarkup.d.ts +9 -0
  43. package/dist/types/markups/EllipseMarkup.d.ts +12 -0
  44. package/dist/types/markups/LeaderLineMarkup.d.ts +25 -0
  45. package/dist/types/markups/MarkupPlugin.d.ts +91 -0
  46. package/dist/types/markups/PolylineMarkup.d.ts +10 -0
  47. package/dist/types/markups/RectMarkup.d.ts +11 -0
  48. package/dist/types/markups/TextMarkup.d.ts +44 -0
  49. package/dist/types/markups/XMarkup.d.ts +10 -0
  50. package/dist/types/markups/index.d.ts +14 -0
  51. package/dist/types/markups/undo/AddMarkupCommand.d.ts +10 -0
  52. package/dist/types/markups/undo/RemoveMarkupCommand.d.ts +10 -0
  53. package/dist/types/markups/undo/UpdateMarkupCommand.d.ts +11 -0
  54. package/dist/types/measurements/AngleMeasureDrawable.d.ts +12 -0
  55. package/dist/types/measurements/AngleMeasurement.d.ts +13 -0
  56. package/dist/types/measurements/AreaMeasureDrawable.d.ts +14 -0
  57. package/dist/types/measurements/AreaMeasurement.d.ts +28 -0
  58. package/dist/types/measurements/BaseMeasureDrawable.d.ts +28 -0
  59. package/dist/types/measurements/BaseMeasurement.d.ts +124 -0
  60. package/dist/types/measurements/CoordinateMeasureDrawable.d.ts +10 -0
  61. package/dist/types/measurements/CoordinateMeasurement.d.ts +12 -0
  62. package/dist/types/measurements/DistanceMeasureDrawable.d.ts +15 -0
  63. package/dist/types/measurements/DistanceMeasurement.d.ts +25 -0
  64. package/dist/types/measurements/Locale.d.ts +10 -0
  65. package/dist/types/measurements/MeasurementPlugin.d.ts +140 -0
  66. package/dist/types/measurements/index.d.ts +3 -0
  67. package/dist/types/measurements/undo/AddMeasurementCommand.d.ts +10 -0
  68. package/dist/types/measurements/undo/RemoveMeasurementCommand.d.ts +10 -0
  69. package/dist/types/nav-cube/Locale.d.ts +18 -0
  70. package/dist/types/nav-cube/NavCube.d.ts +12 -0
  71. package/dist/types/nav-cube/NavCubePlugin.d.ts +36 -0
  72. package/dist/types/nav-cube/index.d.ts +2 -0
  73. package/dist/types/overview-map/ImageDrawable.d.ts +28 -0
  74. package/dist/types/overview-map/OverviewMapPlugin.d.ts +16 -0
  75. package/dist/types/overview-map/OverviewMapViewer.d.ts +50 -0
  76. package/dist/types/overview-map/index.d.ts +1 -0
  77. package/dist/types/pdf/PdfLoader.d.ts +238 -0
  78. package/dist/types/pdf/PdfLoaderPlugin.d.ts +47 -0
  79. package/dist/types/pdf/index.d.ts +2 -0
  80. package/dist/types/property/Locale.d.ts +8 -0
  81. package/dist/types/property/PropertyPlugin.d.ts +76 -0
  82. package/dist/types/property/index.d.ts +2 -0
  83. package/dist/types/screenshot/ScreenshotPlugin.d.ts +153 -0
  84. package/dist/types/screenshot/index.d.ts +1 -0
  85. package/dist/types/sections/AxisPlaneSection.d.ts +63 -0
  86. package/dist/types/sections/AxisSectionPopPanel.d.ts +18 -0
  87. package/dist/types/sections/BaseSection.d.ts +61 -0
  88. package/dist/types/sections/Locale.d.ts +16 -0
  89. package/dist/types/sections/ObjectsBoxSection.d.ts +28 -0
  90. package/dist/types/sections/PickPlaneSection.d.ts +42 -0
  91. package/dist/types/sections/PickSectionPopPanel.d.ts +18 -0
  92. package/dist/types/sections/Section.constants.d.ts +13 -0
  93. package/dist/types/sections/SectionGizmo.d.ts +22 -0
  94. package/dist/types/sections/SectionPlaneMesh.d.ts +23 -0
  95. package/dist/types/sections/SectionPlugin.d.ts +87 -0
  96. package/dist/types/sections/index.d.ts +6 -0
  97. package/dist/types/settings-2d/Locale.d.ts +14 -0
  98. package/dist/types/settings-2d/Settings2dPlugin.d.ts +55 -0
  99. package/dist/types/settings-2d/index.d.ts +2 -0
  100. package/dist/types/settings-3d/Locale.d.ts +50 -0
  101. package/dist/types/settings-3d/Settings3dPlugin.d.ts +51 -0
  102. package/dist/types/settings-3d/index.d.ts +2 -0
  103. package/dist/types/skybox/GradientColorSkybox.d.ts +9 -0
  104. package/dist/types/skybox/SkyboxPlugin.d.ts +49 -0
  105. package/dist/types/skybox/index.d.ts +1 -0
  106. package/dist/types/stats/StatsPlugin.d.ts +19 -0
  107. package/dist/types/stats/index.d.ts +2 -0
  108. package/dist/types/toolbars/Locale.d.ts +98 -0
  109. package/dist/types/toolbars/MarkupToolbar.d.ts +18 -0
  110. package/dist/types/toolbars/Toolbar.config.d.ts +9 -0
  111. package/dist/types/toolbars/Toolbar.constants.d.ts +95 -0
  112. package/dist/types/toolbars/Toolbar.d.ts +107 -0
  113. package/dist/types/toolbars/Viewer2dToolbarPlugin.d.ts +37 -0
  114. package/dist/types/toolbars/Viewer3dToolbarPlugin.d.ts +37 -0
  115. package/dist/types/toolbars/index.d.ts +7 -0
  116. package/dist/types/tree-view/Locale.d.ts +8 -0
  117. package/dist/types/tree-view/TreeViewPlugin.d.ts +71 -0
  118. package/dist/types/tree-view/index.d.ts +2 -0
  119. package/dist/types/view-cube/Locale.d.ts +18 -0
  120. package/dist/types/view-cube/ViewCube.d.ts +79 -0
  121. package/dist/types/view-cube/ViewCubePlugin.d.ts +55 -0
  122. package/dist/types/view-cube/index.d.ts +2 -0
  123. package/package.json +58 -0
@@ -0,0 +1,16 @@
1
+ import { i18next } from "@x-viewer/core";
2
+ export declare const en: {
3
+ pickSectionPlane: string;
4
+ axisSection: string;
5
+ hideSectionPlane: string;
6
+ showSectionPlane: string;
7
+ reset: string;
8
+ };
9
+ export declare const cn: {
10
+ pickSectionPlane: string;
11
+ axisSection: string;
12
+ hideSectionPlane: string;
13
+ showSectionPlane: string;
14
+ reset: string;
15
+ };
16
+ export declare const i18n: i18next.i18n;
@@ -0,0 +1,28 @@
1
+ import { THREE, EventInfo, InputManager, ViewDirection, BaseViewer } from "@x-viewer/core";
2
+ import { BaseSection } from "./BaseSection";
3
+ import { SectionPlaneMesh } from "./SectionPlaneMesh";
4
+ export declare class ObjectsBoxSection extends BaseSection {
5
+ protected selectedObject?: SectionPlaneMesh;
6
+ protected planeMeshes?: SectionPlaneMesh[];
7
+ protected sectionRange: Record<string, number[]>;
8
+ private capsWireframes?;
9
+ constructor(viewer: BaseViewer, input: InputManager);
10
+ activate(): void;
11
+ deactivate(keepSectionState?: boolean): void;
12
+ protected initOrUpdateVertices(): void;
13
+ protected initOrUpdateClipPlanes(): void;
14
+ protected initOrUpdateSectionPlaneMeshes(): void;
15
+ protected initOrUpdateCapsWireframes(): void;
16
+ protected createCapsWireframe(actionType: ViewDirection, vertices: THREE.Vector3[]): SectionPlaneMesh;
17
+ activateSelectedObject(active: boolean): void;
18
+ onDragStart(e: EventInfo): void;
19
+ onDragMove(e: EventInfo): void;
20
+ onDragEnd(e: EventInfo): void;
21
+ protected dragTranslateSectionPlane(axis: THREE.Vector3, from: THREE.Vector3, to: THREE.Vector3, actionType: ViewDirection): void;
22
+ protected isInRange(value: number, range: number[]): boolean;
23
+ protected getIntersection(e: EventInfo): THREE.Intersection | undefined;
24
+ getIntersectObjects(): SectionPlaneMesh[];
25
+ reset(): void;
26
+ setSectionPlaneVisible(visible: boolean): void;
27
+ setCapsVisible(visible: boolean): void;
28
+ }
@@ -0,0 +1,42 @@
1
+ import { THREE, EventInfo, InputManager } from "@x-viewer/core";
2
+ import type { BaseViewer } from "@x-viewer/core";
3
+ import { Tooltip } from "@x-viewer/ui";
4
+ import { BaseSection } from "../sections/BaseSection";
5
+ import { SectionGizmo } from "../sections/SectionGizmo";
6
+ import { SectionPlaneMesh } from "../sections/SectionPlaneMesh";
7
+ export declare class PickPlaneSection extends BaseSection {
8
+ protected pickedFaceInfo?: {
9
+ position: THREE.Vector3;
10
+ normal: THREE.Vector3;
11
+ };
12
+ protected gizmo?: SectionGizmo;
13
+ protected planeMesh?: SectionPlaneMesh;
14
+ protected capsWireframe?: SectionPlaneMesh;
15
+ protected clipPlane?: THREE.Plane;
16
+ protected selectedObject?: SectionPlaneMesh | THREE.Mesh | THREE.Object3D;
17
+ protected center: THREE.Vector3;
18
+ protected tooltip?: Tooltip;
19
+ protected lastMouseMoveIntersection?: THREE.Intersection;
20
+ constructor(viewer: BaseViewer, input: InputManager);
21
+ activate(): void;
22
+ deactivate(keepSectionState?: boolean): void;
23
+ setSection(): void;
24
+ reset(): void;
25
+ setSectionPlaneVisible(visible: boolean): void;
26
+ protected initOrUpdateClipPlanes(): void;
27
+ protected initOrUpdateSectionPlaneMeshes(): void;
28
+ private createCapsWireframe;
29
+ protected initOrUpdateGizmo(): void;
30
+ mousedown: (e: EventInfo) => void;
31
+ mousemove: (e: EventInfo) => void;
32
+ onDragStart(e: EventInfo): void;
33
+ onDragMove(e: EventInfo): void;
34
+ onDragEnd(e: EventInfo): void;
35
+ getIntersectObjects(): THREE.Object3D[];
36
+ activateSelectedObject(active: boolean): void;
37
+ /**
38
+ * Picks an object by mouse position.
39
+ */
40
+ pickObject(e: EventInfo): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | undefined;
41
+ setCapsVisible(visible: boolean): void;
42
+ }
@@ -0,0 +1,18 @@
1
+ import { type BaseViewer } from "@x-viewer/core";
2
+ import { PopPanel } from "@x-viewer/ui";
3
+ import { PickPlaneSection } from "./PickPlaneSection";
4
+ export declare class PickSectionPopPanel extends PopPanel {
5
+ protected activeSelectNode?: Element;
6
+ protected isVisible: boolean;
7
+ protected enabled: boolean;
8
+ protected visibleNode?: HTMLElement;
9
+ protected resetNode?: HTMLElement;
10
+ protected section: PickPlaneSection;
11
+ constructor(viewer: BaseViewer);
12
+ keydown: (e: KeyboardEvent) => void;
13
+ destroy(): void;
14
+ createActiveSelectLayout(): void;
15
+ addActiveItems(): void;
16
+ enable(): void;
17
+ disable(): void;
18
+ }
@@ -0,0 +1,13 @@
1
+ import { THREE } from "@x-viewer/core";
2
+ export declare const AxisX: THREE.Vector3;
3
+ export declare const AxisY: THREE.Vector3;
4
+ export declare const AxisZ: THREE.Vector3;
5
+ export declare enum ActionType {
6
+ None = "",
7
+ TranslateX = "TranslateX",
8
+ TranslateY = "TranslateY",
9
+ TranslateZ = "TranslateZ",
10
+ RotateX = "RotateX",
11
+ RotateY = "RotateY",
12
+ RotateZ = "RotateZ"
13
+ }
@@ -0,0 +1,22 @@
1
+ import { THREE } from "@x-viewer/core";
2
+ import { ActionType } from "../sections/Section.constants";
3
+ export declare class SectionGizmo extends THREE.Group {
4
+ protected redMaterial: THREE.MeshBasicMaterial;
5
+ protected greenMaterial: THREE.MeshBasicMaterial;
6
+ protected blueMaterial: THREE.MeshBasicMaterial;
7
+ protected highlightMaterial: THREE.MeshBasicMaterial;
8
+ protected pickableMaterial: THREE.MeshBasicMaterial;
9
+ protected originalMaterial?: THREE.MeshBasicMaterial;
10
+ protected hoverObject?: THREE.Mesh;
11
+ constructor(normal?: THREE.Vector3);
12
+ initIgnoreClipMaterial(): void;
13
+ setDirection(normal: THREE.Vector3): void;
14
+ initOrUpdateByAxis(normal: THREE.Vector3): void;
15
+ createTranslateGizmo(actionType: ActionType, direction: THREE.Vector3, size: number, material: THREE.Material): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material, THREE.Object3DEventMap>;
16
+ createRotateGizmo(actionType: ActionType, direction: THREE.Vector3, size: number, material: THREE.Material, degree: number): THREE.Mesh<THREE.TorusGeometry, THREE.Material, THREE.Object3DEventMap>;
17
+ createSphere(size: number, material: THREE.Material, position?: THREE.Vector3): void;
18
+ setActiveAxis(axis: THREE.Vector3): void;
19
+ private createHoverRotateObjectByAxis;
20
+ setActive(active: boolean, selectObject: THREE.Mesh): void;
21
+ adjustSize(camera: THREE.Camera): void;
22
+ }
@@ -0,0 +1,23 @@
1
+ import { THREE } from "@x-viewer/core";
2
+ /**
3
+ * Visible section plan mesh.
4
+ */
5
+ export declare class SectionPlaneMesh extends THREE.Mesh {
6
+ static readonly normalPlaneColor: THREE.Color;
7
+ static readonly activePlaneColor: THREE.Color;
8
+ static readonly normalLineColor = 16777215;
9
+ actionType: string;
10
+ vertices: THREE.Vector3[];
11
+ edge: THREE.Line;
12
+ wireframe?: THREE.LineSegments;
13
+ constructor(actionType: string, vertices: THREE.Vector3[]);
14
+ createIgnoreClipMaterials(material: THREE.Material): void;
15
+ createEdge(vertices: THREE.Vector3[]): THREE.Line<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.LineBasicMaterial, THREE.Object3DEventMap>;
16
+ createLine(): void;
17
+ update(vertices: THREE.Vector3[]): void;
18
+ rotatePlane(axis: THREE.Vector3, angle: number): void;
19
+ setDirection(normal: THREE.Vector3): void;
20
+ getPlaneNormal(): THREE.Vector3;
21
+ setActive(active: boolean): void;
22
+ getPlaneCenter(): THREE.Vector3;
23
+ }
@@ -0,0 +1,87 @@
1
+ import { PluginConfig, THREE } from "@x-viewer/core";
2
+ import { type BaseViewer, Plugin } from "@x-viewer/core";
3
+ import { BaseSection } from "../sections/BaseSection";
4
+ /**
5
+ * Section type
6
+ */
7
+ export declare enum SectionType {
8
+ ObjectsBoxSection = "ObjectsBoxSection",
9
+ PickPlaneSection = "PickPlaneSection",
10
+ AxisPlaneSection = "AxisPlaneSection"
11
+ }
12
+ /**
13
+ * Section plugin config.
14
+ */
15
+ export interface SectionPluginConfig extends Partial<PluginConfig> {
16
+ language?: "cn" | "en";
17
+ }
18
+ /**
19
+ * Section plugin, can be used by Viewer3d and BimTilesViewer.
20
+ */
21
+ export declare class SectionPlugin extends Plugin {
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
+ constructor(viewer: BaseViewer, cfg?: SectionPluginConfig);
31
+ private initLocalization;
32
+ protected get raycaster(): THREE.Raycaster;
33
+ private onBeforeRender;
34
+ private onAfterRender;
35
+ private createCapStencilMaterials;
36
+ private render;
37
+ /**
38
+ * Activates one of "ObjectsBoxSection", "AxisPlaneSection" or "PickPlaneSection" Section
39
+ * @param {SectionType} type
40
+ * @param clippingObjectIds
41
+ */
42
+ activate(type: SectionType): void;
43
+ /**
44
+ * @description Deactivate Section plugin
45
+ * @param keepSectionState Keep objects being clipped even after deactived.
46
+ */
47
+ deactivate(keepSectionState?: boolean): void;
48
+ /**
49
+ * Resets section to initial state.
50
+ */
51
+ reset(): void;
52
+ /**
53
+ * Sets gizmo and section plane mesh visibility.
54
+ */
55
+ setSectionPlaneVisible(visible: boolean): void;
56
+ /**
57
+ *
58
+ * @returns {boolean} Is Section active
59
+ */
60
+ isActive(): boolean;
61
+ /**
62
+ * Gets the active section type.
63
+ */
64
+ getActiveSectionType(): SectionType | undefined;
65
+ /**
66
+ * Gets the active section.
67
+ */
68
+ getActiveSection(): BaseSection | undefined;
69
+ /**
70
+ * Sets clipping object ids for all sections.
71
+ * @param ids
72
+ * @returns
73
+ * @description Set the id of the object that needs to be clipping for all section
74
+ */
75
+ setClippingObjectIds(ids?: number[]): void;
76
+ /**
77
+ * Sets clipping object ids for a specific SectionType.
78
+ * @param ids
79
+ * @returns
80
+ * @description Set the id of the object that needs to be clipping for section by section type
81
+ */
82
+ setClippingObjectIdsForType(type: SectionType, ids?: number[]): void;
83
+ /**
84
+ * Destroies this plugin.
85
+ */
86
+ destroy(): void;
87
+ }
@@ -0,0 +1,6 @@
1
+ export * from "./BaseSection";
2
+ export * from "./AxisPlaneSection";
3
+ export * from "./ObjectsBoxSection";
4
+ export * from "./PickPlaneSection";
5
+ export * from "./SectionPlugin";
6
+ export * from "./Section.constants";
@@ -0,0 +1,14 @@
1
+ import { i18next } from "@x-viewer/core";
2
+ export declare const en: {
3
+ settings: string;
4
+ hideSmallObjects: string;
5
+ backgroundColor: string;
6
+ scaleRate: string;
7
+ };
8
+ export declare const cn: {
9
+ settings: string;
10
+ hideSmallObjects: string;
11
+ backgroundColor: string;
12
+ scaleRate: string;
13
+ };
14
+ export declare const i18n: i18next.i18n;
@@ -0,0 +1,55 @@
1
+ import { Viewer2d, Plugin, PluginConfig, THREE } from "@x-viewer/core";
2
+ import { BasePanel } from "@x-viewer/ui";
3
+ /**
4
+ * Setting 2d plugin.
5
+ */
6
+ export interface Settings2dPluginConfig extends Partial<PluginConfig> {
7
+ /**
8
+ * Container div id.
9
+ */
10
+ containerId: string;
11
+ /**
12
+ * If panel is visible. It is visible by default.
13
+ */
14
+ visible?: boolean;
15
+ language?: "cn" | "en";
16
+ }
17
+ /**
18
+ * Setting 2d plugin events.
19
+ */
20
+ type Settings2dPluginEvents = {
21
+ /**
22
+ * Panel visibility change event.
23
+ */
24
+ visibilitychange: boolean;
25
+ };
26
+ /**
27
+ * Setting 2d.
28
+ * Can be used by Viewer2d.
29
+ */
30
+ export declare class Settings2dPlugin extends Plugin<Settings2dPluginEvents> {
31
+ static readonly DEFAULT_ID = "Settings2dPlugin";
32
+ protected cfg: Settings2dPluginConfig;
33
+ protected basePanel?: BasePanel;
34
+ protected container?: HTMLDivElement;
35
+ protected content?: HTMLDivElement;
36
+ constructor(viewer: Viewer2d, cfg?: Settings2dPluginConfig);
37
+ protected init(): void;
38
+ private initLocalization;
39
+ setVisible(visible: boolean): void;
40
+ isVisible(): boolean;
41
+ private onClose;
42
+ destroy(): void;
43
+ addContent(): void;
44
+ protected addEventHandlers(): void;
45
+ /**
46
+ * Converts hex number in format "#ffffff" to rgb object.
47
+ */
48
+ convertHexToRGB(hex: any): {
49
+ r: number;
50
+ g: number;
51
+ b: number;
52
+ };
53
+ setBackgroundColor(rgb: THREE.Color): void;
54
+ }
55
+ export {};
@@ -0,0 +1,2 @@
1
+ import "./Settings2d.scss";
2
+ export * from "./Settings2dPlugin";
@@ -0,0 +1,50 @@
1
+ import { i18next } from "@x-viewer/core";
2
+ export declare const en: {
3
+ settings: string;
4
+ showOutline: string;
5
+ doubleSidedMaterials: string;
6
+ showGroundGrid: string;
7
+ showViewCube: string;
8
+ showAxesHelper: string;
9
+ enableGroundShadow: string;
10
+ skybox: string;
11
+ colorWhite: string;
12
+ colorBlack: string;
13
+ colorGray: string;
14
+ gradientColor1: string;
15
+ gradientColor2: string;
16
+ gradientColor3: string;
17
+ texture1: string;
18
+ texture2: string;
19
+ texture3: string;
20
+ setEnvMap: string;
21
+ default: string;
22
+ cityStreet: string;
23
+ grass: string;
24
+ sunshine: string;
25
+ };
26
+ export declare const cn: {
27
+ settings: string;
28
+ showOutline: string;
29
+ doubleSidedMaterials: string;
30
+ showGroundGrid: string;
31
+ showViewCube: string;
32
+ showAxesHelper: string;
33
+ enableGroundShadow: string;
34
+ skybox: string;
35
+ colorWhite: string;
36
+ colorBlack: string;
37
+ colorGray: string;
38
+ gradientColor1: string;
39
+ gradientColor2: string;
40
+ gradientColor3: string;
41
+ texture1: string;
42
+ texture2: string;
43
+ texture3: string;
44
+ setEnvMap: string;
45
+ default: string;
46
+ cityStreet: string;
47
+ grass: string;
48
+ sunshine: string;
49
+ };
50
+ export declare const i18n: i18next.i18n;
@@ -0,0 +1,51 @@
1
+ import { Viewer3d, Plugin, PluginConfig } from "@x-viewer/core";
2
+ import { BasePanel } from "@x-viewer/ui";
3
+ /**
4
+ * Setting 3d plugin.
5
+ */
6
+ export interface Settings3dPluginConfig extends Partial<PluginConfig> {
7
+ /**
8
+ * Container div id.
9
+ */
10
+ containerId?: string;
11
+ /**
12
+ * If panel is visible. It is visible by default.
13
+ */
14
+ visible?: boolean;
15
+ language?: "cn" | "en";
16
+ }
17
+ /**
18
+ * Setting 3d plugin events.
19
+ */
20
+ type Settings3dPluginEvents = {
21
+ /**
22
+ * Panel visibility change event.
23
+ */
24
+ visibilitychange: boolean;
25
+ };
26
+ /**
27
+ * Setting 3d.
28
+ * Can be used by Viewer3d.
29
+ */
30
+ export declare class Settings3dPlugin extends Plugin<Settings3dPluginEvents> {
31
+ static readonly DEFAULT_ID = "Settings3dPlugin";
32
+ protected cfg: Settings3dPluginConfig;
33
+ protected basePanel?: BasePanel;
34
+ protected container?: HTMLDivElement;
35
+ protected content?: HTMLDivElement;
36
+ private skyboxPlugin;
37
+ private groundGridPlugin;
38
+ private groundShadowPlugin;
39
+ private viewCubePlugin;
40
+ private axisGizmoPlugin;
41
+ constructor(viewer: Viewer3d, cfg?: Settings3dPluginConfig);
42
+ protected init(): void;
43
+ private initLocalization;
44
+ setVisible(visible: boolean): void;
45
+ isVisible(): boolean;
46
+ private onClose;
47
+ destroy(): void;
48
+ addContent(): void;
49
+ protected addEventHandlers(): void;
50
+ }
51
+ export {};
@@ -0,0 +1,2 @@
1
+ import "./Settings3d.scss";
2
+ export * from "./Settings3dPlugin";
@@ -0,0 +1,9 @@
1
+ import { THREE } from "@x-viewer/core";
2
+ export declare class GradientColorSkybox extends THREE.Mesh {
3
+ static readonly NAME = "SKYBOX";
4
+ static readonly MIN_SKY_RADIUS = 4000;
5
+ static readonly MAX_SKY_RADIUS = 20000;
6
+ private vertexShader;
7
+ private fragmentShader;
8
+ constructor(topColor: THREE.Color, skylineColor: THREE.Color, bottomColor: THREE.Color, radius?: number, widthSegments?: number, heightSegments?: number, skyCenter?: THREE.Vector3, sunDirection?: THREE.Vector3);
9
+ }
@@ -0,0 +1,49 @@
1
+ import { THREE, BaseViewer, Plugin, PluginConfig } from "@x-viewer/core";
2
+ import { GradientColorSkybox } from "./GradientColorSkybox";
3
+ /**
4
+ * Skybox plugin config.
5
+ */
6
+ export interface SkyboxPluginConfig extends Partial<PluginConfig> {
7
+ /**
8
+ * Initial single color of the skybox.
9
+ * If specified, it initialize with a single color background. Otherwise,
10
+ * the skybox initialize with default gradient colors.
11
+ */
12
+ color?: number[];
13
+ }
14
+ /**
15
+ * Skybox plugin. It is mainly used by Viewer3d, while can also be used by Viewer2d.
16
+ * You can set skybox in several means:
17
+ * 1) Single color, by using setSkyboxByColor().
18
+ * 2) Gradient colors, by using setSkyboxByGradientColors().
19
+ * 3) Cube texture, by using setSkyboxByCubeTexture().
20
+ */
21
+ export declare class SkyboxPlugin extends Plugin {
22
+ static readonly DEFAULT_ID = "SkyboxPlugin";
23
+ protected gradientColorSkybox?: GradientColorSkybox;
24
+ constructor(viewer: BaseViewer, cfg?: SkyboxPluginConfig);
25
+ /**
26
+ * Set skybox by a single color.
27
+ * @param color rgb number array, each value is between 0 and 1. e.g. [0.92, 0.95, 0.96]
28
+ */
29
+ setSkyboxByColor(color?: number[]): void;
30
+ /**
31
+ * Sets skybox by 3 gradient colors (top, skyline, bottom).
32
+ */
33
+ setSkyboxByGradientColors(topColor?: number[], // 0x86b6f5
34
+ skylineColor?: number[], // 0xffffff
35
+ bottomColor?: number[]): void;
36
+ /**
37
+ * Sets skybox by cube texture (6 images).
38
+ */
39
+ setSkyboxByCubeTexture(urls: string[]): void;
40
+ /**
41
+ * Updates gradient color skybox when models' bbox changed.
42
+ */
43
+ private updateGradientColorSkybox;
44
+ destroy(): void;
45
+ /**
46
+ * Converts rgb color number array to THREE.Color.
47
+ */
48
+ protected rgb2Color(color: number[]): THREE.Color;
49
+ }
@@ -0,0 +1 @@
1
+ export * from "./SkyboxPlugin";
@@ -0,0 +1,19 @@
1
+ import { BaseViewer, Plugin } from "@x-viewer/core";
2
+ import Stats from "stats.js";
3
+ /**
4
+ * Stats plugin is a debug tool for developers to observe the performance of a page.
5
+ */
6
+ export declare class StatsPlugin extends Plugin {
7
+ protected stats?: Stats;
8
+ constructor(viewer: BaseViewer);
9
+ private init;
10
+ /**
11
+ * Shows the stats panel, which indicates current FPS, MS, MB, etc.
12
+ */
13
+ show(): void;
14
+ /**
15
+ * Shows the stats panel, which indicates current FPS, MS, MB, etc.
16
+ */
17
+ hide(): void;
18
+ destroy(): void;
19
+ }
@@ -0,0 +1,2 @@
1
+ import "./stats.scss";
2
+ export * from "./StatsPlugin";
@@ -0,0 +1,98 @@
1
+ import { i18next } from "@x-viewer/core";
2
+ export declare const en: {
3
+ homeView: string;
4
+ orthoView: string;
5
+ measurement: string;
6
+ distanceMeasurement: string;
7
+ areaMeasurement: string;
8
+ angleMeasurement: string;
9
+ coordinateMeasurement: string;
10
+ clearMeasurement: string;
11
+ markupVisibility: string;
12
+ markup: string;
13
+ markupArrow: string;
14
+ markupRect: string;
15
+ markupCloudRect: string;
16
+ markupPolyLine: string;
17
+ markupCloudLine: string;
18
+ markupEllipse: string;
19
+ markupCircle: string;
20
+ markupDot: string;
21
+ markupText: string;
22
+ markupX: string;
23
+ markupStroke: string;
24
+ markupLineWidth: string;
25
+ markupLineWidth2: string;
26
+ markupLineWidth5: string;
27
+ markupLineWidth10: string;
28
+ markupFontSize: string;
29
+ markupFontSize14: string;
30
+ markupFontSize18: string;
31
+ markupFontSize24: string;
32
+ clearMarkup: string;
33
+ quitMarkup: string;
34
+ section: string;
35
+ axisSection: string;
36
+ pickSectionPlane: string;
37
+ sectionBox: string;
38
+ treeView: string;
39
+ viewpoint: string;
40
+ annotation: string;
41
+ property: string;
42
+ settings: string;
43
+ compared: string;
44
+ quitCompare: string;
45
+ fullscreen: string;
46
+ layers: string;
47
+ zoomToRectangle: string;
48
+ screenshot: string;
49
+ };
50
+ export declare const cn: {
51
+ homeView: string;
52
+ orthoView: string;
53
+ measurement: string;
54
+ distanceMeasurement: string;
55
+ areaMeasurement: string;
56
+ angleMeasurement: string;
57
+ coordinateMeasurement: string;
58
+ clearMeasurement: string;
59
+ markupVisibility: string;
60
+ markup: string;
61
+ markupArrow: string;
62
+ markupRect: string;
63
+ markupCloudRect: string;
64
+ markupPolyLine: string;
65
+ markupCloudLine: string;
66
+ markupEllipse: string;
67
+ markupCircle: string;
68
+ markupDot: string;
69
+ markupText: string;
70
+ markupX: string;
71
+ markupStroke: string;
72
+ markupLineWidth: string;
73
+ markupLineWidth2: string;
74
+ markupLineWidth5: string;
75
+ markupLineWidth10: string;
76
+ markupFontSize: string;
77
+ markupFontSize14: string;
78
+ markupFontSize18: string;
79
+ markupFontSize24: string;
80
+ clearMarkup: string;
81
+ quitMarkup: string;
82
+ section: string;
83
+ axisSection: string;
84
+ pickSectionPlane: string;
85
+ sectionBox: string;
86
+ treeView: string;
87
+ viewpoint: string;
88
+ annotation: string;
89
+ property: string;
90
+ settings: string;
91
+ compared: string;
92
+ quitCompare: string;
93
+ fullscreen: string;
94
+ layers: string;
95
+ zoomToRectangle: string;
96
+ screenshot: string;
97
+ };
98
+ export declare const i18n: i18next.i18n;
@@ -0,0 +1,18 @@
1
+ import { type BaseViewer } from "@x-viewer/core";
2
+ import { Toolbar } from "./Toolbar";
3
+ import { ToolbarConfig, ToolbarMenuId } from "./Toolbar.constants";
4
+ /**
5
+ * @internal
6
+ */
7
+ export declare const DefaultMarkupToolbarConfig: ToolbarConfig;
8
+ /**
9
+ * @internal
10
+ */
11
+ export declare const MarkupGroupConfig: ToolbarMenuId[][];
12
+ /**
13
+ * @internal
14
+ */
15
+ export declare class MarkupToolbar extends Toolbar {
16
+ constructor(viewer: BaseViewer, menuCfg: ToolbarConfig, groupCfg?: ToolbarMenuId[][] | string[][]);
17
+ keydown: () => void;
18
+ }
@@ -0,0 +1,9 @@
1
+ import { ToolbarConfig } from "./Toolbar.constants";
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare const DefaultViewer3dToolbarConfig: ToolbarConfig;
6
+ /**
7
+ * @internal
8
+ */
9
+ export declare const DefaultViewer2dToolbarConfig: ToolbarConfig;