@itwin/core-common 5.0.0-dev.4 → 5.0.0-dev.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -1
- package/lib/cjs/AmbientOcclusion.js +9 -9
- package/lib/cjs/AmbientOcclusion.js.map +1 -1
- package/lib/cjs/AnalysisStyle.js +1 -1
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/Atmosphere.js +19 -21
- package/lib/cjs/Atmosphere.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.d.ts +2 -2
- package/lib/cjs/BriefcaseTypes.d.ts.map +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/ClipStyle.js +5 -5
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/ColorDef.js +10 -10
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.d.ts +5 -1
- package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContourDisplay.js +5 -5
- package/lib/cjs/ContourDisplay.js.map +1 -1
- package/lib/cjs/ECSqlReader.d.ts.map +1 -1
- package/lib/cjs/ECSqlReader.js +3 -1
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ElementProps.d.ts.map +1 -1
- package/lib/cjs/ElementProps.js +3 -3
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/Environment.js +2 -2
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureSymbology.js +3 -3
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/Fonts.d.ts +69 -11
- package/lib/cjs/Fonts.d.ts.map +1 -1
- package/lib/cjs/Fonts.js +20 -5
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Gradient.js +9 -9
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GroundPlane.js +2 -2
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/HiddenLine.js +4 -4
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/IModel.d.ts +3 -12
- package/lib/cjs/IModel.d.ts.map +1 -1
- package/lib/cjs/IModel.js +6 -6
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.d.ts +0 -2
- package/lib/cjs/IModelError.d.ts.map +1 -1
- package/lib/cjs/IModelError.js +1 -8
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/ITwinError.d.ts +1 -1
- package/lib/cjs/ITwinError.d.ts.map +1 -1
- package/lib/cjs/ITwinError.js +1 -1
- package/lib/cjs/ITwinError.js.map +1 -1
- package/lib/cjs/LightSettings.js +1 -1
- package/lib/cjs/LightSettings.js.map +1 -1
- package/lib/cjs/PlanarClipMask.js +2 -2
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.js +4 -4
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
- package/lib/cjs/RenderMaterial.js +3 -3
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RpcInterface.js +1 -1
- package/lib/cjs/RpcInterface.js.map +1 -1
- package/lib/cjs/SkyBox.js +4 -4
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/SolarShadows.js +1 -1
- package/lib/cjs/SolarShadows.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js +1 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.js +2 -2
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TextureMapping.js +2 -2
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/ThematicDisplay.js +2 -2
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/ViewDetails.js +2 -2
- package/lib/cjs/ViewDetails.js.map +1 -1
- package/lib/cjs/ViewFlags.js +2 -2
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js +2 -2
- package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/cjs/annotation/TextStyle.js +19 -19
- package/lib/cjs/annotation/TextStyle.js.map +1 -1
- package/lib/cjs/core-common.d.ts +0 -1
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +0 -1
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/geometry/Cartographic.js +13 -13
- package/lib/cjs/geometry/Cartographic.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js +6 -6
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +5 -5
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js +4 -4
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js +4 -4
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js +32 -34
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js +8 -15
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js +3 -5
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.d.ts +0 -3
- package/lib/cjs/rpc/core/RpcMarshaling.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.js +5 -4
- package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js +2 -2
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js +4 -4
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js +5 -5
- package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js +5 -5
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js +2 -2
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js +6 -6
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.d.ts.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js +13 -12
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js +17 -19
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.d.ts +2 -2
- package/lib/cjs/tile/IModelTileIO.js +3 -3
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/AmbientOcclusion.js +9 -9
- package/lib/esm/AmbientOcclusion.js.map +1 -1
- package/lib/esm/AnalysisStyle.js +1 -1
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/Atmosphere.js +19 -21
- package/lib/esm/Atmosphere.js.map +1 -1
- package/lib/esm/BriefcaseTypes.d.ts +2 -2
- package/lib/esm/BriefcaseTypes.d.ts.map +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/ClipStyle.js +5 -5
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/ColorDef.js +10 -10
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/ConcurrentQuery.d.ts +5 -1
- package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContourDisplay.js +5 -5
- package/lib/esm/ContourDisplay.js.map +1 -1
- package/lib/esm/ECSqlReader.d.ts.map +1 -1
- package/lib/esm/ECSqlReader.js +3 -1
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ElementProps.d.ts.map +1 -1
- package/lib/esm/ElementProps.js +4 -4
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/Environment.js +2 -2
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureSymbology.js +3 -3
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/Fonts.d.ts +69 -11
- package/lib/esm/Fonts.d.ts.map +1 -1
- package/lib/esm/Fonts.js +20 -5
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/Gradient.js +9 -9
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GroundPlane.js +2 -2
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/HiddenLine.js +4 -4
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/IModel.d.ts +3 -12
- package/lib/esm/IModel.d.ts.map +1 -1
- package/lib/esm/IModel.js +6 -6
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.d.ts +0 -2
- package/lib/esm/IModelError.d.ts.map +1 -1
- package/lib/esm/IModelError.js +0 -1
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/ITwinError.d.ts +1 -1
- package/lib/esm/ITwinError.d.ts.map +1 -1
- package/lib/esm/ITwinError.js +1 -1
- package/lib/esm/ITwinError.js.map +1 -1
- package/lib/esm/LightSettings.js +1 -1
- package/lib/esm/LightSettings.js.map +1 -1
- package/lib/esm/PlanarClipMask.js +2 -2
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.js +4 -4
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
- package/lib/esm/RenderMaterial.js +3 -3
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RpcInterface.js +2 -2
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/SkyBox.js +4 -4
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/SolarShadows.js +1 -1
- package/lib/esm/SolarShadows.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.js +1 -1
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.js +2 -2
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/TextureMapping.js +2 -2
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/ThematicDisplay.js +2 -2
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/ViewDetails.js +2 -2
- package/lib/esm/ViewDetails.js.map +1 -1
- package/lib/esm/ViewFlags.js +2 -2
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/WhiteOnWhiteReversalSettings.js +2 -2
- package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/esm/annotation/TextStyle.js +19 -19
- package/lib/esm/annotation/TextStyle.js.map +1 -1
- package/lib/esm/core-common.d.ts +0 -1
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +0 -1
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/geometry/Cartographic.js +13 -13
- package/lib/esm/geometry/Cartographic.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js +1 -1
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js +6 -6
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +5 -5
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js +4 -4
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js +4 -4
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js +32 -34
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js +8 -15
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js +3 -5
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcMarshaling.d.ts +0 -3
- package/lib/esm/rpc/core/RpcMarshaling.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcMarshaling.js +2 -1
- package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js +2 -2
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js +4 -4
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js +5 -5
- package/lib/esm/rpc/core/RpcPush.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js +5 -5
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js +2 -2
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js +6 -6
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.d.ts.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.js +14 -13
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js +17 -19
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.d.ts +2 -2
- package/lib/esm/tile/IModelTileIO.js +3 -3
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/package.json +9 -9
- package/lib/cjs/rpc/WipRpcInterface.d.ts +0 -31
- package/lib/cjs/rpc/WipRpcInterface.d.ts.map +0 -1
- package/lib/cjs/rpc/WipRpcInterface.js +0 -42
- package/lib/cjs/rpc/WipRpcInterface.js.map +0 -1
- package/lib/esm/rpc/WipRpcInterface.d.ts +0 -31
- package/lib/esm/rpc/WipRpcInterface.d.ts.map +0 -1
- package/lib/esm/rpc/WipRpcInterface.js +0 -38
- package/lib/esm/rpc/WipRpcInterface.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
# Change Log - @itwin/core-common
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 13 Jan 2025 14:09:29 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.10.4
|
|
6
|
+
Mon, 13 Jan 2025 14:06:43 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 4.10.3
|
|
11
|
+
Mon, 06 Jan 2025 14:00:13 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 4.10.2
|
|
16
|
+
Thu, 21 Nov 2024 15:22:20 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 4.10.1
|
|
21
|
+
Thu, 14 Nov 2024 18:11:00 GMT
|
|
22
|
+
|
|
23
|
+
_Version update only_
|
|
24
|
+
|
|
25
|
+
## 4.10.0
|
|
26
|
+
Wed, 13 Nov 2024 15:23:38 GMT
|
|
27
|
+
|
|
28
|
+
### Updates
|
|
29
|
+
|
|
30
|
+
- Added props for Sheet Index elements
|
|
31
|
+
- fix regression related to classid
|
|
32
|
+
- improve doc for Placement3d.multiplyTransform
|
|
33
|
+
- Deprecate `WipRpcInterface`
|
|
34
|
+
- Add ITwinError interface and namespace
|
|
35
|
+
- Permit FeatureAppearance to independently override line color and transparency.
|
|
36
|
+
- Allow context reality model visibility to be toggled on/off
|
|
37
|
+
- Add ContourDisplay API.
|
|
4
38
|
|
|
5
39
|
## 4.9.7
|
|
6
40
|
Wed, 06 Nov 2024 19:23:04 GMT
|
|
@@ -16,6 +16,14 @@ var AmbientOcclusion;
|
|
|
16
16
|
(function (AmbientOcclusion) {
|
|
17
17
|
/** Describes the properties with which ambient occlusion should be drawn. These properties correspond to a horizon-based ambient occlusion approach. */
|
|
18
18
|
class Settings {
|
|
19
|
+
static { this._defaultBias = 0.25; }
|
|
20
|
+
static { this._defaultZLengthCap = 0.0025; }
|
|
21
|
+
static { this._defaultMaxDistance = 10000.0; }
|
|
22
|
+
static { this._defaultIntensity = 1.0; }
|
|
23
|
+
static { this._defaultTexelStepSize = 1; }
|
|
24
|
+
static { this._defaultBlurDelta = 1.0; }
|
|
25
|
+
static { this._defaultBlurSigma = 2.0; }
|
|
26
|
+
static { this._defaultBlurTexelStepSize = 1.0; }
|
|
19
27
|
constructor(json) {
|
|
20
28
|
if (undefined === json)
|
|
21
29
|
json = {};
|
|
@@ -28,6 +36,7 @@ var AmbientOcclusion;
|
|
|
28
36
|
this.blurSigma = core_bentley_1.JsonUtils.asDouble(json.blurSigma, Settings._defaultBlurSigma);
|
|
29
37
|
this.blurTexelStepSize = core_bentley_1.JsonUtils.asDouble(json.blurTexelStepSize, Settings._defaultBlurTexelStepSize);
|
|
30
38
|
}
|
|
39
|
+
static { this.defaults = new Settings({}); }
|
|
31
40
|
static fromJSON(json) { return undefined !== json ? new Settings(json) : this.defaults; }
|
|
32
41
|
toJSON() {
|
|
33
42
|
return {
|
|
@@ -42,15 +51,6 @@ var AmbientOcclusion;
|
|
|
42
51
|
};
|
|
43
52
|
}
|
|
44
53
|
}
|
|
45
|
-
Settings._defaultBias = 0.25;
|
|
46
|
-
Settings._defaultZLengthCap = 0.0025;
|
|
47
|
-
Settings._defaultMaxDistance = 10000.0;
|
|
48
|
-
Settings._defaultIntensity = 1.0;
|
|
49
|
-
Settings._defaultTexelStepSize = 1;
|
|
50
|
-
Settings._defaultBlurDelta = 1.0;
|
|
51
|
-
Settings._defaultBlurSigma = 2.0;
|
|
52
|
-
Settings._defaultBlurTexelStepSize = 1.0;
|
|
53
|
-
Settings.defaults = new Settings({});
|
|
54
54
|
AmbientOcclusion.Settings = Settings;
|
|
55
55
|
})(AmbientOcclusion || (exports.AmbientOcclusion = AmbientOcclusion = {}));
|
|
56
56
|
//# sourceMappingURL=AmbientOcclusion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmbientOcclusion.js","sourceRoot":"","sources":["../../src/AmbientOcclusion.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgD;AAEhD;;GAEG;AACH,IAAiB,gBAAgB,CAwEhC;AAxED,WAAiB,gBAAgB;IAqB/B,wJAAwJ;IACxJ,MAAa,QAAQ;
|
|
1
|
+
{"version":3,"file":"AmbientOcclusion.js","sourceRoot":"","sources":["../../src/AmbientOcclusion.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgD;AAEhD;;GAEG;AACH,IAAiB,gBAAgB,CAwEhC;AAxED,WAAiB,gBAAgB;IAqB/B,wJAAwJ;IACxJ,MAAa,QAAQ;iBACJ,iBAAY,GAAW,IAAI,CAAC;iBAC5B,uBAAkB,GAAW,MAAM,CAAC;iBACpC,wBAAmB,GAAW,OAAO,CAAC;iBACtC,sBAAiB,GAAW,GAAG,CAAC;iBAChC,0BAAqB,GAAW,CAAC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gB,gCAAhB,gBAAgB,QAwEhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\nimport { JsonUtils } from \"@itwin/core-bentley\";\n\n/** Namespace containing types controlling how ambient occlusion should be drawn.\n * @public\n */\nexport namespace AmbientOcclusion {\n /** Describes the properties with which ambient occlusion should be drawn. These properties correspond to a horizon-based ambient occlusion approach. */\n export interface Props {\n /** If defined, represents an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value, sampling stops in the current direction. This is used to remove shadows from near planar edges. If undefined, the bias defaults to 0.25. */\n readonly bias?: number;\n /** If defined, if the distance in linear depth from the current sample to first sample is greater than this value, sampling stops in the current direction. If undefined, the zLengthCap defaults to 0.0025. The full range of linear depth is 0 to 1. */\n readonly zLengthCap?: number;\n /** If defined, the maximum distance from the camera's near plane in meters at which ambient occlusion will be applied. If undefined, the maximum distance defaults to 10000. */\n readonly maxDistance?: number;\n /** If defined, raise the final ambient occlusion to the power of this value. Larger values make the ambient shadows darker. If undefined, the intensity defaults to 2.0. */\n readonly intensity?: number;\n /** If defined, indicates the texel distance to step toward the next texel sample in the current direction. For portions of geometry close to the near plane, this value will be what is used. As portions of geometry extend away from the near plane, this value will gradually reduce until it reaches a minimum value of 1.0 at the far plane. If undefined, texelStepSize defaults to 1.95. */\n readonly texelStepSize?: number;\n /** If defined, blurDelta is used to compute the weight of a Gaussian filter. The equation is exp((-0.5 * blurDelta * blurDelta) / (blurSigma * blurSigma)). If undefined, blurDelta defaults to 1.0. */\n readonly blurDelta?: number;\n /** If defined, blurSigma is used to compute the weight of a Gaussian filter. The equation is exp((-0.5 * blurDelta * blurDelta) / (blurSigma * blurSigma)). If undefined, blurSigma defaults to 2.0. */\n readonly blurSigma?: number;\n /* If defined, blurTexelStepSize indicates the distance to the next texel for blurring. If undefined, blurTexelStepSize defaults to 1.0. */\n readonly blurTexelStepSize?: number;\n }\n\n /** Describes the properties with which ambient occlusion should be drawn. These properties correspond to a horizon-based ambient occlusion approach. */\n export class Settings implements Props {\n private static _defaultBias: number = 0.25;\n private static _defaultZLengthCap: number = 0.0025;\n private static _defaultMaxDistance: number = 10000.0;\n private static _defaultIntensity: number = 1.0;\n private static _defaultTexelStepSize: number = 1;\n private static _defaultBlurDelta: number = 1.0;\n private static _defaultBlurSigma: number = 2.0;\n private static _defaultBlurTexelStepSize: number = 1.0;\n\n public readonly bias: number;\n public readonly zLengthCap: number;\n public readonly maxDistance: number;\n public readonly intensity: number;\n public readonly texelStepSize: number;\n public readonly blurDelta: number;\n public readonly blurSigma: number;\n public readonly blurTexelStepSize: number;\n\n private constructor(json?: Props) {\n if (undefined === json)\n json = {};\n\n this.bias = JsonUtils.asDouble(json.bias, Settings._defaultBias);\n this.zLengthCap = JsonUtils.asDouble(json.zLengthCap, Settings._defaultZLengthCap);\n this.maxDistance = JsonUtils.asDouble(json.maxDistance, Settings._defaultMaxDistance);\n this.intensity = JsonUtils.asDouble(json.intensity, Settings._defaultIntensity);\n this.texelStepSize = JsonUtils.asDouble(json.texelStepSize, Settings._defaultTexelStepSize);\n this.blurDelta = JsonUtils.asDouble(json.blurDelta, Settings._defaultBlurDelta);\n this.blurSigma = JsonUtils.asDouble(json.blurSigma, Settings._defaultBlurSigma);\n this.blurTexelStepSize = JsonUtils.asDouble(json.blurTexelStepSize, Settings._defaultBlurTexelStepSize);\n }\n\n public static defaults = new Settings({});\n\n public static fromJSON(json?: Props): Settings { return undefined !== json ? new Settings(json) : this.defaults; }\n\n public toJSON(): Props {\n return {\n bias: this.bias !== Settings._defaultBias ? this.bias : undefined,\n zLengthCap: this.zLengthCap !== Settings._defaultZLengthCap ? this.zLengthCap : undefined,\n maxDistance: this.maxDistance !== Settings._defaultMaxDistance ? this.maxDistance : undefined,\n intensity: this.intensity !== Settings._defaultIntensity ? this.intensity : undefined,\n texelStepSize: this.texelStepSize !== Settings._defaultTexelStepSize ? this.texelStepSize : undefined,\n blurDelta: this.blurDelta !== Settings._defaultBlurDelta ? this.blurDelta : undefined,\n blurSigma: this.blurSigma !== Settings._defaultBlurSigma ? this.blurSigma : undefined,\n blurTexelStepSize: this.blurTexelStepSize !== Settings._defaultBlurTexelStepSize ? this.blurTexelStepSize : undefined,\n };\n }\n }\n}\n"]}
|
package/lib/cjs/AnalysisStyle.js
CHANGED
|
@@ -160,7 +160,7 @@ class AnalysisStyle {
|
|
|
160
160
|
return false;
|
|
161
161
|
return undefined === this.thematic || this.thematic.equals(other.thematic);
|
|
162
162
|
}
|
|
163
|
+
static { this.defaults = new AnalysisStyle({}); }
|
|
163
164
|
}
|
|
164
165
|
exports.AnalysisStyle = AnalysisStyle;
|
|
165
|
-
AnalysisStyle.defaults = new AnalysisStyle({});
|
|
166
166
|
//# sourceMappingURL=AnalysisStyle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalysisStyle.js","sourceRoot":"","sources":["../../src/AnalysisStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAA6D;AAC7D,uDAA4F;AAC5F,yCAAsC;AAgBtC;;;GAGG;AACH,MAAa,yBAAyB;IAQpC,gBAAgB;IAChB,YAAoB,WAAmB,EAAE,KAAK,GAAG,CAAC;QAChD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,uCAAuC;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAqC;QAC1D,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,sCAAsC;IAC/B,MAAM;QACX,MAAM,KAAK,GAAmC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;QAChF,IAAI,IAAI,CAAC,KA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IAAI,CAAC,MAAM,EAAE;YAChB,GAAG,YAAY;SAChB,CAAC,CAAC;IACL,CAAC;IAED,0DAA0D;IACnD,MAAM,CAAC,KAAoB;QAChC,IAAI,IAAI,CAAC,iBAAiB,KAAK,KAAK,CAAC,iBAAiB;YACpD,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,YAAY,CAAC;YAC1E,OAAO,KAAK,CAAC;aACV,IAAI,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,YAAa,CAAC;YAC1E,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,QAAQ,CAAC;YAClE,OAAO,KAAK,CAAC;QAEf,OAAO,SAAS,KAAK,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAS,CAAC,CAAC;IAC9E,CAAC;;AAtEH,sCAyEC;AADwB,sBAAQ,GAAG,IAAI,aAAa,CAAC,EAAE,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\nimport { Range1d, Range1dProps } from \"@itwin/core-geometry\";\nimport { ThematicGradientSettings, ThematicGradientSettingsProps } from \"./ThematicDisplay\";\nimport { Gradient } from \"./Gradient\";\n\n/** JSON representation of an [[AnalysisStyleDisplacement]].\n * @see [[AnalysisStyleProps.displacement]].\n * @public\n * @extensions\n */\nexport interface AnalysisStyleDisplacementProps {\n /** See [[AnalysisStyleDisplacement.channelName]]. */\n channelName: string;\n /** See [[AnalysisStyleDisplacement.scale]].\n * Default value: 1.\n */\n scale?: number;\n}\n\n/** Describes how an [[AnalysisStyle]] deforms a [Polyface]($core-geometry) by applying translation to its vertices.\n * @see [[AnalysisStyle.displacement]].\n * @public\n */\nexport class AnalysisStyleDisplacement {\n /** The name of the [AuxChannel]($core-geometry) supplying the displacements to be applied to the vertices. */\n public readonly channelName: string;\n /** A scale applied to the displacements to adjust the magnitude of the effect.\n * Default value: 1.\n */\n public readonly scale: number;\n\n /** @internal */\n private constructor(channelName: string, scale = 1) {\n this.channelName = channelName;\n this.scale = scale;\n }\n\n /** Create from JSON representation. */\n public static fromJSON(props: AnalysisStyleDisplacementProps): AnalysisStyleDisplacement {\n return new this(props.channelName, props.scale);\n }\n\n /** Convert to JSON representation. */\n public toJSON(): AnalysisStyleDisplacementProps {\n const props: AnalysisStyleDisplacementProps = { channelName: this.channelName };\n if (this.scale !== 1)\n props.scale = this.scale;\n\n return props;\n }\n\n /** Return true if `this` is equivalent to `other`. */\n public equals(other: AnalysisStyleDisplacement): boolean {\n return this.channelName === other.channelName && this.scale === other.scale;\n }\n}\n\n/** JSON representation of an [[AnalysisStyleThematic]].\n * @see [[AnalysisStyleProps.scalar]].\n * @public\n * @extensions\n */\nexport interface AnalysisStyleThematicProps {\n /** See [[AnalysisStyleThematic.channelName]]. */\n channelName: string;\n /** See [[AnalysisStyleThematic.range]]. */\n range: Range1dProps;\n /** See [[AnalysisStyleThematic.thematicSettings]].\n * Default value: [[ThematicGradientSettings.defaults]].\n */\n thematicSettings?: ThematicGradientSettingsProps;\n}\n\n/** Describes how an [[AnalysisStyle]] recolors [Polyface]($core-geometry) vertices by mapping values of type\n * [AuxChannelDataType.Scalar]($core-geometry) or [AuxChannelDataType.Distance]($core-geometry) supplied\n * by an [AuxChannel]($core-geometry) to colors supplied by a [[Gradient]] image.\n * @see [[AnalysisStyle.thematic]].\n * @public\n */\nexport class AnalysisStyleThematic {\n /** The name of the [AuxChannel]($core-geometry) supplying the values from which the vertex colors are computed. */\n public readonly channelName: string;\n /** The minimum and maximum values that map to colors in the [[Gradient]] image. Vertices with values outside of\n * this range are displayed with the gradient's margin color.\n */\n public readonly range: Readonly<Range1d>;\n /** Settings used to produce the [[Gradient]] image. */\n public readonly thematicSettings: ThematicGradientSettings;\n private _gradient?: Gradient.Symb;\n\n /** @internal */\n private constructor(props: AnalysisStyleThematicProps) {\n this.channelName = props.channelName;\n this.range = Range1d.fromJSON(props.range);\n this.thematicSettings = ThematicGradientSettings.fromJSON(props.thematicSettings);\n }\n\n /** Create from JSON representation. */\n public static fromJSON(props: AnalysisStyleThematicProps): AnalysisStyleThematic {\n return new this(props);\n }\n\n /** Convert to JSON representation. */\n public toJSON(): AnalysisStyleThematicProps {\n const props: AnalysisStyleThematicProps = {\n channelName: this.channelName,\n range: this.range.toJSON(),\n };\n\n if (!this.thematicSettings.equals(ThematicGradientSettings.defaults))\n props.thematicSettings = this.thematicSettings.toJSON();\n\n return props;\n }\n\n /** The gradient computed from [[thematicSettings]]. */\n public get gradient(): Gradient.Symb {\n if (!this._gradient)\n this._gradient = Gradient.Symb.createThematic(this.thematicSettings);\n\n return this._gradient;\n }\n\n /** Return true if `this` is equivalent to `other`. */\n public equals(other: AnalysisStyleThematic): boolean {\n return this.channelName === other.channelName && this.range.isAlmostEqual(other.range) && this.thematicSettings.equals(other.thematicSettings);\n }\n}\n\n/** JSON representation of an [[AnalysisStyle]].\n * @public\n * @extensions\n */\nexport interface AnalysisStyleProps {\n /** See [[AnalysisStyle.displacement]]. */\n displacement?: AnalysisStyleDisplacementProps;\n /** JSON representation of [[AnalysisStyle.thematic]].\n * @note The name \"scalar\" is used instead of \"thematic\" for backwards compatibility.\n */\n scalar?: AnalysisStyleThematicProps;\n /** See [[AnalysisStyle.normalChannelName]]. */\n normalChannelName?: string;\n}\n\n/** At time of writing, the only iModel in existence that uses AnalysisStyle is the one created by the analysis-importer test app.\n * To avoid breaking existing saved views of that iModel, AnalysisStyle.fromJSON() continues to accept the old JSON representation -\n * but that representation is not part of the public API.\n * @internal exported strictly for tests.\n */\nexport interface LegacyAnalysisStyleProps {\n displacementChannelName?: string;\n scalarChannelName?: string;\n normalChannelName?: string;\n displacementScale?: number;\n scalarRange?: Range1dProps;\n scalarThematicSettings?: ThematicGradientSettingsProps;\n}\n\nfunction tryConvertLegacyProps(input: AnalysisStyleProps): AnalysisStyleProps {\n if (input.displacement || input.scalar)\n return input;\n\n const legacy = input as LegacyAnalysisStyleProps;\n if (undefined === legacy.displacementChannelName && undefined === legacy.scalarChannelName)\n return input;\n\n const output: AnalysisStyleProps = {\n normalChannelName: input.normalChannelName,\n };\n\n if (undefined !== legacy.displacementChannelName) {\n output.displacement = {\n channelName: legacy.displacementChannelName,\n scale: legacy.displacementScale,\n };\n }\n\n if (undefined !== legacy.scalarChannelName && undefined !== legacy.scalarRange) {\n output.scalar = {\n channelName: legacy.scalarChannelName,\n range: legacy.scalarRange,\n thematicSettings: legacy.scalarThematicSettings,\n };\n }\n\n return output;\n}\n\n/** As part of a [[DisplayStyleSettings]], describes how to animate meshes in the view that have been augmented with\n * [PolyfaceAuxData]($core-geometry). The style specifies which channels to use, and can deform the meshes by\n * translating vertices and/or recolor vertices using [[ThematicDisplay]].\n * @see [[DisplayStyleSettings.analysisStyle]] to define the analysis style for a [DisplayStyle]($backend).\n * @see [[DisplayStyleSettings.analysisFraction]] to control playback of the animation.\n * @public\n */\nexport class AnalysisStyle {\n public readonly displacement?: AnalysisStyleDisplacement;\n public readonly thematic?: AnalysisStyleThematic;\n /** If defined, the name of the [AuxChannel]($core-geometry) from which to obtain normal vectors for the vertices. */\n public readonly normalChannelName?: string;\n\n /** Create an analysis style from its JSON representation.\n * @note AnalysisStyle is an immutable type - use [[clone]] to produce a modified copy.\n */\n public static fromJSON(props?: AnalysisStyleProps): AnalysisStyle {\n if (!props)\n return this.defaults;\n\n props = tryConvertLegacyProps(props);\n if (!props.displacement && !props.scalar && undefined === props.normalChannelName)\n return this.defaults;\n\n return new AnalysisStyle(props);\n }\n\n /** @internal */\n private constructor(props: AnalysisStyleProps) {\n this.normalChannelName = props.normalChannelName;\n if (props.displacement)\n this.displacement = AnalysisStyleDisplacement.fromJSON(props.displacement);\n\n if (props.scalar)\n this.thematic = AnalysisStyleThematic.fromJSON(props.scalar);\n }\n\n /** Convert this style to its JSON representation. */\n public toJSON(): AnalysisStyleProps {\n const props: AnalysisStyleProps = {};\n if (this === AnalysisStyle.defaults)\n return props;\n\n if (this.displacement)\n props.displacement = this.displacement.toJSON();\n\n if (this.thematic)\n props.scalar = this.thematic.toJSON();\n\n if (undefined !== this.normalChannelName)\n props.normalChannelName = this.normalChannelName;\n\n return props;\n }\n\n /** Produce a copy of this style identical except for properties explicitly specified by `changedProps`. */\n public clone(changedProps: AnalysisStyleProps): AnalysisStyle {\n return AnalysisStyle.fromJSON({\n ...this.toJSON(),\n ...changedProps,\n });\n }\n\n /** Return true if this style is equivalent to `other`. */\n public equals(other: AnalysisStyle): boolean {\n if (this.normalChannelName !== other.normalChannelName)\n return false;\n\n if ((undefined === this.displacement) !== (undefined === other.displacement))\n return false;\n else if (this.displacement && !this.displacement.equals(other.displacement!))\n return false;\n\n if ((undefined === this.thematic) !== (undefined === other.thematic))\n return false;\n\n return undefined === this.thematic || this.thematic.equals(other.thematic!);\n }\n\n public static readonly defaults = new AnalysisStyle({});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AnalysisStyle.js","sourceRoot":"","sources":["../../src/AnalysisStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAA6D;AAC7D,uDAA4F;AAC5F,yCAAsC;AAgBtC;;;GAGG;AACH,MAAa,yBAAyB;IAQpC,gBAAgB;IAChB,YAAoB,WAAmB,EAAE,KAAK,GAAG,CAAC;QAChD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,uCAAuC;IAChC,MAAM,CAAC,QAAQ,CAAC,KAA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C,IAAI,SAAS,KAAK,IAAI,CAAC,iBAAiB;YACtC,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAEnD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,2GAA2G;IACpG,KAAK,CAAC,YAAgC;QAC3C,OAAO,aAAa,CAAC,QAAQ,CAAC;YAC5B,GAAG,IAAI,CAAC,MAAM,EAAE;YAChB,GAAG,YAAY;SAChB,CAAC,CAAC;IACL,CAAC;IAED,0DAA0D;IACnD,MAAM,CAAC,KAAoB;QAChC,IAAI,IAAI,CAAC,iBAAiB,KAAK,KAAK,CAAC,iBAAiB;YACpD,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,YAAY,CAAC;YAC1E,OAAO,KAAK,CAAC;aACV,IAAI,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,YAAa,CAAC;YAC1E,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,QAAQ,CAAC;YAClE,OAAO,KAAK,CAAC;QAEf,OAAO,SAAS,KAAK,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAS,CAAC,CAAC;IAC9E,CAAC;aAEsB,aAAQ,GAAG,IAAI,aAAa,CAAC,EAAE,CAAC,CAAC;;AAxE1D,sCAyEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\nimport { Range1d, Range1dProps } from \"@itwin/core-geometry\";\nimport { ThematicGradientSettings, ThematicGradientSettingsProps } from \"./ThematicDisplay\";\nimport { Gradient } from \"./Gradient\";\n\n/** JSON representation of an [[AnalysisStyleDisplacement]].\n * @see [[AnalysisStyleProps.displacement]].\n * @public\n * @extensions\n */\nexport interface AnalysisStyleDisplacementProps {\n /** See [[AnalysisStyleDisplacement.channelName]]. */\n channelName: string;\n /** See [[AnalysisStyleDisplacement.scale]].\n * Default value: 1.\n */\n scale?: number;\n}\n\n/** Describes how an [[AnalysisStyle]] deforms a [Polyface]($core-geometry) by applying translation to its vertices.\n * @see [[AnalysisStyle.displacement]].\n * @public\n */\nexport class AnalysisStyleDisplacement {\n /** The name of the [AuxChannel]($core-geometry) supplying the displacements to be applied to the vertices. */\n public readonly channelName: string;\n /** A scale applied to the displacements to adjust the magnitude of the effect.\n * Default value: 1.\n */\n public readonly scale: number;\n\n /** @internal */\n private constructor(channelName: string, scale = 1) {\n this.channelName = channelName;\n this.scale = scale;\n }\n\n /** Create from JSON representation. */\n public static fromJSON(props: AnalysisStyleDisplacementProps): AnalysisStyleDisplacement {\n return new this(props.channelName, props.scale);\n }\n\n /** Convert to JSON representation. */\n public toJSON(): AnalysisStyleDisplacementProps {\n const props: AnalysisStyleDisplacementProps = { channelName: this.channelName };\n if (this.scale !== 1)\n props.scale = this.scale;\n\n return props;\n }\n\n /** Return true if `this` is equivalent to `other`. */\n public equals(other: AnalysisStyleDisplacement): boolean {\n return this.channelName === other.channelName && this.scale === other.scale;\n }\n}\n\n/** JSON representation of an [[AnalysisStyleThematic]].\n * @see [[AnalysisStyleProps.scalar]].\n * @public\n * @extensions\n */\nexport interface AnalysisStyleThematicProps {\n /** See [[AnalysisStyleThematic.channelName]]. */\n channelName: string;\n /** See [[AnalysisStyleThematic.range]]. */\n range: Range1dProps;\n /** See [[AnalysisStyleThematic.thematicSettings]].\n * Default value: [[ThematicGradientSettings.defaults]].\n */\n thematicSettings?: ThematicGradientSettingsProps;\n}\n\n/** Describes how an [[AnalysisStyle]] recolors [Polyface]($core-geometry) vertices by mapping values of type\n * [AuxChannelDataType.Scalar]($core-geometry) or [AuxChannelDataType.Distance]($core-geometry) supplied\n * by an [AuxChannel]($core-geometry) to colors supplied by a [[Gradient]] image.\n * @see [[AnalysisStyle.thematic]].\n * @public\n */\nexport class AnalysisStyleThematic {\n /** The name of the [AuxChannel]($core-geometry) supplying the values from which the vertex colors are computed. */\n public readonly channelName: string;\n /** The minimum and maximum values that map to colors in the [[Gradient]] image. Vertices with values outside of\n * this range are displayed with the gradient's margin color.\n */\n public readonly range: Readonly<Range1d>;\n /** Settings used to produce the [[Gradient]] image. */\n public readonly thematicSettings: ThematicGradientSettings;\n private _gradient?: Gradient.Symb;\n\n /** @internal */\n private constructor(props: AnalysisStyleThematicProps) {\n this.channelName = props.channelName;\n this.range = Range1d.fromJSON(props.range);\n this.thematicSettings = ThematicGradientSettings.fromJSON(props.thematicSettings);\n }\n\n /** Create from JSON representation. */\n public static fromJSON(props: AnalysisStyleThematicProps): AnalysisStyleThematic {\n return new this(props);\n }\n\n /** Convert to JSON representation. */\n public toJSON(): AnalysisStyleThematicProps {\n const props: AnalysisStyleThematicProps = {\n channelName: this.channelName,\n range: this.range.toJSON(),\n };\n\n if (!this.thematicSettings.equals(ThematicGradientSettings.defaults))\n props.thematicSettings = this.thematicSettings.toJSON();\n\n return props;\n }\n\n /** The gradient computed from [[thematicSettings]]. */\n public get gradient(): Gradient.Symb {\n if (!this._gradient)\n this._gradient = Gradient.Symb.createThematic(this.thematicSettings);\n\n return this._gradient;\n }\n\n /** Return true if `this` is equivalent to `other`. */\n public equals(other: AnalysisStyleThematic): boolean {\n return this.channelName === other.channelName && this.range.isAlmostEqual(other.range) && this.thematicSettings.equals(other.thematicSettings);\n }\n}\n\n/** JSON representation of an [[AnalysisStyle]].\n * @public\n * @extensions\n */\nexport interface AnalysisStyleProps {\n /** See [[AnalysisStyle.displacement]]. */\n displacement?: AnalysisStyleDisplacementProps;\n /** JSON representation of [[AnalysisStyle.thematic]].\n * @note The name \"scalar\" is used instead of \"thematic\" for backwards compatibility.\n */\n scalar?: AnalysisStyleThematicProps;\n /** See [[AnalysisStyle.normalChannelName]]. */\n normalChannelName?: string;\n}\n\n/** At time of writing, the only iModel in existence that uses AnalysisStyle is the one created by the analysis-importer test app.\n * To avoid breaking existing saved views of that iModel, AnalysisStyle.fromJSON() continues to accept the old JSON representation -\n * but that representation is not part of the public API.\n * @internal exported strictly for tests.\n */\nexport interface LegacyAnalysisStyleProps {\n displacementChannelName?: string;\n scalarChannelName?: string;\n normalChannelName?: string;\n displacementScale?: number;\n scalarRange?: Range1dProps;\n scalarThematicSettings?: ThematicGradientSettingsProps;\n}\n\nfunction tryConvertLegacyProps(input: AnalysisStyleProps): AnalysisStyleProps {\n if (input.displacement || input.scalar)\n return input;\n\n const legacy = input as LegacyAnalysisStyleProps;\n if (undefined === legacy.displacementChannelName && undefined === legacy.scalarChannelName)\n return input;\n\n const output: AnalysisStyleProps = {\n normalChannelName: input.normalChannelName,\n };\n\n if (undefined !== legacy.displacementChannelName) {\n output.displacement = {\n channelName: legacy.displacementChannelName,\n scale: legacy.displacementScale,\n };\n }\n\n if (undefined !== legacy.scalarChannelName && undefined !== legacy.scalarRange) {\n output.scalar = {\n channelName: legacy.scalarChannelName,\n range: legacy.scalarRange,\n thematicSettings: legacy.scalarThematicSettings,\n };\n }\n\n return output;\n}\n\n/** As part of a [[DisplayStyleSettings]], describes how to animate meshes in the view that have been augmented with\n * [PolyfaceAuxData]($core-geometry). The style specifies which channels to use, and can deform the meshes by\n * translating vertices and/or recolor vertices using [[ThematicDisplay]].\n * @see [[DisplayStyleSettings.analysisStyle]] to define the analysis style for a [DisplayStyle]($backend).\n * @see [[DisplayStyleSettings.analysisFraction]] to control playback of the animation.\n * @public\n */\nexport class AnalysisStyle {\n public readonly displacement?: AnalysisStyleDisplacement;\n public readonly thematic?: AnalysisStyleThematic;\n /** If defined, the name of the [AuxChannel]($core-geometry) from which to obtain normal vectors for the vertices. */\n public readonly normalChannelName?: string;\n\n /** Create an analysis style from its JSON representation.\n * @note AnalysisStyle is an immutable type - use [[clone]] to produce a modified copy.\n */\n public static fromJSON(props?: AnalysisStyleProps): AnalysisStyle {\n if (!props)\n return this.defaults;\n\n props = tryConvertLegacyProps(props);\n if (!props.displacement && !props.scalar && undefined === props.normalChannelName)\n return this.defaults;\n\n return new AnalysisStyle(props);\n }\n\n /** @internal */\n private constructor(props: AnalysisStyleProps) {\n this.normalChannelName = props.normalChannelName;\n if (props.displacement)\n this.displacement = AnalysisStyleDisplacement.fromJSON(props.displacement);\n\n if (props.scalar)\n this.thematic = AnalysisStyleThematic.fromJSON(props.scalar);\n }\n\n /** Convert this style to its JSON representation. */\n public toJSON(): AnalysisStyleProps {\n const props: AnalysisStyleProps = {};\n if (this === AnalysisStyle.defaults)\n return props;\n\n if (this.displacement)\n props.displacement = this.displacement.toJSON();\n\n if (this.thematic)\n props.scalar = this.thematic.toJSON();\n\n if (undefined !== this.normalChannelName)\n props.normalChannelName = this.normalChannelName;\n\n return props;\n }\n\n /** Produce a copy of this style identical except for properties explicitly specified by `changedProps`. */\n public clone(changedProps: AnalysisStyleProps): AnalysisStyle {\n return AnalysisStyle.fromJSON({\n ...this.toJSON(),\n ...changedProps,\n });\n }\n\n /** Return true if this style is equivalent to `other`. */\n public equals(other: AnalysisStyle): boolean {\n if (this.normalChannelName !== other.normalChannelName)\n return false;\n\n if ((undefined === this.displacement) !== (undefined === other.displacement))\n return false;\n else if (this.displacement && !this.displacement.equals(other.displacement!))\n return false;\n\n if ((undefined === this.thematic) !== (undefined === other.thematic))\n return false;\n\n return undefined === this.thematic || this.thematic.equals(other.thematic!);\n }\n\n public static readonly defaults = new AnalysisStyle({});\n}\n"]}
|
package/lib/cjs/Atmosphere.js
CHANGED
|
@@ -31,7 +31,6 @@ const core_bentley_1 = require("@itwin/core-bentley");
|
|
|
31
31
|
*/
|
|
32
32
|
var Atmosphere;
|
|
33
33
|
(function (Atmosphere) {
|
|
34
|
-
var _a;
|
|
35
34
|
/** @internal An immutable container of wavelength values for the red, green and blue pixel components. Values are in nanometers. */
|
|
36
35
|
class Wavelengths {
|
|
37
36
|
/** Constructs from red, green, and blue wavelength values.
|
|
@@ -68,6 +67,16 @@ var Atmosphere;
|
|
|
68
67
|
Atmosphere.Wavelengths = Wavelengths;
|
|
69
68
|
/** Describes the properties with which the atmospheric scattering effect should be drawn. Theses properties correspond to a physics-based approximation of atmospheric scattering phenomenons. */
|
|
70
69
|
class Settings {
|
|
70
|
+
static { this._defaultAtmosphereHeightAboveEarth = 100000.0; }
|
|
71
|
+
static { this._defaultExposure = 2.0; }
|
|
72
|
+
static { this._defaultDensityFalloff = 10.0; }
|
|
73
|
+
static { this._defaultScatteringStrength = 100; }
|
|
74
|
+
static { this._defaultWavelengths = new Wavelengths({ r: 700.0, g: 530.0, b: 440.0 }); }
|
|
75
|
+
static { this._defaultNumViewRaySamples = 10; }
|
|
76
|
+
static { this._highQualityNumViewRaySamples = 20; }
|
|
77
|
+
static { this._defaultNumSunRaySamples = 5; }
|
|
78
|
+
static { this.defaults = new Settings({}); }
|
|
79
|
+
static { this.highQuality = new Settings({ numViewRaySamples: this._highQualityNumViewRaySamples }); }
|
|
71
80
|
equals(other) {
|
|
72
81
|
if (this.atmosphereHeightAboveEarth !== other.atmosphereHeightAboveEarth)
|
|
73
82
|
return false;
|
|
@@ -88,19 +97,19 @@ var Atmosphere;
|
|
|
88
97
|
return true;
|
|
89
98
|
}
|
|
90
99
|
constructor(json) {
|
|
91
|
-
this.atmosphereHeightAboveEarth = core_bentley_1.JsonUtils.asDouble(json.atmosphereHeightAboveEarth,
|
|
92
|
-
this.exposure = core_bentley_1.JsonUtils.asDouble(json.exposure,
|
|
93
|
-
this.densityFalloff = core_bentley_1.JsonUtils.asDouble(json.densityFalloff,
|
|
94
|
-
this.depthBelowEarthForMaxDensity = core_bentley_1.JsonUtils.asDouble(json.depthBelowEarthForMaxDensity,
|
|
95
|
-
this.numViewRaySamples = core_bentley_1.JsonUtils.asDouble(json.numViewRaySamples,
|
|
96
|
-
this.numSunRaySamples = core_bentley_1.JsonUtils.asDouble(json.numSunRaySamples,
|
|
97
|
-
this.scatteringStrength = core_bentley_1.JsonUtils.asDouble(json.scatteringStrength,
|
|
98
|
-
this.wavelengths = Wavelengths.fromJSON(core_bentley_1.JsonUtils.asObject(json.wavelengths) ??
|
|
100
|
+
this.atmosphereHeightAboveEarth = core_bentley_1.JsonUtils.asDouble(json.atmosphereHeightAboveEarth, Settings._defaultAtmosphereHeightAboveEarth);
|
|
101
|
+
this.exposure = core_bentley_1.JsonUtils.asDouble(json.exposure, Settings._defaultExposure);
|
|
102
|
+
this.densityFalloff = core_bentley_1.JsonUtils.asDouble(json.densityFalloff, Settings._defaultDensityFalloff);
|
|
103
|
+
this.depthBelowEarthForMaxDensity = core_bentley_1.JsonUtils.asDouble(json.depthBelowEarthForMaxDensity, Settings._defaultMinDensityHeightBelowEarth);
|
|
104
|
+
this.numViewRaySamples = core_bentley_1.JsonUtils.asDouble(json.numViewRaySamples, Settings._defaultNumViewRaySamples);
|
|
105
|
+
this.numSunRaySamples = core_bentley_1.JsonUtils.asDouble(json.numSunRaySamples, Settings._defaultNumSunRaySamples);
|
|
106
|
+
this.scatteringStrength = core_bentley_1.JsonUtils.asDouble(json.scatteringStrength, Settings._defaultScatteringStrength);
|
|
107
|
+
this.wavelengths = Wavelengths.fromJSON(core_bentley_1.JsonUtils.asObject(json.wavelengths) ?? Settings._defaultWavelengths);
|
|
99
108
|
}
|
|
100
109
|
static fromJSON(json) {
|
|
101
110
|
if (undefined === json)
|
|
102
111
|
return this.defaults;
|
|
103
|
-
return new
|
|
112
|
+
return new Settings(json);
|
|
104
113
|
}
|
|
105
114
|
toJSON(display) {
|
|
106
115
|
const json = {
|
|
@@ -118,17 +127,6 @@ var Atmosphere;
|
|
|
118
127
|
return json;
|
|
119
128
|
}
|
|
120
129
|
}
|
|
121
|
-
_a = Settings;
|
|
122
|
-
Settings._defaultAtmosphereHeightAboveEarth = 100000.0;
|
|
123
|
-
Settings._defaultExposure = 2.0;
|
|
124
|
-
Settings._defaultDensityFalloff = 10.0;
|
|
125
|
-
Settings._defaultScatteringStrength = 100;
|
|
126
|
-
Settings._defaultWavelengths = new Wavelengths({ r: 700.0, g: 530.0, b: 440.0 });
|
|
127
|
-
Settings._defaultNumViewRaySamples = 10;
|
|
128
|
-
Settings._highQualityNumViewRaySamples = 20;
|
|
129
|
-
Settings._defaultNumSunRaySamples = 5;
|
|
130
|
-
Settings.defaults = new _a({});
|
|
131
|
-
Settings.highQuality = new _a({ numViewRaySamples: _a._highQualityNumViewRaySamples });
|
|
132
130
|
Atmosphere.Settings = Settings;
|
|
133
131
|
})(Atmosphere || (exports.Atmosphere = Atmosphere = {}));
|
|
134
132
|
//# sourceMappingURL=Atmosphere.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Atmosphere.js","sourceRoot":"","sources":["../../src/Atmosphere.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAgD;AAEhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,IAAiB,UAAU,CAgK1B;AAhKD,WAAiB,UAAU;;IASzB,oIAAoI;IACpI,MAAa,WAAW;QAKtB;;;;WAIG;QACH,YAAY,KAAuB;YACjC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9B,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9B,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QAChC,CAAC;QAEM,MAAM,CAAC,KAAkB;YAC9B,OAAO,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,I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AAW,CAAC,AAAZ,CAAa;IAE7B,iBAAQ,GAAG,IAAI,EAAQ,CAAC,EAAE,CAAC,AAAnB,CAAoB;IAC5B,oBAAW,GAAG,IAAI,EAAQ,CAAC,EAAE,iBAAiB,EAAE,EAAI,CAAC,6BAA6B,EAAE,CAAC,AAA1E,CAA2E;IAblG,mBAAQ,WAsFpB,CAAA;AACH,CAAC,EAhKgB,UAAU,0BAAV,UAAU,QAgK1B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\nimport { JsonUtils } from \"@itwin/core-bentley\";\n\n/** Namespace containing types controlling how atmospheric scattering should be rendered.\n * @beta\n * The techniques used to render the atmosphere approximate the physical behavior of light when interacting with particles in the air (Rayleigh Scattering and Mie Scattering)\n * Presently, only Rayleigh Scattering is implemented here\n *\n * In a nutshell, this implementation samples atmospheric density along rays cast from the view and uses the samples to simulate the scattering of light toward the camera.\n * The amount of light scattered toward the camera is dependent on the amount of light scattered away from its original path from the sun, so rays must also be cast from the sample points to the sun.\n *\n * The effect can be computed on vertices (the default for the background map) and fragments (the default for the skybox, which is a ViewportQuad).\n * All coordinates are in view space.\n *\n * This implementation is adapted from equations outlined in \"Display of Clouds Taking into Account Multiple Anisotropic Scattering and Sky Light\", Nishita et al. 1993\n * which are further refined for use in GPU shaders in \"Photorealistic Real-Time Outdoor Light Scattering\", Hoffman and Preetham 2002.\n * These sources are also compiled in Chapter 16 of NVIDIA's \"GPU Gems 2\", which can be found online here:\n * https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering\n *\n * This implementation is also highly inspired by Sebastian Lague's Solar System project: https://github.com/SebLague/Solar-System/ and video: https://www.youtube.com/watch?v=DxfEbulyFcY\n * along with this ShaderToy replica: https://www.shadertoy.com/view/fltXD2.\n * Both of which are inspired by this Nvidia article on atmospheric scattering: https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering.\n */\nexport namespace Atmosphere {\n\n /** @internal JSON representation of a [[Wavelengths]] object */\n export interface WavelengthsProps {\n r: number;\n g: number;\n b: number;\n }\n\n /** @internal An immutable container of wavelength values for the red, green and blue pixel components. Values are in nanometers. */\n export class Wavelengths {\n public readonly r: number;\n public readonly g: number;\n public readonly b: number;\n\n /** Constructs from red, green, and blue wavelength values.\n * @param r Wavelength value for red\n * @param g Wavelength value for green\n * @param b Wavelength value for blue\n */\n constructor(props: WavelengthsProps) {\n this.r = Math.max(0, props.r);\n this.g = Math.max(0, props.g);\n this.b = Math.max(0, props.b);\n }\n\n public equals(other: Wavelengths): boolean {\n return this.r === other.r && this.g === other.g && this.b === other.b;\n }\n\n public toJSON(): WavelengthsProps {\n return { r: this.r, g: this.g, b: this.b };\n }\n\n public static fromJSON(json: WavelengthsProps | undefined): Wavelengths {\n let r = 0;\n let g = 0;\n let b = 0;\n if (undefined !== json) {\n if (typeof json.r === \"number\")\n r = json.r;\n if (typeof json.g === \"number\")\n g = json.g;\n if (typeof json.b === \"number\")\n b = json.b;\n }\n return new Wavelengths({ r, g, b });\n }\n }\n\n /** Describes the properties with which the atmospheric scattering effect should be drawn. Theses properties correspond to a physics-based approximation of atmospheric scattering phenomenons. */\n export interface Props {\n /** Whether the ground plane should be displayed. Defaults to false. */\n display?: boolean;\n /** @internal See [[Settings.atmosphereHeightAboveEarth]] */\n atmosphereHeightAboveEarth?: number;\n /** See [[Settings.exposure]] */\n exposure?: number;\n /** @internal See [[Settings.densityFalloff]] */\n densityFalloff?: number;\n /** @internal See [[Settings.minDensityHeightBelowEarth]] */\n depthBelowEarthForMaxDensity?: number;\n /** See [[Settings.numViewRaySamples]] */\n numViewRaySamples?: number;\n /** See [[Settings.numSunRaySamples]] */\n numSunRaySamples?: number;\n /** @internal See [[Settings.scatteringStrength]] */\n scatteringStrength?: number;\n /** @internal See [[Settings.wavelengths]] */\n wavelengths?: WavelengthsProps;\n }\n\n /** Describes the properties with which the atmospheric scattering effect should be drawn. Theses properties correspond to a physics-based approximation of atmospheric scattering phenomenons. */\n export class Settings {\n private static _defaultAtmosphereHeightAboveEarth: number = 100000.0;\n private static _defaultExposure: number = 2.0;\n private static _defaultDensityFalloff: number = 10.0;\n private static _defaultMinDensityHeightBelowEarth: 0.0;\n private static _defaultScatteringStrength: number = 100;\n private static _defaultWavelengths: Wavelengths = new Wavelengths({ r: 700.0, g: 530.0, b: 440.0 });\n\n private static _defaultNumViewRaySamples: number = 10;\n private static _highQualityNumViewRaySamples: number = 20;\n private static _defaultNumSunRaySamples: number = 5;\n\n public static readonly defaults = new Settings({});\n public static readonly highQuality = new Settings({ numViewRaySamples: this._highQualityNumViewRaySamples });\n\n /** @internal If defined, corresponds to the height in meters above the earth's pole at which the atmosphere terminates. Physically, this is the point at which there are no more air molecules to interfere with light transmission. Defaults to 100_000.0. */\n public readonly atmosphereHeightAboveEarth: number;\n /** If defined, this value is used to simulate the aperture of a camera. Higher values allow more light in. This value might need to be adjusted slightly in situations without much sunlight (like sunset) to brighten the image. Defaults to 2.0 */\n public readonly exposure: number;\n /** @internal If defined, controls the rate at which the air density decreases between the point it is the highest and the point is is the lowest. A higher value means a faster decrease in air density. Defaults to 10.0. */\n public readonly densityFalloff: number;\n /** @internal If defined, corresponds to the height in meters below the earth's pole at which the atmosphere is at its densest. Physically, this is the point at which there is the most air molecules to interfere with light transmission. Defaults to 0.0. */\n public readonly depthBelowEarthForMaxDensity: number;\n /** If defined, corresponds to the number of atmospheric density samples used to compute the amount of light scattered along each view ray. For each sample point, another ray will be cast toward the sun to compute the amount of light reaching the sample point. Higher values increase fidelity, but greatly decrease performance because sun rays must be cast from each additional sample point. The range is 1 to 40. Defaults to 10. */\n public readonly numViewRaySamples: number;\n /** If defined, corresponds to the number of atmospheric density samples uses to compute the amount of light scattered along each sun ray. Higher values increase fidelity slightly but greatly decrease performance. Minimal improvement is observable with values above 5. The range is 1 to 40. Defaults to 5. */\n public readonly numSunRaySamples: number;\n /** @internal If defined, controls how strongly the atmosphere's air diverts light. Higher values increase scattering intensity. Defaults to 100.0. */\n public readonly scatteringStrength: number;\n /** @internal If defined, corresponds the wavelengths of the red, green and blue color components in nanometers used to simulate how the atmosphere's air molecules affects light transmission. (See Rayleigh Scattering) Thus, a value of 470 for the red wavelength will make the red light component scatter as if it physically were a cyan light ray. The default value is {r:700.0, g:530.0, b:440.0}. */\n public readonly wavelengths: Wavelengths;\n\n public equals(other: Settings): boolean {\n if (this.atmosphereHeightAboveEarth !== other.atmosphereHeightAboveEarth)\n return false;\n if (this.exposure !== other.exposure)\n return false;\n if (this.densityFalloff !== other.densityFalloff)\n return false;\n if (this.depthBelowEarthForMaxDensity !== other.depthBelowEarthForMaxDensity)\n return false;\n if (this.numViewRaySamples !== other.numViewRaySamples)\n return false;\n if (this.numSunRaySamples !== other.numSunRaySamples)\n return false;\n if (this.scatteringStrength !== other.scatteringStrength)\n return false;\n if (!this.wavelengths.equals(other.wavelengths))\n return false;\n return true;\n }\n\n private constructor(json: Props) {\n this.atmosphereHeightAboveEarth = JsonUtils.asDouble(json.atmosphereHeightAboveEarth, Settings._defaultAtmosphereHeightAboveEarth);\n this.exposure = JsonUtils.asDouble(json.exposure, Settings._defaultExposure);\n this.densityFalloff = JsonUtils.asDouble(json.densityFalloff, Settings._defaultDensityFalloff);\n this.depthBelowEarthForMaxDensity = JsonUtils.asDouble(json.depthBelowEarthForMaxDensity, Settings._defaultMinDensityHeightBelowEarth);\n this.numViewRaySamples = JsonUtils.asDouble(json.numViewRaySamples, Settings._defaultNumViewRaySamples);\n this.numSunRaySamples = JsonUtils.asDouble(json.numSunRaySamples, Settings._defaultNumSunRaySamples);\n this.scatteringStrength = JsonUtils.asDouble(json.scatteringStrength, Settings._defaultScatteringStrength);\n this.wavelengths = Wavelengths.fromJSON(JsonUtils.asObject(json.wavelengths) ?? Settings._defaultWavelengths);\n }\n\n public static fromJSON(json?: Props) {\n if (undefined === json)\n return this.defaults;\n return new Settings(json);\n }\n\n public toJSON(display?: boolean): Props {\n const json: Props = {\n atmosphereHeightAboveEarth: this.atmosphereHeightAboveEarth,\n exposure: this.exposure,\n densityFalloff: this.densityFalloff,\n depthBelowEarthForMaxDensity: this.depthBelowEarthForMaxDensity,\n numViewRaySamples: this.numViewRaySamples,\n numSunRaySamples: this.numSunRaySamples,\n scatteringStrength: this.scatteringStrength,\n wavelengths: this.wavelengths.toJSON(),\n };\n\n if (undefined !== display)\n json.display = display;\n\n return json;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Atmosphere.js","sourceRoot":"","sources":["../../src/Atmosphere.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAgD;AAEhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,IAAiB,UAAU,CAgK1B;AAhKD,WAAiB,UAAU;IASzB,oIAAoI;IACpI,MAAa,WAAW;QAKtB;;;;WAIG;QACH,YAAY,KAAuB;YACjC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9B,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9B,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QAChC,CAAC;QAEM,MAAM,CAAC,KAAkB;YAC9B,OAAO,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;QACxE,CAAC;QAEM,MAAM;YACX,OAAO,EAAE,CAAC,EAAE,IAAI,CAA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I,CAAC;QACd,CAAC;;IArFU,mBAAQ,WAsFpB,CAAA;AACH,CAAC,EAhKgB,UAAU,0BAAV,UAAU,QAgK1B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\nimport { JsonUtils } from \"@itwin/core-bentley\";\n\n/** Namespace containing types controlling how atmospheric scattering should be rendered.\n * @beta\n * The techniques used to render the atmosphere approximate the physical behavior of light when interacting with particles in the air (Rayleigh Scattering and Mie Scattering)\n * Presently, only Rayleigh Scattering is implemented here\n *\n * In a nutshell, this implementation samples atmospheric density along rays cast from the view and uses the samples to simulate the scattering of light toward the camera.\n * The amount of light scattered toward the camera is dependent on the amount of light scattered away from its original path from the sun, so rays must also be cast from the sample points to the sun.\n *\n * The effect can be computed on vertices (the default for the background map) and fragments (the default for the skybox, which is a ViewportQuad).\n * All coordinates are in view space.\n *\n * This implementation is adapted from equations outlined in \"Display of Clouds Taking into Account Multiple Anisotropic Scattering and Sky Light\", Nishita et al. 1993\n * which are further refined for use in GPU shaders in \"Photorealistic Real-Time Outdoor Light Scattering\", Hoffman and Preetham 2002.\n * These sources are also compiled in Chapter 16 of NVIDIA's \"GPU Gems 2\", which can be found online here:\n * https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering\n *\n * This implementation is also highly inspired by Sebastian Lague's Solar System project: https://github.com/SebLague/Solar-System/ and video: https://www.youtube.com/watch?v=DxfEbulyFcY\n * along with this ShaderToy replica: https://www.shadertoy.com/view/fltXD2.\n * Both of which are inspired by this Nvidia article on atmospheric scattering: https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering.\n */\nexport namespace Atmosphere {\n\n /** @internal JSON representation of a [[Wavelengths]] object */\n export interface WavelengthsProps {\n r: number;\n g: number;\n b: number;\n }\n\n /** @internal An immutable container of wavelength values for the red, green and blue pixel components. Values are in nanometers. */\n export class Wavelengths {\n public readonly r: number;\n public readonly g: number;\n public readonly b: number;\n\n /** Constructs from red, green, and blue wavelength values.\n * @param r Wavelength value for red\n * @param g Wavelength value for green\n * @param b Wavelength value for blue\n */\n constructor(props: WavelengthsProps) {\n this.r = Math.max(0, props.r);\n this.g = Math.max(0, props.g);\n this.b = Math.max(0, props.b);\n }\n\n public equals(other: Wavelengths): boolean {\n return this.r === other.r && this.g === other.g && this.b === other.b;\n }\n\n public toJSON(): WavelengthsProps {\n return { r: this.r, g: this.g, b: this.b };\n }\n\n public static fromJSON(json: WavelengthsProps | undefined): Wavelengths {\n let r = 0;\n let g = 0;\n let b = 0;\n if (undefined !== json) {\n if (typeof json.r === \"number\")\n r = json.r;\n if (typeof json.g === \"number\")\n g = json.g;\n if (typeof json.b === \"number\")\n b = json.b;\n }\n return new Wavelengths({ r, g, b });\n }\n }\n\n /** Describes the properties with which the atmospheric scattering effect should be drawn. Theses properties correspond to a physics-based approximation of atmospheric scattering phenomenons. */\n export interface Props {\n /** Whether the ground plane should be displayed. Defaults to false. */\n display?: boolean;\n /** @internal See [[Settings.atmosphereHeightAboveEarth]] */\n atmosphereHeightAboveEarth?: number;\n /** See [[Settings.exposure]] */\n exposure?: number;\n /** @internal See [[Settings.densityFalloff]] */\n densityFalloff?: number;\n /** @internal See [[Settings.minDensityHeightBelowEarth]] */\n depthBelowEarthForMaxDensity?: number;\n /** See [[Settings.numViewRaySamples]] */\n numViewRaySamples?: number;\n /** See [[Settings.numSunRaySamples]] */\n numSunRaySamples?: number;\n /** @internal See [[Settings.scatteringStrength]] */\n scatteringStrength?: number;\n /** @internal See [[Settings.wavelengths]] */\n wavelengths?: WavelengthsProps;\n }\n\n /** Describes the properties with which the atmospheric scattering effect should be drawn. Theses properties correspond to a physics-based approximation of atmospheric scattering phenomenons. */\n export class Settings {\n private static _defaultAtmosphereHeightAboveEarth: number = 100000.0;\n private static _defaultExposure: number = 2.0;\n private static _defaultDensityFalloff: number = 10.0;\n private static _defaultMinDensityHeightBelowEarth: 0.0;\n private static _defaultScatteringStrength: number = 100;\n private static _defaultWavelengths: Wavelengths = new Wavelengths({ r: 700.0, g: 530.0, b: 440.0 });\n\n private static _defaultNumViewRaySamples: number = 10;\n private static _highQualityNumViewRaySamples: number = 20;\n private static _defaultNumSunRaySamples: number = 5;\n\n public static readonly defaults = new Settings({});\n public static readonly highQuality = new Settings({ numViewRaySamples: this._highQualityNumViewRaySamples });\n\n /** @internal If defined, corresponds to the height in meters above the earth's pole at which the atmosphere terminates. Physically, this is the point at which there are no more air molecules to interfere with light transmission. Defaults to 100_000.0. */\n public readonly atmosphereHeightAboveEarth: number;\n /** If defined, this value is used to simulate the aperture of a camera. Higher values allow more light in. This value might need to be adjusted slightly in situations without much sunlight (like sunset) to brighten the image. Defaults to 2.0 */\n public readonly exposure: number;\n /** @internal If defined, controls the rate at which the air density decreases between the point it is the highest and the point is is the lowest. A higher value means a faster decrease in air density. Defaults to 10.0. */\n public readonly densityFalloff: number;\n /** @internal If defined, corresponds to the height in meters below the earth's pole at which the atmosphere is at its densest. Physically, this is the point at which there is the most air molecules to interfere with light transmission. Defaults to 0.0. */\n public readonly depthBelowEarthForMaxDensity: number;\n /** If defined, corresponds to the number of atmospheric density samples used to compute the amount of light scattered along each view ray. For each sample point, another ray will be cast toward the sun to compute the amount of light reaching the sample point. Higher values increase fidelity, but greatly decrease performance because sun rays must be cast from each additional sample point. The range is 1 to 40. Defaults to 10. */\n public readonly numViewRaySamples: number;\n /** If defined, corresponds to the number of atmospheric density samples uses to compute the amount of light scattered along each sun ray. Higher values increase fidelity slightly but greatly decrease performance. Minimal improvement is observable with values above 5. The range is 1 to 40. Defaults to 5. */\n public readonly numSunRaySamples: number;\n /** @internal If defined, controls how strongly the atmosphere's air diverts light. Higher values increase scattering intensity. Defaults to 100.0. */\n public readonly scatteringStrength: number;\n /** @internal If defined, corresponds the wavelengths of the red, green and blue color components in nanometers used to simulate how the atmosphere's air molecules affects light transmission. (See Rayleigh Scattering) Thus, a value of 470 for the red wavelength will make the red light component scatter as if it physically were a cyan light ray. The default value is {r:700.0, g:530.0, b:440.0}. */\n public readonly wavelengths: Wavelengths;\n\n public equals(other: Settings): boolean {\n if (this.atmosphereHeightAboveEarth !== other.atmosphereHeightAboveEarth)\n return false;\n if (this.exposure !== other.exposure)\n return false;\n if (this.densityFalloff !== other.densityFalloff)\n return false;\n if (this.depthBelowEarthForMaxDensity !== other.depthBelowEarthForMaxDensity)\n return false;\n if (this.numViewRaySamples !== other.numViewRaySamples)\n return false;\n if (this.numSunRaySamples !== other.numSunRaySamples)\n return false;\n if (this.scatteringStrength !== other.scatteringStrength)\n return false;\n if (!this.wavelengths.equals(other.wavelengths))\n return false;\n return true;\n }\n\n private constructor(json: Props) {\n this.atmosphereHeightAboveEarth = JsonUtils.asDouble(json.atmosphereHeightAboveEarth, Settings._defaultAtmosphereHeightAboveEarth);\n this.exposure = JsonUtils.asDouble(json.exposure, Settings._defaultExposure);\n this.densityFalloff = JsonUtils.asDouble(json.densityFalloff, Settings._defaultDensityFalloff);\n this.depthBelowEarthForMaxDensity = JsonUtils.asDouble(json.depthBelowEarthForMaxDensity, Settings._defaultMinDensityHeightBelowEarth);\n this.numViewRaySamples = JsonUtils.asDouble(json.numViewRaySamples, Settings._defaultNumViewRaySamples);\n this.numSunRaySamples = JsonUtils.asDouble(json.numSunRaySamples, Settings._defaultNumSunRaySamples);\n this.scatteringStrength = JsonUtils.asDouble(json.scatteringStrength, Settings._defaultScatteringStrength);\n this.wavelengths = Wavelengths.fromJSON(JsonUtils.asObject(json.wavelengths) ?? Settings._defaultWavelengths);\n }\n\n public static fromJSON(json?: Props) {\n if (undefined === json)\n return this.defaults;\n return new Settings(json);\n }\n\n public toJSON(display?: boolean): Props {\n const json: Props = {\n atmosphereHeightAboveEarth: this.atmosphereHeightAboveEarth,\n exposure: this.exposure,\n densityFalloff: this.densityFalloff,\n depthBelowEarthForMaxDensity: this.depthBelowEarthForMaxDensity,\n numViewRaySamples: this.numViewRaySamples,\n numSunRaySamples: this.numSunRaySamples,\n scatteringStrength: this.scatteringStrength,\n wavelengths: this.wavelengths.toJSON(),\n };\n\n if (undefined !== display)\n json.display = display;\n\n return json;\n }\n }\n}\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { GuidString } from "@itwin/core-bentley";
|
|
5
5
|
import { ChangesetIdWithIndex, ChangesetIndexOrId, LocalFileName } from "./ChangesetProps";
|
|
6
|
-
import {
|
|
6
|
+
import { OpenDbKey } from "./IModel";
|
|
7
7
|
import { IModelVersionProps } from "./IModelVersion";
|
|
8
8
|
/** The Id assigned to a briefcase by iModelHub, or [[BriefcaseIdValue.Unassigned]] .
|
|
9
9
|
* @public
|
|
@@ -70,7 +70,7 @@ export interface BriefcaseProps {
|
|
|
70
70
|
/** Properties for opening a local briefcase file via [BriefcaseDb.open]($backend)
|
|
71
71
|
* @public
|
|
72
72
|
*/
|
|
73
|
-
export interface OpenBriefcaseProps extends
|
|
73
|
+
export interface OpenBriefcaseProps extends OpenDbKey {
|
|
74
74
|
/** the full path to the briefcase file */
|
|
75
75
|
readonly fileName: LocalFileName;
|
|
76
76
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BriefcaseTypes.d.ts","sourceRoot":"","sources":["../../src/BriefcaseTypes.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BriefcaseTypes.d.ts","sourceRoot":"","sources":["../../src/BriefcaseTypes.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,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JAAqJ;IACrJ,+CAAY,CAAA;AACd,CAAC,EAPW,QAAQ,wBAAR,QAAQ,QAOnB;AAwID;;GAEG;AACH,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB,qJAAqJ;IACrJ,mFAAyB,CAAA;IAEzB,iKAAiK;IACjK,yFAA4B,CAAA;IAE5B,sMAAsM;IACtM,uDAAW,CAAA;IAEX,qFAAqF;IACrF,2DAAa,CAAA;AACf,CAAC,EAZW,aAAa,6BAAb,aAAa,QAYxB;AAED;;GAEG;AACH,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,0GAA0G;IAC1G,mDAAQ,CAAA;IAER,qDAAqD;IACrD,yDAAW,CAAA;AACb,CAAC,EANW,cAAc,8BAAd,cAAc,QAMzB;AAgBD;;;;GAIG;AACH,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACrB,sIAAsI;IACtI,qDAAQ,CAAA;IAER;;;OAGG;IACH,mEAAe,CAAA;IAEf,4IAA4I;IAC5I,yEAAkB,CAAA;IAElB,oIAAoI;IACpI,iDAAM,CAAA;IAEN,4FAA4F;IAC5F,iDAAM,CAAA;AACR,CAAC,EAlBW,WAAW,2BAAX,WAAW,QAkBtB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport { GuidString } from \"@itwin/core-bentley\";\nimport { ChangesetIdWithIndex, ChangesetIndexOrId, LocalFileName } from \"./ChangesetProps\";\nimport { IModelEncryptionProps, OpenDbKey } from \"./IModel\";\nimport { IModelVersionProps } from \"./IModelVersion\";\n\n/** The Id assigned to a briefcase by iModelHub, or [[BriefcaseIdValue.Unassigned]] .\n * @public\n * @extensions\n */\nexport type BriefcaseId = number;\n\n/** Values of [[BriefcaseId]] that have special meaning.\n * @public\n * @extensions\n */\nexport enum BriefcaseIdValue {\n /** Indicates an invalid/illegal BriefcaseId */\n Illegal = 0xffffffff,\n\n /** BriefcaseIds must be less than this value */\n Max = 1 << 24,\n\n /** All valid iModelHub issued BriefcaseIds will be equal or higher than this */\n FirstValid = 2,\n\n /** All valid iModelHub issued BriefcaseIds will be equal or lower than this */\n LastValid = BriefcaseIdValue.Max - 11,\n\n /**\n * The briefcase has not been assigned a unique Id by iModelHub. Only briefcases that have been assigned a unique BriefcaseId may create changesets,\n * because BriefcaseId is used to create unique ElementIds for new elements.\n *\n * The `Unassigned` briefcaseId is used for several purposes:\n * - **Snapshots**. Snapshot files are immutable copies of an iModel for archival or data exchange purposes. They can neither generate nor accept new changesets.\n * - **Checkpoints**. Checkpoints are Snapshots that represent a specific version on an iModel's timeline.\n * - **PullOnly**. A local briefcase file that may be used to \"slide\" along a timeline by applying incoming changesets.\n * They are always opened readonly except to apply changesets.\n * - **Standalone**. Standalone iModels are local files that are not connected to iModelHub, and therefore cannot accept or create changesets.\n */\n Unassigned = 0,\n}\n\n/** Whether a briefcase is editable or may only accept incoming changesets from iModelHub\n * @public\n * @extensions\n */\nexport enum SyncMode {\n /** Use a fixed version (i.e. a checkpoint). See [CheckpointManager]($backend) for preferred approach to using checkpoint files. */\n FixedVersion = 1,\n /** A briefcase that can be edited. A unique briefcaseId must be assigned by iModelHub. */\n PullAndPush = 2,\n /** use [BriefcaseIdValue.Unassigned](%backend). This makes a briefcase that can accept changesets from iModelHub but can never create changesets. */\n PullOnly = 3,\n}\n\n/**\n * Options to open a previously downloaded briefcase\n * @public\n */\nexport interface OpenBriefcaseOptions {\n /** open briefcase Readonly */\n readonly openAsReadOnly?: boolean;\n}\n\n/**\n * Properties that specify a briefcase within the local briefcase cache.\n * @see BriefcaseManager.getFileName\n * @public\n */\nexport interface BriefcaseProps {\n /** Id of the iModel */\n readonly iModelId: GuidString;\n\n /** BriefcaseId of the briefcase */\n readonly briefcaseId: BriefcaseId;\n}\n\n/** Properties for opening a local briefcase file via [BriefcaseDb.open]($backend)\n * @public\n */\nexport interface OpenBriefcaseProps extends IModelEncryptionProps, OpenDbKey { // eslint-disable-line @typescript-eslint/no-deprecated\n /** the full path to the briefcase file */\n readonly fileName: LocalFileName;\n /**\n * If true, open the briefcase readonly.\n * @note Readonly connections always hold a read transaction against the briefcase. That can cause the WAL file size to grow\n * unbounded if changes happen while they're open (see [Checkpoint starvation](https://www.sqlite.org/wal.html#avoiding_excessively_large_wal_files))\n * It is a good idea to close the readonly connection *before* closing the writeable connection so the WAL file will be deleted.\n */\n readonly readonly?: boolean;\n /** If true, open the briefcase readonly and monitor it for changes originating from another connection.\n * When such changes are detected, the default txn will be restarted.\n * The restart occurs only after the next iteration of the backend event loop, and will generate events that reflect the changes from the other connection.\n * This can be useful in contexts where the read-only connection is displaying a view of the contents of the briefcase while another, non-interactive program\n * is adding txns to the briefcase. It may not be reliable if the writable connection is undoing or redoing txns.\n * @note This cannot be used with cloud-based briefcases.\n */\n readonly watchForChanges?: boolean;\n}\n\n/** Properties of a local briefcase file, returned by [BriefcaseManager.getCachedBriefcases]($backend) and [BriefcaseManager.downloadBriefcase]($backend)\n * @public\n * @extensions\n */\nexport interface LocalBriefcaseProps {\n /** Full path of local file. */\n readonly fileName: LocalFileName;\n\n /** The iTwin containing the iModel. */\n readonly iTwinId: GuidString;\n\n /** The iModelId. */\n readonly iModelId: GuidString;\n\n /** The briefcaseId. */\n readonly briefcaseId: BriefcaseId;\n\n /** The current changesetId.\n * @note ChangeSet Ids are string hash values based on the ChangeSet's content and parent.\n */\n readonly changeset: ChangesetIdWithIndex;\n\n /** Size of the briefcase file in bytes */\n readonly fileSize: number;\n}\n\n/** Properties for downloading a briefcase to a local file, from iModelHub.\n * @public\n * @extensions\n */\nexport interface RequestNewBriefcaseProps {\n /** iTwin that the iModel belongs to. */\n readonly iTwinId: GuidString;\n\n /** The iModelId for the new briefcase. */\n readonly iModelId: GuidString;\n\n /** Full path of local file to store the briefcase. If undefined, a file will be created in the briefcase cache, and this member will be filled with the full path to the file.\n * Callers can use this to open the briefcase after the download completes.\n * @note this member is both an input and an output.\n */\n readonly fileName?: LocalFileName;\n\n /**\n * The BriefcaseId for the new briefcase. If undefined, a new BriefcaseId will be acquired from iModelHub before the download, and is returned in this member.\n * @note To download a briefcase that can accept but not create new changesets (sometimes referred to as \"pull only\" briefcases), set this value to [[BriefcaseIdValue.Unassigned]].\n * After downloading, you can merely delete unassigned briefcase files when they are no longer needed. Assigned BriefcaseIds should be released (via [BriefcaseManager.releaseBriefcase]($backend) )\n * when you are done with them.\n * @note this member is both an input and an output.\n *\n */\n briefcaseId?: BriefcaseId;\n\n /** Id of the change set of the new briefcase. If undefined, use latest. */\n asOf?: IModelVersionProps;\n}\n\n/**\n * Arguments to open a Checkpoint directly from its cloud container\n * @beta\n */\nexport interface OpenCheckpointArgs {\n readonly iTwinId: GuidString;\n\n /** Id of the iModel */\n readonly iModelId: GuidString;\n\n /** changeset for the checkpoint. If undefined, attempt to open the checkpoint for the latest changeset. */\n readonly changeset?: ChangesetIndexOrId;\n}\n\n/**\n * Manages the download of a briefcase\n * @public\n */\nexport interface BriefcaseDownloader {\n /** Id of the briefcase being downloaded */\n readonly briefcaseId: BriefcaseId;\n\n /** the name of the local file for the briefcase */\n readonly fileName: LocalFileName;\n\n /** Promise that resolves when the download completes. await this to complete the download */\n readonly downloadPromise: Promise<void>;\n\n /** Request cancellation of the download */\n readonly requestCancel: () => Promise<boolean>;\n}\n\n/** Option to control the validation and upgrade of domain schemas in the Db\n * @beta\n */\nexport enum DomainOptions {\n /** Domain schemas will be validated for any required upgrades. Any errors will be reported back, and cause the application to fail opening the Db */\n CheckRequiredUpgrades = 0,\n\n /** Domain schemas will be validated for any required or optional upgrades. Any errors will be reported back, and cause the application to fail opening the Db */\n CheckRecommendedUpgrades = 1,\n\n /** Domain schemas will be upgraded if necessary. However, only compatible schema upgrades will be allowed - these are typically additions of classes, properties, and changes to custom attributes */\n Upgrade = 2,\n\n /** Domain schemas will neither be validated nor be upgraded. Used only internally */\n SkipCheck = 3,\n}\n\n/** Options that control whether a profile upgrade should be performed when opening a Db\n * @beta\n */\nexport enum ProfileOptions {\n /** No profile upgrade will be performed. If a profile upgrade was required, opening the file will fail */\n None = 0,\n\n /** Profile upgrade will be performed if necessary */\n Upgrade = 1,\n}\n\n/** Arguments to validate and update the profile and domain schemas when opening a Db\n * @beta\n */\nexport interface UpgradeOptions {\n /** Option to control the validation and upgrade of domain schemas in the Db */\n readonly domain?: DomainOptions;\n\n /** Options that control whether a profile upgrade should be performed when opening a file */\n readonly profile?: ProfileOptions;\n\n /** Options that will allow data transform during Profile/Domain schema upgrade */\n readonly schemaLockHeld?: boolean;\n}\n\n/**\n * The state of the schemas in the Db compared with what the current version of the software expects\n * Note: The state may vary depending on whether the Db is to be opened ReadOnly or ReadWrite.\n * @public\n */\nexport enum SchemaState {\n /** The schemas in the Db are up-to-date, and do not need to be upgraded before opening it with the current version of the software */\n UpToDate,\n\n /** It's required that the schemas in the Db be upgraded before it can be opened with the current version of the software.\n * This may happen in read-write scenarios where the application requires a newer version of the schemas to be in place before\n * it can write data based on that new schema.\n */\n UpgradeRequired,\n\n /** It's recommended, but not necessary that the schemas in the Db be upgraded before opening it with the current version of the software */\n UpgradeRecommended,\n\n /** The schemas in the Db are too old to be opened by the current version of the software. Upgrade using the API is not possible. */\n TooOld,\n\n /** The schemas in the Db are too new to be opened by the current version of the software */\n TooNew,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BriefcaseTypes.js","sourceRoot":"","sources":["../../src/BriefcaseTypes.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAaH;;;GAGG;AACH,IAAY,gBAyBX;AAzBD,WAAY,gBAAgB;IAC1B,+CAA+C;IAC/C,sEAAoB,CAAA;IAEpB,gDAAgD;IAChD,4DAAa,CAAA;IAEb,gFAAgF;IAChF,mEAAc,CAAA;IAEd,+EAA+E;IAC/E,wEAAqC,CAAA;IAErC;;;;;;;;;;OAUG;IACH,mEAAc,CAAA;AAChB,CAAC,EAzBW,gBAAgB,gCAAhB,gBAAgB,QAyB3B;AAED;;;GAGG;AACH,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,mIAAmI;IACnI,uDAAgB,CAAA;IAChB,0FAA0F;IAC1F,qDAAe,CAAA;IACf,qJAAqJ;IACrJ,+CAAY,CAAA;AACd,CAAC,EAPW,QAAQ,wBAAR,QAAQ,QAOnB;AAwID;;GAEG;AACH,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB,qJAAqJ;IACrJ,mFAAyB,CAAA;IAEzB,iKAAiK;IACjK,yFAA4B,CAAA;IAE5B,sMAAsM;IACtM,uDAAW,CAAA;IAEX,qFAAqF;IACrF,2DAAa,CAAA;AACf,CAAC,EAZW,aAAa,6BAAb,aAAa,QAYxB;AAED;;GAEG;AACH,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,0GAA0G;IAC1G,mDAAQ,CAAA;IAER,qDAAqD;IACrD,yDAAW,CAAA;AACb,CAAC,EANW,cAAc,8BAAd,cAAc,QAMzB;AAgBD;;;;GAIG;AACH,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACrB,sIAAsI;IACtI,qDAAQ,CAAA;IAER;;;OAGG;IACH,mEAAe,CAAA;IAEf,4IAA4I;IAC5I,yEAAkB,CAAA;IAElB,oIAAoI;IACpI,iDAAM,CAAA;IAEN,4FAA4F;IAC5F,iDAAM,CAAA;AACR,CAAC,EAlBW,WAAW,2BAAX,WAAW,QAkBtB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport { GuidString } from \"@itwin/core-bentley\";\nimport { ChangesetIdWithIndex, ChangesetIndexOrId, LocalFileName } from \"./ChangesetProps\";\nimport { OpenDbKey } from \"./IModel\";\nimport { IModelVersionProps } from \"./IModelVersion\";\n\n/** The Id assigned to a briefcase by iModelHub, or [[BriefcaseIdValue.Unassigned]] .\n * @public\n * @extensions\n */\nexport type BriefcaseId = number;\n\n/** Values of [[BriefcaseId]] that have special meaning.\n * @public\n * @extensions\n */\nexport enum BriefcaseIdValue {\n /** Indicates an invalid/illegal BriefcaseId */\n Illegal = 0xffffffff,\n\n /** BriefcaseIds must be less than this value */\n Max = 1 << 24,\n\n /** All valid iModelHub issued BriefcaseIds will be equal or higher than this */\n FirstValid = 2,\n\n /** All valid iModelHub issued BriefcaseIds will be equal or lower than this */\n LastValid = BriefcaseIdValue.Max - 11,\n\n /**\n * The briefcase has not been assigned a unique Id by iModelHub. Only briefcases that have been assigned a unique BriefcaseId may create changesets,\n * because BriefcaseId is used to create unique ElementIds for new elements.\n *\n * The `Unassigned` briefcaseId is used for several purposes:\n * - **Snapshots**. Snapshot files are immutable copies of an iModel for archival or data exchange purposes. They can neither generate nor accept new changesets.\n * - **Checkpoints**. Checkpoints are Snapshots that represent a specific version on an iModel's timeline.\n * - **PullOnly**. A local briefcase file that may be used to \"slide\" along a timeline by applying incoming changesets.\n * They are always opened readonly except to apply changesets.\n * - **Standalone**. Standalone iModels are local files that are not connected to iModelHub, and therefore cannot accept or create changesets.\n */\n Unassigned = 0,\n}\n\n/** Whether a briefcase is editable or may only accept incoming changesets from iModelHub\n * @public\n * @extensions\n */\nexport enum SyncMode {\n /** Use a fixed version (i.e. a checkpoint). See [CheckpointManager]($backend) for preferred approach to using checkpoint files. */\n FixedVersion = 1,\n /** A briefcase that can be edited. A unique briefcaseId must be assigned by iModelHub. */\n PullAndPush = 2,\n /** use [BriefcaseIdValue.Unassigned](%backend). This makes a briefcase that can accept changesets from iModelHub but can never create changesets. */\n PullOnly = 3,\n}\n\n/**\n * Options to open a previously downloaded briefcase\n * @public\n */\nexport interface OpenBriefcaseOptions {\n /** open briefcase Readonly */\n readonly openAsReadOnly?: boolean;\n}\n\n/**\n * Properties that specify a briefcase within the local briefcase cache.\n * @see BriefcaseManager.getFileName\n * @public\n */\nexport interface BriefcaseProps {\n /** Id of the iModel */\n readonly iModelId: GuidString;\n\n /** BriefcaseId of the briefcase */\n readonly briefcaseId: BriefcaseId;\n}\n\n/** Properties for opening a local briefcase file via [BriefcaseDb.open]($backend)\n * @public\n */\nexport interface OpenBriefcaseProps extends OpenDbKey {\n /** the full path to the briefcase file */\n readonly fileName: LocalFileName;\n /**\n * If true, open the briefcase readonly.\n * @note Readonly connections always hold a read transaction against the briefcase. That can cause the WAL file size to grow\n * unbounded if changes happen while they're open (see [Checkpoint starvation](https://www.sqlite.org/wal.html#avoiding_excessively_large_wal_files))\n * It is a good idea to close the readonly connection *before* closing the writeable connection so the WAL file will be deleted.\n */\n readonly readonly?: boolean;\n /** If true, open the briefcase readonly and monitor it for changes originating from another connection.\n * When such changes are detected, the default txn will be restarted.\n * The restart occurs only after the next iteration of the backend event loop, and will generate events that reflect the changes from the other connection.\n * This can be useful in contexts where the read-only connection is displaying a view of the contents of the briefcase while another, non-interactive program\n * is adding txns to the briefcase. It may not be reliable if the writable connection is undoing or redoing txns.\n * @note This cannot be used with cloud-based briefcases.\n */\n readonly watchForChanges?: boolean;\n}\n\n/** Properties of a local briefcase file, returned by [BriefcaseManager.getCachedBriefcases]($backend) and [BriefcaseManager.downloadBriefcase]($backend)\n * @public\n * @extensions\n */\nexport interface LocalBriefcaseProps {\n /** Full path of local file. */\n readonly fileName: LocalFileName;\n\n /** The iTwin containing the iModel. */\n readonly iTwinId: GuidString;\n\n /** The iModelId. */\n readonly iModelId: GuidString;\n\n /** The briefcaseId. */\n readonly briefcaseId: BriefcaseId;\n\n /** The current changesetId.\n * @note ChangeSet Ids are string hash values based on the ChangeSet's content and parent.\n */\n readonly changeset: ChangesetIdWithIndex;\n\n /** Size of the briefcase file in bytes */\n readonly fileSize: number;\n}\n\n/** Properties for downloading a briefcase to a local file, from iModelHub.\n * @public\n * @extensions\n */\nexport interface RequestNewBriefcaseProps {\n /** iTwin that the iModel belongs to. */\n readonly iTwinId: GuidString;\n\n /** The iModelId for the new briefcase. */\n readonly iModelId: GuidString;\n\n /** Full path of local file to store the briefcase. If undefined, a file will be created in the briefcase cache, and this member will be filled with the full path to the file.\n * Callers can use this to open the briefcase after the download completes.\n * @note this member is both an input and an output.\n */\n readonly fileName?: LocalFileName;\n\n /**\n * The BriefcaseId for the new briefcase. If undefined, a new BriefcaseId will be acquired from iModelHub before the download, and is returned in this member.\n * @note To download a briefcase that can accept but not create new changesets (sometimes referred to as \"pull only\" briefcases), set this value to [[BriefcaseIdValue.Unassigned]].\n * After downloading, you can merely delete unassigned briefcase files when they are no longer needed. Assigned BriefcaseIds should be released (via [BriefcaseManager.releaseBriefcase]($backend) )\n * when you are done with them.\n * @note this member is both an input and an output.\n *\n */\n briefcaseId?: BriefcaseId;\n\n /** Id of the change set of the new briefcase. If undefined, use latest. */\n asOf?: IModelVersionProps;\n}\n\n/**\n * Arguments to open a Checkpoint directly from its cloud container\n * @beta\n */\nexport interface OpenCheckpointArgs {\n readonly iTwinId: GuidString;\n\n /** Id of the iModel */\n readonly iModelId: GuidString;\n\n /** changeset for the checkpoint. If undefined, attempt to open the checkpoint for the latest changeset. */\n readonly changeset?: ChangesetIndexOrId;\n}\n\n/**\n * Manages the download of a briefcase\n * @public\n */\nexport interface BriefcaseDownloader {\n /** Id of the briefcase being downloaded */\n readonly briefcaseId: BriefcaseId;\n\n /** the name of the local file for the briefcase */\n readonly fileName: LocalFileName;\n\n /** Promise that resolves when the download completes. await this to complete the download */\n readonly downloadPromise: Promise<void>;\n\n /** Request cancellation of the download */\n readonly requestCancel: () => Promise<boolean>;\n}\n\n/** Option to control the validation and upgrade of domain schemas in the Db\n * @beta\n */\nexport enum DomainOptions {\n /** Domain schemas will be validated for any required upgrades. Any errors will be reported back, and cause the application to fail opening the Db */\n CheckRequiredUpgrades = 0,\n\n /** Domain schemas will be validated for any required or optional upgrades. Any errors will be reported back, and cause the application to fail opening the Db */\n CheckRecommendedUpgrades = 1,\n\n /** Domain schemas will be upgraded if necessary. However, only compatible schema upgrades will be allowed - these are typically additions of classes, properties, and changes to custom attributes */\n Upgrade = 2,\n\n /** Domain schemas will neither be validated nor be upgraded. Used only internally */\n SkipCheck = 3,\n}\n\n/** Options that control whether a profile upgrade should be performed when opening a Db\n * @beta\n */\nexport enum ProfileOptions {\n /** No profile upgrade will be performed. If a profile upgrade was required, opening the file will fail */\n None = 0,\n\n /** Profile upgrade will be performed if necessary */\n Upgrade = 1,\n}\n\n/** Arguments to validate and update the profile and domain schemas when opening a Db\n * @beta\n */\nexport interface UpgradeOptions {\n /** Option to control the validation and upgrade of domain schemas in the Db */\n readonly domain?: DomainOptions;\n\n /** Options that control whether a profile upgrade should be performed when opening a file */\n readonly profile?: ProfileOptions;\n\n /** Options that will allow data transform during Profile/Domain schema upgrade */\n readonly schemaLockHeld?: boolean;\n}\n\n/**\n * The state of the schemas in the Db compared with what the current version of the software expects\n * Note: The state may vary depending on whether the Db is to be opened ReadOnly or ReadWrite.\n * @public\n */\nexport enum SchemaState {\n /** The schemas in the Db are up-to-date, and do not need to be upgraded before opening it with the current version of the software */\n UpToDate,\n\n /** It's required that the schemas in the Db be upgraded before it can be opened with the current version of the software.\n * This may happen in read-write scenarios where the application requires a newer version of the schemas to be in place before\n * it can write data based on that new schema.\n */\n UpgradeRequired,\n\n /** It's recommended, but not necessary that the schemas in the Db be upgraded before opening it with the current version of the software */\n UpgradeRecommended,\n\n /** The schemas in the Db are too old to be opened by the current version of the software. Upgrade using the API is not possible. */\n TooOld,\n\n /** The schemas in the Db are too new to be opened by the current version of the software */\n TooNew,\n}\n"]}
|
package/lib/cjs/ClipStyle.js
CHANGED
|
@@ -18,6 +18,8 @@ const ColorDef_1 = require("./ColorDef");
|
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
20
|
class CutStyle {
|
|
21
|
+
/** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */
|
|
22
|
+
static { this.defaults = new CutStyle(); }
|
|
21
23
|
constructor(viewflags, hiddenLine, appearance) {
|
|
22
24
|
this.viewflags = viewflags ?? {};
|
|
23
25
|
if (hiddenLine && !hiddenLine.matchesDefaults)
|
|
@@ -63,8 +65,6 @@ class CutStyle {
|
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
exports.CutStyle = CutStyle;
|
|
66
|
-
/** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */
|
|
67
|
-
CutStyle.defaults = new CutStyle();
|
|
68
68
|
/** As part of a [[ClipStyle]], describes how to colorize geometry intersecting the clip planes.
|
|
69
69
|
* @note Edges are highlighted only if [[ClipStyle.ClipIntersectionStyle]] is `true`.
|
|
70
70
|
* @public
|
|
@@ -81,6 +81,7 @@ class ClipIntersectionStyle {
|
|
|
81
81
|
return this.defaults;
|
|
82
82
|
return new ClipIntersectionStyle(color, width);
|
|
83
83
|
}
|
|
84
|
+
static { this.defaults = new ClipIntersectionStyle(); }
|
|
84
85
|
static fromJSON(props) {
|
|
85
86
|
if (props === undefined) {
|
|
86
87
|
return ClipIntersectionStyle.defaults;
|
|
@@ -108,12 +109,13 @@ class ClipIntersectionStyle {
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
exports.ClipIntersectionStyle = ClipIntersectionStyle;
|
|
111
|
-
ClipIntersectionStyle.defaults = new ClipIntersectionStyle();
|
|
112
112
|
/** Describes symbology and behavior applied to a [ClipVector]($core-geometry) when applied to a [ViewState]($frontend) or [[ModelClipGroup]].
|
|
113
113
|
* @see [[DisplayStyleSettings.clipStyle]].
|
|
114
114
|
* @public
|
|
115
115
|
*/
|
|
116
116
|
class ClipStyle {
|
|
117
|
+
/** The default style, which overrides none of the view's settings. */
|
|
118
|
+
static { this.defaults = new ClipStyle(false, false, CutStyle.defaults, undefined, undefined, undefined); }
|
|
117
119
|
constructor(produceCutGeometry, colorizeIntersection, cutStyle, inside, outside, intersectionStyle) {
|
|
118
120
|
this.produceCutGeometry = produceCutGeometry;
|
|
119
121
|
this.colorizeIntersection = colorizeIntersection;
|
|
@@ -181,6 +183,4 @@ class ClipStyle {
|
|
|
181
183
|
}
|
|
182
184
|
}
|
|
183
185
|
exports.ClipStyle = ClipStyle;
|
|
184
|
-
/** The default style, which overrides none of the view's settings. */
|
|
185
|
-
ClipStyle.defaults = new ClipStyle(false, false, CutStyle.defaults, undefined, undefined, undefined);
|
|
186
186
|
//# sourceMappingURL=ClipStyle.js.map
|
package/lib/cjs/ClipStyle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipStyle.js","sourceRoot":"","sources":["../../src/ClipStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAwD;AAExD,yCAAqD;AACrD,6CAA0C;AAC1C,yDAA+E;AAC/E,yCAAsC;AAgBtC;;;GAGG;AACH,MAAa,QAAQ;IAWnB,YAAoB,SAAuC,EAAE,UAAgC,EAAE,UAA8B;QAC3H,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,EAAE,CAAC;QACjC,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe;YAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE/B,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe;YAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED,6CAA6C;IACtC,MAAM,CAAC,MAAM,CAAC,SAAuC,EAAE,UAAgC,EAAE,UAA8B;QAC5H,IAAI,CAAC,SAAS,IAAI,wBAAS,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;YACpJ,OAAO,IAAI,QAAQ,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;QAEzD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEM,MAAM,CAAC,QAAQ,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C;QAEpC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACxC,IAAI,QAAQ,EAAE,CAAC;YACb,IAAA,qBAAM,EAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;YACvC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC5B,CAAC;QAED,IAAI,IAAI,CAAC,WAAW;YAClB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QAEhD,IAAI,IAAI,CAAC,YAAY;YACnB,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;QAElD,IAAI,IAAI,CAAC,iBAAiB;YACxB,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAE5D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,uHAAuH;IACvH,IAAW,eAAe;QACxB,IAAI,IAAI,KAAK,SAAS,CAAC,QAAQ;YAC7B,OAAO,IAAI,CAAC;QAEd,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;IACvK,CAAC;;AA/GH,8BAgHC;AA9FC,sEAAsE;AAC/C,kBAAQ,GAAG,IAAI,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { assert, JsonUtils } from \"@itwin/core-bentley\";\nimport { ViewFlagOverrides } from \"./ViewFlags\";\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\nimport { HiddenLine } from \"./HiddenLine\";\nimport { FeatureAppearance, FeatureAppearanceProps } from \"./FeatureSymbology\";\nimport { ColorDef } from \"./ColorDef\";\n\n/** Wire format describing a [[CutStyle]] applied to section-cut geometry produced at intersections with a view's [ClipVector]($core-geometry).\n * @see [[ClipStyleProps.cutStyle]].\n * @public\n * @extensions\n */\nexport interface CutStyleProps {\n /** If defined, overrides aspects of the view's [[ViewFlags]] when drawing the cut geometry. */\n viewflags?: ViewFlagOverrides;\n /** If defined, overrides the view's [[HiddenLine.Settings]] when drawing the cut geometry. */\n hiddenLine?: HiddenLine.SettingsProps;\n /** If defined, overrides aspects of the cut geometry's symbology. */\n appearance?: FeatureAppearanceProps;\n}\n\n/** As part of a [[ClipStyle]], describes how section-cut graphics should be displayed.\n * @note Section-cut graphics are only produced if [[ClipStyle.produceCutGeometry]] is `true`.\n * @public\n */\nexport class CutStyle {\n /** Selectively overrides some of the view's [[ViewFlags]] when drawing the section-cut graphics. */\n public readonly viewflags: Readonly<ViewFlagOverrides>;\n /** If defined, overrides the settings the view uses to draw the edges of the section-cut graphics. */\n public readonly hiddenLine?: HiddenLine.Settings;\n /** If defined, overrides aspects of the symbology of the section-cut graphics. */\n public readonly appearance?: FeatureAppearance;\n\n /** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */\n public static readonly defaults = new CutStyle();\n\n private constructor(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance) {\n this.viewflags = viewflags ?? {};\n if (hiddenLine && !hiddenLine.matchesDefaults)\n this.hiddenLine = hiddenLine;\n\n if (appearance && !appearance.matchesDefaults)\n this.appearance = appearance;\n }\n\n /** Create a CutStyle from its components. */\n public static create(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance): CutStyle {\n if ((viewflags && JsonUtils.isNonEmptyObject(viewflags)) || (hiddenLine && !hiddenLine.matchesDefaults) || (appearance && !appearance.matchesDefaults))\n return new CutStyle(viewflags, hiddenLine, appearance);\n\n return this.defaults;\n }\n\n public static fromJSON(props?: CutStyleProps): CutStyle {\n if (JsonUtils.isNonEmptyObject(props)) {\n const viewflags = { ...props?.viewflags };\n const hiddenLine = props?.hiddenLine ? HiddenLine.Settings.fromJSON(props.hiddenLine) : undefined;\n const appearance = props?.appearance ? FeatureAppearance.fromJSON(props.appearance) : undefined;\n\n return this.create(viewflags, hiddenLine, appearance);\n } else {\n return this.defaults;\n }\n }\n\n /** Return JSON representation. The representation is `undefined` if this style matches the default style. */\n public toJSON(): CutStyleProps | undefined {\n if (this.matchesDefaults)\n return undefined;\n\n const props: CutStyleProps = {};\n if (JsonUtils.isNonEmptyObject(this.viewflags))\n props.viewflags = this.viewflags;\n\n if (this.hiddenLine && !this.hiddenLine.matchesDefaults)\n props.hiddenLine = this.hiddenLine?.toJSON();\n\n if (this.appearance && !this.appearance.matchesDefaults)\n props.appearance = this.appearance.toJSON();\n\n return props;\n }\n\n /** Returns true if this style matches the default style - that is, it overrides none of the view's settings. */\n public get matchesDefaults(): boolean {\n if (this === CutStyle.defaults)\n return true;\n\n return !JsonUtils.isNonEmptyObject(this.viewflags) && (!this.hiddenLine || this.hiddenLine.matchesDefaults) && (!this.appearance || this.appearance.matchesDefaults);\n }\n}\n\n/** Wire format describing a [[ClipIntersectionStyle]].\n * @see [[ClipStyleProps.ClipIntersectionStyle]].\n * @public\n * @extensions\n */\nexport interface ClipIntersectionStyleProps {\n /** Color to apply to intersection of geometry and clip planes, default white */\n color?: RgbColorProps;\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\n width?: number;\n}\n\n/** As part of a [[ClipStyle]], describes how to colorize geometry intersecting the clip planes.\n * @note Edges are highlighted only if [[ClipStyle.ClipIntersectionStyle]] is `true`.\n * @public\n * @extensions\n */\nexport class ClipIntersectionStyle {\n /** Color to apply to intersection of geometry and clip planes, default white */\n public readonly color: RgbColor;\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\n public readonly width: number;\n\n private constructor(color: RgbColor = RgbColor.fromColorDef(ColorDef.white), width: number = 1) {\n this.color = color;\n this.width = width;\n }\n /** Create a highlight from its components. */\n public static create(color?: RgbColor, width?: number): ClipIntersectionStyle {\n if (!color && !width)\n return this.defaults;\n\n return new ClipIntersectionStyle(color, width);\n }\n\n public static readonly defaults = new ClipIntersectionStyle();\n\n public static fromJSON(props?: ClipIntersectionStyleProps): ClipIntersectionStyle {\n if (props === undefined) {\n return ClipIntersectionStyle.defaults;\n }\n\n const color = props.color ? RgbColor.fromJSON(props.color) : RgbColor.fromColorDef(ColorDef.white);\n const width = props.width ? props.width : 1;\n return new ClipIntersectionStyle(color, width);\n }\n\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\n public toJSON(): ClipIntersectionStyleProps | undefined {\n const props: ClipIntersectionStyleProps = {};\n\n if (this.matchesDefaults) {\n return undefined;\n }\n\n if (this.color)\n props.color = this.color.toJSON();\n\n if (this.width)\n props.width = this.width;\n\n return props;\n }\n\n public get matchesDefaults(): boolean {\n if (this === ClipIntersectionStyle.defaults)\n return true;\n\n return !this.color && !this.width;\n }\n}\n\n/** Arguments supplied to [[ClipStyle.create]].\n * @public\n * @extensions\n */\nexport interface ClipStyleCreateArgs {\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n produceCutGeometry?: boolean;\n /** If `true`, intersection of geometry and clip planes will be colorized */\n colorizeIntersection?: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n cutStyle?: CutStyle;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n insideColor?: RgbColor;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n outsideColor?: RgbColor;\n /** Controls the style of the intersection of geometry and clip planes */\n intersectionStyle?: ClipIntersectionStyle;\n}\n\n/** Wire format describing a [[ClipStyle]].\n * @see [[DisplayStyleSettingsProps.clipStyle]].\n * @public\n * @extensions\n */\nexport interface ClipStyleProps {\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n produceCutGeometry?: boolean;\n /** If 'true', intersection of geometry and clip planes will be colorized */\n colorizeIntersection?: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n cutStyle?: CutStyleProps;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n insideColor?: RgbColorProps;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n outsideColor?: RgbColorProps;\n /** Controls the style of the intersection of geometry and clip planes */\n intersectionStyle?: ClipIntersectionStyleProps;\n}\n\n/** Describes symbology and behavior applied to a [ClipVector]($core-geometry) when applied to a [ViewState]($frontend) or [[ModelClipGroup]].\n * @see [[DisplayStyleSettings.clipStyle]].\n * @public\n */\nexport class ClipStyle {\n /** If `true`, geometry will be produced at the clip planes.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n public readonly produceCutGeometry: boolean;\n /** If 'true', intersection of geometry and clip planes will be colorized */\n public readonly colorizeIntersection: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n public readonly cutStyle: CutStyle;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n public readonly insideColor?: RgbColor;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n public readonly outsideColor?: RgbColor;\n /** Controls the style of the intersection of geometry and clip planes */\n public readonly intersectionStyle?: ClipIntersectionStyle;\n\n /** The default style, which overrides none of the view's settings. */\n public static readonly defaults = new ClipStyle(false, false, CutStyle.defaults, undefined, undefined, undefined);\n\n private constructor(produceCutGeometry: boolean, colorizeIntersection: boolean, cutStyle: CutStyle, inside: RgbColor | undefined, outside: RgbColor | undefined, intersectionStyle: ClipIntersectionStyle | undefined) {\n this.produceCutGeometry = produceCutGeometry;\n this.colorizeIntersection = colorizeIntersection;\n this.cutStyle = cutStyle;\n this.insideColor = inside;\n this.outsideColor = outside;\n this.intersectionStyle = intersectionStyle;\n }\n\n /** @deprecated in 4.x. Use [[create(style: ClipStyleCreateArgs]] */\n public static create(produceCutGeometry: boolean, cutStyle: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle;\n\n /** Create a style from its components. */\n public static create(style: ClipStyleCreateArgs): ClipStyle;\n\n /** @internal */\n public static create(styleOrProduceCutGeometry: ClipStyleCreateArgs | boolean, cutStyle?: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle {\n\n if (typeof styleOrProduceCutGeometry === \"boolean\") {\n cutStyle = cutStyle === undefined ? CutStyle.defaults : cutStyle;\n\n if (!styleOrProduceCutGeometry && cutStyle.matchesDefaults && !insideColor && !outsideColor) {\n return this.defaults;\n }\n\n return new ClipStyle(styleOrProduceCutGeometry, false, cutStyle, insideColor, outsideColor, undefined);\n }\n\n const style = styleOrProduceCutGeometry;\n if (!style.produceCutGeometry && !style.colorizeIntersection && (!style.cutStyle || style.cutStyle.matchesDefaults) && !style.insideColor && !style.outsideColor && !style.intersectionStyle)\n return this.defaults;\n\n const produceCutGeometry = style.produceCutGeometry ? true : false;\n const colorizeIntersection = style.colorizeIntersection ? true : false;\n cutStyle = style.cutStyle === undefined ? CutStyle.defaults : style.cutStyle;\n\n return new ClipStyle(produceCutGeometry, colorizeIntersection, cutStyle, style.insideColor, style.outsideColor, style.intersectionStyle);\n }\n\n public static fromJSON(props?: ClipStyleProps): ClipStyle {\n if (JsonUtils.isNonEmptyObject(props)) {\n const produceCutGeometry = props.produceCutGeometry ?? false;\n const colorizeIntersection = props.colorizeIntersection ? true : false;\n const cutStyle = CutStyle.fromJSON(props.cutStyle);\n const insideColor = props.insideColor ? RgbColor.fromJSON(props.insideColor) : undefined;\n const outsideColor = props.outsideColor ? RgbColor.fromJSON(props.outsideColor) : undefined;\n const intersectionStyle = props.intersectionStyle ? ClipIntersectionStyle.fromJSON(props.intersectionStyle) : undefined;\n\n return this.create({produceCutGeometry, colorizeIntersection, cutStyle, insideColor, outsideColor, intersectionStyle});\n }\n\n return this.defaults;\n }\n\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\n public toJSON(): ClipStyleProps | undefined {\n if (this.matchesDefaults)\n return undefined;\n\n const props: ClipStyleProps = {};\n if (this.produceCutGeometry)\n props.produceCutGeometry = true;\n\n if (this.colorizeIntersection)\n props.colorizeIntersection = true;\n\n const cutStyle = this.cutStyle.toJSON();\n if (cutStyle) {\n assert(!this.cutStyle.matchesDefaults);\n props.cutStyle = cutStyle;\n }\n\n if (this.insideColor)\n props.insideColor = this.insideColor.toJSON();\n\n if (this.outsideColor)\n props.outsideColor = this.outsideColor.toJSON();\n\n if (this.intersectionStyle)\n props.intersectionStyle = this.intersectionStyle.toJSON();\n\n return props;\n }\n\n /** Returns true if this style matches the [[ClipStyle.defaults]] - that is, it overrides no settings from the view. */\n public get matchesDefaults(): boolean {\n if (this === ClipStyle.defaults)\n return true;\n\n return !this.produceCutGeometry && !this.colorizeIntersection && !this.insideColor && !this.outsideColor && this.cutStyle.matchesDefaults && !this.intersectionStyle;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ClipStyle.js","sourceRoot":"","sources":["../../src/ClipStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAwD;AAExD,yCAAqD;AACrD,6CAA0C;AAC1C,yDAA+E;AAC/E,yCAAsC;AAg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IAAI,CAAC,YAAY;YACnB,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;QAElD,IAAI,IAAI,CAAC,iBAAiB;YACxB,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAE5D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,uHAAuH;IACvH,IAAW,eAAe;QACxB,IAAI,IAAI,KAAK,SAAS,CAAC,QAAQ;YAC7B,OAAO,IAAI,CAAC;QAEd,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;IACvK,CAAC;;AA/GH,8BAgHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { assert, JsonUtils } from \"@itwin/core-bentley\";\nimport { ViewFlagOverrides } from \"./ViewFlags\";\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\nimport { HiddenLine } from \"./HiddenLine\";\nimport { FeatureAppearance, FeatureAppearanceProps } from \"./FeatureSymbology\";\nimport { ColorDef } from \"./ColorDef\";\n\n/** Wire format describing a [[CutStyle]] applied to section-cut geometry produced at intersections with a view's [ClipVector]($core-geometry).\n * @see [[ClipStyleProps.cutStyle]].\n * @public\n * @extensions\n */\nexport interface CutStyleProps {\n /** If defined, overrides aspects of the view's [[ViewFlags]] when drawing the cut geometry. */\n viewflags?: ViewFlagOverrides;\n /** If defined, overrides the view's [[HiddenLine.Settings]] when drawing the cut geometry. */\n hiddenLine?: HiddenLine.SettingsProps;\n /** If defined, overrides aspects of the cut geometry's symbology. */\n appearance?: FeatureAppearanceProps;\n}\n\n/** As part of a [[ClipStyle]], describes how section-cut graphics should be displayed.\n * @note Section-cut graphics are only produced if [[ClipStyle.produceCutGeometry]] is `true`.\n * @public\n */\nexport class CutStyle {\n /** Selectively overrides some of the view's [[ViewFlags]] when drawing the section-cut graphics. */\n public readonly viewflags: Readonly<ViewFlagOverrides>;\n /** If defined, overrides the settings the view uses to draw the edges of the section-cut graphics. */\n public readonly hiddenLine?: HiddenLine.Settings;\n /** If defined, overrides aspects of the symbology of the section-cut graphics. */\n public readonly appearance?: FeatureAppearance;\n\n /** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */\n public static readonly defaults = new CutStyle();\n\n private constructor(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance) {\n this.viewflags = viewflags ?? {};\n if (hiddenLine && !hiddenLine.matchesDefaults)\n this.hiddenLine = hiddenLine;\n\n if (appearance && !appearance.matchesDefaults)\n this.appearance = appearance;\n }\n\n /** Create a CutStyle from its components. */\n public static create(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance): CutStyle {\n if ((viewflags && JsonUtils.isNonEmptyObject(viewflags)) || (hiddenLine && !hiddenLine.matchesDefaults) || (appearance && !appearance.matchesDefaults))\n return new CutStyle(viewflags, hiddenLine, appearance);\n\n return this.defaults;\n }\n\n public static fromJSON(props?: CutStyleProps): CutStyle {\n if (JsonUtils.isNonEmptyObject(props)) {\n const viewflags = { ...props?.viewflags };\n const hiddenLine = props?.hiddenLine ? HiddenLine.Settings.fromJSON(props.hiddenLine) : undefined;\n const appearance = props?.appearance ? FeatureAppearance.fromJSON(props.appearance) : undefined;\n\n return this.create(viewflags, hiddenLine, appearance);\n } else {\n return this.defaults;\n }\n }\n\n /** Return JSON representation. The representation is `undefined` if this style matches the default style. */\n public toJSON(): CutStyleProps | undefined {\n if (this.matchesDefaults)\n return undefined;\n\n const props: CutStyleProps = {};\n if (JsonUtils.isNonEmptyObject(this.viewflags))\n props.viewflags = this.viewflags;\n\n if (this.hiddenLine && !this.hiddenLine.matchesDefaults)\n props.hiddenLine = this.hiddenLine?.toJSON();\n\n if (this.appearance && !this.appearance.matchesDefaults)\n props.appearance = this.appearance.toJSON();\n\n return props;\n }\n\n /** Returns true if this style matches the default style - that is, it overrides none of the view's settings. */\n public get matchesDefaults(): boolean {\n if (this === CutStyle.defaults)\n return true;\n\n return !JsonUtils.isNonEmptyObject(this.viewflags) && (!this.hiddenLine || this.hiddenLine.matchesDefaults) && (!this.appearance || this.appearance.matchesDefaults);\n }\n}\n\n/** Wire format describing a [[ClipIntersectionStyle]].\n * @see [[ClipStyleProps.ClipIntersectionStyle]].\n * @public\n * @extensions\n */\nexport interface ClipIntersectionStyleProps {\n /** Color to apply to intersection of geometry and clip planes, default white */\n color?: RgbColorProps;\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\n width?: number;\n}\n\n/** As part of a [[ClipStyle]], describes how to colorize geometry intersecting the clip planes.\n * @note Edges are highlighted only if [[ClipStyle.ClipIntersectionStyle]] is `true`.\n * @public\n * @extensions\n */\nexport class ClipIntersectionStyle {\n /** Color to apply to intersection of geometry and clip planes, default white */\n public readonly color: RgbColor;\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\n public readonly width: number;\n\n private constructor(color: RgbColor = RgbColor.fromColorDef(ColorDef.white), width: number = 1) {\n this.color = color;\n this.width = width;\n }\n /** Create a highlight from its components. */\n public static create(color?: RgbColor, width?: number): ClipIntersectionStyle {\n if (!color && !width)\n return this.defaults;\n\n return new ClipIntersectionStyle(color, width);\n }\n\n public static readonly defaults = new ClipIntersectionStyle();\n\n public static fromJSON(props?: ClipIntersectionStyleProps): ClipIntersectionStyle {\n if (props === undefined) {\n return ClipIntersectionStyle.defaults;\n }\n\n const color = props.color ? RgbColor.fromJSON(props.color) : RgbColor.fromColorDef(ColorDef.white);\n const width = props.width ? props.width : 1;\n return new ClipIntersectionStyle(color, width);\n }\n\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\n public toJSON(): ClipIntersectionStyleProps | undefined {\n const props: ClipIntersectionStyleProps = {};\n\n if (this.matchesDefaults) {\n return undefined;\n }\n\n if (this.color)\n props.color = this.color.toJSON();\n\n if (this.width)\n props.width = this.width;\n\n return props;\n }\n\n public get matchesDefaults(): boolean {\n if (this === ClipIntersectionStyle.defaults)\n return true;\n\n return !this.color && !this.width;\n }\n}\n\n/** Arguments supplied to [[ClipStyle.create]].\n * @public\n * @extensions\n */\nexport interface ClipStyleCreateArgs {\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n produceCutGeometry?: boolean;\n /** If `true`, intersection of geometry and clip planes will be colorized */\n colorizeIntersection?: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n cutStyle?: CutStyle;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n insideColor?: RgbColor;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n outsideColor?: RgbColor;\n /** Controls the style of the intersection of geometry and clip planes */\n intersectionStyle?: ClipIntersectionStyle;\n}\n\n/** Wire format describing a [[ClipStyle]].\n * @see [[DisplayStyleSettingsProps.clipStyle]].\n * @public\n * @extensions\n */\nexport interface ClipStyleProps {\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n produceCutGeometry?: boolean;\n /** If 'true', intersection of geometry and clip planes will be colorized */\n colorizeIntersection?: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n cutStyle?: CutStyleProps;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n insideColor?: RgbColorProps;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n outsideColor?: RgbColorProps;\n /** Controls the style of the intersection of geometry and clip planes */\n intersectionStyle?: ClipIntersectionStyleProps;\n}\n\n/** Describes symbology and behavior applied to a [ClipVector]($core-geometry) when applied to a [ViewState]($frontend) or [[ModelClipGroup]].\n * @see [[DisplayStyleSettings.clipStyle]].\n * @public\n */\nexport class ClipStyle {\n /** If `true`, geometry will be produced at the clip planes.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n public readonly produceCutGeometry: boolean;\n /** If 'true', intersection of geometry and clip planes will be colorized */\n public readonly colorizeIntersection: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n public readonly cutStyle: CutStyle;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n public readonly insideColor?: RgbColor;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n public readonly outsideColor?: RgbColor;\n /** Controls the style of the intersection of geometry and clip planes */\n public readonly intersectionStyle?: ClipIntersectionStyle;\n\n /** The default style, which overrides none of the view's settings. */\n public static readonly defaults = new ClipStyle(false, false, CutStyle.defaults, undefined, undefined, undefined);\n\n private constructor(produceCutGeometry: boolean, colorizeIntersection: boolean, cutStyle: CutStyle, inside: RgbColor | undefined, outside: RgbColor | undefined, intersectionStyle: ClipIntersectionStyle | undefined) {\n this.produceCutGeometry = produceCutGeometry;\n this.colorizeIntersection = colorizeIntersection;\n this.cutStyle = cutStyle;\n this.insideColor = inside;\n this.outsideColor = outside;\n this.intersectionStyle = intersectionStyle;\n }\n\n /** @deprecated in 4.x. Use [[create(style: ClipStyleCreateArgs]] */\n public static create(produceCutGeometry: boolean, cutStyle: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle;\n\n /** Create a style from its components. */\n public static create(style: ClipStyleCreateArgs): ClipStyle;\n\n /** @internal */\n public static create(styleOrProduceCutGeometry: ClipStyleCreateArgs | boolean, cutStyle?: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle {\n\n if (typeof styleOrProduceCutGeometry === \"boolean\") {\n cutStyle = cutStyle === undefined ? CutStyle.defaults : cutStyle;\n\n if (!styleOrProduceCutGeometry && cutStyle.matchesDefaults && !insideColor && !outsideColor) {\n return this.defaults;\n }\n\n return new ClipStyle(styleOrProduceCutGeometry, false, cutStyle, insideColor, outsideColor, undefined);\n }\n\n const style = styleOrProduceCutGeometry;\n if (!style.produceCutGeometry && !style.colorizeIntersection && (!style.cutStyle || style.cutStyle.matchesDefaults) && !style.insideColor && !style.outsideColor && !style.intersectionStyle)\n return this.defaults;\n\n const produceCutGeometry = style.produceCutGeometry ? true : false;\n const colorizeIntersection = style.colorizeIntersection ? true : false;\n cutStyle = style.cutStyle === undefined ? CutStyle.defaults : style.cutStyle;\n\n return new ClipStyle(produceCutGeometry, colorizeIntersection, cutStyle, style.insideColor, style.outsideColor, style.intersectionStyle);\n }\n\n public static fromJSON(props?: ClipStyleProps): ClipStyle {\n if (JsonUtils.isNonEmptyObject(props)) {\n const produceCutGeometry = props.produceCutGeometry ?? false;\n const colorizeIntersection = props.colorizeIntersection ? true : false;\n const cutStyle = CutStyle.fromJSON(props.cutStyle);\n const insideColor = props.insideColor ? RgbColor.fromJSON(props.insideColor) : undefined;\n const outsideColor = props.outsideColor ? RgbColor.fromJSON(props.outsideColor) : undefined;\n const intersectionStyle = props.intersectionStyle ? ClipIntersectionStyle.fromJSON(props.intersectionStyle) : undefined;\n\n return this.create({produceCutGeometry, colorizeIntersection, cutStyle, insideColor, outsideColor, intersectionStyle});\n }\n\n return this.defaults;\n }\n\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\n public toJSON(): ClipStyleProps | undefined {\n if (this.matchesDefaults)\n return undefined;\n\n const props: ClipStyleProps = {};\n if (this.produceCutGeometry)\n props.produceCutGeometry = true;\n\n if (this.colorizeIntersection)\n props.colorizeIntersection = true;\n\n const cutStyle = this.cutStyle.toJSON();\n if (cutStyle) {\n assert(!this.cutStyle.matchesDefaults);\n props.cutStyle = cutStyle;\n }\n\n if (this.insideColor)\n props.insideColor = this.insideColor.toJSON();\n\n if (this.outsideColor)\n props.outsideColor = this.outsideColor.toJSON();\n\n if (this.intersectionStyle)\n props.intersectionStyle = this.intersectionStyle.toJSON();\n\n return props;\n }\n\n /** Returns true if this style matches the [[ClipStyle.defaults]] - that is, it overrides no settings from the view. */\n public get matchesDefaults(): boolean {\n if (this === ClipStyle.defaults)\n return true;\n\n return !this.produceCutGeometry && !this.colorizeIntersection && !this.insideColor && !this.outsideColor && this.cutStyle.matchesDefaults && !this.intersectionStyle;\n }\n}\n"]}
|