@xtctwins/tctwins-core 1.0.17 → 1.0.18
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 +1 -1
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.d.ts +2 -0
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +96 -82
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.d.ts +2 -0
- package/dist/tctwins-core.cjs.js +0 -196592
- package/dist/tctwins-core.es5.js +0 -29216
- package/dist/tctwins-core.min.cjs.js +0 -37
- package/dist/tctwins-core.min.es5.js +0 -36
package/package.json
CHANGED
|
@@ -3,97 +3,111 @@ import { AngleMeasurement } from "./AngleMeasurement";
|
|
|
3
3
|
import { AngleMeasurementsControl } from "./AngleMeasurementsControl";
|
|
4
4
|
|
|
5
5
|
export declare type AngleMeasurementsPluginConfiguration = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
14
|
};
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* {@link Viewer} plugin for measuring angles.
|
|
18
18
|
*/
|
|
19
19
|
export declare class AngleMeasurementsPlugin extends Plugin {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @constructor
|
|
22
|
+
* @param {Viewer} viewer The Viewer.
|
|
23
|
+
* @param {AngleMeasurementsPluginConfiguration} [cfg] Plugin configuration.
|
|
24
|
+
*/
|
|
25
|
+
constructor(viewer: Viewer, cfg?: AngleMeasurementsPluginConfiguration);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Gets the {@link AngleMeasurementsControl}, which creates {@link AngleMeasurement}s from user input.
|
|
29
|
+
*
|
|
30
|
+
* @type {AngleMeasurementsControl}
|
|
31
|
+
*/
|
|
32
|
+
get control(): AngleMeasurementsControl;
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Destroys all {@link AngleMeasurement}s.
|
|
83
|
-
*/
|
|
84
|
-
clear(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Destroys a {@link AngleMeasurement}.
|
|
76
|
+
*
|
|
77
|
+
* @param {String} id ID of AngleMeasurement to destroy.
|
|
78
|
+
*/
|
|
79
|
+
destroyMeasurement(id: string): void;
|
|
85
80
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
*/
|
|
91
|
-
on(event: "measurementCreated", callback: (measurement: AngleMeasurement)=> void): void;
|
|
81
|
+
/**
|
|
82
|
+
* Destroys all {@link AngleMeasurement}s.
|
|
83
|
+
*/
|
|
84
|
+
clear(): void;
|
|
92
85
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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 completed.
|
|
95
|
+
* @param {String} event The measurementEnd event
|
|
96
|
+
* @param {Function} callback Callback fired on the event
|
|
97
|
+
*/
|
|
98
|
+
on(event: "measurementEnd", callback: (measurement: AngleMeasurement) => void): string;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Fires when a measurement is cancelled.
|
|
102
|
+
* @param {String} event The measurementCancel event
|
|
103
|
+
* @param {Function} callback Callback fired on the event
|
|
104
|
+
*/
|
|
105
|
+
on(event: "measurementCancel", callback: (measurement: AngleMeasurement) => void): string;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Fires when a measurement is destroyed.
|
|
109
|
+
* @param {String} event The measurementDestroyed event
|
|
110
|
+
* @param {Function} callback Callback fired on the event
|
|
111
|
+
*/
|
|
112
|
+
on(event: "measurementDestroyed", callback: (measurement: AngleMeasurement) => void): void;
|
|
113
|
+
}
|