@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtctwins/tctwins-core",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "private": false,
5
5
  "description": "Web Programming Toolkit for 3D/2D BIM and CAD",
6
6
  "module": "./dist/tctwins-core.es.js",
@@ -51,6 +51,8 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
51
51
  cfg?: {
52
52
  pointerLens?: PointerLens;
53
53
  snapping?: boolean;
54
+ offsetX?: number;
55
+ offsetY?: number;
54
56
  }
55
57
  );
56
58
 
@@ -3,97 +3,111 @@ import { AngleMeasurement } from "./AngleMeasurement";
3
3
  import { AngleMeasurementsControl } from "./AngleMeasurementsControl";
4
4
 
5
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;
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
- * @constructor
22
- * @param {Viewer} viewer The Viewer.
23
- * @param {AngleMeasurementsPluginConfiguration} [cfg] Plugin configuration.
24
- */
25
- constructor(viewer: Viewer, cfg?: AngleMeasurementsPluginConfiguration);
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
- * Gets the {@link AngleMeasurementsControl}, which creates {@link AngleMeasurement}s from user input.
29
- *
30
- * @type {AngleMeasurementsControl}
31
- */
32
- get control(): AngleMeasurementsControl;
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
- * 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};
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
- * 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;
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
- * 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;
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
- * 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;
81
+ /**
82
+ * Destroys all {@link AngleMeasurement}s.
83
+ */
84
+ clear(): void;
92
85
 
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
- }
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
+ }
@@ -29,6 +29,8 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
29
29
  cfg?: {
30
30
  pointerLens?: PointerLens;
31
31
  snapping?: boolean;
32
+ offsetX?: number;
33
+ offsetY?: number;
32
34
  }
33
35
  );
34
36