@xtctwins/tctwins-core 1.1.19 → 1.1.20
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/README.md +4 -4
- package/dist/tctwins-core.es5.js +27517 -27493
- package/dist/tctwins-core.min.es5.js +4 -4
- package/package.json +84 -84
- package/types/extras/ContextMenu/ContextMenu.d.ts +127 -127
- package/types/extras/ContextMenu/index.d.ts +1 -1
- package/types/extras/PointerCircle/PointerCircle.d.ts +51 -51
- package/types/extras/PointerCircle/index.d.ts +1 -1
- package/types/extras/PointerLens/PointerLens.d.ts +146 -146
- package/types/extras/index.d.ts +3 -3
- package/types/index.d.ts +3 -3
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurement.d.ts +204 -204
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.d.ts +91 -91
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.d.ts +125 -125
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +151 -151
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsSimulateMouseControl.d.ts +86 -86
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsTouchControl.d.ts +124 -124
- package/types/plugins/AngleMeasurementsPlugin/index.d.ts +5 -5
- package/types/plugins/AnnotationsPlugin/Annotation.d.ts +135 -135
- package/types/plugins/AnnotationsPlugin/AnnotationsPlugin.d.ts +172 -172
- package/types/plugins/AnnotationsPlugin/index.d.ts +2 -2
- package/types/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.d.ts +148 -148
- package/types/plugins/BCFViewpointsPlugin/index.d.ts +1 -1
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.d.ts +253 -253
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.d.ts +96 -96
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.d.ts +102 -102
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +192 -192
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsSimulateMouseControl.d.ts +83 -83
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsTouchControl.d.ts +103 -103
- package/types/plugins/DistanceMeasurementsPlugin/index.d.ts +5 -5
- package/types/plugins/FastNavPlugin/FastNavPlugin.d.ts +223 -223
- package/types/plugins/FastNavPlugin/index.d.ts +1 -1
- package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.d.ts +142 -142
- package/types/plugins/GLTFLoaderPlugin/index.d.ts +1 -1
- package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +240 -240
- package/types/plugins/LASLoaderPlugin/index.d.ts +1 -1
- package/types/plugins/NavCubePlugin/NavCubePlugin.d.ts +177 -177
- package/types/plugins/NavCubePlugin/index.d.ts +1 -1
- package/types/plugins/ObjectEditPlugin/ObjectEditPlugin.d.ts +242 -242
- package/types/plugins/ObjectEditPlugin/index.d.ts +1 -1
- package/types/plugins/SectionPlanesPlugin/SectionBoxControl.d.ts +36 -36
- package/types/plugins/SectionPlanesPlugin/SectionPlanesPlugin.d.ts +186 -186
- package/types/plugins/SectionPlanesPlugin/index.d.ts +2 -2
- package/types/plugins/SkyboxesPlugin/SkyboxesPlugin.d.ts +66 -66
- package/types/plugins/SkyboxesPlugin/index.d.ts +1 -1
- package/types/plugins/StoreyViewsPlugin/Storey.d.ts +69 -69
- package/types/plugins/StoreyViewsPlugin/StoreyMap.d.ts +41 -41
- package/types/plugins/StoreyViewsPlugin/StoreyViewsPlugin.d.ts +180 -180
- package/types/plugins/StoreyViewsPlugin/index.d.ts +1 -1
- package/types/plugins/TreeViewPlugin/ModelTreeView.d.ts +24 -24
- package/types/plugins/TreeViewPlugin/TreeViewNode.d.ts +71 -71
- package/types/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +267 -267
- package/types/plugins/TreeViewPlugin/index.d.ts +1 -1
- package/types/plugins/TreeViewPlugin/renderService.d.ts +128 -128
- package/types/plugins/ViewCullPlugin/ViewCullPlugin.d.ts +34 -34
- package/types/plugins/ViewCullPlugin/index.d.ts +1 -1
- package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +236 -236
- package/types/plugins/WebIFCLoaderPlugin/index.d.ts +1 -1
- package/types/plugins/XTCLoaderPlugin/XTCLoaderPlugin.d.ts +288 -288
- package/types/plugins/XTCLoaderPlugin/index.d.ts +1 -1
- package/types/plugins/index.d.ts +30 -30
- package/types/viewer/Configs.d.ts +46 -46
- package/types/viewer/Plugin.d.ts +69 -69
- package/types/viewer/Viewer.d.ts +282 -282
- package/types/viewer/index.d.ts +6 -6
- package/types/viewer/localization/LocaleService.d.ts +183 -183
- package/types/viewer/metadata/IFCObjectDefaults.d.ts +9 -9
- package/types/viewer/metadata/MetaModel.d.ts +94 -102
- package/types/viewer/metadata/MetaObject.d.ts +74 -74
- package/types/viewer/metadata/MetaScene.d.ts +135 -135
- package/types/viewer/metadata/Property.d.ts +29 -29
- package/types/viewer/metadata/PropertySet.d.ts +31 -31
- package/types/viewer/metadata/index.d.ts +6 -6
- package/types/viewer/scene/Bitmap/Bitmap.d.ts +255 -255
- package/types/viewer/scene/CameraControl/CameraControl.d.ts +777 -777
- package/types/viewer/scene/Component.d.ts +155 -155
- package/types/viewer/scene/Entity.d.ts +401 -401
- package/types/viewer/scene/LineSet/LineSet.d.ts +111 -111
- package/types/viewer/scene/camera/Camera.d.ts +364 -364
- package/types/viewer/scene/camera/CameraFlightAnimation.d.ts +167 -167
- package/types/viewer/scene/camera/CameraPath.d.ts +28 -28
- package/types/viewer/scene/camera/CameraPathAnimation.d.ts +95 -95
- package/types/viewer/scene/camera/CustomProjection.d.ts +57 -57
- package/types/viewer/scene/camera/Frustum.d.ts +166 -166
- package/types/viewer/scene/camera/Ortho.d.ts +115 -115
- package/types/viewer/scene/camera/Perspective.d.ts +136 -136
- package/types/viewer/scene/camera/index.d.ts +4 -4
- package/types/viewer/scene/geometry/Geometry.d.ts +7 -7
- package/types/viewer/scene/geometry/ReadableGeometry.d.ts +95 -95
- package/types/viewer/scene/geometry/VBOGeometry.d.ts +62 -62
- package/types/viewer/scene/geometry/builders/buildBoxGeometry.d.ts +21 -21
- package/types/viewer/scene/geometry/builders/buildBoxLinesGeometry.d.ts +21 -21
- package/types/viewer/scene/geometry/builders/buildCylinderGeometry.d.ts +27 -27
- package/types/viewer/scene/geometry/builders/buildGridGeometry.d.ts +17 -17
- package/types/viewer/scene/geometry/builders/buildPlaneGeometry.d.ts +21 -21
- package/types/viewer/scene/geometry/builders/buildSphereGeometry.d.ts +21 -21
- package/types/viewer/scene/geometry/builders/buildTorusGeometry.d.ts +25 -25
- package/types/viewer/scene/geometry/builders/buildVectorTextGeometry.d.ts +21 -21
- package/types/viewer/scene/geometry/builders/index.d.ts +8 -8
- package/types/viewer/scene/geometry/index.d.ts +2 -2
- package/types/viewer/scene/index.d.ts +23 -23
- package/types/viewer/scene/input/input.d.ts +69 -69
- package/types/viewer/scene/lights/AmbientLight.d.ts +19 -19
- package/types/viewer/scene/lights/DirLight.d.ts +25 -25
- package/types/viewer/scene/lights/Light.d.ts +3 -3
- package/types/viewer/scene/lights/PointLight.d.ts +30 -30
- package/types/viewer/scene/lights/index.d.ts +2 -2
- package/types/viewer/scene/marker/Marker.d.ts +136 -136
- package/types/viewer/scene/marker/SpriteMarker.d.ts +185 -185
- package/types/viewer/scene/marker/index.d.ts +2 -2
- package/types/viewer/scene/materials/EdgeMaterial.d.ts +83 -83
- package/types/viewer/scene/materials/EmphasisMaterial.d.ts +241 -241
- package/types/viewer/scene/materials/Fresnel.d.ts +148 -148
- package/types/viewer/scene/materials/LinesMaterial.d.ts +71 -71
- package/types/viewer/scene/materials/Material.d.ts +3 -3
- package/types/viewer/scene/materials/PhongMaterial.d.ts +468 -468
- package/types/viewer/scene/materials/PointsMaterial.d.ts +206 -206
- package/types/viewer/scene/materials/Texture.d.ts +260 -260
- package/types/viewer/scene/materials/index.d.ts +6 -6
- package/types/viewer/scene/math/Frustum.d.ts +41 -41
- package/types/viewer/scene/math/index.d.ts +1 -1
- package/types/viewer/scene/math/math.d.ts +104 -104
- package/types/viewer/scene/mementos/CameraMemento.d.ts +28 -28
- package/types/viewer/scene/mementos/ModelMemento.d.ts +44 -44
- package/types/viewer/scene/mementos/ObjectsMemento.d.ts +39 -39
- package/types/viewer/scene/mementos/index.d.ts +3 -3
- package/types/viewer/scene/mesh/Mesh.d.ts +793 -793
- package/types/viewer/scene/mesh/index.d.ts +1 -1
- package/types/viewer/scene/models/PerformanceModel/PerformanceModel.d.ts +9 -9
- package/types/viewer/scene/models/PerformanceModel/index.d.ts +1 -1
- package/types/viewer/scene/models/SceneModel.d.ts +757 -762
- package/types/viewer/scene/models/SceneModelEntity.d.ts +417 -417
- package/types/viewer/scene/models/SceneModelMesh.d.ts +68 -68
- package/types/viewer/scene/models/SceneModelTexture.d.ts +16 -16
- package/types/viewer/scene/models/SceneModelTextureSet.d.ts +51 -51
- package/types/viewer/scene/models/SceneModelTransform.d.ts +197 -197
- package/types/viewer/scene/models/VBOSceneModel/VBOSceneModel.d.ts +7 -7
- package/types/viewer/scene/models/index.d.ts +7 -7
- package/types/viewer/scene/nodes/Node.d.ts +664 -664
- package/types/viewer/scene/nodes/index.d.ts +1 -1
- package/types/viewer/scene/postfx/CrossSections.d.ts +42 -42
- package/types/viewer/scene/postfx/SAO.d.ts +209 -209
- package/types/viewer/scene/scene/Scene.d.ts +1068 -1068
- package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +110 -110
- package/types/viewer/scene/sectionPlane/index.d.ts +1 -1
- package/types/viewer/scene/stats.d.ts +40 -40
- package/types/viewer/scene/viewport/Viewport.d.ts +23 -23
- package/types/viewer/scene/viewport/index.d.ts +1 -1
- package/types/viewer/scene/webgl/PickResult.d.ts +115 -115
- package/types/viewer/scene/webgl/index.d.ts +1 -1
- package/dist/tctwins-core.umd.js +0 -37
|
@@ -1,192 +1,192 @@
|
|
|
1
|
-
import { Entity, Plugin, Viewer } from "../../viewer";
|
|
2
|
-
import { DistanceMeasurementsControl } from "./DistanceMeasurementsControl";
|
|
3
|
-
import { DistanceMeasurement } from "./DistanceMeasurement";
|
|
4
|
-
|
|
5
|
-
export declare type DistanceMeasurementsPluginConfiguration = {
|
|
6
|
-
/** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
|
|
7
|
-
id?: string;
|
|
8
|
-
/** The minimum length, in pixels, of an axis wire beyond which its label is shown. */
|
|
9
|
-
labelMinAxisLength?: number;
|
|
10
|
-
/** Container DOM element for markers and labels. Defaults to ````document.body````. */
|
|
11
|
-
container?: HTMLElement;
|
|
12
|
-
/** The default value of the DistanceMeasurements `visible` property. */
|
|
13
|
-
defaultVisible?: boolean;
|
|
14
|
-
/** The default value of the DistanceMeasurements `originVisible` property. */
|
|
15
|
-
defaultOriginVisible?: boolean;
|
|
16
|
-
/** The default value of the DistanceMeasurements `targetVisible` property. */
|
|
17
|
-
defaultTargetVisible?: boolean;
|
|
18
|
-
/** The default value of the DistanceMeasurements `wireVisible` property. */
|
|
19
|
-
defaultWireVisible?: boolean;
|
|
20
|
-
/** The default value of the DistanceMeasurements `axisVisible` property. */
|
|
21
|
-
defaultAxisVisible?: boolean;
|
|
22
|
-
/** The default color of the length dots, wire and label. */
|
|
23
|
-
defaultColor?: string;
|
|
24
|
-
/** If set, the wires, dots and labels will have this zIndex (+1 for dots and +2 for labels). */
|
|
25
|
-
zIndex?: number;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* {@link Viewer} plugin for measuring point-to-point distances.
|
|
30
|
-
*/
|
|
31
|
-
export declare class DistanceMeasurementsPlugin extends Plugin {
|
|
32
|
-
/**
|
|
33
|
-
* @constructor
|
|
34
|
-
* @param {Viewer} viewer The Viewer.
|
|
35
|
-
* @param {DistanceMeasurementsPluginConfiguration} [cfg] Plugin configuration.
|
|
36
|
-
*/
|
|
37
|
-
constructor(viewer: Viewer, cfg?: DistanceMeasurementsPluginConfiguration);
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* 设置精度
|
|
41
|
-
* @param {number} precision
|
|
42
|
-
*/
|
|
43
|
-
set precision(precision: number);
|
|
44
|
-
get precision(): number;
|
|
45
|
-
get measureNum(): number;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Sets the minimum length, in pixels, of an axis wire beyond which its label is shown.
|
|
49
|
-
*
|
|
50
|
-
* The axis wire's label is not shown when its length is less than this value.
|
|
51
|
-
*
|
|
52
|
-
* This is ````25```` pixels by default.
|
|
53
|
-
*
|
|
54
|
-
* Must not be less than ````1````.
|
|
55
|
-
*
|
|
56
|
-
* @type {number}
|
|
57
|
-
*/
|
|
58
|
-
set labelMinAxisLength(arg: number);
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Gets the minimum length, in pixels, of an axis wire beyond which its label is shown.
|
|
62
|
-
* @returns {number}
|
|
63
|
-
*/
|
|
64
|
-
get labelMinAxisLength(): number;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Gets the {@link DistanceMeasurementsControl}, which creates {@link DistanceMeasurement}s from user input.
|
|
68
|
-
*
|
|
69
|
-
* @type {DistanceMeasurementsControl}
|
|
70
|
-
*/
|
|
71
|
-
get control(): DistanceMeasurementsControl;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Gets the existing {@link DistanceMeasurement}s, each mapped to its {@link DistanceMeasurement.id}.
|
|
75
|
-
*
|
|
76
|
-
* @type {{String:DistanceMeasurement}}
|
|
77
|
-
*/
|
|
78
|
-
get measurements(): { [key: string]: DistanceMeasurement };
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Creates a {@link DistanceMeasurement}.
|
|
82
|
-
*
|
|
83
|
-
* The DistanceMeasurement is then registered by {@link DistanceMeasurement.id} in {@link DistanceMeasurementsPlugin.measurements}.
|
|
84
|
-
*
|
|
85
|
-
* @param {Object} params {@link DistanceMeasurement} configuration.
|
|
86
|
-
* @param {String} params.id Unique ID to assign to {@link DistanceMeasurement.id}. The DistanceMeasurement will be registered by this in {@link DistanceMeasurementsPlugin.measurements} and {@link Scene.components}. Must be unique among all components in the {@link Viewer}.
|
|
87
|
-
* @param {Number[]} params.origin.worldPos Origin World-space 3D position.
|
|
88
|
-
* @param {Entity} params.origin.entity Origin Entity.
|
|
89
|
-
* @param {Number[]} params.target.worldPos Target World-space 3D position.
|
|
90
|
-
* @param {Entity} params.target.entity Target Entity.
|
|
91
|
-
* @param {Boolean} [params.visible=true] Whether to initially show the {@link DistanceMeasurement}.
|
|
92
|
-
* @param {Boolean} [params.originVisible=true] Whether to initially show the {@link DistanceMeasurement} origin.
|
|
93
|
-
* @param {Boolean} [params.targetVisible=true] Whether to initially show the {@link DistanceMeasurement} target.
|
|
94
|
-
* @param {Boolean} [params.wireVisible=true] Whether to initially show the direct point-to-point wire between {@link DistanceMeasurement.origin} and {@link DistanceMeasurement.target}.
|
|
95
|
-
* @param {Boolean} [params.axisVisible=true] Whether to initially show the axis-aligned wires between {@link DistanceMeasurement.origin} and {@link DistanceMeasurement.target}.
|
|
96
|
-
* @param {string} [params.color] The color of the length dot, wire and label.
|
|
97
|
-
* @returns {DistanceMeasurement} The new {@link DistanceMeasurement}.
|
|
98
|
-
*/
|
|
99
|
-
createMeasurement(params?: {
|
|
100
|
-
id: string;
|
|
101
|
-
origin: {
|
|
102
|
-
entity: Entity;
|
|
103
|
-
worldPos: number[];
|
|
104
|
-
};
|
|
105
|
-
target: {
|
|
106
|
-
entity: Entity;
|
|
107
|
-
worldPos: number[];
|
|
108
|
-
};
|
|
109
|
-
visible?: boolean;
|
|
110
|
-
originVisible?: boolean;
|
|
111
|
-
targetVisible?: boolean;
|
|
112
|
-
wireVisible?: boolean;
|
|
113
|
-
axisVisible?: boolean;
|
|
114
|
-
color?: string;
|
|
115
|
-
}): DistanceMeasurement;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Destroys a {@link DistanceMeasurement}.
|
|
119
|
-
*
|
|
120
|
-
* @param {String} id ID of DistanceMeasurement to destroy.
|
|
121
|
-
*/
|
|
122
|
-
destroyMeasurement(id: string): void;
|
|
123
|
-
|
|
124
|
-
setLabelsShown(labelsShown: boolean): void;
|
|
125
|
-
|
|
126
|
-
setMeasurementsShown(visible: any): void;
|
|
127
|
-
|
|
128
|
-
setAxisVisible(axisVisible: any): void;
|
|
129
|
-
|
|
130
|
-
getAxisVisible(): boolean;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Destroys all {@link DistanceMeasurement}s.
|
|
134
|
-
*/
|
|
135
|
-
clear(): void;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Fires when a measurement is created.
|
|
139
|
-
* @param {String} event The measurementCreated event
|
|
140
|
-
* @param {Function} callback Callback fired on the event
|
|
141
|
-
*/
|
|
142
|
-
on(event: "measurementCreated", callback: (measurement: DistanceMeasurement) => void): string;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Fires when a measurement is completed.
|
|
146
|
-
* @param {String} event The measurementEnd event
|
|
147
|
-
* @param {Function} callback Callback fired on the event
|
|
148
|
-
*/
|
|
149
|
-
on(event: "measurementEnd", callback: (measurement: DistanceMeasurement) => void): string;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Fires when a measurement is cancelled.
|
|
153
|
-
* @param {String} event The measurementCancel event
|
|
154
|
-
* @param {Function} callback Callback fired on the event
|
|
155
|
-
*/
|
|
156
|
-
on(event: "measurementCancel", callback: (measurement: DistanceMeasurement) => void): string;
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Fires when a measurement is destroyed.
|
|
160
|
-
* @param {String} event The measurementDestroyed event
|
|
161
|
-
* @param {Function} callback Callback fired on the event
|
|
162
|
-
*/
|
|
163
|
-
on(event: "measurementDestroyed", callback: (measurement: DistanceMeasurement) => void): string;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* trigger when hover measure object
|
|
167
|
-
* @param event
|
|
168
|
-
* @param e
|
|
169
|
-
*/
|
|
170
|
-
on(event: "mouseOver", e: any): void;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* trigger when leave measure object
|
|
174
|
-
* @param event
|
|
175
|
-
* @param e
|
|
176
|
-
*/
|
|
177
|
-
on(event: "mouseLeave", e: any): void;
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* trigger when click or touch measure object
|
|
181
|
-
* @param event
|
|
182
|
-
* @param e
|
|
183
|
-
*/
|
|
184
|
-
on(event: "clickMeasure", e: any): void;
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* trigger when touch measure object
|
|
188
|
-
* @param event
|
|
189
|
-
* @param e
|
|
190
|
-
*/
|
|
191
|
-
on(event: "touchMeasure", e: any): void;
|
|
192
|
-
}
|
|
1
|
+
import { Entity, Plugin, Viewer } from "../../viewer";
|
|
2
|
+
import { DistanceMeasurementsControl } from "./DistanceMeasurementsControl";
|
|
3
|
+
import { DistanceMeasurement } from "./DistanceMeasurement";
|
|
4
|
+
|
|
5
|
+
export declare type DistanceMeasurementsPluginConfiguration = {
|
|
6
|
+
/** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
|
|
7
|
+
id?: string;
|
|
8
|
+
/** The minimum length, in pixels, of an axis wire beyond which its label is shown. */
|
|
9
|
+
labelMinAxisLength?: number;
|
|
10
|
+
/** Container DOM element for markers and labels. Defaults to ````document.body````. */
|
|
11
|
+
container?: HTMLElement;
|
|
12
|
+
/** The default value of the DistanceMeasurements `visible` property. */
|
|
13
|
+
defaultVisible?: boolean;
|
|
14
|
+
/** The default value of the DistanceMeasurements `originVisible` property. */
|
|
15
|
+
defaultOriginVisible?: boolean;
|
|
16
|
+
/** The default value of the DistanceMeasurements `targetVisible` property. */
|
|
17
|
+
defaultTargetVisible?: boolean;
|
|
18
|
+
/** The default value of the DistanceMeasurements `wireVisible` property. */
|
|
19
|
+
defaultWireVisible?: boolean;
|
|
20
|
+
/** The default value of the DistanceMeasurements `axisVisible` property. */
|
|
21
|
+
defaultAxisVisible?: boolean;
|
|
22
|
+
/** The default color of the length dots, wire and label. */
|
|
23
|
+
defaultColor?: string;
|
|
24
|
+
/** If set, the wires, dots and labels will have this zIndex (+1 for dots and +2 for labels). */
|
|
25
|
+
zIndex?: number;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* {@link Viewer} plugin for measuring point-to-point distances.
|
|
30
|
+
*/
|
|
31
|
+
export declare class DistanceMeasurementsPlugin extends Plugin {
|
|
32
|
+
/**
|
|
33
|
+
* @constructor
|
|
34
|
+
* @param {Viewer} viewer The Viewer.
|
|
35
|
+
* @param {DistanceMeasurementsPluginConfiguration} [cfg] Plugin configuration.
|
|
36
|
+
*/
|
|
37
|
+
constructor(viewer: Viewer, cfg?: DistanceMeasurementsPluginConfiguration);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 设置精度
|
|
41
|
+
* @param {number} precision
|
|
42
|
+
*/
|
|
43
|
+
set precision(precision: number);
|
|
44
|
+
get precision(): number;
|
|
45
|
+
get measureNum(): number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Sets the minimum length, in pixels, of an axis wire beyond which its label is shown.
|
|
49
|
+
*
|
|
50
|
+
* The axis wire's label is not shown when its length is less than this value.
|
|
51
|
+
*
|
|
52
|
+
* This is ````25```` pixels by default.
|
|
53
|
+
*
|
|
54
|
+
* Must not be less than ````1````.
|
|
55
|
+
*
|
|
56
|
+
* @type {number}
|
|
57
|
+
*/
|
|
58
|
+
set labelMinAxisLength(arg: number);
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Gets the minimum length, in pixels, of an axis wire beyond which its label is shown.
|
|
62
|
+
* @returns {number}
|
|
63
|
+
*/
|
|
64
|
+
get labelMinAxisLength(): number;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Gets the {@link DistanceMeasurementsControl}, which creates {@link DistanceMeasurement}s from user input.
|
|
68
|
+
*
|
|
69
|
+
* @type {DistanceMeasurementsControl}
|
|
70
|
+
*/
|
|
71
|
+
get control(): DistanceMeasurementsControl;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Gets the existing {@link DistanceMeasurement}s, each mapped to its {@link DistanceMeasurement.id}.
|
|
75
|
+
*
|
|
76
|
+
* @type {{String:DistanceMeasurement}}
|
|
77
|
+
*/
|
|
78
|
+
get measurements(): { [key: string]: DistanceMeasurement };
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Creates a {@link DistanceMeasurement}.
|
|
82
|
+
*
|
|
83
|
+
* The DistanceMeasurement is then registered by {@link DistanceMeasurement.id} in {@link DistanceMeasurementsPlugin.measurements}.
|
|
84
|
+
*
|
|
85
|
+
* @param {Object} params {@link DistanceMeasurement} configuration.
|
|
86
|
+
* @param {String} params.id Unique ID to assign to {@link DistanceMeasurement.id}. The DistanceMeasurement will be registered by this in {@link DistanceMeasurementsPlugin.measurements} and {@link Scene.components}. Must be unique among all components in the {@link Viewer}.
|
|
87
|
+
* @param {Number[]} params.origin.worldPos Origin World-space 3D position.
|
|
88
|
+
* @param {Entity} params.origin.entity Origin Entity.
|
|
89
|
+
* @param {Number[]} params.target.worldPos Target World-space 3D position.
|
|
90
|
+
* @param {Entity} params.target.entity Target Entity.
|
|
91
|
+
* @param {Boolean} [params.visible=true] Whether to initially show the {@link DistanceMeasurement}.
|
|
92
|
+
* @param {Boolean} [params.originVisible=true] Whether to initially show the {@link DistanceMeasurement} origin.
|
|
93
|
+
* @param {Boolean} [params.targetVisible=true] Whether to initially show the {@link DistanceMeasurement} target.
|
|
94
|
+
* @param {Boolean} [params.wireVisible=true] Whether to initially show the direct point-to-point wire between {@link DistanceMeasurement.origin} and {@link DistanceMeasurement.target}.
|
|
95
|
+
* @param {Boolean} [params.axisVisible=true] Whether to initially show the axis-aligned wires between {@link DistanceMeasurement.origin} and {@link DistanceMeasurement.target}.
|
|
96
|
+
* @param {string} [params.color] The color of the length dot, wire and label.
|
|
97
|
+
* @returns {DistanceMeasurement} The new {@link DistanceMeasurement}.
|
|
98
|
+
*/
|
|
99
|
+
createMeasurement(params?: {
|
|
100
|
+
id: string;
|
|
101
|
+
origin: {
|
|
102
|
+
entity: Entity;
|
|
103
|
+
worldPos: number[];
|
|
104
|
+
};
|
|
105
|
+
target: {
|
|
106
|
+
entity: Entity;
|
|
107
|
+
worldPos: number[];
|
|
108
|
+
};
|
|
109
|
+
visible?: boolean;
|
|
110
|
+
originVisible?: boolean;
|
|
111
|
+
targetVisible?: boolean;
|
|
112
|
+
wireVisible?: boolean;
|
|
113
|
+
axisVisible?: boolean;
|
|
114
|
+
color?: string;
|
|
115
|
+
}): DistanceMeasurement;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Destroys a {@link DistanceMeasurement}.
|
|
119
|
+
*
|
|
120
|
+
* @param {String} id ID of DistanceMeasurement to destroy.
|
|
121
|
+
*/
|
|
122
|
+
destroyMeasurement(id: string): void;
|
|
123
|
+
|
|
124
|
+
setLabelsShown(labelsShown: boolean): void;
|
|
125
|
+
|
|
126
|
+
setMeasurementsShown(visible: any): void;
|
|
127
|
+
|
|
128
|
+
setAxisVisible(axisVisible: any): void;
|
|
129
|
+
|
|
130
|
+
getAxisVisible(): boolean;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Destroys all {@link DistanceMeasurement}s.
|
|
134
|
+
*/
|
|
135
|
+
clear(): void;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Fires when a measurement is created.
|
|
139
|
+
* @param {String} event The measurementCreated event
|
|
140
|
+
* @param {Function} callback Callback fired on the event
|
|
141
|
+
*/
|
|
142
|
+
on(event: "measurementCreated", callback: (measurement: DistanceMeasurement) => void): string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Fires when a measurement is completed.
|
|
146
|
+
* @param {String} event The measurementEnd event
|
|
147
|
+
* @param {Function} callback Callback fired on the event
|
|
148
|
+
*/
|
|
149
|
+
on(event: "measurementEnd", callback: (measurement: DistanceMeasurement) => void): string;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Fires when a measurement is cancelled.
|
|
153
|
+
* @param {String} event The measurementCancel event
|
|
154
|
+
* @param {Function} callback Callback fired on the event
|
|
155
|
+
*/
|
|
156
|
+
on(event: "measurementCancel", callback: (measurement: DistanceMeasurement) => void): string;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Fires when a measurement is destroyed.
|
|
160
|
+
* @param {String} event The measurementDestroyed event
|
|
161
|
+
* @param {Function} callback Callback fired on the event
|
|
162
|
+
*/
|
|
163
|
+
on(event: "measurementDestroyed", callback: (measurement: DistanceMeasurement) => void): string;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* trigger when hover measure object
|
|
167
|
+
* @param event
|
|
168
|
+
* @param e
|
|
169
|
+
*/
|
|
170
|
+
on(event: "mouseOver", e: any): void;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* trigger when leave measure object
|
|
174
|
+
* @param event
|
|
175
|
+
* @param e
|
|
176
|
+
*/
|
|
177
|
+
on(event: "mouseLeave", e: any): void;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* trigger when click or touch measure object
|
|
181
|
+
* @param event
|
|
182
|
+
* @param e
|
|
183
|
+
*/
|
|
184
|
+
on(event: "clickMeasure", e: any): void;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* trigger when touch measure object
|
|
188
|
+
* @param event
|
|
189
|
+
* @param e
|
|
190
|
+
*/
|
|
191
|
+
on(event: "touchMeasure", e: any): void;
|
|
192
|
+
}
|
package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsSimulateMouseControl.d.ts
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import { DistanceMeasurementsControl } from "./DistanceMeasurementsControl.js";
|
|
2
|
-
import { DistanceMeasurementsPlugin } from "./DistanceMeasurementsPlugin";
|
|
3
|
-
|
|
4
|
-
export class DistanceMeasurementsSimulateMouseControl extends DistanceMeasurementsControl {
|
|
5
|
-
constructor(
|
|
6
|
-
distanceMeasurementsPlugin: DistanceMeasurementsPlugin,
|
|
7
|
-
cfg?: {
|
|
8
|
-
snapping?: boolean;
|
|
9
|
-
offsetX?: number;
|
|
10
|
-
offsetY?: number;
|
|
11
|
-
}
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @return {number} mouse offset
|
|
16
|
-
*/
|
|
17
|
-
get offsetX(): number;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @param {number} offsetX
|
|
21
|
-
*/
|
|
22
|
-
set offsetX(offsetX: number);
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @return {number} mouse offset
|
|
26
|
-
*/
|
|
27
|
-
get offsetY(): number;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @param {number} offsetY
|
|
31
|
-
*/
|
|
32
|
-
set offsetY(offsetY: number);
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Gets if this DistanceMeasurementsMouseControl is currently active, where it is responding to input.
|
|
36
|
-
*
|
|
37
|
-
* @returns {boolean} True if this DistanceMeasurementsMouseControl is active.
|
|
38
|
-
*/
|
|
39
|
-
get active(): boolean;
|
|
40
|
-
set active(active: boolean);
|
|
41
|
-
|
|
42
|
-
get mouseState(): number;
|
|
43
|
-
set mouseState(state: number);
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Sets whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsMouseControl.
|
|
47
|
-
*
|
|
48
|
-
* @param {boolean} snapping Whether to enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsMouseControl.
|
|
49
|
-
*/
|
|
50
|
-
set snapping(snapping: boolean);
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Gets whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsMouseControl.
|
|
54
|
-
*
|
|
55
|
-
* @returns {boolean} Whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsMouseControl.
|
|
56
|
-
*/
|
|
57
|
-
get snapping(): boolean;
|
|
58
|
-
|
|
59
|
-
onMousedown(canvasPos: number[]): void;
|
|
60
|
-
onMousemove(canvasPos: number[]): void;
|
|
61
|
-
onMouseup(canvasPos: number[]): void;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Activates this DistanceMeasurementsMouseControl, ready to respond to input.
|
|
65
|
-
*/
|
|
66
|
-
activate(): void;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Deactivates this DistanceMeasurementsMouseControl, making it unresponsive to input.
|
|
70
|
-
*/
|
|
71
|
-
deactivate(): void;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Resets this DistanceMeasurementsMouseControl.
|
|
75
|
-
*/
|
|
76
|
-
reset(): void;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Destroys this DistanceMeasurementsMouseControl.
|
|
80
|
-
*/
|
|
81
|
-
destroy(): void;
|
|
82
|
-
|
|
83
|
-
}
|
|
1
|
+
import { DistanceMeasurementsControl } from "./DistanceMeasurementsControl.js";
|
|
2
|
+
import { DistanceMeasurementsPlugin } from "./DistanceMeasurementsPlugin";
|
|
3
|
+
|
|
4
|
+
export class DistanceMeasurementsSimulateMouseControl extends DistanceMeasurementsControl {
|
|
5
|
+
constructor(
|
|
6
|
+
distanceMeasurementsPlugin: DistanceMeasurementsPlugin,
|
|
7
|
+
cfg?: {
|
|
8
|
+
snapping?: boolean;
|
|
9
|
+
offsetX?: number;
|
|
10
|
+
offsetY?: number;
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @return {number} mouse offset
|
|
16
|
+
*/
|
|
17
|
+
get offsetX(): number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @param {number} offsetX
|
|
21
|
+
*/
|
|
22
|
+
set offsetX(offsetX: number);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @return {number} mouse offset
|
|
26
|
+
*/
|
|
27
|
+
get offsetY(): number;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @param {number} offsetY
|
|
31
|
+
*/
|
|
32
|
+
set offsetY(offsetY: number);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Gets if this DistanceMeasurementsMouseControl is currently active, where it is responding to input.
|
|
36
|
+
*
|
|
37
|
+
* @returns {boolean} True if this DistanceMeasurementsMouseControl is active.
|
|
38
|
+
*/
|
|
39
|
+
get active(): boolean;
|
|
40
|
+
set active(active: boolean);
|
|
41
|
+
|
|
42
|
+
get mouseState(): number;
|
|
43
|
+
set mouseState(state: number);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Sets whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsMouseControl.
|
|
47
|
+
*
|
|
48
|
+
* @param {boolean} snapping Whether to enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsMouseControl.
|
|
49
|
+
*/
|
|
50
|
+
set snapping(snapping: boolean);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Gets whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsMouseControl.
|
|
54
|
+
*
|
|
55
|
+
* @returns {boolean} Whether snap-to-vertex and snap-to-edge are enabled for this DistanceMeasurementsMouseControl.
|
|
56
|
+
*/
|
|
57
|
+
get snapping(): boolean;
|
|
58
|
+
|
|
59
|
+
onMousedown(canvasPos: number[]): void;
|
|
60
|
+
onMousemove(canvasPos: number[]): void;
|
|
61
|
+
onMouseup(canvasPos: number[]): void;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Activates this DistanceMeasurementsMouseControl, ready to respond to input.
|
|
65
|
+
*/
|
|
66
|
+
activate(): void;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Deactivates this DistanceMeasurementsMouseControl, making it unresponsive to input.
|
|
70
|
+
*/
|
|
71
|
+
deactivate(): void;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Resets this DistanceMeasurementsMouseControl.
|
|
75
|
+
*/
|
|
76
|
+
reset(): void;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Destroys this DistanceMeasurementsMouseControl.
|
|
80
|
+
*/
|
|
81
|
+
destroy(): void;
|
|
82
|
+
|
|
83
|
+
}
|