@itwin/editor-frontend 3.0.0-dev.163 → 3.0.0-dev.169
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/lib/cjs/ProjectLocation/ProjectGeolocation.d.ts +10 -17
- package/lib/cjs/ProjectLocation/ProjectGeolocation.d.ts.map +1 -1
- package/lib/cjs/ProjectLocation/ProjectGeolocation.js +54 -94
- package/lib/cjs/ProjectLocation/ProjectGeolocation.js.map +1 -1
- package/lib/cjs/SketchTools.d.ts +3 -5
- package/lib/cjs/SketchTools.d.ts.map +1 -1
- package/lib/cjs/SketchTools.js +55 -188
- package/lib/cjs/SketchTools.js.map +1 -1
- package/lib/cjs/SolidModelingTools.d.ts +2 -3
- package/lib/cjs/SolidModelingTools.d.ts.map +1 -1
- package/lib/cjs/SolidModelingTools.js +31 -246
- package/lib/cjs/SolidModelingTools.js.map +1 -1
- package/lib/cjs/TransformElementsTool.d.ts.map +1 -1
- package/lib/cjs/TransformElementsTool.js +8 -28
- package/lib/cjs/TransformElementsTool.js.map +1 -1
- package/lib/esm/ProjectLocation/ProjectGeolocation.d.ts +10 -17
- package/lib/esm/ProjectLocation/ProjectGeolocation.d.ts.map +1 -1
- package/lib/esm/ProjectLocation/ProjectGeolocation.js +54 -94
- package/lib/esm/ProjectLocation/ProjectGeolocation.js.map +1 -1
- package/lib/esm/SketchTools.d.ts +3 -5
- package/lib/esm/SketchTools.d.ts.map +1 -1
- package/lib/esm/SketchTools.js +55 -188
- package/lib/esm/SketchTools.js.map +1 -1
- package/lib/esm/SolidModelingTools.d.ts +2 -3
- package/lib/esm/SolidModelingTools.d.ts.map +1 -1
- package/lib/esm/SolidModelingTools.js +31 -246
- package/lib/esm/SolidModelingTools.js.map +1 -1
- package/lib/esm/TransformElementsTool.d.ts.map +1 -1
- package/lib/esm/TransformElementsTool.js +8 -28
- package/lib/esm/TransformElementsTool.js.map +1 -1
- package/lib/public/locales/en/Editor.json +4 -0
- package/package.json +12 -12
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { BeButtonEvent, CanvasDecoration, DecorateContext, EventHandled, PrimitiveTool, Viewport } from "@itwin/core-frontend";
|
|
5
5
|
import { Point3d, Ray3d, XYAndZ } from "@itwin/core-geometry";
|
|
6
|
-
import { DialogItem, DialogPropertySyncItem } from "@itwin/appui-abstract";
|
|
6
|
+
import { DialogItem, DialogProperty, DialogPropertySyncItem } from "@itwin/appui-abstract";
|
|
7
7
|
/** @internal */
|
|
8
8
|
declare class LabelDecoration implements CanvasDecoration {
|
|
9
9
|
worldLocation: Point3d;
|
|
@@ -37,30 +37,22 @@ export declare class ProjectGeolocationPointTool extends PrimitiveTool {
|
|
|
37
37
|
onCleanup(): Promise<void>;
|
|
38
38
|
onRestartTool(): Promise<void>;
|
|
39
39
|
onUnsuspend(): Promise<void>;
|
|
40
|
-
private
|
|
40
|
+
private _latitudeProperty;
|
|
41
|
+
get latitudeProperty(): DialogProperty<number>;
|
|
41
42
|
get latitude(): number;
|
|
42
43
|
set latitude(value: number);
|
|
43
|
-
private
|
|
44
|
-
|
|
45
|
-
private _getLatitudeDescription;
|
|
46
|
-
private _longitudeValue;
|
|
44
|
+
private _longitudeProperty;
|
|
45
|
+
get longitudeProperty(): DialogProperty<number>;
|
|
47
46
|
get longitude(): number;
|
|
48
47
|
set longitude(value: number);
|
|
49
|
-
private
|
|
50
|
-
|
|
51
|
-
private _getLongitudeDescription;
|
|
52
|
-
private _altitudeValue;
|
|
48
|
+
private _altitudeProperty;
|
|
49
|
+
get altitudeProperty(): DialogProperty<number>;
|
|
53
50
|
get altitude(): number;
|
|
54
51
|
set altitude(value: number);
|
|
55
|
-
private
|
|
56
|
-
|
|
57
|
-
private _getAltitudeDescription;
|
|
58
|
-
private _northValue;
|
|
52
|
+
private _northProperty;
|
|
53
|
+
get northProperty(): DialogProperty<number>;
|
|
59
54
|
get north(): number;
|
|
60
55
|
set north(value: number);
|
|
61
|
-
private static _northName;
|
|
62
|
-
private static _northDescription?;
|
|
63
|
-
private _getNorthDescription;
|
|
64
56
|
private syncToolSettingsCoordinates;
|
|
65
57
|
applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
|
|
66
58
|
supplyToolSettingsProperties(): DialogItem[] | undefined;
|
|
@@ -71,6 +63,7 @@ export declare class ProjectGeolocationPointTool extends PrimitiveTool {
|
|
|
71
63
|
decorate(context: DecorateContext): void;
|
|
72
64
|
onMouseMotion(ev: BeButtonEvent): Promise<void>;
|
|
73
65
|
onResetButtonUp(_ev: BeButtonEvent): Promise<EventHandled>;
|
|
66
|
+
protected acceptDefaultLocation(): void;
|
|
74
67
|
acceptKnownLocation(ev: BeButtonEvent): void;
|
|
75
68
|
acceptCoordinates(): Promise<void>;
|
|
76
69
|
onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectGeolocation.d.ts","sourceRoot":"","sources":["../../../src/ProjectLocation/ProjectGeolocation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA4D,aAAa,EAAE,gBAAgB,EAAa,eAAe,EAAE,YAAY,EAA6C,aAAa,EAAoH,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACjW,OAAO,EAAmB,OAAO,EAAE,KAAK,EAAY,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGzF,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"ProjectGeolocation.d.ts","sourceRoot":"","sources":["../../../src/ProjectLocation/ProjectGeolocation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA4D,aAAa,EAAE,gBAAgB,EAAa,eAAe,EAAE,YAAY,EAA6C,aAAa,EAAoH,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACjW,OAAO,EAAmB,OAAO,EAAE,KAAK,EAAY,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGzF,OAAO,EAAE,UAAU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,EAAE,QAAQ,GAAG,SAAS,EAAE,oBAAoB,EAAE,OAAO,GAAG,OAAO;IACtF,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,cAAc,EAAE,OAAO,GAAG,OAAO;IACrE,sBAAsB,IAAI,OAAO;IAC3B,aAAa;IACb,SAAS;IAClB,aAAa;IACJ,WAAW;IAEjC,SAAS,CAAC,qBAAqB,IAAI,IAAI;IAqBvC,SAAS,CAAC,2BAA2B,IAAI,IAAI;IAe7C,OAAO,CAAC,oBAAoB;YAMd,YAAY;IAeV,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IA4BlC,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAMlF,aAAa,CAAC,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ/C,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAQ1D,gBAAgB,CAAC,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAc1D,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;WAE/B,SAAS;CAC9B"}
|
|
@@ -12,6 +12,7 @@ const core_frontend_1 = require("@itwin/core-frontend");
|
|
|
12
12
|
const core_geometry_1 = require("@itwin/core-geometry");
|
|
13
13
|
const core_common_1 = require("@itwin/core-common");
|
|
14
14
|
const ProjectExtentsDecoration_1 = require("./ProjectExtentsDecoration");
|
|
15
|
+
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
15
16
|
const EditTool_1 = require("../EditTool");
|
|
16
17
|
function translatePrompt(key) { return EditTool_1.EditTools.translate(`ProjectLocation:Prompts.${key}`); }
|
|
17
18
|
function translateMessage(key) { return EditTool_1.EditTools.translate(`ProjectLocation:Message.${key}`); }
|
|
@@ -62,30 +63,6 @@ class ProjectGeolocationPointTool extends core_frontend_1.PrimitiveTool {
|
|
|
62
63
|
this._cartographicFromArgs = false;
|
|
63
64
|
this._accept = false;
|
|
64
65
|
this._scale = 1.0;
|
|
65
|
-
this._latitudeValue = { value: 0.0 };
|
|
66
|
-
this._getLatitudeDescription = () => {
|
|
67
|
-
if (!ProjectGeolocationPointTool._latitudeDescription)
|
|
68
|
-
ProjectGeolocationPointTool._latitudeDescription = new core_frontend_1.AngleDescription(ProjectGeolocationPointTool._latitudeName, translateMessage("Latitude"));
|
|
69
|
-
return ProjectGeolocationPointTool._latitudeDescription;
|
|
70
|
-
};
|
|
71
|
-
this._longitudeValue = { value: 0.0 };
|
|
72
|
-
this._getLongitudeDescription = () => {
|
|
73
|
-
if (!ProjectGeolocationPointTool._longitudeDescription)
|
|
74
|
-
ProjectGeolocationPointTool._longitudeDescription = new core_frontend_1.AngleDescription(ProjectGeolocationPointTool._longitudeName, translateMessage("Longitude"));
|
|
75
|
-
return ProjectGeolocationPointTool._longitudeDescription;
|
|
76
|
-
};
|
|
77
|
-
this._altitudeValue = { value: 0.0 };
|
|
78
|
-
this._getAltitudeDescription = () => {
|
|
79
|
-
if (!ProjectGeolocationPointTool._altitudeDescription)
|
|
80
|
-
ProjectGeolocationPointTool._altitudeDescription = new core_frontend_1.LengthDescription(ProjectGeolocationPointTool._altitudeName, core_frontend_1.CoreTools.translate("Measure.Labels.Altitude"));
|
|
81
|
-
return ProjectGeolocationPointTool._altitudeDescription;
|
|
82
|
-
};
|
|
83
|
-
this._northValue = { value: 0.0 };
|
|
84
|
-
this._getNorthDescription = () => {
|
|
85
|
-
if (!ProjectGeolocationPointTool._northDescription)
|
|
86
|
-
ProjectGeolocationPointTool._northDescription = new core_frontend_1.AngleDescription(ProjectGeolocationPointTool._northName, translateMessage("North"));
|
|
87
|
-
return ProjectGeolocationPointTool._northDescription;
|
|
88
|
-
};
|
|
89
66
|
}
|
|
90
67
|
static get minArgs() { return 0; }
|
|
91
68
|
static get maxArgs() { return 4; } // latitude, longitude, altitude, north direction...
|
|
@@ -96,69 +73,47 @@ class ProjectGeolocationPointTool extends core_frontend_1.PrimitiveTool {
|
|
|
96
73
|
async onCleanup() { await super.onCleanup(); this.unsuspendDecorations(); }
|
|
97
74
|
async onRestartTool() { return this.exitTool(); }
|
|
98
75
|
async onUnsuspend() { this.provideToolAssistance(); }
|
|
99
|
-
get
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
76
|
+
get latitudeProperty() {
|
|
77
|
+
if (!this._latitudeProperty)
|
|
78
|
+
this._latitudeProperty = new appui_abstract_1.DialogProperty(new core_frontend_1.AngleDescription("latitude", translateMessage("Latitude")), 0.0);
|
|
79
|
+
return this._latitudeProperty;
|
|
80
|
+
}
|
|
81
|
+
get latitude() { return this.latitudeProperty.value; }
|
|
82
|
+
set latitude(value) { this.latitudeProperty.value = value; }
|
|
83
|
+
get longitudeProperty() {
|
|
84
|
+
if (!this._longitudeProperty)
|
|
85
|
+
this._longitudeProperty = new appui_abstract_1.DialogProperty(new core_frontend_1.AngleDescription("longitude", translateMessage("Longitude")), 0.0);
|
|
86
|
+
return this._longitudeProperty;
|
|
87
|
+
}
|
|
88
|
+
get longitude() { return this.longitudeProperty.value; }
|
|
89
|
+
set longitude(value) { this.longitudeProperty.value = value; }
|
|
90
|
+
get altitudeProperty() {
|
|
91
|
+
if (!this._altitudeProperty)
|
|
92
|
+
this._altitudeProperty = new appui_abstract_1.DialogProperty(new core_frontend_1.LengthDescription("altitude", core_frontend_1.CoreTools.translate("Measure.Labels.Altitude")), 0.0);
|
|
93
|
+
return this._altitudeProperty;
|
|
94
|
+
}
|
|
95
|
+
get altitude() { return this.altitudeProperty.value; }
|
|
96
|
+
set altitude(value) { this.altitudeProperty.value = value; }
|
|
97
|
+
get northProperty() {
|
|
98
|
+
if (!this._northProperty)
|
|
99
|
+
this._northProperty = new appui_abstract_1.DialogProperty(new core_frontend_1.AngleDescription("north", translateMessage("North")), 0.0);
|
|
100
|
+
return this._northProperty;
|
|
101
|
+
}
|
|
102
|
+
get north() { return this.northProperty.value; }
|
|
103
|
+
set north(value) { this.northProperty.value = value; }
|
|
107
104
|
syncToolSettingsCoordinates() {
|
|
108
|
-
|
|
109
|
-
if (ProjectGeolocationPointTool._latitudeDescription) {
|
|
110
|
-
const newLatitudeDisplayValue = ProjectGeolocationPointTool._latitudeDescription.format(this.latitude);
|
|
111
|
-
const latitudeValue = { value: this.latitude, displayValue: newLatitudeDisplayValue };
|
|
112
|
-
const syncLatitudeItem = { value: latitudeValue, propertyName: ProjectGeolocationPointTool._latitudeName, isDisabled: !this._accept };
|
|
113
|
-
syncData.push(syncLatitudeItem);
|
|
114
|
-
}
|
|
115
|
-
if (ProjectGeolocationPointTool._longitudeDescription) {
|
|
116
|
-
const newLongitudeDisplayValue = ProjectGeolocationPointTool._longitudeDescription.format(this.longitude);
|
|
117
|
-
const longitudeValue = { value: this.longitude, displayValue: newLongitudeDisplayValue };
|
|
118
|
-
const syncLongitudeItem = { value: longitudeValue, propertyName: ProjectGeolocationPointTool._longitudeName, isDisabled: !this._accept };
|
|
119
|
-
syncData.push(syncLongitudeItem);
|
|
120
|
-
}
|
|
121
|
-
if (ProjectGeolocationPointTool._altitudeDescription) {
|
|
122
|
-
const newAltitudeDisplayValue = ProjectGeolocationPointTool._altitudeDescription.format(this.altitude);
|
|
123
|
-
const altitudeValue = { value: this.altitude, displayValue: newAltitudeDisplayValue };
|
|
124
|
-
const syncAltitudeItem = { value: altitudeValue, propertyName: ProjectGeolocationPointTool._altitudeName, isDisabled: !this._accept };
|
|
125
|
-
syncData.push(syncAltitudeItem);
|
|
126
|
-
}
|
|
127
|
-
if (ProjectGeolocationPointTool._northDescription) {
|
|
128
|
-
const newNorthDisplayValue = ProjectGeolocationPointTool._northDescription.format(this.north);
|
|
129
|
-
const northValue = { value: this.north, displayValue: newNorthDisplayValue };
|
|
130
|
-
const syncNorthItem = { value: northValue, propertyName: ProjectGeolocationPointTool._northName, isDisabled: !this._accept };
|
|
131
|
-
syncData.push(syncNorthItem);
|
|
132
|
-
}
|
|
133
|
-
if (0 !== syncData.length)
|
|
134
|
-
this.syncToolSettingsProperties(syncData);
|
|
105
|
+
this.syncToolSettingsProperties([this.latitudeProperty.syncItem, this.longitudeProperty.syncItem, this.altitudeProperty.syncItem, this.northProperty.syncItem]);
|
|
135
106
|
}
|
|
136
107
|
async applyToolSettingPropertyChange(updatedValue) {
|
|
137
|
-
|
|
138
|
-
this.latitude = updatedValue.value.value;
|
|
139
|
-
core_frontend_1.IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, { propertyName: ProjectGeolocationPointTool._latitudeName, value: this._latitudeValue });
|
|
140
|
-
}
|
|
141
|
-
else if (updatedValue.propertyName === ProjectGeolocationPointTool._longitudeName) {
|
|
142
|
-
this.longitude = updatedValue.value.value;
|
|
143
|
-
core_frontend_1.IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, { propertyName: ProjectGeolocationPointTool._longitudeName, value: this._longitudeValue });
|
|
144
|
-
}
|
|
145
|
-
else if (updatedValue.propertyName === ProjectGeolocationPointTool._altitudeName) {
|
|
146
|
-
this.altitude = updatedValue.value.value;
|
|
147
|
-
core_frontend_1.IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, { propertyName: ProjectGeolocationPointTool._altitudeName, value: this._altitudeValue });
|
|
148
|
-
}
|
|
149
|
-
else if (updatedValue.propertyName === ProjectGeolocationPointTool._northName) {
|
|
150
|
-
this.north = updatedValue.value.value;
|
|
151
|
-
core_frontend_1.IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, { propertyName: ProjectGeolocationPointTool._northName, value: this._northValue });
|
|
152
|
-
}
|
|
153
|
-
return true;
|
|
108
|
+
return this.changeToolSettingPropertyValue(updatedValue);
|
|
154
109
|
}
|
|
155
110
|
supplyToolSettingsProperties() {
|
|
156
111
|
this._haveToolSettings = true;
|
|
157
112
|
const toolSettings = new Array();
|
|
158
|
-
toolSettings.push(
|
|
159
|
-
toolSettings.push(
|
|
160
|
-
toolSettings.push(
|
|
161
|
-
toolSettings.push(
|
|
113
|
+
toolSettings.push(this.latitudeProperty.toDialogItem({ rowPriority: 1, columnIndex: 2 }));
|
|
114
|
+
toolSettings.push(this.longitudeProperty.toDialogItem({ rowPriority: 2, columnIndex: 2 }));
|
|
115
|
+
toolSettings.push(this.altitudeProperty.toDialogItem({ rowPriority: 3, columnIndex: 2 }));
|
|
116
|
+
toolSettings.push(this.northProperty.toDialogItem({ rowPriority: 4, columnIndex: 2 }));
|
|
162
117
|
return toolSettings;
|
|
163
118
|
}
|
|
164
119
|
provideToolAssistance() {
|
|
@@ -220,6 +175,13 @@ class ProjectGeolocationPointTool extends core_frontend_1.PrimitiveTool {
|
|
|
220
175
|
await this.onReinitialize(); // Calls onRestartTool to exit...
|
|
221
176
|
return core_frontend_1.EventHandled.No;
|
|
222
177
|
}
|
|
178
|
+
acceptDefaultLocation() {
|
|
179
|
+
// Greenwich is better default when testing control handle w/o tool settings support...
|
|
180
|
+
this.latitude = core_geometry_1.Angle.createDegrees(51.4934).radians;
|
|
181
|
+
this.longitude = core_geometry_1.Angle.createDegrees(0.0098).radians;
|
|
182
|
+
this.altitude = 50.0;
|
|
183
|
+
this.north = 0.0;
|
|
184
|
+
}
|
|
223
185
|
acceptKnownLocation(ev) {
|
|
224
186
|
const deco = ProjectExtentsDecoration_1.ProjectExtentsClipDecoration.get();
|
|
225
187
|
if (undefined === deco)
|
|
@@ -236,11 +198,7 @@ class ProjectGeolocationPointTool extends core_frontend_1.PrimitiveTool {
|
|
|
236
198
|
this.north = deco.getClockwiseAngleToNorth().radians;
|
|
237
199
|
}
|
|
238
200
|
else if (!this._haveToolSettings) {
|
|
239
|
-
|
|
240
|
-
this.latitude = core_geometry_1.Angle.createDegrees(51.4934).radians;
|
|
241
|
-
this.longitude = core_geometry_1.Angle.createDegrees(0.0098).radians;
|
|
242
|
-
this.altitude = 50.0;
|
|
243
|
-
this.north = 0.0;
|
|
201
|
+
this.acceptDefaultLocation();
|
|
244
202
|
}
|
|
245
203
|
}
|
|
246
204
|
this.syncToolSettingsCoordinates();
|
|
@@ -267,7 +225,13 @@ class ProjectGeolocationPointTool extends core_frontend_1.PrimitiveTool {
|
|
|
267
225
|
await this.acceptCoordinates();
|
|
268
226
|
return core_frontend_1.EventHandled.No;
|
|
269
227
|
}
|
|
270
|
-
async onInstall() {
|
|
228
|
+
async onInstall() {
|
|
229
|
+
if (!ProjectExtentsDecoration_1.ProjectExtentsClipDecoration.allowEcefLocationChange(false))
|
|
230
|
+
return false;
|
|
231
|
+
// Setup initial values here instead of supplyToolSettingsProperties to support keyin args w/o appui-react...
|
|
232
|
+
this.initializeToolSettingPropertyValues([this.latitudeProperty, this.longitudeProperty, this.altitudeProperty, this.northProperty]);
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
271
235
|
/** The keyin takes the following arguments, all of which are optional:
|
|
272
236
|
* - `latitude=number` Latitude of accept point in degrees.
|
|
273
237
|
* - `longitude=number` Longitude of accept point in degrees.
|
|
@@ -282,28 +246,28 @@ class ProjectGeolocationPointTool extends core_frontend_1.PrimitiveTool {
|
|
|
282
246
|
if (parts[0].toLowerCase().startsWith("la")) {
|
|
283
247
|
const latitude = Number.parseFloat(parts[1]);
|
|
284
248
|
if (!Number.isNaN(latitude)) {
|
|
285
|
-
this.
|
|
249
|
+
this.saveToolSettingPropertyValue(this.latitudeProperty, { value: core_geometry_1.Angle.createDegrees(latitude).radians });
|
|
286
250
|
this._cartographicFromArgs = true;
|
|
287
251
|
}
|
|
288
252
|
}
|
|
289
253
|
else if (parts[0].toLowerCase().startsWith("lo")) {
|
|
290
254
|
const longitude = Number.parseFloat(parts[1]);
|
|
291
255
|
if (!Number.isNaN(longitude)) {
|
|
292
|
-
this.
|
|
256
|
+
this.saveToolSettingPropertyValue(this.longitudeProperty, { value: core_geometry_1.Angle.createDegrees(longitude).radians });
|
|
293
257
|
this._cartographicFromArgs = true;
|
|
294
258
|
}
|
|
295
259
|
}
|
|
296
260
|
else if (parts[0].toLowerCase().startsWith("al")) {
|
|
297
261
|
const altitude = Number.parseFloat(parts[1]);
|
|
298
262
|
if (!Number.isNaN(altitude)) {
|
|
299
|
-
this.
|
|
263
|
+
this.saveToolSettingPropertyValue(this.altitudeProperty, { value: altitude });
|
|
300
264
|
this._cartographicFromArgs = true;
|
|
301
265
|
}
|
|
302
266
|
}
|
|
303
267
|
else if (parts[0].toLowerCase().startsWith("no")) {
|
|
304
268
|
const north = Number.parseFloat(parts[1]);
|
|
305
269
|
if (!Number.isNaN(north)) {
|
|
306
|
-
this.
|
|
270
|
+
this.saveToolSettingPropertyValue(this.northProperty, { value: core_geometry_1.Angle.createDegrees(north).radians });
|
|
307
271
|
this._cartographicFromArgs = true;
|
|
308
272
|
}
|
|
309
273
|
}
|
|
@@ -315,10 +279,6 @@ class ProjectGeolocationPointTool extends core_frontend_1.PrimitiveTool {
|
|
|
315
279
|
exports.ProjectGeolocationPointTool = ProjectGeolocationPointTool;
|
|
316
280
|
ProjectGeolocationPointTool.toolId = "ProjectLocation.Geolocation.Point";
|
|
317
281
|
ProjectGeolocationPointTool.iconSpec = "icon-globe"; // <== Tool button should use whatever icon you have here...
|
|
318
|
-
ProjectGeolocationPointTool._latitudeName = "latitude";
|
|
319
|
-
ProjectGeolocationPointTool._longitudeName = "longitude";
|
|
320
|
-
ProjectGeolocationPointTool._altitudeName = "altitude";
|
|
321
|
-
ProjectGeolocationPointTool._northName = "north";
|
|
322
282
|
/** Change or update geolocation direction to true north.
|
|
323
283
|
* @beta
|
|
324
284
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectGeolocation.js","sourceRoot":"","sources":["../../../src/ProjectLocation/ProjectGeolocation.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAiW;AACjW,wDAAyF;AACzF,oDAAwE;AACxE,yEAA0E;AAE1E,0CAAwC;AAExC,SAAS,eA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C,SAAS,KAAuB,OAAO,uDAA4B,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEnH,MAAM,CAAC,KAAK,CAAC,SAAS,KAAK,OAAO,IAAI,0BAA0B,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;;AAzIpF,gEA0IC;AAzIwB,iCAAM,GAAG,kCAAkC,CAAC;AAC5C,mCAAQ,GAAG,WAAW,CAAC,CAAC,4DAA4D","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Editing\r\n */\r\n\r\nimport { AccuDrawHintBuilder, AccuDrawShortcuts, AngleDescription, BeButtonEvent, CanvasDecoration, CoreTools, DecorateContext, EventHandled, GraphicType, IModelApp, LengthDescription, PrimitiveTool, ToolAssistance, ToolAssistanceImage, ToolAssistanceInputMethod, ToolAssistanceInstruction, ToolAssistanceSection, Viewport } from \"@itwin/core-frontend\";\r\nimport { Angle, Matrix3d, Point3d, Ray3d, Vector3d, XYAndZ } from \"@itwin/core-geometry\";\r\nimport { Cartographic, ColorDef, LinePixels } from \"@itwin/core-common\";\r\nimport { ProjectExtentsClipDecoration } from \"./ProjectExtentsDecoration\";\r\nimport { DialogItem, DialogItemValue, DialogPropertySyncItem, PropertyDescription } from \"@itwin/appui-abstract\";\r\nimport { EditTools } from \"../EditTool\";\r\n\r\nfunction translatePrompt(key: string) { return EditTools.translate(`ProjectLocation:Prompts.${key}`); }\r\nfunction translateMessage(key: string) { return EditTools.translate(`ProjectLocation:Message.${key}`); }\r\n\r\n/** @internal */\r\nclass LabelDecoration implements CanvasDecoration {\r\n public worldLocation = new Point3d();\r\n public position = new Point3d();\r\n public label: string;\r\n\r\n constructor(worldLocation: XYAndZ, label: string) {\r\n this.worldLocation.setFrom(worldLocation);\r\n this.label = label;\r\n }\r\n\r\n public drawDecoration(ctx: CanvasRenderingContext2D): void {\r\n ctx.font = \"16px san-serif\";\r\n const labelHeight = ctx.measureText(\"M\").width; // Close enough for border padding...\r\n const labelWidth = ctx.measureText(this.label).width + labelHeight;\r\n\r\n ctx.lineWidth = 1;\r\n ctx.strokeStyle = \"white\";\r\n ctx.fillStyle = \"rgba(0,0,0,.4)\";\r\n ctx.shadowColor = \"black\";\r\n ctx.shadowBlur = 10;\r\n ctx.fillRect(-(labelWidth / 2), -labelHeight, labelWidth, labelHeight * 2);\r\n ctx.strokeRect(-(labelWidth / 2), -labelHeight, labelWidth, labelHeight * 2);\r\n\r\n ctx.fillStyle = \"white\";\r\n ctx.shadowBlur = 0;\r\n ctx.textAlign = \"center\";\r\n ctx.textBaseline = \"middle\";\r\n ctx.fillText(this.label, 0, 0);\r\n }\r\n\r\n public setPosition(vp: Viewport): boolean {\r\n vp.worldToView(this.worldLocation, this.position);\r\n this.position.y -= Math.floor(vp.pixelsFromInches(0.45)) + 0.5; // Offset from world location...\r\n return vp.viewRect.containsPoint(this.position);\r\n }\r\n\r\n public addDecoration(context: DecorateContext) {\r\n if (this.setPosition(context.viewport))\r\n context.addCanvasDecoration(this);\r\n }\r\n}\r\n\r\n/** Change or update geolocation for project.\r\n * To show tool settings for specifying lat/long, make sure formatting and parsing data are cached before the tool starts\r\n * by calling QuantityFormatter.onInitialized at app startup.\r\n * @beta\r\n */\r\nexport class ProjectGeolocationPointTool extends PrimitiveTool {\r\n public static override toolId = \"ProjectLocation.Geolocation.Point\";\r\n public static override iconSpec = \"icon-globe\"; // <== Tool button should use whatever icon you have here...\r\n\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 4; } // latitude, longitude, altitude, north direction...\r\n\r\n protected _haveToolSettings = false;\r\n protected _cartographicFromArgs = false;\r\n\r\n protected _accept = false;\r\n protected _scale = 1.0;\r\n protected _origin?: Point3d;\r\n protected _labelDeco?: LabelDecoration;\r\n\r\n public override isCompatibleViewport(vp: Viewport | undefined, isSelectedViewChange: boolean): boolean { return (super.isCompatibleViewport(vp, isSelectedViewChange) && undefined !== vp && vp.view.isSpatialView()); }\r\n public override isValidLocation(_ev: BeButtonEvent, _isButtonEvent: boolean): boolean { return true; } // Allow snapping to terrain, etc. outside project extents...\r\n public override requireWriteableTarget(): boolean { return false; } // Tool doesn't modify the imodel...\r\n public override async onPostInstall() { await super.onPostInstall(); this.setupAndPromptForNextAction(); }\r\n public override async onCleanup() { await super.onCleanup(); this.unsuspendDecorations(); }\r\n public async onRestartTool() { return this.exitTool(); }\r\n public override async onUnsuspend() { this.provideToolAssistance(); }\r\n\r\n private _latitudeValue: DialogItemValue = { value: 0.0 };\r\n public get latitude(): number { return this._latitudeValue.value as number; }\r\n public set latitude(value: number) { this._latitudeValue.value = value; }\r\n private static _latitudeName = \"latitude\";\r\n private static _latitudeDescription?: AngleDescription;\r\n private _getLatitudeDescription = (): PropertyDescription => {\r\n if (!ProjectGeolocationPointTool._latitudeDescription)\r\n ProjectGeolocationPointTool._latitudeDescription = new AngleDescription(ProjectGeolocationPointTool._latitudeName, translateMessage(\"Latitude\"));\r\n return ProjectGeolocationPointTool._latitudeDescription;\r\n };\r\n\r\n private _longitudeValue: DialogItemValue = { value: 0.0 };\r\n public get longitude(): number { return this._longitudeValue.value as number; }\r\n public set longitude(value: number) { this._longitudeValue.value = value; }\r\n private static _longitudeName = \"longitude\";\r\n private static _longitudeDescription?: AngleDescription;\r\n private _getLongitudeDescription = (): PropertyDescription => {\r\n if (!ProjectGeolocationPointTool._longitudeDescription)\r\n ProjectGeolocationPointTool._longitudeDescription = new AngleDescription(ProjectGeolocationPointTool._longitudeName, translateMessage(\"Longitude\"));\r\n return ProjectGeolocationPointTool._longitudeDescription;\r\n };\r\n\r\n private _altitudeValue: DialogItemValue = { value: 0.0 };\r\n public get altitude(): number { return this._altitudeValue.value as number; }\r\n public set altitude(value: number) { this._altitudeValue.value = value; }\r\n private static _altitudeName = \"altitude\";\r\n private static _altitudeDescription?: LengthDescription;\r\n private _getAltitudeDescription = (): PropertyDescription => {\r\n if (!ProjectGeolocationPointTool._altitudeDescription)\r\n ProjectGeolocationPointTool._altitudeDescription = new LengthDescription(ProjectGeolocationPointTool._altitudeName, CoreTools.translate(\"Measure.Labels.Altitude\"));\r\n return ProjectGeolocationPointTool._altitudeDescription;\r\n };\r\n\r\n private _northValue: DialogItemValue = { value: 0.0 };\r\n public get north(): number { return this._northValue.value as number; }\r\n public set north(value: number) { this._northValue.value = value; }\r\n private static _northName = \"north\";\r\n private static _northDescription?: AngleDescription;\r\n private _getNorthDescription = (): PropertyDescription => {\r\n if (!ProjectGeolocationPointTool._northDescription)\r\n ProjectGeolocationPointTool._northDescription = new AngleDescription(ProjectGeolocationPointTool._northName, translateMessage(\"North\"));\r\n return ProjectGeolocationPointTool._northDescription;\r\n };\r\n\r\n private syncToolSettingsCoordinates(): void {\r\n const syncData: DialogPropertySyncItem[] = []; // NOTE: Check that formatted quantity descriptions are defined, i.e. abstract ui for tool settings is implemented...\r\n\r\n if (ProjectGeolocationPointTool._latitudeDescription) {\r\n const newLatitudeDisplayValue = ProjectGeolocationPointTool._latitudeDescription.format(this.latitude);\r\n const latitudeValue: DialogItemValue = { value: this.latitude, displayValue: newLatitudeDisplayValue };\r\n const syncLatitudeItem: DialogPropertySyncItem = { value: latitudeValue, propertyName: ProjectGeolocationPointTool._latitudeName, isDisabled: !this._accept };\r\n syncData.push(syncLatitudeItem);\r\n }\r\n\r\n if (ProjectGeolocationPointTool._longitudeDescription) {\r\n const newLongitudeDisplayValue = ProjectGeolocationPointTool._longitudeDescription.format(this.longitude);\r\n const longitudeValue: DialogItemValue = { value: this.longitude, displayValue: newLongitudeDisplayValue };\r\n const syncLongitudeItem: DialogPropertySyncItem = { value: longitudeValue, propertyName: ProjectGeolocationPointTool._longitudeName, isDisabled: !this._accept };\r\n syncData.push(syncLongitudeItem);\r\n }\r\n\r\n if (ProjectGeolocationPointTool._altitudeDescription) {\r\n const newAltitudeDisplayValue = ProjectGeolocationPointTool._altitudeDescription.format(this.altitude);\r\n const altitudeValue: DialogItemValue = { value: this.altitude, displayValue: newAltitudeDisplayValue };\r\n const syncAltitudeItem: DialogPropertySyncItem = { value: altitudeValue, propertyName: ProjectGeolocationPointTool._altitudeName, isDisabled: !this._accept };\r\n syncData.push(syncAltitudeItem);\r\n }\r\n\r\n if (ProjectGeolocationPointTool._northDescription) {\r\n const newNorthDisplayValue = ProjectGeolocationPointTool._northDescription.format(this.north);\r\n const northValue: DialogItemValue = { value: this.north, displayValue: newNorthDisplayValue };\r\n const syncNorthItem: DialogPropertySyncItem = { value: northValue, propertyName: ProjectGeolocationPointTool._northName, isDisabled: !this._accept };\r\n syncData.push(syncNorthItem);\r\n }\r\n\r\n if (0 !== syncData.length)\r\n this.syncToolSettingsProperties(syncData);\r\n }\r\n\r\n public override async applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean> {\r\n if (updatedValue.propertyName === ProjectGeolocationPointTool._latitudeName) {\r\n this.latitude = updatedValue.value.value as number;\r\n IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, { propertyName: ProjectGeolocationPointTool._latitudeName, value: this._latitudeValue });\r\n } else if (updatedValue.propertyName === ProjectGeolocationPointTool._longitudeName) {\r\n this.longitude = updatedValue.value.value as number;\r\n IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, { propertyName: ProjectGeolocationPointTool._longitudeName, value: this._longitudeValue });\r\n } else if (updatedValue.propertyName === ProjectGeolocationPointTool._altitudeName) {\r\n this.altitude = updatedValue.value.value as number;\r\n IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, { propertyName: ProjectGeolocationPointTool._altitudeName, value: this._altitudeValue });\r\n } else if (updatedValue.propertyName === ProjectGeolocationPointTool._northName) {\r\n this.north = updatedValue.value.value as number;\r\n IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, { propertyName: ProjectGeolocationPointTool._northName, value: this._northValue });\r\n }\r\n return true;\r\n }\r\n\r\n public override supplyToolSettingsProperties(): DialogItem[] | undefined {\r\n this._haveToolSettings = true;\r\n const toolSettings = new Array<DialogItem>();\r\n toolSettings.push({ value: this._latitudeValue, property: this._getLatitudeDescription(), isDisabled: true, editorPosition: { rowPriority: 1, columnIndex: 2 } });\r\n toolSettings.push({ value: this._longitudeValue, property: this._getLongitudeDescription(), isDisabled: true, editorPosition: { rowPriority: 2, columnIndex: 2 } });\r\n toolSettings.push({ value: this._altitudeValue, property: this._getAltitudeDescription(), isDisabled: true, editorPosition: { rowPriority: 3, columnIndex: 2 } });\r\n toolSettings.push({ value: this._northValue, property: this._getNorthDescription(), isDisabled: true, editorPosition: { rowPriority: 4, columnIndex: 2 } });\r\n return toolSettings;\r\n }\r\n\r\n protected provideToolAssistance(): void {\r\n const acceptMsg = CoreTools.translate(undefined === this._origin ? \"ElementSet.Inputs.AcceptPoint\" : \"ElementSet.Inputs.Accept\");\r\n const rejectMsg = CoreTools.translate(\"ElementSet.Inputs.Cancel\");\r\n const mainInstruction = ToolAssistance.createInstruction(this.iconSpec, translatePrompt(undefined === this._origin ? \"IdentifyKnownLocation\" : \"ConfirmCoordinates\"));\r\n const sections: ToolAssistanceSection[] = [];\r\n\r\n const mouseInstructions: ToolAssistanceInstruction[] = [];\r\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.LeftClick, acceptMsg, false, ToolAssistanceInputMethod.Mouse));\r\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.RightClick, rejectMsg, false, ToolAssistanceInputMethod.Mouse));\r\n sections.push(ToolAssistance.createSection(mouseInstructions, ToolAssistance.inputsLabel));\r\n\r\n const touchInstructions: ToolAssistanceInstruction[] = [];\r\n if (!ToolAssistance.createTouchCursorInstructions(touchInstructions))\r\n touchInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.OneTouchTap, acceptMsg, false, ToolAssistanceInputMethod.Touch));\r\n touchInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.TwoTouchTap, rejectMsg, false, ToolAssistanceInputMethod.Touch));\r\n sections.push(ToolAssistance.createSection(touchInstructions, ToolAssistance.inputsLabel));\r\n\r\n const instructions = ToolAssistance.createInstructions(mainInstruction, sections);\r\n IModelApp.notifications.setToolAssistance(instructions);\r\n }\r\n\r\n protected setupAndPromptForNextAction(): void {\r\n IModelApp.accuSnap.enableSnap(undefined === this._origin);\r\n this.provideToolAssistance();\r\n }\r\n\r\n private pulseDecoration() {\r\n if (!this._accept)\r\n return;\r\n\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n this._scale += 0.1;\r\n if (this._scale > 1.6)\r\n this._scale = 1.0;\r\n\r\n deco.viewport.invalidateDecorations();\r\n setTimeout(() => { this.pulseDecoration(); }, 100);\r\n }\r\n\r\n private unsuspendDecorations() {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined !== deco)\r\n deco.suspendGeolocationDecorations = false;\r\n }\r\n\r\n public override decorate(context: DecorateContext): void {\r\n if (undefined === this._origin || !context.viewport.view.isSpatialView())\r\n return;\r\n\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n deco.suspendGeolocationDecorations = true;\r\n deco.drawMonumentPoint(context, this._origin, this._scale);\r\n\r\n if (undefined !== this._labelDeco)\r\n this._labelDeco.addDecoration(context);\r\n }\r\n\r\n public override async onMouseMotion(ev: BeButtonEvent): Promise<void> {\r\n if (undefined === ev.viewport || this._accept)\r\n return;\r\n\r\n this._origin = ev.point.clone();\r\n ev.viewport.invalidateDecorations();\r\n }\r\n\r\n public override async onResetButtonUp(_ev: BeButtonEvent): Promise<EventHandled> {\r\n await this.onReinitialize(); // Calls onRestartTool to exit...\r\n return EventHandled.No;\r\n }\r\n\r\n public acceptKnownLocation(ev: BeButtonEvent): void {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n this._accept = true; // Require explicit accept to give user a chance to change values...\r\n this._origin = ev.point.clone();\r\n this._labelDeco = new LabelDecoration(this._origin, translatePrompt(\"SpecifyCoordinates\"));\r\n\r\n if (!this._cartographicFromArgs) {\r\n if (this.iModel.isGeoLocated) {\r\n const cartographic = this.iModel.spatialToCartographicFromEcef(this._origin);\r\n this.latitude = cartographic.latitude;\r\n this.longitude = cartographic.longitude;\r\n this.altitude = cartographic.height;\r\n this.north = deco.getClockwiseAngleToNorth().radians;\r\n } else if (!this._haveToolSettings) {\r\n // Greenwich is better default when testing control handle w/o tool settings support...\r\n this.latitude = Angle.createDegrees(51.4934).radians;\r\n this.longitude = Angle.createDegrees(0.0098).radians;\r\n this.altitude = 50.0;\r\n this.north = 0.0;\r\n }\r\n }\r\n\r\n this.syncToolSettingsCoordinates();\r\n this.pulseDecoration(); // Pulse to indicate that we are waiting for user input...\r\n this.setupAndPromptForNextAction();\r\n }\r\n\r\n public async acceptCoordinates(): Promise<void> {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n const origin = Cartographic.fromRadians({longitude: this.longitude, latitude: this.latitude, height: this.altitude});\r\n if (!deco.updateEcefLocation(origin, this._origin, Angle.createRadians(this.north)))\r\n return;\r\n\r\n return this.onReinitialize(); // Calls onRestartTool to exit...\r\n }\r\n\r\n public override async onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled> {\r\n if (undefined === ev.viewport)\r\n return EventHandled.No; // Shouldn't really happen...\r\n\r\n const haveKnownLocation = this._accept;\r\n if (!haveKnownLocation)\r\n this.acceptKnownLocation(ev);\r\n\r\n const needAcceptPoint = !haveKnownLocation && this._haveToolSettings;\r\n if (!needAcceptPoint)\r\n await this.acceptCoordinates();\r\n\r\n return EventHandled.No;\r\n }\r\n\r\n public override async onInstall(): Promise<boolean> { return ProjectExtentsClipDecoration.allowEcefLocationChange(false); }\r\n\r\n /** The keyin takes the following arguments, all of which are optional:\r\n * - `latitude=number` Latitude of accept point in degrees.\r\n * - `longitude=number` Longitude of accept point in degrees.\r\n * - `altitude=number` Height above ellipsoid of accept point.\r\n * - `north=number` North direction in degrees of accept point.\r\n */\r\n public override async parseAndRun(...inputArgs: string[]): Promise<boolean> {\r\n for (const arg of inputArgs) {\r\n const parts = arg.split(\"=\");\r\n if (2 !== parts.length)\r\n continue;\r\n\r\n if (parts[0].toLowerCase().startsWith(\"la\")) {\r\n const latitude = Number.parseFloat(parts[1]);\r\n if (!Number.isNaN(latitude)) {\r\n this.latitude = Angle.createDegrees(latitude).radians;\r\n this._cartographicFromArgs = true;\r\n }\r\n } else if (parts[0].toLowerCase().startsWith(\"lo\")) {\r\n const longitude = Number.parseFloat(parts[1]);\r\n if (!Number.isNaN(longitude)) {\r\n this.longitude = Angle.createDegrees(longitude).radians;\r\n this._cartographicFromArgs = true;\r\n }\r\n } else if (parts[0].toLowerCase().startsWith(\"al\")) {\r\n const altitude = Number.parseFloat(parts[1]);\r\n if (!Number.isNaN(altitude)) {\r\n this.altitude = altitude;\r\n this._cartographicFromArgs = true;\r\n }\r\n } else if (parts[0].toLowerCase().startsWith(\"no\")) {\r\n const north = Number.parseFloat(parts[1]);\r\n if (!Number.isNaN(north)) {\r\n this.north = Angle.createDegrees(north).radians;\r\n this._cartographicFromArgs = true;\r\n }\r\n }\r\n }\r\n\r\n return this.run();\r\n }\r\n\r\n public static async startTool(): Promise<boolean> { return new ProjectGeolocationPointTool().run(); }\r\n}\r\n\r\n/** Change or update geolocation direction to true north.\r\n * @beta\r\n */\r\nexport class ProjectGeolocationNorthTool extends PrimitiveTool {\r\n public static override toolId = \"ProjectLocation.Geolocation.North\";\r\n public static override iconSpec = \"icon-sort-up\"; // <== Tool button should use whatever icon you have here...\r\n protected _origin?: Point3d;\r\n protected _northDir?: Ray3d;\r\n\r\n public override isCompatibleViewport(vp: Viewport | undefined, isSelectedViewChange: boolean): boolean { return (super.isCompatibleViewport(vp, isSelectedViewChange) && undefined !== vp && vp.view.isSpatialView()); }\r\n public override isValidLocation(_ev: BeButtonEvent, _isButtonEvent: boolean): boolean { return true; } // Allow snapping to terrain, etc. outside project extents...\r\n public override requireWriteableTarget(): boolean { return false; } // Tool doesn't modify the imodel...\r\n public override async onPostInstall() { await super.onPostInstall(); this.setupAndPromptForNextAction(); }\r\n public override async onCleanup() { await super.onCleanup(); this.unsuspendDecorations(); }\r\n public async onRestartTool() { return this.exitTool(); }\r\n public override async onUnsuspend() { this.provideToolAssistance(); }\r\n\r\n protected provideToolAssistance(): void {\r\n const acceptMsg = CoreTools.translate(\"ElementSet.Inputs.AcceptPoint\");\r\n const rejectMsg = CoreTools.translate(\"ElementSet.Inputs.Cancel\");\r\n const mainInstruction = ToolAssistance.createInstruction(this.iconSpec, translatePrompt(undefined === this._origin ? \"IdentifyRefPoint\" : \"DefineAngle\"));\r\n const sections: ToolAssistanceSection[] = [];\r\n\r\n const mouseInstructions: ToolAssistanceInstruction[] = [];\r\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.LeftClick, acceptMsg, false, ToolAssistanceInputMethod.Mouse));\r\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.RightClick, rejectMsg, false, ToolAssistanceInputMethod.Mouse));\r\n sections.push(ToolAssistance.createSection(mouseInstructions, ToolAssistance.inputsLabel));\r\n\r\n const touchInstructions: ToolAssistanceInstruction[] = [];\r\n if (!ToolAssistance.createTouchCursorInstructions(touchInstructions))\r\n touchInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.OneTouchTap, acceptMsg, false, ToolAssistanceInputMethod.Touch));\r\n touchInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.TwoTouchTap, rejectMsg, false, ToolAssistanceInputMethod.Touch));\r\n sections.push(ToolAssistance.createSection(touchInstructions, ToolAssistance.inputsLabel));\r\n\r\n const instructions = ToolAssistance.createInstructions(mainInstruction, sections);\r\n IModelApp.notifications.setToolAssistance(instructions);\r\n }\r\n\r\n protected setupAndPromptForNextAction(): void {\r\n IModelApp.accuSnap.enableSnap(true);\r\n this.provideToolAssistance();\r\n\r\n if (undefined === this._origin)\r\n return;\r\n\r\n const hints = new AccuDrawHintBuilder();\r\n hints.setRotation(Matrix3d.createIdentity());\r\n hints.setOrigin(this._origin);\r\n hints.setModePolar();\r\n hints.setOriginFixed = true;\r\n hints.setLockZ = true;\r\n hints.sendHints();\r\n }\r\n\r\n private getAdjustedPoint(ev: BeButtonEvent): Point3d | undefined {\r\n if (undefined === this._origin)\r\n return undefined;\r\n return AccuDrawHintBuilder.projectPointToPlaneInView(ev.point, this._origin, Vector3d.unitZ(), ev.viewport!, true);\r\n }\r\n\r\n private unsuspendDecorations() {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined !== deco)\r\n deco.suspendGeolocationDecorations = false;\r\n }\r\n\r\n private updateNorthVector(ev: BeButtonEvent): void {\r\n if (undefined === ev.viewport)\r\n return;\r\n\r\n if (undefined === this._northDir)\r\n this._northDir = Ray3d.create(ev.point, Vector3d.unitY());\r\n else\r\n this._northDir.origin.setFrom(undefined !== this._origin ? this._origin : ev.point);\r\n\r\n const dirPt = this.getAdjustedPoint(ev);\r\n if (undefined === dirPt)\r\n return;\r\n\r\n this._northDir.direction.setStartEnd(this._northDir.origin, dirPt);\r\n if (this._northDir.direction.magnitude() < 1.0e-6)\r\n this._northDir.direction.setFrom(Vector3d.unitY());\r\n\r\n this._northDir.direction.z = 0.0;\r\n this._northDir.direction.normalizeInPlace();\r\n }\r\n\r\n public override decorate(context: DecorateContext): void {\r\n if (undefined === this._northDir || !context.viewport.view.isSpatialView())\r\n return;\r\n\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n deco.suspendGeolocationDecorations = true;\r\n deco.drawNorthArrow(context, this._northDir);\r\n }\r\n\r\n public override async onKeyTransition(wentDown: boolean, keyEvent: KeyboardEvent): Promise<EventHandled> {\r\n if (EventHandled.Yes === await super.onKeyTransition(wentDown, keyEvent))\r\n return EventHandled.Yes;\r\n return (wentDown && await AccuDrawShortcuts.processShortcutKey(keyEvent)) ? EventHandled.Yes : EventHandled.No;\r\n }\r\n\r\n public override async onMouseMotion(ev: BeButtonEvent): Promise<void> {\r\n if (undefined === ev.viewport)\r\n return;\r\n\r\n this.updateNorthVector(ev);\r\n ev.viewport.invalidateDecorations();\r\n }\r\n\r\n public override async onResetButtonUp(_ev: BeButtonEvent): Promise<EventHandled> {\r\n await this.onReinitialize(); // Calls onRestartTool to exit...\r\n return EventHandled.No;\r\n }\r\n\r\n public override async onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled> {\r\n if (undefined === ev.viewport)\r\n return EventHandled.No; // Shouldn't really happen...\r\n\r\n if (undefined === this._origin) {\r\n this._origin = ev.point.clone();\r\n this.setupAndPromptForNextAction();\r\n return EventHandled.No;\r\n }\r\n\r\n this.updateNorthVector(ev);\r\n\r\n if (undefined !== this._northDir) {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined !== deco)\r\n deco.updateNorthDirection(this._northDir);\r\n }\r\n\r\n await this.onReinitialize(); // Calls onRestartTool to exit...\r\n return EventHandled.No;\r\n }\r\n\r\n public override async onInstall(): Promise<boolean> { return ProjectExtentsClipDecoration.allowEcefLocationChange(true); }\r\n\r\n public static async startTool() { return new ProjectGeolocationNorthTool().run(); }\r\n}\r\n\r\n/** Move a geolocated model by specifying two points to define the offset.\r\n * @beta\r\n */\r\nexport class ProjectGeolocationMoveTool extends PrimitiveTool {\r\n public static override toolId = \"ProjectLocation.Geolocation.Move\";\r\n public static override iconSpec = \"icon-move\"; // <== Tool button should use whatever icon you have here...\r\n protected _origin?: Point3d;\r\n protected _current?: Point3d;\r\n\r\n public override isCompatibleViewport(vp: Viewport | undefined, isSelectedViewChange: boolean): boolean { return (super.isCompatibleViewport(vp, isSelectedViewChange) && undefined !== vp && vp.view.isSpatialView()); }\r\n public override isValidLocation(_ev: BeButtonEvent, _isButtonEvent: boolean): boolean { return true; } // Allow snapping to terrain, etc. outside project extents...\r\n public override requireWriteableTarget(): boolean { return false; } // Tool doesn't modify the imodel...\r\n public override async onPostInstall() { await super.onPostInstall(); this.setupAndPromptForNextAction(); }\r\n public override async onCleanup() { await super.onCleanup(); this.unsuspendDecorations(); }\r\n public async onRestartTool() { const tool = new ProjectGeolocationMoveTool(); if (!await tool.run()) return this.exitTool(); }\r\n public override async onUnsuspend() { this.provideToolAssistance(); }\r\n\r\n protected provideToolAssistance(): void {\r\n const acceptMsg = CoreTools.translate(\"ElementSet.Inputs.AcceptPoint\");\r\n const rejectMsg = CoreTools.translate(\"ElementSet.Inputs.Cancel\");\r\n const mainInstruction = ToolAssistance.createInstruction(this.iconSpec, translatePrompt(undefined === this._origin ? \"IdentifyRefPoint\" : \"DefineOffset\"));\r\n const sections: ToolAssistanceSection[] = [];\r\n\r\n const mouseInstructions: ToolAssistanceInstruction[] = [];\r\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.LeftClick, acceptMsg, false, ToolAssistanceInputMethod.Mouse));\r\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.RightClick, rejectMsg, false, ToolAssistanceInputMethod.Mouse));\r\n sections.push(ToolAssistance.createSection(mouseInstructions, ToolAssistance.inputsLabel));\r\n\r\n const touchInstructions: ToolAssistanceInstruction[] = [];\r\n if (!ToolAssistance.createTouchCursorInstructions(touchInstructions))\r\n touchInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.OneTouchTap, acceptMsg, false, ToolAssistanceInputMethod.Touch));\r\n touchInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.TwoTouchTap, rejectMsg, false, ToolAssistanceInputMethod.Touch));\r\n sections.push(ToolAssistance.createSection(touchInstructions, ToolAssistance.inputsLabel));\r\n\r\n const instructions = ToolAssistance.createInstructions(mainInstruction, sections);\r\n IModelApp.notifications.setToolAssistance(instructions);\r\n }\r\n\r\n protected setupAndPromptForNextAction(): void {\r\n IModelApp.accuSnap.enableSnap(true);\r\n this.provideToolAssistance();\r\n\r\n if (undefined === this._origin)\r\n return;\r\n\r\n const hints = new AccuDrawHintBuilder();\r\n hints.setRotation(Matrix3d.createIdentity());\r\n hints.setOrigin(this._origin);\r\n hints.setModePolar();\r\n hints.setOriginFixed = true;\r\n hints.sendHints();\r\n }\r\n\r\n private unsuspendDecorations() {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined !== deco)\r\n deco.suspendGeolocationDecorations = false;\r\n }\r\n\r\n private async acceptOffset(ev: BeButtonEvent): Promise<void> {\r\n if (undefined === ev.viewport || undefined === this._origin)\r\n return;\r\n\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n const origin = this.iModel.spatialToCartographicFromEcef(ev.point);\r\n if (!deco.updateEcefLocation(origin, this._origin))\r\n return;\r\n\r\n return this.onReinitialize(); // Calls onRestartTool to exit...\r\n }\r\n\r\n public override decorate(context: DecorateContext): void {\r\n if (undefined === this._origin || undefined === this._current || !context.viewport.view.isSpatialView())\r\n return;\r\n\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n const builderAccVis = context.createGraphicBuilder(GraphicType.WorldDecoration);\r\n const builderAccHid = context.createGraphicBuilder(GraphicType.WorldOverlay);\r\n const colorAccVis = ColorDef.white.adjustedForContrast(context.viewport.view.backgroundColor);\r\n const colorAccHid = colorAccVis.withAlpha(100);\r\n\r\n builderAccVis.setSymbology(colorAccVis, ColorDef.black, 3);\r\n builderAccHid.setSymbology(colorAccHid, ColorDef.black, 1, LinePixels.Code2);\r\n\r\n const extents = this.iModel.projectExtents.cloneTranslated(Vector3d.createStartEnd(this._origin, this._current));\r\n\r\n builderAccVis.addRangeBox(extents);\r\n builderAccHid.addRangeBox(extents);\r\n builderAccHid.addLineString([this._origin, this._current]);\r\n\r\n context.addDecorationFromBuilder(builderAccVis);\r\n context.addDecorationFromBuilder(builderAccHid);\r\n\r\n deco.suspendGeolocationDecorations = true;\r\n }\r\n\r\n public override async onKeyTransition(wentDown: boolean, keyEvent: KeyboardEvent): Promise<EventHandled> {\r\n if (EventHandled.Yes === await super.onKeyTransition(wentDown, keyEvent))\r\n return EventHandled.Yes;\r\n return (wentDown && await AccuDrawShortcuts.processShortcutKey(keyEvent)) ? EventHandled.Yes : EventHandled.No;\r\n }\r\n\r\n public override async onMouseMotion(ev: BeButtonEvent): Promise<void> {\r\n if (undefined === ev.viewport)\r\n return;\r\n\r\n this._current = ev.point;\r\n ev.viewport.invalidateDecorations();\r\n }\r\n\r\n public override async onResetButtonUp(_ev: BeButtonEvent): Promise<EventHandled> {\r\n if (undefined === this._origin)\r\n await this.exitTool(); // exit to select tool if we haven't gotten first point...\r\n else\r\n await this.onReinitialize(); // Calls onRestartTool...\r\n return EventHandled.No;\r\n }\r\n\r\n public override async onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled> {\r\n if (undefined === ev.viewport)\r\n return EventHandled.No; // Shouldn't really happen...\r\n\r\n if (undefined === this._origin) {\r\n this._origin = ev.point.clone();\r\n this.setupAndPromptForNextAction();\r\n return EventHandled.No;\r\n }\r\n\r\n await this.acceptOffset(ev);\r\n return EventHandled.No;\r\n }\r\n\r\n public override async onInstall(): Promise<boolean> { return ProjectExtentsClipDecoration.allowEcefLocationChange(true); }\r\n\r\n public static async startTool() { return new ProjectGeolocationMoveTool().run(); }\r\n}\r\n\r\n"]}
|
|
1
|
+
{"version":3,"file":"ProjectGeolocation.js","sourceRoot":"","sources":["../../../src/ProjectLocation/ProjectGeolocation.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAiW;AACjW,wDAAyF;AACzF,oDAAwE;AACxE,yEAA0E;AAC1E,0DAA2F;AAC3F,0CAAwC;AAExC,SAAS,eAAe,CAAC,GAAW,IAAI,OAAO,oBAAS,CAAC,SAAS,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AACvG,SAAS,gBAAgB,CAAC,GAAW,IAAI,OAAO,o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I,SAAS,KAAK,EAAE,CAAC,QAAQ;YAC3B,OAAO,4BAAY,CAAC,EAAE,CAAC,CAAC,6BAA6B;QAEvD,IAAI,SAAS,KAAK,IAAI,CAAC,OAAO,EAAE;YAC9B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,CAAC,2BAA2B,EAAE,CAAC;YACnC,OAAO,4BAAY,CAAC,EAAE,CAAC;SACxB;QAED,MAAM,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC5B,OAAO,4BAAY,CAAC,EAAE,CAAC;IACzB,CAAC;IAEe,KAAK,CAAC,SAAS,KAAuB,OAAO,uDAA4B,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEnH,MAAM,CAAC,KAAK,CAAC,SAAS,KAAK,OAAO,IAAI,0BAA0B,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;;AAzIpF,gEA0IC;AAzIwB,iCAAM,GAAG,kCAAkC,CAAC;AAC5C,mCAAQ,GAAG,WAAW,CAAC,CAAC,4DAA4D","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Editing\r\n */\r\n\r\nimport { AccuDrawHintBuilder, AccuDrawShortcuts, AngleDescription, BeButtonEvent, CanvasDecoration, CoreTools, DecorateContext, EventHandled, GraphicType, IModelApp, LengthDescription, PrimitiveTool, ToolAssistance, ToolAssistanceImage, ToolAssistanceInputMethod, ToolAssistanceInstruction, ToolAssistanceSection, Viewport } from \"@itwin/core-frontend\";\r\nimport { Angle, Matrix3d, Point3d, Ray3d, Vector3d, XYAndZ } from \"@itwin/core-geometry\";\r\nimport { Cartographic, ColorDef, LinePixels } from \"@itwin/core-common\";\r\nimport { ProjectExtentsClipDecoration } from \"./ProjectExtentsDecoration\";\r\nimport { DialogItem, DialogProperty, DialogPropertySyncItem } from \"@itwin/appui-abstract\";\r\nimport { EditTools } from \"../EditTool\";\r\n\r\nfunction translatePrompt(key: string) { return EditTools.translate(`ProjectLocation:Prompts.${key}`); }\r\nfunction translateMessage(key: string) { return EditTools.translate(`ProjectLocation:Message.${key}`); }\r\n\r\n/** @internal */\r\nclass LabelDecoration implements CanvasDecoration {\r\n public worldLocation = new Point3d();\r\n public position = new Point3d();\r\n public label: string;\r\n\r\n constructor(worldLocation: XYAndZ, label: string) {\r\n this.worldLocation.setFrom(worldLocation);\r\n this.label = label;\r\n }\r\n\r\n public drawDecoration(ctx: CanvasRenderingContext2D): void {\r\n ctx.font = \"16px san-serif\";\r\n const labelHeight = ctx.measureText(\"M\").width; // Close enough for border padding...\r\n const labelWidth = ctx.measureText(this.label).width + labelHeight;\r\n\r\n ctx.lineWidth = 1;\r\n ctx.strokeStyle = \"white\";\r\n ctx.fillStyle = \"rgba(0,0,0,.4)\";\r\n ctx.shadowColor = \"black\";\r\n ctx.shadowBlur = 10;\r\n ctx.fillRect(-(labelWidth / 2), -labelHeight, labelWidth, labelHeight * 2);\r\n ctx.strokeRect(-(labelWidth / 2), -labelHeight, labelWidth, labelHeight * 2);\r\n\r\n ctx.fillStyle = \"white\";\r\n ctx.shadowBlur = 0;\r\n ctx.textAlign = \"center\";\r\n ctx.textBaseline = \"middle\";\r\n ctx.fillText(this.label, 0, 0);\r\n }\r\n\r\n public setPosition(vp: Viewport): boolean {\r\n vp.worldToView(this.worldLocation, this.position);\r\n this.position.y -= Math.floor(vp.pixelsFromInches(0.45)) + 0.5; // Offset from world location...\r\n return vp.viewRect.containsPoint(this.position);\r\n }\r\n\r\n public addDecoration(context: DecorateContext) {\r\n if (this.setPosition(context.viewport))\r\n context.addCanvasDecoration(this);\r\n }\r\n}\r\n\r\n/** Change or update geolocation for project.\r\n * To show tool settings for specifying lat/long, make sure formatting and parsing data are cached before the tool starts\r\n * by calling QuantityFormatter.onInitialized at app startup.\r\n * @beta\r\n */\r\nexport class ProjectGeolocationPointTool extends PrimitiveTool {\r\n public static override toolId = \"ProjectLocation.Geolocation.Point\";\r\n public static override iconSpec = \"icon-globe\"; // <== Tool button should use whatever icon you have here...\r\n\r\n public static override get minArgs() { return 0; }\r\n public static override get maxArgs() { return 4; } // latitude, longitude, altitude, north direction...\r\n\r\n protected _haveToolSettings = false;\r\n protected _cartographicFromArgs = false;\r\n\r\n protected _accept = false;\r\n protected _scale = 1.0;\r\n protected _origin?: Point3d;\r\n protected _labelDeco?: LabelDecoration;\r\n\r\n public override isCompatibleViewport(vp: Viewport | undefined, isSelectedViewChange: boolean): boolean { return (super.isCompatibleViewport(vp, isSelectedViewChange) && undefined !== vp && vp.view.isSpatialView()); }\r\n public override isValidLocation(_ev: BeButtonEvent, _isButtonEvent: boolean): boolean { return true; } // Allow snapping to terrain, etc. outside project extents...\r\n public override requireWriteableTarget(): boolean { return false; } // Tool doesn't modify the imodel...\r\n public override async onPostInstall() { await super.onPostInstall(); this.setupAndPromptForNextAction(); }\r\n public override async onCleanup() { await super.onCleanup(); this.unsuspendDecorations(); }\r\n public async onRestartTool() { return this.exitTool(); }\r\n public override async onUnsuspend() { this.provideToolAssistance(); }\r\n\r\n private _latitudeProperty: DialogProperty<number> | undefined;\r\n public get latitudeProperty() {\r\n if (!this._latitudeProperty)\r\n this._latitudeProperty = new DialogProperty<number>(new AngleDescription(\"latitude\", translateMessage(\"Latitude\")), 0.0);\r\n return this._latitudeProperty;\r\n }\r\n\r\n public get latitude(): number { return this.latitudeProperty.value; }\r\n public set latitude(value: number) { this.latitudeProperty.value = value; }\r\n\r\n private _longitudeProperty: DialogProperty<number> | undefined;\r\n public get longitudeProperty() {\r\n if (!this._longitudeProperty)\r\n this._longitudeProperty = new DialogProperty<number>(new AngleDescription(\"longitude\", translateMessage(\"Longitude\")), 0.0);\r\n return this._longitudeProperty;\r\n }\r\n\r\n public get longitude(): number { return this.longitudeProperty.value; }\r\n public set longitude(value: number) { this.longitudeProperty.value = value; }\r\n\r\n private _altitudeProperty: DialogProperty<number> | undefined;\r\n public get altitudeProperty() {\r\n if (!this._altitudeProperty)\r\n this._altitudeProperty = new DialogProperty<number>(new LengthDescription(\"altitude\", CoreTools.translate(\"Measure.Labels.Altitude\")), 0.0);\r\n return this._altitudeProperty;\r\n }\r\n\r\n public get altitude(): number { return this.altitudeProperty.value; }\r\n public set altitude(value: number) { this.altitudeProperty.value = value; }\r\n\r\n private _northProperty: DialogProperty<number> | undefined;\r\n public get northProperty() {\r\n if (!this._northProperty)\r\n this._northProperty = new DialogProperty<number>(new AngleDescription(\"north\", translateMessage(\"North\")), 0.0);\r\n return this._northProperty;\r\n }\r\n\r\n public get north(): number { return this.northProperty.value; }\r\n public set north(value: number) { this.northProperty.value = value; }\r\n\r\n private syncToolSettingsCoordinates(): void {\r\n this.syncToolSettingsProperties([this.latitudeProperty.syncItem, this.longitudeProperty.syncItem, this.altitudeProperty.syncItem, this.northProperty.syncItem]);\r\n }\r\n\r\n public override async applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean> {\r\n return this.changeToolSettingPropertyValue(updatedValue);\r\n }\r\n\r\n public override supplyToolSettingsProperties(): DialogItem[] | undefined {\r\n this._haveToolSettings = true;\r\n const toolSettings = new Array<DialogItem>();\r\n toolSettings.push(this.latitudeProperty.toDialogItem({ rowPriority: 1, columnIndex: 2 }));\r\n toolSettings.push(this.longitudeProperty.toDialogItem({ rowPriority: 2, columnIndex: 2 }));\r\n toolSettings.push(this.altitudeProperty.toDialogItem({ rowPriority: 3, columnIndex: 2 }));\r\n toolSettings.push(this.northProperty.toDialogItem({ rowPriority: 4, columnIndex: 2 }));\r\n return toolSettings;\r\n }\r\n\r\n protected provideToolAssistance(): void {\r\n const acceptMsg = CoreTools.translate(undefined === this._origin ? \"ElementSet.Inputs.AcceptPoint\" : \"ElementSet.Inputs.Accept\");\r\n const rejectMsg = CoreTools.translate(\"ElementSet.Inputs.Cancel\");\r\n const mainInstruction = ToolAssistance.createInstruction(this.iconSpec, translatePrompt(undefined === this._origin ? \"IdentifyKnownLocation\" : \"ConfirmCoordinates\"));\r\n const sections: ToolAssistanceSection[] = [];\r\n\r\n const mouseInstructions: ToolAssistanceInstruction[] = [];\r\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.LeftClick, acceptMsg, false, ToolAssistanceInputMethod.Mouse));\r\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.RightClick, rejectMsg, false, ToolAssistanceInputMethod.Mouse));\r\n sections.push(ToolAssistance.createSection(mouseInstructions, ToolAssistance.inputsLabel));\r\n\r\n const touchInstructions: ToolAssistanceInstruction[] = [];\r\n if (!ToolAssistance.createTouchCursorInstructions(touchInstructions))\r\n touchInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.OneTouchTap, acceptMsg, false, ToolAssistanceInputMethod.Touch));\r\n touchInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.TwoTouchTap, rejectMsg, false, ToolAssistanceInputMethod.Touch));\r\n sections.push(ToolAssistance.createSection(touchInstructions, ToolAssistance.inputsLabel));\r\n\r\n const instructions = ToolAssistance.createInstructions(mainInstruction, sections);\r\n IModelApp.notifications.setToolAssistance(instructions);\r\n }\r\n\r\n protected setupAndPromptForNextAction(): void {\r\n IModelApp.accuSnap.enableSnap(undefined === this._origin);\r\n this.provideToolAssistance();\r\n }\r\n\r\n private pulseDecoration() {\r\n if (!this._accept)\r\n return;\r\n\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n this._scale += 0.1;\r\n if (this._scale > 1.6)\r\n this._scale = 1.0;\r\n\r\n deco.viewport.invalidateDecorations();\r\n setTimeout(() => { this.pulseDecoration(); }, 100);\r\n }\r\n\r\n private unsuspendDecorations() {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined !== deco)\r\n deco.suspendGeolocationDecorations = false;\r\n }\r\n\r\n public override decorate(context: DecorateContext): void {\r\n if (undefined === this._origin || !context.viewport.view.isSpatialView())\r\n return;\r\n\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n deco.suspendGeolocationDecorations = true;\r\n deco.drawMonumentPoint(context, this._origin, this._scale);\r\n\r\n if (undefined !== this._labelDeco)\r\n this._labelDeco.addDecoration(context);\r\n }\r\n\r\n public override async onMouseMotion(ev: BeButtonEvent): Promise<void> {\r\n if (undefined === ev.viewport || this._accept)\r\n return;\r\n\r\n this._origin = ev.point.clone();\r\n ev.viewport.invalidateDecorations();\r\n }\r\n\r\n public override async onResetButtonUp(_ev: BeButtonEvent): Promise<EventHandled> {\r\n await this.onReinitialize(); // Calls onRestartTool to exit...\r\n return EventHandled.No;\r\n }\r\n\r\n protected acceptDefaultLocation(): void {\r\n // Greenwich is better default when testing control handle w/o tool settings support...\r\n this.latitude = Angle.createDegrees(51.4934).radians;\r\n this.longitude = Angle.createDegrees(0.0098).radians;\r\n this.altitude = 50.0;\r\n this.north = 0.0;\r\n }\r\n\r\n public acceptKnownLocation(ev: BeButtonEvent): void {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n this._accept = true; // Require explicit accept to give user a chance to change values...\r\n this._origin = ev.point.clone();\r\n this._labelDeco = new LabelDecoration(this._origin, translatePrompt(\"SpecifyCoordinates\"));\r\n\r\n if (!this._cartographicFromArgs) {\r\n if (this.iModel.isGeoLocated) {\r\n const cartographic = this.iModel.spatialToCartographicFromEcef(this._origin);\r\n this.latitude = cartographic.latitude;\r\n this.longitude = cartographic.longitude;\r\n this.altitude = cartographic.height;\r\n this.north = deco.getClockwiseAngleToNorth().radians;\r\n } else if (!this._haveToolSettings) {\r\n this.acceptDefaultLocation();\r\n }\r\n }\r\n\r\n this.syncToolSettingsCoordinates();\r\n this.pulseDecoration(); // Pulse to indicate that we are waiting for user input...\r\n this.setupAndPromptForNextAction();\r\n }\r\n\r\n public async acceptCoordinates(): Promise<void> {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n const origin = Cartographic.fromRadians({longitude: this.longitude, latitude: this.latitude, height: this.altitude});\r\n if (!deco.updateEcefLocation(origin, this._origin, Angle.createRadians(this.north)))\r\n return;\r\n\r\n return this.onReinitialize(); // Calls onRestartTool to exit...\r\n }\r\n\r\n public override async onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled> {\r\n if (undefined === ev.viewport)\r\n return EventHandled.No; // Shouldn't really happen...\r\n\r\n const haveKnownLocation = this._accept;\r\n if (!haveKnownLocation)\r\n this.acceptKnownLocation(ev);\r\n\r\n const needAcceptPoint = !haveKnownLocation && this._haveToolSettings;\r\n if (!needAcceptPoint)\r\n await this.acceptCoordinates();\r\n\r\n return EventHandled.No;\r\n }\r\n\r\n public override async onInstall(): Promise<boolean> {\r\n if (!ProjectExtentsClipDecoration.allowEcefLocationChange(false))\r\n return false;\r\n\r\n // Setup initial values here instead of supplyToolSettingsProperties to support keyin args w/o appui-react...\r\n this.initializeToolSettingPropertyValues([this.latitudeProperty, this.longitudeProperty, this.altitudeProperty, this.northProperty]);\r\n\r\n return true;\r\n }\r\n\r\n /** The keyin takes the following arguments, all of which are optional:\r\n * - `latitude=number` Latitude of accept point in degrees.\r\n * - `longitude=number` Longitude of accept point in degrees.\r\n * - `altitude=number` Height above ellipsoid of accept point.\r\n * - `north=number` North direction in degrees of accept point.\r\n */\r\n public override async parseAndRun(...inputArgs: string[]): Promise<boolean> {\r\n for (const arg of inputArgs) {\r\n const parts = arg.split(\"=\");\r\n if (2 !== parts.length)\r\n continue;\r\n\r\n if (parts[0].toLowerCase().startsWith(\"la\")) {\r\n const latitude = Number.parseFloat(parts[1]);\r\n if (!Number.isNaN(latitude)) {\r\n this.saveToolSettingPropertyValue(this.latitudeProperty, { value: Angle.createDegrees(latitude).radians });\r\n this._cartographicFromArgs = true;\r\n }\r\n } else if (parts[0].toLowerCase().startsWith(\"lo\")) {\r\n const longitude = Number.parseFloat(parts[1]);\r\n if (!Number.isNaN(longitude)) {\r\n this.saveToolSettingPropertyValue(this.longitudeProperty, { value: Angle.createDegrees(longitude).radians });\r\n this._cartographicFromArgs = true;\r\n }\r\n } else if (parts[0].toLowerCase().startsWith(\"al\")) {\r\n const altitude = Number.parseFloat(parts[1]);\r\n if (!Number.isNaN(altitude)) {\r\n this.saveToolSettingPropertyValue(this.altitudeProperty, { value: altitude });\r\n this._cartographicFromArgs = true;\r\n }\r\n } else if (parts[0].toLowerCase().startsWith(\"no\")) {\r\n const north = Number.parseFloat(parts[1]);\r\n if (!Number.isNaN(north)) {\r\n this.saveToolSettingPropertyValue(this.northProperty, { value: Angle.createDegrees(north).radians });\r\n this._cartographicFromArgs = true;\r\n }\r\n }\r\n }\r\n\r\n return this.run();\r\n }\r\n\r\n public static async startTool(): Promise<boolean> { return new ProjectGeolocationPointTool().run(); }\r\n}\r\n\r\n/** Change or update geolocation direction to true north.\r\n * @beta\r\n */\r\nexport class ProjectGeolocationNorthTool extends PrimitiveTool {\r\n public static override toolId = \"ProjectLocation.Geolocation.North\";\r\n public static override iconSpec = \"icon-sort-up\"; // <== Tool button should use whatever icon you have here...\r\n protected _origin?: Point3d;\r\n protected _northDir?: Ray3d;\r\n\r\n public override isCompatibleViewport(vp: Viewport | undefined, isSelectedViewChange: boolean): boolean { return (super.isCompatibleViewport(vp, isSelectedViewChange) && undefined !== vp && vp.view.isSpatialView()); }\r\n public override isValidLocation(_ev: BeButtonEvent, _isButtonEvent: boolean): boolean { return true; } // Allow snapping to terrain, etc. outside project extents...\r\n public override requireWriteableTarget(): boolean { return false; } // Tool doesn't modify the imodel...\r\n public override async onPostInstall() { await super.onPostInstall(); this.setupAndPromptForNextAction(); }\r\n public override async onCleanup() { await super.onCleanup(); this.unsuspendDecorations(); }\r\n public async onRestartTool() { return this.exitTool(); }\r\n public override async onUnsuspend() { this.provideToolAssistance(); }\r\n\r\n protected provideToolAssistance(): void {\r\n const acceptMsg = CoreTools.translate(\"ElementSet.Inputs.AcceptPoint\");\r\n const rejectMsg = CoreTools.translate(\"ElementSet.Inputs.Cancel\");\r\n const mainInstruction = ToolAssistance.createInstruction(this.iconSpec, translatePrompt(undefined === this._origin ? \"IdentifyRefPoint\" : \"DefineAngle\"));\r\n const sections: ToolAssistanceSection[] = [];\r\n\r\n const mouseInstructions: ToolAssistanceInstruction[] = [];\r\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.LeftClick, acceptMsg, false, ToolAssistanceInputMethod.Mouse));\r\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.RightClick, rejectMsg, false, ToolAssistanceInputMethod.Mouse));\r\n sections.push(ToolAssistance.createSection(mouseInstructions, ToolAssistance.inputsLabel));\r\n\r\n const touchInstructions: ToolAssistanceInstruction[] = [];\r\n if (!ToolAssistance.createTouchCursorInstructions(touchInstructions))\r\n touchInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.OneTouchTap, acceptMsg, false, ToolAssistanceInputMethod.Touch));\r\n touchInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.TwoTouchTap, rejectMsg, false, ToolAssistanceInputMethod.Touch));\r\n sections.push(ToolAssistance.createSection(touchInstructions, ToolAssistance.inputsLabel));\r\n\r\n const instructions = ToolAssistance.createInstructions(mainInstruction, sections);\r\n IModelApp.notifications.setToolAssistance(instructions);\r\n }\r\n\r\n protected setupAndPromptForNextAction(): void {\r\n IModelApp.accuSnap.enableSnap(true);\r\n this.provideToolAssistance();\r\n\r\n if (undefined === this._origin)\r\n return;\r\n\r\n const hints = new AccuDrawHintBuilder();\r\n hints.setRotation(Matrix3d.createIdentity());\r\n hints.setOrigin(this._origin);\r\n hints.setModePolar();\r\n hints.setOriginFixed = true;\r\n hints.setLockZ = true;\r\n hints.sendHints();\r\n }\r\n\r\n private getAdjustedPoint(ev: BeButtonEvent): Point3d | undefined {\r\n if (undefined === this._origin)\r\n return undefined;\r\n return AccuDrawHintBuilder.projectPointToPlaneInView(ev.point, this._origin, Vector3d.unitZ(), ev.viewport!, true);\r\n }\r\n\r\n private unsuspendDecorations() {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined !== deco)\r\n deco.suspendGeolocationDecorations = false;\r\n }\r\n\r\n private updateNorthVector(ev: BeButtonEvent): void {\r\n if (undefined === ev.viewport)\r\n return;\r\n\r\n if (undefined === this._northDir)\r\n this._northDir = Ray3d.create(ev.point, Vector3d.unitY());\r\n else\r\n this._northDir.origin.setFrom(undefined !== this._origin ? this._origin : ev.point);\r\n\r\n const dirPt = this.getAdjustedPoint(ev);\r\n if (undefined === dirPt)\r\n return;\r\n\r\n this._northDir.direction.setStartEnd(this._northDir.origin, dirPt);\r\n if (this._northDir.direction.magnitude() < 1.0e-6)\r\n this._northDir.direction.setFrom(Vector3d.unitY());\r\n\r\n this._northDir.direction.z = 0.0;\r\n this._northDir.direction.normalizeInPlace();\r\n }\r\n\r\n public override decorate(context: DecorateContext): void {\r\n if (undefined === this._northDir || !context.viewport.view.isSpatialView())\r\n return;\r\n\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n deco.suspendGeolocationDecorations = true;\r\n deco.drawNorthArrow(context, this._northDir);\r\n }\r\n\r\n public override async onKeyTransition(wentDown: boolean, keyEvent: KeyboardEvent): Promise<EventHandled> {\r\n if (EventHandled.Yes === await super.onKeyTransition(wentDown, keyEvent))\r\n return EventHandled.Yes;\r\n return (wentDown && await AccuDrawShortcuts.processShortcutKey(keyEvent)) ? EventHandled.Yes : EventHandled.No;\r\n }\r\n\r\n public override async onMouseMotion(ev: BeButtonEvent): Promise<void> {\r\n if (undefined === ev.viewport)\r\n return;\r\n\r\n this.updateNorthVector(ev);\r\n ev.viewport.invalidateDecorations();\r\n }\r\n\r\n public override async onResetButtonUp(_ev: BeButtonEvent): Promise<EventHandled> {\r\n await this.onReinitialize(); // Calls onRestartTool to exit...\r\n return EventHandled.No;\r\n }\r\n\r\n public override async onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled> {\r\n if (undefined === ev.viewport)\r\n return EventHandled.No; // Shouldn't really happen...\r\n\r\n if (undefined === this._origin) {\r\n this._origin = ev.point.clone();\r\n this.setupAndPromptForNextAction();\r\n return EventHandled.No;\r\n }\r\n\r\n this.updateNorthVector(ev);\r\n\r\n if (undefined !== this._northDir) {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined !== deco)\r\n deco.updateNorthDirection(this._northDir);\r\n }\r\n\r\n await this.onReinitialize(); // Calls onRestartTool to exit...\r\n return EventHandled.No;\r\n }\r\n\r\n public override async onInstall(): Promise<boolean> { return ProjectExtentsClipDecoration.allowEcefLocationChange(true); }\r\n\r\n public static async startTool() { return new ProjectGeolocationNorthTool().run(); }\r\n}\r\n\r\n/** Move a geolocated model by specifying two points to define the offset.\r\n * @beta\r\n */\r\nexport class ProjectGeolocationMoveTool extends PrimitiveTool {\r\n public static override toolId = \"ProjectLocation.Geolocation.Move\";\r\n public static override iconSpec = \"icon-move\"; // <== Tool button should use whatever icon you have here...\r\n protected _origin?: Point3d;\r\n protected _current?: Point3d;\r\n\r\n public override isCompatibleViewport(vp: Viewport | undefined, isSelectedViewChange: boolean): boolean { return (super.isCompatibleViewport(vp, isSelectedViewChange) && undefined !== vp && vp.view.isSpatialView()); }\r\n public override isValidLocation(_ev: BeButtonEvent, _isButtonEvent: boolean): boolean { return true; } // Allow snapping to terrain, etc. outside project extents...\r\n public override requireWriteableTarget(): boolean { return false; } // Tool doesn't modify the imodel...\r\n public override async onPostInstall() { await super.onPostInstall(); this.setupAndPromptForNextAction(); }\r\n public override async onCleanup() { await super.onCleanup(); this.unsuspendDecorations(); }\r\n public async onRestartTool() { const tool = new ProjectGeolocationMoveTool(); if (!await tool.run()) return this.exitTool(); }\r\n public override async onUnsuspend() { this.provideToolAssistance(); }\r\n\r\n protected provideToolAssistance(): void {\r\n const acceptMsg = CoreTools.translate(\"ElementSet.Inputs.AcceptPoint\");\r\n const rejectMsg = CoreTools.translate(\"ElementSet.Inputs.Cancel\");\r\n const mainInstruction = ToolAssistance.createInstruction(this.iconSpec, translatePrompt(undefined === this._origin ? \"IdentifyRefPoint\" : \"DefineOffset\"));\r\n const sections: ToolAssistanceSection[] = [];\r\n\r\n const mouseInstructions: ToolAssistanceInstruction[] = [];\r\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.LeftClick, acceptMsg, false, ToolAssistanceInputMethod.Mouse));\r\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.RightClick, rejectMsg, false, ToolAssistanceInputMethod.Mouse));\r\n sections.push(ToolAssistance.createSection(mouseInstructions, ToolAssistance.inputsLabel));\r\n\r\n const touchInstructions: ToolAssistanceInstruction[] = [];\r\n if (!ToolAssistance.createTouchCursorInstructions(touchInstructions))\r\n touchInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.OneTouchTap, acceptMsg, false, ToolAssistanceInputMethod.Touch));\r\n touchInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.TwoTouchTap, rejectMsg, false, ToolAssistanceInputMethod.Touch));\r\n sections.push(ToolAssistance.createSection(touchInstructions, ToolAssistance.inputsLabel));\r\n\r\n const instructions = ToolAssistance.createInstructions(mainInstruction, sections);\r\n IModelApp.notifications.setToolAssistance(instructions);\r\n }\r\n\r\n protected setupAndPromptForNextAction(): void {\r\n IModelApp.accuSnap.enableSnap(true);\r\n this.provideToolAssistance();\r\n\r\n if (undefined === this._origin)\r\n return;\r\n\r\n const hints = new AccuDrawHintBuilder();\r\n hints.setRotation(Matrix3d.createIdentity());\r\n hints.setOrigin(this._origin);\r\n hints.setModePolar();\r\n hints.setOriginFixed = true;\r\n hints.sendHints();\r\n }\r\n\r\n private unsuspendDecorations() {\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined !== deco)\r\n deco.suspendGeolocationDecorations = false;\r\n }\r\n\r\n private async acceptOffset(ev: BeButtonEvent): Promise<void> {\r\n if (undefined === ev.viewport || undefined === this._origin)\r\n return;\r\n\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n const origin = this.iModel.spatialToCartographicFromEcef(ev.point);\r\n if (!deco.updateEcefLocation(origin, this._origin))\r\n return;\r\n\r\n return this.onReinitialize(); // Calls onRestartTool to exit...\r\n }\r\n\r\n public override decorate(context: DecorateContext): void {\r\n if (undefined === this._origin || undefined === this._current || !context.viewport.view.isSpatialView())\r\n return;\r\n\r\n const deco = ProjectExtentsClipDecoration.get();\r\n if (undefined === deco)\r\n return;\r\n\r\n const builderAccVis = context.createGraphicBuilder(GraphicType.WorldDecoration);\r\n const builderAccHid = context.createGraphicBuilder(GraphicType.WorldOverlay);\r\n const colorAccVis = ColorDef.white.adjustedForContrast(context.viewport.view.backgroundColor);\r\n const colorAccHid = colorAccVis.withAlpha(100);\r\n\r\n builderAccVis.setSymbology(colorAccVis, ColorDef.black, 3);\r\n builderAccHid.setSymbology(colorAccHid, ColorDef.black, 1, LinePixels.Code2);\r\n\r\n const extents = this.iModel.projectExtents.cloneTranslated(Vector3d.createStartEnd(this._origin, this._current));\r\n\r\n builderAccVis.addRangeBox(extents);\r\n builderAccHid.addRangeBox(extents);\r\n builderAccHid.addLineString([this._origin, this._current]);\r\n\r\n context.addDecorationFromBuilder(builderAccVis);\r\n context.addDecorationFromBuilder(builderAccHid);\r\n\r\n deco.suspendGeolocationDecorations = true;\r\n }\r\n\r\n public override async onKeyTransition(wentDown: boolean, keyEvent: KeyboardEvent): Promise<EventHandled> {\r\n if (EventHandled.Yes === await super.onKeyTransition(wentDown, keyEvent))\r\n return EventHandled.Yes;\r\n return (wentDown && await AccuDrawShortcuts.processShortcutKey(keyEvent)) ? EventHandled.Yes : EventHandled.No;\r\n }\r\n\r\n public override async onMouseMotion(ev: BeButtonEvent): Promise<void> {\r\n if (undefined === ev.viewport)\r\n return;\r\n\r\n this._current = ev.point;\r\n ev.viewport.invalidateDecorations();\r\n }\r\n\r\n public override async onResetButtonUp(_ev: BeButtonEvent): Promise<EventHandled> {\r\n if (undefined === this._origin)\r\n await this.exitTool(); // exit to select tool if we haven't gotten first point...\r\n else\r\n await this.onReinitialize(); // Calls onRestartTool...\r\n return EventHandled.No;\r\n }\r\n\r\n public override async onDataButtonDown(ev: BeButtonEvent): Promise<EventHandled> {\r\n if (undefined === ev.viewport)\r\n return EventHandled.No; // Shouldn't really happen...\r\n\r\n if (undefined === this._origin) {\r\n this._origin = ev.point.clone();\r\n this.setupAndPromptForNextAction();\r\n return EventHandled.No;\r\n }\r\n\r\n await this.acceptOffset(ev);\r\n return EventHandled.No;\r\n }\r\n\r\n public override async onInstall(): Promise<boolean> { return ProjectExtentsClipDecoration.allowEcefLocationChange(true); }\r\n\r\n public static async startTool() { return new ProjectGeolocationMoveTool().run(); }\r\n}\r\n\r\n"]}
|
package/lib/cjs/SketchTools.d.ts
CHANGED
|
@@ -159,8 +159,7 @@ export declare class CreateArcTool extends CreateOrContinuePathTool {
|
|
|
159
159
|
protected createConstructionCurve(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
|
|
160
160
|
protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
|
|
161
161
|
private syncToolSettingsRadiusAndSweep;
|
|
162
|
-
|
|
163
|
-
private syncSweepState;
|
|
162
|
+
protected getToolSettingPropertyLocked(property: DialogProperty<any>): DialogProperty<any> | undefined;
|
|
164
163
|
applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
|
|
165
164
|
supplyToolSettingsProperties(): DialogItem[] | undefined;
|
|
166
165
|
onRestartTool(): Promise<void>;
|
|
@@ -205,7 +204,7 @@ export declare class CreateCircleTool extends CreateOrContinuePathTool {
|
|
|
205
204
|
protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
|
|
206
205
|
protected cancelPoint(_ev: BeButtonEvent): Promise<boolean>;
|
|
207
206
|
private syncToolSettingsRadius;
|
|
208
|
-
|
|
207
|
+
protected getToolSettingPropertyLocked(property: DialogProperty<any>): DialogProperty<any> | undefined;
|
|
209
208
|
applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
|
|
210
209
|
supplyToolSettingsProperties(): DialogItem[] | undefined;
|
|
211
210
|
onRestartTool(): Promise<void>;
|
|
@@ -252,7 +251,7 @@ export declare class CreateRectangleTool extends CreateOrContinuePathTool {
|
|
|
252
251
|
protected get createCurvePhase(): CreateCurvePhase;
|
|
253
252
|
protected createNewCurvePrimitive(ev: BeButtonEvent, isDynamics: boolean): CurvePrimitive | undefined;
|
|
254
253
|
protected createNewPath(placement: PlacementProps): JsonGeometryStream | FlatBufferGeometryStream | undefined;
|
|
255
|
-
|
|
254
|
+
protected getToolSettingPropertyLocked(property: DialogProperty<any>): DialogProperty<any> | undefined;
|
|
256
255
|
applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
|
|
257
256
|
supplyToolSettingsProperties(): DialogItem[] | undefined;
|
|
258
257
|
onRestartTool(): Promise<void>;
|
|
@@ -303,7 +302,6 @@ export declare class CreateBCurveTool extends CreateOrContinuePathTool {
|
|
|
303
302
|
protected getSnapGeometry(): GeometryQuery | undefined;
|
|
304
303
|
protected acceptPoint(ev: BeButtonEvent): Promise<boolean>;
|
|
305
304
|
protected cancelPoint(ev: BeButtonEvent): Promise<boolean>;
|
|
306
|
-
private syncOrderState;
|
|
307
305
|
applyToolSettingPropertyChange(updatedValue: DialogPropertySyncItem): Promise<boolean>;
|
|
308
306
|
supplyToolSettingsProperties(): DialogItem[] | undefined;
|
|
309
307
|
onRestartTool(): Promise<void>;
|