@itwin/map-layers-formats 4.7.0-dev.0 → 4.7.0-dev.10
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/CHANGELOG.md +10 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/EsriSymbology.js.map +1 -1
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/cjs/Feature/DefaultMarkerIcon.js +9 -9
- package/lib/cjs/Feature/DefaultMarkerIcon.js.map +1 -1
- package/lib/cjs/Feature/FeatureCanvasRenderer.js.map +1 -1
- package/lib/cjs/Feature/FeatureInfoReader.js.map +1 -1
- package/lib/cjs/Feature/FeatureSymbology.js.map +1 -1
- package/lib/cjs/Feature/RandomMapColor.js.map +1 -1
- package/lib/cjs/GeoJSON/GeoJSONGeometry.js.map +1 -1
- package/lib/cjs/GeoJSON/GeoJSONGeometryReader.js.map +1 -1
- package/lib/cjs/Icons/MapInfoIcon.js.map +1 -1
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -1
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -1
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -1
- package/lib/cjs/Tools/GeometryTerrainDraper.d.ts +20 -0
- package/lib/cjs/Tools/GeometryTerrainDraper.d.ts.map +1 -0
- package/lib/cjs/Tools/GeometryTerrainDraper.js +153 -0
- package/lib/cjs/Tools/GeometryTerrainDraper.js.map +1 -0
- package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts +15 -10
- package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts.map +1 -1
- package/lib/cjs/Tools/MapFeatureInfoDecorator.js +191 -150
- package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -1
- package/lib/cjs/Tools/MapFeatureInfoTool.d.ts.map +1 -1
- package/lib/cjs/Tools/MapFeatureInfoTool.js +6 -3
- package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -1
- package/lib/cjs/map-layers-formats.js.map +1 -1
- package/lib/cjs/mapLayersFormats.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/EsriSymbology.js.map +1 -1
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/esm/Feature/DefaultMarkerIcon.js +9 -9
- package/lib/esm/Feature/DefaultMarkerIcon.js.map +1 -1
- package/lib/esm/Feature/FeatureCanvasRenderer.js.map +1 -1
- package/lib/esm/Feature/FeatureInfoReader.js.map +1 -1
- package/lib/esm/Feature/FeatureSymbology.js.map +1 -1
- package/lib/esm/Feature/RandomMapColor.js.map +1 -1
- package/lib/esm/GeoJSON/GeoJSONGeometry.js.map +1 -1
- package/lib/esm/GeoJSON/GeoJSONGeometryReader.js.map +1 -1
- package/lib/esm/Icons/MapInfoIcon.js.map +1 -1
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -1
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -1
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -1
- package/lib/esm/Tools/GeometryTerrainDraper.d.ts +20 -0
- package/lib/esm/Tools/GeometryTerrainDraper.d.ts.map +1 -0
- package/lib/esm/Tools/GeometryTerrainDraper.js +149 -0
- package/lib/esm/Tools/GeometryTerrainDraper.js.map +1 -0
- package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts +15 -10
- package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts.map +1 -1
- package/lib/esm/Tools/MapFeatureInfoDecorator.js +193 -152
- package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -1
- package/lib/esm/Tools/MapFeatureInfoTool.d.ts.map +1 -1
- package/lib/esm/Tools/MapFeatureInfoTool.js +6 -3
- package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -1
- package/lib/esm/map-layers-formats.js.map +1 -1
- package/lib/esm/mapLayersFormats.js.map +1 -1
- package/lib/public/locales/en/mapLayersFormats.json +18 -18
- package/package.json +14 -14
|
@@ -5,71 +5,12 @@ exports.MapFeatureInfoDecorator = void 0;
|
|
|
5
5
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
6
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
7
|
*--------------------------------------------------------------------------------------------*/
|
|
8
|
-
/* eslint-disable no-console */
|
|
9
8
|
const core_common_1 = require("@itwin/core-common");
|
|
10
9
|
const core_frontend_1 = require("@itwin/core-frontend");
|
|
11
10
|
const core_geometry_1 = require("@itwin/core-geometry");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class DrapeLineStringCollector extends core_frontend_1.TileGeometryCollector {
|
|
16
|
-
constructor(user, chordTolerance, range, transform, _points) {
|
|
17
|
-
super({ user, chordTolerance, range, transform });
|
|
18
|
-
this._points = _points;
|
|
19
|
-
}
|
|
20
|
-
collectTile(tile) {
|
|
21
|
-
let status = super.collectTile(tile);
|
|
22
|
-
if ("reject" !== status && !this.rangeOverlapsLineString(tile.range))
|
|
23
|
-
status = "reject";
|
|
24
|
-
return status;
|
|
25
|
-
}
|
|
26
|
-
rangeOverlapsLineString(range) {
|
|
27
|
-
let inside = false;
|
|
28
|
-
const clipper = core_geometry_1.ConvexClipPlaneSet.createRange3dPlanes(range, true, true, true, true, false, false);
|
|
29
|
-
if (this._options.transform)
|
|
30
|
-
clipper.transformInPlace(this._options.transform);
|
|
31
|
-
for (let i = 0; i < this._points.length - 1 && !inside; i++)
|
|
32
|
-
inside = clipper.announceClippedSegmentIntervals(0, 1, this._points.getPoint3dAtUncheckedPointIndex(i), this._points.getPoint3dAtUncheckedPointIndex(i + 1));
|
|
33
|
-
return inside;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/** @internal */
|
|
37
|
-
class TerrainDraper {
|
|
38
|
-
constructor(viewport, treeRef) {
|
|
39
|
-
this.viewport = viewport;
|
|
40
|
-
this.treeRef = treeRef;
|
|
41
|
-
this.tileUserId = core_frontend_1.TileUser.generateId();
|
|
42
|
-
core_frontend_1.IModelApp.tileAdmin.registerUser(this);
|
|
43
|
-
}
|
|
44
|
-
dispose() {
|
|
45
|
-
core_frontend_1.IModelApp.tileAdmin.forgetUser(this);
|
|
46
|
-
}
|
|
47
|
-
get iModel() { return this.viewport.iModel; }
|
|
48
|
-
onRequestStateChanged() {
|
|
49
|
-
this.viewport.invalidateDecorations();
|
|
50
|
-
}
|
|
51
|
-
discloseTileTrees(trees) {
|
|
52
|
-
trees.disclose(this.treeRef);
|
|
53
|
-
}
|
|
54
|
-
drapeLineString(outStrings, inPoints, tolerance, maxDistance = 1.0E5) {
|
|
55
|
-
const tree = this.treeRef.treeOwner.load();
|
|
56
|
-
if (!tree)
|
|
57
|
-
return "loading";
|
|
58
|
-
const range = core_geometry_1.Range3d.createNull();
|
|
59
|
-
range.extendArray(inPoints);
|
|
60
|
-
range.extendZOnly(-maxDistance); // Expand - but not so much that we get opposite side of globe.
|
|
61
|
-
range.extendZOnly(maxDistance);
|
|
62
|
-
const collector = new DrapeLineStringCollector(this, tolerance, range, tree.iModelTransform, inPoints);
|
|
63
|
-
this.treeRef.collectTileGeometry(collector);
|
|
64
|
-
collector.requestMissingTiles();
|
|
65
|
-
if (collector.isAllGeometryLoaded && collector.polyfaces.length > 0) {
|
|
66
|
-
for (const polyface of collector.polyfaces)
|
|
67
|
-
outStrings.push(...core_geometry_1.PolyfaceQuery.sweepLineStringToFacets(inPoints, polyface, core_geometry_1.SweepLineStringToFacetsOptions.create(core_geometry_1.Vector3d.unitZ(), undefined, true, true, false, false)));
|
|
68
|
-
return "complete";
|
|
69
|
-
}
|
|
70
|
-
return "loading";
|
|
71
|
-
}
|
|
72
|
-
}
|
|
11
|
+
const GeometryTerrainDraper_1 = require("./GeometryTerrainDraper");
|
|
12
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
13
|
+
const loggerCategory = "MapLayersFormats.MapFeatureInfoDecorator";
|
|
73
14
|
/** @internal */
|
|
74
15
|
class PinMarker extends core_frontend_1.Marker {
|
|
75
16
|
constructor(worldLocation, size, image) {
|
|
@@ -110,6 +51,37 @@ class PinMarkerSet extends core_frontend_1.MarkerSet {
|
|
|
110
51
|
return new PinMarkerCluster(cluster.getClusterLocation(), cluster.markers[0].size, cluster, undefined);
|
|
111
52
|
}
|
|
112
53
|
}
|
|
54
|
+
class DrapedPrimitives {
|
|
55
|
+
constructor() {
|
|
56
|
+
this._points = new core_geometry_1.GrowableXYZArray();
|
|
57
|
+
}
|
|
58
|
+
get strings() {
|
|
59
|
+
return this._strings;
|
|
60
|
+
}
|
|
61
|
+
get meshes() {
|
|
62
|
+
return this._meshes;
|
|
63
|
+
}
|
|
64
|
+
get points() {
|
|
65
|
+
return this._points;
|
|
66
|
+
}
|
|
67
|
+
clear() {
|
|
68
|
+
this._strings = undefined;
|
|
69
|
+
this._meshes = undefined;
|
|
70
|
+
this._points.clear();
|
|
71
|
+
}
|
|
72
|
+
addStrings(drapedStrings) {
|
|
73
|
+
if (!this._strings) {
|
|
74
|
+
this._strings = [];
|
|
75
|
+
}
|
|
76
|
+
for (const ds of drapedStrings)
|
|
77
|
+
this._strings.push(ds);
|
|
78
|
+
}
|
|
79
|
+
addMeshes(drapedMeshes) {
|
|
80
|
+
if (!this._meshes)
|
|
81
|
+
this._meshes = [];
|
|
82
|
+
drapedMeshes.forEach((ds) => this._meshes.push(ds));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
113
85
|
/** @internal */
|
|
114
86
|
class MapFeatureInfoDecorator {
|
|
115
87
|
get highlightColor() { return this._highlightColor; }
|
|
@@ -121,32 +93,37 @@ class MapFeatureInfoDecorator {
|
|
|
121
93
|
constructor() {
|
|
122
94
|
this.hidden = false;
|
|
123
95
|
this.useCachedDecorations = true;
|
|
124
|
-
this.disableTerrainDraper =
|
|
96
|
+
this.disableTerrainDraper = false;
|
|
125
97
|
this.markerSize = new core_geometry_1.Point2d(32, 32);
|
|
126
98
|
this.lineWidth = 3;
|
|
99
|
+
// This is the maximum allowed size of a geometry, in pixels, to be draped.
|
|
100
|
+
// If the value is too large, we will end up downloading tons of terrain tiles, and possibly hang for too long.
|
|
101
|
+
this.maxDrapeSizePixels = 50000;
|
|
102
|
+
// This value controls the chord tolerance used to collect terrain tiles
|
|
103
|
+
// at the "right" resolution. Higher values, will give coarser terrain tiles.
|
|
104
|
+
this.chordTolerancePixels = 20;
|
|
127
105
|
this._highlightColor = core_common_1.ColorDef.from(0, 255, 255, 127);
|
|
128
|
-
this._drapePoints = new core_geometry_1.GrowableXYZArray();
|
|
129
106
|
this._scratchPoints = new core_geometry_1.GrowableXYZArray();
|
|
130
|
-
this.
|
|
107
|
+
this._drapeGraphicsStates = [];
|
|
108
|
+
this._drapedPrimitives = new DrapedPrimitives();
|
|
131
109
|
this._allGeomDraped = false;
|
|
132
110
|
this._markerSet = new PinMarkerSet();
|
|
133
111
|
this._graphicType = core_frontend_1.GraphicType.WorldOverlay;
|
|
134
|
-
this.
|
|
135
|
-
this.
|
|
112
|
+
this.clearData = () => {
|
|
113
|
+
this._data = undefined;
|
|
136
114
|
};
|
|
137
|
-
this.
|
|
138
|
-
this.
|
|
115
|
+
this.setData = (data) => {
|
|
116
|
+
this._drapedPrimitives.clear();
|
|
139
117
|
this._allGeomDraped = false;
|
|
140
118
|
this.hidden = false;
|
|
141
|
-
this.
|
|
119
|
+
this._data = data;
|
|
142
120
|
core_frontend_1.IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);
|
|
143
|
-
this.
|
|
144
|
-
this.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const drapeTreeRef = this.getGeometryTreeRef(state.hit.viewport);
|
|
121
|
+
this._drapeGraphicsStates = [];
|
|
122
|
+
if (!this.disableTerrainDraper && this._data.mapInfo?.layerInfos && data.hit.viewport.displayStyle.displayTerrain) {
|
|
123
|
+
if (data.hit?.modelId) {
|
|
124
|
+
const drapeTreeRef = this.getGeometryTreeRef(data.hit.viewport);
|
|
148
125
|
if (drapeTreeRef) {
|
|
149
|
-
this._draper = new
|
|
126
|
+
this._draper = new GeometryTerrainDraper_1.GeometryTerrainDraper(data.hit.viewport, drapeTreeRef);
|
|
150
127
|
return;
|
|
151
128
|
}
|
|
152
129
|
}
|
|
@@ -164,10 +141,10 @@ class MapFeatureInfoDecorator {
|
|
|
164
141
|
const base64 = core_common_1.Base64EncodedString.encode(this.defaultMarkerIconSvgXml);
|
|
165
142
|
this._markerImage.src = `data:image/svg+xml;base64,${base64}`;
|
|
166
143
|
}
|
|
167
|
-
|
|
144
|
+
computePixelSize(viewport, applyAspectRatioSkew, pointWorld) {
|
|
168
145
|
let pixelSize = 1;
|
|
169
146
|
// Compute the horizontal distance in meters between two adjacent pixels at the center of the geometry.
|
|
170
|
-
pixelSize = viewport.getPixelSizeAtPoint(
|
|
147
|
+
pixelSize = viewport.getPixelSizeAtPoint(pointWorld);
|
|
171
148
|
pixelSize = viewport.target.adjustPixelSizeForLOD(pixelSize);
|
|
172
149
|
// Aspect ratio skew > 1.0 stretches the view in Y. In that case use the smaller vertical pixel distance for our stroke tolerance.
|
|
173
150
|
const skew = applyAspectRatioSkew ? viewport.view.getAspectRatioSkew() : 0;
|
|
@@ -175,6 +152,17 @@ class MapFeatureInfoDecorator {
|
|
|
175
152
|
pixelSize /= skew;
|
|
176
153
|
return pixelSize * 0.25;
|
|
177
154
|
}
|
|
155
|
+
computeChordTolerance(viewport, drapeRange) {
|
|
156
|
+
const drapeSizeWorld = Math.max(drapeRange.xLength(), drapeRange.yLength());
|
|
157
|
+
const pixelSize = this.computePixelSize(viewport, true, drapeRange.center);
|
|
158
|
+
const maxDrapeRangeSizeRatio = this.maxDrapeSizePixels / (drapeSizeWorld / pixelSize);
|
|
159
|
+
if (maxDrapeRangeSizeRatio < 1) {
|
|
160
|
+
core_bentley_1.Logger.logWarning(loggerCategory, "Element too large; chord tolerance was adjusted");
|
|
161
|
+
return (pixelSize / maxDrapeRangeSizeRatio) * this.chordTolerancePixels;
|
|
162
|
+
}
|
|
163
|
+
return pixelSize * this.chordTolerancePixels;
|
|
164
|
+
}
|
|
165
|
+
;
|
|
178
166
|
getGeometryTreeRef(vp) {
|
|
179
167
|
let treeRef;
|
|
180
168
|
if (vp.backgroundMapSettings.applyTerrain) {
|
|
@@ -188,7 +176,7 @@ class MapFeatureInfoDecorator {
|
|
|
188
176
|
}
|
|
189
177
|
renderGraphics(context) {
|
|
190
178
|
this._markerSet.markers.clear();
|
|
191
|
-
if (this.
|
|
179
|
+
if (this._data?.mapInfo?.layerInfos === undefined || this.hidden) {
|
|
192
180
|
return undefined;
|
|
193
181
|
}
|
|
194
182
|
let transform;
|
|
@@ -198,71 +186,137 @@ class MapFeatureInfoDecorator {
|
|
|
198
186
|
}
|
|
199
187
|
const builder = context.createGraphicBuilder(this._graphicType, transform);
|
|
200
188
|
if (this._draper) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
189
|
+
this.initializeDrapeState(context.viewport);
|
|
190
|
+
// We need to call drapeGeometries() until it returns true (i.e. fully complete)
|
|
191
|
+
if (!this._allGeomDraped) {
|
|
192
|
+
if (!this.drapeGeometries(context.viewport))
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
195
|
+
this.appendDrapedGeometries(builder);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
// Append geometries straight from the state to the builder
|
|
199
|
+
this.appendGeometries(builder);
|
|
200
|
+
}
|
|
201
|
+
// Add extra markers if any specified
|
|
202
|
+
if (this.extraMarkers !== undefined) {
|
|
203
|
+
this.extraMarkers.forEach((markerPoint) => {
|
|
204
|
+
builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);
|
|
205
|
+
this._markerSet.markers.add(new PinMarker(markerPoint, this.markerSize, this._markerImage));
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return builder.finish();
|
|
209
|
+
}
|
|
210
|
+
// Iterates the mapfeatureinfo data and create a draping state for each entry
|
|
211
|
+
initializeDrapeState(viewport) {
|
|
212
|
+
if (this._drapeGraphicsStates.length === 0) {
|
|
213
|
+
const getGraphicRange = (graphic) => {
|
|
214
|
+
if (graphic.type === "linestring")
|
|
215
|
+
return core_geometry_1.Range3d.createArray(graphic.points);
|
|
216
|
+
else if (graphic.type === "loop")
|
|
217
|
+
return graphic.loop.range();
|
|
218
|
+
else if (graphic.type === "pointstring")
|
|
219
|
+
return core_geometry_1.Range3d.createArray(graphic.points);
|
|
220
|
+
else
|
|
221
|
+
return core_geometry_1.Range3d.createNull();
|
|
222
|
+
};
|
|
223
|
+
for (const layerInfo of this._data?.mapInfo?.layerInfos ?? []) {
|
|
224
|
+
for (const subLayerInfo of layerInfo?.subLayerInfos ?? []) {
|
|
225
|
+
for (const feature of subLayerInfo.features) {
|
|
226
|
+
feature.geometries?.forEach(((geom) => {
|
|
227
|
+
const range = getGraphicRange(geom.graphic);
|
|
228
|
+
this._drapeGraphicsStates.push({
|
|
229
|
+
graphic: geom.graphic,
|
|
230
|
+
collectorState: "loading",
|
|
231
|
+
chordTolerance: this.computeChordTolerance(viewport, range),
|
|
232
|
+
range,
|
|
233
|
+
});
|
|
234
|
+
}));
|
|
216
235
|
}
|
|
217
236
|
}
|
|
218
237
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
// returns true when all geometries are fully draped; otherwise false
|
|
241
|
+
drapeGeometries(_viewport) {
|
|
242
|
+
if (!this._draper)
|
|
243
|
+
return false;
|
|
244
|
+
let hasMissingDrapeGeoms = false;
|
|
245
|
+
for (const state of this._drapeGraphicsStates) {
|
|
246
|
+
if (state.collectorState === "loading") {
|
|
247
|
+
this._scratchPoints.clear();
|
|
248
|
+
if (state.graphic.type === "linestring") {
|
|
249
|
+
this._scratchPoints.pushAll(state.graphic.points);
|
|
250
|
+
const drapedStrings = [];
|
|
251
|
+
if ("loading" === this._draper.drapeLineString(drapedStrings, this._scratchPoints, state.chordTolerance, state.range)) {
|
|
252
|
+
hasMissingDrapeGeoms = true;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
this._drapedPrimitives.addStrings(drapedStrings);
|
|
257
|
+
state.collectorState = "complete";
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
else if (state.graphic.type === "loop") {
|
|
261
|
+
const loop = state.graphic.loop;
|
|
262
|
+
const outMeshes = [];
|
|
263
|
+
if ("loading" === this._draper.drapeLoop(outMeshes, loop, state.chordTolerance, state.range)) {
|
|
264
|
+
hasMissingDrapeGeoms = true;
|
|
265
|
+
break; // We drape each graphic sequentially, otherwise collector get messed up.
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
this._drapedPrimitives.addMeshes(outMeshes);
|
|
269
|
+
state.collectorState = "complete";
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
else if (state.graphic.type === "pointstring") {
|
|
273
|
+
const outPoint = core_geometry_1.Point3d.createZero();
|
|
274
|
+
for (const point of state.graphic.points) {
|
|
275
|
+
if ("loading" === this._draper.drapePoint(outPoint, point, state.chordTolerance, state.range)) {
|
|
276
|
+
this._allGeomDraped = false;
|
|
277
|
+
return false;
|
|
236
278
|
}
|
|
237
|
-
else {
|
|
238
|
-
this.
|
|
239
|
-
state.collectorState = "complete";
|
|
279
|
+
else if (!outPoint.isZero) {
|
|
280
|
+
this._drapedPrimitives.points.push(outPoint);
|
|
240
281
|
}
|
|
241
282
|
}
|
|
242
|
-
drapePointsOffset += state.count;
|
|
243
283
|
}
|
|
244
|
-
this._allGeomDraped = !hasMissingLineStrings;
|
|
245
|
-
}
|
|
246
|
-
if (this._drapedStrings) {
|
|
247
|
-
builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);
|
|
248
|
-
this._drapedStrings.forEach((line) => builder.addLineString(line.points));
|
|
249
284
|
}
|
|
250
285
|
}
|
|
251
|
-
|
|
286
|
+
this._allGeomDraped = !hasMissingDrapeGeoms;
|
|
287
|
+
return this._allGeomDraped;
|
|
288
|
+
}
|
|
289
|
+
appendDrapedGeometries(builder) {
|
|
290
|
+
if (this._drapedPrimitives.strings) {
|
|
252
291
|
builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
292
|
+
this._drapedPrimitives.strings.forEach((line) => builder.addLineString(line.points));
|
|
293
|
+
}
|
|
294
|
+
if (this._drapedPrimitives.meshes) {
|
|
295
|
+
builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);
|
|
296
|
+
this._drapedPrimitives.meshes.forEach((polyface) => builder.addPolyface(polyface, true));
|
|
297
|
+
}
|
|
298
|
+
if (this._drapedPrimitives.points.length > 0) {
|
|
299
|
+
for (let i = 0; i < this._drapedPrimitives.points.length; i++) {
|
|
300
|
+
this._markerSet.markers.add(new PinMarker(this._drapedPrimitives.points.getPoint3dAtUncheckedPointIndex(i), this.markerSize, this._markerImage));
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
appendGeometries(builder) {
|
|
305
|
+
if (!this._data?.mapInfo?.layerInfos)
|
|
306
|
+
return;
|
|
307
|
+
builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);
|
|
308
|
+
for (const layerInfo of this._data.mapInfo.layerInfos) {
|
|
309
|
+
if (layerInfo.subLayerInfos && !(layerInfo.subLayerInfos instanceof HTMLElement)) {
|
|
310
|
+
for (const subLayerInfo of layerInfo.subLayerInfos) {
|
|
311
|
+
for (const feature of subLayerInfo.features) {
|
|
312
|
+
if (feature.geometries) {
|
|
313
|
+
for (const geom of feature.geometries) {
|
|
314
|
+
if (geom.graphic.type === "pointstring") {
|
|
315
|
+
for (const point of geom.graphic.points)
|
|
316
|
+
this._markerSet.markers.add(new PinMarker(point, this.markerSize, this._markerImage));
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
builder.addPrimitive(geom.graphic);
|
|
266
320
|
}
|
|
267
321
|
}
|
|
268
322
|
}
|
|
@@ -270,26 +324,13 @@ class MapFeatureInfoDecorator {
|
|
|
270
324
|
}
|
|
271
325
|
}
|
|
272
326
|
}
|
|
273
|
-
// Add extra markers if any specified
|
|
274
|
-
if (this.extraMarkers !== undefined) {
|
|
275
|
-
this.extraMarkers.forEach((markerPoint) => {
|
|
276
|
-
builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);
|
|
277
|
-
this._markerSet.markers.add(new PinMarker(markerPoint, this.markerSize, this._markerImage));
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
return builder.finish();
|
|
281
|
-
}
|
|
282
|
-
addDrapedStrings(drapedStrings) {
|
|
283
|
-
if (!this._drapedStrings) {
|
|
284
|
-
this._drapedStrings = [];
|
|
285
|
-
}
|
|
286
|
-
for (const ds of drapedStrings)
|
|
287
|
-
this._drapedStrings.push(ds);
|
|
288
327
|
}
|
|
289
328
|
decorate(context) {
|
|
290
329
|
const graphics = this.renderGraphics(context);
|
|
291
|
-
if (graphics)
|
|
330
|
+
if (graphics) {
|
|
292
331
|
context.addDecoration(this._graphicType, graphics);
|
|
332
|
+
core_frontend_1.IModelApp.toolAdmin.setCursor(undefined);
|
|
333
|
+
}
|
|
293
334
|
this._markerSet.addDecoration(context);
|
|
294
335
|
return;
|
|
295
336
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapFeatureInfoDecorator.js","sourceRoot":"","sources":["../../../src/Tools/MapFeatureInfoDecorator.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,+BAA+B;AAC/B,oDAAmE;AACnE,wDAGmG;AACnG,wDAAwN;AAGxN;;EAEE;AACF,MAAM,wBAAyB,SAAQ,qCAAqB;IAC1D,YAAY,IAAc,EAAE,cAAsB,EAAE,KAAc,EAAE,SAAoB,EAAU,OAAyB;QACzH,KAAK,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAD8C,YAAO,GAAP,OAAO,CAAkB;IAE3H,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,CAAC,aAA6B;QACnD,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACzB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QAC3B,CAAC;QACD,KAAK,MAAM,EAAE,IAAI,aAAa;YAC5B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IAEM,QAAQ,CAAC,OAAwB;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,QAAQ;YACV,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QAErD,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;CACF;AAnOD,0DAmOC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/* eslint-disable no-console */\nimport { Base64EncodedString, ColorDef } from \"@itwin/core-common\";\nimport {\n BeButtonEvent, Cluster, CollectTileStatus, DecorateContext, Decorator, DisclosedTileTreeSet,\n GeometryTileTreeReference, GraphicType, IModelApp, MapTileTreeReference, Marker, MarkerImage, MarkerSet,\n Tile, TileGeometryCollector, TileTreeReference, TileUser, Viewport } from \"@itwin/core-frontend\";\nimport { ConvexClipPlaneSet, CurvePrimitive, GrowableXYZArray, LineString3d, Point2d, Point3d, PolyfaceQuery, Range3d, SweepLineStringToFacetsOptions, Transform, Vector3d, XAndY, XYAndZ } from \"@itwin/core-geometry\";\nimport { MapFeatureInfoToolData } from \"./MapFeatureInfoTool\";\n\n/** A TileGeometryCollector that restricts collection to tiles that overlap a line string.\n/* @internal\n*/\nclass DrapeLineStringCollector extends TileGeometryCollector {\n constructor(user: TileUser, chordTolerance: number, range: Range3d, transform: Transform, private _points: GrowableXYZArray) {\n super({ user, chordTolerance, range, transform });\n }\n\n public override collectTile(tile: Tile): CollectTileStatus {\n let status = super.collectTile(tile);\n if (\"reject\" !== status && !this.rangeOverlapsLineString(tile.range))\n status = \"reject\";\n\n return status;\n }\n\n private rangeOverlapsLineString(range: Range3d) {\n let inside = false;\n const clipper = ConvexClipPlaneSet.createRange3dPlanes(range, true, true, true, true, false, false);\n if (this._options.transform)\n clipper.transformInPlace(this._options.transform);\n\n for (let i = 0; i < this._points.length - 1 && !inside; i++)\n inside = clipper.announceClippedSegmentIntervals(0, 1, this._points.getPoint3dAtUncheckedPointIndex(i), this._points.getPoint3dAtUncheckedPointIndex(i + 1));\n\n return inside;\n }\n}\n\n/** @internal */\nclass TerrainDraper implements TileUser {\n public readonly tileUserId: number;\n\n public constructor(public readonly viewport: Viewport, public readonly treeRef: GeometryTileTreeReference) {\n this.tileUserId = TileUser.generateId();\n IModelApp.tileAdmin.registerUser(this);\n }\n\n public dispose(): void {\n IModelApp.tileAdmin.forgetUser(this);\n }\n\n public get iModel() { return this.viewport.iModel; }\n\n public onRequestStateChanged() {\n this.viewport.invalidateDecorations();\n }\n\n public discloseTileTrees(trees: DisclosedTileTreeSet) {\n trees.disclose(this.treeRef);\n }\n\n public drapeLineString(outStrings: CurvePrimitive[], inPoints: GrowableXYZArray, tolerance: number, maxDistance = 1.0E5): \"loading\" | \"complete\" {\n const tree = this.treeRef.treeOwner.load();\n if (!tree)\n return \"loading\";\n\n const range = Range3d.createNull();\n range.extendArray(inPoints);\n range.extendZOnly(-maxDistance); // Expand - but not so much that we get opposite side of globe.\n range.extendZOnly(maxDistance);\n\n const collector = new DrapeLineStringCollector(this, tolerance, range, tree.iModelTransform, inPoints);\n this.treeRef.collectTileGeometry(collector);\n collector.requestMissingTiles();\n\n if (collector.isAllGeometryLoaded && collector.polyfaces.length > 0) {\n for (const polyface of collector.polyfaces)\n outStrings.push(...PolyfaceQuery.sweepLineStringToFacets(inPoints, polyface,\n SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), undefined, true, true, false, false)));\n return \"complete\";\n }\n\n return \"loading\";\n }\n}\n\n/** @internal */\nclass PinMarker extends Marker {\n public constructor(worldLocation: XYAndZ, size: XAndY, image: MarkerImage) {\n super(worldLocation, size);\n this.image = image;\n this.imageOffset = new Point3d(0, Math.floor(size.y * .5));\n }\n}\n\n/** @internal */\nclass PinMarkerCluster extends Marker {\n /** Create a new cluster marker */\n constructor(location: XYAndZ, size: XAndY, cluster: Cluster<PinMarker>, image: MarkerImage | Promise<MarkerImage> | undefined) {\n super(location, size);\n\n this.title = IModelApp.localization.getLocalizedString(\"mapLayersFormats:Messages.MapFeatureInfoDecorator.clusterZoomIn\", { nbInstances: cluster.markers.length});\n\n this.imageOffset = new Point3d(0, size.y * 0.5);\n this.label = cluster.markers.length.toLocaleString();\n this.labelColor = \"black\";\n this.labelFont = \"bold 14px sans-serif\";\n\n if (image)\n this.setImage(image);\n }\n\n /** Show the cluster as a white circle with an outline */\n public override drawFunc(ctx: CanvasRenderingContext2D): void {\n ctx.beginPath();\n ctx.strokeStyle = \"#372528\";\n ctx.fillStyle = \"white\";\n ctx.lineWidth = 5;\n ctx.arc(0, 0, this.size.x * 0.5, 0, Math.PI * 2);\n ctx.fill();\n ctx.stroke();\n }\n\n public override onMouseButton(_ev: BeButtonEvent): boolean { return true; } // Don't allow clicks to be sent to active tool...\n}\n\n/** @internal */\nclass PinMarkerSet extends MarkerSet<PinMarker> {\n protected getClusterMarker(cluster: Cluster<PinMarker>): Marker {\n // No image passed to the cluster, we prefer to have the circle only\n return new PinMarkerCluster(cluster.getClusterLocation(), cluster.markers[0].size, cluster, undefined);\n }\n}\n\n/** @internal */\ninterface DrapePointState {\n count: number;\n collectorState: string;\n}\n\n/** @internal */\nexport class MapFeatureInfoDecorator implements Decorator {\n public hidden = false;\n public readonly useCachedDecorations = true;\n public readonly disableTerrainDraper = true;\n public markerSize = new Point2d(32, 32);\n public lineWidth = 3;\n private _highlightColor = ColorDef.from(0, 255, 255, 127);\n\n public get highlightColor() { return this._highlightColor;}\n public set highlightColor(color: ColorDef) {\n this.updateMarkerImage();\n this._highlightColor = color;\n }\n\n public get defaultMarkerIconSvgXml() { return `<svg class=\"indicator\" viewBox=\"0 0 22 22\" width=\"22\" height=\"22\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11 0a7.44506 7.44506 0 0 0 -7.5 7.2875c0 1.65 1.132 4.2625 3.25477 8.1125 1.55652 2.75 4.24523 6.6 4.24523 6.6s2.68865-3.9875 4.24528-6.7375c2.12272-3.85 3.25472-6.4625 3.25472-8.1125a7.4215 7.4215 0 0 0 -7.5-7.15z\" fill=\"black\"/><path d=\"m11 1.01715a6.46476 6.46476 0 0 0 -6.48285 6.27033c0 1.72619 1.67181 4.97973 3.12836 7.62139.97564 1.7237 2.42828 3.92176 3.34118 5.27161.91413-1.39148 2.385-3.673 3.37336-5.41907 1.451-2.63171 3.1228-5.88525 3.1228-7.61139a6.39982 6.39982 0 0 0 -6.48285-6.13287zm.00183 8.98285a3 3 0 1 1 3-3 3 3 0 0 1 -3 3z\" fill=\"${this.highlightColor.toRgbString()}\"/></svg>`; }\n\n private _drapePoints = new GrowableXYZArray();\n private _scratchPoints = new GrowableXYZArray();\n\n private _drapePointsStates: DrapePointState[] = [];\n private _drapedStrings?: LineString3d[];\n private _allGeomDraped = false;\n private _draper?: TerrainDraper;\n private _markerImage: HTMLImageElement;\n private _markerSet = new PinMarkerSet();\n\n // Extra markers can be added outside the normal state\n public extraMarkers: Point3d[]|undefined;\n\n private _state: MapFeatureInfoToolData | undefined;\n\n private readonly _graphicType = GraphicType.WorldOverlay;\n\n public constructor() {\n this._markerImage = new Image();\n this.updateMarkerImage();\n }\n\n private updateMarkerImage() {\n const base64 = Base64EncodedString.encode(this.defaultMarkerIconSvgXml);\n this._markerImage.src = `data:image/svg+xml;base64,${base64}`;\n }\n\n private _computeChordTolerance(viewport: Viewport, applyAspectRatioSkew: boolean, computeRange: () => Range3d) {\n let pixelSize = 1;\n // Compute the horizontal distance in meters between two adjacent pixels at the center of the geometry.\n pixelSize = viewport.getPixelSizeAtPoint(computeRange().center);\n pixelSize = viewport.target.adjustPixelSizeForLOD(pixelSize);\n\n // Aspect ratio skew > 1.0 stretches the view in Y. In that case use the smaller vertical pixel distance for our stroke tolerance.\n const skew = applyAspectRatioSkew ? viewport.view.getAspectRatioSkew() : 0;\n if (skew > 1)\n pixelSize /= skew;\n return pixelSize * 0.25;\n }\n\n public clearState = () => {\n this._state = undefined;\n };\n\n public setState = (state: MapFeatureInfoToolData) => {\n\n this._drapedStrings = undefined;\n this._allGeomDraped = false;\n this.hidden = false;\n\n this._state = state;\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n\n this._drapePoints.clear();\n this._drapePointsStates = [];\n\n if (!this.disableTerrainDraper && this._state.mapInfo?.layerInfos && state.hit.viewport.displayStyle.displayTerrain) {\n\n if (state.hit?.modelId) {\n const drapeTreeRef = this.getGeometryTreeRef(state.hit.viewport);\n if (drapeTreeRef) {\n this._draper = new TerrainDraper(state.hit.viewport, drapeTreeRef);\n return;\n }\n }\n }\n\n if (this._draper) {\n // Dispose draper every time?\n this._draper.dispose();\n this._draper = undefined;\n }\n };\n\n private getGeometryTreeRef(vp: Viewport): GeometryTileTreeReference | undefined {\n let treeRef: GeometryTileTreeReference | undefined;\n if (vp.backgroundMapSettings.applyTerrain) {\n vp.forEachMapTreeRef((ref: TileTreeReference) => {\n if (!treeRef && ref instanceof MapTileTreeReference) {\n treeRef = ref.createGeometryTreeReference();\n }\n });\n }\n\n return treeRef;\n }\n\n protected renderGraphics(context: DecorateContext) {\n this._markerSet.markers.clear();\n\n if (this._state?.mapInfo?.layerInfos === undefined || this.hidden) {\n return undefined;\n }\n\n let transform: Transform|undefined;\n const groundBias = context.viewport.displayStyle.backgroundMapSettings.groundBias;\n if (groundBias !== 0) {\n transform = Transform.createTranslationXYZ(0, 0 , groundBias);\n }\n const builder = context.createGraphicBuilder(this._graphicType, transform);\n\n if (this._draper) {\n if (this._drapePoints.length === 0 && this._state.mapInfo.layerInfos) {\n\n for (const layerInfo of this._state.mapInfo.layerInfos) {\n if (layerInfo.subLayerInfos) {\n for (const subLayerInfo of layerInfo.subLayerInfos) {\n for (const feature of subLayerInfo.features) {\n if (feature.geometries) {\n for (const geom of feature.geometries) {\n if (geom.graphic.type === \"linestring\") {\n this._drapePointsStates.push({ count: geom.graphic.points.length, collectorState: \"loading\" });\n this._drapePoints.pushAll(geom.graphic.points);\n }\n }\n }\n }\n }\n\n }\n }\n }\n\n if (!this._allGeomDraped) {\n\n let hasMissingLineStrings = false;\n let drapePointsOffset = 0;\n for (const state of this._drapePointsStates) {\n\n if (state.collectorState === \"loading\") {\n this._scratchPoints.clear();\n this._scratchPoints.resize(state.count);\n\n let dstIdx = 0;\n for (let srcIdx = drapePointsOffset; srcIdx < drapePointsOffset + state.count; srcIdx++) {\n this._scratchPoints.transferFromGrowableXYZArray(dstIdx++, this._drapePoints, srcIdx);\n }\n\n const drapeRange = Range3d.createNull();\n drapeRange.extendArray(this._scratchPoints);\n const drapedStrings: LineString3d[] = [];\n const tolerance = this._computeChordTolerance(context.viewport, true, () => drapeRange) * 10; // 10 pixels\n if (\"loading\" === this._draper.drapeLineString(drapedStrings, this._scratchPoints, tolerance)) {\n hasMissingLineStrings = true;\n } else {\n this.addDrapedStrings(drapedStrings);\n state.collectorState = \"complete\";\n }\n }\n drapePointsOffset += state.count;\n }\n this._allGeomDraped = !hasMissingLineStrings;\n }\n\n if (this._drapedStrings) {\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\n this._drapedStrings.forEach((line) => builder.addLineString(line.points));\n }\n\n } else {\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\n for (const layerInfo of this._state.mapInfo.layerInfos) {\n if (layerInfo.subLayerInfos && !(layerInfo.subLayerInfos instanceof HTMLElement)) {\n for (const subLayerInfo of layerInfo.subLayerInfos) {\n for (const feature of subLayerInfo.features) {\n if (feature.geometries) {\n for (const geom of feature.geometries) {\n if (geom.graphic.type === \"pointstring\") {\n for (const point of geom.graphic.points)\n this._markerSet.markers.add(new PinMarker(point, this.markerSize, this._markerImage));\n } else {\n builder.addPrimitive(geom.graphic);\n }\n\n }\n }\n }\n }\n\n }\n\n }\n }\n\n // Add extra markers if any specified\n if ( this.extraMarkers !== undefined) {\n this.extraMarkers.forEach((markerPoint)=> {\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\n this._markerSet.markers.add(new PinMarker(markerPoint, this.markerSize, this._markerImage));\n });\n }\n\n return builder.finish();\n }\n\n public addDrapedStrings(drapedStrings: LineString3d[]) {\n if (!this._drapedStrings) {\n this._drapedStrings = [];\n }\n for (const ds of drapedStrings)\n this._drapedStrings.push(ds);\n }\n\n public decorate(context: DecorateContext): void {\n const graphics = this.renderGraphics(context);\n if (graphics)\n context.addDecoration(this._graphicType, graphics);\n\n this._markerSet.addDecoration(context);\n return;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MapFeatureInfoDecorator.js","sourceRoot":"","sources":["../../../src/Tools/MapFeatureInfoDecorator.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,oDAAmE;AACnE,wDAI4D;AAC5D,wDAAqI;AAErI,mEAAgE;AAChE,sDAA6C;AAC7C,MAAM,cAAc,GAAG,0CAA0C,CAAC;AAElE,gBAAgB;AAChB,MAAM,SAAU,SAAQ,sBAAM;IAC5B,YAAmB,aAAqB,EAAE,IAAW,EAAE,KAAkB;QACvE,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,IAAI,uBAAO,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC;CACF;AAED,gBAAgB;AAChB,MAAM,gBAAiB,SAAQ,sBAAM;IACnC,kCAAkC;I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C;QACvC,OAAO;IACT,CAAC;CACF;AAzSD,0DAySC","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\nimport { Base64EncodedString, ColorDef } from \"@itwin/core-common\";\r\nimport {\r\n BeButtonEvent, Cluster, DecorateContext, Decorator,\r\n GeometryTileTreeReference, GraphicBuilder, GraphicPrimitive, GraphicType, IModelApp, MapTileTreeReference, Marker, MarkerImage, MarkerSet,\r\n ScreenViewport,\r\n TileTreeReference, Viewport } from \"@itwin/core-frontend\";\r\nimport { GrowableXYZArray, LineString3d, Point2d, Point3d, Polyface, Range3d, Transform, XAndY, XYAndZ } from \"@itwin/core-geometry\";\r\nimport { MapFeatureInfoToolData } from \"./MapFeatureInfoTool\";\r\nimport { GeometryTerrainDraper } from \"./GeometryTerrainDraper\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nconst loggerCategory = \"MapLayersFormats.MapFeatureInfoDecorator\";\r\n\r\n/** @internal */\r\nclass PinMarker extends Marker {\r\n public constructor(worldLocation: XYAndZ, size: XAndY, image: MarkerImage) {\r\n super(worldLocation, size);\r\n this.image = image;\r\n this.imageOffset = new Point3d(0, Math.floor(size.y * .5));\r\n }\r\n}\r\n\r\n/** @internal */\r\nclass PinMarkerCluster extends Marker {\r\n /** Create a new cluster marker */\r\n constructor(location: XYAndZ, size: XAndY, cluster: Cluster<PinMarker>, image: MarkerImage | Promise<MarkerImage> | undefined) {\r\n super(location, size);\r\n\r\n this.title = IModelApp.localization.getLocalizedString(\"mapLayersFormats:Messages.MapFeatureInfoDecorator.clusterZoomIn\", { nbInstances: cluster.markers.length});\r\n\r\n this.imageOffset = new Point3d(0, size.y * 0.5);\r\n this.label = cluster.markers.length.toLocaleString();\r\n this.labelColor = \"black\";\r\n this.labelFont = \"bold 14px sans-serif\";\r\n\r\n if (image)\r\n this.setImage(image);\r\n }\r\n\r\n /** Show the cluster as a white circle with an outline */\r\n public override drawFunc(ctx: CanvasRenderingContext2D): void {\r\n ctx.beginPath();\r\n ctx.strokeStyle = \"#372528\";\r\n ctx.fillStyle = \"white\";\r\n ctx.lineWidth = 5;\r\n ctx.arc(0, 0, this.size.x * 0.5, 0, Math.PI * 2);\r\n ctx.fill();\r\n ctx.stroke();\r\n }\r\n\r\n public override onMouseButton(_ev: BeButtonEvent): boolean { return true; } // Don't allow clicks to be sent to active tool...\r\n}\r\n\r\n/** @internal */\r\nclass PinMarkerSet extends MarkerSet<PinMarker> {\r\n protected getClusterMarker(cluster: Cluster<PinMarker>): Marker {\r\n // No image passed to the cluster, we prefer to have the circle only\r\n return new PinMarkerCluster(cluster.getClusterLocation(), cluster.markers[0].size, cluster, undefined);\r\n }\r\n}\r\n\r\ninterface DrapeGraphicState {\r\n graphic: GraphicPrimitive;\r\n collectorState: string;\r\n chordTolerance: number;\r\n range: Range3d;\r\n}\r\n\r\nclass DrapedPrimitives {\r\n private _strings?: LineString3d[];\r\n private _meshes?: Polyface[];\r\n private _points = new GrowableXYZArray();\r\n\r\n public get strings() {\r\n return this._strings;\r\n }\r\n\r\n public get meshes() {\r\n return this._meshes;\r\n }\r\n\r\n public get points() {\r\n return this._points;\r\n }\r\n\r\n public clear() {\r\n this._strings = undefined;\r\n this._meshes = undefined;\r\n this._points.clear();\r\n }\r\n\r\n public addStrings(drapedStrings: LineString3d[]) {\r\n if (!this._strings) {\r\n this._strings = [];\r\n }\r\n for (const ds of drapedStrings)\r\n this._strings.push(ds);\r\n }\r\n\r\n public addMeshes(drapedMeshes: Polyface[]) {\r\n if (!this._meshes)\r\n this._meshes = [];\r\n drapedMeshes.forEach((ds) => this._meshes!.push(ds));\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class MapFeatureInfoDecorator implements Decorator {\r\n public hidden = false;\r\n public readonly useCachedDecorations = true;\r\n public readonly disableTerrainDraper = false;\r\n public markerSize = new Point2d(32, 32);\r\n public lineWidth = 3;\r\n\r\n // This is the maximum allowed size of a geometry, in pixels, to be draped.\r\n // If the value is too large, we will end up downloading tons of terrain tiles, and possibly hang for too long.\r\n public maxDrapeSizePixels = 50000;\r\n\r\n // This value controls the chord tolerance used to collect terrain tiles\r\n // at the \"right\" resolution. Higher values, will give coarser terrain tiles.\r\n public chordTolerancePixels = 20;\r\n\r\n private _highlightColor = ColorDef.from(0, 255, 255, 127);\r\n public get highlightColor() { return this._highlightColor;}\r\n public set highlightColor(color: ColorDef) {\r\n this.updateMarkerImage();\r\n this._highlightColor = color;\r\n }\r\n\r\n public get defaultMarkerIconSvgXml() { return `<svg class=\"indicator\" viewBox=\"0 0 22 22\" width=\"22\" height=\"22\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11 0a7.44506 7.44506 0 0 0 -7.5 7.2875c0 1.65 1.132 4.2625 3.25477 8.1125 1.55652 2.75 4.24523 6.6 4.24523 6.6s2.68865-3.9875 4.24528-6.7375c2.12272-3.85 3.25472-6.4625 3.25472-8.1125a7.4215 7.4215 0 0 0 -7.5-7.15z\" fill=\"black\"/><path d=\"m11 1.01715a6.46476 6.46476 0 0 0 -6.48285 6.27033c0 1.72619 1.67181 4.97973 3.12836 7.62139.97564 1.7237 2.42828 3.92176 3.34118 5.27161.91413-1.39148 2.385-3.673 3.37336-5.41907 1.451-2.63171 3.1228-5.88525 3.1228-7.61139a6.39982 6.39982 0 0 0 -6.48285-6.13287zm.00183 8.98285a3 3 0 1 1 3-3 3 3 0 0 1 -3 3z\" fill=\"${this.highlightColor.toRgbString()}\"/></svg>`; }\r\n\r\n private _scratchPoints = new GrowableXYZArray();\r\n\r\n private _drapeGraphicsStates: DrapeGraphicState[] = [];\r\n private _drapedPrimitives = new DrapedPrimitives();\r\n private _allGeomDraped = false;\r\n private _draper?: GeometryTerrainDraper;\r\n private _markerImage: HTMLImageElement;\r\n private _markerSet = new PinMarkerSet();\r\n\r\n // Extra markers can be added outside the normal state\r\n public extraMarkers: Point3d[]|undefined;\r\n\r\n private _data: MapFeatureInfoToolData | undefined;\r\n\r\n private readonly _graphicType = GraphicType.WorldOverlay;\r\n\r\n public constructor() {\r\n this._markerImage = new Image();\r\n this.updateMarkerImage();\r\n }\r\n\r\n private updateMarkerImage() {\r\n const base64 = Base64EncodedString.encode(this.defaultMarkerIconSvgXml);\r\n this._markerImage.src = `data:image/svg+xml;base64,${base64}`;\r\n }\r\n\r\n private computePixelSize(viewport: Viewport, applyAspectRatioSkew: boolean, pointWorld: Point3d) {\r\n let pixelSize = 1;\r\n // Compute the horizontal distance in meters between two adjacent pixels at the center of the geometry.\r\n pixelSize = viewport.getPixelSizeAtPoint(pointWorld);\r\n pixelSize = viewport.target.adjustPixelSizeForLOD(pixelSize);\r\n\r\n // Aspect ratio skew > 1.0 stretches the view in Y. In that case use the smaller vertical pixel distance for our stroke tolerance.\r\n const skew = applyAspectRatioSkew ? viewport.view.getAspectRatioSkew() : 0;\r\n if (skew > 1)\r\n pixelSize /= skew;\r\n return pixelSize * 0.25;\r\n }\r\n\r\n private computeChordTolerance(viewport: Viewport, drapeRange: Range3d) {\r\n const drapeSizeWorld = Math.max(drapeRange.xLength(), drapeRange.yLength());\r\n const pixelSize = this.computePixelSize(viewport, true, drapeRange.center);\r\n const maxDrapeRangeSizeRatio = this.maxDrapeSizePixels / (drapeSizeWorld / pixelSize);\r\n if (maxDrapeRangeSizeRatio < 1) {\r\n Logger.logWarning(loggerCategory, \"Element too large; chord tolerance was adjusted\");\r\n return (pixelSize / maxDrapeRangeSizeRatio)*this.chordTolerancePixels;\r\n }\r\n return pixelSize*this.chordTolerancePixels;\r\n };\r\n\r\n public clearData = () => {\r\n this._data = undefined;\r\n };\r\n\r\n public setData = (data: MapFeatureInfoToolData) => {\r\n\r\n this._drapedPrimitives.clear();\r\n this._allGeomDraped = false;\r\n this.hidden = false;\r\n\r\n this._data = data;\r\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\r\n\r\n this._drapeGraphicsStates = [];\r\n\r\n if (!this.disableTerrainDraper && this._data.mapInfo?.layerInfos && data.hit.viewport.displayStyle.displayTerrain) {\r\n\r\n if (data.hit?.modelId) {\r\n const drapeTreeRef = this.getGeometryTreeRef(data.hit.viewport);\r\n if (drapeTreeRef) {\r\n this._draper = new GeometryTerrainDraper(data.hit.viewport, drapeTreeRef);\r\n return;\r\n }\r\n }\r\n }\r\n\r\n if (this._draper) {\r\n // Dispose draper every time?\r\n this._draper.dispose();\r\n this._draper = undefined;\r\n }\r\n };\r\n\r\n private getGeometryTreeRef(vp: Viewport): GeometryTileTreeReference | undefined {\r\n let treeRef: GeometryTileTreeReference | undefined;\r\n if (vp.backgroundMapSettings.applyTerrain) {\r\n vp.forEachMapTreeRef((ref: TileTreeReference) => {\r\n if (!treeRef && ref instanceof MapTileTreeReference) {\r\n treeRef = ref.createGeometryTreeReference();\r\n }\r\n });\r\n }\r\n\r\n return treeRef;\r\n }\r\n\r\n protected renderGraphics(context: DecorateContext) {\r\n this._markerSet.markers.clear();\r\n\r\n if (this._data?.mapInfo?.layerInfos === undefined || this.hidden) {\r\n return undefined;\r\n }\r\n\r\n let transform: Transform|undefined;\r\n const groundBias = context.viewport.displayStyle.backgroundMapSettings.groundBias;\r\n if (groundBias !== 0) {\r\n transform = Transform.createTranslationXYZ(0, 0 , groundBias);\r\n }\r\n const builder = context.createGraphicBuilder(this._graphicType, transform);\r\n\r\n if (this._draper) {\r\n this.initializeDrapeState(context.viewport);\r\n\r\n // We need to call drapeGeometries() until it returns true (i.e. fully complete)\r\n if (!this._allGeomDraped) {\r\n if (!this.drapeGeometries(context.viewport))\r\n return undefined;\r\n }\r\n\r\n this.appendDrapedGeometries(builder);\r\n } else {\r\n // Append geometries straight from the state to the builder\r\n this.appendGeometries(builder);\r\n }\r\n\r\n // Add extra markers if any specified\r\n if ( this.extraMarkers !== undefined) {\r\n this.extraMarkers.forEach((markerPoint)=> {\r\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\r\n this._markerSet.markers.add(new PinMarker(markerPoint, this.markerSize, this._markerImage));\r\n });\r\n }\r\n\r\n return builder.finish();\r\n }\r\n\r\n // Iterates the mapfeatureinfo data and create a draping state for each entry\r\n private initializeDrapeState(viewport: ScreenViewport) {\r\n if (this._drapeGraphicsStates.length === 0) {\r\n const getGraphicRange = (graphic: GraphicPrimitive) => {\r\n if (graphic.type === \"linestring\")\r\n return Range3d.createArray(graphic.points);\r\n else if (graphic.type === \"loop\")\r\n return graphic.loop.range();\r\n else if (graphic.type === \"pointstring\")\r\n return Range3d.createArray(graphic.points);\r\n else\r\n return Range3d.createNull();\r\n };\r\n\r\n for (const layerInfo of this._data?.mapInfo?.layerInfos??[]) {\r\n for (const subLayerInfo of layerInfo?.subLayerInfos??[]) {\r\n for (const feature of subLayerInfo.features) {\r\n\r\n feature.geometries?.forEach(((geom)=> {\r\n const range = getGraphicRange(geom.graphic);\r\n this._drapeGraphicsStates.push({\r\n graphic: geom.graphic,\r\n collectorState: \"loading\",\r\n chordTolerance: this.computeChordTolerance(viewport, range),\r\n range,\r\n });\r\n } ));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // returns true when all geometries are fully draped; otherwise false\r\n private drapeGeometries(_viewport: ScreenViewport): boolean {\r\n if (!this._draper)\r\n return false;\r\n\r\n let hasMissingDrapeGeoms = false;\r\n for (const state of this._drapeGraphicsStates) {\r\n if (state.collectorState === \"loading\") {\r\n this._scratchPoints.clear();\r\n\r\n if (state.graphic.type === \"linestring\") {\r\n this._scratchPoints.pushAll(state.graphic.points);\r\n const drapedStrings: LineString3d[] = [];\r\n if (\"loading\" === this._draper.drapeLineString(drapedStrings, this._scratchPoints, state.chordTolerance, state.range)) {\r\n hasMissingDrapeGeoms = true;\r\n break;\r\n } else {\r\n this._drapedPrimitives.addStrings(drapedStrings);\r\n state.collectorState = \"complete\";\r\n }\r\n } else if (state.graphic.type === \"loop\") {\r\n const loop = state.graphic.loop;\r\n const outMeshes: Polyface[] = [];\r\n if (\"loading\" === this._draper.drapeLoop(outMeshes, loop, state.chordTolerance, state.range)) {\r\n hasMissingDrapeGeoms = true;\r\n break; // We drape each graphic sequentially, otherwise collector get messed up.\r\n } else {\r\n this._drapedPrimitives.addMeshes(outMeshes);\r\n state.collectorState = \"complete\";\r\n }\r\n } else if (state.graphic.type === \"pointstring\") {\r\n const outPoint = Point3d.createZero();\r\n for (const point of state.graphic.points) {\r\n if (\"loading\" === this._draper.drapePoint(outPoint, point, state.chordTolerance, state.range)) {\r\n this._allGeomDraped = false;\r\n return false;\r\n } else if (!outPoint.isZero) {\r\n this._drapedPrimitives.points.push(outPoint);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n this._allGeomDraped = !hasMissingDrapeGeoms;\r\n return this._allGeomDraped;\r\n }\r\n\r\n private appendDrapedGeometries(builder: GraphicBuilder) {\r\n if (this._drapedPrimitives.strings) {\r\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\r\n this._drapedPrimitives.strings.forEach((line) => builder.addLineString(line.points));\r\n }\r\n\r\n if (this._drapedPrimitives.meshes) {\r\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\r\n this._drapedPrimitives.meshes.forEach((polyface) => builder.addPolyface(polyface, true));\r\n }\r\n\r\n if (this._drapedPrimitives.points.length > 0) {\r\n for (let i = 0; i < this._drapedPrimitives.points.length; i++) {\r\n this._markerSet.markers.add(new PinMarker(this._drapedPrimitives.points.getPoint3dAtUncheckedPointIndex(i), this.markerSize, this._markerImage));\r\n }\r\n }\r\n }\r\n\r\n private appendGeometries(builder: GraphicBuilder) {\r\n if (!this._data?.mapInfo?.layerInfos)\r\n return;\r\n\r\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\r\n for (const layerInfo of this._data.mapInfo.layerInfos) {\r\n if (layerInfo.subLayerInfos && !(layerInfo.subLayerInfos instanceof HTMLElement)) {\r\n for (const subLayerInfo of layerInfo.subLayerInfos) {\r\n for (const feature of subLayerInfo.features) {\r\n if (feature.geometries) {\r\n for (const geom of feature.geometries) {\r\n if (geom.graphic.type === \"pointstring\") {\r\n for (const point of geom.graphic.points)\r\n this._markerSet.markers.add(new PinMarker(point, this.markerSize, this._markerImage));\r\n } else {\r\n builder.addPrimitive(geom.graphic);\r\n }\r\n\r\n }\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n }\r\n\r\n public decorate(context: DecorateContext): void {\r\n const graphics = this.renderGraphics(context);\r\n if (graphics) {\r\n context.addDecoration(this._graphicType, graphics);\r\n IModelApp.toolAdmin.setCursor(undefined);\r\n }\r\n\r\n this._markerSet.addDecoration(context);\r\n return;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapFeatureInfoTool.d.ts","sourceRoot":"","sources":["../../../src/Tools/MapFeatureInfoTool.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,aAAa,EACb,YAAY,EACZ,SAAS,EAET,kBAAkB,EAClB,cAAc,EACd,cAAc,EAId,aAAa,EAOd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK9C;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,SAAS,CAAC;IACf,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAqED;;;;;GAKG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,SAAgB,WAAW,iBAAsB,sBAAsB,KAAK,IAAI,EAAI;IACpF,SAAgB,aAAa,kDAAkB;IAE/C,OAAuB,MAAM,SAAwB;IACrD,OAAuB,QAAQ,moCAAuB;IAEtD,OAAO,CAAC,UAAU,CAA0D;IAC5E,OAAO,CAAC,mBAAmB,CAAiD;IAE5E,OAAO,CAAC,MAAM,CAAkD;IAChE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsB;IACvD,OAAO,CAAE,0BAA0B,CAAyB;IAE5C,sBAAsB,IAAI,OAAO;I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2B,IAAI,IAAI;IAI7C,OAAO,CAAC,eAAe;IAaD,aAAa;IA4Db,SAAS;IAU/B;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAaR,UAAU,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,MAAM,CAAC;IASzD,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI7E,gBAAgB,CACpC,EAAE,EAAE,aAAa,GAChB,OAAO,CAAC,YAAY,CAAC;IAmCF,eAAe,CACnC,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,YAAY,CAAC;IAOF,aAAa;IAMnC,gBAAgB;IAChB,SAAS,CAAC,UAAU,IAAI,IAAI;CAmB7B"}
|
|
@@ -104,7 +104,7 @@ class MapFeatureInfoTool extends core_frontend_1.PrimitiveTool {
|
|
|
104
104
|
else {
|
|
105
105
|
// Flush existing decorations until a new selection is made
|
|
106
106
|
this.onInfoCleared.raiseEvent();
|
|
107
|
-
this._decorator.
|
|
107
|
+
this._decorator.clearData();
|
|
108
108
|
}
|
|
109
109
|
vp.invalidateDecorations();
|
|
110
110
|
}
|
|
@@ -205,10 +205,13 @@ class MapFeatureInfoTool extends core_frontend_1.PrimitiveTool {
|
|
|
205
205
|
const pixelRadius = Math.floor(aperture + 0.5);
|
|
206
206
|
mapInfo = await hit.viewport.getMapFeatureInfo(hit, { tolerance: pixelRadius });
|
|
207
207
|
if (mapInfo) {
|
|
208
|
-
this._decorator.
|
|
208
|
+
this._decorator.setData({ hit, mapInfo });
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
core_frontend_1.IModelApp.toolAdmin.setCursor(undefined);
|
|
209
212
|
}
|
|
210
213
|
}
|
|
211
|
-
|
|
214
|
+
catch {
|
|
212
215
|
core_frontend_1.IModelApp.toolAdmin.setCursor(undefined);
|
|
213
216
|
}
|
|
214
217
|
}
|