@xeokit/xeokit-sdk 2.2.5 → 2.3.0-beta-2

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 (120) hide show
  1. package/dist/web-ifc.wasm +0 -0
  2. package/dist/xeokit-sdk.cjs.js +87051 -79967
  3. package/dist/xeokit-sdk.es.js +87051 -79967
  4. package/dist/xeokit-sdk.min.cjs.js +1 -1
  5. package/dist/xeokit-sdk.min.es.js +1 -1
  6. package/package.json +18 -22
  7. package/types/extras/ContextMenu/ContextMenu.d.ts +125 -0
  8. package/types/extras/ContextMenu/index.d.ts +1 -0
  9. package/types/extras/index.d.ts +1 -0
  10. package/types/index.d.ts +3 -0
  11. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurement.d.ts +144 -0
  12. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.d.ts +67 -0
  13. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +99 -0
  14. package/types/plugins/AngleMeasurementsPlugin/index.d.ts +1 -0
  15. package/types/plugins/AnnotationsPlugin/Annotation.d.ts +135 -0
  16. package/types/plugins/AnnotationsPlugin/AnnotationsPlugin.d.ts +150 -0
  17. package/types/plugins/AnnotationsPlugin/index.d.ts +2 -0
  18. package/types/plugins/AxisGizmoPlugin/AxisGizmoPlugin.d.ts +28 -0
  19. package/types/plugins/AxisGizmoPlugin/index.d.ts +1 -0
  20. package/types/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.d.ts +146 -0
  21. package/types/plugins/BCFViewpointsPlugin/index.d.ts +1 -0
  22. package/types/plugins/CityJSONLoaderPlugin/CityJSONLoaderPlugin.d.ts +81 -0
  23. package/types/plugins/CityJSONLoaderPlugin/index.d.ts +1 -0
  24. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.d.ts +137 -0
  25. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.d.ts +65 -0
  26. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +135 -0
  27. package/types/plugins/DistanceMeasurementsPlugin/index.d.ts +1 -0
  28. package/types/plugins/FastNavPlugin/FastNavPlugin.d.ts +203 -0
  29. package/types/plugins/FastNavPlugin/index.d.ts +1 -0
  30. package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.d.ts +140 -0
  31. package/types/plugins/GLTFLoaderPlugin/index.d.ts +1 -0
  32. package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +146 -0
  33. package/types/plugins/LASLoaderPlugin/index.d.ts +1 -0
  34. package/types/plugins/NavCubePlugin/NavCubePlugin.d.ts +160 -0
  35. package/types/plugins/NavCubePlugin/index.d.ts +1 -0
  36. package/types/plugins/OBJLoaderPlugin/OBJLoaderPlugin.d.ts +44 -0
  37. package/types/plugins/OBJLoaderPlugin/index.d.ts +1 -0
  38. package/types/plugins/STLLoaderPlugin/STLLoaderPlugin.d.ts +88 -0
  39. package/types/plugins/STLLoaderPlugin/index.d.ts +1 -0
  40. package/types/plugins/SectionPlanesPlugin/SectionPlanesPlugin.d.ts +103 -0
  41. package/types/plugins/SectionPlanesPlugin/index.d.ts +1 -0
  42. package/types/plugins/SkyboxesPlugin/SkyboxesPlugin.d.ts +34 -0
  43. package/types/plugins/SkyboxesPlugin/index.d.ts +1 -0
  44. package/types/plugins/StoreyViewsPlugin/Storey.d.ts +47 -0
  45. package/types/plugins/StoreyViewsPlugin/StoreyMap.d.ts +41 -0
  46. package/types/plugins/StoreyViewsPlugin/StoreyViewsPlugin.d.ts +180 -0
  47. package/types/plugins/StoreyViewsPlugin/index.d.ts +1 -0
  48. package/types/plugins/TreeViewPlugin/ModelTreeView.d.ts +24 -0
  49. package/types/plugins/TreeViewPlugin/TreeViewNode.d.ts +66 -0
  50. package/types/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +150 -0
  51. package/types/plugins/TreeViewPlugin/index.d.ts +1 -0
  52. package/types/plugins/ViewCullPlugin/ViewCullPlugin.d.ts +34 -0
  53. package/types/plugins/ViewCullPlugin/index.d.ts +1 -0
  54. package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +230 -0
  55. package/types/plugins/WebIFCLoaderPlugin/index.d.ts +1 -0
  56. package/types/plugins/XKTLoaderPlugin/XKTLoaderPlugin.d.ts +277 -0
  57. package/types/plugins/XKTLoaderPlugin/index.d.ts +1 -0
  58. package/types/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.d.ts +65 -0
  59. package/types/plugins/XML3DLoaderPlugin/index.d.ts +1 -0
  60. package/types/plugins/index.d.ts +34 -0
  61. package/types/viewer/Configs.d.ts +20 -0
  62. package/types/viewer/Plugin.d.ts +69 -0
  63. package/types/viewer/Viewer.d.ts +212 -0
  64. package/types/viewer/index.d.ts +6 -0
  65. package/types/viewer/localization/LocaleService.d.ts +183 -0
  66. package/types/viewer/metadata/IFCObjectDefaults.d.ts +9 -0
  67. package/types/viewer/metadata/MetaModel.d.ts +65 -0
  68. package/types/viewer/metadata/MetaObject.d.ts +74 -0
  69. package/types/viewer/metadata/MetaScene.d.ts +135 -0
  70. package/types/viewer/metadata/Property.d.ts +29 -0
  71. package/types/viewer/metadata/PropertySet.d.ts +31 -0
  72. package/types/viewer/metadata/index.d.ts +6 -0
  73. package/types/viewer/scene/CameraControl/CameraControl.d.ts +681 -0
  74. package/types/viewer/scene/Component.d.ts +155 -0
  75. package/types/viewer/scene/Entity.d.ts +394 -0
  76. package/types/viewer/scene/camera/Camera.d.ts +364 -0
  77. package/types/viewer/scene/camera/CameraFlightAnimation.d.ts +167 -0
  78. package/types/viewer/scene/camera/CameraPath.d.ts +28 -0
  79. package/types/viewer/scene/camera/CameraPathAnimation.d.ts +95 -0
  80. package/types/viewer/scene/camera/CustomProjection.d.ts +57 -0
  81. package/types/viewer/scene/camera/Frustum.d.ts +166 -0
  82. package/types/viewer/scene/camera/Ortho.d.ts +115 -0
  83. package/types/viewer/scene/camera/Perspective.d.ts +136 -0
  84. package/types/viewer/scene/camera/index.d.ts +4 -0
  85. package/types/viewer/scene/geometry/Geometry.d.ts +7 -0
  86. package/types/viewer/scene/geometry/ReadableGeometry.d.ts +95 -0
  87. package/types/viewer/scene/geometry/index.d.ts +1 -0
  88. package/types/viewer/scene/index.d.ts +17 -0
  89. package/types/viewer/scene/marker/Marker.d.ts +136 -0
  90. package/types/viewer/scene/marker/index.d.ts +1 -0
  91. package/types/viewer/scene/materials/EdgeMaterial.d.ts +83 -0
  92. package/types/viewer/scene/materials/EmphasisMaterial.d.ts +241 -0
  93. package/types/viewer/scene/materials/Fresnel.d.ts +148 -0
  94. package/types/viewer/scene/materials/LinesMaterial.d.ts +71 -0
  95. package/types/viewer/scene/materials/Material.d.ts +3 -0
  96. package/types/viewer/scene/materials/PhongMaterial.d.ts +468 -0
  97. package/types/viewer/scene/materials/PointsMaterial.d.ts +206 -0
  98. package/types/viewer/scene/materials/Texture.d.ts +260 -0
  99. package/types/viewer/scene/materials/index.d.ts +6 -0
  100. package/types/viewer/scene/math/math.d.ts +56 -0
  101. package/types/viewer/scene/mementos/CameraMemento.d.ts +28 -0
  102. package/types/viewer/scene/mementos/ModelMemento.d.ts +44 -0
  103. package/types/viewer/scene/mementos/ObjectsMemento.d.ts +39 -0
  104. package/types/viewer/scene/mementos/index.d.ts +3 -0
  105. package/types/viewer/scene/mesh/Mesh.d.ts +786 -0
  106. package/types/viewer/scene/mesh/index.d.ts +1 -0
  107. package/types/viewer/scene/models/PerformanceModel/PerformanceModel.d.ts +622 -0
  108. package/types/viewer/scene/models/PerformanceModel/PerformanceNode.d.ts +302 -0
  109. package/types/viewer/scene/models/PerformanceModel/index.d.ts +2 -0
  110. package/types/viewer/scene/models/index.d.ts +1 -0
  111. package/types/viewer/scene/nodes/Node.d.ts +664 -0
  112. package/types/viewer/scene/nodes/index.d.ts +1 -0
  113. package/types/viewer/scene/postfx/SAO.d.ts +209 -0
  114. package/types/viewer/scene/scene/Scene.d.ts +771 -0
  115. package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +93 -0
  116. package/types/viewer/scene/sectionPlane/index.d.ts +1 -0
  117. package/types/viewer/scene/viewport/Viewport.d.ts +23 -0
  118. package/types/viewer/scene/viewport/index.d.ts +1 -0
  119. package/types/viewer/scene/webgl/PickResult.d.ts +103 -0
  120. package/types/viewer/scene/webgl/index.d.ts +1 -0
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@xeokit/xeokit-sdk",
3
- "version": "2.2.5",
3
+ "version": "2.3.0-beta-2",
4
4
  "description": "Web Programming Toolkit for 3D/2D BIM and AEC Graphics",
5
5
  "module": "/dist/xeokit-sdk.es.js",
6
6
  "main": "/dist/xeokit-sdk.cjs.js",
7
+ "types": "./types/index.d.ts",
7
8
  "scripts": {
8
9
  "build": "rollup --config rollup.config.js; rollup --config rollup.minified.config.js; cp node_modules/web-ifc/web-ifc.wasm dist/.",
9
10
  "test": "percy exec -- node ./snapshots.js",
10
11
  "docs": "rm -Rf ./docs/*; ./node_modules/.bin/esdoc",
12
+ "typedocs": "rm -Rf ./docs/*; typedoc --tsconfig tsconfig.json",
11
13
  "publish": "npm publish --access public"
12
14
  },
13
15
  "repository": {
@@ -44,32 +46,26 @@
44
46
  },
45
47
  "homepage": "https://xeokit.io",
46
48
  "dependencies": {
47
- "web-ifc": "0.0.30",
48
- "@loaders.gl/core": "^3.0.13",
49
- "@loaders.gl/las": "^3.0.13"
49
+ "@loaders.gl/core": "^3.1.8",
50
+ "@loaders.gl/las": "^3.1.8",
51
+ "@loaders.gl/gltf": "^3.1.8",
52
+ "@loaders.gl/draco": "^3.1.8",
53
+ "web-ifc": "0.0.34"
50
54
  },
51
55
  "devDependencies": {
52
- "@babel/cli": "^7.15.7",
53
- "@babel/core": "^7.15.5",
54
- "@babel/plugin-transform-modules-commonjs": "^7.15.4",
55
- "@babel/preset-env": "^7.15.6",
56
- "@percy/script": "^1.1.0",
57
- "babel": "^6.23.0",
58
- "babel-jest": "^27.2.2",
59
- "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
60
- "esdoc": "^1.0.4",
56
+ "esdoc": "^1.1.0",
61
57
  "esdoc-custom-theme": "^1.4.2",
62
- "esdoc-publish-html-plugin": "^1.1.0",
58
+ "esdoc-publish-html-plugin": "^1.1.2",
63
59
  "esdoc-standard-plugin": "^1.0.0",
64
- "eslint": "^5.16.0",
65
- "http-server": "^0.12.3",
66
- "jest": "^27.2.2",
67
- "jest-webgl-canvas-mock": "^0.2.3",
68
- "rollup": "^2.46.0",
69
- "rollup-plugin-node-resolve": "^5.2.0",
70
- "rollup-plugin-terser": "^7.0.2"
60
+ "eslint": "^8.13.0",
61
+ "parse5": "^7.0.0",
62
+ "rollup": "^2.70.2",
63
+ "@rollup/plugin-node-resolve": "^13.2.1",
64
+ "rollup-plugin-terser": "^7.0.2",
65
+ "typedoc": "^0.22.15"
71
66
  },
72
67
  "files": [
73
- "/dist"
68
+ "/dist",
69
+ "/types"
74
70
  ]
75
71
  }
@@ -0,0 +1,125 @@
1
+ export declare type ContextMenuConfiguration = {
2
+ /** The context menu items. These can also be dynamically set on {@link ContextMenu.items}. See the class documentation for an example. */
3
+ items?: any;
4
+ /** The context, which is passed into the item callbacks. This can also be dynamically set on {@link ContextMenu.context}. This must be set before calling {@link ContextMenu.show}. */
5
+ context?: any;
6
+ /** Whether this ````ContextMenu```` is initially enabled. {@link ContextMenu.show} does nothing while this is ````false````. */
7
+ enabled?: boolean;
8
+ /** Whether this ````ContextMenu```` automatically hides whenever we mouse-down or tap anywhere in the page. */
9
+ hideOnMouseDown?: boolean;
10
+ };
11
+
12
+ /**
13
+ * A customizable HTML context menu.
14
+ */
15
+ export declare class ContextMenu {
16
+ /**
17
+ * @constructor
18
+ *
19
+ * @param {ContextMenuConfiguration} [cfg] ````ContextMenu```` configuration.
20
+ */
21
+ constructor(cfg?: ContextMenuConfiguration);
22
+
23
+ /**
24
+ * Sets the ````ContextMenu```` items.
25
+ *
26
+ * These can be updated dynamically at any time.
27
+ *
28
+ * See class documentation for an example.
29
+ *
30
+ * @type {Object[]}
31
+ */
32
+ set items(arg: any[]);
33
+
34
+ /**
35
+ * Gets the ````ContextMenu```` items.
36
+ *
37
+ * @type {Object[]}
38
+ */
39
+ get items(): any[];
40
+
41
+ /**
42
+ * Sets the ````ContextMenu```` context.
43
+ *
44
+ * The context can be any object that you need to be provides to the callbacks configured on {@link ContextMenu.items}.
45
+ *
46
+ * This must be set before calling {@link ContextMenu.show}.
47
+ *
48
+ * @type {Object}
49
+ */
50
+ set context(arg: any);
51
+
52
+ /**
53
+ * Gets the ````ContextMenu```` context.
54
+ *
55
+ * @type {Object}
56
+ */
57
+ get context(): any;
58
+
59
+ /**
60
+ * Sets whether this ````ContextMenu```` is enabled.
61
+ *
62
+ * Hides the menu when disabling.
63
+ *
64
+ * @type {Boolean}
65
+ */
66
+ set enabled(arg: boolean);
67
+
68
+ /**
69
+ * Gets whether this ````ContextMenu```` is enabled.
70
+ *
71
+ * {@link ContextMenu.show} does nothing while this is ````false````.
72
+ *
73
+ * @type {Boolean}
74
+ */
75
+ get enabled(): boolean;
76
+
77
+ /**
78
+ Subscribes to an event fired at this ````ContextMenu````.
79
+
80
+ @param {String} event The event
81
+ @param {Function} callback Callback fired on the event
82
+ */
83
+ on(event: string, callback: Function): void;
84
+
85
+ /**
86
+ Fires an event at this ````ContextMenu````.
87
+
88
+ @param {String} event The event type name
89
+ @param {Object} value The event parameters
90
+ */
91
+ fire(event: string, value: any): void;
92
+
93
+ /**
94
+ * Shows this ````ContextMenu```` at the given page coordinates.
95
+ *
96
+ * Does nothing when {@link ContextMenu.enabled} is ````false````.
97
+ *
98
+ * Logs error to console and does nothing if {@link ContextMenu.context} has not been set.
99
+ *
100
+ * Fires a "shown" event when shown.
101
+ *
102
+ * @param {Number} pageX Page X-coordinate.
103
+ * @param {Number} pageY Page Y-coordinate.
104
+ */
105
+ show(pageX: number, pageY: number): void;
106
+
107
+ /**
108
+ * Gets whether this ````ContextMenu```` is currently shown or not.
109
+ *
110
+ * @returns {Boolean} Whether this ````ContextMenu```` is shown.
111
+ */
112
+ get shown(): boolean;
113
+
114
+ /**
115
+ * Hides this ````ContextMenu````.
116
+ *
117
+ * Fires a "hidden" event when hidden.
118
+ */
119
+ hide(): void;
120
+
121
+ /**
122
+ * Destroys this ````ContextMenu````.
123
+ */
124
+ destroy(): void;
125
+ }
@@ -0,0 +1 @@
1
+ export * from "./ContextMenu";
@@ -0,0 +1 @@
1
+ export * from "./ContextMenu";
@@ -0,0 +1,3 @@
1
+ export * from "./extras";
2
+ export * from "./plugins";
3
+ export * from "./viewer";
@@ -0,0 +1,144 @@
1
+ import { Component } from "../../viewer/scene/Component";
2
+ import { AngleMeasurementsPlugin } from "./AngleMeasurementsPlugin";
3
+ import { Marker } from "../../viewer/scene/marker";
4
+
5
+ /**
6
+ * @desc Measures the angle indicated by three 3D points.
7
+ */
8
+ export declare class AngleMeasurement extends Component {
9
+ /**
10
+ * The {@link AngleMeasurementsPlugin} that owns this AngleMeasurement.
11
+ * @type {AngleMeasurementsPlugin}
12
+ */
13
+ plugin: AngleMeasurementsPlugin;
14
+
15
+ /**
16
+ * Sets whether this AngleMeasurement indicates that its measurement is approximate.
17
+ *
18
+ * This is ````true```` by default.
19
+ *
20
+ * @type {Boolean}
21
+ */
22
+ set approximate(arg: boolean);
23
+ /**
24
+ * Gets whether this AngleMeasurement indicates that its measurement is approximate.
25
+ *
26
+ * This is ````true```` by default.
27
+ *
28
+ * @type {Boolean}
29
+ */
30
+ get approximate(): boolean;
31
+ /**
32
+ * Sets whether this AngleMeasurement is visible or not.
33
+ *
34
+ * @type Boolean
35
+ */
36
+ set visible(arg: boolean);
37
+ /**
38
+ * Gets whether this AngleMeasurement is visible or not.
39
+ *
40
+ * @type Boolean
41
+ */
42
+ get visible(): boolean;
43
+ /**
44
+ * Sets if the origin {@link Marker} is visible.
45
+ *
46
+ * @type {Boolean}
47
+ */
48
+ set originVisible(arg: boolean);
49
+ /**
50
+ * Gets if the origin {@link Marker} is visible.
51
+ *
52
+ * @type {Boolean}
53
+ */
54
+ get originVisible(): boolean;
55
+ /**
56
+ * Sets if the corner {@link Marker} is visible.
57
+ *
58
+ * @type {Boolean}
59
+ */
60
+ set cornerVisible(arg: boolean);
61
+ /**
62
+ * Gets if the corner {@link Marker} is visible.
63
+ *
64
+ * @type {Boolean}
65
+ */
66
+ get cornerVisible(): boolean;
67
+ /**
68
+ * Sets if the target {@link Marker} is visible.
69
+ *
70
+ * @type {Boolean}
71
+ */
72
+ set targetVisible(arg: boolean);
73
+ /**
74
+ * Gets if the target {@link Marker} is visible.
75
+ *
76
+ * @type {Boolean}
77
+ */
78
+ get targetVisible(): boolean;
79
+ /**
80
+ * Sets if the wire between the origin and the corner is visible.
81
+ *
82
+ * @type {Boolean}
83
+ */
84
+ set originWireVisible(arg: boolean);
85
+ /**
86
+ * Gets if the wire between the origin and the corner is visible.
87
+ *
88
+ * @type {Boolean}
89
+ */
90
+ get originWireVisible(): boolean;
91
+ /**
92
+ * Sets if the wire between the target and the corner is visible.
93
+ *
94
+ * @type {Boolean}
95
+ */
96
+ set targetWireVisible(arg: boolean);
97
+ /**
98
+ * Gets if the wire between the target and the corner is visible.
99
+ *
100
+ * @type {Boolean}
101
+ */
102
+ get targetWireVisible(): boolean;
103
+ /**
104
+ * Sets if the angle label is visible.
105
+ *
106
+ * @type {Boolean}
107
+ */
108
+ set angleVisible(arg: boolean);
109
+ /**
110
+ * Gets if the angle label is visible.
111
+ *
112
+ * @type {Boolean}
113
+ */
114
+ get angleVisible(): boolean;
115
+
116
+ /**
117
+ * Gets the origin {@link Marker}.
118
+ *
119
+ * @type {Marker}
120
+ */
121
+ get origin(): Marker;
122
+
123
+ /**
124
+ * Gets the corner {@link Marker}.
125
+ *
126
+ * @type {Marker}
127
+ */
128
+ get corner(): Marker;
129
+
130
+ /**
131
+ * Gets the target {@link Marker}.
132
+ *
133
+ * @type {Marker}
134
+ */
135
+ get target(): Marker;
136
+
137
+ /**
138
+ * Gets the angle between two connected 3D line segments, given
139
+ * as three positions on the surface(s) of one or more {@link Entity}s.
140
+ *
141
+ * @type {Number}
142
+ */
143
+ get angle(): number;
144
+ }
@@ -0,0 +1,67 @@
1
+ import { Component } from "../../viewer/scene/Component";
2
+ import { AngleMeasurement } from "./AngleMeasurement";
3
+ import { AngleMeasurementsPlugin } from "./AngleMeasurementsPlugin";
4
+
5
+ /**
6
+ * Creates {@link AngleMeasurement}s from mouse and touch input.
7
+ *
8
+ * Once the AngleMeasurementControl is activated, the first click on any {@link Entity} begins constructing a {@link AngleMeasurement}, fixing its origin to that Entity. The next click on any Entity will complete the AngleMeasurement, fixing its target to that second Entity. The AngleMeasurementControl will then wait for the next click on any Entity, to begin constructing another AngleMeasurement, and so on, until deactivated.
9
+ */
10
+ export declare class AngleMeasurementsControl extends Component {
11
+ /**
12
+ * The {@link AngleMeasurementsPlugin} that owns this AngleMeasurementsControl.
13
+ * @type {AngleMeasurementsPlugin}
14
+ */
15
+ plugin: AngleMeasurementsPlugin;
16
+
17
+ /** Gets if this AngleMeasurementsControl is currently active, where it is responding to input.
18
+ *
19
+ * @returns {boolean}
20
+ */
21
+ get active(): boolean;
22
+
23
+ /**
24
+ * Activates this AngleMeasurementsControl, ready to respond to input.
25
+ */
26
+ activate(): void;
27
+
28
+ /**
29
+ * Deactivates this AngleMeasurementsControl, making it unresponsive to input.
30
+ *
31
+ * Destroys any {@link AngleMeasurement} under construction.
32
+ */
33
+ deactivate(): void;
34
+
35
+ /**
36
+ * Resets this AngleMeasurementsControl.
37
+ *
38
+ * Destroys any {@link AngleMeasurement} under construction.
39
+ *
40
+ * Does nothing if the AngleMeasurementsControl is not active.
41
+ */
42
+ reset(): void;
43
+
44
+ /**
45
+ * Fires when the measurement is ended.
46
+ * @param event The measurementEnd event
47
+ * @param callback Called fired on the event
48
+ * @param scope Scope for the callback
49
+ */
50
+ on(event: "measurementEnd", callback: (measurement: AngleMeasurement) => void, scope?: any): string
51
+
52
+ /**
53
+ * Fires when the measurement is cancelled.
54
+ * @param event The measurementCancel event
55
+ * @param callback Called fired on the event
56
+ * @param scope Scope for the callback
57
+ */
58
+ on(event: "measurementCancel", callback: (measurement: AngleMeasurement) => void, scope?: any): string
59
+
60
+ /**
61
+ * Fires when the measurement is started.
62
+ * @param event The measurementStart event
63
+ * @param callback Called fired on the event
64
+ * @param scope Scope for the callback
65
+ */
66
+ on(event: "measurementStart", callback: (measurement: AngleMeasurement) => void, scope?: any): string
67
+ }
@@ -0,0 +1,99 @@
1
+ import { Entity, Plugin, Viewer } from "../../viewer";
2
+ import { AngleMeasurement } from "./AngleMeasurement";
3
+ import { AngleMeasurementsControl } from "./AngleMeasurementsControl";
4
+
5
+ export declare type AngleMeasurementsPluginConfiguration = {
6
+ /** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
7
+ id?: string;
8
+ /** Container DOM element for markers and labels. Defaults to ````document.body````. */
9
+ container?: HTMLElement;
10
+ /** The default color of the dots, wire and label. */
11
+ defaultColor?: string;
12
+ /** If set, the wires, dots and labels will have this zIndex (+1 for dots and +2 for labels). */
13
+ zIndex?: number;
14
+ };
15
+
16
+ /**
17
+ * {@link Viewer} plugin for measuring angles.
18
+ */
19
+ export declare class AngleMeasurementsPlugin extends Plugin {
20
+ /**
21
+ * @constructor
22
+ * @param {Viewer} viewer The Viewer.
23
+ * @param {AngleMeasurementsPluginConfiguration} [cfg] Plugin configuration.
24
+ */
25
+ constructor(viewer: Viewer, cfg?: AngleMeasurementsPluginConfiguration);
26
+
27
+ /**
28
+ * Gets the {@link AngleMeasurementsControl}, which creates {@link AngleMeasurement}s from user input.
29
+ *
30
+ * @type {AngleMeasurementsControl}
31
+ */
32
+ get control(): AngleMeasurementsControl;
33
+
34
+ /**
35
+ * Gets the existing {@link AngleMeasurement}s, each mapped to its {@link AngleMeasurement.id}.
36
+ *
37
+ * @type {{String:AngleMeasurement}}
38
+ */
39
+ get measurements(): { [key:string]: AngleMeasurement};
40
+
41
+ /**
42
+ * Creates an {@link AngleMeasurement}.
43
+ *
44
+ * The AngleMeasurement is then registered by {@link AngleMeasurement.id} in {@link AngleMeasurementsPlugin.measurements}.
45
+ *
46
+ * @param {Object} params {@link AngleMeasurement} configuration.
47
+ * @param {String} params.id Unique ID to assign to {@link AngleMeasurement.id}. The AngleMeasurement will be registered by this in {@link AngleMeasurementsPlugin.measurements} and {@link Scene.components}. Must be unique among all components in the {@link Viewer}.
48
+ * @param {Number[]} params.origin.worldPos Origin World-space 3D position.
49
+ * @param {Entity} params.origin.entity Origin Entity.
50
+ * @param {Number[]} params.corner.worldPos Corner World-space 3D position.
51
+ * @param {Entity} params.corner.entity Corner Entity.
52
+ * @param {Number[]} params.target.worldPos Target World-space 3D position.
53
+ * @param {Entity} params.target.entity Target Entity.
54
+ * @param {Boolean} [params.visible=true] Whether to initially show the {@link AngleMeasurement}.
55
+ * @returns {AngleMeasurement} The new {@link AngleMeasurement}.
56
+ */
57
+ createMeasurement(params?: {
58
+ id: string;
59
+ origin: {
60
+ entity: Entity;
61
+ worldPos: number[];
62
+ },
63
+ corner: {
64
+ entity: Entity;
65
+ worldPos: number[];
66
+ },
67
+ target: {
68
+ entity: Entity;
69
+ worldPos: number[];
70
+ },
71
+ visible?: boolean;
72
+ }): AngleMeasurement;
73
+
74
+ /**
75
+ * Destroys a {@link AngleMeasurement}.
76
+ *
77
+ * @param {String} id ID of AngleMeasurement to destroy.
78
+ */
79
+ destroyMeasurement(id: string): void;
80
+
81
+ /**
82
+ * Destroys all {@link AngleMeasurement}s.
83
+ */
84
+ clear(): void;
85
+
86
+ /**
87
+ * Fires when a measurement is created.
88
+ * @param {String} event The measurementCreated event
89
+ * @param {Function} callback Callback fired on the event
90
+ */
91
+ on(event: "measurementCreated", callback: (measurement: AngleMeasurement)=> void): void;
92
+
93
+ /**
94
+ * Fires when a measurement is destroyed.
95
+ * @param {String} event The measurementDestroyed event
96
+ * @param {Function} callback Callback fired on the event
97
+ */
98
+ on(event: "measurementDestroyed", callback: (measurement: AngleMeasurement)=> void): void;
99
+ }
@@ -0,0 +1 @@
1
+ export * from "./AngleMeasurementsPlugin";
@@ -0,0 +1,135 @@
1
+ import { Marker } from "../../viewer/scene/marker";
2
+ import { AnnotationsPlugin } from "./AnnotationsPlugin";
3
+
4
+ /**
5
+ * A {@link Marker} with an HTML label attached to it, managed by an {@link AnnotationsPlugin}.
6
+ */
7
+ export declare class Annotation extends Marker {
8
+ /**
9
+ * The {@link AnnotationsPlugin} this Annotation was created by.
10
+ * @type {AnnotationsPlugin}
11
+ */
12
+ plugin: AnnotationsPlugin;
13
+
14
+ /**
15
+ * Optional World-space position for {@link Camera.eye}, used when this Annotation is associated with a {@link Camera} position.
16
+ *
17
+ * Undefined by default.
18
+ *
19
+ * @type {Number[]} Eye position.
20
+ */
21
+ eye: number[];
22
+
23
+ /**
24
+ * Optional World-space position for {@link Camera.look}, used when this Annotation is associated with a {@link Camera} position.
25
+ *
26
+ * Undefined by default.
27
+ *
28
+ * @type {Number[]} The "look" vector.
29
+ */
30
+ look: number[];
31
+
32
+ /**
33
+ * Optional World-space position for {@link Camera.up}, used when this Annotation is associated with a {@link Camera} position.
34
+ *
35
+ * Undefined by default.
36
+ *
37
+ * @type {Number[]} The "up" vector.
38
+ */
39
+ up: number[];
40
+
41
+ /**
42
+ * Optional projection type for {@link Camera.projection}, used when this Annotation is associated with a {@link Camera} position.
43
+ *
44
+ * Undefined by default.
45
+ *
46
+ * @type {String} The projection type - "perspective" or "ortho"..
47
+ */
48
+ projection: string;
49
+
50
+ /**
51
+ * Sets whether or not to show this Annotation's marker.
52
+ *
53
+ * The marker shows the Annotation's position.
54
+ *
55
+ * The marker is only visible when both this property and {@link Annotation.visible} are ````true````.
56
+ *
57
+ * See {@link AnnotationsPlugin} for more info.
58
+ *
59
+ * @param {Boolean} shown Whether to show the marker.
60
+ */
61
+ setMarkerShown(shown: boolean): void;
62
+
63
+ /**
64
+ * Gets whether or not to show this Annotation's marker.
65
+ *
66
+ * The marker shows the Annotation's position.
67
+ *
68
+ * The marker is only visible when both this property and {@link Annotation.visible} are ````true````.
69
+ *
70
+ * See {@link AnnotationsPlugin} for more info.
71
+ *
72
+ * @returns {Boolean} Whether to show the marker.
73
+ */
74
+ getMarkerShown(): boolean;
75
+
76
+ /**
77
+ * Sets whether or not to show this Annotation's label.
78
+ *
79
+ * The label is only visible when both this property and {@link Annotation.visible} are ````true````.
80
+ *
81
+ * See {@link AnnotationsPlugin} for more info.
82
+ *
83
+ * @param {Boolean} shown Whether to show the label.
84
+ */
85
+ setLabelShown(shown: boolean): void;
86
+
87
+ /**
88
+ * Gets whether or not to show this Annotation's label.
89
+ *
90
+ * The label is only visible when both this property and {@link Annotation.visible} are ````true````.
91
+ *
92
+ * See {@link AnnotationsPlugin} for more info.
93
+ *
94
+ * @returns {Boolean} Whether to show the label.
95
+ */
96
+ getLabelShown(): boolean;
97
+
98
+ /**
99
+ * Sets the value of a field within the HTML templates for either the Annotation's marker or label.
100
+ *
101
+ * See {@link AnnotationsPlugin} for more info.
102
+ *
103
+ * @param {String} key Identifies the field.
104
+ * @param {String} value The field's value.
105
+ */
106
+ setField(key: string, value: string): void;
107
+
108
+ /**
109
+ * Gets the value of a field within the HTML templates for either the Annotation's marker or label.
110
+ *
111
+ * See {@link AnnotationsPlugin} for more info.
112
+ *
113
+ * @param {String} key Identifies the field.
114
+ * @returns {String} The field's value.
115
+ */
116
+ getField(key: string): string;
117
+
118
+ /**
119
+ * Sets values for multiple placeholders within the Annotation's HTML templates for marker and label.
120
+ *
121
+ * See {@link AnnotationsPlugin} for more info.
122
+ *
123
+ * @param {{String:(String|Number)}} values Map of field values.
124
+ */
125
+ setValues(values: { [key:string] : string | number }): void;
126
+
127
+ /**
128
+ * Gets the values that were set for the placeholders within this Annotation's HTML marker and label templates.
129
+ *
130
+ * See {@link AnnotationsPlugin} for more info.
131
+ *
132
+ * @RETURNS {{String:(String|Number)}} Map of field values.
133
+ */
134
+ getValues(): { [key:string] : string | number };
135
+ }