@itwin/core-frontend 5.0.0-dev.100 → 5.0.0-dev.104
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 +6 -1
- package/lib/cjs/AccuDraw.d.ts.map +1 -1
- package/lib/cjs/AccuDraw.js +20 -41
- package/lib/cjs/AccuDraw.js.map +1 -1
- package/lib/cjs/ModelState.d.ts.map +1 -1
- package/lib/cjs/ModelState.js +7 -5
- package/lib/cjs/ModelState.js.map +1 -1
- package/lib/cjs/internal/cross-package.d.ts +1 -1
- package/lib/cjs/internal/cross-package.d.ts.map +1 -1
- package/lib/cjs/internal/cross-package.js +3 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/internal/render/webgl/MapLayerParams.d.ts +0 -1
- package/lib/cjs/internal/render/webgl/MapLayerParams.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/MapLayerParams.js +11 -20
- package/lib/cjs/internal/render/webgl/MapLayerParams.js.map +1 -1
- package/lib/cjs/internal/render/webgl/SurfaceGeometry.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/SurfaceGeometry.js +16 -8
- package/lib/cjs/internal/render/webgl/SurfaceGeometry.js.map +1 -1
- package/lib/cjs/internal/tile/GraphicsCollector.d.ts +1 -0
- package/lib/cjs/internal/tile/GraphicsCollector.d.ts.map +1 -1
- package/lib/cjs/internal/tile/GraphicsCollector.js +1 -0
- package/lib/cjs/internal/tile/GraphicsCollector.js.map +1 -1
- package/lib/cjs/internal/tile/IModelTile.d.ts.map +1 -1
- package/lib/cjs/internal/tile/IModelTile.js +5 -0
- package/lib/cjs/internal/tile/IModelTile.js.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.d.ts +4 -1
- package/lib/cjs/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.js +5 -0
- package/lib/cjs/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/ImdlDecoder.d.ts +2 -0
- package/lib/cjs/internal/tile/ImdlDecoder.d.ts.map +1 -1
- package/lib/cjs/internal/tile/ImdlDecoder.js.map +1 -1
- package/lib/cjs/internal/tile/ImdlGraphicsCreator.d.ts +2 -2
- package/lib/cjs/internal/tile/ImdlGraphicsCreator.d.ts.map +1 -1
- package/lib/cjs/internal/tile/ImdlGraphicsCreator.js +2 -1
- package/lib/cjs/internal/tile/ImdlGraphicsCreator.js.map +1 -1
- package/lib/cjs/{tile → internal/tile}/LayerTileTreeHandler.d.ts +3 -3
- package/lib/cjs/internal/tile/LayerTileTreeHandler.d.ts.map +1 -0
- package/lib/cjs/{tile → internal/tile}/LayerTileTreeHandler.js +3 -2
- package/lib/cjs/internal/tile/LayerTileTreeHandler.js.map +1 -0
- package/lib/cjs/{tile → internal/tile}/LayerTileTreeReferenceHandler.d.ts +7 -5
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -0
- package/lib/cjs/{tile → internal/tile}/LayerTileTreeReferenceHandler.js +29 -4
- package/lib/cjs/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -0
- package/lib/cjs/internal/tile/PrimaryTileTree.d.ts +9 -4
- package/lib/cjs/internal/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/PrimaryTileTree.js +30 -8
- package/lib/cjs/internal/tile/PrimaryTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts +0 -2
- package/lib/cjs/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/RealityModelTileTree.js +2 -21
- package/lib/cjs/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/tile/ImdlReader.d.ts +3 -2
- package/lib/cjs/tile/ImdlReader.d.ts.map +1 -1
- package/lib/cjs/tile/ImdlReader.js +1 -0
- package/lib/cjs/tile/ImdlReader.js.map +1 -1
- package/lib/cjs/tile/internal.d.ts +3 -2
- package/lib/cjs/tile/internal.d.ts.map +1 -1
- package/lib/cjs/tile/internal.js +3 -2
- package/lib/cjs/tile/internal.js.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapTileTree.js +2 -4
- package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
- package/lib/cjs/tools/AccuDrawViewportUI.d.ts +0 -1
- package/lib/cjs/tools/AccuDrawViewportUI.d.ts.map +1 -1
- package/lib/cjs/tools/AccuDrawViewportUI.js +15 -19
- package/lib/cjs/tools/AccuDrawViewportUI.js.map +1 -1
- package/lib/cjs/tools/ViewTool.d.ts +25 -16
- package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
- package/lib/cjs/tools/ViewTool.js +29 -40
- package/lib/cjs/tools/ViewTool.js.map +1 -1
- package/lib/esm/AccuDraw.d.ts.map +1 -1
- package/lib/esm/AccuDraw.js +21 -42
- package/lib/esm/AccuDraw.js.map +1 -1
- package/lib/esm/ModelState.d.ts.map +1 -1
- package/lib/esm/ModelState.js +7 -5
- package/lib/esm/ModelState.js.map +1 -1
- package/lib/esm/internal/cross-package.d.ts +1 -1
- package/lib/esm/internal/cross-package.d.ts.map +1 -1
- package/lib/esm/internal/cross-package.js +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/internal/render/webgl/MapLayerParams.d.ts +0 -1
- package/lib/esm/internal/render/webgl/MapLayerParams.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/MapLayerParams.js +11 -20
- package/lib/esm/internal/render/webgl/MapLayerParams.js.map +1 -1
- package/lib/esm/internal/render/webgl/SurfaceGeometry.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/SurfaceGeometry.js +16 -8
- package/lib/esm/internal/render/webgl/SurfaceGeometry.js.map +1 -1
- package/lib/esm/internal/tile/GraphicsCollector.d.ts +1 -0
- package/lib/esm/internal/tile/GraphicsCollector.d.ts.map +1 -1
- package/lib/esm/internal/tile/GraphicsCollector.js +1 -0
- package/lib/esm/internal/tile/GraphicsCollector.js.map +1 -1
- package/lib/esm/internal/tile/IModelTile.d.ts.map +1 -1
- package/lib/esm/internal/tile/IModelTile.js +6 -1
- package/lib/esm/internal/tile/IModelTile.js.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.d.ts +4 -1
- package/lib/esm/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.js +6 -1
- package/lib/esm/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/esm/internal/tile/ImdlDecoder.d.ts +2 -0
- package/lib/esm/internal/tile/ImdlDecoder.d.ts.map +1 -1
- package/lib/esm/internal/tile/ImdlDecoder.js.map +1 -1
- package/lib/esm/internal/tile/ImdlGraphicsCreator.d.ts +2 -2
- package/lib/esm/internal/tile/ImdlGraphicsCreator.d.ts.map +1 -1
- package/lib/esm/internal/tile/ImdlGraphicsCreator.js +2 -1
- package/lib/esm/internal/tile/ImdlGraphicsCreator.js.map +1 -1
- package/lib/esm/{tile → internal/tile}/LayerTileTreeHandler.d.ts +3 -3
- package/lib/esm/internal/tile/LayerTileTreeHandler.d.ts.map +1 -0
- package/lib/esm/{tile → internal/tile}/LayerTileTreeHandler.js +3 -2
- package/lib/esm/internal/tile/LayerTileTreeHandler.js.map +1 -0
- package/lib/esm/{tile → internal/tile}/LayerTileTreeReferenceHandler.d.ts +7 -5
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.d.ts.map +1 -0
- package/lib/esm/{tile → internal/tile}/LayerTileTreeReferenceHandler.js +29 -4
- package/lib/esm/internal/tile/LayerTileTreeReferenceHandler.js.map +1 -0
- package/lib/esm/internal/tile/PrimaryTileTree.d.ts +9 -4
- package/lib/esm/internal/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/PrimaryTileTree.js +32 -10
- package/lib/esm/internal/tile/PrimaryTileTree.js.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts +0 -2
- package/lib/esm/internal/tile/RealityModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/RealityModelTileTree.js +2 -21
- package/lib/esm/internal/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/tile/ImdlReader.d.ts +3 -2
- package/lib/esm/tile/ImdlReader.d.ts.map +1 -1
- package/lib/esm/tile/ImdlReader.js +1 -0
- package/lib/esm/tile/ImdlReader.js.map +1 -1
- package/lib/esm/tile/internal.d.ts +3 -2
- package/lib/esm/tile/internal.d.ts.map +1 -1
- package/lib/esm/tile/internal.js +3 -2
- package/lib/esm/tile/internal.js.map +1 -1
- package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
- package/lib/esm/tile/map/MapTileTree.js +2 -4
- package/lib/esm/tile/map/MapTileTree.js.map +1 -1
- package/lib/esm/tools/AccuDrawViewportUI.d.ts +0 -1
- package/lib/esm/tools/AccuDrawViewportUI.d.ts.map +1 -1
- package/lib/esm/tools/AccuDrawViewportUI.js +16 -20
- package/lib/esm/tools/AccuDrawViewportUI.js.map +1 -1
- package/lib/esm/tools/ViewTool.d.ts +25 -16
- package/lib/esm/tools/ViewTool.d.ts.map +1 -1
- package/lib/esm/tools/ViewTool.js +29 -40
- package/lib/esm/tools/ViewTool.js.map +1 -1
- package/package.json +16 -16
- package/lib/cjs/tile/LayerTileTreeHandler.d.ts.map +0 -1
- package/lib/cjs/tile/LayerTileTreeHandler.js.map +0 -1
- package/lib/cjs/tile/LayerTileTreeReferenceHandler.d.ts.map +0 -1
- package/lib/cjs/tile/LayerTileTreeReferenceHandler.js.map +0 -1
- package/lib/esm/tile/LayerTileTreeHandler.d.ts.map +0 -1
- package/lib/esm/tile/LayerTileTreeHandler.js.map +0 -1
- package/lib/esm/tile/LayerTileTreeReferenceHandler.d.ts.map +0 -1
- package/lib/esm/tile/LayerTileTreeReferenceHandler.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelState.d.ts","sourceRoot":"","sources":["../../src/ModelState.ts"],"names":[],"mappings":"AAIA;;G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;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,qBAAqB;IAC1D,wHAAwH;IACxH,SAAgB,WAAW,CAAC,EAAE,uBAAuB,CAAC;IAEtD,WAA2B,SAAS,WAA6B;IAEjE,IAAoB,cAAc,IAAI,iBAAiB,CAAiB;gBAErD,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,CAAC,EAAE,iBAAiB;IAMzF,6EAA6E;IAC7E,IAAW,cAAc,IAAI,OAAO,CAEnC;CACF;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,iBAAiB;IACvD,WAA2B,SAAS,WAA8B;CACnE;AAED;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,iBAAiB;IAC9D,WAA2B,SAAS,WAAqC;CAC1E;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,qBAAqB;IAC1D,WAA2B,SAAS,WAA6B;CAClE;AAED;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,iBAAiB;IAC7D,WAA2B,SAAS,WAAoC;CACzE"}
|
package/lib/cjs/ModelState.js
CHANGED
|
@@ -100,6 +100,8 @@ class GeometricModelState extends ModelState {
|
|
|
100
100
|
const spatialModel = this.asSpatialModel;
|
|
101
101
|
const rdSourceKey = this.jsonProperties.rdSourceKey;
|
|
102
102
|
const getDisplaySettings = () => view.displayStyle.settings.getRealityModelDisplaySettings(this.id) ?? core_common_1.RealityModelDisplaySettings.defaults;
|
|
103
|
+
const getBackgroundBase = () => view.displayStyle.settings?.mapImagery.backgroundBase;
|
|
104
|
+
const getBackgroundLayers = () => view.displayStyle.settings?.mapImagery.backgroundLayers;
|
|
103
105
|
if (rdSourceKey) {
|
|
104
106
|
const useOrbitGtTileTreeReference = rdSourceKey.format === core_common_1.RealityDataFormat.OPC;
|
|
105
107
|
const treeRef = (!useOrbitGtTileTreeReference) ?
|
|
@@ -111,8 +113,8 @@ class GeometricModelState extends ModelState {
|
|
|
111
113
|
// url: tilesetUrl, // If rdSourceKey is defined, url is not used
|
|
112
114
|
classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,
|
|
113
115
|
getDisplaySettings,
|
|
114
|
-
getBackgroundBase
|
|
115
|
-
getBackgroundLayers
|
|
116
|
+
getBackgroundBase,
|
|
117
|
+
getBackgroundLayers,
|
|
116
118
|
}) :
|
|
117
119
|
(0, internal_1.createOrbitGtTileTreeReference)({
|
|
118
120
|
rdSourceKey,
|
|
@@ -161,11 +163,11 @@ class GeometricModelState extends ModelState {
|
|
|
161
163
|
tilesetToDbTransform: this.jsonProperties.tilesetToDbTransform,
|
|
162
164
|
classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,
|
|
163
165
|
getDisplaySettings,
|
|
164
|
-
getBackgroundBase
|
|
165
|
-
getBackgroundLayers
|
|
166
|
+
getBackgroundBase,
|
|
167
|
+
getBackgroundLayers,
|
|
166
168
|
});
|
|
167
169
|
}
|
|
168
|
-
return (0, internal_1.createPrimaryTileTreeReference)(view, this);
|
|
170
|
+
return (0, internal_1.createPrimaryTileTreeReference)(view, this, getBackgroundBase, getBackgroundLayers);
|
|
169
171
|
}
|
|
170
172
|
}
|
|
171
173
|
exports.GeometricModelState = GeometricModelState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelState.js","sourceRoot":"","sources":["../../src/ModelState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkE;AAClE,oDAE4B;AAC5B,wDAAwD;AACxD,+CAA4C;AAG5C,2DAAwD;AACxD,8CAAoJ;AAEpJ,uEAAoE;AAEpE;;;GAGG;AACH,MAAa,UAAW,SAAQ,yBAAW;IAClC,MAAM,KAAc,SAAS,KAAK,OAAO,OAAO,CAAC,CAAC,CAAC;IAC1C,cAAc,CAAiB;IAC/B,IAAI,CAAS;IACtB,WAAW,CAAa;IACf,SAAS,CAAU;IACnB,UAAU,CAAU;IAEpC,YAAY,KAAiB,EAAE,MAAwB,EAAE,KAAkB;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;QACvF,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAC5B,IAAI,IAAI,CAAC,cAAc;YACrB,IAAI,CAAC,WAAW,GAAG,iDAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3E,CAAC;IAED,6EAA6E;IAC7E,IAAW,cAAc;QACvB,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;IACpH,CAAC;CACF;AAlBD,8CAkBC;AAED;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,iBAAiB;IAChD,MAAM,KAAc,SAAS,KAAK,OAAO,eAAe,CAAC,CAAC,CAAC;CACnE;AAFD,gDAEC;AAED;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,iBAAiB;IACvD,MAAM,KAAc,SAAS,KAAK,OAAO,sBAAsB,CAAC,CAAC,CAAC;CAC1E;AAFD,8DAEC;AAED;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,qBAAqB;IACnD,MAAM,KAAc,SAAS,KAAK,OAAO,cAAc,CAAC,CAAC,CAAC;CAClE;AAFD,8CAEC;AAED;;;GAGG;AACH,MAAa,wBAAyB,SAAQ,iBAAiB;IACtD,MAAM,KAAc,SAAS,KAAK,OAAO,qBAAqB,CAAC,CAAC,CAAC;CACzE;AAFD,4DAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ModelState\r\n */\r\n\r\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, ModelProps, RealityDataFormat, RealityDataSourceKey, RealityModelDisplaySettings, RelatedElement,\r\n} from \"@itwin/core-common\";\r\nimport { Point2d, Range3d } from \"@itwin/core-geometry\";\r\nimport { EntityState } from \"./EntityState\";\r\nimport { HitDetail } from \"./HitDetail\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { RealityDataSource } from \"./RealityDataSource\";\r\nimport { createOrbitGtTileTreeReference, createPrimaryTileTreeReference, createRealityTileTreeReference, TileTreeReference } from \"./tile/internal\";\r\nimport { ViewState } from \"./ViewState\";\r\nimport { SpatialClassifiersState } from \"./SpatialClassifiersState\";\r\n\r\n/** Represents the front-end state of a [Model]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class ModelState extends EntityState implements ModelProps {\r\n public static override get className() { return \"Model\"; }\r\n public readonly modeledElement: RelatedElement;\r\n public readonly name: string;\r\n public parentModel: Id64String;\r\n public readonly isPrivate: boolean;\r\n public readonly isTemplate: boolean;\r\n\r\n constructor(props: ModelProps, iModel: IModelConnection, state?: ModelState) {\r\n super(props, iModel, state);\r\n this.modeledElement = RelatedElement.fromJSON(props.modeledElement)!;\r\n this.name = props.name ? props.name : \"\";\r\n this.parentModel = Id64.fromJSON(props.parentModel)!; // NB! Must always match the model of the modeledElement!\r\n this.isPrivate = JsonUtils.asBool(props.isPrivate);\r\n this.isTemplate = JsonUtils.asBool(props.isTemplate);\r\n }\r\n\r\n /** Add all custom-handled properties of a Model to a json object. */\r\n public override toJSON(): ModelProps {\r\n const val = super.toJSON() as ModelProps;\r\n val.modeledElement = this.modeledElement;\r\n val.parentModel = this.parentModel;\r\n val.name = this.name;\r\n if (this.isPrivate)\r\n val.isPrivate = this.isPrivate;\r\n if (this.isTemplate)\r\n val.isTemplate = this.isTemplate;\r\n return val;\r\n }\r\n\r\n /** Determine whether this is a GeometricModel */\r\n public get isGeometricModel(): boolean { return false; }\r\n\r\n /** Attempts to cast this model to a geometric model. */\r\n public get asGeometricModel(): GeometricModelState | undefined { return undefined; }\r\n /** Attempts to cast this model to a 3d geometric model. */\r\n public get asGeometricModel3d(): GeometricModel3dState | undefined { return undefined; }\r\n /** Attempts to cast this model to a 2d geometric model. */\r\n public get asGeometricModel2d(): GeometricModel2dState | undefined { return undefined; }\r\n /** Attempts to cast this model to a spatial model. */\r\n public get asSpatialModel(): SpatialModelState | undefined { return undefined; }\r\n\r\n /**\r\n * Return the tool tip for this model. This is called only if the hit does not return a tooltip.\r\n * @internal\r\n */\r\n public getToolTip(_hit: HitDetail): HTMLElement | string | undefined { return undefined; }\r\n}\r\n\r\n/** Represents the front-end state of a [GeometricModel]($backend).\r\n * The contents of a GeometricModelState can be rendered inside a [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class GeometricModelState extends ModelState implements GeometricModelProps {\r\n public static override get className() { return \"GeometricModel\"; }\r\n /** @internal */\r\n public geometryGuid?: string;\r\n\r\n private _modelRange?: Range3d;\r\n\r\n constructor(props: GeometricModelProps, iModel: IModelConnection, state?: GeometricModelState) {\r\n super(props, iModel, state);\r\n this.geometryGuid = props.geometryGuid;\r\n }\r\n\r\n /** Returns true if this is a 3d model (a [[GeometricModel3dState]]). */\r\n public abstract get is3d(): boolean;\r\n public override get asGeometricModel(): GeometricModelState { return this; }\r\n /** Returns true if this is a 2d model (a [[GeometricModel2dState]]). */\r\n public get is2d(): boolean { return !this.is3d; }\r\n\r\n public override get isGeometricModel(): boolean { return true; }\r\n /** @internal */\r\n public get treeModelId(): Id64String { return this.id; }\r\n\r\n /** Query for the union of the ranges of all the elements in this GeometricModel.\r\n * @note This value is cached after the first time it is called.\r\n * @public\r\n */\r\n public async queryModelRange(): Promise<Range3d> {\r\n if (undefined === this._modelRange) {\r\n const ranges = await this.iModel.models.queryExtents(this.id);\r\n this._modelRange = Range3d.fromJSON(ranges[0]?.extents);\r\n }\r\n\r\n return this._modelRange;\r\n }\r\n\r\n /** @internal */\r\n public createTileTreeReference(view: ViewState): TileTreeReference {\r\n // If this is a reality model, its tile tree is obtained from reality data service URL.\r\n\r\n const spatialModel = this.asSpatialModel;\r\n const rdSourceKey = this.jsonProperties.rdSourceKey;\r\n const getDisplaySettings = () => view.displayStyle.settings.getRealityModelDisplaySettings(this.id) ?? RealityModelDisplaySettings.defaults;\r\n\r\n if (rdSourceKey) {\r\n const useOrbitGtTileTreeReference = rdSourceKey.format === RealityDataFormat.OPC;\r\n\r\n const treeRef = (!useOrbitGtTileTreeReference) ?\r\n createRealityTileTreeReference({\r\n rdSourceKey,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n // url: tilesetUrl, // If rdSourceKey is defined, url is not used\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n getBackgroundBase: () => view.displayStyle.settings.mapImagery.backgroundBase,\r\n getBackgroundLayers: () => view.displayStyle.settings.mapImagery.backgroundLayers,\r\n }) :\r\n createOrbitGtTileTreeReference({\r\n rdSourceKey,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n // orbitGtBlob: props.orbitGtBlob!, // If rdSourceKey is defined, orbitGtBlob is not used\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n });\r\n return treeRef;\r\n }\r\n\r\n const orbitGtBlob = this.jsonProperties.orbitGtBlob;\r\n\r\n // If this is an OrbitGt reality model, create it's reference\r\n if(orbitGtBlob) {\r\n let orbitGtName = \"\";\r\n if (orbitGtBlob.blobFileName !== \"\") {\r\n if (orbitGtBlob.blobFileName[0] === \"/\")\r\n orbitGtName = orbitGtBlob.blobFileName.substring(1);\r\n else\r\n orbitGtName = orbitGtBlob.blobFileName;\r\n }\r\n // Create rdSourceKey if not provided\r\n const rdSourceKeyOGT: RealityDataSourceKey = RealityDataSource.createKeyFromOrbitGtBlobProps(orbitGtBlob);\r\n\r\n return createOrbitGtTileTreeReference({\r\n rdSourceKey: rdSourceKeyOGT,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n orbitGtBlob,\r\n name: orbitGtName,\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n });\r\n }\r\n\r\n // If this is a TileTree reality model, create it's reference\r\n const tilesetUrl = this.jsonProperties.tilesetUrl;\r\n\r\n if(tilesetUrl) {\r\n const rdSourceKeyCS = RealityDataSource.createKeyFromUrl(tilesetUrl);\r\n return createRealityTileTreeReference({\r\n rdSourceKey: rdSourceKeyCS,\r\n url : tilesetUrl,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n tilesetToDbTransform: this.jsonProperties.tilesetToDbTransform,\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n getBackgroundBase: () => view.displayStyle.settings.mapImagery.backgroundBase,\r\n getBackgroundLayers: () => view.displayStyle.settings.mapImagery.backgroundLayers,\r\n });\r\n }\r\n\r\n return createPrimaryTileTreeReference(view, this);\r\n\r\n }\r\n}\r\n/** Represents the front-end state of a [GeometricModel2d]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class GeometricModel2dState extends GeometricModelState implements GeometricModel2dProps {\r\n public static override get className() { return \"GeometricModel2d\"; }\r\n /** @internal */\r\n public readonly globalOrigin: Point2d;\r\n\r\n constructor(props: GeometricModel2dProps, iModel: IModelConnection, state?: GeometricModel2dState) {\r\n super(props, iModel, state);\r\n this.globalOrigin = Point2d.fromJSON(props.globalOrigin);\r\n }\r\n\r\n public get is3d(): boolean { return false; }\r\n public override get asGeometricModel2d(): GeometricModel2dState { return this; }\r\n\r\n public override toJSON(): GeometricModel2dProps {\r\n const val = super.toJSON() as GeometricModel2dProps;\r\n val.globalOrigin = this.globalOrigin;\r\n return val;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [GeometricModel3d]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class GeometricModel3dState extends GeometricModelState {\r\n public static override get className() { return \"GeometricModel3d\"; }\r\n\r\n constructor(props: GeometricModel3dProps, iModel: IModelConnection, state?: GeometricModel3dState) {\r\n super(props, iModel, state);\r\n this.isNotSpatiallyLocated = JsonUtils.asBool(props.isNotSpatiallyLocated);\r\n this.isPlanProjection = JsonUtils.asBool(props.isPlanProjection);\r\n }\r\n\r\n public override toJSON(): GeometricModel3dProps {\r\n const val = super.toJSON() as GeometricModel3dProps;\r\n if (this.isNotSpatiallyLocated)\r\n val.isNotSpatiallyLocated = true;\r\n\r\n if (this.isPlanProjection)\r\n val.isPlanProjection = true;\r\n\r\n return val;\r\n }\r\n\r\n public get is3d(): boolean { return true; }\r\n public override get asGeometricModel3d(): GeometricModel3dState { return this; }\r\n\r\n /** If true, then the elements in this GeometricModel3dState are expected to be in an XY plane.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isPlanProjection: boolean;\r\n\r\n /** If true, then the elements in this GeometricModel3dState are not in real-world coordinates and will not be in the spatial index.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isNotSpatiallyLocated: boolean;\r\n\r\n /** If true, then the elements in this GeometricModel3dState are in real-world coordinates and will be in the spatial index. */\r\n public get isSpatiallyLocated(): boolean { return !this.isNotSpatiallyLocated; }\r\n}\r\n\r\n/** Represents the front-end state of a [SheetModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SheetModelState extends GeometricModel2dState {\r\n public static override get className() { return \"SheetModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SpatialModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SpatialModelState extends GeometricModel3dState {\r\n /** If this is a reality model, provides access to a list of available spatial classifiers that can be applied to it. */\r\n public readonly classifiers?: SpatialClassifiersState;\r\n\r\n public static override get className() { return \"SpatialModel\"; }\r\n\r\n public override get asSpatialModel(): SpatialModelState { return this; }\r\n\r\n public constructor(props: ModelProps, iModel: IModelConnection, state?: SpatialModelState) {\r\n super(props, iModel, state);\r\n if (this.isRealityModel)\r\n this.classifiers = SpatialClassifiersState.create(this.jsonProperties);\r\n }\r\n\r\n /** Return true if this is a reality model (represented by a 3d tile set). */\r\n public get isRealityModel(): boolean {\r\n return !!this.jsonProperties.tilesetUrl || !!this.jsonProperties.rdSourceKey || !!this.jsonProperties.orbitGtBlob;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [PhysicalModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class PhysicalModelState extends SpatialModelState {\r\n public static override get className() { return \"PhysicalModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SpatialLocationModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SpatialLocationModelState extends SpatialModelState {\r\n public static override get className() { return \"SpatialLocationModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [DrawingModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class DrawingModelState extends GeometricModel2dState {\r\n public static override get className() { return \"DrawingModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SectionDrawingModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SectionDrawingModelState extends DrawingModelState {\r\n public static override get className() { return \"SectionDrawingModel\"; }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ModelState.js","sourceRoot":"","sources":["../../src/ModelState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkE;AAClE,oDAE4B;AAC5B,wDAAwD;AACxD,+CAA4C;AAG5C,2DAAwD;AACxD,8CAAoJ;AAEpJ,uEAAoE;AAEpE;;;GAGG;AACH,MAAa,UAAW,SAAQ,yBAAW;IAClC,MAAM,KAAc,SAAS,KAAK,OAAO,OAAO,CAAC,CAAC,CAAC;IAC1C,cAAc,CAAiB;IAC/B,IAAI,CAAS;IACtB,WAAW,CAAa;IACf,SAAS,CAAU;IACnB,UAAU,CAAU;IAEpC,YAAY,KAAiB,EAAE,MAAwB,EAAE,KAAkB;QACzE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAC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AAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3E,CAAC;IAED,6EAA6E;IAC7E,IAAW,cAAc;QACvB,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;IACpH,CAAC;CACF;AAlBD,8CAkBC;AAED;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,iBAAiB;IAChD,MAAM,KAAc,SAAS,KAAK,OAAO,eAAe,CAAC,CAAC,CAAC;CACnE;AAFD,gDAEC;AAED;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,iBAAiB;IACvD,MAAM,KAAc,SAAS,KAAK,OAAO,sBAAsB,CAAC,CAAC,CAAC;CAC1E;AAFD,8DAEC;AAED;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,qBAAqB;IACnD,MAAM,KAAc,SAAS,KAAK,OAAO,cAAc,CAAC,CAAC,CAAC;CAClE;AAFD,8CAEC;AAED;;;GAGG;AACH,MAAa,wBAAyB,SAAQ,iBAAiB;IACtD,MAAM,KAAc,SAAS,KAAK,OAAO,qBAAqB,CAAC,CAAC,CAAC;CACzE;AAFD,4DAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ModelState\r\n */\r\n\r\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, ModelProps, RealityDataFormat, RealityDataSourceKey, RealityModelDisplaySettings, RelatedElement,\r\n} from \"@itwin/core-common\";\r\nimport { Point2d, Range3d } from \"@itwin/core-geometry\";\r\nimport { EntityState } from \"./EntityState\";\r\nimport { HitDetail } from \"./HitDetail\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { RealityDataSource } from \"./RealityDataSource\";\r\nimport { createOrbitGtTileTreeReference, createPrimaryTileTreeReference, createRealityTileTreeReference, TileTreeReference } from \"./tile/internal\";\r\nimport { ViewState } from \"./ViewState\";\r\nimport { SpatialClassifiersState } from \"./SpatialClassifiersState\";\r\n\r\n/** Represents the front-end state of a [Model]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class ModelState extends EntityState implements ModelProps {\r\n public static override get className() { return \"Model\"; }\r\n public readonly modeledElement: RelatedElement;\r\n public readonly name: string;\r\n public parentModel: Id64String;\r\n public readonly isPrivate: boolean;\r\n public readonly isTemplate: boolean;\r\n\r\n constructor(props: ModelProps, iModel: IModelConnection, state?: ModelState) {\r\n super(props, iModel, state);\r\n this.modeledElement = RelatedElement.fromJSON(props.modeledElement)!;\r\n this.name = props.name ? props.name : \"\";\r\n this.parentModel = Id64.fromJSON(props.parentModel)!; // NB! Must always match the model of the modeledElement!\r\n this.isPrivate = JsonUtils.asBool(props.isPrivate);\r\n this.isTemplate = JsonUtils.asBool(props.isTemplate);\r\n }\r\n\r\n /** Add all custom-handled properties of a Model to a json object. */\r\n public override toJSON(): ModelProps {\r\n const val = super.toJSON() as ModelProps;\r\n val.modeledElement = this.modeledElement;\r\n val.parentModel = this.parentModel;\r\n val.name = this.name;\r\n if (this.isPrivate)\r\n val.isPrivate = this.isPrivate;\r\n if (this.isTemplate)\r\n val.isTemplate = this.isTemplate;\r\n return val;\r\n }\r\n\r\n /** Determine whether this is a GeometricModel */\r\n public get isGeometricModel(): boolean { return false; }\r\n\r\n /** Attempts to cast this model to a geometric model. */\r\n public get asGeometricModel(): GeometricModelState | undefined { return undefined; }\r\n /** Attempts to cast this model to a 3d geometric model. */\r\n public get asGeometricModel3d(): GeometricModel3dState | undefined { return undefined; }\r\n /** Attempts to cast this model to a 2d geometric model. */\r\n public get asGeometricModel2d(): GeometricModel2dState | undefined { return undefined; }\r\n /** Attempts to cast this model to a spatial model. */\r\n public get asSpatialModel(): SpatialModelState | undefined { return undefined; }\r\n\r\n /**\r\n * Return the tool tip for this model. This is called only if the hit does not return a tooltip.\r\n * @internal\r\n */\r\n public getToolTip(_hit: HitDetail): HTMLElement | string | undefined { return undefined; }\r\n}\r\n\r\n/** Represents the front-end state of a [GeometricModel]($backend).\r\n * The contents of a GeometricModelState can be rendered inside a [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class GeometricModelState extends ModelState implements GeometricModelProps {\r\n public static override get className() { return \"GeometricModel\"; }\r\n /** @internal */\r\n public geometryGuid?: string;\r\n\r\n private _modelRange?: Range3d;\r\n\r\n constructor(props: GeometricModelProps, iModel: IModelConnection, state?: GeometricModelState) {\r\n super(props, iModel, state);\r\n this.geometryGuid = props.geometryGuid;\r\n }\r\n\r\n /** Returns true if this is a 3d model (a [[GeometricModel3dState]]). */\r\n public abstract get is3d(): boolean;\r\n public override get asGeometricModel(): GeometricModelState { return this; }\r\n /** Returns true if this is a 2d model (a [[GeometricModel2dState]]). */\r\n public get is2d(): boolean { return !this.is3d; }\r\n\r\n public override get isGeometricModel(): boolean { return true; }\r\n /** @internal */\r\n public get treeModelId(): Id64String { return this.id; }\r\n\r\n /** Query for the union of the ranges of all the elements in this GeometricModel.\r\n * @note This value is cached after the first time it is called.\r\n * @public\r\n */\r\n public async queryModelRange(): Promise<Range3d> {\r\n if (undefined === this._modelRange) {\r\n const ranges = await this.iModel.models.queryExtents(this.id);\r\n this._modelRange = Range3d.fromJSON(ranges[0]?.extents);\r\n }\r\n\r\n return this._modelRange;\r\n }\r\n\r\n /** @internal */\r\n public createTileTreeReference(view: ViewState): TileTreeReference {\r\n // If this is a reality model, its tile tree is obtained from reality data service URL.\r\n\r\n const spatialModel = this.asSpatialModel;\r\n const rdSourceKey = this.jsonProperties.rdSourceKey;\r\n const getDisplaySettings = () => view.displayStyle.settings.getRealityModelDisplaySettings(this.id) ?? RealityModelDisplaySettings.defaults;\r\n const getBackgroundBase = () => view.displayStyle.settings?.mapImagery.backgroundBase;\r\n const getBackgroundLayers = () => view.displayStyle.settings?.mapImagery.backgroundLayers\r\n\r\n if (rdSourceKey) {\r\n const useOrbitGtTileTreeReference = rdSourceKey.format === RealityDataFormat.OPC;\r\n\r\n const treeRef = (!useOrbitGtTileTreeReference) ?\r\n createRealityTileTreeReference({\r\n rdSourceKey,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n // url: tilesetUrl, // If rdSourceKey is defined, url is not used\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n getBackgroundBase,\r\n getBackgroundLayers,\r\n }) :\r\n createOrbitGtTileTreeReference({\r\n rdSourceKey,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n // orbitGtBlob: props.orbitGtBlob!, // If rdSourceKey is defined, orbitGtBlob is not used\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n });\r\n return treeRef;\r\n }\r\n\r\n const orbitGtBlob = this.jsonProperties.orbitGtBlob;\r\n\r\n // If this is an OrbitGt reality model, create it's reference\r\n if(orbitGtBlob) {\r\n let orbitGtName = \"\";\r\n if (orbitGtBlob.blobFileName !== \"\") {\r\n if (orbitGtBlob.blobFileName[0] === \"/\")\r\n orbitGtName = orbitGtBlob.blobFileName.substring(1);\r\n else\r\n orbitGtName = orbitGtBlob.blobFileName;\r\n }\r\n // Create rdSourceKey if not provided\r\n const rdSourceKeyOGT: RealityDataSourceKey = RealityDataSource.createKeyFromOrbitGtBlobProps(orbitGtBlob);\r\n\r\n return createOrbitGtTileTreeReference({\r\n rdSourceKey: rdSourceKeyOGT,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n orbitGtBlob,\r\n name: orbitGtName,\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n });\r\n }\r\n\r\n // If this is a TileTree reality model, create it's reference\r\n const tilesetUrl = this.jsonProperties.tilesetUrl;\r\n\r\n if(tilesetUrl) {\r\n const rdSourceKeyCS = RealityDataSource.createKeyFromUrl(tilesetUrl);\r\n return createRealityTileTreeReference({\r\n rdSourceKey: rdSourceKeyCS,\r\n url : tilesetUrl,\r\n iModel: this.iModel,\r\n source: view,\r\n modelId: this.id,\r\n tilesetToDbTransform: this.jsonProperties.tilesetToDbTransform,\r\n classifiers: undefined !== spatialModel ? spatialModel.classifiers : undefined,\r\n getDisplaySettings,\r\n getBackgroundBase,\r\n getBackgroundLayers,\r\n });\r\n }\r\n\r\n return createPrimaryTileTreeReference(view, this, getBackgroundBase, getBackgroundLayers);\r\n }\r\n}\r\n/** Represents the front-end state of a [GeometricModel2d]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class GeometricModel2dState extends GeometricModelState implements GeometricModel2dProps {\r\n public static override get className() { return \"GeometricModel2d\"; }\r\n /** @internal */\r\n public readonly globalOrigin: Point2d;\r\n\r\n constructor(props: GeometricModel2dProps, iModel: IModelConnection, state?: GeometricModel2dState) {\r\n super(props, iModel, state);\r\n this.globalOrigin = Point2d.fromJSON(props.globalOrigin);\r\n }\r\n\r\n public get is3d(): boolean { return false; }\r\n public override get asGeometricModel2d(): GeometricModel2dState { return this; }\r\n\r\n public override toJSON(): GeometricModel2dProps {\r\n const val = super.toJSON() as GeometricModel2dProps;\r\n val.globalOrigin = this.globalOrigin;\r\n return val;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [GeometricModel3d]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class GeometricModel3dState extends GeometricModelState {\r\n public static override get className() { return \"GeometricModel3d\"; }\r\n\r\n constructor(props: GeometricModel3dProps, iModel: IModelConnection, state?: GeometricModel3dState) {\r\n super(props, iModel, state);\r\n this.isNotSpatiallyLocated = JsonUtils.asBool(props.isNotSpatiallyLocated);\r\n this.isPlanProjection = JsonUtils.asBool(props.isPlanProjection);\r\n }\r\n\r\n public override toJSON(): GeometricModel3dProps {\r\n const val = super.toJSON() as GeometricModel3dProps;\r\n if (this.isNotSpatiallyLocated)\r\n val.isNotSpatiallyLocated = true;\r\n\r\n if (this.isPlanProjection)\r\n val.isPlanProjection = true;\r\n\r\n return val;\r\n }\r\n\r\n public get is3d(): boolean { return true; }\r\n public override get asGeometricModel3d(): GeometricModel3dState { return this; }\r\n\r\n /** If true, then the elements in this GeometricModel3dState are expected to be in an XY plane.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isPlanProjection: boolean;\r\n\r\n /** If true, then the elements in this GeometricModel3dState are not in real-world coordinates and will not be in the spatial index.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isNotSpatiallyLocated: boolean;\r\n\r\n /** If true, then the elements in this GeometricModel3dState are in real-world coordinates and will be in the spatial index. */\r\n public get isSpatiallyLocated(): boolean { return !this.isNotSpatiallyLocated; }\r\n}\r\n\r\n/** Represents the front-end state of a [SheetModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SheetModelState extends GeometricModel2dState {\r\n public static override get className() { return \"SheetModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SpatialModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SpatialModelState extends GeometricModel3dState {\r\n /** If this is a reality model, provides access to a list of available spatial classifiers that can be applied to it. */\r\n public readonly classifiers?: SpatialClassifiersState;\r\n\r\n public static override get className() { return \"SpatialModel\"; }\r\n\r\n public override get asSpatialModel(): SpatialModelState { return this; }\r\n\r\n public constructor(props: ModelProps, iModel: IModelConnection, state?: SpatialModelState) {\r\n super(props, iModel, state);\r\n if (this.isRealityModel)\r\n this.classifiers = SpatialClassifiersState.create(this.jsonProperties);\r\n }\r\n\r\n /** Return true if this is a reality model (represented by a 3d tile set). */\r\n public get isRealityModel(): boolean {\r\n return !!this.jsonProperties.tilesetUrl || !!this.jsonProperties.rdSourceKey || !!this.jsonProperties.orbitGtBlob;\r\n }\r\n}\r\n\r\n/** Represents the front-end state of a [PhysicalModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class PhysicalModelState extends SpatialModelState {\r\n public static override get className() { return \"PhysicalModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SpatialLocationModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SpatialLocationModelState extends SpatialModelState {\r\n public static override get className() { return \"SpatialLocationModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [DrawingModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class DrawingModelState extends GeometricModel2dState {\r\n public static override get className() { return \"DrawingModel\"; }\r\n}\r\n\r\n/** Represents the front-end state of a [SectionDrawingModel]($backend).\r\n * @public\r\n * @extensions\r\n */\r\nexport class SectionDrawingModelState extends DrawingModelState {\r\n public static override get className() { return \"SectionDrawingModel\"; }\r\n}\r\n"]}
|
|
@@ -9,7 +9,7 @@ export { PerformanceMetrics } from "./render/webgl/PerformanceMetrics";
|
|
|
9
9
|
export { type GLTimerResult, RenderDiagnostics, type RenderSystemDebugControl } from "./render/RenderSystemDebugControl";
|
|
10
10
|
export { formatAnimationBranchId } from "./render/AnimationBranchState";
|
|
11
11
|
export { PrimitiveVisibility, type RenderTargetDebugControl } from "./render/RenderTargetDebugControl";
|
|
12
|
-
export { acquireImdlDecoder, appendQueryParams, ArcGisErrorCode, ArcGisGeometryReaderJSON, type ArcGisGetServiceJsonArgs, ArcGISImageryProvider, type ArcGISServiceMetadata, ArcGisUtilities, type ArcGisValidateSourceArgs, createSpatialTileTreeReferences, deflateCoordinates, type FeatureAttributeDrivenSymbology, FeatureGeometryBaseRenderer, type FeatureGeometryRenderer, FeatureGraphicsRenderer, type FeatureSymbolizedRenderer, type FeatureSymbologyRenderer, GltfReader, type GltfReaderArgs, type GltfReaderResult, type GraphicsGeometryRenderer, ImageryMapTileTree, type ImdlDecoder, ImdlReader, type MapLayerInfoFromTileTree, MapTileTreeReference, RealityModelTileUtils, RealityTileLoader, SpatialTileTreeReferences, type WGS84Extent, WmsUtilities, } from "../tile/internal";
|
|
12
|
+
export { acquireImdlDecoder, appendQueryParams, ArcGisErrorCode, ArcGisGeometryReaderJSON, type ArcGisGetServiceJsonArgs, ArcGISImageryProvider, type ArcGISServiceMetadata, ArcGisUtilities, type ArcGisValidateSourceArgs, createSpatialTileTreeReferences, deflateCoordinates, type FeatureAttributeDrivenSymbology, FeatureGeometryBaseRenderer, type FeatureGeometryRenderer, FeatureGraphicsRenderer, type FeatureSymbolizedRenderer, type FeatureSymbologyRenderer, GltfReader, type GltfReaderArgs, type GltfReaderResult, type GraphicsGeometryRenderer, ImageryMapTileTree, type ImdlDecoder, ImdlReader, type MapLayerInfoFromTileTree, MapTileTreeReference, RealityModelTileUtils, RealityTileLoader, SpatialTileTreeReferences, type WGS84Extent, WmsUtilities, LayerTileTreeHandler, type MapLayerTreeSetting, LayerTileTreeReferenceHandler, } from "../tile/internal";
|
|
13
13
|
export { DebugShaderFile } from "./render/RenderSystemDebugControl";
|
|
14
14
|
export { IModelTileTree } from "./tile/IModelTileTree";
|
|
15
15
|
//# sourceMappingURL=cross-package.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-package.d.ts","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,KAAK,aAAa,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AACzH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K,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAGvG,OAAO,EACN,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,eAAe,EACf,KAAK,wBAAwB,EAC7B,+BAA+B,EAC/B,kBAAkB,EAClB,KAAK,+BAA+B,EACpC,2BAA2B,EAC3B,KAAK,uBAAuB,EAC5B,uBAAuB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,kBAAkB,EAClB,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,wBAAwB,EAC7B,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,WAAW,EAChB,YAAY,EACZ,oBAAoB,EAAE,KAAK,mBAAmB,EAAE,6BAA6B,GAC7E,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module Utils
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.IModelTileTree = exports.DebugShaderFile = exports.WmsUtilities = exports.SpatialTileTreeReferences = exports.RealityTileLoader = exports.RealityModelTileUtils = exports.MapTileTreeReference = exports.ImdlReader = exports.ImageryMapTileTree = exports.GltfReader = exports.FeatureGraphicsRenderer = exports.FeatureGeometryBaseRenderer = exports.deflateCoordinates = exports.createSpatialTileTreeReferences = exports.ArcGisUtilities = exports.ArcGISImageryProvider = exports.ArcGisGeometryReaderJSON = exports.ArcGisErrorCode = exports.appendQueryParams = exports.acquireImdlDecoder = exports.PrimitiveVisibility = exports.formatAnimationBranchId = exports.RenderDiagnostics = exports.PerformanceMetrics = exports.Target = exports.OnScreenTarget = exports.GltfDataType = exports.AnimationNodeId = exports._scheduleScriptReference = exports._callIpcChannel = void 0;
|
|
10
|
+
exports.IModelTileTree = exports.DebugShaderFile = exports.LayerTileTreeReferenceHandler = exports.LayerTileTreeHandler = exports.WmsUtilities = exports.SpatialTileTreeReferences = exports.RealityTileLoader = exports.RealityModelTileUtils = exports.MapTileTreeReference = exports.ImdlReader = exports.ImageryMapTileTree = exports.GltfReader = exports.FeatureGraphicsRenderer = exports.FeatureGeometryBaseRenderer = exports.deflateCoordinates = exports.createSpatialTileTreeReferences = exports.ArcGisUtilities = exports.ArcGISImageryProvider = exports.ArcGisGeometryReaderJSON = exports.ArcGisErrorCode = exports.appendQueryParams = exports.acquireImdlDecoder = exports.PrimitiveVisibility = exports.formatAnimationBranchId = exports.RenderDiagnostics = exports.PerformanceMetrics = exports.Target = exports.OnScreenTarget = exports.GltfDataType = exports.AnimationNodeId = exports._scheduleScriptReference = exports._callIpcChannel = void 0;
|
|
11
11
|
var Symbols_1 = require("../common/internal/Symbols");
|
|
12
12
|
Object.defineProperty(exports, "_callIpcChannel", { enumerable: true, get: function () { return Symbols_1._callIpcChannel; } });
|
|
13
13
|
Object.defineProperty(exports, "_scheduleScriptReference", { enumerable: true, get: function () { return Symbols_1._scheduleScriptReference; } });
|
|
@@ -46,6 +46,8 @@ Object.defineProperty(exports, "RealityModelTileUtils", { enumerable: true, get:
|
|
|
46
46
|
Object.defineProperty(exports, "RealityTileLoader", { enumerable: true, get: function () { return internal_1.RealityTileLoader; } });
|
|
47
47
|
Object.defineProperty(exports, "SpatialTileTreeReferences", { enumerable: true, get: function () { return internal_1.SpatialTileTreeReferences; } });
|
|
48
48
|
Object.defineProperty(exports, "WmsUtilities", { enumerable: true, get: function () { return internal_1.WmsUtilities; } });
|
|
49
|
+
Object.defineProperty(exports, "LayerTileTreeHandler", { enumerable: true, get: function () { return internal_1.LayerTileTreeHandler; } });
|
|
50
|
+
Object.defineProperty(exports, "LayerTileTreeReferenceHandler", { enumerable: true, get: function () { return internal_1.LayerTileTreeReferenceHandler; } });
|
|
49
51
|
// Used by display-test-app which currently builds using both ESModules and CommonJS.
|
|
50
52
|
// Remove once CommonJS is dropped.
|
|
51
53
|
var RenderSystemDebugControl_2 = require("./render/RenderSystemDebugControl");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuF;AAA9E,0GAAA,eAAe,OAAA;AAAE,mHAAA,wBAAwB,OAAA;AAClD,6EAA4E;AAAnE,kHAAA,eAAe,OAAA;AACxB,wDAAiF;AAAxE,0GAAA,YAAY,OAAA;AACrB,gDAA+D;AAAtD,wGAAA,cAAc,OAAA;AAAE,gGAAA,MAAM,OAAA;AAC/B,wEAAuE;AAA9D,wHAAA,kBAAkB,OAAA;AAC3B,8EAAyH;AAA5F,6HAAA,iBAAiB,OAAA;AAC9C,sEAAwE;AAA/D,+HAAA,uBAAuB,OAAA;AAChC,8EAAuG;AAA9F,+HAAA,mBAAmB,OAAA;AAE5B,iEAAiE;AACjE,
|
|
1
|
+
{"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuF;AAA9E,0GAAA,eAAe,OAAA;AAAE,mHAAA,wBAAwB,OAAA;AAClD,6EAA4E;AAAnE,kHAAA,eAAe,OAAA;AACxB,wDAAiF;AAAxE,0GAAA,YAAY,OAAA;AACrB,gDAA+D;AAAtD,wGAAA,cAAc,OAAA;AAAE,gGAAA,MAAM,OAAA;AAC/B,wEAAuE;AAA9D,wHAAA,kBAAkB,OAAA;AAC3B,8EAAyH;AAA5F,6HAAA,iBAAiB,OAAA;AAC9C,sEAAwE;AAA/D,+HAAA,uBAAuB,OAAA;AAChC,8EAAuG;AAA9F,+HAAA,mBAAmB,OAAA;AAE5B,iEAAiE;AACjE,6CAiC0B;AAhCzB,8GAAA,kBAAkB,OAAA;AAClB,6GAAA,iBAAiB,OAAA;AACjB,2GAAA,eAAe,OAAA;AACf,oHAAA,wBAAwB,OAAA;AAExB,iHAAA,qBAAqB,OAAA;AAErB,2GAAA,eAAe,OAAA;AAEf,2HAAA,+BAA+B,OAAA;AAC/B,8GAAA,kBAAkB,OAAA;AAElB,uHAAA,2BAA2B,OAAA;AAE3B,mHAAA,uBAAuB,OAAA;AAGvB,sGAAA,UAAU,OAAA;AAIV,8GAAA,kBAAkB,OAAA;AAElB,sGAAA,UAAU,OAAA;AAEV,gHAAA,oBAAoB,OAAA;AACpB,iHAAA,qBAAqB,OAAA;AACrB,6GAAA,iBAAiB,OAAA;AACjB,qHAAA,yBAAyB,OAAA;AAEzB,wGAAA,YAAY,OAAA;AACZ,gHAAA,oBAAoB,OAAA;AAA4B,yHAAA,6BAA6B,OAAA;AAG9E,qFAAqF;AACrF,mCAAmC;AACnC,8EAAoE;AAA3D,2HAAA,eAAe,OAAA;AACxB,wDAAuD;AAA9C,gHAAA,cAAc,OAAA","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 Utils\n */\n\nexport { _callIpcChannel, _scheduleScriptReference } from \"../common/internal/Symbols\";\nexport { AnimationNodeId } from \"../common/internal/render/AnimationNodeId\";\nexport { GltfDataType, type GltfMeshPrimitive } from \"../common/gltf/GltfSchema\";\nexport { OnScreenTarget, Target } from \"./render/webgl/Target\";\nexport { PerformanceMetrics } from \"./render/webgl/PerformanceMetrics\";\nexport { type GLTimerResult, RenderDiagnostics, type RenderSystemDebugControl } from \"./render/RenderSystemDebugControl\";\nexport { formatAnimationBranchId } from \"./render/AnimationBranchState\";\nexport { PrimitiveVisibility, type RenderTargetDebugControl } from \"./render/RenderTargetDebugControl\";\n\n// Used by frontend-tiles, map-layers-formats, frontend-dev-tools\nexport {\n acquireImdlDecoder,\n appendQueryParams,\n ArcGisErrorCode,\n ArcGisGeometryReaderJSON,\n type ArcGisGetServiceJsonArgs,\n ArcGISImageryProvider,\n type ArcGISServiceMetadata,\n ArcGisUtilities,\n type ArcGisValidateSourceArgs,\n createSpatialTileTreeReferences,\n deflateCoordinates,\n type FeatureAttributeDrivenSymbology,\n FeatureGeometryBaseRenderer,\n type FeatureGeometryRenderer,\n FeatureGraphicsRenderer,\n type FeatureSymbolizedRenderer,\n type FeatureSymbologyRenderer,\n GltfReader,\n type GltfReaderArgs,\n type GltfReaderResult,\n type GraphicsGeometryRenderer,\n ImageryMapTileTree,\n type ImdlDecoder,\n ImdlReader,\n type MapLayerInfoFromTileTree,\n MapTileTreeReference,\n RealityModelTileUtils,\n RealityTileLoader,\n SpatialTileTreeReferences,\n type WGS84Extent,\n WmsUtilities,\n LayerTileTreeHandler, type MapLayerTreeSetting, LayerTileTreeReferenceHandler,\n} from \"../tile/internal\";\n\n// Used by display-test-app which currently builds using both ESModules and CommonJS.\n// Remove once CommonJS is dropped.\nexport { DebugShaderFile } from \"./render/RenderSystemDebugControl\";\nexport { IModelTileTree } from \"./tile/IModelTileTree\";\n"]}
|
|
@@ -47,7 +47,6 @@ export interface LayerTileData {
|
|
|
47
47
|
* @param prevView The previous view state.
|
|
48
48
|
* @param newView The new view state.
|
|
49
49
|
* @returns {boolean} True if there is any difference in the model layer configuration; false otherwise.
|
|
50
|
-
* @internal
|
|
51
50
|
*/
|
|
52
51
|
export declare function compareMapLayer(prevView: ViewState, newView: ViewState): boolean;
|
|
53
52
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerParams.d.ts","sourceRoot":"","sources":["../../../../../src/internal/render/webgl/MapLayerParams.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,QAAQ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AG,SAAS,EAAU,yBAAyB,EAAE,gBAAgB,GAAG,OAAO;IACpH,IAAW,WAAW,YAAyE;IAExF,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;IAexB,mBAAmB,IAAI,QAAQ,GAAG,SAAS;IAG3C,gBAAgB,IAAI,OAAO,GAAG,SAAS;IAIvC,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;CA8C3C;AAED,gBAAgB;AAChB,qBAAa,kBAAmB,YAAW,UAAU;IAChC,MAAM,EAAE,iBAAiB,EAAE;gBAA3B,MAAM,EAAE,iBAAiB,EAAE;WAChC,MAAM,CAAC,QAAQ,EAAE,yBAAyB,EAAE;IA6CnD,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAGhC;AAED,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,SAAS,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,GAAG,SAAS,CAAC;CACpE;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAsBhF"}
|
|
@@ -168,30 +168,21 @@ exports.LayerTextureParams = LayerTextureParams;
|
|
|
168
168
|
* @param prevView The previous view state.
|
|
169
169
|
* @param newView The new view state.
|
|
170
170
|
* @returns {boolean} True if there is any difference in the model layer configuration; false otherwise.
|
|
171
|
-
* @internal
|
|
172
171
|
*/
|
|
173
172
|
function compareMapLayer(prevView, newView) {
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
for (const layer of newLayers) {
|
|
184
|
-
if (layer instanceof core_common_1.ModelMapLayerSettings && layer.drapeTarget === core_common_1.ModelMapLayerDrapeTarget.RealityData) {
|
|
185
|
-
newModelIds.push(layer.modelId);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
if (prevModelIds.length !== newModelIds.length) {
|
|
173
|
+
const getDrapedModelIds = (view) => view.displayStyle
|
|
174
|
+
.getMapLayers(false)
|
|
175
|
+
.filter((layer) => layer instanceof core_common_1.ModelMapLayerSettings &&
|
|
176
|
+
(layer.drapeTarget === core_common_1.ModelMapLayerDrapeTarget.RealityData ||
|
|
177
|
+
layer.drapeTarget === core_common_1.ModelMapLayerDrapeTarget.IModel))
|
|
178
|
+
.map(layer => layer.modelId);
|
|
179
|
+
const prev = getDrapedModelIds(prevView);
|
|
180
|
+
const next = getDrapedModelIds(newView);
|
|
181
|
+
if (prev.length !== next.length)
|
|
189
182
|
return true;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
if (prevModelIds[i] !== newModelIds[i]) {
|
|
183
|
+
for (let i = 0; i < prev.length; i++) {
|
|
184
|
+
if (prev[i] !== next[i])
|
|
193
185
|
return true;
|
|
194
|
-
}
|
|
195
186
|
}
|
|
196
187
|
return false;
|
|
197
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerParams.js","sourceRoot":"","sources":["../../../../../src/internal/render/webgl/MapLayerParams.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAgL/F,0CA8BC;AA5MD;;GAEG;AAEH,wDAA6E;AAG7E,oDAAkD;AAClD,qCAAmC;AACnC,oDAAoG;AACpG,sDAAoE;AAEpE,qCAAkC;AAGlC,MAAa,gBAAgB;IAE4B;IAA8C;IAD9F,UAAU,CAAmB;IACpC,YAAY,UAAkC,EAAS,UAAqC,EAAS,eAAwB;QAAtE,eAAU,GAAV,UAAU,CAA2B;QAAS,oBAAe,GAAf,eAAe,CAAS;QAC3H,IAAI,CAAC,UAAU,GAAG,UAA8B,CAAC;IACnD,CAAC;IACM,KAAK,CAAC,eAAwB;QACnC,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,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AAC,MAAM,CAAC,CAAC;IAC5B,CAAC;CACF;AAlDD,gDAkDC;AAQD;;;;;;;;;GASG;AACH,SAAgB,eAAe,CAAC,QAAmB,EAAE,OAAkB;IACrE,MAAM,UAAU,GAAG,QAAQ,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC7D,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAE3D,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;QAC7B,IAAI,KAAK,YAAY,mCAAqB,IAAI,KAAK,CAAC,WAAW,KAAK,sCAAwB,CAAC,WAAW,EAAE,CAAC;YACvG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;IACL,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;QAC5B,IAAI,KAAK,YAAY,mCAAqB,IAAI,KAAK,CAAC,WAAW,KAAK,sCAAwB,CAAC,WAAW,EAAE,CAAC;YACvG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,CAAC;IACL,CAAC;IAED,IAAI,YAAY,CAAC,MAAM,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;QAC7C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,IAAI,YAAY,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","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\n/** @packageDocumentation\n * @module WebGL\n */\n\nimport { Matrix4d, Range2d, Range3d, Transform } from \"@itwin/core-geometry\";\nimport { RenderPlanarClassifier } from \"../RenderPlanarClassifier\";\nimport { PlanarClassifier } from \"./PlanarClassifier\";\nimport { TerrainTexture } from \"../RenderTerrain\";\nimport { Matrix4 } from \"./Matrix\";\nimport { ModelMapLayerDrapeTarget, ModelMapLayerSettings, RenderTexture } from \"@itwin/core-common\";\nimport { assert, dispose, disposeArray } from \"@itwin/core-bentley\";\nimport { MeshMapLayerGraphicParams } from \"../MeshMapLayerGraphicParams\";\nimport { System } from \"./System\";\nimport { ViewState } from \"../../../ViewState\";\n\nexport class ProjectedTexture {\n public classifier: PlanarClassifier;\n constructor(classifier: RenderPlanarClassifier, public meshParams: MeshMapLayerGraphicParams, public targetRectangle: Range2d) {\n this.classifier = classifier as PlanarClassifier;\n }\n public clone(targetRectangle: Range2d) {\n return new ProjectedTexture(this.classifier, this.meshParams, targetRectangle.clone());\n }\n}\n\nconst scratchBytes = new Uint8Array(4);\nconst scratchBatchBaseId = new Uint32Array(scratchBytes.buffer);\nconst scratchRange2d = Range2d.createNull();\n\ntype TerrainOrProjectedTexture = TerrainTexture | ProjectedTexture;\n\nclass LayerTextureParam implements Disposable {\n constructor(public texture: RenderTexture | undefined, private _projectedTextureOrMatrix: ProjectedTexture | Matrix4) { }\n public get isProjected() { return this._projectedTextureOrMatrix instanceof ProjectedTexture; }\n\n public [Symbol.dispose](): void {\n this.texture = dispose(this.texture);\n }\n\n /* There are two methods of applying a texture to a reality mesh. the first member of \"params\" denotes which\n method is to be used. A value of zero indicates a standard texture and one represents a classified texture.\n\n A standard (nonprojected) texture is generated by multiplying v_textCoord by the scaling and translation packed into the first row\n of \"matrix\". A clip rectangle is packed into second row of \"matrix\".\n\n A \"classified\" reality mesh texture is used for map layers. It does not uses v_texCoord, the texture coordinates\n are instead generated by a projection of the model position onto the X-Y plane. We only have eye position, not model position\n so the matrix in this case is a real transform matrix that contains a mapping from eye to model position\n followed by the model to texture projection.\n*/\n public getProjectionMatrix(): Matrix4d | undefined {\n return this._projectedTextureOrMatrix instanceof ProjectedTexture ? this._projectedTextureOrMatrix.classifier.projectionMatrix : undefined;\n }\n public getTerrainMatrix(): Matrix4 | undefined {\n return this._projectedTextureOrMatrix instanceof Matrix4 ? this._projectedTextureOrMatrix : undefined;\n }\n\n public getParams(result: Matrix4): Matrix4 {\n /** Entry 0 is 0 for */\n if (this._projectedTextureOrMatrix instanceof ProjectedTexture) {\n const projectedTexture = this._projectedTextureOrMatrix;\n\n result.data[0] = 1;\n result.data[1] = projectedTexture.classifier.textureImageCount;\n result.data[2] = projectedTexture.classifier.sourceTransparency === undefined ? 1.0 : (1.0 - projectedTexture.classifier.sourceTransparency);\n scratchBatchBaseId[0] = projectedTexture.classifier.baseBatchId;\n result.data[4] = scratchBytes[0];\n result.data[5] = scratchBytes[1];\n result.data[6] = scratchBytes[2];\n result.data[7] = scratchBytes[3];\n\n const points = [];\n const meshParams = projectedTexture.meshParams;\n // Calculate range in the tiles local coordinates.\n const low = meshParams.tileRectangle.worldToLocal(projectedTexture.targetRectangle.low, scratchRange2d.low)!;\n const high = meshParams.tileRectangle.worldToLocal(projectedTexture.targetRectangle.high, scratchRange2d.high)!;\n points.push(meshParams.projection.getGlobalPoint(low.x, low.y, 0));\n points.push(meshParams.projection.getGlobalPoint(high.x, low.y, 0));\n points.push(meshParams.projection.getGlobalPoint(high.x, high.y, 0));\n points.push(meshParams.projection.getGlobalPoint(low.x, high.y, 0));\n for (let i = 0, j = 8; i < 4; i++) {\n const projectedPoint = projectedTexture.classifier.projectionMatrix.multiplyPoint3dQuietNormalize(points[i]);\n result.data[j++] = projectedPoint.x;\n result.data[j++] = projectedPoint.y;\n }\n const x0 = result.data[10] - result.data[8], y0 = result.data[11] - result.data[9];\n const x1 = result.data[12] - result.data[8], y1 = result.data[13] - result.data[9];\n if (x0 * y1 - x1 * y0 < 0) {\n const swap = ((i: number, j: number) => {\n const temp = result.data[i];\n result.data[i] = result.data[j];\n result.data[j] = temp;\n });\n for (let i = 8, j = 14; i <= 10; i += 2, j -= 2) {\n swap(i, j);\n swap(i + 1, j + 1);\n }\n }\n } else {\n result.data[0] = 0;\n }\n return result;\n }\n}\n\n/** @internal */\nexport class LayerTextureParams implements Disposable {\n constructor(public params: LayerTextureParam[]) { }\n public static create(textures: TerrainOrProjectedTexture[]) {\n const maxTexturesPerMesh = System.instance.maxRealityImageryLayers;\n assert(textures.length <= maxTexturesPerMesh);\n\n const textureParams = new Array<LayerTextureParam>();\n for (const texture of textures) {\n if (texture instanceof TerrainTexture) {\n const terrainTexture = texture;\n const matrix = new Matrix4(); // Published as Mat4.\n assert(terrainTexture.texture !== undefined, \"Texture not defined in TerrainTextureParams constructor\");\n matrix.data[0] = terrainTexture.translate.x;\n matrix.data[1] = terrainTexture.translate.y;\n matrix.data[2] = terrainTexture.scale.x;\n matrix.data[3] = terrainTexture.scale.y;\n\n if (terrainTexture.clipRectangle) {\n matrix.data[4] = terrainTexture.clipRectangle.low.x;\n matrix.data[5] = terrainTexture.clipRectangle.low.y;\n matrix.data[6] = terrainTexture.clipRectangle.high.x;\n matrix.data[7] = terrainTexture.clipRectangle.high.y;\n } else {\n matrix.data[4] = matrix.data[5] = 0;\n matrix.data[6] = matrix.data[7] = 1;\n }\n matrix.data[8] = (1.0 - terrainTexture.transparency);\n matrix.data[9] = terrainTexture.featureId;\n textureParams.push(new LayerTextureParam(terrainTexture.texture, matrix));\n } else {\n const classifier = texture.classifier;\n textureParams.push(new LayerTextureParam(classifier.getOrCreateClassifierTexture(), texture));\n }\n }\n\n for (let i = textures.length; i < maxTexturesPerMesh; i++) {\n const matrix = new Matrix4();\n matrix.data[0] = matrix.data[1] = 0.0;\n matrix.data[2] = matrix.data[3] = 1.0;\n matrix.data[4] = matrix.data[5] = 1;\n matrix.data[6] = matrix.data[7] = -1;\n matrix.data[15] = 0; // Denotes a terrain texture.\n textureParams.push(new LayerTextureParam(undefined, matrix));\n }\n return new LayerTextureParams(textureParams);\n }\n\n public [Symbol.dispose](): void {\n disposeArray(this.params);\n }\n}\n\nexport interface LayerTileData {\n ecefTransform: Transform;\n range: Range3d;\n layerClassifiers?: Map<number, RenderPlanarClassifier> | undefined;\n}\n\n/**\n * Compares the map layers of two view states, ensuring both the number of layers\n * and their order remain unchanged.\n * Returns true if the map layers differ in count, order, or model IDs; otherwise, returns false.\n *\n * @param prevView The previous view state.\n * @param newView The new view state.\n * @returns {boolean} True if there is any difference in the model layer configuration; false otherwise.\n * @internal\n */\nexport function compareMapLayer(prevView: ViewState, newView: ViewState): boolean {\n const prevLayers = prevView.displayStyle.getMapLayers(false);\n const newLayers = newView.displayStyle.getMapLayers(false);\n\n const prevModelIds: string[] = [];\n const newModelIds: string[] = [];\n\n for (const layer of prevLayers) {\n if (layer instanceof ModelMapLayerSettings && layer.drapeTarget === ModelMapLayerDrapeTarget.RealityData) {\n prevModelIds.push(layer.modelId);\n }\n }\n\n for (const layer of newLayers) {\n if (layer instanceof ModelMapLayerSettings && layer.drapeTarget === ModelMapLayerDrapeTarget.RealityData) {\n newModelIds.push(layer.modelId);\n }\n }\n\n if (prevModelIds.length !== newModelIds.length) {\n return true;\n }\n\n for (let i = 0; i < prevModelIds.length; i++) {\n if (prevModelIds[i] !== newModelIds[i]) {\n return true;\n }\n }\n\n return false;\n}"]}
|
|
1
|
+
{"version":3,"file":"MapLayerParams.js","sourceRoot":"","sources":["../../../../../src/internal/render/webgl/MapLayerParams.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AA+K/F,0CAsBC;AAnMD;;GAEG;AAEH,wDAA6E;AAG7E,oDAAkD;AAClD,qCAAmC;AACnC,oDAAoG;AACpG,sDAAoE;AAEpE,qCAAkC;AAGlC,MAAa,gBAAgB;IAE4B;IAA8C;IAD9F,UAAU,CAAmB;IACpC,YAAY,UAAkC,EAA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ACzD,aAAa,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,IAAI,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAC/C,CAAC;IAEM,CAAC,MAAM,CAAC,OAAO,CAAC;QACrB,IAAA,2BAAY,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;CACF;AAlDD,gDAkDC;AAQD;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAAC,QAAmB,EAAE,OAAkB;IACrE,MAAM,iBAAiB,GAAG,CAAC,IAAe,EAAY,EAAE,CACtD,IAAI,CAAC,YAAY;SACd,YAAY,CAAC,KAAK,CAAC;SACnB,MAAM,CAAC,CAAC,KAAK,EAAkC,EAAE,CAChD,KAAK,YAAY,mCAAqB;QACtC,CAAC,KAAK,CAAC,WAAW,KAAK,sCAAwB,CAAC,WAAW;YAC1D,KAAK,CAAC,WAAW,KAAK,sCAAwB,CAAC,MAAM,CAAC,CAAC;SACzD,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEjC,MAAM,IAAI,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAExC,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM;QAC7B,OAAO,IAAI,CAAC;IAEd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;YACrB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","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\n/** @packageDocumentation\n * @module WebGL\n */\n\nimport { Matrix4d, Range2d, Range3d, Transform } from \"@itwin/core-geometry\";\nimport { RenderPlanarClassifier } from \"../RenderPlanarClassifier\";\nimport { PlanarClassifier } from \"./PlanarClassifier\";\nimport { TerrainTexture } from \"../RenderTerrain\";\nimport { Matrix4 } from \"./Matrix\";\nimport { ModelMapLayerDrapeTarget, ModelMapLayerSettings, RenderTexture } from \"@itwin/core-common\";\nimport { assert, dispose, disposeArray } from \"@itwin/core-bentley\";\nimport { MeshMapLayerGraphicParams } from \"../MeshMapLayerGraphicParams\";\nimport { System } from \"./System\";\nimport { ViewState } from \"../../../ViewState\";\n\nexport class ProjectedTexture {\n public classifier: PlanarClassifier;\n constructor(classifier: RenderPlanarClassifier, public meshParams: MeshMapLayerGraphicParams, public targetRectangle: Range2d) {\n this.classifier = classifier as PlanarClassifier;\n }\n public clone(targetRectangle: Range2d) {\n return new ProjectedTexture(this.classifier, this.meshParams, targetRectangle.clone());\n }\n}\n\nconst scratchBytes = new Uint8Array(4);\nconst scratchBatchBaseId = new Uint32Array(scratchBytes.buffer);\nconst scratchRange2d = Range2d.createNull();\n\ntype TerrainOrProjectedTexture = TerrainTexture | ProjectedTexture;\n\nclass LayerTextureParam implements Disposable {\n constructor(public texture: RenderTexture | undefined, private _projectedTextureOrMatrix: ProjectedTexture | Matrix4) { }\n public get isProjected() { return this._projectedTextureOrMatrix instanceof ProjectedTexture; }\n\n public [Symbol.dispose](): void {\n this.texture = dispose(this.texture);\n }\n\n /* There are two methods of applying a texture to a reality mesh. the first member of \"params\" denotes which\n method is to be used. A value of zero indicates a standard texture and one represents a classified texture.\n\n A standard (nonprojected) texture is generated by multiplying v_textCoord by the scaling and translation packed into the first row\n of \"matrix\". A clip rectangle is packed into second row of \"matrix\".\n\n A \"classified\" reality mesh texture is used for map layers. It does not uses v_texCoord, the texture coordinates\n are instead generated by a projection of the model position onto the X-Y plane. We only have eye position, not model position\n so the matrix in this case is a real transform matrix that contains a mapping from eye to model position\n followed by the model to texture projection.\n*/\n public getProjectionMatrix(): Matrix4d | undefined {\n return this._projectedTextureOrMatrix instanceof ProjectedTexture ? this._projectedTextureOrMatrix.classifier.projectionMatrix : undefined;\n }\n public getTerrainMatrix(): Matrix4 | undefined {\n return this._projectedTextureOrMatrix instanceof Matrix4 ? this._projectedTextureOrMatrix : undefined;\n }\n\n public getParams(result: Matrix4): Matrix4 {\n /** Entry 0 is 0 for */\n if (this._projectedTextureOrMatrix instanceof ProjectedTexture) {\n const projectedTexture = this._projectedTextureOrMatrix;\n\n result.data[0] = 1;\n result.data[1] = projectedTexture.classifier.textureImageCount;\n result.data[2] = projectedTexture.classifier.sourceTransparency === undefined ? 1.0 : (1.0 - projectedTexture.classifier.sourceTransparency);\n scratchBatchBaseId[0] = projectedTexture.classifier.baseBatchId;\n result.data[4] = scratchBytes[0];\n result.data[5] = scratchBytes[1];\n result.data[6] = scratchBytes[2];\n result.data[7] = scratchBytes[3];\n\n const points = [];\n const meshParams = projectedTexture.meshParams;\n // Calculate range in the tiles local coordinates.\n const low = meshParams.tileRectangle.worldToLocal(projectedTexture.targetRectangle.low, scratchRange2d.low)!;\n const high = meshParams.tileRectangle.worldToLocal(projectedTexture.targetRectangle.high, scratchRange2d.high)!;\n points.push(meshParams.projection.getGlobalPoint(low.x, low.y, 0));\n points.push(meshParams.projection.getGlobalPoint(high.x, low.y, 0));\n points.push(meshParams.projection.getGlobalPoint(high.x, high.y, 0));\n points.push(meshParams.projection.getGlobalPoint(low.x, high.y, 0));\n for (let i = 0, j = 8; i < 4; i++) {\n const projectedPoint = projectedTexture.classifier.projectionMatrix.multiplyPoint3dQuietNormalize(points[i]);\n result.data[j++] = projectedPoint.x;\n result.data[j++] = projectedPoint.y;\n }\n const x0 = result.data[10] - result.data[8], y0 = result.data[11] - result.data[9];\n const x1 = result.data[12] - result.data[8], y1 = result.data[13] - result.data[9];\n if (x0 * y1 - x1 * y0 < 0) {\n const swap = ((i: number, j: number) => {\n const temp = result.data[i];\n result.data[i] = result.data[j];\n result.data[j] = temp;\n });\n for (let i = 8, j = 14; i <= 10; i += 2, j -= 2) {\n swap(i, j);\n swap(i + 1, j + 1);\n }\n }\n } else {\n result.data[0] = 0;\n }\n return result;\n }\n}\n\n/** @internal */\nexport class LayerTextureParams implements Disposable {\n constructor(public params: LayerTextureParam[]) { }\n public static create(textures: TerrainOrProjectedTexture[]) {\n const maxTexturesPerMesh = System.instance.maxRealityImageryLayers;\n assert(textures.length <= maxTexturesPerMesh);\n\n const textureParams = new Array<LayerTextureParam>();\n for (const texture of textures) {\n if (texture instanceof TerrainTexture) {\n const terrainTexture = texture;\n const matrix = new Matrix4(); // Published as Mat4.\n assert(terrainTexture.texture !== undefined, \"Texture not defined in TerrainTextureParams constructor\");\n matrix.data[0] = terrainTexture.translate.x;\n matrix.data[1] = terrainTexture.translate.y;\n matrix.data[2] = terrainTexture.scale.x;\n matrix.data[3] = terrainTexture.scale.y;\n\n if (terrainTexture.clipRectangle) {\n matrix.data[4] = terrainTexture.clipRectangle.low.x;\n matrix.data[5] = terrainTexture.clipRectangle.low.y;\n matrix.data[6] = terrainTexture.clipRectangle.high.x;\n matrix.data[7] = terrainTexture.clipRectangle.high.y;\n } else {\n matrix.data[4] = matrix.data[5] = 0;\n matrix.data[6] = matrix.data[7] = 1;\n }\n matrix.data[8] = (1.0 - terrainTexture.transparency);\n matrix.data[9] = terrainTexture.featureId;\n textureParams.push(new LayerTextureParam(terrainTexture.texture, matrix));\n } else {\n const classifier = texture.classifier;\n textureParams.push(new LayerTextureParam(classifier.getOrCreateClassifierTexture(), texture));\n }\n }\n\n for (let i = textures.length; i < maxTexturesPerMesh; i++) {\n const matrix = new Matrix4();\n matrix.data[0] = matrix.data[1] = 0.0;\n matrix.data[2] = matrix.data[3] = 1.0;\n matrix.data[4] = matrix.data[5] = 1;\n matrix.data[6] = matrix.data[7] = -1;\n matrix.data[15] = 0; // Denotes a terrain texture.\n textureParams.push(new LayerTextureParam(undefined, matrix));\n }\n return new LayerTextureParams(textureParams);\n }\n\n public [Symbol.dispose](): void {\n disposeArray(this.params);\n }\n}\n\nexport interface LayerTileData {\n ecefTransform: Transform;\n range: Range3d;\n layerClassifiers?: Map<number, RenderPlanarClassifier> | undefined;\n}\n\n/**\n * Compares the map layers of two view states, ensuring both the number of layers\n * and their order remain unchanged.\n * Returns true if the map layers differ in count, order, or model IDs; otherwise, returns false.\n *\n * @param prevView The previous view state.\n * @param newView The new view state.\n * @returns {boolean} True if there is any difference in the model layer configuration; false otherwise.\n */\nexport function compareMapLayer(prevView: ViewState, newView: ViewState): boolean {\n const getDrapedModelIds = (view: ViewState): string[] =>\n view.displayStyle\n .getMapLayers(false)\n .filter((layer): layer is ModelMapLayerSettings =>\n layer instanceof ModelMapLayerSettings &&\n (layer.drapeTarget === ModelMapLayerDrapeTarget.RealityData ||\n layer.drapeTarget === ModelMapLayerDrapeTarget.IModel))\n .map(layer => layer.modelId);\n\n const prev = getDrapedModelIds(prevView);\n const next = getDrapedModelIds(newView);\n\n if (prev.length !== next.length)\n return true;\n\n for (let i = 0; i < prev.length; i++) {\n if (prev[i] !== next[i])\n return true;\n }\n\n return false;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SurfaceGeometry.d.ts","sourceRoot":"","sources":["../../../../../src/internal/render/webgl/SurfaceGeometry.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAmG,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEhJ,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAkC,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,WAAW,EAA+B,MAAM,e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EAAE,MAAM,GAAG,OAAO;IA4BnD,IAAoB,YAAY,IAAI,YAAY,GAAG,SAAS,CAAmC;IAExF,UAAU,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO;IAIhD,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO;IAIlD,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI;IAwDhF,OAAO;IAWP,OAAO,CAAC,YAAY;IA2BpB,OAAO,CAAC,cAAc;CAavB"}
|
|
@@ -218,17 +218,25 @@ class SurfaceGeometry extends MeshGeometry_1.MeshGeometry {
|
|
|
218
218
|
}
|
|
219
219
|
_wantWoWReversal(target) {
|
|
220
220
|
const fillFlags = this.fillFlags;
|
|
221
|
-
if (core_common_1.FillFlags.None !== (fillFlags & core_common_1.FillFlags.Background))
|
|
221
|
+
if (core_common_1.FillFlags.None !== (fillFlags & core_common_1.FillFlags.Background)) {
|
|
222
222
|
return false; // fill color explicitly from background
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
}
|
|
224
|
+
if (this.wantTextures(target, this.hasTexture)) {
|
|
225
|
+
// Don't invert white pixels of textures.
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
225
228
|
const vf = target.currentViewFlags;
|
|
226
|
-
if (core_common_1.RenderMode.Wireframe === vf.renderMode
|
|
229
|
+
if (core_common_1.RenderMode.Wireframe === vf.renderMode) {
|
|
230
|
+
// Fill displayed even in wireframe?
|
|
231
|
+
return core_common_1.FillFlags.None !== (fillFlags & core_common_1.FillFlags.Always);
|
|
232
|
+
}
|
|
233
|
+
if (vf.visibleEdges) {
|
|
227
234
|
return false; // never invert surfaces when edges are displayed
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
235
|
+
}
|
|
236
|
+
if (this.isLit && wantLighting(vf)) {
|
|
237
|
+
return false; // the lit color won't be pure white anyway.
|
|
238
|
+
}
|
|
239
|
+
return true;
|
|
232
240
|
}
|
|
233
241
|
get materialInfo() { return this.mesh.materialInfo; }
|
|
234
242
|
useTexture(params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SurfaceGeometry.js","sourceRoot":"","sources":["../../../../../src/internal/render/webgl/SurfaceGeometry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAwBH,sCAEC;AAxBD,sDAAsD;AACtD,oDAAgJ;AAChJ,iFAA4E;AAE5E,iDAA8C;AAE9C,6BAA0B;AAC1B,yDAAsF;AAGtF,qCAAkC;AAIlC,iDAA8C;AAC9C,qDAAwE;AAExE,qDAA8F;AAE9F,wDAAgD;AAEhD,gBAAgB;AAChB,SAAgB,aAAa,CAAC,EAAa;IACzC,OAAO,EAAE,CAAC,SAAS,IAAI,wBAAU,CAAC,WAAW,KAAK,EAAE,CAAC,UAAU,CAAC;AAClE,CAAC;AAED,SAAS,YAAY,CAAC,EAAa;IACjC,OAAO,wBAAU,CAAC,WAAW,KAAK,EAAE,CAAC,UAAU,IAAI,EAAE,CAAC,QAAQ,CAAC;AACjE,CAAC;AAED,gBAAgB;AAChB,MAAa,eAAgB,SAAQ,2BAAY;IAC9B,QAAQ,CAAmB;IAC3B,QAAQ,CAAe;IACxB,WAAW,CAAU;IAC9B,aAAa,CAAiC;IAErD,IAAW,UAAU,KAAK,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE1C,MAAM,CAAC,MAAM,CAAC,IAAc,EAAE,MAAkB;QACrD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;QACvC,MAAM,WAAW,GAAG,+BAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEjE,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC;QAE7B,MAAM,gBAAgB,GAAG,IAAI,EAAE,gBAAgB,CAAC;QAEhD,IAAI,CAAC,gBAAgB,EAAE,IAAI,IAAI,CAAC,IAAI,IAAI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G,uBAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,uBAAS,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG,uBAAS,CAAC,MAAM,CAAC,CAAC,CAAC;YAC1H;gBACE,OAAO,uBAAS,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG,uBAAS,CAAC,MAAM,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAEO,cAAc,CAAC,MAAc,EAAE,eAAwB;QAC7D,IAAI,CAAC,eAAe,IAAI,CAAC,MAAM,CAAC,iBAAiB;YAC/C,OAAO,KAAK,CAAC;QAEf,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC;QAEtC,QAAQ,KAAK,CAAC,UAAU,EAAE,CAAC;YACzB,KAAK,wBAAU,CAAC,WAAW;gBACzB,OAAO,KAAK,CAAC,QAAQ,CAAC;YACxB;gBACE,OAAO,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;CACF;AAvXD,0CAuXC","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 WebGL\n */\n\nimport { assert, dispose } from \"@itwin/core-bentley\";\nimport { CartographicRange, FillFlags, RenderMode, TextureTransparency, ThematicGradientTransparencyMode, ViewFlags } from \"@itwin/core-common\";\nimport { SurfaceType } from \"../../../common/internal/render/SurfaceParams\";\nimport { RenderMemory } from \"../../../render/RenderMemory\";\nimport { AttributeMap } from \"./AttributeMap\";\nimport { ShaderProgramParams } from \"./DrawCommand\";\nimport { GL } from \"./GL\";\nimport { BufferHandle, BufferParameters, BuffersContainer } from \"./AttributeBuffers\";\nimport { MaterialInfo } from \"./Material\";\nimport { Pass, RenderOrder, RenderPass, SurfaceBitIndex } from \"./RenderFlags\";\nimport { System } from \"./System\";\nimport { Target } from \"./Target\";\nimport { TechniqueId } from \"./TechniqueId\";\nimport { MeshData } from \"./MeshData\";\nimport { MeshGeometry } from \"./MeshGeometry\";\nimport { LayerTextureParams, ProjectedTexture } from \"./MapLayerParams\";\nimport { MeshParams } from \"../../../common/internal/render/MeshParams\";\nimport { MapCartoRectangle, PlanarProjection, PlanarTilePatch } from \"../../../tile/internal\";\nimport { MeshMapLayerGraphicParams } from \"../MeshMapLayerGraphicParams\";\nimport { Vector3d } from \"@itwin/core-geometry\";\n\n/** @internal */\nexport function wantMaterials(vf: ViewFlags): boolean {\n return vf.materials && RenderMode.SmoothShade === vf.renderMode;\n}\n\nfunction wantLighting(vf: ViewFlags) {\n return RenderMode.SmoothShade === vf.renderMode && vf.lighting;\n}\n\n/** @internal */\nexport class SurfaceGeometry extends MeshGeometry {\n private readonly _buffers: BuffersContainer;\n private readonly _indices: BufferHandle;\n public readonly hasTextures: boolean;\n public textureParams: LayerTextureParams | undefined;\n\n public get lutBuffers() { return this._buffers; }\n\n public static create(mesh: MeshData, params: MeshParams): SurfaceGeometry | undefined {\n const indices = params.surface.indices;\n const indexBuffer = BufferHandle.createArrayBuffer(indices.data);\n\n const tile = params.tileData;\n\n const layerClassifiers = tile?.layerClassifiers;\n\n if (!layerClassifiers?.size || !tile || undefined === layerClassifiers) {\n return undefined !== indexBuffer ? new SurfaceGeometry(indexBuffer, indices.length, mesh, undefined) : undefined;\n }\n\n const transformECEF = tile.ecefTransform;\n\n const tileEcefRange = transformECEF.multiplyRange(tile.range);\n const cartographicRange = new CartographicRange(tileEcefRange, transformECEF);\n const boundingBox = cartographicRange.getLongitudeLatitudeBoundingBox();\n const mapCartoRectangle = MapCartoRectangle.fromRadians(\n boundingBox.low.x,\n boundingBox.low.y,\n boundingBox.high.x,\n boundingBox.high.y\n );\n\n const corners = tile.range.corners();\n\n const normal = Vector3d.createCrossProductToPoints(corners[0], corners[1], corners[2])?.normalize();\n if (!normal) {\n return undefined !== indexBuffer ? new SurfaceGeometry(indexBuffer, indices.length, mesh, undefined) : undefined;\n }\n const chordHeight = corners[0].distance(corners[3]) / 2;\n\n const surfacePlanarTilePatch = new PlanarTilePatch(corners, normal, chordHeight);\n const surfaceProjection = new PlanarProjection(surfacePlanarTilePatch);\n\n const meshParams: MeshMapLayerGraphicParams = {\n projection: surfaceProjection,\n tileRectangle: mapCartoRectangle,\n tileId: undefined,\n baseColor: undefined,\n baseTransparent: false,\n layerClassifiers\n };\n\n const layerTextures: ProjectedTexture[] = [];\n\n let sequentialIndex = 0;\n\n layerClassifiers?.forEach((layerClassifier) => {\n layerTextures[sequentialIndex++] = new ProjectedTexture(layerClassifier, meshParams, meshParams.tileRectangle);\n });\n\n let surfaceGeometry;\n\n if (undefined !== indexBuffer) {\n const indexCount = indices.length;\n const hasLayerTextures = layerTextures.length > 0;\n const layerTextureParams = hasLayerTextures ? LayerTextureParams.create(layerTextures) : undefined;\n\n surfaceGeometry = new SurfaceGeometry(indexBuffer, indexCount, mesh, layerTextureParams);\n }\n\n return surfaceGeometry;\n }\n\n public get isDisposed(): boolean {\n return this._buffers.isDisposed\n && this._indices.isDisposed;\n }\n\n public [Symbol.dispose]() {\n dispose(this._buffers);\n dispose(this._indices);\n }\n\n public collectStatistics(stats: RenderMemory.Statistics): void {\n stats.addSurface(this._indices.bytesUsed);\n }\n\n public get isLit() { return SurfaceType.Lit === this.surfaceType || SurfaceType.TexturedLit === this.surfaceType; }\n public get isTexturedType() { return SurfaceType.Textured === this.surfaceType || SurfaceType.TexturedLit === this.surfaceType; }\n public get hasTexture() { return this.isTexturedType && undefined !== this.texture; }\n public get hasNormalMap() { return this.isLit && this.isTexturedType && undefined !== this.normalMap; }\n public get isGlyph() { return this.mesh.isGlyph; }\n public override get alwaysRenderTranslucent() { return this.isGlyph; }\n public get isTileSection() { return undefined !== this.texture && this.texture.isTileSection; }\n public get isClassifier() { return SurfaceType.VolumeClassifier === this.surfaceType; }\n public override get supportsThematicDisplay() {\n return !this.isGlyph;\n }\n\n public override get allowColorOverride() {\n // Text background color should not be overridden by feature symbology overrides - otherwise it becomes unreadable...\n // We don't actually know if we have text.\n // We do know that text background color uses blanking fill. So do ImageGraphics, so they're also going to forbid overriding their color.\n return FillFlags.Blanking !== (this.fillFlags & FillFlags.Blanking);\n }\n\n public override get asSurface() { return this; }\n public override get asEdge() { return undefined; }\n public override get asSilhouette() { return undefined; }\n\n protected _draw(numInstances: number, instanceBuffersContainer?: BuffersContainer): void {\n const system = System.instance;\n\n // If we can't write depth in the fragment shader, use polygonOffset to force blanking regions to draw behind.\n const offset = RenderOrder.BlankingRegion === this.renderOrder && !system.supportsLogZBuffer;\n if (offset) {\n system.context.enable(GL.POLYGON_OFFSET_FILL);\n system.context.polygonOffset(1.0, 1.0);\n }\n\n const bufs = instanceBuffersContainer !== undefined ? instanceBuffersContainer : this._buffers;\n bufs.bind();\n system.drawArrays(GL.PrimitiveType.Triangles, 0, this._numIndices, numInstances);\n bufs.unbind();\n\n if (offset)\n system.context.disable(GL.POLYGON_OFFSET_FILL);\n }\n\n public override wantMixMonochromeColor(target: Target): boolean {\n // Text relies on white-on-white reversal.\n return !this.isGlyph && (this.isLitSurface || this.wantTextures(target, this.hasTexture));\n }\n\n public get techniqueId(): TechniqueId { return TechniqueId.Surface; }\n public override get isLitSurface() { return this.isLit; }\n public override get hasBakedLighting() { return this.mesh.hasBakedLighting; }\n public get renderOrder(): RenderOrder {\n if (FillFlags.Behind === (this.fillFlags & FillFlags.Behind))\n return RenderOrder.BlankingRegion;\n\n let order = this.isLit ? RenderOrder.LitSurface : RenderOrder.UnlitSurface;\n if (this.isPlanar)\n order = order | RenderOrder.PlanarBit;\n\n return order;\n }\n\n public override getColor(target: Target) {\n if (FillFlags.Background === (this.fillFlags & FillFlags.Background))\n return target.uniforms.style.backgroundColorInfo;\n else\n return this.colorInfo;\n }\n\n public override getPass(target: Target): Pass {\n // Classifiers have a dedicated pass\n if (this.isClassifier)\n return \"classification\";\n\n let opaquePass: Pass = this.isPlanar ? \"opaque-planar\" : \"opaque\";\n\n // When reading pixels, glyphs are always opaque. Otherwise always transparent (for anti-aliasing).\n if (this.isGlyph)\n return target.isReadPixelsInProgress ? opaquePass : \"translucent\";\n\n const vf = target.currentViewFlags;\n\n // When rendering thematic isolines, we need translucency because they have anti-aliasing.\n const thematic = target.wantThematicDisplay && this.supportsThematicDisplay ? target.uniforms.thematic.thematicDisplay : undefined;\n if (thematic && target.uniforms.thematic.wantIsoLines)\n return \"translucent\";\n\n // In wireframe, unless fill is explicitly enabled for planar region, surface does not draw\n if (RenderMode.Wireframe === vf.renderMode && !this.mesh.isTextureAlwaysDisplayed) {\n const fillFlags = this.fillFlags;\n const showFill = FillFlags.Always === (fillFlags & FillFlags.Always) || (vf.fill && FillFlags.ByView === (fillFlags & FillFlags.ByView));\n if (!showFill)\n return \"none\";\n }\n\n // If transparency disabled by render mode or view flag, always draw opaque.\n if (!vf.transparency || RenderMode.SolidFill === vf.renderMode || RenderMode.HiddenLine === vf.renderMode)\n return opaquePass;\n\n // A gradient texture applied by analysis style always fully determines the transparency of the surface.\n if (this.hasScalarAnimation && undefined !== target.analysisTexture) {\n assert(undefined !== target.analysisStyle?.thematic);\n switch (target.analysisStyle.thematic.thematicSettings.textureTransparency) {\n case TextureTransparency.Translucent:\n return \"translucent\";\n case TextureTransparency.Opaque:\n return opaquePass;\n case TextureTransparency.Mixed:\n return `${opaquePass}-translucent`;\n }\n }\n\n // We have 3 sources of alpha: the material, the texture, and the color.\n // Base alpha comes from the material if it overrides it; otherwise from the color.\n // The texture's alpha is multiplied by the base alpha.\n // So we must draw in the translucent pass if the texture has transparency OR the base alpha is less than 1.\n let hasAlpha = false;\n const mat = wantMaterials(vf) ? this.mesh.materialInfo : undefined;\n if (undefined !== mat && mat.overridesAlpha)\n hasAlpha = mat.hasTranslucency;\n else\n hasAlpha = this.getColor(target).hasTranslucency;\n\n // Thematic gradient can optionally multiply gradient alpha with surface alpha.\n if (thematic && thematic.gradientSettings.transparencyMode === ThematicGradientTransparencyMode.MultiplySurfaceAndGradient) {\n switch (thematic.gradientSettings.textureTransparency) {\n case TextureTransparency.Opaque:\n // This surface's alpha gets multiplied by 1 - gradient colors are all opaque.\n return hasAlpha ? \"translucent\" : opaquePass;\n case TextureTransparency.Translucent:\n // This surface's alpha gets multiplied by < 1 - gradient colors are all translucent.\n return \"translucent\";\n case TextureTransparency.Mixed:\n // The gradient contains a mix of translucent and opaque colors.\n return hasAlpha ? \"translucent\" : `${opaquePass}-translucent`;\n }\n }\n\n if (!hasAlpha) {\n const tex = this.wantTextures(target, true) ? this.texture : undefined;\n switch (tex?.transparency) {\n case TextureTransparency.Translucent:\n hasAlpha = true;\n break;\n case TextureTransparency.Mixed:\n opaquePass = `${opaquePass}-translucent`;\n break;\n }\n }\n\n return hasAlpha ? \"translucent\" : opaquePass;\n }\n\n protected _wantWoWReversal(target: Target): boolean {\n const fillFlags = this.fillFlags;\n if (FillFlags.None !== (fillFlags & FillFlags.Background))\n return false; // fill color explicitly from background\n\n if (FillFlags.None !== (fillFlags & FillFlags.Always))\n return true; // fill displayed even in wireframe\n\n const vf = target.currentViewFlags;\n if (RenderMode.Wireframe === vf.renderMode || vf.visibleEdges)\n return false; // never invert surfaces when edges are displayed\n\n if (this.isLit && wantLighting(vf))\n return false;\n\n // Don't invert white pixels of textures...\n return !this.wantTextures(target, this.hasTexture);\n }\n\n public override get materialInfo(): MaterialInfo | undefined { return this.mesh.materialInfo; }\n\n public useTexture(params: ShaderProgramParams): boolean {\n return this.wantTextures(params.target, this.hasTexture);\n }\n\n public useNormalMap(params: ShaderProgramParams): boolean {\n return this.wantNormalMaps(params.target, this.hasNormalMap);\n }\n\n public computeSurfaceFlags(params: ShaderProgramParams, flags: Int32Array): void {\n const target = params.target;\n const vf = target.currentViewFlags;\n\n const useMaterial = wantMaterials(vf);\n flags[SurfaceBitIndex.IgnoreMaterial] = useMaterial ? 0 : 1;\n flags[SurfaceBitIndex.HasMaterialAtlas] = useMaterial && this.hasMaterialAtlas ? 1 : 0;\n\n flags[SurfaceBitIndex.ApplyLighting] = 0;\n flags[SurfaceBitIndex.HasColorAndNormal] = 0;\n if (this.isLit) {\n flags[SurfaceBitIndex.HasNormals] = 1;\n if (wantLighting(vf))\n flags[SurfaceBitIndex.ApplyLighting] = 1;\n\n // Textured meshes store normal in place of color index.\n // Untextured lit meshes store normal where textured meshes would store UV coords.\n // Tell shader where to find normal.\n if (!this.isTexturedType) {\n flags[SurfaceBitIndex.HasColorAndNormal] = 1;\n }\n } else {\n flags[SurfaceBitIndex.HasNormals] = 0;\n }\n\n flags[SurfaceBitIndex.HasTexture] = this.useTexture(params) ? 1 : 0;\n flags[SurfaceBitIndex.HasNormalMap] = this.useNormalMap(params) ? 1 : 0;\n flags[SurfaceBitIndex.UseConstantLodTextureMapping] = this.mesh.textureUsesConstantLod ? 1 : 0;\n flags[SurfaceBitIndex.UseConstantLodNormalMapMapping] = this.mesh.normalMapUsesConstantLod ? 1 : 0;\n\n // The transparency threshold controls how transparent a surface must be to allow light to pass through; more opaque surfaces cast shadows.\n flags[SurfaceBitIndex.TransparencyThreshold] = params.target.isDrawingShadowMap ? 1 : 0;\n flags[SurfaceBitIndex.BackgroundFill] = 0;\n switch (params.renderPass) {\n // NB: We need this for opaque pass due to SolidFill (must compute transparency, discard below threshold, render opaque at or above threshold)\n case RenderPass.OpaqueLinear:\n case RenderPass.OpaquePlanar:\n case RenderPass.OpaqueGeneral:\n case RenderPass.Translucent:\n case RenderPass.WorldOverlay:\n case RenderPass.OpaqueLayers:\n case RenderPass.TranslucentLayers:\n case RenderPass.OverlayLayers: {\n const mode = vf.renderMode;\n if (!this.isGlyph && (RenderMode.HiddenLine === mode || RenderMode.SolidFill === mode)) {\n flags[SurfaceBitIndex.TransparencyThreshold] = 1;\n if (RenderMode.HiddenLine === mode && FillFlags.Always !== (this.fillFlags & FillFlags.Always)) {\n // fill flags test for text - doesn't render with bg fill in hidden line mode.\n flags[SurfaceBitIndex.BackgroundFill] = 1;\n }\n break;\n }\n }\n }\n }\n\n private constructor(indices: BufferHandle, numIndices: number, mesh: MeshData, textureParams?: LayerTextureParams) {\n super(mesh, numIndices);\n this.textureParams = textureParams;\n this._buffers = BuffersContainer.create();\n const attrPos = AttributeMap.findAttribute(\"a_pos\", TechniqueId.Surface, false);\n assert(undefined !== attrPos);\n this._buffers.addBuffer(indices, [BufferParameters.create(attrPos.location, 3, GL.DataType.UnsignedByte, false, 0, 0, false)]);\n this._indices = indices;\n this.hasTextures = undefined !== this.textureParams && this.textureParams.params.some((x) => undefined !== x.texture);\n }\n\n private wantTextures(target: Target, surfaceTextureExists: boolean): boolean {\n if (this.hasScalarAnimation && undefined !== target.analysisTexture)\n return true;\n\n if (!surfaceTextureExists)\n return false;\n\n if (this.mesh.isTextureAlwaysDisplayed)\n return true;\n\n if (this.supportsThematicDisplay && target.wantThematicDisplay)\n return false;\n\n const fill = this.fillFlags;\n const flags = target.currentViewFlags;\n\n // ###TODO need to distinguish between gradient fill and actual textures...\n switch (flags.renderMode) {\n case RenderMode.SmoothShade:\n return flags.textures;\n case RenderMode.Wireframe:\n return FillFlags.Always === (fill & FillFlags.Always) || (flags.fill && FillFlags.ByView === (fill & FillFlags.ByView));\n default:\n return FillFlags.Always === (fill & FillFlags.Always);\n }\n }\n\n private wantNormalMaps(target: Target, normalMapExists: boolean): boolean {\n if (!normalMapExists || !target.displayNormalMaps)\n return false;\n\n const flags = target.currentViewFlags;\n\n switch (flags.renderMode) {\n case RenderMode.SmoothShade:\n return flags.textures;\n default:\n return false;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SurfaceGeometry.js","sourceRoot":"","sources":["../../../../../src/internal/render/webgl/SurfaceGeometry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAwBH,sCAEC;AAxBD,sDAAsD;AACtD,oDAAgJ;AAChJ,iFAA4E;AAE5E,iDAA8C;AAE9C,6BAA0B;AAC1B,yDAAsF;AAGtF,qCAAkC;AAIlC,iDAA8C;AAC9C,qDAAwE;AAExE,qDAA8F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C;QAC1D,CAAC;IACH,CAAC;IAEO,cAAc,CAAC,MAAc,EAAE,eAAwB;QAC7D,IAAI,CAAC,eAAe,IAAI,CAAC,MAAM,CAAC,iBAAiB;YAC/C,OAAO,KAAK,CAAC;QAEf,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC;QAEtC,QAAQ,KAAK,CAAC,UAAU,EAAE,CAAC;YACzB,KAAK,wBAAU,CAAC,WAAW;gBACzB,OAAO,KAAK,CAAC,QAAQ,CAAC;YACxB;gBACE,OAAO,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;CACF;AAhYD,0CAgYC","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 WebGL\n */\n\nimport { assert, dispose } from \"@itwin/core-bentley\";\nimport { CartographicRange, FillFlags, RenderMode, TextureTransparency, ThematicGradientTransparencyMode, ViewFlags } from \"@itwin/core-common\";\nimport { SurfaceType } from \"../../../common/internal/render/SurfaceParams\";\nimport { RenderMemory } from \"../../../render/RenderMemory\";\nimport { AttributeMap } from \"./AttributeMap\";\nimport { ShaderProgramParams } from \"./DrawCommand\";\nimport { GL } from \"./GL\";\nimport { BufferHandle, BufferParameters, BuffersContainer } from \"./AttributeBuffers\";\nimport { MaterialInfo } from \"./Material\";\nimport { Pass, RenderOrder, RenderPass, SurfaceBitIndex } from \"./RenderFlags\";\nimport { System } from \"./System\";\nimport { Target } from \"./Target\";\nimport { TechniqueId } from \"./TechniqueId\";\nimport { MeshData } from \"./MeshData\";\nimport { MeshGeometry } from \"./MeshGeometry\";\nimport { LayerTextureParams, ProjectedTexture } from \"./MapLayerParams\";\nimport { MeshParams } from \"../../../common/internal/render/MeshParams\";\nimport { MapCartoRectangle, PlanarProjection, PlanarTilePatch } from \"../../../tile/internal\";\nimport { MeshMapLayerGraphicParams } from \"../MeshMapLayerGraphicParams\";\nimport { Vector3d } from \"@itwin/core-geometry\";\n\n/** @internal */\nexport function wantMaterials(vf: ViewFlags): boolean {\n return vf.materials && RenderMode.SmoothShade === vf.renderMode;\n}\n\nfunction wantLighting(vf: ViewFlags) {\n return RenderMode.SmoothShade === vf.renderMode && vf.lighting;\n}\n\n/** @internal */\nexport class SurfaceGeometry extends MeshGeometry {\n private readonly _buffers: BuffersContainer;\n private readonly _indices: BufferHandle;\n public readonly hasTextures: boolean;\n public textureParams: LayerTextureParams | undefined;\n\n public get lutBuffers() { return this._buffers; }\n\n public static create(mesh: MeshData, params: MeshParams): SurfaceGeometry | undefined {\n const indices = params.surface.indices;\n const indexBuffer = BufferHandle.createArrayBuffer(indices.data);\n\n const tile = params.tileData;\n\n const layerClassifiers = tile?.layerClassifiers;\n\n if (!layerClassifiers?.size || !tile || undefined === layerClassifiers) {\n return undefined !== indexBuffer ? new SurfaceGeometry(indexBuffer, indices.length, mesh, undefined) : undefined;\n }\n\n const transformECEF = tile.ecefTransform;\n\n const tileEcefRange = transformECEF.multiplyRange(tile.range);\n const cartographicRange = new CartographicRange(tileEcefRange, transformECEF);\n const boundingBox = cartographicRange.getLongitudeLatitudeBoundingBox();\n const mapCartoRectangle = MapCartoRectangle.fromRadians(\n boundingBox.low.x,\n boundingBox.low.y,\n boundingBox.high.x,\n boundingBox.high.y\n );\n\n const corners = tile.range.corners();\n\n const normal = Vector3d.createCrossProductToPoints(corners[0], corners[1], corners[2])?.normalize();\n if (!normal) {\n return undefined !== indexBuffer ? new SurfaceGeometry(indexBuffer, indices.length, mesh, undefined) : undefined;\n }\n const chordHeight = corners[0].distance(corners[3]) / 2;\n\n const surfacePlanarTilePatch = new PlanarTilePatch(corners, normal, chordHeight);\n const surfaceProjection = new PlanarProjection(surfacePlanarTilePatch);\n\n const meshParams: MeshMapLayerGraphicParams = {\n projection: surfaceProjection,\n tileRectangle: mapCartoRectangle,\n tileId: undefined,\n baseColor: undefined,\n baseTransparent: false,\n layerClassifiers\n };\n\n const layerTextures: ProjectedTexture[] = [];\n\n let sequentialIndex = 0;\n\n layerClassifiers?.forEach((layerClassifier) => {\n layerTextures[sequentialIndex++] = new ProjectedTexture(layerClassifier, meshParams, meshParams.tileRectangle);\n });\n\n let surfaceGeometry;\n\n if (undefined !== indexBuffer) {\n const indexCount = indices.length;\n const hasLayerTextures = layerTextures.length > 0;\n const layerTextureParams = hasLayerTextures ? LayerTextureParams.create(layerTextures) : undefined;\n\n surfaceGeometry = new SurfaceGeometry(indexBuffer, indexCount, mesh, layerTextureParams);\n }\n\n return surfaceGeometry;\n }\n\n public get isDisposed(): boolean {\n return this._buffers.isDisposed\n && this._indices.isDisposed;\n }\n\n public [Symbol.dispose]() {\n dispose(this._buffers);\n dispose(this._indices);\n }\n\n public collectStatistics(stats: RenderMemory.Statistics): void {\n stats.addSurface(this._indices.bytesUsed);\n }\n\n public get isLit() { return SurfaceType.Lit === this.surfaceType || SurfaceType.TexturedLit === this.surfaceType; }\n public get isTexturedType() { return SurfaceType.Textured === this.surfaceType || SurfaceType.TexturedLit === this.surfaceType; }\n public get hasTexture() { return this.isTexturedType && undefined !== this.texture; }\n public get hasNormalMap() { return this.isLit && this.isTexturedType && undefined !== this.normalMap; }\n public get isGlyph() { return this.mesh.isGlyph; }\n public override get alwaysRenderTranslucent() { return this.isGlyph; }\n public get isTileSection() { return undefined !== this.texture && this.texture.isTileSection; }\n public get isClassifier() { return SurfaceType.VolumeClassifier === this.surfaceType; }\n public override get supportsThematicDisplay() {\n return !this.isGlyph;\n }\n\n public override get allowColorOverride() {\n // Text background color should not be overridden by feature symbology overrides - otherwise it becomes unreadable...\n // We don't actually know if we have text.\n // We do know that text background color uses blanking fill. So do ImageGraphics, so they're also going to forbid overriding their color.\n return FillFlags.Blanking !== (this.fillFlags & FillFlags.Blanking);\n }\n\n public override get asSurface() { return this; }\n public override get asEdge() { return undefined; }\n public override get asSilhouette() { return undefined; }\n\n protected _draw(numInstances: number, instanceBuffersContainer?: BuffersContainer): void {\n const system = System.instance;\n\n // If we can't write depth in the fragment shader, use polygonOffset to force blanking regions to draw behind.\n const offset = RenderOrder.BlankingRegion === this.renderOrder && !system.supportsLogZBuffer;\n if (offset) {\n system.context.enable(GL.POLYGON_OFFSET_FILL);\n system.context.polygonOffset(1.0, 1.0);\n }\n\n const bufs = instanceBuffersContainer !== undefined ? instanceBuffersContainer : this._buffers;\n bufs.bind();\n system.drawArrays(GL.PrimitiveType.Triangles, 0, this._numIndices, numInstances);\n bufs.unbind();\n\n if (offset)\n system.context.disable(GL.POLYGON_OFFSET_FILL);\n }\n\n public override wantMixMonochromeColor(target: Target): boolean {\n // Text relies on white-on-white reversal.\n return !this.isGlyph && (this.isLitSurface || this.wantTextures(target, this.hasTexture));\n }\n\n public get techniqueId(): TechniqueId { return TechniqueId.Surface; }\n public override get isLitSurface() { return this.isLit; }\n public override get hasBakedLighting() { return this.mesh.hasBakedLighting; }\n public get renderOrder(): RenderOrder {\n if (FillFlags.Behind === (this.fillFlags & FillFlags.Behind))\n return RenderOrder.BlankingRegion;\n\n let order = this.isLit ? RenderOrder.LitSurface : RenderOrder.UnlitSurface;\n if (this.isPlanar)\n order = order | RenderOrder.PlanarBit;\n\n return order;\n }\n\n public override getColor(target: Target) {\n if (FillFlags.Background === (this.fillFlags & FillFlags.Background))\n return target.uniforms.style.backgroundColorInfo;\n else\n return this.colorInfo;\n }\n\n public override getPass(target: Target): Pass {\n // Classifiers have a dedicated pass\n if (this.isClassifier)\n return \"classification\";\n\n let opaquePass: Pass = this.isPlanar ? \"opaque-planar\" : \"opaque\";\n\n // When reading pixels, glyphs are always opaque. Otherwise always transparent (for anti-aliasing).\n if (this.isGlyph)\n return target.isReadPixelsInProgress ? opaquePass : \"translucent\";\n\n const vf = target.currentViewFlags;\n\n // When rendering thematic isolines, we need translucency because they have anti-aliasing.\n const thematic = target.wantThematicDisplay && this.supportsThematicDisplay ? target.uniforms.thematic.thematicDisplay : undefined;\n if (thematic && target.uniforms.thematic.wantIsoLines)\n return \"translucent\";\n\n // In wireframe, unless fill is explicitly enabled for planar region, surface does not draw\n if (RenderMode.Wireframe === vf.renderMode && !this.mesh.isTextureAlwaysDisplayed) {\n const fillFlags = this.fillFlags;\n const showFill = FillFlags.Always === (fillFlags & FillFlags.Always) || (vf.fill && FillFlags.ByView === (fillFlags & FillFlags.ByView));\n if (!showFill)\n return \"none\";\n }\n\n // If transparency disabled by render mode or view flag, always draw opaque.\n if (!vf.transparency || RenderMode.SolidFill === vf.renderMode || RenderMode.HiddenLine === vf.renderMode)\n return opaquePass;\n\n // A gradient texture applied by analysis style always fully determines the transparency of the surface.\n if (this.hasScalarAnimation && undefined !== target.analysisTexture) {\n assert(undefined !== target.analysisStyle?.thematic);\n switch (target.analysisStyle.thematic.thematicSettings.textureTransparency) {\n case TextureTransparency.Translucent:\n return \"translucent\";\n case TextureTransparency.Opaque:\n return opaquePass;\n case TextureTransparency.Mixed:\n return `${opaquePass}-translucent`;\n }\n }\n\n // We have 3 sources of alpha: the material, the texture, and the color.\n // Base alpha comes from the material if it overrides it; otherwise from the color.\n // The texture's alpha is multiplied by the base alpha.\n // So we must draw in the translucent pass if the texture has transparency OR the base alpha is less than 1.\n let hasAlpha = false;\n const mat = wantMaterials(vf) ? this.mesh.materialInfo : undefined;\n if (undefined !== mat && mat.overridesAlpha)\n hasAlpha = mat.hasTranslucency;\n else\n hasAlpha = this.getColor(target).hasTranslucency;\n\n // Thematic gradient can optionally multiply gradient alpha with surface alpha.\n if (thematic && thematic.gradientSettings.transparencyMode === ThematicGradientTransparencyMode.MultiplySurfaceAndGradient) {\n switch (thematic.gradientSettings.textureTransparency) {\n case TextureTransparency.Opaque:\n // This surface's alpha gets multiplied by 1 - gradient colors are all opaque.\n return hasAlpha ? \"translucent\" : opaquePass;\n case TextureTransparency.Translucent:\n // This surface's alpha gets multiplied by < 1 - gradient colors are all translucent.\n return \"translucent\";\n case TextureTransparency.Mixed:\n // The gradient contains a mix of translucent and opaque colors.\n return hasAlpha ? \"translucent\" : `${opaquePass}-translucent`;\n }\n }\n\n if (!hasAlpha) {\n const tex = this.wantTextures(target, true) ? this.texture : undefined;\n switch (tex?.transparency) {\n case TextureTransparency.Translucent:\n hasAlpha = true;\n break;\n case TextureTransparency.Mixed:\n opaquePass = `${opaquePass}-translucent`;\n break;\n }\n }\n\n return hasAlpha ? \"translucent\" : opaquePass;\n }\n\n protected _wantWoWReversal(target: Target): boolean {\n const fillFlags = this.fillFlags;\n if (FillFlags.None !== (fillFlags & FillFlags.Background)) {\n return false; // fill color explicitly from background\n }\n\n if (this.wantTextures(target, this.hasTexture)) {\n // Don't invert white pixels of textures.\n return false;\n }\n\n const vf = target.currentViewFlags;\n if (RenderMode.Wireframe === vf.renderMode) {\n // Fill displayed even in wireframe?\n return FillFlags.None !== (fillFlags & FillFlags.Always);\n }\n\n if (vf.visibleEdges) {\n return false; // never invert surfaces when edges are displayed\n }\n\n if (this.isLit && wantLighting(vf)) {\n return false; // the lit color won't be pure white anyway.\n }\n\n return true;\n }\n\n public override get materialInfo(): MaterialInfo | undefined { return this.mesh.materialInfo; }\n\n public useTexture(params: ShaderProgramParams): boolean {\n return this.wantTextures(params.target, this.hasTexture);\n }\n\n public useNormalMap(params: ShaderProgramParams): boolean {\n return this.wantNormalMaps(params.target, this.hasNormalMap);\n }\n\n public computeSurfaceFlags(params: ShaderProgramParams, flags: Int32Array): void {\n const target = params.target;\n const vf = target.currentViewFlags;\n\n const useMaterial = wantMaterials(vf);\n flags[SurfaceBitIndex.IgnoreMaterial] = useMaterial ? 0 : 1;\n flags[SurfaceBitIndex.HasMaterialAtlas] = useMaterial && this.hasMaterialAtlas ? 1 : 0;\n\n flags[SurfaceBitIndex.ApplyLighting] = 0;\n flags[SurfaceBitIndex.HasColorAndNormal] = 0;\n if (this.isLit) {\n flags[SurfaceBitIndex.HasNormals] = 1;\n if (wantLighting(vf))\n flags[SurfaceBitIndex.ApplyLighting] = 1;\n\n // Textured meshes store normal in place of color index.\n // Untextured lit meshes store normal where textured meshes would store UV coords.\n // Tell shader where to find normal.\n if (!this.isTexturedType) {\n flags[SurfaceBitIndex.HasColorAndNormal] = 1;\n }\n } else {\n flags[SurfaceBitIndex.HasNormals] = 0;\n }\n\n flags[SurfaceBitIndex.HasTexture] = this.useTexture(params) ? 1 : 0;\n flags[SurfaceBitIndex.HasNormalMap] = this.useNormalMap(params) ? 1 : 0;\n flags[SurfaceBitIndex.UseConstantLodTextureMapping] = this.mesh.textureUsesConstantLod ? 1 : 0;\n flags[SurfaceBitIndex.UseConstantLodNormalMapMapping] = this.mesh.normalMapUsesConstantLod ? 1 : 0;\n\n // The transparency threshold controls how transparent a surface must be to allow light to pass through; more opaque surfaces cast shadows.\n flags[SurfaceBitIndex.TransparencyThreshold] = params.target.isDrawingShadowMap ? 1 : 0;\n flags[SurfaceBitIndex.BackgroundFill] = 0;\n switch (params.renderPass) {\n // NB: We need this for opaque pass due to SolidFill (must compute transparency, discard below threshold, render opaque at or above threshold)\n case RenderPass.OpaqueLinear:\n case RenderPass.OpaquePlanar:\n case RenderPass.OpaqueGeneral:\n case RenderPass.Translucent:\n case RenderPass.WorldOverlay:\n case RenderPass.OpaqueLayers:\n case RenderPass.TranslucentLayers:\n case RenderPass.OverlayLayers: {\n const mode = vf.renderMode;\n if (!this.isGlyph && (RenderMode.HiddenLine === mode || RenderMode.SolidFill === mode)) {\n flags[SurfaceBitIndex.TransparencyThreshold] = 1;\n if (RenderMode.HiddenLine === mode && FillFlags.Always !== (this.fillFlags & FillFlags.Always)) {\n // fill flags test for text - doesn't render with bg fill in hidden line mode.\n flags[SurfaceBitIndex.BackgroundFill] = 1;\n }\n break;\n }\n }\n }\n }\n\n private constructor(indices: BufferHandle, numIndices: number, mesh: MeshData, textureParams?: LayerTextureParams) {\n super(mesh, numIndices);\n this.textureParams = textureParams;\n this._buffers = BuffersContainer.create();\n const attrPos = AttributeMap.findAttribute(\"a_pos\", TechniqueId.Surface, false);\n assert(undefined !== attrPos);\n this._buffers.addBuffer(indices, [BufferParameters.create(attrPos.location, 3, GL.DataType.UnsignedByte, false, 0, 0, false)]);\n this._indices = indices;\n this.hasTextures = undefined !== this.textureParams && this.textureParams.params.some((x) => undefined !== x.texture);\n }\n\n private wantTextures(target: Target, surfaceTextureExists: boolean): boolean {\n if (this.hasScalarAnimation && undefined !== target.analysisTexture)\n return true;\n\n if (!surfaceTextureExists)\n return false;\n\n if (this.mesh.isTextureAlwaysDisplayed)\n return true;\n\n if (this.supportsThematicDisplay && target.wantThematicDisplay)\n return false;\n\n const fill = this.fillFlags;\n const flags = target.currentViewFlags;\n\n // ###TODO need to distinguish between gradient fill and actual textures...\n switch (flags.renderMode) {\n case RenderMode.SmoothShade:\n return flags.textures;\n case RenderMode.Wireframe:\n return FillFlags.Always === (fill & FillFlags.Always) || (flags.fill && FillFlags.ByView === (fill & FillFlags.ByView));\n default:\n return FillFlags.Always === (fill & FillFlags.Always);\n }\n }\n\n private wantNormalMaps(target: Target, normalMapExists: boolean): boolean {\n if (!normalMapExists || !target.displayNormalMaps)\n return false;\n\n const flags = target.currentViewFlags;\n\n switch (flags.renderMode) {\n case RenderMode.SmoothShade:\n return flags.textures;\n default:\n return false;\n }\n }\n}\n"]}
|
|
@@ -10,6 +10,7 @@ import { TileDrawArgs, TileGraphicType, TileTreeReference } from "../../tile/int
|
|
|
10
10
|
export interface GraphicsCollector {
|
|
11
11
|
addGraphic(graphic: RenderGraphic): void;
|
|
12
12
|
}
|
|
13
|
+
/** @internal*/
|
|
13
14
|
export declare class GraphicsCollectorDrawArgs extends TileDrawArgs {
|
|
14
15
|
private _planes;
|
|
15
16
|
private _worldToViewMap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphicsCollector.d.ts","sourceRoot":"","sources":["../../../../src/internal/tile/GraphicsCollector.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAA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