@xeokit/xeokit-sdk 2.2.5-beta-1 → 2.2.5-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.
- package/package.json +4 -2
- package/types/extras/ContextMenu/ContextMenu.d.ts +125 -0
- package/types/extras/ContextMenu/index.d.ts +1 -0
- package/types/extras/index.d.ts +1 -0
- package/types/index.d.ts +3 -0
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurement.d.ts +144 -0
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.d.ts +42 -0
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +85 -0
- package/types/plugins/AngleMeasurementsPlugin/index.d.ts +1 -0
- package/types/plugins/AnnotationsPlugin/Annotation.d.ts +134 -0
- package/types/plugins/AnnotationsPlugin/AnnotationsPlugin.d.ts +117 -0
- package/types/plugins/AnnotationsPlugin/index.d.ts +1 -0
- package/types/plugins/AxisGizmoPlugin/AxisGizmoPlugin.d.ts +28 -0
- package/types/plugins/AxisGizmoPlugin/index.d.ts +1 -0
- package/types/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.d.ts +146 -0
- package/types/plugins/BCFViewpointsPlugin/index.d.ts +1 -0
- package/types/plugins/CityJSONLoaderPlugin/CityJSONLoaderPlugin.d.ts +81 -0
- package/types/plugins/CityJSONLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.d.ts +137 -0
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.d.ts +40 -0
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +120 -0
- package/types/plugins/DistanceMeasurementsPlugin/index.d.ts +1 -0
- package/types/plugins/FastNavPlugin/FastNavPlugin.d.ts +203 -0
- package/types/plugins/FastNavPlugin/index.d.ts +1 -0
- package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.d.ts +140 -0
- package/types/plugins/GLTFLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +146 -0
- package/types/plugins/LASLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/NavCubePlugin/NavCubePlugin.d.ts +160 -0
- package/types/plugins/NavCubePlugin/index.d.ts +1 -0
- package/types/plugins/OBJLoaderPlugin/OBJLoaderPlugin.d.ts +44 -0
- package/types/plugins/OBJLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/STLLoaderPlugin/STLLoaderPlugin.d.ts +88 -0
- package/types/plugins/STLLoaderPlugin/index.d.ts +2 -0
- package/types/plugins/SectionPlanesPlugin/SectionPlanesPlugin.d.ts +103 -0
- package/types/plugins/SectionPlanesPlugin/index.d.ts +1 -0
- package/types/plugins/SkyboxesPlugin/SkyboxesPlugin.d.ts +34 -0
- package/types/plugins/SkyboxesPlugin/index.d.ts +1 -0
- package/types/plugins/StoreyViewsPlugin/Storey.d.ts +47 -0
- package/types/plugins/StoreyViewsPlugin/StoreyMap.d.ts +41 -0
- package/types/plugins/StoreyViewsPlugin/StoreyViewsPlugin.d.ts +173 -0
- package/types/plugins/StoreyViewsPlugin/index.d.ts +1 -0
- package/types/plugins/TreeViewPlugin/ModelTreeView.d.ts +24 -0
- package/types/plugins/TreeViewPlugin/TreeViewNode.d.ts +66 -0
- package/types/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +136 -0
- package/types/plugins/TreeViewPlugin/index.d.ts +1 -0
- package/types/plugins/ViewCullPlugin/ViewCullPlugin.d.ts +34 -0
- package/types/plugins/ViewCullPlugin/index.d.ts +1 -0
- package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +230 -0
- package/types/plugins/WebIFCLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/XKTLoaderPlugin/XKTLoaderPlugin.d.ts +277 -0
- package/types/plugins/XKTLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.d.ts +65 -0
- package/types/plugins/XML3DLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/index.d.ts +34 -0
- package/types/viewer/Configs.d.ts +20 -0
- package/types/viewer/Plugin.d.ts +69 -0
- package/types/viewer/Viewer.d.ts +212 -0
- package/types/viewer/index.d.ts +6 -0
- package/types/viewer/localization/LocaleService.d.ts +176 -0
- package/types/viewer/metadata/IFCObjectDefaults.d.ts +9 -0
- package/types/viewer/metadata/MetaModel.d.ts +65 -0
- package/types/viewer/metadata/MetaObject.d.ts +74 -0
- package/types/viewer/metadata/MetaScene.d.ts +135 -0
- package/types/viewer/metadata/Property.d.ts +29 -0
- package/types/viewer/metadata/PropertySet.d.ts +31 -0
- package/types/viewer/metadata/index.d.ts +6 -0
- package/types/viewer/scene/CameraControl/CameraControl.d.ts +591 -0
- package/types/viewer/scene/Component.d.ts +155 -0
- package/types/viewer/scene/Entity.d.ts +394 -0
- package/types/viewer/scene/PerformanceModel/PerformanceModel.d.ts +605 -0
- package/types/viewer/scene/PerformanceModel/PerformanceNode.d.ts +302 -0
- package/types/viewer/scene/camera/Camera.d.ts +364 -0
- package/types/viewer/scene/camera/CameraFlightAnimation.d.ts +167 -0
- package/types/viewer/scene/camera/CameraPath.d.ts +28 -0
- package/types/viewer/scene/camera/CameraPathAnimation.d.ts +95 -0
- package/types/viewer/scene/camera/CustomProjection.d.ts +57 -0
- package/types/viewer/scene/camera/Frustum.d.ts +166 -0
- package/types/viewer/scene/camera/Ortho.d.ts +115 -0
- package/types/viewer/scene/camera/Perspective.d.ts +136 -0
- package/types/viewer/scene/camera/index.d.ts +4 -0
- package/types/viewer/scene/geometry/Geometry.d.ts +7 -0
- package/types/viewer/scene/geometry/ReadableGeometry.d.ts +95 -0
- package/types/viewer/scene/geometry/index.d.ts +1 -0
- package/types/viewer/scene/index.d.ts +6 -0
- package/types/viewer/scene/marker/Marker.d.ts +136 -0
- package/types/viewer/scene/marker/index.d.ts +1 -0
- package/types/viewer/scene/materials/EdgeMaterial.d.ts +83 -0
- package/types/viewer/scene/materials/EmphasisMaterial.d.ts +241 -0
- package/types/viewer/scene/materials/Fresnel.d.ts +149 -0
- package/types/viewer/scene/materials/LinesMaterial.d.ts +71 -0
- package/types/viewer/scene/materials/Material.d.ts +3 -0
- package/types/viewer/scene/materials/PhongMaterial.d.ts +468 -0
- package/types/viewer/scene/materials/PointsMaterial.d.ts +206 -0
- package/types/viewer/scene/materials/Texture.d.ts +261 -0
- package/types/viewer/scene/materials/index.d.ts +5 -0
- package/types/viewer/scene/math/math.d.ts +36 -0
- package/types/viewer/scene/postfx/SAO.d.ts +209 -0
- package/types/viewer/scene/scene/Scene.d.ts +727 -0
- package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +93 -0
- package/types/viewer/scene/sectionPlane/index.d.ts +1 -0
- package/types/viewer/scene/viewport/Viewport.d.ts +23 -0
- package/types/viewer/scene/webgl/PickResult.d.ts +103 -0
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xeokit/xeokit-sdk",
|
|
3
|
-
"version": "2.2.5-beta-
|
|
3
|
+
"version": "2.2.5-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",
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
"rollup-plugin-terser": "^7.0.2"
|
|
71
72
|
},
|
|
72
73
|
"files": [
|
|
73
|
-
"/dist"
|
|
74
|
+
"/dist",
|
|
75
|
+
"/types"
|
|
74
76
|
]
|
|
75
77
|
}
|
|
@@ -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";
|
package/types/index.d.ts
ADDED
|
@@ -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 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,42 @@
|
|
|
1
|
+
import { Component } from "../../viewer/scene/Component";
|
|
2
|
+
import { AngleMeasurementsPlugin } from "./AngleMeasurementsPlugin";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Creates {@link AngleMeasurement}s from mouse and touch input.
|
|
6
|
+
*
|
|
7
|
+
* 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.
|
|
8
|
+
*/
|
|
9
|
+
export class AngleMeasurementsControl extends Component {
|
|
10
|
+
/**
|
|
11
|
+
* The {@link AngleMeasurementsPlugin} that owns this AngleMeasurementsControl.
|
|
12
|
+
* @type {AngleMeasurementsPlugin}
|
|
13
|
+
*/
|
|
14
|
+
plugin: AngleMeasurementsPlugin;
|
|
15
|
+
|
|
16
|
+
/** Gets if this AngleMeasurementsControl is currently active, where it is responding to input.
|
|
17
|
+
*
|
|
18
|
+
* @returns {boolean}
|
|
19
|
+
*/
|
|
20
|
+
get active(): boolean;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Activates this AngleMeasurementsControl, ready to respond to input.
|
|
24
|
+
*/
|
|
25
|
+
activate(): void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Deactivates this AngleMeasurementsControl, making it unresponsive to input.
|
|
29
|
+
*
|
|
30
|
+
* Destroys any {@link AngleMeasurement} under construction.
|
|
31
|
+
*/
|
|
32
|
+
deactivate(): void;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Resets this AngleMeasurementsControl.
|
|
36
|
+
*
|
|
37
|
+
* Destroys any {@link AngleMeasurement} under construction.
|
|
38
|
+
*
|
|
39
|
+
* Does nothing if the AngleMeasurementsControl is not active.
|
|
40
|
+
*/
|
|
41
|
+
reset(): void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AngleMeasurementsPlugin";
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { AnnotationsPlugin } from "./AnnotationsPlugin";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link Marker} with an HTML label attached to it, managed by an {@link AnnotationsPlugin}.
|
|
4
|
+
*/
|
|
5
|
+
export class Annotation {
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The {@link AnnotationsPlugin} this Annotation was created by.
|
|
9
|
+
* @type {AnnotationsPlugin}
|
|
10
|
+
*/
|
|
11
|
+
plugin: AnnotationsPlugin;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Optional World-space position for {@link Camera#eye}, used when this Annotation is associated with a {@link Camera} position.
|
|
15
|
+
*
|
|
16
|
+
* Undefined by default.
|
|
17
|
+
*
|
|
18
|
+
* @type {Number[]} Eye position.
|
|
19
|
+
*/
|
|
20
|
+
eye: number[];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Optional World-space position for {@link Camera#look}, used when this Annotation is associated with a {@link Camera} position.
|
|
24
|
+
*
|
|
25
|
+
* Undefined by default.
|
|
26
|
+
*
|
|
27
|
+
* @type {Number[]} The "look" vector.
|
|
28
|
+
*/
|
|
29
|
+
look: number[];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Optional World-space position for {@link Camera#up}, used when this Annotation is associated with a {@link Camera} position.
|
|
33
|
+
*
|
|
34
|
+
* Undefined by default.
|
|
35
|
+
*
|
|
36
|
+
* @type {Number[]} The "up" vector.
|
|
37
|
+
*/
|
|
38
|
+
up: number[];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optional projection type for {@link Camera#projection}, used when this Annotation is associated with a {@link Camera} position.
|
|
42
|
+
*
|
|
43
|
+
* Undefined by default.
|
|
44
|
+
*
|
|
45
|
+
* @type {String} The projection type - "perspective" or "ortho"..
|
|
46
|
+
*/
|
|
47
|
+
projection: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Sets whether or not to show this Annotation's marker.
|
|
51
|
+
*
|
|
52
|
+
* The marker shows the Annotation's position.
|
|
53
|
+
*
|
|
54
|
+
* The marker is only visible when both this property and {@link Annotation#visible} are ````true````.
|
|
55
|
+
*
|
|
56
|
+
* See {@link AnnotationsPlugin} for more info.
|
|
57
|
+
*
|
|
58
|
+
* @param {Boolean} shown Whether to show the marker.
|
|
59
|
+
*/
|
|
60
|
+
setMarkerShown(shown: boolean): void;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Gets whether or not to show this Annotation's marker.
|
|
64
|
+
*
|
|
65
|
+
* The marker shows the Annotation's position.
|
|
66
|
+
*
|
|
67
|
+
* The marker is only visible when both this property and {@link Annotation#visible} are ````true````.
|
|
68
|
+
*
|
|
69
|
+
* See {@link AnnotationsPlugin} for more info.
|
|
70
|
+
*
|
|
71
|
+
* @returns {Boolean} Whether to show the marker.
|
|
72
|
+
*/
|
|
73
|
+
getMarkerShown(): boolean;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Sets whether or not to show this Annotation's label.
|
|
77
|
+
*
|
|
78
|
+
* The label is only visible when both this property and {@link Annotation#visible} are ````true````.
|
|
79
|
+
*
|
|
80
|
+
* See {@link AnnotationsPlugin} for more info.
|
|
81
|
+
*
|
|
82
|
+
* @param {Boolean} shown Whether to show the label.
|
|
83
|
+
*/
|
|
84
|
+
setLabelShown(shown: boolean): void;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Gets whether or not to show this Annotation's label.
|
|
88
|
+
*
|
|
89
|
+
* The label is only visible when both this property and {@link Annotation#visible} are ````true````.
|
|
90
|
+
*
|
|
91
|
+
* See {@link AnnotationsPlugin} for more info.
|
|
92
|
+
*
|
|
93
|
+
* @returns {Boolean} Whether to show the label.
|
|
94
|
+
*/
|
|
95
|
+
getLabelShown(): boolean;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Sets the value of a field within the HTML templates for either the Annotation's marker or label.
|
|
99
|
+
*
|
|
100
|
+
* See {@link AnnotationsPlugin} for more info.
|
|
101
|
+
*
|
|
102
|
+
* @param {String} key Identifies the field.
|
|
103
|
+
* @param {String} value The field's value.
|
|
104
|
+
*/
|
|
105
|
+
setField(key: string, value: string): void;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Gets the value of a field within the HTML templates for either the Annotation's marker or label.
|
|
109
|
+
*
|
|
110
|
+
* See {@link AnnotationsPlugin} for more info.
|
|
111
|
+
*
|
|
112
|
+
* @param {String} key Identifies the field.
|
|
113
|
+
* @returns {String} The field's value.
|
|
114
|
+
*/
|
|
115
|
+
getField(key: string): string;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Sets values for multiple placeholders within the Annotation's HTML templates for marker and label.
|
|
119
|
+
*
|
|
120
|
+
* See {@link AnnotationsPlugin} for more info.
|
|
121
|
+
*
|
|
122
|
+
* @param {{String:(String|Number)}} values Map of field values.
|
|
123
|
+
*/
|
|
124
|
+
setValues(values: { [key:string] : string | number }): void;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Gets the values that were set for the placeholders within this Annotation's HTML marker and label templates.
|
|
128
|
+
*
|
|
129
|
+
* See {@link AnnotationsPlugin} for more info.
|
|
130
|
+
*
|
|
131
|
+
* @RETURNS {{String:(String|Number)}} Map of field values.
|
|
132
|
+
*/
|
|
133
|
+
getValues(): { [key:string] : string | number };
|
|
134
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { PickResult } from "viewer/scene/webgl/PickResult";
|
|
2
|
+
import { Entity, Plugin, Viewer } from "../../viewer";
|
|
3
|
+
import { Annotation } from "./Annotation";
|
|
4
|
+
|
|
5
|
+
export declare type AnnotationsPluginConfiguration = {
|
|
6
|
+
/** Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}. */
|
|
7
|
+
id?: string;
|
|
8
|
+
/** HTML text template for Annotation markers. Defaults to ````<div></div>````. Ignored on {@link Annotation}s configured with a ````markerElementId````. */
|
|
9
|
+
markerHTML?: string;
|
|
10
|
+
/** HTML text template for Annotation labels. Defaults to ````<div></div>````. Ignored on {@link Annotation}s configured with a ````labelElementId````. */
|
|
11
|
+
labelHTML?: string;
|
|
12
|
+
/** Container DOM element for markers and labels. Defaults to ````document.body````. */
|
|
13
|
+
container?: HTMLElement;
|
|
14
|
+
/** Map of default values to insert into the HTML templates for the marker and label. */
|
|
15
|
+
values?: { [key: string]: string | number };
|
|
16
|
+
/** The amount by which each {@link Annotation} is offset from the surface of its {@link Entity} when we create the Annotation by supplying a {@link PickResult} to {@link AnnotationsPlugin#createAnnotation}.*/
|
|
17
|
+
surfaceOffset?: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* {@link Viewer} plugin that creates {@link Annotation}s.
|
|
22
|
+
*/
|
|
23
|
+
export class AnnotationsPlugin extends Plugin {
|
|
24
|
+
/**
|
|
25
|
+
* @constructor
|
|
26
|
+
* @param {Viewer} viewer The Viewer.
|
|
27
|
+
* @param {AnnotationsPluginConfiguration} cfg Plugin configuration.
|
|
28
|
+
*/
|
|
29
|
+
constructor(viewer: Viewer, cfg: AnnotationsPluginConfiguration);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The {@link Annotation}s created by {@link AnnotationsPlugin#createAnnotation}, each mapped to its {@link Annotation#id}.
|
|
33
|
+
* @type {{String:Annotation}}
|
|
34
|
+
*/
|
|
35
|
+
annotations: { [key:string]: Annotation };
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Sets the amount by which each {@link Annotation} is offset from the surface of its {@link Entity}, when we
|
|
39
|
+
* create the Annotation by supplying a {@link PickResult} to {@link AnnotationsPlugin#createAnnotation}.
|
|
40
|
+
*
|
|
41
|
+
* See the class comments for more info.
|
|
42
|
+
*
|
|
43
|
+
* This is ````0.3```` by default.
|
|
44
|
+
*
|
|
45
|
+
* @param {Number} surfaceOffset The surface offset.
|
|
46
|
+
*/
|
|
47
|
+
set surfaceOffset(arg: number);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Gets the amount by which an {@link Annotation} is offset from the surface of its {@link Entity} when
|
|
51
|
+
* created by {@link AnnotationsPlugin#createAnnotation}, when we
|
|
52
|
+
* create the Annotation by supplying a {@link PickResult} to {@link AnnotationsPlugin#createAnnotation}.
|
|
53
|
+
*
|
|
54
|
+
* This is ````0.3```` by default.
|
|
55
|
+
*
|
|
56
|
+
* @returns {Number} The surface offset.
|
|
57
|
+
*/
|
|
58
|
+
get surfaceOffset(): number;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Creates an {@link Annotation}.
|
|
62
|
+
*
|
|
63
|
+
* The Annotation is then registered by {@link Annotation#id} in {@link AnnotationsPlugin#annotations}.
|
|
64
|
+
*
|
|
65
|
+
* @param {Object} params Annotation configuration.
|
|
66
|
+
* @param {String} params.id Unique ID to assign to {@link Annotation#id}. The Annotation will be registered by this in {@link AnnotationsPlugin#annotations} and {@link Scene.components}. Must be unique among all components in the {@link Viewer}.
|
|
67
|
+
* @param {String} [params.markerElementId] ID of pre-existing DOM element to render the marker. This overrides ````markerHTML```` and does not support ````values```` (data is baked into the label DOM element).
|
|
68
|
+
* @param {String} [params.labelElementId] ID of pre-existing DOM element to render the label. This overrides ````labelHTML```` and does not support ````values```` (data is baked into the label DOM element).
|
|
69
|
+
* @param {String} [params.markerHTML] HTML text template for the Annotation marker. Defaults to the marker HTML given to the AnnotationsPlugin constructor. Ignored if you provide ````markerElementId````.
|
|
70
|
+
* @param {String} [params.labelHTML] HTML text template for the Annotation label. Defaults to the label HTML given to the AnnotationsPlugin constructor. Ignored if you provide ````labelElementId````.
|
|
71
|
+
* @param {Number[]} [params.worldPos=[0,0,0]] World-space position of the Annotation marker, assigned to {@link Annotation#worldPos}.
|
|
72
|
+
* @param {Entity} [params.entity] Optional {@link Entity} to associate the Annotation with. Causes {@link Annotation#visible} to be ````false```` whenever {@link Entity#visible} is also ````false````.
|
|
73
|
+
* @param {PickResult} [params.pickResult] Sets the Annotation's World-space position and direction vector from the given {@link PickResult}'s {@link PickResult#worldPos} and {@link PickResult#worldNormal}, and the Annotation's Entity from {@link PickResult#entity}. Causes ````worldPos```` and ````entity```` parameters to be ignored, if they are also given.
|
|
74
|
+
* @param {Boolean} [params.occludable=false] Indicates whether or not the {@link Annotation} marker and label are hidden whenever the marker occluded by {@link Entity}s in the {@link Scene}. The
|
|
75
|
+
* {@link Scene} periodically occlusion-tests all Annotations on every 20th "tick" (which represents a rendered frame). We can adjust that frequency via property {@link Scene#ticksPerOcclusionTest}.
|
|
76
|
+
* @param {{String:(String|Number)}} [params.values={}] Map of values to insert into the HTML templates for the marker and label. These will be inserted in addition to any values given to the AnnotationsPlugin constructor.
|
|
77
|
+
* @param {Boolean} [params.markerShown=true] Whether to initially show the {@link Annotation} marker.
|
|
78
|
+
* @param {Boolean} [params.labelShown=false] Whether to initially show the {@link Annotation} label.
|
|
79
|
+
* @param {Number[]} [params.eye] Optional World-space position for {@link Camera#eye}, used when this Annotation is associated with a {@link Camera} position.
|
|
80
|
+
* @param {Number[]} [params.look] Optional World-space position for {@link Camera#look}, used when this Annotation is associated with a {@link Camera} position.
|
|
81
|
+
* @param {Number[]} [params.up] Optional World-space position for {@link Camera#up}, used when this Annotation is associated with a {@link Camera} position.
|
|
82
|
+
* @param {String} [params.projection] Optional projection type for {@link Camera#projection}, used when this Annotation is associated with a {@link Camera} position.
|
|
83
|
+
* @returns {Annotation} The new {@link Annotation}.
|
|
84
|
+
*/
|
|
85
|
+
createAnnotation(params: {
|
|
86
|
+
id: string;
|
|
87
|
+
markerElementId?: string;
|
|
88
|
+
labelElementId?: string;
|
|
89
|
+
markerHTML?: string;
|
|
90
|
+
labelHTML?: string;
|
|
91
|
+
worldPos?: number[];
|
|
92
|
+
entity?: Entity;
|
|
93
|
+
pickResult?: PickResult;
|
|
94
|
+
occludable?: boolean;
|
|
95
|
+
values?: {
|
|
96
|
+
String: (string | number);
|
|
97
|
+
};
|
|
98
|
+
markerShown?: boolean;
|
|
99
|
+
labelShown?: boolean;
|
|
100
|
+
eye?: number[];
|
|
101
|
+
look?: number[];
|
|
102
|
+
up?: number[];
|
|
103
|
+
projection?: string;
|
|
104
|
+
}): Annotation;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Destroys an {@link Annotation}.
|
|
108
|
+
*
|
|
109
|
+
* @param {String} id ID of Annotation to destroy.
|
|
110
|
+
*/
|
|
111
|
+
destroyAnnotation(id: string): void;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Destroys all {@link Annotation}s.
|
|
115
|
+
*/
|
|
116
|
+
clear(): void;
|
|
117
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AnnotationsPlugin";
|