@itwin/core-frontend 4.7.4 → 4.7.6

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/lib/cjs/PlanarClipMaskState.d.ts +3 -1
  3. package/lib/cjs/PlanarClipMaskState.d.ts.map +1 -1
  4. package/lib/cjs/PlanarClipMaskState.js +14 -7
  5. package/lib/cjs/PlanarClipMaskState.js.map +1 -1
  6. package/lib/cjs/SpatialViewState.d.ts +2 -1
  7. package/lib/cjs/SpatialViewState.d.ts.map +1 -1
  8. package/lib/cjs/SpatialViewState.js +3 -2
  9. package/lib/cjs/SpatialViewState.js.map +1 -1
  10. package/lib/cjs/render/GraphicBuilder.d.ts +4 -0
  11. package/lib/cjs/render/GraphicBuilder.d.ts.map +1 -1
  12. package/lib/cjs/render/GraphicBuilder.js +49 -0
  13. package/lib/cjs/render/GraphicBuilder.js.map +1 -1
  14. package/lib/cjs/render/RenderTarget.d.ts +1 -0
  15. package/lib/cjs/render/RenderTarget.d.ts.map +1 -1
  16. package/lib/cjs/render/RenderTarget.js.map +1 -1
  17. package/lib/cjs/render/webgl/BackgroundMapDrape.js +1 -1
  18. package/lib/cjs/render/webgl/BackgroundMapDrape.js.map +1 -1
  19. package/lib/cjs/render/webgl/PlanarClassifier.d.ts.map +1 -1
  20. package/lib/cjs/render/webgl/PlanarClassifier.js +17 -9
  21. package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
  22. package/lib/cjs/render/webgl/PlanarTextureProjection.d.ts +3 -3
  23. package/lib/cjs/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
  24. package/lib/cjs/render/webgl/PlanarTextureProjection.js +53 -19
  25. package/lib/cjs/render/webgl/PlanarTextureProjection.js.map +1 -1
  26. package/lib/cjs/render/webgl/SolarShadowMap.js +2 -2
  27. package/lib/cjs/render/webgl/SolarShadowMap.js.map +1 -1
  28. package/lib/cjs/render/webgl/Target.d.ts +1 -0
  29. package/lib/cjs/render/webgl/Target.d.ts.map +1 -1
  30. package/lib/cjs/render/webgl/Target.js +1 -0
  31. package/lib/cjs/render/webgl/Target.js.map +1 -1
  32. package/lib/cjs/tile/PrimaryTileTree.d.ts +2 -2
  33. package/lib/cjs/tile/PrimaryTileTree.d.ts.map +1 -1
  34. package/lib/cjs/tile/PrimaryTileTree.js +8 -3
  35. package/lib/cjs/tile/PrimaryTileTree.js.map +1 -1
  36. package/lib/cjs/tile/map/ArcGisUtilities.d.ts +1 -0
  37. package/lib/cjs/tile/map/ArcGisUtilities.d.ts.map +1 -1
  38. package/lib/cjs/tile/map/ArcGisUtilities.js +5 -3
  39. package/lib/cjs/tile/map/ArcGisUtilities.js.map +1 -1
  40. package/lib/cjs/tile/map/ImageryProviders/ArcGISImageryProvider.d.ts.map +1 -1
  41. package/lib/cjs/tile/map/ImageryProviders/ArcGISImageryProvider.js +7 -2
  42. package/lib/cjs/tile/map/ImageryProviders/ArcGISImageryProvider.js.map +1 -1
  43. package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
  44. package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -1
  45. package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  46. package/lib/esm/PlanarClipMaskState.d.ts +3 -1
  47. package/lib/esm/PlanarClipMaskState.d.ts.map +1 -1
  48. package/lib/esm/PlanarClipMaskState.js +14 -7
  49. package/lib/esm/PlanarClipMaskState.js.map +1 -1
  50. package/lib/esm/SpatialViewState.d.ts +2 -1
  51. package/lib/esm/SpatialViewState.d.ts.map +1 -1
  52. package/lib/esm/SpatialViewState.js +3 -2
  53. package/lib/esm/SpatialViewState.js.map +1 -1
  54. package/lib/esm/render/GraphicBuilder.d.ts +4 -0
  55. package/lib/esm/render/GraphicBuilder.d.ts.map +1 -1
  56. package/lib/esm/render/GraphicBuilder.js +49 -0
  57. package/lib/esm/render/GraphicBuilder.js.map +1 -1
  58. package/lib/esm/render/RenderTarget.d.ts +1 -0
  59. package/lib/esm/render/RenderTarget.d.ts.map +1 -1
  60. package/lib/esm/render/RenderTarget.js.map +1 -1
  61. package/lib/esm/render/webgl/BackgroundMapDrape.js +2 -2
  62. package/lib/esm/render/webgl/BackgroundMapDrape.js.map +1 -1
  63. package/lib/esm/render/webgl/PlanarClassifier.d.ts.map +1 -1
  64. package/lib/esm/render/webgl/PlanarClassifier.js +18 -10
  65. package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
  66. package/lib/esm/render/webgl/PlanarTextureProjection.d.ts +3 -3
  67. package/lib/esm/render/webgl/PlanarTextureProjection.d.ts.map +1 -1
  68. package/lib/esm/render/webgl/PlanarTextureProjection.js +54 -20
  69. package/lib/esm/render/webgl/PlanarTextureProjection.js.map +1 -1
  70. package/lib/esm/render/webgl/SolarShadowMap.js +2 -2
  71. package/lib/esm/render/webgl/SolarShadowMap.js.map +1 -1
  72. package/lib/esm/render/webgl/Target.d.ts +1 -0
  73. package/lib/esm/render/webgl/Target.d.ts.map +1 -1
  74. package/lib/esm/render/webgl/Target.js +1 -0
  75. package/lib/esm/render/webgl/Target.js.map +1 -1
  76. package/lib/esm/tile/PrimaryTileTree.d.ts +2 -2
  77. package/lib/esm/tile/PrimaryTileTree.d.ts.map +1 -1
  78. package/lib/esm/tile/PrimaryTileTree.js +8 -3
  79. package/lib/esm/tile/PrimaryTileTree.js.map +1 -1
  80. package/lib/esm/tile/map/ArcGisUtilities.d.ts +1 -0
  81. package/lib/esm/tile/map/ArcGisUtilities.d.ts.map +1 -1
  82. package/lib/esm/tile/map/ArcGisUtilities.js +5 -3
  83. package/lib/esm/tile/map/ArcGisUtilities.js.map +1 -1
  84. package/lib/esm/tile/map/ImageryProviders/ArcGISImageryProvider.d.ts.map +1 -1
  85. package/lib/esm/tile/map/ImageryProviders/ArcGISImageryProvider.js +7 -2
  86. package/lib/esm/tile/map/ImageryProviders/ArcGISImageryProvider.js.map +1 -1
  87. package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.d.ts.map +1 -1
  88. package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +3 -1
  89. package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  90. package/package.json +18 -18
package/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Change Log - @itwin/core-frontend
2
2
 
3
- This log was last generated on Mon, 01 Jul 2024 14:06:23 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 12 Jul 2024 14:42:55 GMT and should not be manually modified.
4
+
5
+ ## 4.7.6
6
+ Fri, 12 Jul 2024 14:42:55 GMT
7
+
8
+ ### Updates
9
+
10
+ - Fix missing login dialog for some ArcGIS services
11
+
12
+ ## 4.7.5
13
+ Thu, 11 Jul 2024 15:24:55 GMT
14
+
15
+ ### Updates
16
+
17
+ - Improve resolution of planar clip masks
4
18
 
5
19
  ## 4.7.4
6
20
  Mon, 01 Jul 2024 14:06:23 GMT
@@ -7,6 +7,7 @@ import { FeatureSymbology } from "./render/FeatureSymbology";
7
7
  import { DisclosedTileTreeSet, TileTreeReference } from "./tile/internal";
8
8
  import { SceneContext } from "./ViewContext";
9
9
  import { SpatialViewState } from "./SpatialViewState";
10
+ import { Range3d } from "@itwin/core-geometry";
10
11
  /** The State of Planar Clip Mask applied to a reality model or background map.
11
12
  * Handles loading models and their associated tiles for models that are used by masks but may not be otherwise loaded or displayed.
12
13
  * @beta
@@ -16,12 +17,13 @@ export declare class PlanarClipMaskState {
16
17
  private _tileTreeRefs?;
17
18
  private _allLoaded;
18
19
  private _usingViewportOverrides;
20
+ private _maskRange;
19
21
  private constructor();
20
22
  static create(settings: PlanarClipMaskSettings): PlanarClipMaskState;
21
23
  static fromJSON(props: PlanarClipMaskProps): PlanarClipMaskState;
22
24
  get usingViewportOverrides(): boolean;
23
25
  discloseTileTrees(trees: DisclosedTileTreeSet): void;
24
- getTileTrees(view: SpatialViewState, classifiedModelId: Id64String): TileTreeReference[] | undefined;
26
+ getTileTrees(view: SpatialViewState, classifiedModelId: Id64String, maskRange: Range3d): TileTreeReference[] | undefined;
25
27
  getPlanarClipMaskSymbologyOverrides(view: SpatialViewState, context: SceneContext): FeatureSymbology.Overrides | undefined;
26
28
  }
27
29
  //# sourceMappingURL=PlanarClipMaskState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlanarClipMaskState.d.ts","sourceRoot":"","sources":["../../src/PlanarClipMaskState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAiE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAChJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,SAAgB,QAAQ,EAAE,sBAAsB,CAAC;IACjD,OAAO,CAAC,aAAa,CAAC,CAAsB;IAC5C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,uBAAuB,CAAS;IAExC,OAAO;WAIO,MAAM,CAAC,QAAQ,EAAE,sBAAsB,GAAG,mBAAmB;WAI7D,QAAQ,CAAC,KAAK,EAAE,mBAAmB,GAAG,mBAAmB;IAIvE,IAAW,sBAAsB,IAAI,OAAO,CAAyC;IAE9E,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI;IAMpD,YAAY,CAAC,IAAI,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,GAAG,iBAAiB,EAAE,GAAG,SAAS;IA6BpG,mCAAmC,CAAC,IAAI,E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AG,SAAS;CAmDlI"}
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.PlanarClipMaskState = void 0;
11
11
  const core_common_1 = require("@itwin/core-common");
12
12
  const FeatureSymbology_1 = require("./render/FeatureSymbology");
13
+ const core_geometry_1 = require("@itwin/core-geometry");
13
14
  /** The State of Planar Clip Mask applied to a reality model or background map.
14
15
  * Handles loading models and their associated tiles for models that are used by masks but may not be otherwise loaded or displayed.
15
16
  * @beta
@@ -18,6 +19,7 @@ class PlanarClipMaskState {
18
19
  constructor(settings) {
19
20
  this._allLoaded = false;
20
21
  this._usingViewportOverrides = false;
22
+ this._maskRange = core_geometry_1.Range3d.createNull();
21
23
  this.settings = settings;
22
24
  }
23
25
  static create(settings) {
@@ -32,10 +34,11 @@ class PlanarClipMaskState {
32
34
  if (this._tileTreeRefs)
33
35
  this._tileTreeRefs.forEach((treeRef) => treeRef.discloseTileTrees(trees));
34
36
  }
35
- // Returns the TileTreeReferences for the models that need to be drawn to create the planar clip mask.
36
- getTileTrees(view, classifiedModelId) {
37
+ // Returns the TileTreeReferences for the models that need to be drawn to create the planar clip mask, and extend the maskRange if needed.
38
+ getTileTrees(view, classifiedModelId, maskRange) {
37
39
  if (this.settings.mode === core_common_1.PlanarClipMaskMode.Priority) {
38
40
  // For priority mode we simply want refs for all viewed models if the priority is higher than the mask priority.
41
+ // For this case, we don't need a maskRange so leave it as null.
39
42
  const viewTrees = new Array();
40
43
  const thisPriority = this.settings.priority === undefined ? core_common_1.PlanarClipMaskPriority.RealityModel : this.settings.priority;
41
44
  view.forEachTileTreeRef((ref) => {
@@ -47,13 +50,17 @@ class PlanarClipMaskState {
47
50
  }
48
51
  // For all other modes we need to let the tree refs in the view state decide which refs need to be drawn
49
52
  // since batched tiles cannot turn on/off individual models just by their tile tree refs.
50
- if (!this._tileTreeRefs) {
53
+ // Keep calling this until loaded so that the range is valid.
54
+ if (!this._allLoaded) {
51
55
  this._tileTreeRefs = new Array();
52
- if (this.settings.modelIds)
53
- view.collectMaskRefs(this.settings.modelIds, this._tileTreeRefs);
54
- }
55
- if (!this._allLoaded)
56
+ if (this.settings.modelIds) {
57
+ view.collectMaskRefs(this.settings.modelIds, this._tileTreeRefs, maskRange);
58
+ }
56
59
  this._allLoaded = this._tileTreeRefs.every((treeRef) => treeRef.treeOwner.load() !== undefined);
60
+ maskRange.clone(this._maskRange);
61
+ }
62
+ else // If already loaded, just set the maskRange to the saved maskRange.
63
+ this._maskRange.clone(maskRange);
57
64
  return this._allLoaded ? this._tileTreeRefs : undefined;
58
65
  }
59
66
  // Returns any potential FeatureSymbology overrides for drawing the planar clip mask.
@@ -1 +1 @@
1
- {"version":3,"file":"PlanarClipMaskState.js","sourceRoot":"","sources":["../../src/PlanarClipMaskState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,oDAAgJ;AAChJ,gEAA6D;AAK7D;;;GAGG;AACH,MAAa,mBAAmB;IAM9B,YAAoB,QAAgC;QAH5C,eAAU,GAAG,KAAK,CAAC;QACnB,4BAAuB,GAAG,KAAK,CAAC;QAGtC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,QAAgC;QACnD,OAAO,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAA0B;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,oCAAsB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,IAAW,sBAAsB,KAAc,OAAO,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAAA,CAAC;IAE/E,iBAAiB,CAAC,KAA2B;QAClD,IAAI,IAAI,CAAC,aAAa;YACpB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK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AAC;gBAChF,CAAC,CAAC,CAAC;gBACH,OAAO,YAAY,CAAC;YACtB,CAAC;YACD,mEAAmE;YACnE,cAAc,CAAC,OAAO,CAAC,CAAC,OAAe,EAAE,EAAE;gBACzC,SAAS,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;YAC7E,CAAC,CAAC,CAAC;QACL,CAAC;QAED,sGAAsG;QACtG,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC3B,KAAK,gCAAkB,CAAC,eAAe,CAAC,CAAC,CAAC;gBACxC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,uBAAwB,EAAE,IAAI,CAAC,CAAC;gBAC1E,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,KAAK,gCAAkB,CAAC,eAAe,CAAC,CAAC,CAAC;gBACxC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC;gBACnC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,uBAAwB,CAAC,CAAC;gBACnE,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,KAAK,gCAAkB,CAAC,oBAAoB,CAAC,CAAC,CAAC;gBAC7C,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,QAAQ,CAAC,uBAAwB;oBAChE,SAAS,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;gBACjD,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA1GD,kDA0GC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { FeatureAppearance, PlanarClipMaskMode, PlanarClipMaskPriority, PlanarClipMaskProps, PlanarClipMaskSettings } from \"@itwin/core-common\";\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\nimport { DisclosedTileTreeSet, TileTreeReference } from \"./tile/internal\";\nimport { SceneContext } from \"./ViewContext\";\nimport { SpatialViewState } from \"./SpatialViewState\";\n\n/** The State of Planar Clip Mask applied to a reality model or background map.\n * Handles loading models and their associated tiles for models that are used by masks but may not be otherwise loaded or displayed.\n * @beta\n */\nexport class PlanarClipMaskState {\n public readonly settings: PlanarClipMaskSettings;\n private _tileTreeRefs?: TileTreeReference[];\n private _allLoaded = false;\n private _usingViewportOverrides = false;\n\n private constructor(settings: PlanarClipMaskSettings) {\n this.settings = settings;\n }\n\n public static create(settings: PlanarClipMaskSettings): PlanarClipMaskState {\n return new PlanarClipMaskState(settings);\n }\n\n public static fromJSON(props: PlanarClipMaskProps): PlanarClipMaskState {\n return this.create(PlanarClipMaskSettings.fromJSON(props));\n }\n\n public get usingViewportOverrides(): boolean { return this._usingViewportOverrides; };\n\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n if (this._tileTreeRefs)\n this._tileTreeRefs.forEach((treeRef) => treeRef.discloseTileTrees(trees));\n }\n\n // Returns the TileTreeReferences for the models that need to be drawn to create the planar clip mask.\n public getTileTrees(view: SpatialViewState, classifiedModelId: Id64String): TileTreeReference[] | undefined {\n if (this.settings.mode === PlanarClipMaskMode.Priority) {\n // For priority mode we simply want refs for all viewed models if the priority is higher than the mask priority.\n const viewTrees = new Array<TileTreeReference>();\n const thisPriority = this.settings.priority === undefined ? PlanarClipMaskPriority.RealityModel : this.settings.priority;\n view.forEachTileTreeRef((ref) => {\n const tree = ref.treeOwner.load();\n if (tree && tree.modelId !== classifiedModelId && ref.planarclipMaskPriority > thisPriority)\n viewTrees.push(ref);\n });\n\n return viewTrees;\n }\n\n // For all other modes we need to let the tree refs in the view state decide which refs need to be drawn\n // since batched tiles cannot turn on/off individual models just by their tile tree refs.\n if (!this._tileTreeRefs) {\n this._tileTreeRefs = new Array<TileTreeReference>();\n if (this.settings.modelIds)\n view.collectMaskRefs(this.settings.modelIds, this._tileTreeRefs);\n }\n\n if (!this._allLoaded)\n this._allLoaded = this._tileTreeRefs.every((treeRef) => treeRef.treeOwner.load() !== undefined);\n\n return this._allLoaded ? this._tileTreeRefs : undefined;\n }\n\n // Returns any potential FeatureSymbology overrides for drawing the planar clip mask.\n public getPlanarClipMaskSymbologyOverrides(view: SpatialViewState, context: SceneContext): FeatureSymbology.Overrides | undefined {\n this._usingViewportOverrides = false;\n // First obtain a list of models that will need to be turned off for drawing the planar clip mask (only used for batched tile trees).\n const overrideModels = view.getModelsNotInMask(this.settings.modelIds, PlanarClipMaskMode.Priority === this.settings.mode);\n\n const noSubCategoryOrElementIds = !this.settings.subCategoryOrElementIds;\n if (noSubCategoryOrElementIds && !overrideModels)\n return undefined;\n\n const overrides = new FeatureSymbology.Overrides();\n\n if (overrideModels) {\n // overrideModels is used for batched models. For those, we need to create model overrides to turn off models that are\n // not wanted in the mask (using transparency) no matter what mask mode is being used.\n const appOff = FeatureAppearance.fromTransparency(1.0);\n // For Priority or Models mode, we need to start with the current overrides and modify them\n if (PlanarClipMaskMode.Priority === this.settings.mode || PlanarClipMaskMode.Models === this.settings.mode || noSubCategoryOrElementIds) {\n this._usingViewportOverrides = true; // Set flag to use listener since context.viewport might change afterwards.\n const curOverrides = new FeatureSymbology.Overrides(context.viewport);\n curOverrides.addInvisibleElementOverridesToNeverDrawn(); // need this for fully trans element overrides to not participate in mask\n overrideModels.forEach((modelId: string) => {\n curOverrides.override({ modelId, appearance: appOff, onConflict: \"replace\" });\n });\n return curOverrides;\n }\n // Otherwise, we just start with a default overrides and modify it.\n overrideModels.forEach((modelId: string) => {\n overrides.override({ modelId, appearance: appOff, onConflict: \"replace\" });\n });\n }\n\n // Add overrides to turn things on or off based on the subcategories or elements in the mask settings.\n switch (this.settings.mode) {\n case PlanarClipMaskMode.IncludeElements: {\n overrides.setAlwaysDrawnSet(this.settings.subCategoryOrElementIds!, true);\n return overrides;\n }\n case PlanarClipMaskMode.ExcludeElements: {\n overrides.ignoreSubCategory = true;\n overrides.setNeverDrawnSet(this.settings.subCategoryOrElementIds!);\n return overrides;\n }\n case PlanarClipMaskMode.IncludeSubCategories: {\n for (const subCategoryId of this.settings.subCategoryOrElementIds!)\n overrides.setVisibleSubCategory(subCategoryId);\n return overrides;\n }\n }\n\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"PlanarClipMaskState.js","sourceRoot":"","sources":["../../src/PlanarClipMaskState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,oDAAgJ;AAChJ,gEAA6D;AAI7D,wDAA+C;AAE/C;;;GAGG;AACH,MAAa,mBAAmB;IAO9B,YAAoB,QAAgC;QAJ5C,eAAU,GAAG,KAAK,CAAC;QACnB,4BAAuB,GAAG,KAAK,CAAC;QAChC,eAAU,GAAY,uBAAO,CAAC,UAAU,EAAE,CAAC;QAGjD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,QAAgC;QACnD,OAAO,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAA0B;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,oCAAsB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,IAAW,sBAAsB,KAAc,OAAO,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAAA,CAAC;IAE/E,iBAAiB,CAAC,KAA2B;QAClD,IAAI,IAAI,CAAC,aAAa;YACpB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,0IAA0I;IACnI,YAAY,CAAC,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,EAAE,EAAE;oBACzC,YAAY,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;gBAChF,CAAC,CAAC,CAAC;gBACH,OAAO,YAAY,CAAC;YACtB,CAAC;YACD,mEAAmE;YACnE,cAAc,CAAC,OAAO,CAAC,CAAC,OAAe,EAAE,EAAE;gBACzC,SAAS,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;YAC7E,CAAC,CAAC,CAAC;QACL,CAAC;QAED,sGAAsG;QACtG,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC3B,KAAK,gCAAkB,CAAC,eAAe,CAAC,CAAC,CAAC;gBACxC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,uBAAwB,EAAE,IAAI,CAAC,CAAC;gBAC1E,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,KAAK,gCAAkB,CAAC,eAAe,CAAC,CAAC,CAAC;gBACxC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC;gBACnC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,uBAAwB,CAAC,CAAC;gBACnE,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,KAAK,gCAAkB,CAAC,oBAAoB,CAAC,CAAC,CAAC;gBAC7C,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,QAAQ,CAAC,uBAAwB;oBAChE,SAAS,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;gBACjD,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA9GD,kDA8GC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { FeatureAppearance, PlanarClipMaskMode, PlanarClipMaskPriority, PlanarClipMaskProps, PlanarClipMaskSettings } from \"@itwin/core-common\";\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\nimport { DisclosedTileTreeSet, TileTreeReference } from \"./tile/internal\";\nimport { SceneContext } from \"./ViewContext\";\nimport { SpatialViewState } from \"./SpatialViewState\";\nimport { Range3d } from \"@itwin/core-geometry\";\n\n/** The State of Planar Clip Mask applied to a reality model or background map.\n * Handles loading models and their associated tiles for models that are used by masks but may not be otherwise loaded or displayed.\n * @beta\n */\nexport class PlanarClipMaskState {\n public readonly settings: PlanarClipMaskSettings;\n private _tileTreeRefs?: TileTreeReference[];\n private _allLoaded = false;\n private _usingViewportOverrides = false;\n private _maskRange: Range3d = Range3d.createNull();\n\n private constructor(settings: PlanarClipMaskSettings) {\n this.settings = settings;\n }\n\n public static create(settings: PlanarClipMaskSettings): PlanarClipMaskState {\n return new PlanarClipMaskState(settings);\n }\n\n public static fromJSON(props: PlanarClipMaskProps): PlanarClipMaskState {\n return this.create(PlanarClipMaskSettings.fromJSON(props));\n }\n\n public get usingViewportOverrides(): boolean { return this._usingViewportOverrides; };\n\n public discloseTileTrees(trees: DisclosedTileTreeSet): void {\n if (this._tileTreeRefs)\n this._tileTreeRefs.forEach((treeRef) => treeRef.discloseTileTrees(trees));\n }\n\n // Returns the TileTreeReferences for the models that need to be drawn to create the planar clip mask, and extend the maskRange if needed.\n public getTileTrees(view: SpatialViewState, classifiedModelId: Id64String, maskRange: Range3d): TileTreeReference[] | undefined {\n if (this.settings.mode === PlanarClipMaskMode.Priority) {\n // For priority mode we simply want refs for all viewed models if the priority is higher than the mask priority.\n // For this case, we don't need a maskRange so leave it as null.\n const viewTrees = new Array<TileTreeReference>();\n const thisPriority = this.settings.priority === undefined ? PlanarClipMaskPriority.RealityModel : this.settings.priority;\n view.forEachTileTreeRef((ref) => {\n const tree = ref.treeOwner.load();\n if (tree && tree.modelId !== classifiedModelId && ref.planarclipMaskPriority > thisPriority)\n viewTrees.push(ref);\n });\n\n return viewTrees;\n }\n\n // For all other modes we need to let the tree refs in the view state decide which refs need to be drawn\n // since batched tiles cannot turn on/off individual models just by their tile tree refs.\n // Keep calling this until loaded so that the range is valid.\n if (!this._allLoaded) {\n this._tileTreeRefs = new Array<TileTreeReference>();\n if (this.settings.modelIds) {\n view.collectMaskRefs(this.settings.modelIds, this._tileTreeRefs, maskRange);\n }\n this._allLoaded = this._tileTreeRefs.every((treeRef) => treeRef.treeOwner.load() !== undefined);\n maskRange.clone(this._maskRange);\n } else // If already loaded, just set the maskRange to the saved maskRange.\n this._maskRange.clone(maskRange);\n\n return this._allLoaded ? this._tileTreeRefs : undefined;\n }\n\n // Returns any potential FeatureSymbology overrides for drawing the planar clip mask.\n public getPlanarClipMaskSymbologyOverrides(view: SpatialViewState, context: SceneContext): FeatureSymbology.Overrides | undefined {\n this._usingViewportOverrides = false;\n // First obtain a list of models that will need to be turned off for drawing the planar clip mask (only used for batched tile trees).\n const overrideModels = view.getModelsNotInMask(this.settings.modelIds, PlanarClipMaskMode.Priority === this.settings.mode);\n\n const noSubCategoryOrElementIds = !this.settings.subCategoryOrElementIds;\n if (noSubCategoryOrElementIds && !overrideModels)\n return undefined;\n\n const overrides = new FeatureSymbology.Overrides();\n\n if (overrideModels) {\n // overrideModels is used for batched models. For those, we need to create model overrides to turn off models that are\n // not wanted in the mask (using transparency) no matter what mask mode is being used.\n const appOff = FeatureAppearance.fromTransparency(1.0);\n // For Priority or Models mode, we need to start with the current overrides and modify them\n if (PlanarClipMaskMode.Priority === this.settings.mode || PlanarClipMaskMode.Models === this.settings.mode || noSubCategoryOrElementIds) {\n this._usingViewportOverrides = true; // Set flag to use listener since context.viewport might change afterwards.\n const curOverrides = new FeatureSymbology.Overrides(context.viewport);\n curOverrides.addInvisibleElementOverridesToNeverDrawn(); // need this for fully trans element overrides to not participate in mask\n overrideModels.forEach((modelId: string) => {\n curOverrides.override({ modelId, appearance: appOff, onConflict: \"replace\" });\n });\n return curOverrides;\n }\n // Otherwise, we just start with a default overrides and modify it.\n overrideModels.forEach((modelId: string) => {\n overrides.override({ modelId, appearance: appOff, onConflict: \"replace\" });\n });\n }\n\n // Add overrides to turn things on or off based on the subcategories or elements in the mask settings.\n switch (this.settings.mode) {\n case PlanarClipMaskMode.IncludeElements: {\n overrides.setAlwaysDrawnSet(this.settings.subCategoryOrElementIds!, true);\n return overrides;\n }\n case PlanarClipMaskMode.ExcludeElements: {\n overrides.ignoreSubCategory = true;\n overrides.setNeverDrawnSet(this.settings.subCategoryOrElementIds!);\n return overrides;\n }\n case PlanarClipMaskMode.IncludeSubCategories: {\n for (const subCategoryId of this.settings.subCategoryOrElementIds!)\n overrides.setVisibleSubCategory(subCategoryId);\n return overrides;\n }\n }\n\n return undefined;\n }\n}\n"]}
@@ -104,9 +104,10 @@ export declare class SpatialViewState extends ViewState3d {
104
104
  /** For getting the [TileTreeReference]s that are in the modelIds, for planar classification.
105
105
  * @param modelIds modelIds for which to get the TileTreeReferences
106
106
  * @param maskTreeRefs where to store the TileTreeReferences
107
+ * @param maskRange range to extend for the maskRefs
107
108
  * @internal
108
109
  */
109
- collectMaskRefs(modelIds: OrderedId64Iterable, maskTreeRefs: TileTreeReference[]): void;
110
+ collectMaskRefs(modelIds: OrderedId64Iterable, maskTreeRefs: TileTreeReference[], maskRange: Range3d): void;
110
111
  /** For getting a list of modelIds which do not participate in masking for planar classification.
111
112
  * @param maskModels models which DO participate in planar clip masking
112
113
  * @param useVisible when true, use visible models to set flag
@@ -1 +1 @@
1
- {"version":3,"file":"SpatialViewState.d.ts","sourceRoot":"","sources":["../../src/SpatialViewState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAqB,UAAU,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAClG,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AG,SAAS,EAAE,WAAW,EAAE,OAAO,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,IAAI;IAI9L;;;;;OAKG;IACI,eAAe,CAAC,QAAQ,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI;IAIlH;;;;OAIG;IACI,kBAAkB,CAAC,UAAU,EAAE,mBAAmB,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,UAAU,EAAE,GAAG,SAAS;IAIrH,OAAO,CAAC,8BAA8B;IAYtC,OAAO,CAAC,gCAAgC;CAIzC;AACD;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,gBAAgB;IACzD,WAA2B,SAAS,WAA2C;gBAEnE,KAAK,EAAE,0BAA0B,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,kBAAkB;IAEhK,cAAc,IAAI,OAAO;CAC1C"}
@@ -206,10 +206,11 @@ class SpatialViewState extends ViewState_1.ViewState3d {
206
206
  /** For getting the [TileTreeReference]s that are in the modelIds, for planar classification.
207
207
  * @param modelIds modelIds for which to get the TileTreeReferences
208
208
  * @param maskTreeRefs where to store the TileTreeReferences
209
+ * @param maskRange range to extend for the maskRefs
209
210
  * @internal
210
211
  */
211
- collectMaskRefs(modelIds, maskTreeRefs) {
212
- this._treeRefs.collectMaskRefs(modelIds, maskTreeRefs);
212
+ collectMaskRefs(modelIds, maskTreeRefs, maskRange) {
213
+ this._treeRefs.collectMaskRefs(modelIds, maskTreeRefs, maskRange);
213
214
  }
214
215
  /** For getting a list of modelIds which do not participate in masking for planar classification.
215
216
  * @param maskModels models which DO participate in planar clip masking
@@ -1 +1 @@
1
- {"version":3,"file":"SpatialViewState.js","sourceRoot":"","sources":["../../src/SpatialViewState.ts"],"names":[],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AC,CAAC;IACnE,CAAC;IAEO,8BAA8B;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC;QACnD,MAAM,IAAI,GAAG,GAAG,EAAE;YAChB,IAAI,CAAC,wBAAwB,EAAE,CAAC;YAChC,IAAI,CAAC,qBAAqB,CAAC,UAAU,EAAE,CAAC;QAC1C,CAAC,CAAC;QAEF,IAAI,CAAC,iCAAiC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9E,IAAI,CAAC,iCAAiC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QAChF,IAAI,CAAC,iCAAiC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IAClF,CAAC;IAEO,gCAAgC;QACtC,IAAI,CAAC,iCAAiC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,iCAAiC,CAAC,MAAM,GAAG,CAAC,CAAC;IACpD,CAAC;CACF;AAlQD,4CAkQC;AACD;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,gBAAgB;IAClD,MAAM,KAAc,SAAS,KAAK,OAAO,4BAA4B,CAAC,CAAC,CAAC;IAE/E,YAAY,KAAiC,EAAE,MAAwB,EAAE,UAAiC,EAAE,YAAiC,EAAE,aAAiC,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAEpO,cAAc,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;CAC5D;AAND,sDAMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { BeEvent, CompressedId64Set, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport { Constant, Matrix3d, Range3d, XYAndZ } from \"@itwin/core-geometry\";\nimport { AxisAlignedBox3d, HydrateViewStateRequestProps, HydrateViewStateResponseProps, SpatialViewDefinitionProps, ViewStateProps } from \"@itwin/core-common\";\nimport { AuxCoordSystemSpatialState, AuxCoordSystemState } from \"./AuxCoordSys\";\nimport { ModelSelectorState } from \"./ModelSelectorState\";\nimport { CategorySelectorState } from \"./CategorySelectorState\";\nimport { DisplayStyle3dState } from \"./DisplayStyleState\";\nimport { GeometricModel3dState, GeometricModelState } from \"./ModelState\";\nimport { SceneContext } from \"./ViewContext\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { AttachToViewportArgs, ViewState3d } from \"./ViewState\";\nimport { SpatialTileTreeReferences, TileTreeReference } from \"./tile/internal\";\n\n/** Options supplied to [[SpatialViewState.computeFitRange]].\n * @public\n */\nexport interface ComputeSpatialViewFitRangeOptions {\n /** The minimal extents. The computed range will be unioned with this range if supplied. */\n baseExtents?: Range3d;\n}\n\n/** Defines a view of one or more SpatialModels.\n * The list of viewed models is stored in the ModelSelector.\n * @public\n * @extensions\n */\nexport class SpatialViewState extends ViewState3d {\n public static override get className() { return \"SpatialViewDefinition\"; }\n\n private readonly _treeRefs: SpatialTileTreeReferences;\n private _modelSelector: ModelSelectorState;\n private readonly _unregisterModelSelectorListeners: VoidFunction[] = [];\n\n /** An event raised when the set of models viewed by this view changes, *only* if the view is attached to a [[Viewport]].\n * @public\n */\n public readonly onViewedModelsChanged = new BeEvent<() => void>();\n\n public get modelSelector(): ModelSelectorState {\n return this._modelSelector;\n }\n\n public set modelSelector(selector: ModelSelectorState) {\n if (selector === this.modelSelector)\n return;\n\n const isAttached = this.isAttachedToViewport;\n this.unregisterModelSelectorListeners();\n\n this._modelSelector = selector;\n\n if (isAttached) {\n this.registerModelSelectorListeners();\n this.onViewedModelsChanged.raiseEvent();\n }\n\n this.markModelSelectorChanged();\n }\n\n /** Create a new *blank* SpatialViewState. The returned SpatialViewState will nave non-persistent empty [[CategorySelectorState]] and [[ModelSelectorState]],\n * and a non-persistent [[DisplayStyle3dState]] with default values for all of its components. Generally after creating a blank SpatialViewState,\n * callers will modify the state to suit specific needs.\n * @param iModel The IModelConnection for the new SpatialViewState\n * @param origin The origin for the new SpatialViewState\n * @param extents The extents for the new SpatialViewState\n * @param rotation The rotation of the new SpatialViewState. If undefined, use top view.\n * @public\n */\n public static createBlank(iModel: IModelConnection, origin: XYAndZ, extents: XYAndZ, rotation?: Matrix3d): SpatialViewState {\n const blank = {} as any;\n const cat = new CategorySelectorState(blank, iModel);\n const modelSelectorState = new ModelSelectorState(blank, iModel);\n const displayStyleState = new DisplayStyle3dState(blank, iModel);\n const view = new this(blank, iModel, cat, displayStyleState, modelSelectorState);\n view.setOrigin(origin);\n view.setExtents(extents);\n if (undefined !== rotation)\n view.setRotation(rotation);\n return view;\n }\n\n public static override createFromProps(props: ViewStateProps, iModel: IModelConnection): SpatialViewState {\n const cat = new CategorySelectorState(props.categorySelectorProps, iModel);\n const displayStyleState = new DisplayStyle3dState(props.displayStyleProps, iModel);\n const modelSelectorState = new ModelSelectorState(props.modelSelectorProps!, iModel);\n return new this(props.viewDefinitionProps as SpatialViewDefinitionProps, iModel, cat, displayStyleState, modelSelectorState);\n }\n\n public override toProps(): ViewStateProps {\n const props = super.toProps();\n props.modelSelectorProps = this.modelSelector.toJSON();\n return props;\n }\n\n constructor(props: SpatialViewDefinitionProps, iModel: IModelConnection, arg3: CategorySelectorState, displayStyle: DisplayStyle3dState, modelSelector: ModelSelectorState) {\n super(props, iModel, arg3, displayStyle);\n this._modelSelector = modelSelector;\n if (arg3 instanceof SpatialViewState) // from clone\n this._modelSelector = arg3.modelSelector.clone();\n\n this._treeRefs = SpatialTileTreeReferences.create(this);\n }\n\n /** @internal */\n public override isSpatialView(): this is SpatialViewState { return true; }\n\n public override equals(other: this): boolean { return super.equals(other) && this.modelSelector.equals(other.modelSelector); }\n\n public override createAuxCoordSystem(acsName: string): AuxCoordSystemState { return AuxCoordSystemSpatialState.createNew(acsName, this.iModel); }\n public get defaultExtentLimits() { return { min: Constant.oneMillimeter, max: 3 * Constant.diameterOfEarth }; } // Increased max by 3X to support globe mode.\n\n /** @internal */\n public markModelSelectorChanged(): void {\n this._treeRefs.update();\n }\n\n /** Get world-space viewed extents based on the iModel's project extents.\n * @deprecated in 3.6. These extents are based on [[IModelConnection.displayedExtents]], which is deprecated. Consider using [[computeFitRange]] or [[getViewedExtents]] instead.\n */\n protected getDisplayedExtents(): AxisAlignedBox3d {\n /* eslint-disable-next-line deprecation/deprecation */\n const extents = Range3d.fromJSON<AxisAlignedBox3d>(this.iModel.displayedExtents);\n extents.scaleAboutCenterInPlace(1.0001); // projectExtents. lying smack up against the extents is not excluded by frustum...\n extents.extendRange(this.getGroundExtents());\n return extents;\n }\n\n private computeBaseExtents(): AxisAlignedBox3d {\n const extents = Range3d.fromJSON<AxisAlignedBox3d>(this.iModel.projectExtents);\n\n // Ensure geometry coincident with planes of the project extents is not clipped.\n extents.scaleAboutCenterInPlace(1.0001);\n\n // Ensure ground plane is not clipped, if it's being drawn.\n extents.extendRange(this.getGroundExtents());\n\n return extents;\n }\n\n /** Compute a volume in world coordinates tightly encompassing the contents of the view. The volume is computed from the union of the volumes of the\n * view's viewed models, including [GeometricModel]($backend)s and reality models.\n * Those volumes are obtained from the [[TileTree]]s used to render those models, so any tile tree that has not yet been loaded will not contribute to the computation.\n * If `options.baseExtents` is defined, it will be unioned with the computed volume.\n * If the computed volume is null (empty), a default volume will be computed from [IModel.projectExtents]($common), which may be a looser approximation of the\n * models' volumes.\n * @param options Options used to customize how the volume is computed.\n * @returns A non-null volume in world coordinates encompassing the contents of the view.\n */\n public computeFitRange(options?: ComputeSpatialViewFitRangeOptions): AxisAlignedBox3d {\n // Fit to the union of the ranges of all loaded tile trees.\n const range = options?.baseExtents?.clone() ?? new Range3d();\n this.forEachTileTreeRef((ref) => {\n ref.unionFitRange(range);\n });\n\n // Fall back to the project extents if necessary.\n if (range.isNull)\n range.setFrom(this.computeBaseExtents());\n\n // Avoid ridiculously small extents.\n range.ensureMinLengths(1.0);\n\n return range;\n }\n\n public getViewedExtents(): AxisAlignedBox3d {\n // Encompass the project extents and ground plane.\n const extents = this.computeBaseExtents();\n\n // Include any tile trees that extend outside the project extents.\n extents.extendRange(this.computeFitRange());\n\n return extents;\n }\n\n public override toJSON(): SpatialViewDefinitionProps {\n const val = super.toJSON() as SpatialViewDefinitionProps;\n val.modelSelectorId = this.modelSelector.id;\n return val;\n }\n\n /** @internal */\n protected override preload(hydrateRequest: HydrateViewStateRequestProps): void {\n super.preload(hydrateRequest);\n const notLoaded = this.iModel.models.filterLoaded(this.modelSelector.models);\n if (undefined === notLoaded)\n return; // all requested models are already loaded\n hydrateRequest.notLoadedModelSelectorStateModels = CompressedId64Set.sortAndCompress(notLoaded);\n }\n\n /** @internal */\n protected override async postload(hydrateResponse: HydrateViewStateResponseProps): Promise<void> {\n const promises = [];\n promises.push(super.postload(hydrateResponse));\n if (hydrateResponse.modelSelectorStateModels !== undefined)\n promises.push(this.iModel.models.updateLoadedWithModelProps(hydrateResponse.modelSelectorStateModels));\n await Promise.all(promises);\n }\n\n public viewsModel(modelId: Id64String): boolean { return this.modelSelector.containsModel(modelId); }\n public clearViewedModels() { this.modelSelector.models.clear(); }\n public addViewedModel(id: Id64String) { this.modelSelector.addModels(id); }\n public removeViewedModel(id: Id64String) { this.modelSelector.dropModels(id); }\n\n public forEachModel(func: (model: GeometricModelState) => void) {\n for (const modelId of this.modelSelector.models) {\n const model = this.iModel.models.getLoaded(modelId);\n if (undefined !== model && undefined !== model.asGeometricModel3d)\n func(model as GeometricModel3dState);\n }\n }\n\n /** @internal */\n public override forEachModelTreeRef(func: (treeRef: TileTreeReference) => void): void {\n for (const ref of this._treeRefs)\n func(ref);\n }\n\n /** @internal */\n public override createScene(context: SceneContext): void {\n super.createScene(context);\n context.textureDrapes.forEach((drape) => drape.collectGraphics(context));\n context.viewport.target.updateSolarShadows(this.getDisplayStyle3d().wantShadows ? context : undefined);\n }\n\n /** See [[ViewState.attachToViewport]]. */\n public override attachToViewport(args: AttachToViewportArgs): void {\n super.attachToViewport(args);\n this.registerModelSelectorListeners();\n this._treeRefs.attachToViewport(args);\n }\n\n /** See [[ViewState.detachFromViewport]]. */\n public override detachFromViewport(): void {\n super.detachFromViewport();\n this._treeRefs.detachFromViewport();\n this.unregisterModelSelectorListeners();\n }\n\n /** Chiefly for debugging: change the \"deactivated\" state of one or more tile tree references. Deactivated references are\n * omitted when iterating the references, so e.g. their graphics are omitted from the scene.\n * @param modelIds The Ids of one or more models whose tile tree references are to be affected. If omitted, all models are affected.\n * @param deactivated True to deactivate the specified references, false to reactivate them, undefined to invert each one's current state.\n * @param which The references to be affected as either a broad category or one or more indices of animated references.\n * @internal\n */\n public setTileTreeReferencesDeactivated(modelIds: Id64String | Id64String[] | undefined, deactivated: boolean | undefined, which: \"all\" | \"animated\" | \"primary\" | \"section\" | number[]): void {\n this._treeRefs.setDeactivated(modelIds, deactivated, which);\n }\n\n /** For getting the [TileTreeReference]s that are in the modelIds, for planar classification.\n * @param modelIds modelIds for which to get the TileTreeReferences\n * @param maskTreeRefs where to store the TileTreeReferences\n * @internal\n */\n public collectMaskRefs(modelIds: OrderedId64Iterable, maskTreeRefs: TileTreeReference[]): void {\n this._treeRefs.collectMaskRefs(modelIds, maskTreeRefs);\n }\n\n /** For getting a list of modelIds which do not participate in masking for planar classification.\n * @param maskModels models which DO participate in planar clip masking\n * @param useVisible when true, use visible models to set flag\n * @internal\n */\n public getModelsNotInMask(maskModels: OrderedId64Iterable | undefined, useVisible: boolean): Id64String[] | undefined {\n return this._treeRefs.getModelsNotInMask(maskModels, useVisible);\n }\n\n private registerModelSelectorListeners(): void {\n const models = this.modelSelector.observableModels;\n const func = () => {\n this.markModelSelectorChanged();\n this.onViewedModelsChanged.raiseEvent();\n };\n\n this._unregisterModelSelectorListeners.push(models.onAdded.addListener(func));\n this._unregisterModelSelectorListeners.push(models.onDeleted.addListener(func));\n this._unregisterModelSelectorListeners.push(models.onCleared.addListener(func));\n }\n\n private unregisterModelSelectorListeners(): void {\n this._unregisterModelSelectorListeners.forEach((f) => f());\n this._unregisterModelSelectorListeners.length = 0;\n }\n}\n/** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.\n * @public\n * @extensions\n */\nexport class OrthographicViewState extends SpatialViewState {\n public static override get className() { return \"OrthographicViewDefinition\"; }\n\n constructor(props: SpatialViewDefinitionProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle3dState, modelSelector: ModelSelectorState) { super(props, iModel, categories, displayStyle, modelSelector); }\n\n public override supportsCamera(): boolean { return false; }\n}\n"]}
1
+ {"version":3,"file":"SpatialViewState.js","sourceRoot":"","sources":["../../src/SpatialViewState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkG;AAClG,wDAA2E;AAE3E,+CAAgF;AAChF,6DAA0D;AAC1D,mEAAgE;AAChE,2DAA0D;AAI1D,2CAAgE;AAChE,8CAA+E;AAU/E;;;;GAIG;AACH,MAAa,gBAAiB,SAAQ,uBAAW;IACxC,MAAM,KAAc,SAAS,KAAK,OAAO,uBAAuB,CAAC,CAAC,CAAC;IAW1E,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,IAAW,aAAa,CAAC,QAA4B;QACnD,IAAI,QAAQ,KAAK,IAAI,CAAC,aAAa;YACjC,OAAO;QAET,MAAM,UAAU,GAAG,IAAI,CAAC,oBAAoB,CAAC;QAC7C,IAAI,CAAC,gCAAgC,EAAE,CAAC;QAExC,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC;QAE/B,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,8BAA8B,EAAE,C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CAAC,iCAAiC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,iCAAiC,CAAC,MAAM,GAAG,CAAC,CAAC;IACpD,CAAC;CACF;AAnQD,4CAmQC;AACD;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,gBAAgB;IAClD,MAAM,KAAc,SAAS,KAAK,OAAO,4BAA4B,CAAC,CAAC,CAAC;IAE/E,YAAY,KAAiC,EAAE,MAAwB,EAAE,UAAiC,EAAE,YAAiC,EAAE,aAAiC,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAEpO,cAAc,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;CAC5D;AAND,sDAMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { BeEvent, CompressedId64Set, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport { Constant, Matrix3d, Range3d, XYAndZ } from \"@itwin/core-geometry\";\nimport { AxisAlignedBox3d, HydrateViewStateRequestProps, HydrateViewStateResponseProps, SpatialViewDefinitionProps, ViewStateProps } from \"@itwin/core-common\";\nimport { AuxCoordSystemSpatialState, AuxCoordSystemState } from \"./AuxCoordSys\";\nimport { ModelSelectorState } from \"./ModelSelectorState\";\nimport { CategorySelectorState } from \"./CategorySelectorState\";\nimport { DisplayStyle3dState } from \"./DisplayStyleState\";\nimport { GeometricModel3dState, GeometricModelState } from \"./ModelState\";\nimport { SceneContext } from \"./ViewContext\";\nimport { IModelConnection } from \"./IModelConnection\";\nimport { AttachToViewportArgs, ViewState3d } from \"./ViewState\";\nimport { SpatialTileTreeReferences, TileTreeReference } from \"./tile/internal\";\n\n/** Options supplied to [[SpatialViewState.computeFitRange]].\n * @public\n */\nexport interface ComputeSpatialViewFitRangeOptions {\n /** The minimal extents. The computed range will be unioned with this range if supplied. */\n baseExtents?: Range3d;\n}\n\n/** Defines a view of one or more SpatialModels.\n * The list of viewed models is stored in the ModelSelector.\n * @public\n * @extensions\n */\nexport class SpatialViewState extends ViewState3d {\n public static override get className() { return \"SpatialViewDefinition\"; }\n\n private readonly _treeRefs: SpatialTileTreeReferences;\n private _modelSelector: ModelSelectorState;\n private readonly _unregisterModelSelectorListeners: VoidFunction[] = [];\n\n /** An event raised when the set of models viewed by this view changes, *only* if the view is attached to a [[Viewport]].\n * @public\n */\n public readonly onViewedModelsChanged = new BeEvent<() => void>();\n\n public get modelSelector(): ModelSelectorState {\n return this._modelSelector;\n }\n\n public set modelSelector(selector: ModelSelectorState) {\n if (selector === this.modelSelector)\n return;\n\n const isAttached = this.isAttachedToViewport;\n this.unregisterModelSelectorListeners();\n\n this._modelSelector = selector;\n\n if (isAttached) {\n this.registerModelSelectorListeners();\n this.onViewedModelsChanged.raiseEvent();\n }\n\n this.markModelSelectorChanged();\n }\n\n /** Create a new *blank* SpatialViewState. The returned SpatialViewState will nave non-persistent empty [[CategorySelectorState]] and [[ModelSelectorState]],\n * and a non-persistent [[DisplayStyle3dState]] with default values for all of its components. Generally after creating a blank SpatialViewState,\n * callers will modify the state to suit specific needs.\n * @param iModel The IModelConnection for the new SpatialViewState\n * @param origin The origin for the new SpatialViewState\n * @param extents The extents for the new SpatialViewState\n * @param rotation The rotation of the new SpatialViewState. If undefined, use top view.\n * @public\n */\n public static createBlank(iModel: IModelConnection, origin: XYAndZ, extents: XYAndZ, rotation?: Matrix3d): SpatialViewState {\n const blank = {} as any;\n const cat = new CategorySelectorState(blank, iModel);\n const modelSelectorState = new ModelSelectorState(blank, iModel);\n const displayStyleState = new DisplayStyle3dState(blank, iModel);\n const view = new this(blank, iModel, cat, displayStyleState, modelSelectorState);\n view.setOrigin(origin);\n view.setExtents(extents);\n if (undefined !== rotation)\n view.setRotation(rotation);\n return view;\n }\n\n public static override createFromProps(props: ViewStateProps, iModel: IModelConnection): SpatialViewState {\n const cat = new CategorySelectorState(props.categorySelectorProps, iModel);\n const displayStyleState = new DisplayStyle3dState(props.displayStyleProps, iModel);\n const modelSelectorState = new ModelSelectorState(props.modelSelectorProps!, iModel);\n return new this(props.viewDefinitionProps as SpatialViewDefinitionProps, iModel, cat, displayStyleState, modelSelectorState);\n }\n\n public override toProps(): ViewStateProps {\n const props = super.toProps();\n props.modelSelectorProps = this.modelSelector.toJSON();\n return props;\n }\n\n constructor(props: SpatialViewDefinitionProps, iModel: IModelConnection, arg3: CategorySelectorState, displayStyle: DisplayStyle3dState, modelSelector: ModelSelectorState) {\n super(props, iModel, arg3, displayStyle);\n this._modelSelector = modelSelector;\n if (arg3 instanceof SpatialViewState) // from clone\n this._modelSelector = arg3.modelSelector.clone();\n\n this._treeRefs = SpatialTileTreeReferences.create(this);\n }\n\n /** @internal */\n public override isSpatialView(): this is SpatialViewState { return true; }\n\n public override equals(other: this): boolean { return super.equals(other) && this.modelSelector.equals(other.modelSelector); }\n\n public override createAuxCoordSystem(acsName: string): AuxCoordSystemState { return AuxCoordSystemSpatialState.createNew(acsName, this.iModel); }\n public get defaultExtentLimits() { return { min: Constant.oneMillimeter, max: 3 * Constant.diameterOfEarth }; } // Increased max by 3X to support globe mode.\n\n /** @internal */\n public markModelSelectorChanged(): void {\n this._treeRefs.update();\n }\n\n /** Get world-space viewed extents based on the iModel's project extents.\n * @deprecated in 3.6. These extents are based on [[IModelConnection.displayedExtents]], which is deprecated. Consider using [[computeFitRange]] or [[getViewedExtents]] instead.\n */\n protected getDisplayedExtents(): AxisAlignedBox3d {\n /* eslint-disable-next-line deprecation/deprecation */\n const extents = Range3d.fromJSON<AxisAlignedBox3d>(this.iModel.displayedExtents);\n extents.scaleAboutCenterInPlace(1.0001); // projectExtents. lying smack up against the extents is not excluded by frustum...\n extents.extendRange(this.getGroundExtents());\n return extents;\n }\n\n private computeBaseExtents(): AxisAlignedBox3d {\n const extents = Range3d.fromJSON<AxisAlignedBox3d>(this.iModel.projectExtents);\n\n // Ensure geometry coincident with planes of the project extents is not clipped.\n extents.scaleAboutCenterInPlace(1.0001);\n\n // Ensure ground plane is not clipped, if it's being drawn.\n extents.extendRange(this.getGroundExtents());\n\n return extents;\n }\n\n /** Compute a volume in world coordinates tightly encompassing the contents of the view. The volume is computed from the union of the volumes of the\n * view's viewed models, including [GeometricModel]($backend)s and reality models.\n * Those volumes are obtained from the [[TileTree]]s used to render those models, so any tile tree that has not yet been loaded will not contribute to the computation.\n * If `options.baseExtents` is defined, it will be unioned with the computed volume.\n * If the computed volume is null (empty), a default volume will be computed from [IModel.projectExtents]($common), which may be a looser approximation of the\n * models' volumes.\n * @param options Options used to customize how the volume is computed.\n * @returns A non-null volume in world coordinates encompassing the contents of the view.\n */\n public computeFitRange(options?: ComputeSpatialViewFitRangeOptions): AxisAlignedBox3d {\n // Fit to the union of the ranges of all loaded tile trees.\n const range = options?.baseExtents?.clone() ?? new Range3d();\n this.forEachTileTreeRef((ref) => {\n ref.unionFitRange(range);\n });\n\n // Fall back to the project extents if necessary.\n if (range.isNull)\n range.setFrom(this.computeBaseExtents());\n\n // Avoid ridiculously small extents.\n range.ensureMinLengths(1.0);\n\n return range;\n }\n\n public getViewedExtents(): AxisAlignedBox3d {\n // Encompass the project extents and ground plane.\n const extents = this.computeBaseExtents();\n\n // Include any tile trees that extend outside the project extents.\n extents.extendRange(this.computeFitRange());\n\n return extents;\n }\n\n public override toJSON(): SpatialViewDefinitionProps {\n const val = super.toJSON() as SpatialViewDefinitionProps;\n val.modelSelectorId = this.modelSelector.id;\n return val;\n }\n\n /** @internal */\n protected override preload(hydrateRequest: HydrateViewStateRequestProps): void {\n super.preload(hydrateRequest);\n const notLoaded = this.iModel.models.filterLoaded(this.modelSelector.models);\n if (undefined === notLoaded)\n return; // all requested models are already loaded\n hydrateRequest.notLoadedModelSelectorStateModels = CompressedId64Set.sortAndCompress(notLoaded);\n }\n\n /** @internal */\n protected override async postload(hydrateResponse: HydrateViewStateResponseProps): Promise<void> {\n const promises = [];\n promises.push(super.postload(hydrateResponse));\n if (hydrateResponse.modelSelectorStateModels !== undefined)\n promises.push(this.iModel.models.updateLoadedWithModelProps(hydrateResponse.modelSelectorStateModels));\n await Promise.all(promises);\n }\n\n public viewsModel(modelId: Id64String): boolean { return this.modelSelector.containsModel(modelId); }\n public clearViewedModels() { this.modelSelector.models.clear(); }\n public addViewedModel(id: Id64String) { this.modelSelector.addModels(id); }\n public removeViewedModel(id: Id64String) { this.modelSelector.dropModels(id); }\n\n public forEachModel(func: (model: GeometricModelState) => void) {\n for (const modelId of this.modelSelector.models) {\n const model = this.iModel.models.getLoaded(modelId);\n if (undefined !== model && undefined !== model.asGeometricModel3d)\n func(model as GeometricModel3dState);\n }\n }\n\n /** @internal */\n public override forEachModelTreeRef(func: (treeRef: TileTreeReference) => void): void {\n for (const ref of this._treeRefs)\n func(ref);\n }\n\n /** @internal */\n public override createScene(context: SceneContext): void {\n super.createScene(context);\n context.textureDrapes.forEach((drape) => drape.collectGraphics(context));\n context.viewport.target.updateSolarShadows(this.getDisplayStyle3d().wantShadows ? context : undefined);\n }\n\n /** See [[ViewState.attachToViewport]]. */\n public override attachToViewport(args: AttachToViewportArgs): void {\n super.attachToViewport(args);\n this.registerModelSelectorListeners();\n this._treeRefs.attachToViewport(args);\n }\n\n /** See [[ViewState.detachFromViewport]]. */\n public override detachFromViewport(): void {\n super.detachFromViewport();\n this._treeRefs.detachFromViewport();\n this.unregisterModelSelectorListeners();\n }\n\n /** Chiefly for debugging: change the \"deactivated\" state of one or more tile tree references. Deactivated references are\n * omitted when iterating the references, so e.g. their graphics are omitted from the scene.\n * @param modelIds The Ids of one or more models whose tile tree references are to be affected. If omitted, all models are affected.\n * @param deactivated True to deactivate the specified references, false to reactivate them, undefined to invert each one's current state.\n * @param which The references to be affected as either a broad category or one or more indices of animated references.\n * @internal\n */\n public setTileTreeReferencesDeactivated(modelIds: Id64String | Id64String[] | undefined, deactivated: boolean | undefined, which: \"all\" | \"animated\" | \"primary\" | \"section\" | number[]): void {\n this._treeRefs.setDeactivated(modelIds, deactivated, which);\n }\n\n /** For getting the [TileTreeReference]s that are in the modelIds, for planar classification.\n * @param modelIds modelIds for which to get the TileTreeReferences\n * @param maskTreeRefs where to store the TileTreeReferences\n * @param maskRange range to extend for the maskRefs\n * @internal\n */\n public collectMaskRefs(modelIds: OrderedId64Iterable, maskTreeRefs: TileTreeReference[], maskRange: Range3d): void {\n this._treeRefs.collectMaskRefs(modelIds, maskTreeRefs, maskRange);\n }\n\n /** For getting a list of modelIds which do not participate in masking for planar classification.\n * @param maskModels models which DO participate in planar clip masking\n * @param useVisible when true, use visible models to set flag\n * @internal\n */\n public getModelsNotInMask(maskModels: OrderedId64Iterable | undefined, useVisible: boolean): Id64String[] | undefined {\n return this._treeRefs.getModelsNotInMask(maskModels, useVisible);\n }\n\n private registerModelSelectorListeners(): void {\n const models = this.modelSelector.observableModels;\n const func = () => {\n this.markModelSelectorChanged();\n this.onViewedModelsChanged.raiseEvent();\n };\n\n this._unregisterModelSelectorListeners.push(models.onAdded.addListener(func));\n this._unregisterModelSelectorListeners.push(models.onDeleted.addListener(func));\n this._unregisterModelSelectorListeners.push(models.onCleared.addListener(func));\n }\n\n private unregisterModelSelectorListeners(): void {\n this._unregisterModelSelectorListeners.forEach((f) => f());\n this._unregisterModelSelectorListeners.length = 0;\n }\n}\n/** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.\n * @public\n * @extensions\n */\nexport class OrthographicViewState extends SpatialViewState {\n public static override get className() { return \"OrthographicViewDefinition\"; }\n\n constructor(props: SpatialViewDefinitionProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle3dState, modelSelector: ModelSelectorState) { super(props, iModel, categories, displayStyle, modelSelector); }\n\n public override supportsCamera(): boolean { return false; }\n}\n"]}
@@ -357,8 +357,12 @@ export declare abstract class GraphicBuilder {
357
357
  addRangeBox(range: Range3d, solid?: boolean): void;
358
358
  /** Add Frustum edges. Useful for debugging. */
359
359
  addFrustum(frustum: Frustum): void;
360
+ /** Add Frustum sides. Useful for debugging. */
361
+ addFrustumSides(frustum: Frustum): void;
360
362
  /** Add range edges from corner points */
361
363
  addRangeBoxFromCorners(p: Point3d[]): void;
364
+ /** Add range sides from corner points */
365
+ addRangeBoxSidesFromCorners(p: Point3d[]): void;
362
366
  /** Sets the current active symbology for this builder. Any new geometry subsequently added will be drawn using the specified symbology.
363
367
  * @param lineColor The color in which to draw lines.
364
368
  * @param fillColor The color in which to draw filled regions.
@@ -1 +1 @@
1
- {"version":3,"file":"GraphicBuilder.d.ts","sourceRoot":"","sources":["../../../src/render/GraphicBuilder.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,iBAAiB,EAAE,KAAK,EAAO,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAC1G,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAO,MAAM,oBAAoB,CAAC;AAC9H,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;;;;GAQG;AACH,oBAAY,WAAW;IACrB;;;;;;;OAOG;IACH,cAAc,IAAA;IACd,qEAAqE;IACrE;;;;;;OAMG;IACH,KAAK,IAAA;IACL,8GAA8G;IAC9G;;;;;;OAMG;IACH,eAAe,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AAC,KAAK,EAAE,OAAO,EAAE,KAAK,UAAQ,GAAG,IAAI;IAWvD,+CAA+C;IACxC,UAAU,CAAC,OAAO,EAAE,OAAO;IAIlC,+CAA+C;IACxC,eAAe,CAAC,OAAO,EAAE,OAAO;IAIvC,yCAAyC;IAClC,sBAAsB,CAAC,CAAC,EAAE,OAAO,EAAE;IAmB1C,yCAAyC;IAClC,2BAA2B,CAAC,CAAC,EAAE,OAAO,EAAE;IAuC/C;;;;;;OAMG;IACI,YAAY,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,aAAmB;IAI9G;;;;;OAKG;IACI,eAAe,CAAC,SAAS,EAAE,QAAQ;CAC3C"}
@@ -251,6 +251,10 @@ class GraphicBuilder {
251
251
  addFrustum(frustum) {
252
252
  this.addRangeBoxFromCorners(frustum.points);
253
253
  }
254
+ /** Add Frustum sides. Useful for debugging. */
255
+ addFrustumSides(frustum) {
256
+ this.addRangeBoxSidesFromCorners(frustum.points);
257
+ }
254
258
  /** Add range edges from corner points */
255
259
  addRangeBoxFromCorners(p) {
256
260
  this.addLineString([
@@ -269,6 +273,51 @@ class GraphicBuilder {
269
273
  this.addLineString([p[core_common_1.Npc.RightTopFront].clone(), p[core_common_1.Npc.RightTopRear].clone()]);
270
274
  this.addLineString([p[core_common_1.Npc.LeftBottomRear].clone(), p[core_common_1.Npc.RightBottomRear].clone()]);
271
275
  }
276
+ /** Add range sides from corner points */
277
+ addRangeBoxSidesFromCorners(p) {
278
+ this.addShape([
279
+ p[core_common_1.Npc.LeftBottomFront].clone(),
280
+ p[core_common_1.Npc.LeftTopFront].clone(),
281
+ p[core_common_1.Npc.RightTopFront].clone(),
282
+ p[core_common_1.Npc.RightBottomFront].clone(),
283
+ p[core_common_1.Npc.LeftBottomFront].clone()
284
+ ]);
285
+ this.addShape([
286
+ p[core_common_1.Npc.RightTopRear].clone(),
287
+ p[core_common_1.Npc.LeftTopRear].clone(),
288
+ p[core_common_1.Npc.LeftBottomRear].clone(),
289
+ p[core_common_1.Npc.RightBottomRear].clone(),
290
+ p[core_common_1.Npc.RightTopRear].clone()
291
+ ]);
292
+ this.addShape([
293
+ p[core_common_1.Npc.RightTopRear].clone(),
294
+ p[core_common_1.Npc.LeftTopRear].clone(),
295
+ p[core_common_1.Npc.LeftTopFront].clone(),
296
+ p[core_common_1.Npc.RightTopFront].clone(),
297
+ p[core_common_1.Npc.RightTopRear].clone()
298
+ ]);
299
+ this.addShape([
300
+ p[core_common_1.Npc.RightTopRear].clone(),
301
+ p[core_common_1.Npc.RightBottomRear].clone(),
302
+ p[core_common_1.Npc.RightBottomFront].clone(),
303
+ p[core_common_1.Npc.RightTopFront].clone(),
304
+ p[core_common_1.Npc.RightTopRear].clone()
305
+ ]);
306
+ this.addShape([
307
+ p[core_common_1.Npc.LeftBottomRear].clone(),
308
+ p[core_common_1.Npc.RightBottomRear].clone(),
309
+ p[core_common_1.Npc.RightBottomFront].clone(),
310
+ p[core_common_1.Npc.LeftBottomFront].clone(),
311
+ p[core_common_1.Npc.LeftBottomRear].clone()
312
+ ]);
313
+ this.addShape([
314
+ p[core_common_1.Npc.LeftBottomRear].clone(),
315
+ p[core_common_1.Npc.LeftTopRear].clone(),
316
+ p[core_common_1.Npc.LeftTopFront].clone(),
317
+ p[core_common_1.Npc.LeftBottomFront].clone(),
318
+ p[core_common_1.Npc.LeftBottomRear].clone()
319
+ ]);
320
+ }
272
321
  /** Sets the current active symbology for this builder. Any new geometry subsequently added will be drawn using the specified symbology.
273
322
  * @param lineColor The color in which to draw lines.
274
323
  * @param fillColor The color in which to draw filled regions.
@@ -1 +1 @@
1
- {"version":3,"file":"GraphicBuilder.js","sourceRoot":"","sources":["../../../src/render/GraphicBuilder.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AACzD,wDAE8B;AAC9B,oDAA8H;AAM9H;;;;;;;;GAQG;AACH,IAAY,WA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* 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 Rendering\n */\n\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport {\n AnyCurvePrimitive, Arc3d, Box, Loop, Path, Point2d, Point3d, Polyface, Range3d, SolidPrimitive, Transform,\n} from \"@itwin/core-geometry\";\nimport { AnalysisStyle, ColorDef, Feature, Frustum, GeometryClass, GraphicParams, LinePixels, Npc } from \"@itwin/core-common\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { Viewport } from \"../Viewport\";\nimport { RenderGraphic } from \"./RenderGraphic\";\nimport { GraphicPrimitive } from \"./GraphicPrimitive\";\n\n/**\n * Describes the type of a [[GraphicBuilder]], which defines the coordinate system in which the builder's geometry is defined and\n * controls the behavior of the [[RenderGraphic]] produced by the builder.\n * @note For those types for which depth-testing is disabled, the order in which the individual geometric primitives are drawn determines which geometry draws on top of other geometry.\n * - Within a [[GraphicList]], each [[RenderGraphic]] is rendered in the order in which it appears in the list; and\n * - Within a single [[RenderGraphic]], each geometric primitive is rendered in the ordered in which it was added to the GraphicBuilder.\n * @public\n * @extensions\n */\nexport enum GraphicType {\n /**\n * Renders behind all other graphics. For example, the border of a [[SheetViewState]] is of this type.\n * Coordinates: [[CoordSystem.View]].\n * [[RenderMode]]: [[RenderMode.SmoothShade]].\n * Lighting: none.\n * Depth-testing: disabled.\n * @see [[Decorations.viewBackground]]\n */\n ViewBackground,\n /** Used for the scene itself, dynamics, and 'normal' decorations. */\n /**\n * Renders as if it were part of the scene. All of the [[ViewFlags]] applied to the view's normal geometry also applies to these types of decorations.\n * Coordinates: [[CoordSystem.World]].\n * Lighting and [[RenderMode]]: from view.\n * Depth-testing: enabled.\n * @see [[Decorations.normal]].\n */\n Scene,\n /** Renders within the scene. Coordinates: world. RenderMode: smooth. Lighting: default. Z-testing: enabled */\n /** Renders within the scene, but ignores the view's [[ViewFlags]].\n * Coordinates: [[CoordSystem.World]].\n * Lighting: default.\n * [[RenderMode]]: [[RenderMode.SmoothShade]].\n * Depth-testing: enabled.\n * @see [[Decorations.world]].\n */\n WorldDecoration,\n /**\n * Renders as an overlay on top of the scene. These decorations differ from [[GraphicType.WorldDecoration]] only in that depth-testing is disabled.\n * For example, the ACS triad and [[WindowAreaTool]] decorations are of this type.\n * Coordinates: [[CoordSystem.World]].\n * [[RenderMode]]: [[RenderMode.SmoothShade]]\n * Lighting: default.\n * Depth-testing: disabled.\n * Renders atop the scene. Coordinates: world. RenderMode: smooth. Lighting: none. Z-testing: disabled\n * @note Overlay decorations typically employ some degree of transparency to ensure that they do not fully obscure the scene.\n * @see [[Decorations.worldOverlay]]\n */\n WorldOverlay,\n /**\n * Renders as an overlay on top of the scene. These decorations differ from [[GraphicType.WorldOverlay]] only in that their geometry is defined in view coordinates rather than world.\n * Coordinates: [[CoordSystem.View]].\n * [[RenderMode]]: [[RenderMode.SmoothShade]]\n * Lighting: default.\n * Depth-testing: disabled.\n * @note For more flexibility in defining view overlay decorations, consider using a [[CanvasDecorationList]].\n * @see [[Decorations.viewOverlay]]\n */\n ViewOverlay,\n}\n\n/** Options used when constructing a `Batch` - that is, a [[RenderGraphic]] with an associated [FeatureTable]($common) describing individual [Feature]($common)s within the\n * graphic. Individual features can be resymbolized in a variety of ways including flashing and hiliting.\n * For example, to prevent graphics produced by [[readElementGraphics]] from being hilited when their corresponding element is in the [[SelectionSet]],\n * pass `{ noHilite: true }` to [[readElementGraphics]].\n * @public\n * @extensions\n */\nexport interface BatchOptions {\n /** Identifies the [[Tile]] associated with the batch, chiefly for debugging purposes.\n * @beta\n */\n tileId?: string;\n /** If true, features within the batch will not be flashed on mouseover. */\n noFlash?: boolean;\n /** If true, features within the batch will not be hilited when their corresponding element is in the [[SelectionSet]]. */\n noHilite?: boolean;\n /** If true, features within the batch will not be emphasized when the corresponding [[Feature]] is emphasized using [FeatureOverrides]($common). */\n noEmphasis?: boolean;\n /** If true, the contents of the batch will only be drawn by [[Viewport.readPixels]], not [[Viewport.renderFrame]], causing them to be locatable but invisible. */\n locateOnly?: boolean;\n}\n\n/** Options used as part of [[GraphicBuilderOptions]] to describe a [pickable]($docs/learning/frontend/ViewDecorations#pickable-view-graphic-decorations) [[RenderGraphic]].\n * @public\n * @extensions\n */\nexport interface PickableGraphicOptions extends BatchOptions {\n /** A unique identifier for the graphic.\n * @see [[IModelConnection.transientIds]] to obtain a unique Id in the context of an iModel.\n * @see [[GraphicBuilder.activatePickableId]] or [[GraphicBuilder.activateFeature]] to change the pickable object while adding geometry.\n */\n id: Id64String;\n /** Optional Id of the subcategory with which the graphic should be associated. */\n subCategoryId?: Id64String;\n /** Optional geometry class for the graphic - defaults to [GeometryClass.Primary]($common). */\n geometryClass?: GeometryClass;\n /** The optional Id of the model with which the graphic should be associated. */\n modelId?: Id64String;\n /** True if the graphic is to be used as a [[DynamicSpatialClassifier]] to classify volumes of a reality model. */\n isVolumeClassifier?: boolean;\n}\n\n/** Options for creating a [[GraphicBuilder]] used by functions like [[DecorateContext.createGraphic]] and [[RenderSystem.createGraphic]].\n * @see [[ViewportGraphicBuilderOptions]] to create a graphic builder for a [[Viewport]].\n * @see [[CustomGraphicBuilderOptions]] to create a graphic builder unassociated with any [[Viewport]].\n * @public\n * @extensions\n */\nexport interface GraphicBuilderOptions {\n /** The type of graphic to produce. */\n type: GraphicType;\n\n /** The local-to-world transform in which the builder's geometry is to be defined - by default, an identity transform. */\n placement?: Transform;\n\n /** If the graphic is to be pickable, specifies the pickable Id and other options. */\n pickable?: PickableGraphicOptions;\n\n /** If true, the order in which geometry is added to the builder is preserved.\n * This is useful for overlay and background graphics because they draw without using the depth buffer. For example, to draw an overlay containing a red shape with a white outline,\n * you would add the shape to the GraphicBuilder first, followed by the outline, to ensure the outline draws \"in front of\" the shape.\n * It defaults to true for overlays and background graphics, and false for other graphic types.\n * It is not useful for other types of graphics and imposes a performance penalty due to increased number of draw calls.\n * For overlay and background graphics that do not need to draw in any particular order, the performance penalty can be eliminated by setting this to `false`.\n */\n preserveOrder?: boolean;\n\n /** Controls whether normals are generated for surfaces. Normals allow 3d geometry to receive lighting; without them the geometry will be unaffected by lighting.\n * By default, normals are generated only for graphics of type [[GraphicType.Scene]]; or for any type of graphic if [[GraphicBuilder.wantEdges]] is true, because\n * normals are required to prevent z-fighting between surfaces and their edges. This default can be overridden by explicitly specifying `true` or `false`.\n * @see [[GraphicType]] for a description of whether and how different types of graphics are affected by lighting.\n */\n wantNormals?: boolean;\n\n /** Controls whether edges are generated for surfaces.\n * Edges are only displayed if [ViewFlags.renderMode]($common) is not [RenderMode.SmoothShade]($common) or [ViewFlags.visibleEdges]($common) is `true`.\n * Since all decoration graphics except [[GraphicType.Scene]] are drawn in smooth shaded mode with no visible edges, by default edges are only produced for scene graphics, and\n * - if a [[Viewport]] is supplied with the options - only if [ViewFlags.edgesRequired]($common) is true for the viewport.\n * That default can be overridden by explicitly specifying `true` or `false`. This can be useful for non-scene decorations contained in a [[GraphicBranch]] that applies [ViewFlagOverrides]($common)\n * that change the edge display settings; or for scene decorations that might be cached for reuse after the viewport's edge settings are changed.\n * @note Edges will tend to z-fight with their surfaces unless the graphic is [[pickable]].\n */\n generateEdges?: boolean;\n\n /** If defined, specifies a point about which the graphic will rotate such that it always faces the viewer.\n * This can be particular useful for planar regions to create a billboarding effect - e.g., to implement [[Marker]]-like WebGL decorations.\n * The graphic's [[placement]] transform is not applied to the point.\n * @note This has no effect for graphics displayed in a 2d view.\n */\n viewIndependentOrigin?: Point3d;\n}\n\n/** Options for creating a [[GraphicBuilder]] to produce a [[RenderGraphic]] to be displayed in a specific [[Viewport]].\n * The level of detail of the graphic will be computed from the position of its geometry within the viewport's [Frustum]($common).\n * Default values for [[GraphicBuilderOptions.wantNormals]] and [[GraphicBuilderOptions.generateEdges]] will be determined by the viewport's [ViewFlags]($common).\n * The [[GraphicBuilder.iModel]] will be set to the viewport's [[IModelConnection]].\n * @public\n * @extensions\n */\nexport interface ViewportGraphicBuilderOptions extends GraphicBuilderOptions {\n /** The viewport in which the resultant [[RenderGraphic]] is to be drawn. */\n viewport: Viewport;\n\n /** If true, [[ViewState.getAspectRatioSkew]] will be taken into account when computing the level of detail for the produced graphics. */\n applyAspectRatioSkew?: boolean;\n\n iModel?: never;\n computeChordTolerance?: never;\n}\n\n/** Arguments used to compute the chord tolerance (level of detail) of the [[RenderGraphic]]s produced by a [[GraphicBuilder]].\n * Generally, the chord tolerance should be roughly equivalent to the size in meters of one pixel on screen where the graphic is to be displayed.\n * For [[GraphicType.ViewOverlay]] and [[GraphicType.ViewBackground]], which already define their geometry in pixels, the chord tolerance should typically be 1.\n * @see [[CustomGraphicBuilderOptions.computeChordTolerance]].\n * @public\n * @extensions\n */\nexport interface ComputeChordToleranceArgs {\n /** The graphic builder being used to produce the graphics. */\n readonly graphic: GraphicBuilder;\n /** A function that computes a range enclosing all of the geometry that was added to the builder. */\n readonly computeRange: () => Range3d;\n}\n\n/** Options for creating a [[GraphicBuilder]] to produce a [[RenderGraphic]] that is not associated with any particular [[Viewport]] and may not be associated with\n * any particular [[IModelConnection]].\n * This is primarily useful when the same graphic is to be saved and reused for display in multiple viewports and for which a chord tolerance can be computed\n * independently of each viewport's [Frustum]($common).\n * @public\n * @extensions\n */\nexport interface CustomGraphicBuilderOptions extends GraphicBuilderOptions {\n /** Optionally, the IModelConnection with which the graphic is associated. */\n iModel?: IModelConnection;\n /** A function that can compute the level of detail for the graphics produced by the builder. */\n computeChordTolerance: (args: ComputeChordToleranceArgs) => number;\n\n applyAspectRatioSkew?: never;\n viewport?: never;\n}\n\n/** Provides methods for constructing a [[RenderGraphic]] from geometric primitives.\n * GraphicBuilder is primarily used for creating [[Decorations]] to be displayed inside a [[Viewport]].\n *\n * The typical process for constructing a [[RenderGraphic]] proceeds as follows:\n * 1. Use [[DecorateContext.createGraphic]] or [[RenderSystem.createGraphic]] to obtain a builder.\n * 2. Set up the symbology using [[GraphicBuilder.activateGraphicParams]] or [[GraphicBuilder.setSymbology]].\n * 3. Add one or more geometric primitives using methods like [[GraphicBuilder.addShape]] and [[GraphicBuilder.addLineString]], possibly setting new symbology in between.\n * 4. Use [[GraphicBuilder.finish]] to produce the finished [[RenderGraphic]].\n *\n * @note Most of the methods which add geometry to the builder take ownership of their inputs rather than cloning them.\n * So, for example, if you pass an array of points to addLineString(), you should not subsequently modify that array.\n *\n * @public\n * @extensions\n */\nexport abstract class GraphicBuilder {\n /** The local coordinate system transform applied to this builder's geometry.\n * @see [[GraphicBuilderOptions.placement]].\n */\n public readonly placement: Transform;\n\n /** The iModel associated with this builder, if any. */\n public readonly iModel?: IModelConnection;\n\n /** The type of graphic to be produced by this builder.\n * @see [[GraphicBuilderOptions.type]].\n */\n public readonly type: GraphicType;\n\n /** If the graphic is to be pickable, specifies the pickable Id and other options. */\n public readonly pickable?: Readonly<PickableGraphicOptions>;\n\n /** If true, the order in which geometry is added to the builder is preserved.\n * @see [[GraphicBuilderOptions.preserveOrder]] for more details.\n */\n public readonly preserveOrder: boolean;\n\n /** Controls whether normals are generated for surfaces.\n * @note Normals are required for proper edge display, so by default they are always produced if [[wantEdges]] is `true`.\n * @see [[GraphicBuilderOptions.wantNormals]] for more details.\n */\n public readonly wantNormals: boolean;\n\n /** Controls whether edges are generated for surfaces.\n * @see [[GraphicBuilderOptions.generateEdges]] for more details.\n */\n public readonly wantEdges: boolean;\n\n /** @alpha */\n public readonly analysisStyle?: AnalysisStyle;\n\n protected readonly _computeChordTolerance: (args: ComputeChordToleranceArgs) => number;\n protected readonly _options: CustomGraphicBuilderOptions | ViewportGraphicBuilderOptions;\n\n /** @internal */\n protected constructor(options: ViewportGraphicBuilderOptions | CustomGraphicBuilderOptions) {\n // Stored for potential use later in creating a new GraphicBuilder from this one (see PrimitiveBuilder.finishGraphic).\n this._options = options;\n\n const vp = options.viewport;\n this.placement = options.placement ?? Transform.createIdentity();\n this.iModel = vp?.iModel ?? options.iModel;\n this.type = options.type;\n this.pickable = options.pickable;\n this.wantEdges = options.generateEdges ?? (this.type === GraphicType.Scene && (!vp || vp.viewFlags.edgesRequired()));\n this.wantNormals = options.wantNormals ?? (this.wantEdges || this.type === GraphicType.Scene);\n this.preserveOrder = options.preserveOrder ?? (this.isOverlay || this.isViewBackground);\n\n if (!options.viewport) {\n this._computeChordTolerance = options.computeChordTolerance;\n return;\n }\n\n this.analysisStyle = options.viewport.displayStyle.settings.analysisStyle;\n\n this._computeChordTolerance = (args: ComputeChordToleranceArgs) => {\n let pixelSize = 1;\n if (!this.isViewCoordinates) {\n // Compute the horizontal distance in meters between two adjacent pixels at the center of the geometry.\n pixelSize = options.viewport.getPixelSizeAtPoint(args.computeRange().center);\n pixelSize = options.viewport.target.adjustPixelSizeForLOD(pixelSize);\n\n // Aspect ratio skew > 1.0 stretches the view in Y. In that case use the smaller vertical pixel distance for our stroke tolerance.\n const skew = options.applyAspectRatioSkew ? options.viewport.view.getAspectRatioSkew() : 0;\n if (skew > 1)\n pixelSize /= skew;\n }\n\n return pixelSize * 0.25;\n };\n }\n\n /** The Id to be associated with the graphic for picking.\n * @see [[GraphicBuilderOptions.pickable]] for more options.\n * @deprecated in 3.x. This provides only the **first** pickable Id for this graphic - you should keep track of the **current** pickable Id yourself.\n */\n public get pickId(): Id64String | undefined {\n return this.pickable?.id;\n }\n\n /** Whether the builder's geometry is defined in [[CoordSystem.View]] coordinates.\n * @see [[isWorldCoordinates]].\n */\n public get isViewCoordinates(): boolean {\n return this.type === GraphicType.ViewBackground || this.type === GraphicType.ViewOverlay;\n }\n\n /** Whether the builder's geometry is defined in [[CoordSystem.World]] coordinates.\n * @see [[isViewCoordinates]].\n */\n public get isWorldCoordinates(): boolean {\n return !this.isViewCoordinates;\n }\n\n /** True if the builder produces a graphic of [[GraphicType.Scene]]. */\n public get isSceneGraphic(): boolean {\n return this.type === GraphicType.Scene;\n }\n\n /** True if the builder produces a graphic of [[GraphicType.ViewBackground]]. */\n public get isViewBackground(): boolean {\n return this.type === GraphicType.ViewBackground;\n }\n\n /** True if the builder produces a graphic of [[GraphicType.WorldOverlay]] or [[GraphicType.ViewOerlay]]. */\n public get isOverlay(): boolean {\n return this.type === GraphicType.ViewOverlay || this.type === GraphicType.WorldOverlay;\n }\n\n /**\n * Processes the accumulated symbology and geometry to produce a renderable graphic.\n * This function can only be called once; after the [[RenderGraphic]] has been extracted the [[GraphicBuilder]] should no longer be used.\n */\n public abstract finish(): RenderGraphic;\n\n /** Sets the current active symbology for this builder. Any new geometry subsequently added to the builder will be drawn using the specified symbology.\n * @param graphicParams The symbology to apply to subsequent geometry.\n * @see [[GraphicBuilder.setSymbology]] for a convenient way to set common symbology options.\n */\n public abstract activateGraphicParams(graphicParams: GraphicParams): void;\n\n /** Called by [[activateFeature]] after validation to change the [Feature]($common) to be associated with subsequently-added geometry.\n * This default implementation does nothing.\n */\n protected _activateFeature(_feature: Feature): void { }\n\n /** Change the [Feature]($common) to be associated with subsequently-added geometry. This permits multiple features to be batched together into a single graphic\n * for more efficient rendering.\n * @note This method has no effect if [[GraphicBuilderOptions.pickable]] was not supplied to the GraphicBuilder's constructor.\n */\n public activateFeature(feature: Feature): void {\n assert(undefined !== this._options.pickable, \"GraphicBuilder.activateFeature has no effect if PickableGraphicOptions were not supplied\");\n if (this._options.pickable)\n this._activateFeature(feature);\n }\n\n /** Change the pickable Id to be associated with subsequently-added geometry. This permits multiple pickable objects to be batched together into a single graphic\n * for more efficient rendering. This method calls [[activateFeature]], using the subcategory Id and [GeometryClass]($common) specified in [[GraphicBuilder.pickable]]\n * at construction, if any.\n * @note This method has no effect if [[GraphicBuilderOptions.pickable]] was not supplied to the GraphicBuilder's constructor.\n */\n public activatePickableId(id: Id64String): void {\n const pick = this._options.pickable;\n this.activateFeature(new Feature(id, pick?.subCategoryId, pick?.geometryClass));\n }\n\n /**\n * Appends a 3d line string to the builder.\n * @param points Array of vertices in the line string.\n */\n public abstract addLineString(points: Point3d[]): void;\n\n /**\n * Appends a 2d line string to the builder.\n * @param points Array of vertices in the line string.\n * @param zDepth Z value in local coordinates to use for each point.\n */\n public abstract addLineString2d(points: Point2d[], zDepth: number): void;\n\n /**\n * Appends a 3d point string to the builder. The points are drawn disconnected, with a diameter in pixels defined by the builder's active [[GraphicParams.rasterWidth]].\n * @param points Array of vertices in the point string.\n */\n public abstract addPointString(points: Point3d[]): void;\n\n /**\n * Appends a 2d point string to the builder. The points are drawn disconnected, with a diameter in pixels defined by the builder's active [[GraphicParams.rasterWidth]].\n * @param points Array of vertices in the point string.\n * @param zDepth Z value in local coordinates to use for each point.\n */\n public abstract addPointString2d(points: Point2d[], zDepth: number): void;\n\n /**\n * Appends a closed 3d planar region to the builder.\n * @param points Array of vertices of the shape.\n */\n public abstract addShape(points: Point3d[]): void;\n\n /**\n * Appends a closed 2d region to the builder.\n * @param points Array of vertices of the shape.\n * @param zDepth Z value in local coordinates to use for each point.\n */\n public abstract addShape2d(points: Point2d[], zDepth: number): void;\n\n /**\n * Appends a 3d open arc or closed ellipse to the builder.\n * @param arc Description of the arc or ellipse.\n * @param isEllipse If true, and if the arc defines a full sweep, then draw as a closed ellipse instead of an arc.\n * @param filled If true, and isEllipse is also true, then draw ellipse filled.\n */\n public abstract addArc(arc: Arc3d, isEllipse: boolean, filled: boolean): void;\n\n /**\n * Appends a 2d open arc or closed ellipse to the builder.\n * @param arc Description of the arc or ellipse.\n * @param isEllipse If true, and if the arc defines a full sweep, then draw as a closed ellipse instead of an arc.\n * @param filled If true, and isEllipse is also true, then draw ellipse filled.\n * @param zDepth Z value in local coordinates to use for each point in the arc or ellipse.\n */\n public abstract addArc2d(ellipse: Arc3d, isEllipse: boolean, filled: boolean, zDepth: number): void;\n\n /** Append a 3d open path to the builder. */\n public abstract addPath(path: Path): void;\n\n /** Append a 3d planar region to the builder. */\n public abstract addLoop(loop: Loop): void;\n\n /** Append a [CurvePrimitive]($core-geometry) to the builder. */\n public addCurvePrimitive(curve: AnyCurvePrimitive): void {\n switch (curve.curvePrimitiveType) {\n case \"lineString\":\n this.addLineString(curve.points);\n break;\n case \"lineSegment\":\n this.addLineString([curve.startPoint(), curve.endPoint()]);\n break;\n case \"arc\":\n this.addArc(curve, false, false);\n break;\n default:\n const path = new Path();\n if (path.tryAddChild(curve))\n this.addPath(path);\n\n break;\n }\n }\n\n /** Append a mesh to the builder.\n * @param meshData Describes the mesh\n * @param filled If the mesh describes a planar region, indicates whether its interior area should be drawn with fill in [[RenderMode.Wireframe]].\n */\n public abstract addPolyface(meshData: Polyface, filled: boolean): void;\n\n /** Append a solid primitive to the builder. */\n public abstract addSolidPrimitive(solidPrimitive: SolidPrimitive): void;\n\n /** Append any primitive to the builder.\n * @param primitive The graphic primitive to append.\n */\n public addPrimitive(primitive: GraphicPrimitive): void {\n switch (primitive.type) {\n case \"linestring\":\n this.addLineString(primitive.points);\n break;\n case \"linestring2d\":\n this.addLineString2d(primitive.points, primitive.zDepth);\n break;\n case \"pointstring\":\n this.addPointString(primitive.points);\n break;\n case \"pointstring2d\":\n this.addPointString2d(primitive.points, primitive.zDepth);\n break;\n case \"shape\":\n this.addShape(primitive.points);\n break;\n case \"shape2d\":\n this.addShape2d(primitive.points, primitive.zDepth);\n break;\n case \"arc\":\n this.addArc(primitive.arc, true === primitive.isEllipse, true === primitive.filled);\n break;\n case \"arc2d\":\n this.addArc2d(primitive.arc, true === primitive.isEllipse, true === primitive.filled, primitive.zDepth);\n break;\n case \"path\":\n this.addPath(primitive.path);\n break;\n case \"loop\":\n this.addLoop(primitive.loop);\n break;\n case \"polyface\":\n this.addPolyface(primitive.polyface, true === primitive.filled);\n break;\n case \"solidPrimitive\":\n this.addSolidPrimitive(primitive.solidPrimitive);\n break;\n }\n }\n\n /** Add a box representing a volume of space. Typically used for debugging purposes.\n * @param range The volume of space.\n * @param solid If true, a [[Box]] solid primitive will be added; otherwise, a wireframe outline of the box will be added.\n */\n public addRangeBox(range: Range3d, solid = false): void {\n if (!solid) {\n this.addFrustum(Frustum.fromRange(range));\n return;\n }\n\n const box = Box.createRange(range, true);\n if (box)\n this.addSolidPrimitive(box);\n }\n\n /** Add Frustum edges. Useful for debugging. */\n public addFrustum(frustum: Frustum) {\n this.addRangeBoxFromCorners(frustum.points);\n }\n\n /** Add range edges from corner points */\n public addRangeBoxFromCorners(p: Point3d[]) {\n this.addLineString([\n p[Npc.LeftBottomFront],\n p[Npc.LeftTopFront],\n p[Npc.RightTopFront],\n p[Npc.RightBottomFront],\n p[Npc.RightBottomRear],\n p[Npc.RightTopRear],\n p[Npc.LeftTopRear],\n p[Npc.LeftBottomRear],\n p[Npc.LeftBottomFront].clone(),\n p[Npc.RightBottomFront].clone(),\n ]);\n\n this.addLineString([p[Npc.LeftTopFront].clone(), p[Npc.LeftTopRear].clone()]);\n this.addLineString([p[Npc.RightTopFront].clone(), p[Npc.RightTopRear].clone()]);\n this.addLineString([p[Npc.LeftBottomRear].clone(), p[Npc.RightBottomRear].clone()]);\n }\n\n /** Sets the current active symbology for this builder. Any new geometry subsequently added will be drawn using the specified symbology.\n * @param lineColor The color in which to draw lines.\n * @param fillColor The color in which to draw filled regions.\n * @param lineWidth The width in pixels to draw lines. The renderer will clamp this value to an integer in the range [1, 32].\n * @param linePixels The pixel pattern in which to draw lines.\n * @see [[GraphicBuilder.activateGraphicParams]] for additional symbology options.\n */\n public setSymbology(lineColor: ColorDef, fillColor: ColorDef, lineWidth: number, linePixels = LinePixels.Solid) {\n this.activateGraphicParams(GraphicParams.fromSymbology(lineColor, fillColor, lineWidth, linePixels));\n }\n\n /** Set the current active symbology for this builder to be a blanking fill before adding a planar region.\n * A planar region drawn with blanking fill renders behind other geometry in the same graphic.\n * Blanking fill is not affected by the fill [[ViewFlags]] being disabled.\n * An example would be to add a line to a graphic containing a shape with blanking fill so that the line is always shown in front of the fill.\n * @param fillColor The color in which to draw filled regions.\n */\n public setBlankingFill(fillColor: ColorDef) { this.activateGraphicParams(GraphicParams.fromBlankingFill(fillColor)); }\n}\n"]}
1
+ {"version":3,"file":"GraphicBuilder.js","sourceRoot":"","sources":["../../../src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------------------------------------------------------------------------------------------\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 Rendering\n */\n\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport {\n AnyCurvePrimitive, Arc3d, Box, Loop, Path, Point2d, Point3d, Polyface, Range3d, SolidPrimitive, Transform,\n} from \"@itwin/core-geometry\";\nimport { AnalysisStyle, ColorDef, Feature, Frustum, GeometryClass, GraphicParams, LinePixels, Npc } from \"@itwin/core-common\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { Viewport } from \"../Viewport\";\nimport { RenderGraphic } from \"./RenderGraphic\";\nimport { GraphicPrimitive } from \"./GraphicPrimitive\";\n\n/**\n * Describes the type of a [[GraphicBuilder]], which defines the coordinate system in which the builder's geometry is defined and\n * controls the behavior of the [[RenderGraphic]] produced by the builder.\n * @note For those types for which depth-testing is disabled, the order in which the individual geometric primitives are drawn determines which geometry draws on top of other geometry.\n * - Within a [[GraphicList]], each [[RenderGraphic]] is rendered in the order in which it appears in the list; and\n * - Within a single [[RenderGraphic]], each geometric primitive is rendered in the ordered in which it was added to the GraphicBuilder.\n * @public\n * @extensions\n */\nexport enum GraphicType {\n /**\n * Renders behind all other graphics. For example, the border of a [[SheetViewState]] is of this type.\n * Coordinates: [[CoordSystem.View]].\n * [[RenderMode]]: [[RenderMode.SmoothShade]].\n * Lighting: none.\n * Depth-testing: disabled.\n * @see [[Decorations.viewBackground]]\n */\n ViewBackground,\n /** Used for the scene itself, dynamics, and 'normal' decorations. */\n /**\n * Renders as if it were part of the scene. All of the [[ViewFlags]] applied to the view's normal geometry also applies to these types of decorations.\n * Coordinates: [[CoordSystem.World]].\n * Lighting and [[RenderMode]]: from view.\n * Depth-testing: enabled.\n * @see [[Decorations.normal]].\n */\n Scene,\n /** Renders within the scene. Coordinates: world. RenderMode: smooth. Lighting: default. Z-testing: enabled */\n /** Renders within the scene, but ignores the view's [[ViewFlags]].\n * Coordinates: [[CoordSystem.World]].\n * Lighting: default.\n * [[RenderMode]]: [[RenderMode.SmoothShade]].\n * Depth-testing: enabled.\n * @see [[Decorations.world]].\n */\n WorldDecoration,\n /**\n * Renders as an overlay on top of the scene. These decorations differ from [[GraphicType.WorldDecoration]] only in that depth-testing is disabled.\n * For example, the ACS triad and [[WindowAreaTool]] decorations are of this type.\n * Coordinates: [[CoordSystem.World]].\n * [[RenderMode]]: [[RenderMode.SmoothShade]]\n * Lighting: default.\n * Depth-testing: disabled.\n * Renders atop the scene. Coordinates: world. RenderMode: smooth. Lighting: none. Z-testing: disabled\n * @note Overlay decorations typically employ some degree of transparency to ensure that they do not fully obscure the scene.\n * @see [[Decorations.worldOverlay]]\n */\n WorldOverlay,\n /**\n * Renders as an overlay on top of the scene. These decorations differ from [[GraphicType.WorldOverlay]] only in that their geometry is defined in view coordinates rather than world.\n * Coordinates: [[CoordSystem.View]].\n * [[RenderMode]]: [[RenderMode.SmoothShade]]\n * Lighting: default.\n * Depth-testing: disabled.\n * @note For more flexibility in defining view overlay decorations, consider using a [[CanvasDecorationList]].\n * @see [[Decorations.viewOverlay]]\n */\n ViewOverlay,\n}\n\n/** Options used when constructing a `Batch` - that is, a [[RenderGraphic]] with an associated [FeatureTable]($common) describing individual [Feature]($common)s within the\n * graphic. Individual features can be resymbolized in a variety of ways including flashing and hiliting.\n * For example, to prevent graphics produced by [[readElementGraphics]] from being hilited when their corresponding element is in the [[SelectionSet]],\n * pass `{ noHilite: true }` to [[readElementGraphics]].\n * @public\n * @extensions\n */\nexport interface BatchOptions {\n /** Identifies the [[Tile]] associated with the batch, chiefly for debugging purposes.\n * @beta\n */\n tileId?: string;\n /** If true, features within the batch will not be flashed on mouseover. */\n noFlash?: boolean;\n /** If true, features within the batch will not be hilited when their corresponding element is in the [[SelectionSet]]. */\n noHilite?: boolean;\n /** If true, features within the batch will not be emphasized when the corresponding [[Feature]] is emphasized using [FeatureOverrides]($common). */\n noEmphasis?: boolean;\n /** If true, the contents of the batch will only be drawn by [[Viewport.readPixels]], not [[Viewport.renderFrame]], causing them to be locatable but invisible. */\n locateOnly?: boolean;\n}\n\n/** Options used as part of [[GraphicBuilderOptions]] to describe a [pickable]($docs/learning/frontend/ViewDecorations#pickable-view-graphic-decorations) [[RenderGraphic]].\n * @public\n * @extensions\n */\nexport interface PickableGraphicOptions extends BatchOptions {\n /** A unique identifier for the graphic.\n * @see [[IModelConnection.transientIds]] to obtain a unique Id in the context of an iModel.\n * @see [[GraphicBuilder.activatePickableId]] or [[GraphicBuilder.activateFeature]] to change the pickable object while adding geometry.\n */\n id: Id64String;\n /** Optional Id of the subcategory with which the graphic should be associated. */\n subCategoryId?: Id64String;\n /** Optional geometry class for the graphic - defaults to [GeometryClass.Primary]($common). */\n geometryClass?: GeometryClass;\n /** The optional Id of the model with which the graphic should be associated. */\n modelId?: Id64String;\n /** True if the graphic is to be used as a [[DynamicSpatialClassifier]] to classify volumes of a reality model. */\n isVolumeClassifier?: boolean;\n}\n\n/** Options for creating a [[GraphicBuilder]] used by functions like [[DecorateContext.createGraphic]] and [[RenderSystem.createGraphic]].\n * @see [[ViewportGraphicBuilderOptions]] to create a graphic builder for a [[Viewport]].\n * @see [[CustomGraphicBuilderOptions]] to create a graphic builder unassociated with any [[Viewport]].\n * @public\n * @extensions\n */\nexport interface GraphicBuilderOptions {\n /** The type of graphic to produce. */\n type: GraphicType;\n\n /** The local-to-world transform in which the builder's geometry is to be defined - by default, an identity transform. */\n placement?: Transform;\n\n /** If the graphic is to be pickable, specifies the pickable Id and other options. */\n pickable?: PickableGraphicOptions;\n\n /** If true, the order in which geometry is added to the builder is preserved.\n * This is useful for overlay and background graphics because they draw without using the depth buffer. For example, to draw an overlay containing a red shape with a white outline,\n * you would add the shape to the GraphicBuilder first, followed by the outline, to ensure the outline draws \"in front of\" the shape.\n * It defaults to true for overlays and background graphics, and false for other graphic types.\n * It is not useful for other types of graphics and imposes a performance penalty due to increased number of draw calls.\n * For overlay and background graphics that do not need to draw in any particular order, the performance penalty can be eliminated by setting this to `false`.\n */\n preserveOrder?: boolean;\n\n /** Controls whether normals are generated for surfaces. Normals allow 3d geometry to receive lighting; without them the geometry will be unaffected by lighting.\n * By default, normals are generated only for graphics of type [[GraphicType.Scene]]; or for any type of graphic if [[GraphicBuilder.wantEdges]] is true, because\n * normals are required to prevent z-fighting between surfaces and their edges. This default can be overridden by explicitly specifying `true` or `false`.\n * @see [[GraphicType]] for a description of whether and how different types of graphics are affected by lighting.\n */\n wantNormals?: boolean;\n\n /** Controls whether edges are generated for surfaces.\n * Edges are only displayed if [ViewFlags.renderMode]($common) is not [RenderMode.SmoothShade]($common) or [ViewFlags.visibleEdges]($common) is `true`.\n * Since all decoration graphics except [[GraphicType.Scene]] are drawn in smooth shaded mode with no visible edges, by default edges are only produced for scene graphics, and\n * - if a [[Viewport]] is supplied with the options - only if [ViewFlags.edgesRequired]($common) is true for the viewport.\n * That default can be overridden by explicitly specifying `true` or `false`. This can be useful for non-scene decorations contained in a [[GraphicBranch]] that applies [ViewFlagOverrides]($common)\n * that change the edge display settings; or for scene decorations that might be cached for reuse after the viewport's edge settings are changed.\n * @note Edges will tend to z-fight with their surfaces unless the graphic is [[pickable]].\n */\n generateEdges?: boolean;\n\n /** If defined, specifies a point about which the graphic will rotate such that it always faces the viewer.\n * This can be particular useful for planar regions to create a billboarding effect - e.g., to implement [[Marker]]-like WebGL decorations.\n * The graphic's [[placement]] transform is not applied to the point.\n * @note This has no effect for graphics displayed in a 2d view.\n */\n viewIndependentOrigin?: Point3d;\n}\n\n/** Options for creating a [[GraphicBuilder]] to produce a [[RenderGraphic]] to be displayed in a specific [[Viewport]].\n * The level of detail of the graphic will be computed from the position of its geometry within the viewport's [Frustum]($common).\n * Default values for [[GraphicBuilderOptions.wantNormals]] and [[GraphicBuilderOptions.generateEdges]] will be determined by the viewport's [ViewFlags]($common).\n * The [[GraphicBuilder.iModel]] will be set to the viewport's [[IModelConnection]].\n * @public\n * @extensions\n */\nexport interface ViewportGraphicBuilderOptions extends GraphicBuilderOptions {\n /** The viewport in which the resultant [[RenderGraphic]] is to be drawn. */\n viewport: Viewport;\n\n /** If true, [[ViewState.getAspectRatioSkew]] will be taken into account when computing the level of detail for the produced graphics. */\n applyAspectRatioSkew?: boolean;\n\n iModel?: never;\n computeChordTolerance?: never;\n}\n\n/** Arguments used to compute the chord tolerance (level of detail) of the [[RenderGraphic]]s produced by a [[GraphicBuilder]].\n * Generally, the chord tolerance should be roughly equivalent to the size in meters of one pixel on screen where the graphic is to be displayed.\n * For [[GraphicType.ViewOverlay]] and [[GraphicType.ViewBackground]], which already define their geometry in pixels, the chord tolerance should typically be 1.\n * @see [[CustomGraphicBuilderOptions.computeChordTolerance]].\n * @public\n * @extensions\n */\nexport interface ComputeChordToleranceArgs {\n /** The graphic builder being used to produce the graphics. */\n readonly graphic: GraphicBuilder;\n /** A function that computes a range enclosing all of the geometry that was added to the builder. */\n readonly computeRange: () => Range3d;\n}\n\n/** Options for creating a [[GraphicBuilder]] to produce a [[RenderGraphic]] that is not associated with any particular [[Viewport]] and may not be associated with\n * any particular [[IModelConnection]].\n * This is primarily useful when the same graphic is to be saved and reused for display in multiple viewports and for which a chord tolerance can be computed\n * independently of each viewport's [Frustum]($common).\n * @public\n * @extensions\n */\nexport interface CustomGraphicBuilderOptions extends GraphicBuilderOptions {\n /** Optionally, the IModelConnection with which the graphic is associated. */\n iModel?: IModelConnection;\n /** A function that can compute the level of detail for the graphics produced by the builder. */\n computeChordTolerance: (args: ComputeChordToleranceArgs) => number;\n\n applyAspectRatioSkew?: never;\n viewport?: never;\n}\n\n/** Provides methods for constructing a [[RenderGraphic]] from geometric primitives.\n * GraphicBuilder is primarily used for creating [[Decorations]] to be displayed inside a [[Viewport]].\n *\n * The typical process for constructing a [[RenderGraphic]] proceeds as follows:\n * 1. Use [[DecorateContext.createGraphic]] or [[RenderSystem.createGraphic]] to obtain a builder.\n * 2. Set up the symbology using [[GraphicBuilder.activateGraphicParams]] or [[GraphicBuilder.setSymbology]].\n * 3. Add one or more geometric primitives using methods like [[GraphicBuilder.addShape]] and [[GraphicBuilder.addLineString]], possibly setting new symbology in between.\n * 4. Use [[GraphicBuilder.finish]] to produce the finished [[RenderGraphic]].\n *\n * @note Most of the methods which add geometry to the builder take ownership of their inputs rather than cloning them.\n * So, for example, if you pass an array of points to addLineString(), you should not subsequently modify that array.\n *\n * @public\n * @extensions\n */\nexport abstract class GraphicBuilder {\n /** The local coordinate system transform applied to this builder's geometry.\n * @see [[GraphicBuilderOptions.placement]].\n */\n public readonly placement: Transform;\n\n /** The iModel associated with this builder, if any. */\n public readonly iModel?: IModelConnection;\n\n /** The type of graphic to be produced by this builder.\n * @see [[GraphicBuilderOptions.type]].\n */\n public readonly type: GraphicType;\n\n /** If the graphic is to be pickable, specifies the pickable Id and other options. */\n public readonly pickable?: Readonly<PickableGraphicOptions>;\n\n /** If true, the order in which geometry is added to the builder is preserved.\n * @see [[GraphicBuilderOptions.preserveOrder]] for more details.\n */\n public readonly preserveOrder: boolean;\n\n /** Controls whether normals are generated for surfaces.\n * @note Normals are required for proper edge display, so by default they are always produced if [[wantEdges]] is `true`.\n * @see [[GraphicBuilderOptions.wantNormals]] for more details.\n */\n public readonly wantNormals: boolean;\n\n /** Controls whether edges are generated for surfaces.\n * @see [[GraphicBuilderOptions.generateEdges]] for more details.\n */\n public readonly wantEdges: boolean;\n\n /** @alpha */\n public readonly analysisStyle?: AnalysisStyle;\n\n protected readonly _computeChordTolerance: (args: ComputeChordToleranceArgs) => number;\n protected readonly _options: CustomGraphicBuilderOptions | ViewportGraphicBuilderOptions;\n\n /** @internal */\n protected constructor(options: ViewportGraphicBuilderOptions | CustomGraphicBuilderOptions) {\n // Stored for potential use later in creating a new GraphicBuilder from this one (see PrimitiveBuilder.finishGraphic).\n this._options = options;\n\n const vp = options.viewport;\n this.placement = options.placement ?? Transform.createIdentity();\n this.iModel = vp?.iModel ?? options.iModel;\n this.type = options.type;\n this.pickable = options.pickable;\n this.wantEdges = options.generateEdges ?? (this.type === GraphicType.Scene && (!vp || vp.viewFlags.edgesRequired()));\n this.wantNormals = options.wantNormals ?? (this.wantEdges || this.type === GraphicType.Scene);\n this.preserveOrder = options.preserveOrder ?? (this.isOverlay || this.isViewBackground);\n\n if (!options.viewport) {\n this._computeChordTolerance = options.computeChordTolerance;\n return;\n }\n\n this.analysisStyle = options.viewport.displayStyle.settings.analysisStyle;\n\n this._computeChordTolerance = (args: ComputeChordToleranceArgs) => {\n let pixelSize = 1;\n if (!this.isViewCoordinates) {\n // Compute the horizontal distance in meters between two adjacent pixels at the center of the geometry.\n pixelSize = options.viewport.getPixelSizeAtPoint(args.computeRange().center);\n pixelSize = options.viewport.target.adjustPixelSizeForLOD(pixelSize);\n\n // Aspect ratio skew > 1.0 stretches the view in Y. In that case use the smaller vertical pixel distance for our stroke tolerance.\n const skew = options.applyAspectRatioSkew ? options.viewport.view.getAspectRatioSkew() : 0;\n if (skew > 1)\n pixelSize /= skew;\n }\n\n return pixelSize * 0.25;\n };\n }\n\n /** The Id to be associated with the graphic for picking.\n * @see [[GraphicBuilderOptions.pickable]] for more options.\n * @deprecated in 3.x. This provides only the **first** pickable Id for this graphic - you should keep track of the **current** pickable Id yourself.\n */\n public get pickId(): Id64String | undefined {\n return this.pickable?.id;\n }\n\n /** Whether the builder's geometry is defined in [[CoordSystem.View]] coordinates.\n * @see [[isWorldCoordinates]].\n */\n public get isViewCoordinates(): boolean {\n return this.type === GraphicType.ViewBackground || this.type === GraphicType.ViewOverlay;\n }\n\n /** Whether the builder's geometry is defined in [[CoordSystem.World]] coordinates.\n * @see [[isViewCoordinates]].\n */\n public get isWorldCoordinates(): boolean {\n return !this.isViewCoordinates;\n }\n\n /** True if the builder produces a graphic of [[GraphicType.Scene]]. */\n public get isSceneGraphic(): boolean {\n return this.type === GraphicType.Scene;\n }\n\n /** True if the builder produces a graphic of [[GraphicType.ViewBackground]]. */\n public get isViewBackground(): boolean {\n return this.type === GraphicType.ViewBackground;\n }\n\n /** True if the builder produces a graphic of [[GraphicType.WorldOverlay]] or [[GraphicType.ViewOerlay]]. */\n public get isOverlay(): boolean {\n return this.type === GraphicType.ViewOverlay || this.type === GraphicType.WorldOverlay;\n }\n\n /**\n * Processes the accumulated symbology and geometry to produce a renderable graphic.\n * This function can only be called once; after the [[RenderGraphic]] has been extracted the [[GraphicBuilder]] should no longer be used.\n */\n public abstract finish(): RenderGraphic;\n\n /** Sets the current active symbology for this builder. Any new geometry subsequently added to the builder will be drawn using the specified symbology.\n * @param graphicParams The symbology to apply to subsequent geometry.\n * @see [[GraphicBuilder.setSymbology]] for a convenient way to set common symbology options.\n */\n public abstract activateGraphicParams(graphicParams: GraphicParams): void;\n\n /** Called by [[activateFeature]] after validation to change the [Feature]($common) to be associated with subsequently-added geometry.\n * This default implementation does nothing.\n */\n protected _activateFeature(_feature: Feature): void { }\n\n /** Change the [Feature]($common) to be associated with subsequently-added geometry. This permits multiple features to be batched together into a single graphic\n * for more efficient rendering.\n * @note This method has no effect if [[GraphicBuilderOptions.pickable]] was not supplied to the GraphicBuilder's constructor.\n */\n public activateFeature(feature: Feature): void {\n assert(undefined !== this._options.pickable, \"GraphicBuilder.activateFeature has no effect if PickableGraphicOptions were not supplied\");\n if (this._options.pickable)\n this._activateFeature(feature);\n }\n\n /** Change the pickable Id to be associated with subsequently-added geometry. This permits multiple pickable objects to be batched together into a single graphic\n * for more efficient rendering. This method calls [[activateFeature]], using the subcategory Id and [GeometryClass]($common) specified in [[GraphicBuilder.pickable]]\n * at construction, if any.\n * @note This method has no effect if [[GraphicBuilderOptions.pickable]] was not supplied to the GraphicBuilder's constructor.\n */\n public activatePickableId(id: Id64String): void {\n const pick = this._options.pickable;\n this.activateFeature(new Feature(id, pick?.subCategoryId, pick?.geometryClass));\n }\n\n /**\n * Appends a 3d line string to the builder.\n * @param points Array of vertices in the line string.\n */\n public abstract addLineString(points: Point3d[]): void;\n\n /**\n * Appends a 2d line string to the builder.\n * @param points Array of vertices in the line string.\n * @param zDepth Z value in local coordinates to use for each point.\n */\n public abstract addLineString2d(points: Point2d[], zDepth: number): void;\n\n /**\n * Appends a 3d point string to the builder. The points are drawn disconnected, with a diameter in pixels defined by the builder's active [[GraphicParams.rasterWidth]].\n * @param points Array of vertices in the point string.\n */\n public abstract addPointString(points: Point3d[]): void;\n\n /**\n * Appends a 2d point string to the builder. The points are drawn disconnected, with a diameter in pixels defined by the builder's active [[GraphicParams.rasterWidth]].\n * @param points Array of vertices in the point string.\n * @param zDepth Z value in local coordinates to use for each point.\n */\n public abstract addPointString2d(points: Point2d[], zDepth: number): void;\n\n /**\n * Appends a closed 3d planar region to the builder.\n * @param points Array of vertices of the shape.\n */\n public abstract addShape(points: Point3d[]): void;\n\n /**\n * Appends a closed 2d region to the builder.\n * @param points Array of vertices of the shape.\n * @param zDepth Z value in local coordinates to use for each point.\n */\n public abstract addShape2d(points: Point2d[], zDepth: number): void;\n\n /**\n * Appends a 3d open arc or closed ellipse to the builder.\n * @param arc Description of the arc or ellipse.\n * @param isEllipse If true, and if the arc defines a full sweep, then draw as a closed ellipse instead of an arc.\n * @param filled If true, and isEllipse is also true, then draw ellipse filled.\n */\n public abstract addArc(arc: Arc3d, isEllipse: boolean, filled: boolean): void;\n\n /**\n * Appends a 2d open arc or closed ellipse to the builder.\n * @param arc Description of the arc or ellipse.\n * @param isEllipse If true, and if the arc defines a full sweep, then draw as a closed ellipse instead of an arc.\n * @param filled If true, and isEllipse is also true, then draw ellipse filled.\n * @param zDepth Z value in local coordinates to use for each point in the arc or ellipse.\n */\n public abstract addArc2d(ellipse: Arc3d, isEllipse: boolean, filled: boolean, zDepth: number): void;\n\n /** Append a 3d open path to the builder. */\n public abstract addPath(path: Path): void;\n\n /** Append a 3d planar region to the builder. */\n public abstract addLoop(loop: Loop): void;\n\n /** Append a [CurvePrimitive]($core-geometry) to the builder. */\n public addCurvePrimitive(curve: AnyCurvePrimitive): void {\n switch (curve.curvePrimitiveType) {\n case \"lineString\":\n this.addLineString(curve.points);\n break;\n case \"lineSegment\":\n this.addLineString([curve.startPoint(), curve.endPoint()]);\n break;\n case \"arc\":\n this.addArc(curve, false, false);\n break;\n default:\n const path = new Path();\n if (path.tryAddChild(curve))\n this.addPath(path);\n\n break;\n }\n }\n\n /** Append a mesh to the builder.\n * @param meshData Describes the mesh\n * @param filled If the mesh describes a planar region, indicates whether its interior area should be drawn with fill in [[RenderMode.Wireframe]].\n */\n public abstract addPolyface(meshData: Polyface, filled: boolean): void;\n\n /** Append a solid primitive to the builder. */\n public abstract addSolidPrimitive(solidPrimitive: SolidPrimitive): void;\n\n /** Append any primitive to the builder.\n * @param primitive The graphic primitive to append.\n */\n public addPrimitive(primitive: GraphicPrimitive): void {\n switch (primitive.type) {\n case \"linestring\":\n this.addLineString(primitive.points);\n break;\n case \"linestring2d\":\n this.addLineString2d(primitive.points, primitive.zDepth);\n break;\n case \"pointstring\":\n this.addPointString(primitive.points);\n break;\n case \"pointstring2d\":\n this.addPointString2d(primitive.points, primitive.zDepth);\n break;\n case \"shape\":\n this.addShape(primitive.points);\n break;\n case \"shape2d\":\n this.addShape2d(primitive.points, primitive.zDepth);\n break;\n case \"arc\":\n this.addArc(primitive.arc, true === primitive.isEllipse, true === primitive.filled);\n break;\n case \"arc2d\":\n this.addArc2d(primitive.arc, true === primitive.isEllipse, true === primitive.filled, primitive.zDepth);\n break;\n case \"path\":\n this.addPath(primitive.path);\n break;\n case \"loop\":\n this.addLoop(primitive.loop);\n break;\n case \"polyface\":\n this.addPolyface(primitive.polyface, true === primitive.filled);\n break;\n case \"solidPrimitive\":\n this.addSolidPrimitive(primitive.solidPrimitive);\n break;\n }\n }\n\n /** Add a box representing a volume of space. Typically used for debugging purposes.\n * @param range The volume of space.\n * @param solid If true, a [[Box]] solid primitive will be added; otherwise, a wireframe outline of the box will be added.\n */\n public addRangeBox(range: Range3d, solid = false): void {\n if (!solid) {\n this.addFrustum(Frustum.fromRange(range));\n return;\n }\n\n const box = Box.createRange(range, true);\n if (box)\n this.addSolidPrimitive(box);\n }\n\n /** Add Frustum edges. Useful for debugging. */\n public addFrustum(frustum: Frustum) {\n this.addRangeBoxFromCorners(frustum.points);\n }\n\n /** Add Frustum sides. Useful for debugging. */\n public addFrustumSides(frustum: Frustum) {\n this.addRangeBoxSidesFromCorners(frustum.points);\n }\n\n /** Add range edges from corner points */\n public addRangeBoxFromCorners(p: Point3d[]) {\n this.addLineString([\n p[Npc.LeftBottomFront],\n p[Npc.LeftTopFront],\n p[Npc.RightTopFront],\n p[Npc.RightBottomFront],\n p[Npc.RightBottomRear],\n p[Npc.RightTopRear],\n p[Npc.LeftTopRear],\n p[Npc.LeftBottomRear],\n p[Npc.LeftBottomFront].clone(),\n p[Npc.RightBottomFront].clone(),\n ]);\n\n this.addLineString([p[Npc.LeftTopFront].clone(), p[Npc.LeftTopRear].clone()]);\n this.addLineString([p[Npc.RightTopFront].clone(), p[Npc.RightTopRear].clone()]);\n this.addLineString([p[Npc.LeftBottomRear].clone(), p[Npc.RightBottomRear].clone()]);\n }\n\n /** Add range sides from corner points */\n public addRangeBoxSidesFromCorners(p: Point3d[]) {\n this.addShape([\n p[Npc.LeftBottomFront].clone(),\n p[Npc.LeftTopFront].clone(),\n p[Npc.RightTopFront].clone(),\n p[Npc.RightBottomFront].clone(),\n p[Npc.LeftBottomFront].clone()]);\n this.addShape([\n p[Npc.RightTopRear].clone(),\n p[Npc.LeftTopRear].clone(),\n p[Npc.LeftBottomRear].clone(),\n p[Npc.RightBottomRear].clone(),\n p[Npc.RightTopRear].clone()]);\n this.addShape([\n p[Npc.RightTopRear].clone(),\n p[Npc.LeftTopRear].clone(),\n p[Npc.LeftTopFront].clone(),\n p[Npc.RightTopFront].clone(),\n p[Npc.RightTopRear].clone()]);\n this.addShape([\n p[Npc.RightTopRear].clone(),\n p[Npc.RightBottomRear].clone(),\n p[Npc.RightBottomFront].clone(),\n p[Npc.RightTopFront].clone(),\n p[Npc.RightTopRear].clone()]);\n this.addShape([\n p[Npc.LeftBottomRear].clone(),\n p[Npc.RightBottomRear].clone(),\n p[Npc.RightBottomFront].clone(),\n p[Npc.LeftBottomFront].clone(),\n p[Npc.LeftBottomRear].clone()]);\n this.addShape([\n p[Npc.LeftBottomRear].clone(),\n p[Npc.LeftTopRear].clone(),\n p[Npc.LeftTopFront].clone(),\n p[Npc.LeftBottomFront].clone(),\n p[Npc.LeftBottomRear].clone()]);\n }\n\n /** Sets the current active symbology for this builder. Any new geometry subsequently added will be drawn using the specified symbology.\n * @param lineColor The color in which to draw lines.\n * @param fillColor The color in which to draw filled regions.\n * @param lineWidth The width in pixels to draw lines. The renderer will clamp this value to an integer in the range [1, 32].\n * @param linePixels The pixel pattern in which to draw lines.\n * @see [[GraphicBuilder.activateGraphicParams]] for additional symbology options.\n */\n public setSymbology(lineColor: ColorDef, fillColor: ColorDef, lineWidth: number, linePixels = LinePixels.Solid) {\n this.activateGraphicParams(GraphicParams.fromSymbology(lineColor, fillColor, lineWidth, linePixels));\n }\n\n /** Set the current active symbology for this builder to be a blanking fill before adding a planar region.\n * A planar region drawn with blanking fill renders behind other geometry in the same graphic.\n * Blanking fill is not affected by the fill [[ViewFlags]] being disabled.\n * An example would be to add a line to a graphic containing a shape with blanking fill so that the line is always shown in front of the fill.\n * @param fillColor The color in which to draw filled regions.\n */\n public setBlankingFill(fillColor: ColorDef) { this.activateGraphicParams(GraphicParams.fromBlankingFill(fillColor)); }\n}\n"]}
@@ -46,6 +46,7 @@ export interface RenderTargetDebugControl {
46
46
  vcSupportIntersectingVolumes: boolean;
47
47
  readonly shadowFrustum: Frustum | undefined;
48
48
  displayDrapeFrustum: boolean;
49
+ displayMaskFrustum: boolean;
49
50
  /** Override device pixel ratio for on-screen targets only. This supersedes window.devicePixelRatio.
50
51
  * Undefined clears the override. Chiefly useful for tests.
51
52
  */