@itwin/core-frontend 3.3.0-dev.49 → 3.3.0-dev.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/DisplayStyleState.d.ts +12 -14
- package/lib/cjs/DisplayStyleState.d.ts.map +1 -1
- package/lib/cjs/DisplayStyleState.js +84 -69
- package/lib/cjs/DisplayStyleState.js.map +1 -1
- package/lib/cjs/DrawingViewState.js +1 -1
- package/lib/cjs/DrawingViewState.js.map +1 -1
- package/lib/cjs/IModelConnection.js +1 -1
- package/lib/cjs/IModelConnection.js.map +1 -1
- package/lib/cjs/RealityDataSource.d.ts.map +1 -1
- package/lib/cjs/RealityDataSource.js +6 -2
- package/lib/cjs/RealityDataSource.js.map +1 -1
- package/lib/cjs/SheetViewState.js +1 -1
- package/lib/cjs/SheetViewState.js.map +1 -1
- package/lib/cjs/ViewState.d.ts +1 -2
- package/lib/cjs/ViewState.d.ts.map +1 -1
- package/lib/cjs/ViewState.js +2 -2
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +9 -4
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +0 -2
- package/lib/cjs/core-frontend.d.ts.map +1 -1
- package/lib/cjs/core-frontend.js +0 -2
- package/lib/cjs/core-frontend.js.map +1 -1
- package/lib/cjs/render/FeatureSymbology.js +2 -2
- package/lib/cjs/render/FeatureSymbology.js.map +1 -1
- package/lib/cjs/render/GraphicBranch.d.ts +15 -9
- package/lib/cjs/render/GraphicBranch.d.ts.map +1 -1
- package/lib/cjs/render/GraphicBranch.js +38 -1
- package/lib/cjs/render/GraphicBranch.js.map +1 -1
- package/lib/cjs/render/primitives/EdgeParams.d.ts +11 -0
- package/lib/cjs/render/primitives/EdgeParams.d.ts.map +1 -1
- package/lib/cjs/render/primitives/EdgeParams.js +36 -29
- package/lib/cjs/render/primitives/EdgeParams.js.map +1 -1
- package/lib/cjs/render/primitives/VertexTable.d.ts +11 -4
- package/lib/cjs/render/primitives/VertexTable.d.ts.map +1 -1
- package/lib/cjs/render/primitives/VertexTable.js +13 -6
- package/lib/cjs/render/primitives/VertexTable.js.map +1 -1
- package/lib/cjs/render/primitives/VertexTableSplitter.d.ts +41 -0
- package/lib/cjs/render/primitives/VertexTableSplitter.d.ts.map +1 -0
- package/lib/cjs/render/primitives/VertexTableSplitter.js +662 -0
- package/lib/cjs/render/primitives/VertexTableSplitter.js.map +1 -0
- package/lib/cjs/render-primitives.d.ts +1 -0
- package/lib/cjs/render-primitives.d.ts.map +1 -1
- package/lib/cjs/render-primitives.js +1 -0
- package/lib/cjs/render-primitives.js.map +1 -1
- package/lib/cjs/tile/ClassifierTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/ClassifierTileTree.js +8 -8
- package/lib/cjs/tile/ClassifierTileTree.js.map +1 -1
- package/lib/cjs/tile/IModelTile.d.ts.map +1 -1
- package/lib/cjs/tile/IModelTile.js +1 -0
- package/lib/cjs/tile/IModelTile.js.map +1 -1
- package/lib/cjs/tile/IModelTileTree.d.ts +3 -1
- package/lib/cjs/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/IModelTileTree.js +1 -0
- package/lib/cjs/tile/IModelTileTree.js.map +1 -1
- package/lib/cjs/tile/ImdlReader.d.ts +9 -4
- package/lib/cjs/tile/ImdlReader.d.ts.map +1 -1
- package/lib/cjs/tile/ImdlReader.js +174 -60
- package/lib/cjs/tile/ImdlReader.js.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.d.ts +7 -6
- package/lib/cjs/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/cjs/tile/PrimaryTileTree.js +30 -25
- package/lib/cjs/tile/PrimaryTileTree.js.map +1 -1
- package/lib/cjs/tile/TileAdmin.d.ts +21 -2
- package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
- package/lib/cjs/tile/TileAdmin.js +30 -12
- package/lib/cjs/tile/TileAdmin.js.map +1 -1
- package/lib/esm/DisplayStyleState.d.ts +12 -14
- package/lib/esm/DisplayStyleState.d.ts.map +1 -1
- package/lib/esm/DisplayStyleState.js +84 -69
- package/lib/esm/DisplayStyleState.js.map +1 -1
- package/lib/esm/DrawingViewState.js +1 -1
- package/lib/esm/DrawingViewState.js.map +1 -1
- package/lib/esm/IModelConnection.js +1 -1
- package/lib/esm/IModelConnection.js.map +1 -1
- package/lib/esm/RealityDataSource.d.ts.map +1 -1
- package/lib/esm/RealityDataSource.js +6 -2
- package/lib/esm/RealityDataSource.js.map +1 -1
- package/lib/esm/SheetViewState.js +1 -1
- package/lib/esm/SheetViewState.js.map +1 -1
- package/lib/esm/ViewState.d.ts +1 -2
- package/lib/esm/ViewState.d.ts.map +1 -1
- package/lib/esm/ViewState.js +2 -2
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +9 -4
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +0 -2
- package/lib/esm/core-frontend.d.ts.map +1 -1
- package/lib/esm/core-frontend.js +0 -2
- package/lib/esm/core-frontend.js.map +1 -1
- package/lib/esm/render/FeatureSymbology.js +2 -2
- package/lib/esm/render/FeatureSymbology.js.map +1 -1
- package/lib/esm/render/GraphicBranch.d.ts +15 -9
- package/lib/esm/render/GraphicBranch.d.ts.map +1 -1
- package/lib/esm/render/GraphicBranch.js +36 -0
- package/lib/esm/render/GraphicBranch.js.map +1 -1
- package/lib/esm/render/primitives/EdgeParams.d.ts +11 -0
- package/lib/esm/render/primitives/EdgeParams.d.ts.map +1 -1
- package/lib/esm/render/primitives/EdgeParams.js +34 -28
- package/lib/esm/render/primitives/EdgeParams.js.map +1 -1
- package/lib/esm/render/primitives/VertexTable.d.ts +11 -4
- package/lib/esm/render/primitives/VertexTable.d.ts.map +1 -1
- package/lib/esm/render/primitives/VertexTable.js +14 -7
- package/lib/esm/render/primitives/VertexTable.js.map +1 -1
- package/lib/esm/render/primitives/VertexTableSplitter.d.ts +41 -0
- package/lib/esm/render/primitives/VertexTableSplitter.d.ts.map +1 -0
- package/lib/esm/render/primitives/VertexTableSplitter.js +655 -0
- package/lib/esm/render/primitives/VertexTableSplitter.js.map +1 -0
- package/lib/esm/render-primitives.d.ts +1 -0
- package/lib/esm/render-primitives.d.ts.map +1 -1
- package/lib/esm/render-primitives.js +1 -0
- package/lib/esm/render-primitives.js.map +1 -1
- package/lib/esm/tile/ClassifierTileTree.d.ts.map +1 -1
- package/lib/esm/tile/ClassifierTileTree.js +10 -10
- package/lib/esm/tile/ClassifierTileTree.js.map +1 -1
- package/lib/esm/tile/IModelTile.d.ts.map +1 -1
- package/lib/esm/tile/IModelTile.js +1 -0
- package/lib/esm/tile/IModelTile.js.map +1 -1
- package/lib/esm/tile/IModelTileTree.d.ts +3 -1
- package/lib/esm/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/esm/tile/IModelTileTree.js +1 -0
- package/lib/esm/tile/IModelTileTree.js.map +1 -1
- package/lib/esm/tile/ImdlReader.d.ts +9 -4
- package/lib/esm/tile/ImdlReader.d.ts.map +1 -1
- package/lib/esm/tile/ImdlReader.js +174 -60
- package/lib/esm/tile/ImdlReader.js.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.d.ts +7 -6
- package/lib/esm/tile/PrimaryTileTree.d.ts.map +1 -1
- package/lib/esm/tile/PrimaryTileTree.js +31 -26
- package/lib/esm/tile/PrimaryTileTree.js.map +1 -1
- package/lib/esm/tile/TileAdmin.d.ts +21 -2
- package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
- package/lib/esm/tile/TileAdmin.js +31 -13
- package/lib/esm/tile/TileAdmin.js.map +1 -1
- package/package.json +20 -20
- package/lib/cjs/RenderScheduleState.d.ts +0 -24
- package/lib/cjs/RenderScheduleState.d.ts.map +0 -1
- package/lib/cjs/RenderScheduleState.js +0 -76
- package/lib/cjs/RenderScheduleState.js.map +0 -1
- package/lib/cjs/extension/providers/ExtensionServiceClient.d.ts +0 -54
- package/lib/cjs/extension/providers/ExtensionServiceClient.d.ts.map +0 -1
- package/lib/cjs/extension/providers/ExtensionServiceClient.js +0 -138
- package/lib/cjs/extension/providers/ExtensionServiceClient.js.map +0 -1
- package/lib/cjs/extension/providers/ServiceExtensionProvider.d.ts +0 -38
- package/lib/cjs/extension/providers/ServiceExtensionProvider.d.ts.map +0 -1
- package/lib/cjs/extension/providers/ServiceExtensionProvider.js +0 -73
- package/lib/cjs/extension/providers/ServiceExtensionProvider.js.map +0 -1
- package/lib/esm/RenderScheduleState.d.ts +0 -24
- package/lib/esm/RenderScheduleState.d.ts.map +0 -1
- package/lib/esm/RenderScheduleState.js +0 -71
- package/lib/esm/RenderScheduleState.js.map +0 -1
- package/lib/esm/extension/providers/ExtensionServiceClient.d.ts +0 -54
- package/lib/esm/extension/providers/ExtensionServiceClient.d.ts.map +0 -1
- package/lib/esm/extension/providers/ExtensionServiceClient.js +0 -134
- package/lib/esm/extension/providers/ExtensionServiceClient.js.map +0 -1
- package/lib/esm/extension/providers/ServiceExtensionProvider.d.ts +0 -38
- package/lib/esm/extension/providers/ServiceExtensionProvider.d.ts.map +0 -1
- package/lib/esm/extension/providers/ServiceExtensionProvider.js +0 -69
- package/lib/esm/extension/providers/ServiceExtensionProvider.js.map +0 -1
|
@@ -44,7 +44,6 @@ export * from "./NoRenderApp";
|
|
|
44
44
|
export * from "./NotificationManager";
|
|
45
45
|
export * from "./PerModelCategoryVisibility";
|
|
46
46
|
export * from "./PlanarClipMaskState";
|
|
47
|
-
export * from "./RenderScheduleState";
|
|
48
47
|
export * from "./SelectionSet";
|
|
49
48
|
export * from "./SheetViewState";
|
|
50
49
|
export * from "./SpatialViewState";
|
|
@@ -68,7 +67,6 @@ export * from "./ViewStatus";
|
|
|
68
67
|
export * from "./extension/Extension";
|
|
69
68
|
export * from "./extension/providers/LocalExtensionProvider";
|
|
70
69
|
export * from "./extension/providers/RemoteExtensionProvider";
|
|
71
|
-
export * from "./extension/providers/ServiceExtensionProvider";
|
|
72
70
|
export * from "./properties/AngleDescription";
|
|
73
71
|
export * from "./properties/FormattedQuantityDescription";
|
|
74
72
|
export * from "./properties/LengthDescription";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-frontend.d.ts","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":"AAKA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,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;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG"}
|
package/lib/cjs/core-frontend.js
CHANGED
|
@@ -60,7 +60,6 @@ __exportStar(require("./NoRenderApp"), exports);
|
|
|
60
60
|
__exportStar(require("./NotificationManager"), exports);
|
|
61
61
|
__exportStar(require("./PerModelCategoryVisibility"), exports);
|
|
62
62
|
__exportStar(require("./PlanarClipMaskState"), exports);
|
|
63
|
-
__exportStar(require("./RenderScheduleState"), exports);
|
|
64
63
|
__exportStar(require("./SelectionSet"), exports);
|
|
65
64
|
__exportStar(require("./SheetViewState"), exports);
|
|
66
65
|
__exportStar(require("./SpatialViewState"), exports);
|
|
@@ -84,7 +83,6 @@ __exportStar(require("./ViewStatus"), exports);
|
|
|
84
83
|
__exportStar(require("./extension/Extension"), exports);
|
|
85
84
|
__exportStar(require("./extension/providers/LocalExtensionProvider"), exports);
|
|
86
85
|
__exportStar(require("./extension/providers/RemoteExtensionProvider"), exports);
|
|
87
|
-
__exportStar(require("./extension/providers/ServiceExtensionProvider"), exports);
|
|
88
86
|
__exportStar(require("./properties/AngleDescription"), exports);
|
|
89
87
|
__exportStar(require("./properties/FormattedQuantityDescription"), exports);
|
|
90
88
|
__exportStar(require("./properties/LengthDescription"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-frontend.js","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,6CAA2B;AAC3B,6CAA2B;AAC3B,gDAA8B;AAC9B,iDAA+B;AAC/B,wDAAsC;AACtC,kDAAgC;AAChC,0DAAwC;AACxC,gDAA8B;AAC9B,yDAAuC;AACvC,6DAA2C;AAC3C,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B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AChD,wDAAsC;AACtC,wDAAsC;AACtC,yDAAuC;AACvC,iDAA+B;AAC/B,oEAAkD;AAClD,0DAAwC;AACxC,oEAAkD;AAClD,wDAAsC;AACtC,sEAAoD;AACpD,kDAAgC;AAChC,uDAAqC;AACrC,uDAAqC;AACrC,0DAAwC;AACxC,yDAAuC;AACvC,0DAAwC;AACxC,mDAAiC;AACjC,sDAAoC;AACpC,wDAAsC;AACtC,qDAAmC;AACnC,+CAA6B;AAC7B,uDAAqC;AACrC,oDAAkC;AAClC,yDAAuC;AACvC,mDAAiC;AACjC,0DAAwC;AACxC,kDAAgC;AAChC,kDAAgC;AAChC,oDAAkC;AAClC,sDAAoC;AACpC,sGAAsG;AACtG,wCAAsC;AAEtC;;GAEG;AAEH;;;;GAIG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./AccuDraw\";\r\nexport * from \"./AccuSnap\";\r\nexport * from \"./AuxCoordSys\";\r\nexport * from \"./BingLocation\";\r\nexport * from \"./BriefcaseConnection\";\r\nexport * from \"./BriefcaseTxns\";\r\nexport * from \"./CategorySelectorState\";\r\nexport * from \"./ChangeFlags\";\r\nexport * from \"./CheckpointConnection\";\r\nexport * from \"./ContextRealityModelState\";\r\nexport * from \"./CoordSystem\";\r\nexport * from \"./DecorationsCache\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyleState\";\r\nexport * from \"./DrawingViewState\";\r\nexport * from \"./ElementLocateManager\";\r\nexport * from \"./EmphasizeElements\";\r\nexport * from \"./EntityState\";\r\nexport * from \"./EnvironmentDecorations\";\r\nexport * from \"./FeatureOverrideProvider\";\r\nexport * from \"./FlashSettings\";\r\nexport * from \"./FrontendLoggerCategory\";\r\nexport * from \"./FrontendHubAccess\";\r\nexport * from \"./Frustum2d\";\r\nexport * from \"./FrustumAnimator\";\r\nexport * from \"./FuzzySearch\";\r\nexport * from \"./GeoServices\";\r\nexport * from \"./GlobeAnimator\";\r\nexport * from \"./GraphicalEditingScope\";\r\nexport * from \"./HitDetail\";\r\nexport * from \"./ImageUtil\";\r\nexport * from \"./IModelApp\";\r\nexport * from \"./IModelConnection\";\r\nexport * from \"./IModelRoutingContext\";\r\nexport * from \"./IpcApp\";\r\nexport * from \"./LinePlaneIntersect\";\r\nexport * from \"./MarginPercent\";\r\nexport * from \"./Marker\";\r\nexport * from \"./ModelSelectorState\";\r\nexport * from \"./ModelState\";\r\nexport * from \"./NativeApp\";\r\nexport * from \"./NativeAppLogger\";\r\nexport * from \"./NoRenderApp\";\r\nexport * from \"./NotificationManager\";\r\nexport * from \"./PerModelCategoryVisibility\";\r\nexport * from \"./PlanarClipMaskState\";\r\nexport * from \"./RenderScheduleState\";\r\nexport * from \"./SelectionSet\";\r\nexport * from \"./SheetViewState\";\r\nexport * from \"./SpatialViewState\";\r\nexport * from \"./Sprites\";\r\nexport * from \"./StandardView\";\r\nexport * from \"./SubCategoriesCache\";\r\nexport * from \"./TentativePoint\";\r\nexport * from \"./Tiles\";\r\nexport * from \"./UserPreferences\";\r\nexport * from \"./ViewAnimation\";\r\nexport * from \"./ViewContext\";\r\nexport * from \"./ViewGlobalLocation\";\r\nexport * from \"./ViewingSpace\";\r\nexport * from \"./ViewManager\";\r\nexport * from \"./Viewport\";\r\nexport * from \"./ViewportSync\";\r\nexport * from \"./ViewPose\";\r\nexport * from \"./ViewRect\";\r\nexport * from \"./ViewState\";\r\nexport * from \"./ViewStatus\";\r\nexport * from \"./extension/Extension\";\r\nexport * from \"./extension/providers/LocalExtensionProvider\";\r\nexport * from \"./extension/providers/RemoteExtensionProvider\";\r\nexport * from \"./extension/providers/ServiceExtensionProvider\";\r\nexport * from \"./properties/AngleDescription\";\r\nexport * from \"./properties/FormattedQuantityDescription\";\r\nexport * from \"./properties/LengthDescription\";\r\nexport * from \"./quantity-formatting/QuantityFormatter\";\r\nexport * from \"./quantity-formatting/BaseUnitFormattingSettingsProvider\";\r\nexport * from \"./quantity-formatting/LocalUnitFormatProvider\";\r\nexport * from \"./quantity-formatting/QuantityTypesEditorSpecs\";\r\nexport * from \"./render/CanvasDecoration\";\r\nexport * from \"./render/Decorations\";\r\nexport * from \"./render/FeatureSymbology\";\r\nexport * from \"./render/FrameStats\";\r\nexport * from \"./render/GraphicBranch\";\r\nexport * from \"./render/GraphicBuilder\";\r\nexport * from \"./render/GraphicPrimitive\";\r\nexport * from \"./render/InstancedGraphicParams\";\r\nexport * from \"./render/MockRender\";\r\nexport * from \"./render/ParticleCollectionBuilder\";\r\nexport * from \"./render/Pixel\";\r\nexport * from \"./render/RenderClipVolume\";\r\nexport * from \"./render/RenderGraphic\";\r\nexport * from \"./render/RenderMaterial\";\r\nexport * from \"./render/RenderMemory\";\r\nexport * from \"./render/RenderPlan\";\r\nexport * from \"./render/RenderPlanarClassifier\";\r\nexport * from \"./render/RenderTarget\";\r\nexport * from \"./render/RenderSystem\";\r\nexport * from \"./render/RenderTexture\";\r\nexport * from \"./render/Scene\";\r\nexport * from \"./render/ScreenSpaceEffectBuilder\";\r\nexport * from \"./render/VisibleFeature\";\r\nexport * from \"./render/webgl/PerformanceMetrics\";\r\nexport * from \"./render/webgl/Target\";\r\nexport * from \"./render/webgl/IModelFrameLifecycle\";\r\nexport * from \"./tile/internal\";\r\nexport * from \"./tools/AccuDrawTool\";\r\nexport * from \"./tools/ClipViewTool\";\r\nexport * from \"./tools/EditManipulator\";\r\nexport * from \"./tools/ElementSetTool\";\r\nexport * from \"./tools/EventController\";\r\nexport * from \"./tools/IdleTool\";\r\nexport * from \"./tools/MeasureTool\";\r\nexport * from \"./tools/PrimitiveTool\";\r\nexport * from \"./tools/SelectTool\";\r\nexport * from \"./tools/Tool\";\r\nexport * from \"./tools/ToolSettings\";\r\nexport * from \"./tools/ToolAdmin\";\r\nexport * from \"./tools/ToolAssistance\";\r\nexport * from \"./tools/ViewTool\";\r\nexport * from \"./BackgroundMapGeometry\";\r\nexport * from \"./ViewCreator2d\";\r\nexport * from \"./ViewCreator3d\";\r\nexport * from \"./LocalhostIpcApp\";\r\nexport * from \"./RealityDataSource\";\r\n// TODO/FIX: \"./extension/ExtensionRuntime\" import has to be last to avoid circular dependency errors.\r\nimport \"./extension/ExtensionRuntime\";\r\n\r\n/** @docs-package-description\r\n * The core-frontend package always runs in a web browser. It contains classes for [querying iModels and showing views]($docs/learning/frontend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelApp\r\n * Classes for configuring and administering an iTwin.js application.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description IModelConnection\r\n * Classes for working with a connection to an [iModel briefcase]($docs/learning/IModels.md)\r\n */\r\n/**\r\n * @docs-group-description ElementState\r\n * Classes for working with the *state* of Elements in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description ModelState\r\n * Classes for working with the *state* of Models in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Tools\r\n * Classes for [working with Tools]($docs/learning/frontend/Tools.md)\r\n */\r\n/**\r\n * @docs-group-description Measure\r\n * Classes for reporting point to point distances and mass properties of elements.\r\n */\r\n/**\r\n * @docs-group-description Views\r\n * Classes for [working with Views]($docs/learning/frontend/Views.md)\r\n */\r\n/**\r\n * @docs-group-description LocatingElements\r\n * Classes for locating and snapping to elements in views.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description AccuDraw\r\n * AccuDraw provides helpful assistance for creating and modifying elements in a view.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Notifications\r\n * Notifications provide feedback to the user of something of interest.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Extensions\r\n * Classes for creating and managing Extensions.\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Classes for working with property records and descriptions.\r\n */\r\n/**\r\n * @docs-group-description Rendering\r\n * Classes for rendering the contents of views.\r\n */\r\n/**\r\n * @docs-group-description SelectionSet\r\n * Classes for working with the set of selected elements.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Native Applications\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package\r\n */\r\n/**\r\n * @docs-group-description QuantityFormatting\r\n * Classes for formatting and parsing quantity values.\r\n */\r\n/**\r\n * @docs-group-description Tiles\r\n * Classes representing graphics as [hierarchical 3d tiles](https://github.com/CesiumGS/3d-tiles).\r\n */\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n/**\r\n * @docs-group-description UserPreferences\r\n * APIs for working with user preferences in an iModelApp.\r\n * See [the learning articles]($docs/learning/frontend/preferences.md).\r\n */\r\n/**\r\n * @docs-group-description MapLayers\r\n * Classes supporting map layers display.\r\n */\r\n"]}
|
|
1
|
+
{"version":3,"file":"core-frontend.js","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,6CAA2B;AAC3B,6CAA2B;AAC3B,gDAA8B;AAC9B,iDAA+B;AAC/B,wDAAsC;AACtC,kDAAgC;AAChC,0DAAwC;AACxC,gDAA8B;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AACxC,wDAAsC;AACtC,sDAAoC;AACpC,kEAAgD;AAChD,wDAAsC;AACtC,wDAAsC;AACtC,yDAAuC;AACvC,iDAA+B;AAC/B,oEAAkD;AAClD,0DAAwC;AACxC,oEAAkD;AAClD,wDAAsC;AACtC,sEAAoD;AACpD,kDAAgC;AAChC,uDAAqC;AACrC,uDAAqC;AACrC,0DAAwC;AACxC,yDAAuC;AACvC,0DAAwC;AACxC,mDAAiC;AACjC,sDAAoC;AACpC,wDAAsC;AACtC,qDAAmC;AACnC,+CAA6B;AAC7B,uDAAqC;AACrC,oDAAkC;AAClC,yDAAuC;AACvC,mDAAiC;AACjC,0DAAwC;AACxC,kDAAgC;AAChC,kDAAgC;AAChC,oDAAkC;AAClC,sDAAoC;AACpC,sGAAsG;AACtG,wCAAsC;AAEtC;;GAEG;AAEH;;;;GAIG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./AccuDraw\";\r\nexport * from \"./AccuSnap\";\r\nexport * from \"./AuxCoordSys\";\r\nexport * from \"./BingLocation\";\r\nexport * from \"./BriefcaseConnection\";\r\nexport * from \"./BriefcaseTxns\";\r\nexport * from \"./CategorySelectorState\";\r\nexport * from \"./ChangeFlags\";\r\nexport * from \"./CheckpointConnection\";\r\nexport * from \"./ContextRealityModelState\";\r\nexport * from \"./CoordSystem\";\r\nexport * from \"./DecorationsCache\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyleState\";\r\nexport * from \"./DrawingViewState\";\r\nexport * from \"./ElementLocateManager\";\r\nexport * from \"./EmphasizeElements\";\r\nexport * from \"./EntityState\";\r\nexport * from \"./EnvironmentDecorations\";\r\nexport * from \"./FeatureOverrideProvider\";\r\nexport * from \"./FlashSettings\";\r\nexport * from \"./FrontendLoggerCategory\";\r\nexport * from \"./FrontendHubAccess\";\r\nexport * from \"./Frustum2d\";\r\nexport * from \"./FrustumAnimator\";\r\nexport * from \"./FuzzySearch\";\r\nexport * from \"./GeoServices\";\r\nexport * from \"./GlobeAnimator\";\r\nexport * from \"./GraphicalEditingScope\";\r\nexport * from \"./HitDetail\";\r\nexport * from \"./ImageUtil\";\r\nexport * from \"./IModelApp\";\r\nexport * from \"./IModelConnection\";\r\nexport * from \"./IModelRoutingContext\";\r\nexport * from \"./IpcApp\";\r\nexport * from \"./LinePlaneIntersect\";\r\nexport * from \"./MarginPercent\";\r\nexport * from \"./Marker\";\r\nexport * from \"./ModelSelectorState\";\r\nexport * from \"./ModelState\";\r\nexport * from \"./NativeApp\";\r\nexport * from \"./NativeAppLogger\";\r\nexport * from \"./NoRenderApp\";\r\nexport * from \"./NotificationManager\";\r\nexport * from \"./PerModelCategoryVisibility\";\r\nexport * from \"./PlanarClipMaskState\";\r\nexport * from \"./SelectionSet\";\r\nexport * from \"./SheetViewState\";\r\nexport * from \"./SpatialViewState\";\r\nexport * from \"./Sprites\";\r\nexport * from \"./StandardView\";\r\nexport * from \"./SubCategoriesCache\";\r\nexport * from \"./TentativePoint\";\r\nexport * from \"./Tiles\";\r\nexport * from \"./UserPreferences\";\r\nexport * from \"./ViewAnimation\";\r\nexport * from \"./ViewContext\";\r\nexport * from \"./ViewGlobalLocation\";\r\nexport * from \"./ViewingSpace\";\r\nexport * from \"./ViewManager\";\r\nexport * from \"./Viewport\";\r\nexport * from \"./ViewportSync\";\r\nexport * from \"./ViewPose\";\r\nexport * from \"./ViewRect\";\r\nexport * from \"./ViewState\";\r\nexport * from \"./ViewStatus\";\r\nexport * from \"./extension/Extension\";\r\nexport * from \"./extension/providers/LocalExtensionProvider\";\r\nexport * from \"./extension/providers/RemoteExtensionProvider\";\r\nexport * from \"./properties/AngleDescription\";\r\nexport * from \"./properties/FormattedQuantityDescription\";\r\nexport * from \"./properties/LengthDescription\";\r\nexport * from \"./quantity-formatting/QuantityFormatter\";\r\nexport * from \"./quantity-formatting/BaseUnitFormattingSettingsProvider\";\r\nexport * from \"./quantity-formatting/LocalUnitFormatProvider\";\r\nexport * from \"./quantity-formatting/QuantityTypesEditorSpecs\";\r\nexport * from \"./render/CanvasDecoration\";\r\nexport * from \"./render/Decorations\";\r\nexport * from \"./render/FeatureSymbology\";\r\nexport * from \"./render/FrameStats\";\r\nexport * from \"./render/GraphicBranch\";\r\nexport * from \"./render/GraphicBuilder\";\r\nexport * from \"./render/GraphicPrimitive\";\r\nexport * from \"./render/InstancedGraphicParams\";\r\nexport * from \"./render/MockRender\";\r\nexport * from \"./render/ParticleCollectionBuilder\";\r\nexport * from \"./render/Pixel\";\r\nexport * from \"./render/RenderClipVolume\";\r\nexport * from \"./render/RenderGraphic\";\r\nexport * from \"./render/RenderMaterial\";\r\nexport * from \"./render/RenderMemory\";\r\nexport * from \"./render/RenderPlan\";\r\nexport * from \"./render/RenderPlanarClassifier\";\r\nexport * from \"./render/RenderTarget\";\r\nexport * from \"./render/RenderSystem\";\r\nexport * from \"./render/RenderTexture\";\r\nexport * from \"./render/Scene\";\r\nexport * from \"./render/ScreenSpaceEffectBuilder\";\r\nexport * from \"./render/VisibleFeature\";\r\nexport * from \"./render/webgl/PerformanceMetrics\";\r\nexport * from \"./render/webgl/Target\";\r\nexport * from \"./render/webgl/IModelFrameLifecycle\";\r\nexport * from \"./tile/internal\";\r\nexport * from \"./tools/AccuDrawTool\";\r\nexport * from \"./tools/ClipViewTool\";\r\nexport * from \"./tools/EditManipulator\";\r\nexport * from \"./tools/ElementSetTool\";\r\nexport * from \"./tools/EventController\";\r\nexport * from \"./tools/IdleTool\";\r\nexport * from \"./tools/MeasureTool\";\r\nexport * from \"./tools/PrimitiveTool\";\r\nexport * from \"./tools/SelectTool\";\r\nexport * from \"./tools/Tool\";\r\nexport * from \"./tools/ToolSettings\";\r\nexport * from \"./tools/ToolAdmin\";\r\nexport * from \"./tools/ToolAssistance\";\r\nexport * from \"./tools/ViewTool\";\r\nexport * from \"./BackgroundMapGeometry\";\r\nexport * from \"./ViewCreator2d\";\r\nexport * from \"./ViewCreator3d\";\r\nexport * from \"./LocalhostIpcApp\";\r\nexport * from \"./RealityDataSource\";\r\n// TODO/FIX: \"./extension/ExtensionRuntime\" import has to be last to avoid circular dependency errors.\r\nimport \"./extension/ExtensionRuntime\";\r\n\r\n/** @docs-package-description\r\n * The core-frontend package always runs in a web browser. It contains classes for [querying iModels and showing views]($docs/learning/frontend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelApp\r\n * Classes for configuring and administering an iTwin.js application.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description IModelConnection\r\n * Classes for working with a connection to an [iModel briefcase]($docs/learning/IModels.md)\r\n */\r\n/**\r\n * @docs-group-description ElementState\r\n * Classes for working with the *state* of Elements in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description ModelState\r\n * Classes for working with the *state* of Models in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Tools\r\n * Classes for [working with Tools]($docs/learning/frontend/Tools.md)\r\n */\r\n/**\r\n * @docs-group-description Measure\r\n * Classes for reporting point to point distances and mass properties of elements.\r\n */\r\n/**\r\n * @docs-group-description Views\r\n * Classes for [working with Views]($docs/learning/frontend/Views.md)\r\n */\r\n/**\r\n * @docs-group-description LocatingElements\r\n * Classes for locating and snapping to elements in views.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description AccuDraw\r\n * AccuDraw provides helpful assistance for creating and modifying elements in a view.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Notifications\r\n * Notifications provide feedback to the user of something of interest.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Extensions\r\n * Classes for creating and managing Extensions.\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Classes for working with property records and descriptions.\r\n */\r\n/**\r\n * @docs-group-description Rendering\r\n * Classes for rendering the contents of views.\r\n */\r\n/**\r\n * @docs-group-description SelectionSet\r\n * Classes for working with the set of selected elements.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Native Applications\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package\r\n */\r\n/**\r\n * @docs-group-description QuantityFormatting\r\n * Classes for formatting and parsing quantity values.\r\n */\r\n/**\r\n * @docs-group-description Tiles\r\n * Classes representing graphics as [hierarchical 3d tiles](https://github.com/CesiumGS/3d-tiles).\r\n */\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n/**\r\n * @docs-group-description UserPreferences\r\n * APIs for working with user preferences in an iModelApp.\r\n * See [the learning articles]($docs/learning/frontend/preferences.md).\r\n */\r\n/**\r\n * @docs-group-description MapLayers\r\n * Classes supporting map layers display.\r\n */\r\n"]}
|
|
@@ -121,9 +121,9 @@ var FeatureSymbology;
|
|
|
121
121
|
if (realityModel.appearanceOverrides && realityModel.modelId)
|
|
122
122
|
this.override({ modelId: realityModel.modelId, appearance: realityModel.appearanceOverrides });
|
|
123
123
|
});
|
|
124
|
-
const script = style.
|
|
124
|
+
const script = style.scheduleScript;
|
|
125
125
|
if (script)
|
|
126
|
-
script.
|
|
126
|
+
script.addSymbologyOverrides(this, (_a = style.settings.timePoint) !== null && _a !== void 0 ? _a : 0);
|
|
127
127
|
if (!view.is3d())
|
|
128
128
|
return;
|
|
129
129
|
const planProjectionSettings = view.getDisplayStyle3d().settings.planProjectionSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureSymbology.js","sourceRoot":"","sources":["../../../src/render/FeatureSymbology.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,oDAAyE;AACzE,0CAAuC;AAGvC,+BAA+B;AAE/B;;;GAGG;AACH,IAAiB,gBAAgB,CA0LhC;AA1LD,WAAiB,gBAAgB;IAkB/B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAa,SAAU,SAAQ,8BAAgB;QAQ7C;;WAEG;QACH,YAAmB,IAA2B;YAC5C,KAAK,EAAE,CAAC;YACR,IAAI,SAAS,KAAK,IAAI,EAAE;gBACtB,IAAI,IAAI,YAAY,mBAAQ;oBAC1B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;;oBAE5B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;aAC3B;QACH,CAAC;QAhBD,aAAa;QACb,IAAW,MAAM;YACf,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;QAeD;;WAEG;QACI,MAAM,CAAC,UAAU,CAAC,MAAc,EAAE,IAA2B;YAClE,MAAM,IAAI,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;YACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;YACtB,OAAO,IAAI,CAAC;QACd,CAAC;QAED;;WAEG;QACI,YAAY,CAAC,IAAe;YACjC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;QAED;;WAEG;QACI,gBAAgB,CAAC,QAAkB;YACxC,MAAM,IAAI,GAA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CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE;gBAChE,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;YAEH,kFAAkF;YAClF,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC,UAAkB,EAAE,UAAkB,EAAE,OAAuB,EAAE,EAAE;gBAC1G,OAAO,CAAC,OAAO,CAAC,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE;oBAC7C,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;wBAC1C,sFAAsF;wBACtF,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;qBACzB;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;KACF;IAhJY,0BAAS,YAgJrB,CAAA;AACH,CAAC,EA1LgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QA0LhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { BeEvent, Id64 } from \"@itwin/core-bentley\";\r\nimport { FeatureAppearance, FeatureOverrides } from \"@itwin/core-common\";\r\nimport { Viewport } from \"../Viewport\";\r\nimport { ViewState } from \"../ViewState\";\r\n\r\n// cspell:ignore subcat subcats\r\n\r\n/** Contains types that enable an application to customize how [Feature]($common)s are drawn within a [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport namespace FeatureSymbology {\r\n /** An object that serves as the source of a [[FeatureSymbology.Overrides]].\r\n * Use this if you are drawing the same tiles into a single Viewport and overriding the FeatureSymbology.Overrides applied to them\r\n * by settings [[GraphicBranch.symbologyOverrides]].\r\n * Each tile will have a separate set of feature overrides per combination of Source and Viewport. This prevents the display system\r\n * from constantly recomputing the feature overrides for a tile.\r\n * You must call `onSourceDisposed.raiseEvent()` when the source is no longer being used by the Viewport to allow the feature overrides\r\n * and their WebGL resources to be freed - failure to do so will result in memory leaks, which may eventually produce WebGL context loss.\r\n * @alpha\r\n */\r\n export interface Source {\r\n /** An event raised when this source becomes disassociated with the viewport, indicating any WebGL resources allocated for it\r\n * can be freed.\r\n * Failure to invoke this event appropriately will result in memory leaks, which may eventually produce WebGL context loss.\r\n */\r\n readonly onSourceDisposed: BeEvent<() => void>;\r\n }\r\n\r\n /** Allows a [[Viewport]] to customize the appearance of individual [Feature]($common)s within it.\r\n *\r\n * The Viewport computes its base Overrides based on the following:\r\n * - The set of categories enabled for display in its [[CategorySelectorState]]. Every [[SubCategory]] belonging to an enabled [[Category]] is added to the set of visible subcategories - all other subcategories are assumed to be invisible.\r\n * - For the set of visible subcategories, any [[SubCategoryOverride]]s defined by the view's [[DisplayStyleState]] are applied. This may render some subcategories invisible, and change the symbology of others.\r\n * - The visibility of each [GeometryClass]($common) is set based on the view's [ViewFlags]($common).\r\n * - The line weight is overridden to 1 pixel for all Features if line weight has been disabled by the view's [ViewFlags]($common).\r\n * - The sets of elements which are always drawn and never drawn are initialized from the [[Viewport]]'s sets.\r\n * An application can further customize the symbology of any Features by registering a [[FeatureOverrideProvider]] with a [[Viewport]]. That provider's addFeatureOverrides function will be invoked\r\n * whenever the Overrides need to be regenerated.\r\n *\r\n * To override the symbology of *most* Features within a view, specify a `defaultOverrides` to be applied to any Feature not explicitly overridden.\r\n * If default overrides are defined and some Features should draw normally without being affected by the default overrides, override that Feature with\r\n * an Appearance which defines no overrides.\r\n *\r\n * It is possible to override multiple aspects of a Feature. For example, you might specify that all elements belonging to subcategory \"A\" should be drawn in red, and\r\n * that the element with Id \"0x123\" should be drawn with 0.25 transparency. In this case, when drawing a Feature with subcategory \"A\" and element Id \"0x123\", the two overrides will\r\n * be merged, causing the Feature's geometry to draw 25% transparent red. On the other hand, if subcategory \"A\" is specified to draw in red and element \"0x123\" to draw in green,\r\n * the color specified by the element override will take precedence over that specified for the subcategory, resulting in a green Feature.\r\n *\r\n * @see [[Viewport.alwaysDrawn]]\r\n * @see [[Viewport.neverDrawn]]\r\n */\r\n export class Overrides extends FeatureOverrides {\r\n private _source?: Source;\r\n\r\n /** @alpha */\r\n public get source(): Source | undefined {\r\n return this._source;\r\n }\r\n\r\n /** Construct a new Overrides. The result is an empty set of overrides if no view or viewport is supplied.\r\n * @param view If supplied, the overrides will be initialized based on the current state of the view or viewport.\r\n */\r\n public constructor(view?: ViewState | Viewport) {\r\n super();\r\n if (undefined !== view) {\r\n if (view instanceof Viewport)\r\n this.initFromViewport(view);\r\n else\r\n this.initFromView(view);\r\n }\r\n }\r\n\r\n /** Create symbology overrides associated with a [[FeatureSymbology.Source]].\r\n * @alpha\r\n */\r\n public static withSource(source: Source, view?: ViewState | Viewport): Overrides {\r\n const ovrs = new Overrides(view);\r\n ovrs._source = source;\r\n return ovrs;\r\n }\r\n\r\n /** Initialize these Overrides based on a specific view.\r\n * @internal\r\n */\r\n public initFromView(view: ViewState): void {\r\n this._initFromView(view);\r\n this._initSubCategoryOverrides(view);\r\n }\r\n\r\n /** Initialize these Overrides based on a specific viewport.\r\n * @internal\r\n */\r\n public initFromViewport(viewport: Viewport): void {\r\n const view = viewport.view;\r\n this._initFromView(view);\r\n\r\n if (undefined !== viewport.neverDrawn)\r\n this.setNeverDrawnSet(viewport.neverDrawn);\r\n\r\n if (undefined !== viewport.alwaysDrawn)\r\n this.setAlwaysDrawnSet(viewport.alwaysDrawn, viewport.isAlwaysDrawnExclusive);\r\n\r\n viewport.addFeatureOverrides(this);\r\n viewport.addModelSubCategoryVisibilityOverrides(this, this._modelSubCategoryOverrides);\r\n\r\n // This will include any per-model subcategory visibility overrides added above.\r\n this._initSubCategoryOverrides(view);\r\n }\r\n\r\n private _initFromView(view: ViewState): void {\r\n const { viewFlags } = view;\r\n const { constructions, dimensions, patterns } = viewFlags;\r\n\r\n this.neverDrawnAnimationNodes.clear();\r\n this.animationNodeOverrides.clear();\r\n\r\n for (const excluded of view.displayStyle.settings.excludedElementIds)\r\n this.setNeverDrawn(excluded);\r\n\r\n this._constructions = constructions;\r\n this._dimensions = dimensions;\r\n this._patterns = patterns;\r\n this._lineWeights = viewFlags.weights;\r\n\r\n for (const categoryId of view.categorySelector.categories) {\r\n const subCategoryIds = view.iModel.subcategories.getSubCategories(categoryId);\r\n if (undefined === subCategoryIds)\r\n continue;\r\n\r\n for (const subCategoryId of subCategoryIds) {\r\n if (view.isSubCategoryVisible(subCategoryId)) {\r\n const idLo = Id64.getLowerUint32(subCategoryId);\r\n const idHi = Id64.getUpperUint32(subCategoryId);\r\n this._visibleSubCategories.add(idLo, idHi);\r\n\r\n const app = view.iModel.subcategories.getSubCategoryAppearance(subCategoryId);\r\n if (undefined !== app)\r\n this._subCategoryPriorities.set(idLo, idHi, app.priority);\r\n }\r\n }\r\n }\r\n const style = view.displayStyle;\r\n style.settings.modelAppearanceOverrides.forEach((appearance, modelId) => this.override({ modelId, appearance, onConflict: \"skip\" }));\r\n\r\n style.forEachRealityModel((realityModel) => {\r\n if (realityModel.appearanceOverrides && realityModel.modelId)\r\n this.override({ modelId: realityModel.modelId, appearance: realityModel.appearanceOverrides });\r\n });\r\n\r\n const script = style.scheduleState;\r\n if (script)\r\n script.getSymbologyOverrides(this, style.settings.timePoint ?? 0);\r\n\r\n if (!view.is3d())\r\n return;\r\n\r\n const planProjectionSettings = view.getDisplayStyle3d().settings.planProjectionSettings;\r\n if (undefined === planProjectionSettings)\r\n return;\r\n\r\n for (const [modelId, projSettings] of planProjectionSettings) {\r\n if (undefined !== projSettings.transparency)\r\n this.override({ modelId, appearance: FeatureAppearance.fromJSON({ transparency: projSettings.transparency }) });\r\n }\r\n }\r\n\r\n private _initSubCategoryOverrides(view: ViewState): void {\r\n const addOverride = (idLo: number, idHi: number) => {\r\n const subCategoryId = Id64.fromUint32Pair(idLo, idHi);\r\n const ovr = view.getSubCategoryOverride(subCategoryId);\r\n if (undefined !== ovr) {\r\n const app = FeatureAppearance.fromSubCategoryOverride(ovr);\r\n if (app.overridesSymbology)\r\n this._subCategoryOverrides.set(idLo, idHi, app);\r\n\r\n if (undefined !== ovr.priority)\r\n this._subCategoryPriorities.set(idLo, idHi, ovr.priority);\r\n }\r\n };\r\n\r\n // Add overrides for all subcategories visible in the view\r\n this._visibleSubCategories.forEach((idLo: number, idHi: number) => {\r\n addOverride(idLo, idHi);\r\n });\r\n\r\n // Add overrides for all subcategories overridden to be visible in specific models\r\n this._modelSubCategoryOverrides.forEach((_modelIdLo: number, _modelIdHi: number, subcats: Id64.Uint32Set) => {\r\n subcats.forEach((idLo: number, idHi: number) => {\r\n if (!this.isSubCategoryVisible(idLo, idHi)) {\r\n // Overridden to be visible in one or more models - will need the appearance overrides\r\n addOverride(idLo, idHi);\r\n }\r\n });\r\n });\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"FeatureSymbology.js","sourceRoot":"","sources":["../../../src/render/FeatureSymbology.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,oDAAyE;AACzE,0CAAuC;AAGvC,+BAA+B;AAE/B;;;GAGG;AACH,IAAiB,gBAAgB,CA0LhC;AA1LD,WAAiB,gBAAgB;IAkB/B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAa,SAAU,SAAQ,8BAAgB;QAQ7C;;WAEG;QACH,YAAmB,IAA2B;YAC5C,KAAK,EAAE,CAAC;YACR,IAAI,SAAS,KAAK,IAAI,EAAE;gBACtB,IAAI,IAAI,YAAY,mBAAQ;oBAC1B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;;oBAE5B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;aAC3B;QACH,CAAC;QAhBD,aAAa;QACb,IAAW,MAAM;YACf,OAAO,IAAI,CAAC,OAAO,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AI,SAAS,KAAK,GAAG,EAAE;oBACrB,MAAM,GAAG,GAAG,+BAAiB,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;oBAC3D,IAAI,GAAG,CAAC,kBAAkB;wBACxB,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;oBAElD,IAAI,SAAS,KAAK,GAAG,CAAC,QAAQ;wBAC5B,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;iBAC7D;YACH,CAAC,CAAC;YAEF,0DAA0D;YAC1D,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE;gBAChE,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;YAEH,kFAAkF;YAClF,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC,UAAkB,EAAE,UAAkB,EAAE,OAAuB,EAAE,EAAE;gBAC1G,OAAO,CAAC,OAAO,CAAC,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE;oBAC7C,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;wBAC1C,sFAAsF;wBACtF,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;qBACzB;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;KACF;IAhJY,0BAAS,YAgJrB,CAAA;AACH,CAAC,EA1LgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QA0LhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { BeEvent, Id64 } from \"@itwin/core-bentley\";\r\nimport { FeatureAppearance, FeatureOverrides } from \"@itwin/core-common\";\r\nimport { Viewport } from \"../Viewport\";\r\nimport { ViewState } from \"../ViewState\";\r\n\r\n// cspell:ignore subcat subcats\r\n\r\n/** Contains types that enable an application to customize how [Feature]($common)s are drawn within a [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport namespace FeatureSymbology {\r\n /** An object that serves as the source of a [[FeatureSymbology.Overrides]].\r\n * Use this if you are drawing the same tiles into a single Viewport and overriding the FeatureSymbology.Overrides applied to them\r\n * by settings [[GraphicBranch.symbologyOverrides]].\r\n * Each tile will have a separate set of feature overrides per combination of Source and Viewport. This prevents the display system\r\n * from constantly recomputing the feature overrides for a tile.\r\n * You must call `onSourceDisposed.raiseEvent()` when the source is no longer being used by the Viewport to allow the feature overrides\r\n * and their WebGL resources to be freed - failure to do so will result in memory leaks, which may eventually produce WebGL context loss.\r\n * @alpha\r\n */\r\n export interface Source {\r\n /** An event raised when this source becomes disassociated with the viewport, indicating any WebGL resources allocated for it\r\n * can be freed.\r\n * Failure to invoke this event appropriately will result in memory leaks, which may eventually produce WebGL context loss.\r\n */\r\n readonly onSourceDisposed: BeEvent<() => void>;\r\n }\r\n\r\n /** Allows a [[Viewport]] to customize the appearance of individual [Feature]($common)s within it.\r\n *\r\n * The Viewport computes its base Overrides based on the following:\r\n * - The set of categories enabled for display in its [[CategorySelectorState]]. Every [[SubCategory]] belonging to an enabled [[Category]] is added to the set of visible subcategories - all other subcategories are assumed to be invisible.\r\n * - For the set of visible subcategories, any [[SubCategoryOverride]]s defined by the view's [[DisplayStyleState]] are applied. This may render some subcategories invisible, and change the symbology of others.\r\n * - The visibility of each [GeometryClass]($common) is set based on the view's [ViewFlags]($common).\r\n * - The line weight is overridden to 1 pixel for all Features if line weight has been disabled by the view's [ViewFlags]($common).\r\n * - The sets of elements which are always drawn and never drawn are initialized from the [[Viewport]]'s sets.\r\n * An application can further customize the symbology of any Features by registering a [[FeatureOverrideProvider]] with a [[Viewport]]. That provider's addFeatureOverrides function will be invoked\r\n * whenever the Overrides need to be regenerated.\r\n *\r\n * To override the symbology of *most* Features within a view, specify a `defaultOverrides` to be applied to any Feature not explicitly overridden.\r\n * If default overrides are defined and some Features should draw normally without being affected by the default overrides, override that Feature with\r\n * an Appearance which defines no overrides.\r\n *\r\n * It is possible to override multiple aspects of a Feature. For example, you might specify that all elements belonging to subcategory \"A\" should be drawn in red, and\r\n * that the element with Id \"0x123\" should be drawn with 0.25 transparency. In this case, when drawing a Feature with subcategory \"A\" and element Id \"0x123\", the two overrides will\r\n * be merged, causing the Feature's geometry to draw 25% transparent red. On the other hand, if subcategory \"A\" is specified to draw in red and element \"0x123\" to draw in green,\r\n * the color specified by the element override will take precedence over that specified for the subcategory, resulting in a green Feature.\r\n *\r\n * @see [[Viewport.alwaysDrawn]]\r\n * @see [[Viewport.neverDrawn]]\r\n */\r\n export class Overrides extends FeatureOverrides {\r\n private _source?: Source;\r\n\r\n /** @alpha */\r\n public get source(): Source | undefined {\r\n return this._source;\r\n }\r\n\r\n /** Construct a new Overrides. The result is an empty set of overrides if no view or viewport is supplied.\r\n * @param view If supplied, the overrides will be initialized based on the current state of the view or viewport.\r\n */\r\n public constructor(view?: ViewState | Viewport) {\r\n super();\r\n if (undefined !== view) {\r\n if (view instanceof Viewport)\r\n this.initFromViewport(view);\r\n else\r\n this.initFromView(view);\r\n }\r\n }\r\n\r\n /** Create symbology overrides associated with a [[FeatureSymbology.Source]].\r\n * @alpha\r\n */\r\n public static withSource(source: Source, view?: ViewState | Viewport): Overrides {\r\n const ovrs = new Overrides(view);\r\n ovrs._source = source;\r\n return ovrs;\r\n }\r\n\r\n /** Initialize these Overrides based on a specific view.\r\n * @internal\r\n */\r\n public initFromView(view: ViewState): void {\r\n this._initFromView(view);\r\n this._initSubCategoryOverrides(view);\r\n }\r\n\r\n /** Initialize these Overrides based on a specific viewport.\r\n * @internal\r\n */\r\n public initFromViewport(viewport: Viewport): void {\r\n const view = viewport.view;\r\n this._initFromView(view);\r\n\r\n if (undefined !== viewport.neverDrawn)\r\n this.setNeverDrawnSet(viewport.neverDrawn);\r\n\r\n if (undefined !== viewport.alwaysDrawn)\r\n this.setAlwaysDrawnSet(viewport.alwaysDrawn, viewport.isAlwaysDrawnExclusive);\r\n\r\n viewport.addFeatureOverrides(this);\r\n viewport.addModelSubCategoryVisibilityOverrides(this, this._modelSubCategoryOverrides);\r\n\r\n // This will include any per-model subcategory visibility overrides added above.\r\n this._initSubCategoryOverrides(view);\r\n }\r\n\r\n private _initFromView(view: ViewState): void {\r\n const { viewFlags } = view;\r\n const { constructions, dimensions, patterns } = viewFlags;\r\n\r\n this.neverDrawnAnimationNodes.clear();\r\n this.animationNodeOverrides.clear();\r\n\r\n for (const excluded of view.displayStyle.settings.excludedElementIds)\r\n this.setNeverDrawn(excluded);\r\n\r\n this._constructions = constructions;\r\n this._dimensions = dimensions;\r\n this._patterns = patterns;\r\n this._lineWeights = viewFlags.weights;\r\n\r\n for (const categoryId of view.categorySelector.categories) {\r\n const subCategoryIds = view.iModel.subcategories.getSubCategories(categoryId);\r\n if (undefined === subCategoryIds)\r\n continue;\r\n\r\n for (const subCategoryId of subCategoryIds) {\r\n if (view.isSubCategoryVisible(subCategoryId)) {\r\n const idLo = Id64.getLowerUint32(subCategoryId);\r\n const idHi = Id64.getUpperUint32(subCategoryId);\r\n this._visibleSubCategories.add(idLo, idHi);\r\n\r\n const app = view.iModel.subcategories.getSubCategoryAppearance(subCategoryId);\r\n if (undefined !== app)\r\n this._subCategoryPriorities.set(idLo, idHi, app.priority);\r\n }\r\n }\r\n }\r\n const style = view.displayStyle;\r\n style.settings.modelAppearanceOverrides.forEach((appearance, modelId) => this.override({ modelId, appearance, onConflict: \"skip\" }));\r\n\r\n style.forEachRealityModel((realityModel) => {\r\n if (realityModel.appearanceOverrides && realityModel.modelId)\r\n this.override({ modelId: realityModel.modelId, appearance: realityModel.appearanceOverrides });\r\n });\r\n\r\n const script = style.scheduleScript;\r\n if (script)\r\n script.addSymbologyOverrides(this, style.settings.timePoint ?? 0);\r\n\r\n if (!view.is3d())\r\n return;\r\n\r\n const planProjectionSettings = view.getDisplayStyle3d().settings.planProjectionSettings;\r\n if (undefined === planProjectionSettings)\r\n return;\r\n\r\n for (const [modelId, projSettings] of planProjectionSettings) {\r\n if (undefined !== projSettings.transparency)\r\n this.override({ modelId, appearance: FeatureAppearance.fromJSON({ transparency: projSettings.transparency }) });\r\n }\r\n }\r\n\r\n private _initSubCategoryOverrides(view: ViewState): void {\r\n const addOverride = (idLo: number, idHi: number) => {\r\n const subCategoryId = Id64.fromUint32Pair(idLo, idHi);\r\n const ovr = view.getSubCategoryOverride(subCategoryId);\r\n if (undefined !== ovr) {\r\n const app = FeatureAppearance.fromSubCategoryOverride(ovr);\r\n if (app.overridesSymbology)\r\n this._subCategoryOverrides.set(idLo, idHi, app);\r\n\r\n if (undefined !== ovr.priority)\r\n this._subCategoryPriorities.set(idLo, idHi, ovr.priority);\r\n }\r\n };\r\n\r\n // Add overrides for all subcategories visible in the view\r\n this._visibleSubCategories.forEach((idLo: number, idHi: number) => {\r\n addOverride(idLo, idHi);\r\n });\r\n\r\n // Add overrides for all subcategories overridden to be visible in specific models\r\n this._modelSubCategoryOverrides.forEach((_modelIdLo: number, _modelIdHi: number, subcats: Id64.Uint32Set) => {\r\n subcats.forEach((idLo: number, idHi: number) => {\r\n if (!this.isSubCategoryVisible(idLo, idHi)) {\r\n // Overridden to be visible in one or more models - will need the appearance overrides\r\n addOverride(idLo, idHi);\r\n }\r\n });\r\n });\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Rendering
|
|
3
3
|
*/
|
|
4
|
+
import { Id64String, IDisposable } from "@itwin/core-bentley";
|
|
5
|
+
import { FeatureAppearanceProvider, HiddenLine, RenderSchedule, ViewFlagOverrides, ViewFlags } from "@itwin/core-common";
|
|
6
|
+
import { IModelConnection } from "../IModelConnection";
|
|
7
|
+
import { FeatureSymbology } from "./FeatureSymbology";
|
|
8
|
+
import { RenderClipVolume } from "./RenderClipVolume";
|
|
9
|
+
import { RenderGraphic } from "./RenderGraphic";
|
|
10
|
+
import { RenderMemory } from "./RenderMemory";
|
|
11
|
+
import { RenderPlanarClassifier } from "./RenderPlanarClassifier";
|
|
12
|
+
import { RenderTextureDrape } from "./RenderSystem";
|
|
4
13
|
/** Carries information in a GraphicBranchOptions about a GraphicBranch produced by drawing one view into the context of another.
|
|
5
14
|
* @internal
|
|
6
15
|
*/
|
|
@@ -11,15 +20,6 @@ export interface GraphicBranchFrustum {
|
|
|
11
20
|
y: number;
|
|
12
21
|
};
|
|
13
22
|
}
|
|
14
|
-
import { IDisposable } from "@itwin/core-bentley";
|
|
15
|
-
import { FeatureAppearanceProvider, HiddenLine, ViewFlagOverrides, ViewFlags } from "@itwin/core-common";
|
|
16
|
-
import { IModelConnection } from "../IModelConnection";
|
|
17
|
-
import { FeatureSymbology } from "./FeatureSymbology";
|
|
18
|
-
import { RenderClipVolume } from "./RenderClipVolume";
|
|
19
|
-
import { RenderGraphic } from "./RenderGraphic";
|
|
20
|
-
import { RenderMemory } from "./RenderMemory";
|
|
21
|
-
import { RenderPlanarClassifier } from "./RenderPlanarClassifier";
|
|
22
|
-
import { RenderTextureDrape } from "./RenderSystem";
|
|
23
23
|
/** Special values of [[GraphicBranch.animationNodeId]].
|
|
24
24
|
* All other values refer to an [ElementTimeline.batchId]($common) that applies a transform to the graphics in the branch.
|
|
25
25
|
* @internal
|
|
@@ -105,6 +105,8 @@ export interface AnimationBranchState {
|
|
|
105
105
|
readonly clip?: RenderClipVolume;
|
|
106
106
|
readonly omit?: boolean;
|
|
107
107
|
}
|
|
108
|
+
/** @internal */
|
|
109
|
+
export declare function formatAnimationBranchId(modelId: Id64String, branchId: number): string;
|
|
108
110
|
/** Mapping from node/branch IDs to animation branch state
|
|
109
111
|
* @internal
|
|
110
112
|
*/
|
|
@@ -114,4 +116,8 @@ export interface AnimationBranchStates {
|
|
|
114
116
|
/** Ids of nodes that apply a transform. */
|
|
115
117
|
readonly transformNodeIds: ReadonlySet<number>;
|
|
116
118
|
}
|
|
119
|
+
/** @internal */
|
|
120
|
+
export declare namespace AnimationBranchStates {
|
|
121
|
+
function fromScript(script: RenderSchedule.Script, time: number): AnimationBranchStates | undefined;
|
|
122
|
+
}
|
|
117
123
|
//# sourceMappingURL=GraphicBranch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphicBranch.d.ts","sourceRoot":"","sources":["../../../src/render/GraphicBranch.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH
|
|
1
|
+
{"version":3,"file":"GraphicBranch.d.ts","sourceRoot":"","sources":["../../../src/render/GraphicBranch.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAgB,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EACL,yBAAyB,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EACpF,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE;QACL,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CA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gB,CAAC;IAC1B,gBAAgB;IAChB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,wFAAwF;IACxF,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;IAC/C,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;CAC5D;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,gBAAgB;AAChB,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKrF;AASD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,oCAAoC;IACpC,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IACzD,2CAA2C;IAC3C,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAChD;AAED,gBAAgB;AAChB,yBAAiB,qBAAqB,CAAC;IACrC,SAAgB,UAAU,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAmBzG;CACF"}
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
* @module Rendering
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.GraphicBranch = exports.AnimationNodeId = void 0;
|
|
10
|
+
exports.AnimationBranchStates = exports.formatAnimationBranchId = exports.GraphicBranch = exports.AnimationNodeId = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
+
const IModelApp_1 = require("../IModelApp");
|
|
12
13
|
/** Special values of [[GraphicBranch.animationNodeId]].
|
|
13
14
|
* All other values refer to an [ElementTimeline.batchId]($common) that applies a transform to the graphics in the branch.
|
|
14
15
|
* @internal
|
|
@@ -79,4 +80,40 @@ class GraphicBranch {
|
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
exports.GraphicBranch = GraphicBranch;
|
|
83
|
+
/** @internal */
|
|
84
|
+
function formatAnimationBranchId(modelId, branchId) {
|
|
85
|
+
if (branchId < 0)
|
|
86
|
+
return modelId;
|
|
87
|
+
return `${modelId}_Node_${branchId.toString()}`;
|
|
88
|
+
}
|
|
89
|
+
exports.formatAnimationBranchId = formatAnimationBranchId;
|
|
90
|
+
function addAnimationBranch(modelId, timeline, branchId, branches, time) {
|
|
91
|
+
const clipVector = timeline.getClipVector(time);
|
|
92
|
+
const clip = clipVector ? IModelApp_1.IModelApp.renderSystem.createClipVolume(clipVector) : undefined;
|
|
93
|
+
if (clip)
|
|
94
|
+
branches.set(formatAnimationBranchId(modelId, branchId), { clip });
|
|
95
|
+
}
|
|
96
|
+
/** @internal */
|
|
97
|
+
var AnimationBranchStates;
|
|
98
|
+
(function (AnimationBranchStates) {
|
|
99
|
+
function fromScript(script, time) {
|
|
100
|
+
if (!script.containsModelClipping && !script.requiresBatching)
|
|
101
|
+
return undefined;
|
|
102
|
+
const branches = new Map();
|
|
103
|
+
for (const model of script.modelTimelines) {
|
|
104
|
+
addAnimationBranch(model.modelId, model, -1, branches, time);
|
|
105
|
+
for (const elem of model.elementTimelines) {
|
|
106
|
+
if (elem.getVisibility(time) <= 0)
|
|
107
|
+
branches.set(formatAnimationBranchId(model.modelId, elem.batchId), { omit: true });
|
|
108
|
+
else
|
|
109
|
+
addAnimationBranch(model.modelId, elem, elem.batchId, branches, time);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
branchStates: branches,
|
|
114
|
+
transformNodeIds: script.transformBatchIds,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
AnimationBranchStates.fromScript = fromScript;
|
|
118
|
+
})(AnimationBranchStates = exports.AnimationBranchStates || (exports.AnimationBranchStates = {}));
|
|
82
119
|
//# sourceMappingURL=GraphicBranch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphicBranch.js","sourceRoot":"","sources":["../../../src/render/GraphicBranch.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAaH,sDAAgE;AAUhE;;;GAGG;AACH,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,gFAA0B,CAAA;AAC5B,CAAC,EAFW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAE1B;AAED;;;;;;;GAOG;AACH,MAAa,aAAa;IAoBxB;;OAEG;IACH,YAAmB,cAAuB,KAAK;QAtB/C,qCAAqC;QACrB,YAAO,GAAoB,EAAE,CAAC;QAG9C;;WAEG;QACI,sBAAiB,GAAsB,EAAE,CAAC;QAgB/C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,oCAAoC;IAC7B,GAAG,CAAC,OAAsB;QAC/B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,YAAY,CAAC,KAAgB;QAClC,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAChD,CAAC;IAED,uFAAuF;IAChF,YAAY,CAAC,KAAgB;QAClC,IAAI,CAAC,iBAAiB,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IACxC,CAAC;IAED,oCAAoC;IAC7B,oBAAoB,CAAC,GAAsB;QAChD,IAAI,CAAC,iBAAiB,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IACtC,CAAC;IAED,uFAAuF;IAChF,OAAO;QACZ,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,wDAAwD;IACxD,IAAW,OAAO;QAChB,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IACnC,CAAC;IAED,sIAAsI;IAC/H,KAAK;QACV,IAAI,IAAI,CAAC,WAAW;YAClB,IAAA,2BAAY,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;;YAE3B,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED,gBAAgB;IACT,iBAAiB,CAAC,KAA8B;QACrD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO;YAC9B,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF;AAzED,sCAyEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\n/** Carries information in a GraphicBranchOptions about a GraphicBranch produced by drawing one view into the context of another.\r\n * @internal\r\n */\r\nexport interface GraphicBranchFrustum {\r\n is3d: boolean;\r\n scale: {\r\n x: number;\r\n y: number;\r\n };\r\n}\r\n\r\nimport { disposeArray, IDisposable } from \"@itwin/core-bentley\";\r\nimport { FeatureAppearanceProvider, HiddenLine, ViewFlagOverrides, ViewFlags } from \"@itwin/core-common\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport { FeatureSymbology } from \"./FeatureSymbology\";\r\nimport { RenderClipVolume } from \"./RenderClipVolume\";\r\nimport { RenderGraphic } from \"./RenderGraphic\";\r\nimport { RenderMemory } from \"./RenderMemory\";\r\nimport { RenderPlanarClassifier } from \"./RenderPlanarClassifier\";\r\nimport { RenderTextureDrape } from \"./RenderSystem\";\r\n\r\n/** Special values of [[GraphicBranch.animationNodeId]].\r\n * All other values refer to an [ElementTimeline.batchId]($common) that applies a transform to the graphics in the branch.\r\n * @internal\r\n */\r\nexport enum AnimationNodeId {\r\n Untransformed = 0xffffffff,\r\n}\r\n\r\n/**\r\n * A node in a scene graph. The branch itself is not renderable. Instead it contains a list of RenderGraphics,\r\n * and a transform, symbology overrides, and clip volume which are to be applied when rendering them.\r\n * Branches can be nested to build an arbitrarily-complex scene graph.\r\n * @see [[RenderSystem.createBranch]]\r\n * @public\r\n * @extensions\r\n */\r\nexport class GraphicBranch implements IDisposable /* , RenderMemory.Consumer */ {\r\n /** The child nodes of this branch */\r\n public readonly entries: RenderGraphic[] = [];\r\n /** If true, when the branch is disposed of, the RenderGraphics in its entries array will also be disposed */\r\n public readonly ownsEntries: boolean;\r\n /** Selectively overrides the view's [ViewFlags]($common) while drawing graphics within this branch. The default overrides nothing.\r\n * @see [[setViewFlagOverrides]].\r\n */\r\n public viewFlagOverrides: ViewFlagOverrides = {};\r\n /** Optional symbology overrides to be applied to all graphics in this branch */\r\n public symbologyOverrides?: FeatureSymbology.Overrides;\r\n /** Optional animation branch Id that incorporates the model Id and, for element timelines, the batch Id.\r\n * @internal\r\n */\r\n public animationId?: string;\r\n /** Identifies the node in the [RenderSchedule.Script]($backend) with which this branch is associated.\r\n * @internal\r\n */\r\n public animationNodeId?: AnimationNodeId | number;\r\n\r\n /** Constructor\r\n * @param ownsEntries If true, when this branch is [[dispose]]d, all of the [[RenderGraphic]]s it contains will also be disposed.\r\n */\r\n public constructor(ownsEntries: boolean = false) {\r\n this.ownsEntries = ownsEntries;\r\n }\r\n\r\n /** Add a graphic to this branch. */\r\n public add(graphic: RenderGraphic): void {\r\n this.entries.push(graphic);\r\n }\r\n\r\n /** Compute the view flags that result from applying this branch's [[viewFlagOverrides]] to the input flags.\r\n * @param flags The input view flags, e.g., from the view's [[DisplayStyleState]].\r\n * @returns The result of applying [[viewFlagOverrides]] to `flags`.\r\n */\r\n public getViewFlags(flags: ViewFlags): ViewFlags {\r\n return flags.override(this.viewFlagOverrides);\r\n }\r\n\r\n /** Set [[viewFlagOverrides]] to override **all** ViewFlags as specified by `flags`. */\r\n public setViewFlags(flags: ViewFlags): void {\r\n this.viewFlagOverrides = { ...flags };\r\n }\r\n\r\n /** Change [[viewFlagOverrides]]. */\r\n public setViewFlagOverrides(ovr: ViewFlagOverrides): void {\r\n this.viewFlagOverrides = { ...ovr };\r\n }\r\n\r\n /** Disposes of all graphics in this branch, if and only if [[ownsEntries]] is true. */\r\n public dispose() {\r\n this.clear();\r\n }\r\n\r\n /** Returns true if this branch contains no graphics. */\r\n public get isEmpty(): boolean {\r\n return 0 === this.entries.length;\r\n }\r\n\r\n /** Empties the list of [[RenderGraphic]]s contained in this branch, and if the [[ownsEntries]] flag is set, also disposes of them. */\r\n public clear(): void {\r\n if (this.ownsEntries)\r\n disposeArray(this.entries);\r\n else\r\n this.entries.length = 0;\r\n }\r\n\r\n /** @internal */\r\n public collectStatistics(stats: RenderMemory.Statistics): void {\r\n for (const entry of this.entries)\r\n entry.collectStatistics(stats);\r\n }\r\n}\r\n\r\n/** Options passed to [[RenderSystem.createGraphicBranch]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GraphicBranchOptions {\r\n /** Clip applied to the graphics in the branch. */\r\n clipVolume?: RenderClipVolume;\r\n /** @internal */\r\n classifierOrDrape?: RenderPlanarClassifier | RenderTextureDrape;\r\n /** Optionally replaces the view's hidden line settings when drawing the branch. */\r\n hline?: HiddenLine.Settings;\r\n /** The iModel from which the graphics originate, if different than that associated with the view. */\r\n iModel?: IModelConnection;\r\n /** @internal */\r\n frustum?: GraphicBranchFrustum;\r\n /** Supplements the view's [[FeatureSymbology.Overrides]] for graphics in the branch. */\r\n appearanceProvider?: FeatureAppearanceProvider;\r\n /** @internal Secondary planar classifiers (map layers) */\r\n secondaryClassifiers?: Map<number, RenderPlanarClassifier>;\r\n}\r\n\r\n/** Clip/Transform for a branch that are varied over time.\r\n * @internal\r\n */\r\nexport interface AnimationBranchState {\r\n readonly clip?: RenderClipVolume;\r\n readonly omit?: boolean;\r\n}\r\n\r\n/** Mapping from node/branch IDs to animation branch state\r\n * @internal\r\n */\r\nexport interface AnimationBranchStates {\r\n /** Maps node Id to branch state. */\r\n readonly branchStates: Map<string, AnimationBranchState>;\r\n /** Ids of nodes that apply a transform. */\r\n readonly transformNodeIds: ReadonlySet<number>;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"GraphicBranch.js","sourceRoot":"","sources":["../../../src/render/GraphicBranch.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4E;AAK5E,4CAAyC;AAmBzC;;;GAGG;AACH,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,gFAA0B,CAAA;AAC5B,CAAC,EAFW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAE1B;AAED;;;;;;;GAOG;AACH,MAAa,aAAa;IAoBxB;;OAEG;IACH,YAAmB,cAAuB,KAAK;QAtB/C,qCAAqC;QACrB,YAAO,GAAoB,EAAE,CAAC;QAG9C;;WAEG;QACI,sBAAiB,GAAsB,EAAE,CAAC;QAgB/C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,oCAAoC;IAC7B,GAAG,CAAC,OAAsB;QAC/B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,YAAY,CAAC,KAAgB;QAClC,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAChD,CAAC;IAED,uFAAuF;IAChF,YAAY,CAAC,KAAgB;QAClC,IAAI,CAAC,iBAAiB,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IACxC,CAAC;IAED,oCAAoC;IAC7B,oBAAoB,CAAC,GAAsB;QAChD,IAAI,CAAC,iBAAiB,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IACtC,CAAC;IAED,uFAAuF;IAChF,OAAO;QACZ,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,wDAAwD;IACxD,IAAW,OAAO;QAChB,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IACnC,CAAC;IAED,sIAAsI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ACzD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,cAAc,EAAE;YACzC,kBAAkB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC7D,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,gBAAgB,EAAE;gBACzC,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;oBAC/B,QAAQ,CAAC,GAAG,CAAC,uBAAuB,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;;oBAEnF,kBAAkB,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;aACzE;SACF;QAED,OAAO;YACL,YAAY,EAAE,QAAQ;YACtB,gBAAgB,EAAE,MAAM,CAAC,iBAAiB;SAC3C,CAAC;IACJ,CAAC;IAnBe,gCAAU,aAmBzB,CAAA;AACH,CAAC,EArBgB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAqBrC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { disposeArray, Id64String, IDisposable } from \"@itwin/core-bentley\";\r\nimport {\r\n FeatureAppearanceProvider, HiddenLine, RenderSchedule, ViewFlagOverrides, ViewFlags,\r\n} from \"@itwin/core-common\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { FeatureSymbology } from \"./FeatureSymbology\";\r\nimport { RenderClipVolume } from \"./RenderClipVolume\";\r\nimport { RenderGraphic } from \"./RenderGraphic\";\r\nimport { RenderMemory } from \"./RenderMemory\";\r\nimport { RenderPlanarClassifier } from \"./RenderPlanarClassifier\";\r\nimport { RenderTextureDrape } from \"./RenderSystem\";\r\n\r\n/** Carries information in a GraphicBranchOptions about a GraphicBranch produced by drawing one view into the context of another.\r\n * @internal\r\n */\r\nexport interface GraphicBranchFrustum {\r\n is3d: boolean;\r\n scale: {\r\n x: number;\r\n y: number;\r\n };\r\n}\r\n\r\n/** Special values of [[GraphicBranch.animationNodeId]].\r\n * All other values refer to an [ElementTimeline.batchId]($common) that applies a transform to the graphics in the branch.\r\n * @internal\r\n */\r\nexport enum AnimationNodeId {\r\n Untransformed = 0xffffffff,\r\n}\r\n\r\n/**\r\n * A node in a scene graph. The branch itself is not renderable. Instead it contains a list of RenderGraphics,\r\n * and a transform, symbology overrides, and clip volume which are to be applied when rendering them.\r\n * Branches can be nested to build an arbitrarily-complex scene graph.\r\n * @see [[RenderSystem.createBranch]]\r\n * @public\r\n * @extensions\r\n */\r\nexport class GraphicBranch implements IDisposable /* , RenderMemory.Consumer */ {\r\n /** The child nodes of this branch */\r\n public readonly entries: RenderGraphic[] = [];\r\n /** If true, when the branch is disposed of, the RenderGraphics in its entries array will also be disposed */\r\n public readonly ownsEntries: boolean;\r\n /** Selectively overrides the view's [ViewFlags]($common) while drawing graphics within this branch. The default overrides nothing.\r\n * @see [[setViewFlagOverrides]].\r\n */\r\n public viewFlagOverrides: ViewFlagOverrides = {};\r\n /** Optional symbology overrides to be applied to all graphics in this branch */\r\n public symbologyOverrides?: FeatureSymbology.Overrides;\r\n /** Optional animation branch Id that incorporates the model Id and, for element timelines, the batch Id.\r\n * @internal\r\n */\r\n public animationId?: string;\r\n /** Identifies the node in the [RenderSchedule.Script]($backend) with which this branch is associated.\r\n * @internal\r\n */\r\n public animationNodeId?: AnimationNodeId | number;\r\n\r\n /** Constructor\r\n * @param ownsEntries If true, when this branch is [[dispose]]d, all of the [[RenderGraphic]]s it contains will also be disposed.\r\n */\r\n public constructor(ownsEntries: boolean = false) {\r\n this.ownsEntries = ownsEntries;\r\n }\r\n\r\n /** Add a graphic to this branch. */\r\n public add(graphic: RenderGraphic): void {\r\n this.entries.push(graphic);\r\n }\r\n\r\n /** Compute the view flags that result from applying this branch's [[viewFlagOverrides]] to the input flags.\r\n * @param flags The input view flags, e.g., from the view's [[DisplayStyleState]].\r\n * @returns The result of applying [[viewFlagOverrides]] to `flags`.\r\n */\r\n public getViewFlags(flags: ViewFlags): ViewFlags {\r\n return flags.override(this.viewFlagOverrides);\r\n }\r\n\r\n /** Set [[viewFlagOverrides]] to override **all** ViewFlags as specified by `flags`. */\r\n public setViewFlags(flags: ViewFlags): void {\r\n this.viewFlagOverrides = { ...flags };\r\n }\r\n\r\n /** Change [[viewFlagOverrides]]. */\r\n public setViewFlagOverrides(ovr: ViewFlagOverrides): void {\r\n this.viewFlagOverrides = { ...ovr };\r\n }\r\n\r\n /** Disposes of all graphics in this branch, if and only if [[ownsEntries]] is true. */\r\n public dispose() {\r\n this.clear();\r\n }\r\n\r\n /** Returns true if this branch contains no graphics. */\r\n public get isEmpty(): boolean {\r\n return 0 === this.entries.length;\r\n }\r\n\r\n /** Empties the list of [[RenderGraphic]]s contained in this branch, and if the [[ownsEntries]] flag is set, also disposes of them. */\r\n public clear(): void {\r\n if (this.ownsEntries)\r\n disposeArray(this.entries);\r\n else\r\n this.entries.length = 0;\r\n }\r\n\r\n /** @internal */\r\n public collectStatistics(stats: RenderMemory.Statistics): void {\r\n for (const entry of this.entries)\r\n entry.collectStatistics(stats);\r\n }\r\n}\r\n\r\n/** Options passed to [[RenderSystem.createGraphicBranch]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GraphicBranchOptions {\r\n /** Clip applied to the graphics in the branch. */\r\n clipVolume?: RenderClipVolume;\r\n /** @internal */\r\n classifierOrDrape?: RenderPlanarClassifier | RenderTextureDrape;\r\n /** Optionally replaces the view's hidden line settings when drawing the branch. */\r\n hline?: HiddenLine.Settings;\r\n /** The iModel from which the graphics originate, if different than that associated with the view. */\r\n iModel?: IModelConnection;\r\n /** @internal */\r\n frustum?: GraphicBranchFrustum;\r\n /** Supplements the view's [[FeatureSymbology.Overrides]] for graphics in the branch. */\r\n appearanceProvider?: FeatureAppearanceProvider;\r\n /** @internal Secondary planar classifiers (map layers) */\r\n secondaryClassifiers?: Map<number, RenderPlanarClassifier>;\r\n}\r\n\r\n/** Clip/Transform for a branch that are varied over time.\r\n * @internal\r\n */\r\nexport interface AnimationBranchState {\r\n readonly clip?: RenderClipVolume;\r\n readonly omit?: boolean;\r\n}\r\n\r\n/** @internal */\r\nexport function formatAnimationBranchId(modelId: Id64String, branchId: number): string {\r\n if (branchId < 0)\r\n return modelId;\r\n\r\n return `${modelId}_Node_${branchId.toString()}`;\r\n}\r\n\r\nfunction addAnimationBranch(modelId: Id64String, timeline: RenderSchedule.Timeline, branchId: number, branches: Map<string, AnimationBranchState>, time: number): void {\r\n const clipVector = timeline.getClipVector(time);\r\n const clip = clipVector ? IModelApp.renderSystem.createClipVolume(clipVector) : undefined;\r\n if (clip)\r\n branches.set(formatAnimationBranchId(modelId, branchId), { clip });\r\n}\r\n\r\n/** Mapping from node/branch IDs to animation branch state\r\n * @internal\r\n */\r\nexport interface AnimationBranchStates {\r\n /** Maps node Id to branch state. */\r\n readonly branchStates: Map<string, AnimationBranchState>;\r\n /** Ids of nodes that apply a transform. */\r\n readonly transformNodeIds: ReadonlySet<number>;\r\n}\r\n\r\n/** @internal */\r\nexport namespace AnimationBranchStates {\r\n export function fromScript(script: RenderSchedule.Script, time: number): AnimationBranchStates | undefined {\r\n if (!script.containsModelClipping && !script.requiresBatching)\r\n return undefined;\r\n\r\n const branches = new Map<string, AnimationBranchState>();\r\n for (const model of script.modelTimelines) {\r\n addAnimationBranch(model.modelId, model, -1, branches, time);\r\n for (const elem of model.elementTimelines) {\r\n if (elem.getVisibility(time) <= 0)\r\n branches.set(formatAnimationBranchId(model.modelId, elem.batchId), { omit: true });\r\n else\r\n addAnimationBranch(model.modelId, elem, elem.batchId, branches, time);\r\n }\r\n }\r\n\r\n return {\r\n branchStates: branches,\r\n transformNodeIds: script.transformBatchIds,\r\n };\r\n }\r\n}\r\n"]}
|
|
@@ -62,6 +62,17 @@ export interface IndexedEdgeParams {
|
|
|
62
62
|
/** The lookup table indexed by [[indices]]. */
|
|
63
63
|
readonly edges: EdgeTable;
|
|
64
64
|
}
|
|
65
|
+
export interface EdgeTableInfo {
|
|
66
|
+
/** Width of the table. */
|
|
67
|
+
readonly width: number;
|
|
68
|
+
/** Height of the table. */
|
|
69
|
+
readonly height: number;
|
|
70
|
+
/** The number of segments in the lower partition. */
|
|
71
|
+
readonly silhouettePadding: number;
|
|
72
|
+
/** The starting byte index of silhouettes */
|
|
73
|
+
readonly silhouetteStartByteIndex: number;
|
|
74
|
+
}
|
|
75
|
+
export declare function calculateEdgeTableParams(numSegmentEdges: number, numSilhouettes: number, maxSize: number): EdgeTableInfo;
|
|
65
76
|
/** Describes the edges of a mesh. */
|
|
66
77
|
export interface EdgeParams {
|
|
67
78
|
/** The edge width in pixels. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdgeParams.d.ts","sourceRoot":"","sources":["../../../../src/render/primitives/EdgeParams.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAgD,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAiB,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAsB,MAAM,kBAAkB,CAAC;AAG1E;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,sBAAsB,EAAE,UAAU,CAAC;CAC7C;AAiED;;;;;GAKG;AACH,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,8CA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CAAC,EAAE,iBAAiB,CAAC;CACtC;AAED,gBAAgB;AAChB,yBAAiB,UAAU,CAAC;IAC1B,SAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CA8B1F;CACF"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module Rendering
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.EdgeParams = void 0;
|
|
10
|
+
exports.EdgeParams = exports.calculateEdgeTableParams = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const VertexTable_1 = require("./VertexTable");
|
|
13
13
|
const PolylineParams_1 = require("./PolylineParams");
|
|
@@ -86,35 +86,17 @@ function convertSilhouettes(edges, normalPairs) {
|
|
|
86
86
|
normalPairs: normalPairBytes,
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
var _a, _b, _c, _d, _e;
|
|
91
|
-
const hardEdges = (_a = args.edges) === null || _a === void 0 ? void 0 : _a.edges;
|
|
92
|
-
const silhouettes = args.silhouettes;
|
|
93
|
-
const polylines = doPolylines ? (_b = args.polylines) === null || _b === void 0 ? void 0 : _b.lines : undefined;
|
|
94
|
-
const numHardEdges = (_c = hardEdges === null || hardEdges === void 0 ? void 0 : hardEdges.length) !== null && _c !== void 0 ? _c : 0;
|
|
95
|
-
const numSilhouettes = (_e = (_d = silhouettes === null || silhouettes === void 0 ? void 0 : silhouettes.edges) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0;
|
|
96
|
-
const numPolylines = polylines ? polylines.reduce((count, pd) => count + Math.max(0, pd.vertIndices.length - 1), 0) : 0;
|
|
97
|
-
const numSegmentEdges = numHardEdges + numPolylines;
|
|
98
|
-
const numTotalEdges = numSegmentEdges + numSilhouettes;
|
|
99
|
-
if (numTotalEdges === 0)
|
|
100
|
-
return undefined;
|
|
101
|
-
// Each edge is a quad consisting of six vertices. Each vertex is an identical 24-bit index into the lookup table.
|
|
102
|
-
const indices = new VertexTable_1.VertexIndices(new Uint8Array(numTotalEdges * 6 * 3));
|
|
103
|
-
for (let i = 0; i < numTotalEdges; i++)
|
|
104
|
-
for (let j = 0; j < 6; j++)
|
|
105
|
-
indices.setNthIndex(i * 6 + j, i);
|
|
89
|
+
function calculateEdgeTableParams(numSegmentEdges, numSilhouettes, maxSize) {
|
|
106
90
|
// Each segment edge requires 2 24-bit indices = 6 bytes = 1.5 RGBA values.
|
|
107
91
|
// Each silhouette requires the same as segment edge plus 2 16-bit oct-encoded normals = 10 bytes = 2.5 RGBA values.
|
|
108
92
|
let nRgbaRequired = Math.ceil(1.5 * numSegmentEdges + 2.5 * numSilhouettes);
|
|
109
|
-
let dimensions;
|
|
110
93
|
const silhouetteStartByteIndex = numSegmentEdges * 6;
|
|
111
94
|
let silhouettePadding = 0;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
else {
|
|
95
|
+
let width = nRgbaRequired;
|
|
96
|
+
let height = 1;
|
|
97
|
+
if (nRgbaRequired >= maxSize) {
|
|
116
98
|
// Make roughly square to reduce unused space in last row.
|
|
117
|
-
|
|
99
|
+
width = Math.ceil(Math.sqrt(nRgbaRequired));
|
|
118
100
|
// Each entry's data must fit on the same row. 15 RGBA = 60 bytes = lowest common multiple of 6, 10, and 4.
|
|
119
101
|
const remainder = width % 15;
|
|
120
102
|
if (0 !== remainder)
|
|
@@ -126,12 +108,37 @@ function buildIndexedEdges(args, doPolylines, maxSize) {
|
|
|
126
108
|
silhouettePadding = (60 - silOffset) % 10;
|
|
127
109
|
nRgbaRequired += Math.ceil(silhouettePadding / 4);
|
|
128
110
|
}
|
|
129
|
-
|
|
111
|
+
height = Math.ceil(nRgbaRequired / width);
|
|
130
112
|
if (width * height < nRgbaRequired)
|
|
131
113
|
height++;
|
|
132
|
-
dimensions = { width, height };
|
|
133
114
|
}
|
|
134
|
-
|
|
115
|
+
return {
|
|
116
|
+
width,
|
|
117
|
+
height,
|
|
118
|
+
silhouettePadding,
|
|
119
|
+
silhouetteStartByteIndex,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
exports.calculateEdgeTableParams = calculateEdgeTableParams;
|
|
123
|
+
function buildIndexedEdges(args, doPolylines, maxSize) {
|
|
124
|
+
var _a, _b, _c, _d, _e;
|
|
125
|
+
const hardEdges = (_a = args.edges) === null || _a === void 0 ? void 0 : _a.edges;
|
|
126
|
+
const silhouettes = args.silhouettes;
|
|
127
|
+
const polylines = doPolylines ? (_b = args.polylines) === null || _b === void 0 ? void 0 : _b.lines : undefined;
|
|
128
|
+
const numHardEdges = (_c = hardEdges === null || hardEdges === void 0 ? void 0 : hardEdges.length) !== null && _c !== void 0 ? _c : 0;
|
|
129
|
+
const numSilhouettes = (_e = (_d = silhouettes === null || silhouettes === void 0 ? void 0 : silhouettes.edges) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0;
|
|
130
|
+
const numPolylines = polylines ? polylines.reduce((count, pd) => count + Math.max(0, pd.vertIndices.length - 1), 0) : 0;
|
|
131
|
+
const numSegmentEdges = numHardEdges + numPolylines;
|
|
132
|
+
const numTotalEdges = numSegmentEdges + numSilhouettes;
|
|
133
|
+
if (numTotalEdges === 0)
|
|
134
|
+
return undefined;
|
|
135
|
+
// Each edge is a quad consisting of six vertices. Each vertex is an identical 24-bit index into the lookup table.
|
|
136
|
+
const indices = new VertexTable_1.VertexIndices(new Uint8Array(numTotalEdges * 6 * 3));
|
|
137
|
+
for (let i = 0; i < numTotalEdges; i++)
|
|
138
|
+
for (let j = 0; j < 6; j++)
|
|
139
|
+
indices.setNthIndex(i * 6 + j, i);
|
|
140
|
+
const { width, height, silhouettePadding, silhouetteStartByteIndex } = calculateEdgeTableParams(numSegmentEdges, numSilhouettes, maxSize);
|
|
141
|
+
const data = new Uint8Array(width * height * 4);
|
|
135
142
|
function setUint24(byteIndex, value) {
|
|
136
143
|
data[byteIndex + 0] = value & 0x0000ff;
|
|
137
144
|
data[byteIndex + 1] = (value & 0x00ff00) >>> 8;
|
|
@@ -180,8 +187,8 @@ function buildIndexedEdges(args, doPolylines, maxSize) {
|
|
|
180
187
|
indices,
|
|
181
188
|
edges: {
|
|
182
189
|
data,
|
|
183
|
-
width
|
|
184
|
-
height
|
|
190
|
+
width,
|
|
191
|
+
height,
|
|
185
192
|
numSegments: numSegmentEdges,
|
|
186
193
|
silhouettePadding,
|
|
187
194
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EdgeParams.js","sourceRoot":"","sources":["../../../../src/render/primitives/EdgeParams.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAG7C,+CAA8C;AAC9C,qDAA0E;AAC1E,+CAA4C;AAmB5C,SAAS,wBAAwB,CAAC,SAA0B,EAAE,KAAkB;IAC9E,IAAI,UAAU,GAAG,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,IAAI,SAAS,KAAK,SAAS;QACzB,KAAK,MAAM,EAAE,IAAI,SAAS;YACxB,UAAU,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAE9C,IAAI,CAAC,KAAK,UAAU;QAClB,OAAO,SAAS,CAAC;IAEnB,UAAU,IAAI,CAAC,CAAC;IAChB,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IAClD,MAAM,yBAAyB,GAAG,IAAI,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IAEjE,IAAI,GAAG,GAAW,CAAC,CAAC;IACpB,IAAI,IAAI,GAAW,CAAC,CAAC;IAErB,MAAM,QAAQ,GAAG,CAAC,EAAU,EAAE,EAAU,EAAE,SAAiB,EAAE,EAAE;Q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AAI,qBAAS,CAAC,SAAS,CAAC,kBAAkB,EAAE;YAC1C,OAAO,GAAG,iBAAiB,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,qBAAS,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;SACjG;aAAM;YACL,QAAQ,GAAG,wBAAwB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACjE,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;SACrJ;QAED,IAAI,CAAC,QAAQ,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO;YACrD,OAAO,SAAS,CAAC;QAEnB,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,KAAK;YAClB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,QAAQ;YACR,WAAW;YACX,SAAS;YACT,OAAO;SACR,CAAC;IACJ,CAAC;IA9Be,uBAAY,eA8B3B,CAAA;AACH,CAAC,EAhCgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAgC1B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { LinePixels, MeshEdge, OctEncodedNormalPair, PolylineData } from \"@itwin/core-common\";\r\nimport { MeshArgs, MeshArgsEdges } from \"./mesh/MeshPrimitives\";\r\nimport { VertexIndices } from \"./VertexTable\";\r\nimport { TesselatedPolyline, wantJointTriangles } from \"./PolylineParams\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\n\r\n/**\r\n * Describes a set of line segments representing edges of a mesh.\r\n * Each segment is expanded into a quad defined by two triangles.\r\n * The positions are adjusted in the shader to account for the edge width.\r\n * @internal\r\n */\r\nexport interface SegmentEdgeParams {\r\n /** The 24-bit indices of the tesselated line segment */\r\n readonly indices: VertexIndices;\r\n /**\r\n * For each 24-bit index, 4 bytes:\r\n * the 24-bit index of the vertex at the other end of the segment, followed by\r\n * an 8-bit 'quad index' in [0..3] indicating which point in the expanded quad the vertex represents.\r\n */\r\n readonly endPointAndQuadIndices: Uint8Array;\r\n}\r\n\r\nfunction convertPolylinesAndEdges(polylines?: PolylineData[], edges?: MeshEdge[]): SegmentEdgeParams | undefined {\r\n let numIndices = undefined !== edges ? edges.length : 0;\r\n if (undefined !== polylines)\r\n for (const pd of polylines)\r\n numIndices += (pd.vertIndices.length - 1);\r\n\r\n if (0 === numIndices)\r\n return undefined;\r\n\r\n numIndices *= 6;\r\n const indexBytes = new Uint8Array(numIndices * 3);\r\n const endPointAndQuadIndexBytes = new Uint8Array(numIndices * 4);\r\n\r\n let ndx: number = 0;\r\n let ndx2: number = 0;\r\n\r\n const addPoint = (p0: number, p1: number, quadIndex: number) => {\r\n VertexIndices.encodeIndex(p0, indexBytes, ndx);\r\n ndx += 3;\r\n VertexIndices.encodeIndex(p1, endPointAndQuadIndexBytes, ndx2);\r\n endPointAndQuadIndexBytes[ndx2 + 3] = quadIndex;\r\n ndx2 += 4;\r\n };\r\n\r\n if (undefined !== polylines) {\r\n for (const pd of polylines) {\r\n const num = pd.vertIndices.length - 1;\r\n for (let i = 0; i < num; ++i) {\r\n let p0 = pd.vertIndices[i];\r\n let p1 = pd.vertIndices[i + 1];\r\n if (p1 < p0) { // swap so that lower index is first.\r\n p0 = p1;\r\n p1 = pd.vertIndices[i];\r\n }\r\n addPoint(p0, p1, 0);\r\n addPoint(p1, p0, 2);\r\n addPoint(p0, p1, 1);\r\n addPoint(p0, p1, 1);\r\n addPoint(p1, p0, 2);\r\n addPoint(p1, p0, 3);\r\n }\r\n }\r\n }\r\n\r\n if (undefined !== edges) {\r\n for (const meshEdge of edges) {\r\n const p0 = meshEdge.indices[0];\r\n const p1 = meshEdge.indices[1];\r\n addPoint(p0, p1, 0);\r\n addPoint(p1, p0, 2);\r\n addPoint(p0, p1, 1);\r\n addPoint(p0, p1, 1);\r\n addPoint(p1, p0, 2);\r\n addPoint(p1, p0, 3);\r\n }\r\n }\r\n\r\n return {\r\n indices: new VertexIndices(indexBytes),\r\n endPointAndQuadIndices: endPointAndQuadIndexBytes,\r\n };\r\n}\r\n\r\n/**\r\n * A set of line segments representing edges of curved portions of a mesh.\r\n * Each vertex is augmented with a pair of oct-encoded normals used in the shader\r\n * to determine whether or not the edge should be displayed.\r\n * @internal\r\n */\r\nexport interface SilhouetteParams extends SegmentEdgeParams {\r\n /** Per index, 2 16-bit oct-encoded normals */\r\n readonly normalPairs: Uint8Array;\r\n}\r\n\r\nfunction convertSilhouettes(edges: MeshEdge[], normalPairs: OctEncodedNormalPair[]): SilhouetteParams | undefined {\r\n const base = convertPolylinesAndEdges(undefined, edges);\r\n if (undefined === base)\r\n return undefined;\r\n\r\n const normalPairBytes = new Uint8Array(normalPairs.length * 6 * 4);\r\n const normalPair16 = new Uint16Array(normalPairBytes.buffer);\r\n\r\n let ndx = 0;\r\n for (const pair of normalPairs) {\r\n for (let i = 0; i < 6; i++) {\r\n normalPair16[ndx++] = pair.first.value;\r\n normalPair16[ndx++] = pair.second.value;\r\n }\r\n }\r\n\r\n return {\r\n indices: base.indices,\r\n endPointAndQuadIndices: base.endPointAndQuadIndices,\r\n normalPairs: normalPairBytes,\r\n };\r\n}\r\n\r\n/** A lookup table of edges for a mesh. The table is partitioned such that the lower partition contains simple segment edges\r\n * and the upper partition contains silhouette edges. Each entry in the lower partition consists of 2 24-bit indices into\r\n * a [[VertexTable]] from which to obtain the endpoints of the edge. Each entry in the upper partition consists of 2 24-bit\r\n * vertex indices followed by two 16-bit [[OctEncodedNormal]]s.\r\n * If both partitions exist then one row may exist between them containing a mix of segments and silhouettes; in this case a handful\r\n * of padding bytes may exist between the last segment and the first silhouette.\r\n * @see [[IndexedEdgeParams.edges]].\r\n * @internal\r\n */\r\nexport interface EdgeTable {\r\n /** The rectangular lookup table. */\r\n readonly data: Uint8Array;\r\n /** Width of the table. */\r\n readonly width: number;\r\n /** Height of the table. */\r\n readonly height: number;\r\n /** The number of segments in the lower partition. */\r\n readonly numSegments: number;\r\n /** The number of padding bytes inserted between the partitions to preserve alignment of data. */\r\n readonly silhouettePadding: number;\r\n}\r\n\r\n/** Describes the edges of a surface as a lookup table. Each edge consists of six identical indices into the lookup table, forming a quad.\r\n * @see [[EdgeParams.indexed]].\r\n * @internal\r\n */\r\nexport interface IndexedEdgeParams {\r\n /** The indices into [[edges]]. */\r\n readonly indices: VertexIndices;\r\n /** The lookup table indexed by [[indices]]. */\r\n readonly edges: EdgeTable;\r\n}\r\n\r\nfunction buildIndexedEdges(args: MeshArgsEdges, doPolylines: boolean, maxSize: number): IndexedEdgeParams | undefined {\r\n const hardEdges = args.edges?.edges;\r\n const silhouettes = args.silhouettes;\r\n const polylines = doPolylines ? args.polylines?.lines : undefined;\r\n\r\n const numHardEdges = hardEdges?.length ?? 0;\r\n const numSilhouettes = silhouettes?.edges?.length ?? 0;\r\n const numPolylines = polylines ? polylines.reduce((count: number, pd: PolylineData) => count + Math.max(0, pd.vertIndices.length - 1), 0) : 0;\r\n const numSegmentEdges = numHardEdges + numPolylines;\r\n const numTotalEdges = numSegmentEdges + numSilhouettes;\r\n if (numTotalEdges === 0)\r\n return undefined;\r\n\r\n // Each edge is a quad consisting of six vertices. Each vertex is an identical 24-bit index into the lookup table.\r\n const indices = new VertexIndices(new Uint8Array(numTotalEdges * 6 * 3));\r\n for (let i = 0; i < numTotalEdges; i++)\r\n for (let j = 0; j < 6; j++)\r\n indices.setNthIndex(i * 6 + j, i);\r\n\r\n // Each segment edge requires 2 24-bit indices = 6 bytes = 1.5 RGBA values.\r\n // Each silhouette requires the same as segment edge plus 2 16-bit oct-encoded normals = 10 bytes = 2.5 RGBA values.\r\n let nRgbaRequired = Math.ceil(1.5 * numSegmentEdges + 2.5 * numSilhouettes);\r\n let dimensions;\r\n const silhouetteStartByteIndex = numSegmentEdges * 6;\r\n let silhouettePadding = 0;\r\n if (nRgbaRequired < maxSize) {\r\n dimensions = { width: nRgbaRequired, height: 1 };\r\n } else {\r\n // Make roughly square to reduce unused space in last row.\r\n let width = Math.ceil(Math.sqrt(nRgbaRequired));\r\n // Each entry's data must fit on the same row. 15 RGBA = 60 bytes = lowest common multiple of 6, 10, and 4.\r\n const remainder = width % 15;\r\n if (0 !== remainder)\r\n width += 15 - remainder;\r\n\r\n // If the table contains both segments and silhouettes, there may be one row containing a mix of the two where padding\r\n // is required between them.\r\n if (numSilhouettes > 0 && numSegmentEdges > 0) {\r\n const silOffset = silhouetteStartByteIndex % 60; // some multiple of 6.\r\n silhouettePadding = (60 - silOffset) % 10;\r\n nRgbaRequired += Math.ceil(silhouettePadding / 4);\r\n }\r\n\r\n let height = Math.ceil(nRgbaRequired / width);\r\n if (width * height < nRgbaRequired)\r\n height++;\r\n\r\n dimensions = { width, height };\r\n }\r\n\r\n const data = new Uint8Array(dimensions.width * dimensions.height * 4);\r\n function setUint24(byteIndex: number, value: number): void {\r\n data[byteIndex + 0] = value & 0x0000ff;\r\n data[byteIndex + 1] = (value & 0x00ff00) >>> 8;\r\n data[byteIndex + 2] = (value & 0xff0000) >>> 16;\r\n }\r\n\r\n function setEdge(index: number, startPointIndex: number, endPointIndex: number): void {\r\n const byteIndex = index * 6;\r\n setUint24(byteIndex, startPointIndex);\r\n setUint24(byteIndex + 3, endPointIndex);\r\n }\r\n\r\n let curIndex = 0;\r\n if (hardEdges)\r\n for (const edge of hardEdges)\r\n setEdge(curIndex++, edge.indices[0], edge.indices[1]);\r\n\r\n if (polylines) {\r\n for (const pd of polylines) {\r\n const num = pd.vertIndices.length - 1;\r\n for (let i = 0; i < num; i++) {\r\n const p0 = pd.vertIndices[i];\r\n const p1 = pd.vertIndices[i + 1];\r\n // Ensure lower index is first.\r\n if (p0 < p1)\r\n setEdge(curIndex++, p0, p1);\r\n else\r\n setEdge(curIndex++, p1, p0);\r\n }\r\n }\r\n }\r\n\r\n if (silhouettes?.edges) {\r\n assert(undefined !== silhouettes.normals);\r\n assert(silhouettes.normals.length === silhouettes.edges.length);\r\n function setSilhouette(index: number, start: number, end: number, normals: OctEncodedNormalPair): void {\r\n const byteIndex = silhouetteStartByteIndex + silhouettePadding + index * 10;\r\n setUint24(byteIndex, start);\r\n setUint24(byteIndex + 3, end);\r\n data[byteIndex + 6] = normals.first.value & 0xff;\r\n data[byteIndex + 7] = (normals.first.value & 0xff00) >>> 8;\r\n data[byteIndex + 8] = normals.second.value & 0xff;\r\n data[byteIndex + 9] = (normals.second.value & 0xff00) >>> 8;\r\n }\r\n\r\n curIndex = 0;\r\n for (let i = 0; i < silhouettes.edges.length; i++)\r\n setSilhouette(curIndex++, silhouettes.edges[i].indices[0], silhouettes.edges[i].indices[1], silhouettes.normals[i]);\r\n }\r\n\r\n return {\r\n indices,\r\n edges: {\r\n data,\r\n width: dimensions.width,\r\n height: dimensions.height,\r\n numSegments: numSegmentEdges,\r\n silhouettePadding,\r\n },\r\n };\r\n}\r\n\r\n/** Describes the edges of a mesh. */\r\nexport interface EdgeParams {\r\n /** The edge width in pixels. */\r\n readonly weight: number;\r\n /** The line pattern in which edges are drawn. */\r\n readonly linePixels: LinePixels;\r\n /** Simple single-segment edges, always displayed when edge display is enabled. */\r\n readonly segments?: SegmentEdgeParams;\r\n /** Single-segment edges of curved surfaces, displayed based on edge normal relative to eye. */\r\n readonly silhouettes?: SilhouetteParams;\r\n /** Polyline edges, always displayed when edge display is enabled. */\r\n readonly polylines?: TesselatedPolyline;\r\n /** Silhouettes and simple-segment edges, compactly represented as indices into a lookup table. */\r\n readonly indexed?: IndexedEdgeParams;\r\n}\r\n\r\n/** @internal */\r\nexport namespace EdgeParams {\r\n export function fromMeshArgs(meshArgs: MeshArgs, maxWidth?: number): EdgeParams | undefined {\r\n const args = meshArgs.edges;\r\n if (!args)\r\n return undefined;\r\n\r\n const doJoints = wantJointTriangles(args.width, true === meshArgs.is2d);\r\n const polylines = doJoints ? TesselatedPolyline.fromMesh(meshArgs) : undefined;\r\n\r\n let segments: SegmentEdgeParams | undefined;\r\n let silhouettes: SilhouetteParams | undefined;\r\n let indexed: IndexedEdgeParams | undefined;\r\n\r\n if (IModelApp.tileAdmin.enableIndexedEdges) {\r\n indexed = buildIndexedEdges(args, !doJoints, maxWidth ?? IModelApp.renderSystem.maxTextureSize);\r\n } else {\r\n segments = convertPolylinesAndEdges(undefined, args.edges.edges);\r\n silhouettes = args.silhouettes.edges && args.silhouettes.normals ? convertSilhouettes(args.silhouettes.edges, args.silhouettes.normals) : undefined;\r\n }\r\n\r\n if (!segments && !silhouettes && !polylines && !indexed)\r\n return undefined;\r\n\r\n return {\r\n weight: args.width,\r\n linePixels: args.linePixels,\r\n segments,\r\n silhouettes,\r\n polylines,\r\n indexed,\r\n };\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"EdgeParams.js","sourceRoot":"","sources":["../../../../src/render/primitives/EdgeParams.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAG7C,+CAA8C;AAC9C,qDAA0E;AAC1E,+CAA4C;AAmB5C,SAAS,wBAAwB,CAAC,SAA0B,EAAE,KAAkB;IAC9E,IAAI,UAAU,GAAG,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,IAAI,SAAS,KAAK,SAAS;QACzB,KAAK,MAAM,EAAE,IAAI,SAAS;YACxB,UAAU,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IA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AS;YACT,OAAO;SACR,CAAC;IACJ,CAAC;IA9Be,uBAAY,eA8B3B,CAAA;AACH,CAAC,EAhCgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAgC1B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { LinePixels, MeshEdge, OctEncodedNormalPair, PolylineData } from \"@itwin/core-common\";\r\nimport { MeshArgs, MeshArgsEdges } from \"./mesh/MeshPrimitives\";\r\nimport { VertexIndices } from \"./VertexTable\";\r\nimport { TesselatedPolyline, wantJointTriangles } from \"./PolylineParams\";\r\nimport { IModelApp } from \"../../IModelApp\";\r\n\r\n/**\r\n * Describes a set of line segments representing edges of a mesh.\r\n * Each segment is expanded into a quad defined by two triangles.\r\n * The positions are adjusted in the shader to account for the edge width.\r\n * @internal\r\n */\r\nexport interface SegmentEdgeParams {\r\n /** The 24-bit indices of the tesselated line segment */\r\n readonly indices: VertexIndices;\r\n /**\r\n * For each 24-bit index, 4 bytes:\r\n * the 24-bit index of the vertex at the other end of the segment, followed by\r\n * an 8-bit 'quad index' in [0..3] indicating which point in the expanded quad the vertex represents.\r\n */\r\n readonly endPointAndQuadIndices: Uint8Array;\r\n}\r\n\r\nfunction convertPolylinesAndEdges(polylines?: PolylineData[], edges?: MeshEdge[]): SegmentEdgeParams | undefined {\r\n let numIndices = undefined !== edges ? edges.length : 0;\r\n if (undefined !== polylines)\r\n for (const pd of polylines)\r\n numIndices += (pd.vertIndices.length - 1);\r\n\r\n if (0 === numIndices)\r\n return undefined;\r\n\r\n numIndices *= 6;\r\n const indexBytes = new Uint8Array(numIndices * 3);\r\n const endPointAndQuadIndexBytes = new Uint8Array(numIndices * 4);\r\n\r\n let ndx: number = 0;\r\n let ndx2: number = 0;\r\n\r\n const addPoint = (p0: number, p1: number, quadIndex: number) => {\r\n VertexIndices.encodeIndex(p0, indexBytes, ndx);\r\n ndx += 3;\r\n VertexIndices.encodeIndex(p1, endPointAndQuadIndexBytes, ndx2);\r\n endPointAndQuadIndexBytes[ndx2 + 3] = quadIndex;\r\n ndx2 += 4;\r\n };\r\n\r\n if (undefined !== polylines) {\r\n for (const pd of polylines) {\r\n const num = pd.vertIndices.length - 1;\r\n for (let i = 0; i < num; ++i) {\r\n let p0 = pd.vertIndices[i];\r\n let p1 = pd.vertIndices[i + 1];\r\n if (p1 < p0) { // swap so that lower index is first.\r\n p0 = p1;\r\n p1 = pd.vertIndices[i];\r\n }\r\n addPoint(p0, p1, 0);\r\n addPoint(p1, p0, 2);\r\n addPoint(p0, p1, 1);\r\n addPoint(p0, p1, 1);\r\n addPoint(p1, p0, 2);\r\n addPoint(p1, p0, 3);\r\n }\r\n }\r\n }\r\n\r\n if (undefined !== edges) {\r\n for (const meshEdge of edges) {\r\n const p0 = meshEdge.indices[0];\r\n const p1 = meshEdge.indices[1];\r\n addPoint(p0, p1, 0);\r\n addPoint(p1, p0, 2);\r\n addPoint(p0, p1, 1);\r\n addPoint(p0, p1, 1);\r\n addPoint(p1, p0, 2);\r\n addPoint(p1, p0, 3);\r\n }\r\n }\r\n\r\n return {\r\n indices: new VertexIndices(indexBytes),\r\n endPointAndQuadIndices: endPointAndQuadIndexBytes,\r\n };\r\n}\r\n\r\n/**\r\n * A set of line segments representing edges of curved portions of a mesh.\r\n * Each vertex is augmented with a pair of oct-encoded normals used in the shader\r\n * to determine whether or not the edge should be displayed.\r\n * @internal\r\n */\r\nexport interface SilhouetteParams extends SegmentEdgeParams {\r\n /** Per index, 2 16-bit oct-encoded normals */\r\n readonly normalPairs: Uint8Array;\r\n}\r\n\r\nfunction convertSilhouettes(edges: MeshEdge[], normalPairs: OctEncodedNormalPair[]): SilhouetteParams | undefined {\r\n const base = convertPolylinesAndEdges(undefined, edges);\r\n if (undefined === base)\r\n return undefined;\r\n\r\n const normalPairBytes = new Uint8Array(normalPairs.length * 6 * 4);\r\n const normalPair16 = new Uint16Array(normalPairBytes.buffer);\r\n\r\n let ndx = 0;\r\n for (const pair of normalPairs) {\r\n for (let i = 0; i < 6; i++) {\r\n normalPair16[ndx++] = pair.first.value;\r\n normalPair16[ndx++] = pair.second.value;\r\n }\r\n }\r\n\r\n return {\r\n indices: base.indices,\r\n endPointAndQuadIndices: base.endPointAndQuadIndices,\r\n normalPairs: normalPairBytes,\r\n };\r\n}\r\n\r\n/** A lookup table of edges for a mesh. The table is partitioned such that the lower partition contains simple segment edges\r\n * and the upper partition contains silhouette edges. Each entry in the lower partition consists of 2 24-bit indices into\r\n * a [[VertexTable]] from which to obtain the endpoints of the edge. Each entry in the upper partition consists of 2 24-bit\r\n * vertex indices followed by two 16-bit [[OctEncodedNormal]]s.\r\n * If both partitions exist then one row may exist between them containing a mix of segments and silhouettes; in this case a handful\r\n * of padding bytes may exist between the last segment and the first silhouette.\r\n * @see [[IndexedEdgeParams.edges]].\r\n * @internal\r\n */\r\nexport interface EdgeTable {\r\n /** The rectangular lookup table. */\r\n readonly data: Uint8Array;\r\n /** Width of the table. */\r\n readonly width: number;\r\n /** Height of the table. */\r\n readonly height: number;\r\n /** The number of segments in the lower partition. */\r\n readonly numSegments: number;\r\n /** The number of padding bytes inserted between the partitions to preserve alignment of data. */\r\n readonly silhouettePadding: number;\r\n}\r\n\r\n/** Describes the edges of a surface as a lookup table. Each edge consists of six identical indices into the lookup table, forming a quad.\r\n * @see [[EdgeParams.indexed]].\r\n * @internal\r\n */\r\nexport interface IndexedEdgeParams {\r\n /** The indices into [[edges]]. */\r\n readonly indices: VertexIndices;\r\n /** The lookup table indexed by [[indices]]. */\r\n readonly edges: EdgeTable;\r\n}\r\n\r\nexport interface EdgeTableInfo {\r\n /** Width of the table. */\r\n readonly width: number;\r\n /** Height of the table. */\r\n readonly height: number;\r\n /** The number of segments in the lower partition. */\r\n readonly silhouettePadding: number;\r\n /** The starting byte index of silhouettes */\r\n readonly silhouetteStartByteIndex: number;\r\n}\r\n\r\nexport function calculateEdgeTableParams(numSegmentEdges: number, numSilhouettes: number, maxSize: number): EdgeTableInfo {\r\n // Each segment edge requires 2 24-bit indices = 6 bytes = 1.5 RGBA values.\r\n // Each silhouette requires the same as segment edge plus 2 16-bit oct-encoded normals = 10 bytes = 2.5 RGBA values.\r\n let nRgbaRequired = Math.ceil(1.5 * numSegmentEdges + 2.5 * numSilhouettes);\r\n const silhouetteStartByteIndex = numSegmentEdges * 6;\r\n let silhouettePadding = 0;\r\n let width = nRgbaRequired;\r\n let height = 1;\r\n if (nRgbaRequired >= maxSize) {\r\n // Make roughly square to reduce unused space in last row.\r\n width = Math.ceil(Math.sqrt(nRgbaRequired));\r\n // Each entry's data must fit on the same row. 15 RGBA = 60 bytes = lowest common multiple of 6, 10, and 4.\r\n const remainder = width % 15;\r\n if (0 !== remainder)\r\n width += 15 - remainder;\r\n\r\n // If the table contains both segments and silhouettes, there may be one row containing a mix of the two where padding\r\n // is required between them.\r\n if (numSilhouettes > 0 && numSegmentEdges > 0) {\r\n const silOffset = silhouetteStartByteIndex % 60; // some multiple of 6.\r\n silhouettePadding = (60 - silOffset) % 10;\r\n nRgbaRequired += Math.ceil(silhouettePadding / 4);\r\n }\r\n\r\n height = Math.ceil(nRgbaRequired / width);\r\n if (width * height < nRgbaRequired)\r\n height++;\r\n }\r\n\r\n return {\r\n width,\r\n height,\r\n silhouettePadding,\r\n silhouetteStartByteIndex,\r\n };\r\n}\r\n\r\nfunction buildIndexedEdges(args: MeshArgsEdges, doPolylines: boolean, maxSize: number): IndexedEdgeParams | undefined {\r\n const hardEdges = args.edges?.edges;\r\n const silhouettes = args.silhouettes;\r\n const polylines = doPolylines ? args.polylines?.lines : undefined;\r\n\r\n const numHardEdges = hardEdges?.length ?? 0;\r\n const numSilhouettes = silhouettes?.edges?.length ?? 0;\r\n const numPolylines = polylines ? polylines.reduce((count: number, pd: PolylineData) => count + Math.max(0, pd.vertIndices.length - 1), 0) : 0;\r\n const numSegmentEdges = numHardEdges + numPolylines;\r\n const numTotalEdges = numSegmentEdges + numSilhouettes;\r\n if (numTotalEdges === 0)\r\n return undefined;\r\n\r\n // Each edge is a quad consisting of six vertices. Each vertex is an identical 24-bit index into the lookup table.\r\n const indices = new VertexIndices(new Uint8Array(numTotalEdges * 6 * 3));\r\n for (let i = 0; i < numTotalEdges; i++)\r\n for (let j = 0; j < 6; j++)\r\n indices.setNthIndex(i * 6 + j, i);\r\n\r\n const {width, height, silhouettePadding, silhouetteStartByteIndex } = calculateEdgeTableParams (numSegmentEdges, numSilhouettes, maxSize);\r\n\r\n const data = new Uint8Array(width * height * 4);\r\n function setUint24(byteIndex: number, value: number): void {\r\n data[byteIndex + 0] = value & 0x0000ff;\r\n data[byteIndex + 1] = (value & 0x00ff00) >>> 8;\r\n data[byteIndex + 2] = (value & 0xff0000) >>> 16;\r\n }\r\n\r\n function setEdge(index: number, startPointIndex: number, endPointIndex: number): void {\r\n const byteIndex = index * 6;\r\n setUint24(byteIndex, startPointIndex);\r\n setUint24(byteIndex + 3, endPointIndex);\r\n }\r\n\r\n let curIndex = 0;\r\n if (hardEdges)\r\n for (const edge of hardEdges)\r\n setEdge(curIndex++, edge.indices[0], edge.indices[1]);\r\n\r\n if (polylines) {\r\n for (const pd of polylines) {\r\n const num = pd.vertIndices.length - 1;\r\n for (let i = 0; i < num; i++) {\r\n const p0 = pd.vertIndices[i];\r\n const p1 = pd.vertIndices[i + 1];\r\n // Ensure lower index is first.\r\n if (p0 < p1)\r\n setEdge(curIndex++, p0, p1);\r\n else\r\n setEdge(curIndex++, p1, p0);\r\n }\r\n }\r\n }\r\n\r\n if (silhouettes?.edges) {\r\n assert(undefined !== silhouettes.normals);\r\n assert(silhouettes.normals.length === silhouettes.edges.length);\r\n function setSilhouette(index: number, start: number, end: number, normals: OctEncodedNormalPair): void {\r\n const byteIndex = silhouetteStartByteIndex + silhouettePadding + index * 10;\r\n setUint24(byteIndex, start);\r\n setUint24(byteIndex + 3, end);\r\n data[byteIndex + 6] = normals.first.value & 0xff;\r\n data[byteIndex + 7] = (normals.first.value & 0xff00) >>> 8;\r\n data[byteIndex + 8] = normals.second.value & 0xff;\r\n data[byteIndex + 9] = (normals.second.value & 0xff00) >>> 8;\r\n }\r\n\r\n curIndex = 0;\r\n for (let i = 0; i < silhouettes.edges.length; i++)\r\n setSilhouette(curIndex++, silhouettes.edges[i].indices[0], silhouettes.edges[i].indices[1], silhouettes.normals[i]);\r\n }\r\n\r\n return {\r\n indices,\r\n edges: {\r\n data,\r\n width,\r\n height,\r\n numSegments: numSegmentEdges,\r\n silhouettePadding,\r\n },\r\n };\r\n}\r\n\r\n/** Describes the edges of a mesh. */\r\nexport interface EdgeParams {\r\n /** The edge width in pixels. */\r\n readonly weight: number;\r\n /** The line pattern in which edges are drawn. */\r\n readonly linePixels: LinePixels;\r\n /** Simple single-segment edges, always displayed when edge display is enabled. */\r\n readonly segments?: SegmentEdgeParams;\r\n /** Single-segment edges of curved surfaces, displayed based on edge normal relative to eye. */\r\n readonly silhouettes?: SilhouetteParams;\r\n /** Polyline edges, always displayed when edge display is enabled. */\r\n readonly polylines?: TesselatedPolyline;\r\n /** Silhouettes and simple-segment edges, compactly represented as indices into a lookup table. */\r\n readonly indexed?: IndexedEdgeParams;\r\n}\r\n\r\n/** @internal */\r\nexport namespace EdgeParams {\r\n export function fromMeshArgs(meshArgs: MeshArgs, maxWidth?: number): EdgeParams | undefined {\r\n const args = meshArgs.edges;\r\n if (!args)\r\n return undefined;\r\n\r\n const doJoints = wantJointTriangles(args.width, true === meshArgs.is2d);\r\n const polylines = doJoints ? TesselatedPolyline.fromMesh(meshArgs) : undefined;\r\n\r\n let segments: SegmentEdgeParams | undefined;\r\n let silhouettes: SilhouetteParams | undefined;\r\n let indexed: IndexedEdgeParams | undefined;\r\n\r\n if (IModelApp.tileAdmin.enableIndexedEdges) {\r\n indexed = buildIndexedEdges(args, !doJoints, maxWidth ?? IModelApp.renderSystem.maxTextureSize);\r\n } else {\r\n segments = convertPolylinesAndEdges(undefined, args.edges.edges);\r\n silhouettes = args.silhouettes.edges && args.silhouettes.normals ? convertSilhouettes(args.silhouettes.edges, args.silhouettes.normals) : undefined;\r\n }\r\n\r\n if (!segments && !silhouettes && !polylines && !indexed)\r\n return undefined;\r\n\r\n return {\r\n weight: args.width,\r\n linePixels: args.linePixels,\r\n segments,\r\n silhouettes,\r\n polylines,\r\n indexed,\r\n };\r\n }\r\n}\r\n"]}
|