@xeokit/xeokit-sdk 2.6.3 → 2.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/xeokit-sdk.cjs.js +136 -124
- package/dist/xeokit-sdk.es.js +136 -124
- package/dist/xeokit-sdk.es5.js +63 -64
- package/dist/xeokit-sdk.min.cjs.js +5 -5
- package/dist/xeokit-sdk.min.es.js +4 -4
- package/dist/xeokit-sdk.min.es5.js +2 -2
- package/package.json +1 -1
- package/src/extras/ContextMenu/ContextMenu.js +21 -0
- package/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsTouchControl.js +47 -52
- package/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js +1 -1
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.js +22 -23
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsTouchControl.js +40 -47
- package/src/viewer/scene/mesh/occlusion/OcclusionRenderer.js +4 -0
- package/src/viewer/scene/model/SceneModelTransform.js +1 -1
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.d.ts +9 -0
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.d.ts +1 -2
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +4 -0
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsTouchControl.d.ts +92 -0
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.d.ts +1 -1
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +13 -2
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsTouchControl.d.ts +70 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { AngleMeasurementsControl } from "./AngleMeasurementsControl";
|
|
2
|
+
import {AngleMeasurementsPlugin} from "./AngleMeasurementsPlugin";
|
|
3
|
+
import {PointerLens} from "../../extras/";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates {@link AngleMeasurement}s in an {@link AngleMeasurementsPlugin} from touch input.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { Viewer, XKTLoaderPlugin, AngleMeasurementsPlugin, AngleMeasurementsTouchControl, PointerLens } from "xeokit-sdk.es.js";
|
|
10
|
+
*
|
|
11
|
+
* const viewer = new Viewer({
|
|
12
|
+
* canvasId: "myCanvas",
|
|
13
|
+
* });
|
|
14
|
+
*
|
|
15
|
+
* viewer.camera.eye = [-3.93, 2.85, 27.01];
|
|
16
|
+
* viewer.camera.look = [4.40, 3.72, 8.89];
|
|
17
|
+
* viewer.camera.up = [-0.01, 0.99, 0.039];
|
|
18
|
+
*
|
|
19
|
+
* const xktLoader = new XKTLoaderPlugin(viewer);
|
|
20
|
+
*
|
|
21
|
+
* const sceneModel = xktLoader.load({
|
|
22
|
+
* id: "myModel",
|
|
23
|
+
* src: "Duplex.xkt"
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* const angleMeasurements = new AngleMeasurementsPlugin(viewer);
|
|
27
|
+
*
|
|
28
|
+
* const pointerLens = new PointerLens(viewer); // Create a PointerLens instance
|
|
29
|
+
*
|
|
30
|
+
* const angleMeasurementsTouchControl = new AngleMeasurementsTouchControl(angleMeasurements, {
|
|
31
|
+
* pointerLens: pointerLens,
|
|
32
|
+
* snapping: true
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* angleMeasurementsTouchControl.activate();
|
|
36
|
+
*/
|
|
37
|
+
export class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new AngleMeasurementsTouchControl.
|
|
41
|
+
*
|
|
42
|
+
* @param {AngleMeasurementsPlugin} angleMeasurementsPlugin The AngleMeasurementsPlugin to control.
|
|
43
|
+
* @param {Object} [cfg] Configuration options.
|
|
44
|
+
* @param {PointerLens} [cfg.pointerLens] A PointerLens to use for providing a magnified view of the cursor when snapping is enabled.
|
|
45
|
+
* @param {boolean} [cfg.snapping=true] Whether to initially enable snap-to-vertex and snap-to-edge for this AngleMeasurementsTouchControl.
|
|
46
|
+
*/
|
|
47
|
+
constructor(angleMeasurementsPlugin: AngleMeasurementsPlugin, cfg?: {
|
|
48
|
+
pointerLens?: PointerLens;
|
|
49
|
+
snapping?: boolean;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Gets whether this AngleMeasurementsTouchControl is currently active, responding to input.
|
|
54
|
+
*
|
|
55
|
+
* @returns {boolean} True if active, false otherwise.
|
|
56
|
+
*/
|
|
57
|
+
get active(): boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Sets whether snap-to-vertex and snap-to-edge are enabled for this AngleMeasurementsTouchControl.
|
|
61
|
+
*
|
|
62
|
+
* @param {boolean} snapping True to enable snap-to-vertex and snap-to-edge, false to disable.
|
|
63
|
+
*/
|
|
64
|
+
set snapping(snapping: boolean);
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Gets whether snap-to-vertex and snap-to-edge are enabled for this AngleMeasurementsTouchControl.
|
|
68
|
+
*
|
|
69
|
+
* @returns {boolean} True if snap-to-vertex and snap-to-edge are enabled, false otherwise.
|
|
70
|
+
*/
|
|
71
|
+
get snapping(): boolean;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Activates this AngleMeasurementsTouchControl, making it responsive to input.
|
|
75
|
+
*/
|
|
76
|
+
activate(): void;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Deactivates this AngleMeasurementsTouchControl, making it unresponsive to input.
|
|
80
|
+
*/
|
|
81
|
+
deactivate(): void;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Resets this AngleMeasurementsTouchControl, destroying any AngleMeasurement under construction.
|
|
85
|
+
*/
|
|
86
|
+
reset(): void;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Destroys this AngleMeasurementsTouchControl.
|
|
90
|
+
*/
|
|
91
|
+
destroy(): void;
|
|
92
|
+
}
|
|
@@ -88,7 +88,7 @@ export declare class DistanceMeasurementsControl extends Component {
|
|
|
88
88
|
on(event: "measurementStart", callback: (measurement: DistanceMeasurement) => void, scope?: any): string
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
|
-
* Fires when the
|
|
91
|
+
* Fires when the control is (de)activated
|
|
92
92
|
* @param event The activation event
|
|
93
93
|
* @param callback Called fired on the event
|
|
94
94
|
* @param scope Scope for the callback
|
|
@@ -3,26 +3,37 @@ import { DistanceMeasurementsControl } from "./DistanceMeasurementsControl";
|
|
|
3
3
|
import { DistanceMeasurement } from "./DistanceMeasurement";
|
|
4
4
|
|
|
5
5
|
export declare type DistanceMeasurementsPluginConfiguration = {
|
|
6
|
+
|
|
6
7
|
/** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
|
|
7
8
|
id?: string;
|
|
9
|
+
|
|
8
10
|
/** The minimum length, in pixels, of an axis wire beyond which its label is shown. */
|
|
9
11
|
labelMinAxisLength?: number;
|
|
12
|
+
|
|
10
13
|
/** Container DOM element for markers and labels. Defaults to ````document.body````. */
|
|
11
14
|
container?: HTMLElement;
|
|
15
|
+
|
|
12
16
|
/** The default value of the DistanceMeasurements `visible` property. */
|
|
13
17
|
defaultVisible?: boolean;
|
|
18
|
+
|
|
14
19
|
/** The default value of the DistanceMeasurements `originVisible` property. */
|
|
15
20
|
defaultOriginVisible?: boolean;
|
|
21
|
+
|
|
16
22
|
/** The default value of the DistanceMeasurements `targetVisible` property. */
|
|
17
23
|
defaultTargetVisible?: boolean;
|
|
24
|
+
|
|
18
25
|
/** The default value of the DistanceMeasurements `wireVisible` property. */
|
|
19
26
|
defaultWireVisible?: boolean;
|
|
27
|
+
|
|
20
28
|
/** The default value of the DistanceMeasurements `axisVisible` property. */
|
|
21
29
|
defaultAxisVisible?: boolean;
|
|
30
|
+
|
|
22
31
|
/** The default color of the length dots, wire and label. */
|
|
23
32
|
defaultColor?: string;
|
|
33
|
+
|
|
24
34
|
/** The default value of the DistanceMeasurements `labelsOnWires` property. */
|
|
25
35
|
defaultLabelsOnWires?: boolean;
|
|
36
|
+
|
|
26
37
|
/** If set, the wires, dots and labels will have this zIndex (+1 for dots and +2 for labels). */
|
|
27
38
|
zIndex?: number;
|
|
28
39
|
};
|
|
@@ -31,7 +42,8 @@ export declare type DistanceMeasurementsPluginConfiguration = {
|
|
|
31
42
|
* {@link Viewer} plugin for measuring point-to-point distances.
|
|
32
43
|
*/
|
|
33
44
|
export declare class DistanceMeasurementsPlugin extends Plugin {
|
|
34
|
-
|
|
45
|
+
|
|
46
|
+
/**
|
|
35
47
|
* @constructor
|
|
36
48
|
* @param {Viewer} viewer The Viewer.
|
|
37
49
|
* @param {DistanceMeasurementsPluginConfiguration} [cfg] Plugin configuration.
|
|
@@ -149,5 +161,4 @@ export declare class DistanceMeasurementsPlugin extends Plugin {
|
|
|
149
161
|
* @param {Function} callback Callback fired on the event
|
|
150
162
|
*/
|
|
151
163
|
on(event: "measurementDestroyed", callback: (measurement: DistanceMeasurement)=> void): string;
|
|
152
|
-
|
|
153
164
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {DistanceMeasurementsControl} from "./DistanceMeasurementsControl";
|
|
2
|
+
import {DistanceMeasurementsPlugin} from "./DistanceMeasurementsPlugin";
|
|
3
|
+
import {PointerLens} from "../../extras/";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates {@link DistanceMeasurement}s in a {@link DistanceMeasurementsPlugin} from touch input.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Usage
|
|
10
|
+
* const distanceMeasurementsControl = new DistanceMeasurementsTouchControl(distanceMeasurementsPlugin, {
|
|
11
|
+
* pointerLens: new PointerLens(viewer),
|
|
12
|
+
* snapping: true
|
|
13
|
+
* });
|
|
14
|
+
*/
|
|
15
|
+
export class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates a DistanceMeasurementsTouchControl bound to the given DistanceMeasurementsPlugin.
|
|
19
|
+
*
|
|
20
|
+
* @param {DistanceMeasurementsPlugin} distanceMeasurementsPlugin The DistanceMeasurementsPlugin to control.
|
|
21
|
+
* @param {Object} cfg Configuration options.
|
|
22
|
+
* @param {PointerLens} [cfg.pointerLens] A PointerLens to provide a magnified view of the cursor when snapping is enabled.
|
|
23
|
+
* @param {boolean} [cfg.snapping=true] Whether to enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsTouchControl.
|
|
24
|
+
*/
|
|
25
|
+
constructor(distanceMeasurementsPlugin: DistanceMeasurementsPlugin, cfg?: {
|
|
26
|
+
pointerLens?: PointerLens;
|
|
27
|
+
snapping?: boolean;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Gets if this DistanceMeasurementsTouchControl is currently active, where it is responding to input.
|
|
32
|
+
*
|
|
33
|
+
* @returns {boolean} True if this DistanceMeasurementsTouchControl is active.
|
|
34
|
+
*/
|
|
35
|
+
get active(): boolean;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Sets whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsTouchControl.
|
|
39
|
+
*
|
|
40
|
+
* @param {boolean} snapping Whether to enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsTouchControl.
|
|
41
|
+
*/
|
|
42
|
+
set snapping(snapping: boolean);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Gets whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsTouchControl.
|
|
46
|
+
*
|
|
47
|
+
* @returns {boolean} Whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsTouchControl.
|
|
48
|
+
*/
|
|
49
|
+
get snapping(): boolean;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Activates this DistanceMeasurementsTouchControl, ready to respond to input.
|
|
53
|
+
*/
|
|
54
|
+
activate(): void;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Deactivates this DistanceMeasurementsTouchControl, making it unresponsive to input.
|
|
58
|
+
*/
|
|
59
|
+
deactivate(): void;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Resets this DistanceMeasurementsTouchControl.
|
|
63
|
+
*/
|
|
64
|
+
reset(): void;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Destroys this DistanceMeasurementsTouchControl.
|
|
68
|
+
*/
|
|
69
|
+
destroy(): void;
|
|
70
|
+
}
|