@itwin/core-frontend 5.3.0 → 5.3.2
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 +36 -1
- package/lib/cjs/BriefcaseConnection.d.ts.map +1 -1
- package/lib/cjs/BriefcaseConnection.js +1 -0
- package/lib/cjs/BriefcaseConnection.js.map +1 -1
- package/lib/cjs/SheetViewState.d.ts +7 -5
- package/lib/cjs/SheetViewState.d.ts.map +1 -1
- package/lib/cjs/SheetViewState.js +52 -683
- package/lib/cjs/SheetViewState.js.map +1 -1
- package/lib/cjs/SubCategoriesCache.d.ts +1 -0
- package/lib/cjs/SubCategoriesCache.d.ts.map +1 -1
- package/lib/cjs/SubCategoriesCache.js +40 -1
- package/lib/cjs/SubCategoriesCache.js.map +1 -1
- package/lib/cjs/internal/SheetViewAttachments.d.ts +57 -0
- package/lib/cjs/internal/SheetViewAttachments.d.ts.map +1 -0
- package/lib/cjs/internal/SheetViewAttachments.js +336 -0
- package/lib/cjs/internal/SheetViewAttachments.js.map +1 -0
- package/lib/cjs/internal/ViewAttachmentRenderer.d.ts +32 -0
- package/lib/cjs/internal/ViewAttachmentRenderer.d.ts.map +1 -0
- package/lib/cjs/internal/ViewAttachmentRenderer.js +462 -0
- package/lib/cjs/internal/ViewAttachmentRenderer.js.map +1 -0
- package/lib/cjs/internal/render/webgl/ShaderBuilder.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/ShaderBuilder.js +8 -1
- package/lib/cjs/internal/render/webgl/ShaderBuilder.js.map +1 -1
- package/lib/esm/BriefcaseConnection.d.ts.map +1 -1
- package/lib/esm/BriefcaseConnection.js +1 -0
- package/lib/esm/BriefcaseConnection.js.map +1 -1
- package/lib/esm/SheetViewState.d.ts +7 -5
- package/lib/esm/SheetViewState.d.ts.map +1 -1
- package/lib/esm/SheetViewState.js +55 -686
- package/lib/esm/SheetViewState.js.map +1 -1
- package/lib/esm/SubCategoriesCache.d.ts +1 -0
- package/lib/esm/SubCategoriesCache.d.ts.map +1 -1
- package/lib/esm/SubCategoriesCache.js +40 -1
- package/lib/esm/SubCategoriesCache.js.map +1 -1
- package/lib/esm/internal/SheetViewAttachments.d.ts +57 -0
- package/lib/esm/internal/SheetViewAttachments.d.ts.map +1 -0
- package/lib/esm/internal/SheetViewAttachments.js +332 -0
- package/lib/esm/internal/SheetViewAttachments.js.map +1 -0
- package/lib/esm/internal/ViewAttachmentRenderer.d.ts +32 -0
- package/lib/esm/internal/ViewAttachmentRenderer.d.ts.map +1 -0
- package/lib/esm/internal/ViewAttachmentRenderer.js +459 -0
- package/lib/esm/internal/ViewAttachmentRenderer.js.map +1 -0
- package/lib/esm/internal/render/webgl/ShaderBuilder.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/ShaderBuilder.js +8 -1
- package/lib/esm/internal/render/webgl/ShaderBuilder.js.map +1 -1
- package/package.json +20 -20
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Views
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.createViewAttachmentRenderer = createViewAttachmentRenderer;
|
|
11
|
+
const core_common_1 = require("@itwin/core-common");
|
|
12
|
+
const CoordSystem_1 = require("../CoordSystem");
|
|
13
|
+
const Frustum2d_1 = require("../Frustum2d");
|
|
14
|
+
const IModelApp_1 = require("../IModelApp");
|
|
15
|
+
const Viewport_1 = require("../Viewport");
|
|
16
|
+
const ImageUtil_1 = require("../common/ImageUtil");
|
|
17
|
+
const ViewRect_1 = require("../common/ViewRect");
|
|
18
|
+
const GraphicType_1 = require("../common/render/GraphicType");
|
|
19
|
+
const FeatureSymbology_1 = require("../render/FeatureSymbology");
|
|
20
|
+
const GraphicBranch_1 = require("../render/GraphicBranch");
|
|
21
|
+
const internal_1 = require("../tile/internal");
|
|
22
|
+
const MockRender_1 = require("./render/MockRender");
|
|
23
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
24
|
+
const core_geometry_1 = require("@itwin/core-geometry");
|
|
25
|
+
const ViewFlagOverrides_1 = require("./tile/ViewFlagOverrides");
|
|
26
|
+
function createViewAttachmentRenderer(args) {
|
|
27
|
+
const { props, view } = args;
|
|
28
|
+
if (props.jsonProperties?.displayOptions?.drawAsRaster || (view.is3d() && view.isCameraOn)) {
|
|
29
|
+
return new RasterAttachment(view, props, args.backgroundColor);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return new OrthographicAttachment(view, props, args.sheetModelId);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** A mostly no-op RenderTarget for an OrthographicAttachment. */
|
|
36
|
+
class AttachmentTarget extends MockRender_1.MockRender.OffScreenTarget {
|
|
37
|
+
_attachment;
|
|
38
|
+
constructor(attachment) {
|
|
39
|
+
// The dimensions don't matter - we're not drawing anything.
|
|
40
|
+
const rect = new ViewRect_1.ViewRect(1, 1);
|
|
41
|
+
super(IModelApp_1.IModelApp.renderSystem, rect);
|
|
42
|
+
this._attachment = attachment;
|
|
43
|
+
}
|
|
44
|
+
changeScene(scene) {
|
|
45
|
+
this._attachment.scene = scene;
|
|
46
|
+
}
|
|
47
|
+
overrideFeatureSymbology(ovrs) {
|
|
48
|
+
this._attachment.symbologyOverrides = ovrs;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** Draws the contents a 2d or orthographic 3d view directly into a sheet view.
|
|
52
|
+
* We select tiles for the view in the context of a light-weight offscreen viewport with a no-op RenderTarget, then
|
|
53
|
+
* collect the resultant graphics and add them to the sheet view's scene.
|
|
54
|
+
*/
|
|
55
|
+
class OrthographicAttachment {
|
|
56
|
+
_viewport;
|
|
57
|
+
_props;
|
|
58
|
+
_sheetModelId;
|
|
59
|
+
_viewFlagOverrides;
|
|
60
|
+
_toSheet;
|
|
61
|
+
_fromSheet;
|
|
62
|
+
_sizeInMeters;
|
|
63
|
+
_range;
|
|
64
|
+
_viewRect = new ViewRect_1.ViewRect(0, 0, 1, 1);
|
|
65
|
+
_originalFrustum = new core_common_1.Frustum();
|
|
66
|
+
_clipVolume;
|
|
67
|
+
_hiddenLineSettings;
|
|
68
|
+
_scale;
|
|
69
|
+
_debugFeatureTable;
|
|
70
|
+
scene;
|
|
71
|
+
symbologyOverrides;
|
|
72
|
+
zDepth;
|
|
73
|
+
get view() {
|
|
74
|
+
return this._viewport.view;
|
|
75
|
+
}
|
|
76
|
+
get viewAttachmentProps() {
|
|
77
|
+
return this._props;
|
|
78
|
+
}
|
|
79
|
+
get viewport() {
|
|
80
|
+
return this._viewport;
|
|
81
|
+
}
|
|
82
|
+
constructor(view, props, sheetModelId) {
|
|
83
|
+
this.symbologyOverrides = new FeatureSymbology_1.FeatureSymbology.Overrides(view);
|
|
84
|
+
const target = new AttachmentTarget(this);
|
|
85
|
+
this._viewport = Viewport_1.OffScreenViewport.createViewport(view, target, true);
|
|
86
|
+
this._props = props;
|
|
87
|
+
this._sheetModelId = sheetModelId;
|
|
88
|
+
const applyClip = true; // set to false for debugging
|
|
89
|
+
this._viewFlagOverrides = {
|
|
90
|
+
...view.viewFlags,
|
|
91
|
+
clipVolume: applyClip,
|
|
92
|
+
lighting: false,
|
|
93
|
+
shadows: false,
|
|
94
|
+
};
|
|
95
|
+
const placement = core_common_1.Placement2d.fromJSON(props.placement);
|
|
96
|
+
const range = placement.calculateRange();
|
|
97
|
+
this._range = range;
|
|
98
|
+
this._sizeInMeters = new core_geometry_1.Point2d(range.xLength(), range.yLength());
|
|
99
|
+
// Compute transform from attached view's world coordinates to sheet's world coordinates.
|
|
100
|
+
// NB: We obtain the extents and origin from the *viewport* not the *view* - they may have been adjusted by the viewport.
|
|
101
|
+
const applySkew = true; // set to false for debugging
|
|
102
|
+
const skew = applySkew ? view.getAspectRatioSkew() : 1;
|
|
103
|
+
const extents = this._viewport.viewingSpace.viewDelta.clone();
|
|
104
|
+
const zDepth = Math.abs(extents.z);
|
|
105
|
+
const scaleX = this._sizeInMeters.x / Math.abs(extents.x);
|
|
106
|
+
const scaleY = skew * this._sizeInMeters.y / Math.abs(extents.y);
|
|
107
|
+
this._scale = { x: 1 / scaleX, y: 1 / scaleY };
|
|
108
|
+
const zBias = Frustum2d_1.Frustum2d.depthFromDisplayPriority(props.jsonProperties?.displayPriority ?? 0);
|
|
109
|
+
this.zDepth = 1.01 * (zDepth - zBias); // give a little padding so that geometry right up against far plane doesn't get clipped.
|
|
110
|
+
// View origin is at the *back* of the view. Align *front* of view based on display priority.
|
|
111
|
+
const viewRot = view.getRotation();
|
|
112
|
+
const viewOrg = viewRot.multiplyVector(this._viewport.viewingSpace.viewOrigin);
|
|
113
|
+
viewOrg.z += zDepth;
|
|
114
|
+
viewRot.multiplyTransposeVectorInPlace(viewOrg);
|
|
115
|
+
const matrix = core_geometry_1.Matrix3d.createScale(scaleX, scaleY, 1);
|
|
116
|
+
matrix.multiplyMatrixMatrix(viewRot, matrix);
|
|
117
|
+
const origin = core_geometry_1.Matrix3d.xyzMinusMatrixTimesXYZ(viewOrg, matrix, viewOrg);
|
|
118
|
+
const attachmentOrigin = core_geometry_1.Point3d.createFrom(placement.origin);
|
|
119
|
+
attachmentOrigin.z = zBias;
|
|
120
|
+
const viewOrgToAttachment = attachmentOrigin.minus(viewOrg);
|
|
121
|
+
origin.addInPlace(viewOrgToAttachment);
|
|
122
|
+
this._toSheet = core_geometry_1.Transform.createRefs(origin, matrix);
|
|
123
|
+
this._fromSheet = (0, core_bentley_1.expectDefined)(this._toSheet.inverse());
|
|
124
|
+
// If the attached view is a section drawing, it may itself have an attached spatial view with a clip.
|
|
125
|
+
// The clip needs to be transformed into sheet space.
|
|
126
|
+
if (view.isDrawingView())
|
|
127
|
+
this._viewport.drawingToSheetTransform = this._toSheet;
|
|
128
|
+
// ###TODO? If we also apply the attachment's clip to the attached view, we may get additional culling during tile selection.
|
|
129
|
+
// However the attached view's frustum is already clipped by intersection with sheet view's frustum, and additional clipping planes
|
|
130
|
+
// introduce additional computation, so possibly not worth it.
|
|
131
|
+
// Transform the view's clip (if any) to sheet space
|
|
132
|
+
let viewClip = view.viewFlags.clipVolume ? view.getViewClip()?.clone() : undefined;
|
|
133
|
+
if (viewClip)
|
|
134
|
+
viewClip.transformInPlace(this._toSheet);
|
|
135
|
+
else
|
|
136
|
+
viewClip = core_geometry_1.ClipVector.createEmpty();
|
|
137
|
+
let sheetClip;
|
|
138
|
+
if (undefined !== props.jsonProperties?.clip)
|
|
139
|
+
sheetClip = core_geometry_1.ClipVector.fromJSON(props.jsonProperties?.clip);
|
|
140
|
+
if (sheetClip && sheetClip.isValid) {
|
|
141
|
+
// Clip to view attachment's clip. NB: clip is in sheet coordinate space.
|
|
142
|
+
for (const clip of sheetClip.clips)
|
|
143
|
+
viewClip.clips.push(clip);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
// Clip to view attachment's bounding box
|
|
147
|
+
viewClip.appendShape([
|
|
148
|
+
core_geometry_1.Point3d.create(this._range.low.x, this._range.low.y),
|
|
149
|
+
core_geometry_1.Point3d.create(this._range.high.x, this._range.low.y),
|
|
150
|
+
core_geometry_1.Point3d.create(this._range.high.x, this._range.high.y),
|
|
151
|
+
core_geometry_1.Point3d.create(this._range.low.x, this._range.high.y),
|
|
152
|
+
]);
|
|
153
|
+
}
|
|
154
|
+
this._clipVolume = IModelApp_1.IModelApp.renderSystem.createClipVolume(viewClip);
|
|
155
|
+
// Save off the original frustum (potentially adjusted by viewport).
|
|
156
|
+
this._viewport.setupFromView();
|
|
157
|
+
this._viewport.viewingSpace.getFrustum(CoordSystem_1.CoordSystem.World, true, this._originalFrustum);
|
|
158
|
+
const applyHiddenLineSettings = true; // for debugging edge display, set to false...
|
|
159
|
+
const style = view.displayStyle;
|
|
160
|
+
if (style.is3d() && applyHiddenLineSettings)
|
|
161
|
+
this._hiddenLineSettings = style.settings.hiddenLineSettings;
|
|
162
|
+
}
|
|
163
|
+
[Symbol.dispose]() {
|
|
164
|
+
this._viewport[Symbol.dispose]();
|
|
165
|
+
}
|
|
166
|
+
discloseTileTrees(trees) {
|
|
167
|
+
trees.disclose(this._viewport);
|
|
168
|
+
}
|
|
169
|
+
addToScene(context) {
|
|
170
|
+
if (context.viewport.freezeScene)
|
|
171
|
+
return;
|
|
172
|
+
if (!context.viewport.view.viewsCategory(this._props.category))
|
|
173
|
+
return;
|
|
174
|
+
const wantBounds = context.viewport.wantViewAttachmentBoundaries;
|
|
175
|
+
const wantClipShapes = context.viewport.wantViewAttachmentClipShapes;
|
|
176
|
+
if (wantBounds || wantClipShapes) {
|
|
177
|
+
const builder = context.createSceneGraphicBuilder();
|
|
178
|
+
if (wantBounds) {
|
|
179
|
+
builder.setSymbology(core_common_1.ColorDef.red, core_common_1.ColorDef.red, 2);
|
|
180
|
+
builder.addRangeBox(this._range);
|
|
181
|
+
}
|
|
182
|
+
if (wantClipShapes && this._clipVolume) {
|
|
183
|
+
builder.setSymbology(core_common_1.ColorDef.blue, core_common_1.ColorDef.blue, 2);
|
|
184
|
+
for (const prim of this._clipVolume.clipVector.clips) {
|
|
185
|
+
if (!(prim instanceof core_geometry_1.ClipShape))
|
|
186
|
+
continue; // ###TODO handle non-shape primitives, if any such ever encountered
|
|
187
|
+
const pts = [];
|
|
188
|
+
const tf = prim.transformFromClip;
|
|
189
|
+
for (const pt of prim.polygon) {
|
|
190
|
+
const tfPt = tf ? tf.multiplyPoint3d(pt) : pt;
|
|
191
|
+
pts.push(new core_geometry_1.Point2d(tfPt.x, tfPt.y));
|
|
192
|
+
}
|
|
193
|
+
builder.addLineString2d(pts, 0);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// Put into a Batch so that we can see tooltip with attachment Id on mouseover.
|
|
197
|
+
const batch = context.target.renderSystem.createBatch(builder.finish(), this.getDebugFeatureTable(), this._range);
|
|
198
|
+
context.outputGraphic(batch);
|
|
199
|
+
}
|
|
200
|
+
if (!context.viewport.wantViewAttachments)
|
|
201
|
+
return;
|
|
202
|
+
// Pixel size used to compute size of ViewRect so that tiles of appropriate LOD are selected.
|
|
203
|
+
const pixelSize = context.viewport.getPixelSizeAtPoint();
|
|
204
|
+
if (0 === pixelSize)
|
|
205
|
+
return;
|
|
206
|
+
// Adjust attached view frustum based on intersection with sheet view frustum.
|
|
207
|
+
const attachFrustum = this._originalFrustum.transformBy(this._toSheet);
|
|
208
|
+
const attachFrustumRange = attachFrustum.toRange();
|
|
209
|
+
const sheetFrustum = context.viewport.getWorldFrustum();
|
|
210
|
+
const sheetFrustumRange = sheetFrustum.toRange();
|
|
211
|
+
const intersect = attachFrustumRange.intersect(sheetFrustumRange);
|
|
212
|
+
if (intersect.isNull)
|
|
213
|
+
return;
|
|
214
|
+
attachFrustum.initFromRange(intersect);
|
|
215
|
+
attachFrustum.transformBy(this._fromSheet, attachFrustum);
|
|
216
|
+
this._viewport.setupViewFromFrustum(attachFrustum);
|
|
217
|
+
// Adjust view rect based on size of attachment on screen so that tiles of appropriate LOD are selected.
|
|
218
|
+
const width = this._sizeInMeters.x * intersect.xLength() / attachFrustumRange.xLength();
|
|
219
|
+
const height = this._sizeInMeters.y * intersect.yLength() / attachFrustumRange.yLength();
|
|
220
|
+
this._viewRect.width = Math.max(1, Math.round(width / pixelSize));
|
|
221
|
+
this._viewRect.height = Math.max(1, Math.round(height / pixelSize));
|
|
222
|
+
this._viewport.setRect(this._viewRect);
|
|
223
|
+
// Propagate settings from on-screen viewport.
|
|
224
|
+
this._viewport.debugBoundingBoxes = context.viewport.debugBoundingBoxes;
|
|
225
|
+
this._viewport.setTileSizeModifier(context.viewport.tileSizeModifier);
|
|
226
|
+
// Create the scene.
|
|
227
|
+
this._viewport.renderFrame();
|
|
228
|
+
const scene = this.scene;
|
|
229
|
+
if (!scene)
|
|
230
|
+
return;
|
|
231
|
+
// Extract scene graphics and insert into on-screen scene context.
|
|
232
|
+
const options = {
|
|
233
|
+
viewAttachmentId: this._props.id,
|
|
234
|
+
clipVolume: this._clipVolume,
|
|
235
|
+
hline: this._hiddenLineSettings,
|
|
236
|
+
frustum: {
|
|
237
|
+
is3d: this.view.is3d(),
|
|
238
|
+
scale: this._scale,
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
const outputGraphics = (source) => {
|
|
242
|
+
if (0 === source.length)
|
|
243
|
+
return;
|
|
244
|
+
const graphics = new GraphicBranch_1.GraphicBranch();
|
|
245
|
+
graphics.setViewFlagOverrides(this._viewFlagOverrides);
|
|
246
|
+
graphics.symbologyOverrides = this.symbologyOverrides;
|
|
247
|
+
for (const graphic of source)
|
|
248
|
+
graphics.entries.push(graphic);
|
|
249
|
+
const branch = context.createGraphicBranch(graphics, this._toSheet, options);
|
|
250
|
+
context.outputGraphic(branch);
|
|
251
|
+
};
|
|
252
|
+
outputGraphics(scene.foreground);
|
|
253
|
+
context.withGraphicType(internal_1.TileGraphicType.BackgroundMap, () => outputGraphics(scene.background));
|
|
254
|
+
context.withGraphicType(internal_1.TileGraphicType.Overlay, () => outputGraphics(scene.overlay));
|
|
255
|
+
// Report tile statistics to sheet view's viewport.
|
|
256
|
+
const tileAdmin = IModelApp_1.IModelApp.tileAdmin;
|
|
257
|
+
const selectedAndReady = tileAdmin.getTilesForUser(this._viewport);
|
|
258
|
+
const requested = tileAdmin.getRequestsForUser(this._viewport);
|
|
259
|
+
tileAdmin.addExternalTilesForUser(context.viewport, {
|
|
260
|
+
requested: requested?.size ?? 0,
|
|
261
|
+
selected: selectedAndReady?.selected.size ?? 0,
|
|
262
|
+
ready: selectedAndReady?.ready.size ?? 0,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
getDebugFeatureTable() {
|
|
266
|
+
if (this._debugFeatureTable)
|
|
267
|
+
return this._debugFeatureTable;
|
|
268
|
+
const featureTable = new core_common_1.FeatureTable(1, this._sheetModelId);
|
|
269
|
+
featureTable.insert(new core_common_1.Feature(this._props.id));
|
|
270
|
+
this._debugFeatureTable = core_common_1.PackedFeatureTable.pack(featureTable);
|
|
271
|
+
return this._debugFeatureTable;
|
|
272
|
+
}
|
|
273
|
+
get areAllTileTreesLoaded() {
|
|
274
|
+
return this.view.areAllTileTreesLoaded;
|
|
275
|
+
}
|
|
276
|
+
collectStatistics(_stats) {
|
|
277
|
+
// Handled by discloseTileTrees()
|
|
278
|
+
}
|
|
279
|
+
get ortho() {
|
|
280
|
+
return {
|
|
281
|
+
toSheet: this._toSheet,
|
|
282
|
+
view: this.view,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function createRasterAttachmentViewport(_view, _rect, _attachment) {
|
|
287
|
+
class RasterAttachmentViewport extends Viewport_1.OffScreenViewport {
|
|
288
|
+
_sceneContext;
|
|
289
|
+
_isSceneReady = false;
|
|
290
|
+
_attachment;
|
|
291
|
+
constructor(view, rect, attachment) {
|
|
292
|
+
super(IModelApp_1.IModelApp.renderSystem.createOffscreenTarget(rect));
|
|
293
|
+
this._attachment = attachment;
|
|
294
|
+
this._isAspectRatioLocked = true;
|
|
295
|
+
this.changeView(view);
|
|
296
|
+
}
|
|
297
|
+
createSceneContext() {
|
|
298
|
+
(0, core_bentley_1.assert)(!this._isSceneReady);
|
|
299
|
+
this._sceneContext = super.createSceneContext();
|
|
300
|
+
return this._sceneContext;
|
|
301
|
+
}
|
|
302
|
+
renderFrame() {
|
|
303
|
+
(0, core_bentley_1.assert)(!this._isSceneReady);
|
|
304
|
+
this.clearSceneContext();
|
|
305
|
+
super.renderFrame();
|
|
306
|
+
if (undefined !== this._sceneContext) {
|
|
307
|
+
this._isSceneReady = !this._sceneContext.hasMissingTiles && this.view.areAllTileTreesLoaded;
|
|
308
|
+
if (this._isSceneReady)
|
|
309
|
+
this._attachment.produceGraphics(this._sceneContext);
|
|
310
|
+
this._sceneContext = undefined;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
clearSceneContext() {
|
|
314
|
+
this._sceneContext = undefined;
|
|
315
|
+
}
|
|
316
|
+
addDecorations() {
|
|
317
|
+
// ###TODO: skybox, ground plane, possibly grid. DecorateContext requires a ScreenViewport...
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
return new RasterAttachmentViewport(_view, _rect, _attachment);
|
|
321
|
+
}
|
|
322
|
+
/** Draws a 3d view (usually with camera enabled) into a sheet view by producing an image of the view's contents offscreen. */
|
|
323
|
+
class RasterAttachment {
|
|
324
|
+
_props;
|
|
325
|
+
_placement;
|
|
326
|
+
_transform;
|
|
327
|
+
zDepth;
|
|
328
|
+
_viewport;
|
|
329
|
+
_graphics;
|
|
330
|
+
constructor(view, props, bgColor) {
|
|
331
|
+
// Render to a 2048x2048 view rect. Scale in Y to preserve aspect ratio.
|
|
332
|
+
const maxSize = 2048;
|
|
333
|
+
const rect = new ViewRect_1.ViewRect(0, 0, maxSize, maxSize);
|
|
334
|
+
const height = maxSize * view.getAspectRatio() * view.getAspectRatioSkew();
|
|
335
|
+
const skew = maxSize / height;
|
|
336
|
+
view.setAspectRatioSkew(skew);
|
|
337
|
+
if (true !== props.jsonProperties?.displayOptions?.preserveBackground) {
|
|
338
|
+
// Make background color 100% transparent so that Viewport.readImageBuffer() will discard transparent pixels.
|
|
339
|
+
view.displayStyle.backgroundColor = bgColor.withAlpha(0);
|
|
340
|
+
}
|
|
341
|
+
this._viewport = createRasterAttachmentViewport(view, rect, this);
|
|
342
|
+
this._props = props;
|
|
343
|
+
this._placement = core_common_1.Placement2d.fromJSON(props.placement);
|
|
344
|
+
this._transform = this._placement.transform;
|
|
345
|
+
this.zDepth = Frustum2d_1.Frustum2d.depthFromDisplayPriority(props.jsonProperties?.displayPriority ?? 0);
|
|
346
|
+
}
|
|
347
|
+
[Symbol.dispose]() {
|
|
348
|
+
this._viewport?.[Symbol.dispose]();
|
|
349
|
+
}
|
|
350
|
+
get viewAttachmentProps() {
|
|
351
|
+
return this._props;
|
|
352
|
+
}
|
|
353
|
+
get viewport() {
|
|
354
|
+
return this._viewport;
|
|
355
|
+
}
|
|
356
|
+
get areAllTileTreesLoaded() {
|
|
357
|
+
return this._viewport?.areAllTileTreesLoaded ?? true;
|
|
358
|
+
}
|
|
359
|
+
addToScene(context) {
|
|
360
|
+
// ###TODO: check viewport.wantViewAttachmentClipShapes
|
|
361
|
+
if (!context.viewport.view.viewsCategory(this._props.category))
|
|
362
|
+
return;
|
|
363
|
+
if (context.viewport.wantViewAttachmentBoundaries) {
|
|
364
|
+
const builder = context.createSceneGraphicBuilder(this._transform);
|
|
365
|
+
builder.setSymbology(core_common_1.ColorDef.red, core_common_1.ColorDef.red, 2);
|
|
366
|
+
builder.addRangeBox(core_geometry_1.Range3d.createRange2d(this._placement.bbox));
|
|
367
|
+
context.outputGraphic(builder.finish());
|
|
368
|
+
}
|
|
369
|
+
if (!context.viewport.wantViewAttachments)
|
|
370
|
+
return;
|
|
371
|
+
if (this._graphics) {
|
|
372
|
+
context.outputGraphic(this._graphics);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (undefined === this._viewport)
|
|
376
|
+
return;
|
|
377
|
+
this._viewport.debugBoundingBoxes = context.viewport.debugBoundingBoxes;
|
|
378
|
+
this._viewport.setTileSizeModifier(context.viewport.tileSizeModifier);
|
|
379
|
+
this._viewport.renderFrame();
|
|
380
|
+
if (this._graphics)
|
|
381
|
+
context.outputGraphic(this._graphics);
|
|
382
|
+
}
|
|
383
|
+
discloseTileTrees(trees) {
|
|
384
|
+
if (this._viewport)
|
|
385
|
+
trees.disclose(this._viewport);
|
|
386
|
+
}
|
|
387
|
+
produceGraphics(context) {
|
|
388
|
+
(0, core_bentley_1.assert)(context.viewport === this._viewport);
|
|
389
|
+
this._graphics = this.createGraphics(this._viewport);
|
|
390
|
+
this._viewport = (0, core_bentley_1.dispose)(this._viewport);
|
|
391
|
+
if (undefined !== this._graphics)
|
|
392
|
+
context.outputGraphic(this._graphics);
|
|
393
|
+
}
|
|
394
|
+
createGraphics(vp) {
|
|
395
|
+
// Create a texture from the contents of the view.
|
|
396
|
+
const image = vp.readImageBuffer({ upsideDown: true });
|
|
397
|
+
if (undefined === image)
|
|
398
|
+
return undefined;
|
|
399
|
+
const debugImage = false; // set to true to open a window displaying the captured image.
|
|
400
|
+
if (debugImage) {
|
|
401
|
+
const url = (0, ImageUtil_1.imageBufferToPngDataUrl)(image, false);
|
|
402
|
+
if (url)
|
|
403
|
+
(0, ImageUtil_1.openImageDataUrlInNewWindow)(url, "Attachment");
|
|
404
|
+
}
|
|
405
|
+
const texture = IModelApp_1.IModelApp.renderSystem.createTexture({
|
|
406
|
+
image: { source: image, transparency: core_common_1.TextureTransparency.Opaque },
|
|
407
|
+
});
|
|
408
|
+
if (!texture)
|
|
409
|
+
return undefined;
|
|
410
|
+
// Create a material for the texture
|
|
411
|
+
const graphicParams = new core_common_1.GraphicParams();
|
|
412
|
+
graphicParams.material = IModelApp_1.IModelApp.renderSystem.createRenderMaterial({ textureMapping: { texture } });
|
|
413
|
+
// Apply the texture to a rectangular polyface.
|
|
414
|
+
const depth = this.zDepth;
|
|
415
|
+
const east = this._placement.bbox.low.x;
|
|
416
|
+
const west = this._placement.bbox.high.x;
|
|
417
|
+
const north = this._placement.bbox.low.y;
|
|
418
|
+
const south = this._placement.bbox.high.y;
|
|
419
|
+
const corners = [
|
|
420
|
+
core_geometry_1.Point3d.create(east, north, depth),
|
|
421
|
+
core_geometry_1.Point3d.create(west, north, depth),
|
|
422
|
+
core_geometry_1.Point3d.create(west, south, depth),
|
|
423
|
+
core_geometry_1.Point3d.create(east, south, depth),
|
|
424
|
+
];
|
|
425
|
+
const params = [
|
|
426
|
+
core_geometry_1.Point2d.create(0, 0),
|
|
427
|
+
core_geometry_1.Point2d.create(1, 0),
|
|
428
|
+
core_geometry_1.Point2d.create(1, 1),
|
|
429
|
+
core_geometry_1.Point2d.create(0, 1),
|
|
430
|
+
];
|
|
431
|
+
const strokeOptions = new core_geometry_1.StrokeOptions();
|
|
432
|
+
strokeOptions.needParams = strokeOptions.shouldTriangulate = true;
|
|
433
|
+
const polyfaceBuilder = core_geometry_1.PolyfaceBuilder.create(strokeOptions);
|
|
434
|
+
polyfaceBuilder.addQuadFacet(corners, params);
|
|
435
|
+
const polyface = polyfaceBuilder.claimPolyface();
|
|
436
|
+
const graphicBuilder = IModelApp_1.IModelApp.renderSystem.createGraphicBuilder(core_geometry_1.Transform.createIdentity(), GraphicType_1.GraphicType.Scene, vp, this._props.id);
|
|
437
|
+
graphicBuilder.activateGraphicParams(graphicParams);
|
|
438
|
+
graphicBuilder.addPolyface(polyface, false);
|
|
439
|
+
const graphic = graphicBuilder.finish();
|
|
440
|
+
// Wrap the polyface in a GraphicBranch.
|
|
441
|
+
const branch = new GraphicBranch_1.GraphicBranch(true);
|
|
442
|
+
const vfOvrs = (0, ViewFlagOverrides_1.createDefaultViewFlagOverrides)({ clipVolume: true, shadows: false, lighting: false, thematic: false });
|
|
443
|
+
// Disable transparency - background pixels are 100% transparent so they will be discarded anyway. Other pixels are 100% opaque.
|
|
444
|
+
vfOvrs.transparency = false;
|
|
445
|
+
branch.setViewFlagOverrides(vfOvrs);
|
|
446
|
+
branch.symbologyOverrides = new FeatureSymbology_1.FeatureSymbology.Overrides();
|
|
447
|
+
branch.entries.push(graphic);
|
|
448
|
+
// Apply the attachment's clip, if any.
|
|
449
|
+
let clipVolume;
|
|
450
|
+
if (this._props.jsonProperties?.clip) {
|
|
451
|
+
const clipVector = core_geometry_1.ClipVector.fromJSON(this._props.jsonProperties?.clip);
|
|
452
|
+
if (clipVector.isValid)
|
|
453
|
+
clipVolume = IModelApp_1.IModelApp.renderSystem.createClipVolume(clipVector);
|
|
454
|
+
}
|
|
455
|
+
return IModelApp_1.IModelApp.renderSystem.createGraphicBranch(branch, this._transform, { clipVolume });
|
|
456
|
+
}
|
|
457
|
+
collectStatistics(stats) {
|
|
458
|
+
if (this._graphics)
|
|
459
|
+
this._graphics.collectStatistics(stats);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
//# sourceMappingURL=ViewAttachmentRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewAttachmentRenderer.js","sourceRoot":"","sources":["../../../src/internal/ViewAttachmentRenderer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AAuCH,oEAYC;AAjDD,oDAAuM;AACvM,gDAA6C;AAC7C,4CAAyC;AACzC,4CAAyC;AAEzC,0CAA0D;AAC1D,mDAA2F;AAC3F,iDAA8C;AAC9C,8DAA2D;AAC3D,iEAA8D;AAC9D,2DAAwD;AAKxD,+CAAyE;AAEzE,oDAAiD;AACjD,sDAAiF;AACjF,wDAA6I;AAC7I,gEAA0E;AAiB1E,SAAgB,4BAA4B,CAAC,IAK5C;IACC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAC7B,IAAI,KAAK,CAAC,cAAc,EAAE,cAAc,EAAE,YAAY,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3F,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACjE,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,sBAAsB,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAED,iEAAiE;AACjE,MAAM,gBAAiB,SAAQ,uBAAU,CAAC,eAAe;IACtC,WAAW,CAAyB;IAErD,YAAmB,UAAkC;QACnD,4DAA4D;QAC5D,MAAM,IAAI,GAAG,IAAI,mBAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAChC,KAAK,CAAC,qBAAS,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QACpC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AAC,IAAI,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,IAAA,kDAA8B,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QAEtH,gIAAgI;QAChI,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC;QAC5B,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,CAAC,kBAAkB,GAAG,IAAI,mCAAgB,CAAC,SAAS,EAAE,CAAC;QAC7D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE7B,uCAAuC;QACvC,IAAI,UAAU,CAAC;QACf,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC;YACrC,MAAM,UAAU,GAAG,0BAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;YACzE,IAAI,UAAU,CAAC,OAAO;gBACpB,UAAU,GAAG,qBAAS,CAAC,YAAY,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACrE,CAAC;QAED,OAAO,qBAAS,CAAC,YAAY,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;IAC7F,CAAC;IAEM,iBAAiB,CAAC,KAA8B;QACrD,IAAI,IAAI,CAAC,SAAS;YAChB,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;CACF","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/** @packageDocumentation\n * @module Views\n */\n\nimport { ColorDef, Feature, FeatureTable, Frustum, GraphicParams, HiddenLine, PackedFeatureTable, Placement2d, TextureTransparency, ViewAttachmentProps, ViewFlagOverrides } from \"@itwin/core-common\";\nimport { CoordSystem } from \"../CoordSystem\";\nimport { Frustum2d } from \"../Frustum2d\";\nimport { IModelApp } from \"../IModelApp\";\nimport { ViewState } from \"../ViewState\";\nimport { OffScreenViewport, Viewport } from \"../Viewport\";\nimport { imageBufferToPngDataUrl, openImageDataUrlInNewWindow } from \"../common/ImageUtil\";\nimport { ViewRect } from \"../common/ViewRect\";\nimport { GraphicType } from \"../common/render/GraphicType\";\nimport { FeatureSymbology } from \"../render/FeatureSymbology\";\nimport { GraphicBranch } from \"../render/GraphicBranch\";\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\nimport { RenderGraphic } from \"../render/RenderGraphic\";\nimport { RenderMemory } from \"../render/RenderMemory\";\nimport { Scene } from \"../render/Scene\";\nimport { DisclosedTileTreeSet, TileGraphicType } from \"../tile/internal\";\nimport { SceneContext } from \"../ViewContext\";\nimport { MockRender } from \"./render/MockRender\";\nimport { assert, dispose, expectDefined, Id64String } from \"@itwin/core-bentley\";\nimport { ClipShape, ClipVector, Matrix3d, Point2d, Point3d, PolyfaceBuilder, Range3d, StrokeOptions, Transform } from \"@itwin/core-geometry\";\nimport { createDefaultViewFlagOverrides } from \"./tile/ViewFlagOverrides\";\n\n/** Draws the contents of a view attachment into a sheet view. */\nexport interface ViewAttachmentRenderer extends Disposable {\n readonly areAllTileTreesLoaded: boolean;\n addToScene: (context: SceneContext) => void;\n discloseTileTrees: (trees: DisclosedTileTreeSet) => void;\n readonly zDepth: number;\n collectStatistics: (stats: RenderMemory.Statistics) => void;\n viewAttachmentProps: ViewAttachmentProps;\n readonly viewport?: Viewport;\n readonly ortho?: {\n readonly toSheet: Transform;\n readonly view: ViewState;\n };\n}\n\nexport function createViewAttachmentRenderer(args: {\n view: ViewState,\n backgroundColor: ColorDef,\n sheetModelId: Id64String,\n props: ViewAttachmentProps,\n}): ViewAttachmentRenderer {\n const { props, view } = args;\n if (props.jsonProperties?.displayOptions?.drawAsRaster || (view.is3d() && view.isCameraOn)) {\n return new RasterAttachment(view, props, args.backgroundColor);\n } else {\n return new OrthographicAttachment(view, props, args.sheetModelId);\n }\n}\n\n/** A mostly no-op RenderTarget for an OrthographicAttachment. */\nclass AttachmentTarget extends MockRender.OffScreenTarget {\n private readonly _attachment: OrthographicAttachment;\n\n public constructor(attachment: OrthographicAttachment) {\n // The dimensions don't matter - we're not drawing anything.\n const rect = new ViewRect(1, 1);\n super(IModelApp.renderSystem, rect);\n this._attachment = attachment;\n }\n\n public override changeScene(scene: Scene): void {\n this._attachment.scene = scene;\n }\n\n public override overrideFeatureSymbology(ovrs: FeatureSymbology.Overrides): void {\n this._attachment.symbologyOverrides = ovrs;\n }\n}\n\n/** Draws the contents a 2d or orthographic 3d view directly into a sheet view.\n * We select tiles for the view in the context of a light-weight offscreen viewport with a no-op RenderTarget, then\n * collect the resultant graphics and add them to the sheet view's scene.\n */\nclass OrthographicAttachment {\n private readonly _viewport: OffScreenViewport;\n private readonly _props: ViewAttachmentProps;\n private readonly _sheetModelId: Id64String;\n private readonly _viewFlagOverrides: ViewFlagOverrides;\n private readonly _toSheet: Transform;\n private readonly _fromSheet: Transform;\n private readonly _sizeInMeters: Point2d;\n private readonly _range: Range3d;\n private readonly _viewRect = new ViewRect(0, 0, 1, 1);\n private readonly _originalFrustum = new Frustum();\n private readonly _clipVolume?: RenderClipVolume;\n private readonly _hiddenLineSettings?: HiddenLine.Settings;\n private readonly _scale: { x: number, y: number };\n private _debugFeatureTable?: PackedFeatureTable;\n public scene?: Scene;\n public symbologyOverrides: FeatureSymbology.Overrides;\n public readonly zDepth: number;\n\n public get view(): ViewState {\n return this._viewport.view;\n }\n\n public get viewAttachmentProps() {\n return this._props;\n }\n\n public get viewport(): Viewport {\n return this._viewport;\n }\n\n public constructor(view: ViewState, props: ViewAttachmentProps, sheetModelId: Id64String) {\n this.symbologyOverrides = new FeatureSymbology.Overrides(view);\n const target = new AttachmentTarget(this);\n this._viewport = OffScreenViewport.createViewport(view, target, true);\n\n this._props = props;\n this._sheetModelId = sheetModelId;\n\n const applyClip = true; // set to false for debugging\n this._viewFlagOverrides = {\n ...view.viewFlags,\n clipVolume: applyClip,\n lighting: false,\n shadows: false,\n };\n\n const placement = Placement2d.fromJSON(props.placement);\n const range = placement.calculateRange();\n this._range = range;\n this._sizeInMeters = new Point2d(range.xLength(), range.yLength());\n\n // Compute transform from attached view's world coordinates to sheet's world coordinates.\n // NB: We obtain the extents and origin from the *viewport* not the *view* - they may have been adjusted by the viewport.\n const applySkew = true; // set to false for debugging\n const skew = applySkew ? view.getAspectRatioSkew() : 1;\n const extents = this._viewport.viewingSpace.viewDelta.clone();\n const zDepth = Math.abs(extents.z);\n const scaleX = this._sizeInMeters.x / Math.abs(extents.x);\n const scaleY = skew * this._sizeInMeters.y / Math.abs(extents.y);\n this._scale = { x: 1 / scaleX, y: 1 / scaleY };\n\n const zBias = Frustum2d.depthFromDisplayPriority(props.jsonProperties?.displayPriority ?? 0);\n this.zDepth = 1.01 * (zDepth - zBias); // give a little padding so that geometry right up against far plane doesn't get clipped.\n\n // View origin is at the *back* of the view. Align *front* of view based on display priority.\n const viewRot = view.getRotation();\n const viewOrg = viewRot.multiplyVector(this._viewport.viewingSpace.viewOrigin);\n viewOrg.z += zDepth;\n viewRot.multiplyTransposeVectorInPlace(viewOrg);\n\n const matrix = Matrix3d.createScale(scaleX, scaleY, 1);\n matrix.multiplyMatrixMatrix(viewRot, matrix);\n const origin = Matrix3d.xyzMinusMatrixTimesXYZ(viewOrg, matrix, viewOrg);\n const attachmentOrigin = Point3d.createFrom(placement.origin);\n attachmentOrigin.z = zBias;\n const viewOrgToAttachment = attachmentOrigin.minus(viewOrg);\n origin.addInPlace(viewOrgToAttachment);\n this._toSheet = Transform.createRefs(origin, matrix);\n this._fromSheet = expectDefined(this._toSheet.inverse());\n\n // If the attached view is a section drawing, it may itself have an attached spatial view with a clip.\n // The clip needs to be transformed into sheet space.\n if (view.isDrawingView())\n this._viewport.drawingToSheetTransform = this._toSheet;\n\n // ###TODO? If we also apply the attachment's clip to the attached view, we may get additional culling during tile selection.\n // However the attached view's frustum is already clipped by intersection with sheet view's frustum, and additional clipping planes\n // introduce additional computation, so possibly not worth it.\n\n // Transform the view's clip (if any) to sheet space\n let viewClip = view.viewFlags.clipVolume ? view.getViewClip()?.clone() : undefined;\n if (viewClip)\n viewClip.transformInPlace(this._toSheet);\n else\n viewClip = ClipVector.createEmpty();\n\n let sheetClip;\n if (undefined !== props.jsonProperties?.clip)\n sheetClip = ClipVector.fromJSON(props.jsonProperties?.clip);\n\n if (sheetClip && sheetClip.isValid) {\n // Clip to view attachment's clip. NB: clip is in sheet coordinate space.\n for (const clip of sheetClip.clips)\n viewClip.clips.push(clip);\n } else {\n // Clip to view attachment's bounding box\n viewClip.appendShape([\n Point3d.create(this._range.low.x, this._range.low.y),\n Point3d.create(this._range.high.x, this._range.low.y),\n Point3d.create(this._range.high.x, this._range.high.y),\n Point3d.create(this._range.low.x, this._range.high.y),\n ]);\n }\n\n this._clipVolume = IModelApp.renderSystem.createClipVolume(viewClip);\n\n // Save off the original frustum (potentially adjusted by viewport).\n this._viewport.setupFromView();\n this._viewport.viewingSpace.getFrustum(CoordSystem.World, true, this._originalFrustum);\n\n const applyHiddenLineSettings = true; // for debugging edge display, set to false...\n const style = view.displayStyle;\n if (style.is3d() && applyHiddenLineSettings)\n this._hiddenLineSettings = style.settings.hiddenLineSettings;\n }\n\n public [Symbol.dispose](): void {\n this._viewport[Symbol.dispose]();\n }\n\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n trees.disclose(this._viewport);\n }\n\n public addToScene(context: SceneContext): void {\n if (context.viewport.freezeScene)\n return;\n\n if (!context.viewport.view.viewsCategory(this._props.category))\n return;\n\n const wantBounds = context.viewport.wantViewAttachmentBoundaries;\n const wantClipShapes = context.viewport.wantViewAttachmentClipShapes;\n if (wantBounds || wantClipShapes) {\n const builder = context.createSceneGraphicBuilder();\n if (wantBounds) {\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\n builder.addRangeBox(this._range);\n }\n\n if (wantClipShapes && this._clipVolume) {\n builder.setSymbology(ColorDef.blue, ColorDef.blue, 2);\n for (const prim of this._clipVolume.clipVector.clips) {\n if (!(prim instanceof ClipShape))\n continue; // ###TODO handle non-shape primitives, if any such ever encountered\n\n const pts = [];\n const tf = prim.transformFromClip;\n for (const pt of prim.polygon) {\n const tfPt = tf ? tf.multiplyPoint3d(pt) : pt;\n pts.push(new Point2d(tfPt.x, tfPt.y));\n }\n\n builder.addLineString2d(pts, 0);\n }\n }\n\n // Put into a Batch so that we can see tooltip with attachment Id on mouseover.\n const batch = context.target.renderSystem.createBatch(builder.finish(), this.getDebugFeatureTable(), this._range);\n context.outputGraphic(batch);\n }\n\n if (!context.viewport.wantViewAttachments)\n return;\n\n // Pixel size used to compute size of ViewRect so that tiles of appropriate LOD are selected.\n const pixelSize = context.viewport.getPixelSizeAtPoint();\n if (0 === pixelSize)\n return;\n\n // Adjust attached view frustum based on intersection with sheet view frustum.\n const attachFrustum = this._originalFrustum.transformBy(this._toSheet);\n const attachFrustumRange = attachFrustum.toRange();\n const sheetFrustum = context.viewport.getWorldFrustum();\n const sheetFrustumRange = sheetFrustum.toRange();\n const intersect = attachFrustumRange.intersect(sheetFrustumRange);\n if (intersect.isNull)\n return;\n\n attachFrustum.initFromRange(intersect);\n attachFrustum.transformBy(this._fromSheet, attachFrustum);\n this._viewport.setupViewFromFrustum(attachFrustum);\n\n // Adjust view rect based on size of attachment on screen so that tiles of appropriate LOD are selected.\n const width = this._sizeInMeters.x * intersect.xLength() / attachFrustumRange.xLength();\n const height = this._sizeInMeters.y * intersect.yLength() / attachFrustumRange.yLength();\n this._viewRect.width = Math.max(1, Math.round(width / pixelSize));\n this._viewRect.height = Math.max(1, Math.round(height / pixelSize));\n this._viewport.setRect(this._viewRect);\n\n // Propagate settings from on-screen viewport.\n this._viewport.debugBoundingBoxes = context.viewport.debugBoundingBoxes;\n this._viewport.setTileSizeModifier(context.viewport.tileSizeModifier);\n\n // Create the scene.\n this._viewport.renderFrame();\n\n const scene = this.scene;\n if (!scene)\n return;\n\n // Extract scene graphics and insert into on-screen scene context.\n const options = {\n viewAttachmentId: this._props.id,\n clipVolume: this._clipVolume,\n hline: this._hiddenLineSettings,\n frustum: {\n is3d: this.view.is3d(),\n scale: this._scale,\n },\n };\n\n const outputGraphics = (source: RenderGraphic[]) => {\n if (0 === source.length)\n return;\n\n const graphics = new GraphicBranch();\n graphics.setViewFlagOverrides(this._viewFlagOverrides);\n graphics.symbologyOverrides = this.symbologyOverrides;\n\n for (const graphic of source)\n graphics.entries.push(graphic);\n\n const branch = context.createGraphicBranch(graphics, this._toSheet, options);\n context.outputGraphic(branch);\n };\n\n outputGraphics(scene.foreground);\n context.withGraphicType(TileGraphicType.BackgroundMap, () => outputGraphics(scene.background));\n context.withGraphicType(TileGraphicType.Overlay, () => outputGraphics(scene.overlay));\n\n // Report tile statistics to sheet view's viewport.\n const tileAdmin = IModelApp.tileAdmin;\n const selectedAndReady = tileAdmin.getTilesForUser(this._viewport);\n const requested = tileAdmin.getRequestsForUser(this._viewport);\n tileAdmin.addExternalTilesForUser(context.viewport, {\n requested: requested?.size ?? 0,\n selected: selectedAndReady?.selected.size ?? 0,\n ready: selectedAndReady?.ready.size ?? 0,\n });\n }\n\n private getDebugFeatureTable(): PackedFeatureTable {\n if (this._debugFeatureTable)\n return this._debugFeatureTable;\n\n const featureTable = new FeatureTable(1, this._sheetModelId);\n featureTable.insert(new Feature(this._props.id));\n this._debugFeatureTable = PackedFeatureTable.pack(featureTable);\n return this._debugFeatureTable;\n }\n\n public get areAllTileTreesLoaded(): boolean {\n return this.view.areAllTileTreesLoaded;\n }\n\n public collectStatistics(_stats: RenderMemory.Statistics): void {\n // Handled by discloseTileTrees()\n }\n\n public get ortho() {\n return {\n toSheet: this._toSheet,\n view: this.view,\n }\n }\n}\n\nfunction createRasterAttachmentViewport(_view: ViewState, _rect: ViewRect, _attachment: RasterAttachment): OffScreenViewport {\n class RasterAttachmentViewport extends OffScreenViewport {\n private _sceneContext?: SceneContext;\n private _isSceneReady = false;\n private readonly _attachment: RasterAttachment;\n\n public constructor(view: ViewState, rect: ViewRect, attachment: RasterAttachment) {\n super(IModelApp.renderSystem.createOffscreenTarget(rect));\n this._attachment = attachment;\n this._isAspectRatioLocked = true;\n this.changeView(view);\n }\n\n public override createSceneContext(): SceneContext {\n assert(!this._isSceneReady);\n\n this._sceneContext = super.createSceneContext();\n return this._sceneContext;\n }\n\n public override renderFrame(): void {\n assert(!this._isSceneReady);\n\n this.clearSceneContext();\n super.renderFrame();\n\n if (undefined !== this._sceneContext) {\n this._isSceneReady = !this._sceneContext.hasMissingTiles && this.view.areAllTileTreesLoaded;\n if (this._isSceneReady)\n this._attachment.produceGraphics(this._sceneContext);\n\n this._sceneContext = undefined;\n }\n }\n\n private clearSceneContext(): void {\n this._sceneContext = undefined;\n }\n\n public override addDecorations(): void {\n // ###TODO: skybox, ground plane, possibly grid. DecorateContext requires a ScreenViewport...\n }\n }\n\n return new RasterAttachmentViewport(_view, _rect, _attachment);\n}\n\n/** Draws a 3d view (usually with camera enabled) into a sheet view by producing an image of the view's contents offscreen. */\nclass RasterAttachment {\n private readonly _props: ViewAttachmentProps;\n private readonly _placement: Placement2d;\n private readonly _transform: Transform;\n public readonly zDepth: number;\n private _viewport?: OffScreenViewport;\n private _graphics?: RenderGraphic;\n\n public constructor(view: ViewState, props: ViewAttachmentProps, bgColor: ColorDef) {\n // Render to a 2048x2048 view rect. Scale in Y to preserve aspect ratio.\n const maxSize = 2048;\n const rect = new ViewRect(0, 0, maxSize, maxSize);\n const height = maxSize * view.getAspectRatio() * view.getAspectRatioSkew();\n const skew = maxSize / height;\n view.setAspectRatioSkew(skew);\n\n if (true !== props.jsonProperties?.displayOptions?.preserveBackground) {\n // Make background color 100% transparent so that Viewport.readImageBuffer() will discard transparent pixels.\n view.displayStyle.backgroundColor = bgColor.withAlpha(0);\n }\n\n this._viewport = createRasterAttachmentViewport(view, rect, this);\n this._props = props;\n this._placement = Placement2d.fromJSON(props.placement);\n this._transform = this._placement.transform;\n this.zDepth = Frustum2d.depthFromDisplayPriority(props.jsonProperties?.displayPriority ?? 0);\n }\n\n public [Symbol.dispose](): void {\n this._viewport?.[Symbol.dispose]();\n }\n\n public get viewAttachmentProps() {\n return this._props;\n }\n\n public get viewport(): Viewport | undefined {\n return this._viewport;\n }\n\n public get areAllTileTreesLoaded() {\n return this._viewport?.areAllTileTreesLoaded ?? true;\n }\n\n public addToScene(context: SceneContext): void {\n // ###TODO: check viewport.wantViewAttachmentClipShapes\n if (!context.viewport.view.viewsCategory(this._props.category))\n return;\n\n if (context.viewport.wantViewAttachmentBoundaries) {\n const builder = context.createSceneGraphicBuilder(this._transform);\n builder.setSymbology(ColorDef.red, ColorDef.red, 2);\n builder.addRangeBox(Range3d.createRange2d(this._placement.bbox));\n context.outputGraphic(builder.finish());\n }\n\n if (!context.viewport.wantViewAttachments)\n return;\n\n if (this._graphics) {\n context.outputGraphic(this._graphics);\n return;\n }\n\n if (undefined === this._viewport)\n return;\n\n this._viewport.debugBoundingBoxes = context.viewport.debugBoundingBoxes;\n this._viewport.setTileSizeModifier(context.viewport.tileSizeModifier);\n\n this._viewport.renderFrame();\n if (this._graphics)\n context.outputGraphic(this._graphics);\n }\n\n public discloseTileTrees(trees: DisclosedTileTreeSet) {\n if (this._viewport)\n trees.disclose(this._viewport);\n }\n\n public produceGraphics(context: SceneContext): void {\n assert(context.viewport === this._viewport);\n this._graphics = this.createGraphics(this._viewport);\n this._viewport = dispose(this._viewport);\n\n if (undefined !== this._graphics)\n context.outputGraphic(this._graphics);\n }\n\n private createGraphics(vp: Viewport): RenderGraphic | undefined {\n // Create a texture from the contents of the view.\n const image = vp.readImageBuffer({ upsideDown: true });\n if (undefined === image)\n return undefined;\n\n const debugImage = false; // set to true to open a window displaying the captured image.\n if (debugImage) {\n const url = imageBufferToPngDataUrl(image, false);\n if (url)\n openImageDataUrlInNewWindow(url, \"Attachment\");\n }\n\n const texture = IModelApp.renderSystem.createTexture({\n image: { source: image, transparency: TextureTransparency.Opaque },\n });\n if (!texture)\n return undefined;\n\n // Create a material for the texture\n const graphicParams = new GraphicParams();\n graphicParams.material = IModelApp.renderSystem.createRenderMaterial({ textureMapping: { texture } });\n\n // Apply the texture to a rectangular polyface.\n const depth = this.zDepth;\n const east = this._placement.bbox.low.x;\n const west = this._placement.bbox.high.x;\n const north = this._placement.bbox.low.y;\n const south = this._placement.bbox.high.y;\n const corners = [\n Point3d.create(east, north, depth),\n Point3d.create(west, north, depth),\n Point3d.create(west, south, depth),\n Point3d.create(east, south, depth),\n ];\n const params = [\n Point2d.create(0, 0),\n Point2d.create(1, 0),\n Point2d.create(1, 1),\n Point2d.create(0, 1),\n ];\n\n const strokeOptions = new StrokeOptions();\n strokeOptions.needParams = strokeOptions.shouldTriangulate = true;\n const polyfaceBuilder = PolyfaceBuilder.create(strokeOptions);\n polyfaceBuilder.addQuadFacet(corners, params);\n const polyface = polyfaceBuilder.claimPolyface();\n\n const graphicBuilder = IModelApp.renderSystem.createGraphicBuilder(Transform.createIdentity(), GraphicType.Scene, vp, this._props.id);\n graphicBuilder.activateGraphicParams(graphicParams);\n graphicBuilder.addPolyface(polyface, false);\n const graphic = graphicBuilder.finish();\n\n // Wrap the polyface in a GraphicBranch.\n const branch = new GraphicBranch(true);\n const vfOvrs = createDefaultViewFlagOverrides({ clipVolume: true, shadows: false, lighting: false, thematic: false });\n\n // Disable transparency - background pixels are 100% transparent so they will be discarded anyway. Other pixels are 100% opaque.\n vfOvrs.transparency = false;\n branch.setViewFlagOverrides(vfOvrs);\n branch.symbologyOverrides = new FeatureSymbology.Overrides();\n branch.entries.push(graphic);\n\n // Apply the attachment's clip, if any.\n let clipVolume;\n if (this._props.jsonProperties?.clip) {\n const clipVector = ClipVector.fromJSON(this._props.jsonProperties?.clip);\n if (clipVector.isValid)\n clipVolume = IModelApp.renderSystem.createClipVolume(clipVector);\n }\n\n return IModelApp.renderSystem.createGraphicBranch(branch, this._transform, { clipVolume });\n }\n\n public collectStatistics(stats: RenderMemory.Statistics): void {\n if (this._graphics)\n this._graphics.collectStatistics(stats);\n }\n}\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShaderBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/internal/render/webgl/ShaderBuilder.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIlD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD;;GAEG;AACH,0BAAkB,YAAY;IAC5B,OAAO,IAAA,CAAE,OAAO;IAChB,GAAG,IAAA,CAAE,MAAM;IACX,KAAK,IAAA,CAAE,QAAQ;IACf,IAAI,IAAA,CAAE,OAAO;IACb,IAAI,IAAA,CAAE,OAAO;IACb,IAAI,IAAA,CAAE,OAAO;IACb,IAAI,IAAA,CAAE,OAAO;IACb,IAAI,IAAA,CAAE,OAAO;IACb,SAAS,IAAA,CAAE,YAAY;IACvB,WAAW,IAAA,CAAE,cAAc;IAC3B,IAAI,KAAA,CAAE,OAAO;IACb,KAAK,KAAA,CAAE,QAAQ;IAEf,KAAK,KAAA;CACN;AAED;;GAEG;AACH,0BAAkB,aAAa;IAC7B,MAAM,IAAA,CAAE,eAAe;IACvB,OAAO,IAAA,CAAE,UAAU;IACnB,OAAO,IAAA,CAAE,UAAU;IAEnB,KAAK,IAAA;CACN;AAED;;GAEG;AACH,0BAAkB,iBAAiB;IACjC,OAAO,IAAA,CAAE,+FAA+F;IACxG,GAAG,IAAA,CAAE,OAAO;IACZ,MAAM,IAAA,CAAE,UAAU;IAClB,IAAI,IAAA,CAAE,QAAQ;IAEd,KAAK,IAAA;CACN;AAgDD;;;;;GAKG;AACH,MAAM,M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AAO,EAAE,kBAAkB,EAAE,KAAK,GAAE,UAA4B;IAGlI,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY;IAG3C,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,GAAE,UAA4B,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,OAAe;IAIzH,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM;IAIpF,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAO/F,kCAAkC,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAM7G,kGAAkG;IAC3F,YAAY,CAAC,EAAE,EAAE,sBAAsB,GAAG,aAAa;IAmCvD,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAKrD,mDAAmD;IAC5C,KAAK,IAAI,cAAc;CAM/B"}
|
|
@@ -614,12 +614,19 @@ class VertexShaderBuilder extends ShaderBuilder {
|
|
|
614
614
|
}
|
|
615
615
|
main.addline(" v_color = baseColor;");
|
|
616
616
|
}
|
|
617
|
+
/*
|
|
618
|
+
There is currently a driver glitch which is known to affect much of the Intel Ultra 7 family of chipsets when using Intel driver from some point after driver version 32.0.101.6078 (9/13/2024).
|
|
619
|
+
|
|
620
|
+
The graphics driver will glitch when discarding triangles using the vertex shader (setting all vertices to the same value) if gl_Position was not initialized to a valid position beforehand.
|
|
621
|
+
|
|
622
|
+
The workaround for this bug involves ensuring that gl_Position is initialized to a valid position before attempting a discard using a degenerate triangle.
|
|
623
|
+
*/
|
|
624
|
+
main.addline(" gl_Position = computePosition(rawPosition);");
|
|
617
625
|
const checkForDiscard = this.get(9 /* VertexShaderComponent.CheckForDiscard */);
|
|
618
626
|
if (undefined !== checkForDiscard) {
|
|
619
627
|
prelude.addFunction("bool checkForDiscard()", checkForDiscard);
|
|
620
628
|
main.add(Vertex_1.vertexDiscard);
|
|
621
629
|
}
|
|
622
|
-
main.addline(" gl_Position = computePosition(rawPosition);");
|
|
623
630
|
const finalizePos = this.get(13 /* VertexShaderComponent.FinalizePosition */);
|
|
624
631
|
if (undefined !== finalizePos) {
|
|
625
632
|
prelude.addFunction("vec4 finalizePosition(vec4 pos)", finalizePos);
|