@itwin/core-common 4.8.0-dev.4 → 4.8.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 +55 -1
- package/lib/cjs/BriefcaseTypes.d.ts +1 -1
- package/lib/cjs/BriefcaseTypes.js +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/ColorDef.js +1 -1
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/ElementProps.d.ts +4 -4
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/FeatureSymbology.d.ts +4 -0
- package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
- package/lib/cjs/FeatureSymbology.js +10 -0
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.d.ts +1 -1
- package/lib/cjs/FeatureTable.d.ts.map +1 -1
- package/lib/cjs/FeatureTable.js +13 -13
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/IModel.d.ts +5 -1
- package/lib/cjs/IModel.d.ts.map +1 -1
- package/lib/cjs/IModel.js +14 -3
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.d.ts +37 -7
- package/lib/cjs/IModelError.d.ts.map +1 -1
- package/lib/cjs/IModelError.js +27 -11
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/PlanarClipMask.d.ts +16 -6
- package/lib/cjs/PlanarClipMask.d.ts.map +1 -1
- package/lib/cjs/PlanarClipMask.js +13 -4
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/Render.d.ts +9 -6
- package/lib/cjs/Render.d.ts.map +1 -1
- package/lib/cjs/Render.js +6 -1
- package/lib/cjs/Render.js.map +1 -1
- package/lib/cjs/RenderMaterial.d.ts +8 -1
- package/lib/cjs/RenderMaterial.d.ts.map +1 -1
- package/lib/cjs/RenderMaterial.js +6 -1
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderTexture.d.ts +5 -1
- package/lib/cjs/RenderTexture.d.ts.map +1 -1
- package/lib/cjs/RenderTexture.js +7 -1
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/TextureMapping.d.ts +6 -0
- package/lib/cjs/TextureMapping.d.ts.map +1 -1
- package/lib/cjs/TextureMapping.js +44 -0
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.d.ts +3 -1
- package/lib/cjs/annotation/TextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js +3 -2
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/core-common.d.ts +1 -1
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +1 -1
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.d.ts +8 -6
- package/lib/cjs/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/{esm → cjs/internal}/Snapping.d.ts +6 -6
- package/lib/cjs/internal/Snapping.d.ts.map +1 -0
- package/lib/cjs/internal/Snapping.js.map +1 -0
- package/lib/cjs/internal/cross-package.d.ts +2 -0
- package/lib/cjs/internal/cross-package.d.ts.map +1 -0
- package/lib/cjs/internal/cross-package.js +7 -0
- package/lib/cjs/internal/cross-package.js.map +1 -0
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +2 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +5 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +3 -2
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/BriefcaseTypes.d.ts +1 -1
- package/lib/esm/BriefcaseTypes.js +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/ColorDef.js +1 -1
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/ElementProps.d.ts +4 -4
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/FeatureSymbology.d.ts +4 -0
- package/lib/esm/FeatureSymbology.d.ts.map +1 -1
- package/lib/esm/FeatureSymbology.js +10 -0
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.d.ts +1 -1
- package/lib/esm/FeatureTable.d.ts.map +1 -1
- package/lib/esm/FeatureTable.js +13 -13
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/IModel.d.ts +5 -1
- package/lib/esm/IModel.d.ts.map +1 -1
- package/lib/esm/IModel.js +14 -3
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.d.ts +37 -7
- package/lib/esm/IModelError.d.ts.map +1 -1
- package/lib/esm/IModelError.js +26 -10
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/PlanarClipMask.d.ts +16 -6
- package/lib/esm/PlanarClipMask.d.ts.map +1 -1
- package/lib/esm/PlanarClipMask.js +13 -4
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/Render.d.ts +9 -6
- package/lib/esm/Render.d.ts.map +1 -1
- package/lib/esm/Render.js +6 -1
- package/lib/esm/Render.js.map +1 -1
- package/lib/esm/RenderMaterial.d.ts +8 -1
- package/lib/esm/RenderMaterial.d.ts.map +1 -1
- package/lib/esm/RenderMaterial.js +6 -1
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RenderTexture.d.ts +5 -1
- package/lib/esm/RenderTexture.d.ts.map +1 -1
- package/lib/esm/RenderTexture.js +7 -1
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/TextureMapping.d.ts +6 -0
- package/lib/esm/TextureMapping.d.ts.map +1 -1
- package/lib/esm/TextureMapping.js +44 -0
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.d.ts +3 -1
- package/lib/esm/annotation/TextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js +3 -2
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/core-common.d.ts +1 -1
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +1 -1
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.d.ts +8 -6
- package/lib/esm/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/{cjs → esm/internal}/Snapping.d.ts +6 -6
- package/lib/esm/internal/Snapping.d.ts.map +1 -0
- package/lib/esm/internal/Snapping.js.map +1 -0
- package/lib/esm/internal/cross-package.d.ts +2 -0
- package/lib/esm/internal/cross-package.d.ts.map +1 -0
- package/lib/esm/internal/cross-package.js +6 -0
- package/lib/esm/internal/cross-package.js.map +1 -0
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts +2 -1
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +5 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js +1 -1
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +3 -2
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/package.json +6 -6
- package/ThirdPartyNotices.md +0 -30
- package/lib/cjs/Snapping.d.ts.map +0 -1
- package/lib/cjs/Snapping.js.map +0 -1
- package/lib/esm/Snapping.d.ts.map +0 -1
- package/lib/esm/Snapping.js.map +0 -1
- /package/lib/cjs/{Snapping.js → internal/Snapping.js} +0 -0
- /package/lib/esm/{Snapping.js → internal/Snapping.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelError.d.ts","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"IModelError.d.ts","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAmB,YAAY,EAAE,eAAe,EACxH,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,GACtF,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAC,mBAAmB,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAE3F;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,QAAQ,GAAG,aAAa,GAAG,eAAe,GAAG,eAAe,CAAC;AAE5G;;;GAGG;AACH,qBAAa,WAAY,SAAQ,YAAY;gBACxB,WAAW,EAAE,iBAAiB,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe;CAG3G;AAED;;GAEG;AACH,oBAAY,SAAS;IACnB,gCAAgC;IAChC,IAAI,IAAI;IACR,mJAAmJ;IACnJ,MAAM,IAAI;IACV;;OAEG;IACH,SAAS,IAAI;CACd;AAED;;;EAGE;AACF,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB;;;SAGK;IACL,KAAK,EAAE,SAAS,CAAC;IACjB,qDAAqD;IACrD,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,WAAW;IAC7C,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;gBAChC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe,EAAE,gBAAgB,CAAC,EAAE,eAAe,EAAE;CAKjG;AAED,cAAc;AACd,qBAAa,WAAY,SAAQ,WAAW;gBACvB,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAIxD;AAED,cAAc;AACd,qBAAa,kBAAmB,SAAQ,WAAW;gBAC9B,OAAO,EAAE,MAAM;CAInC;AAED,cAAc;AACd,qBAAa,YAAa,SAAQ,WAAW;gBACxB,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe;CAIrG;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;;CAI9C"}
|
package/lib/cjs/IModelError.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module iModels
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.NoContentError = exports.
|
|
10
|
+
exports.NoContentError = exports.BackendError = exports.ServerTimeoutError = exports.ServerError = exports.ConflictingLocksError = exports.LockState = exports.IModelError = exports.ChangeSetStatus = exports.DbResult = exports.BriefcaseStatus = exports.IModelStatus = exports.BentleyError = exports.BentleyStatus = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
var core_bentley_2 = require("@itwin/core-bentley");
|
|
13
13
|
Object.defineProperty(exports, "BentleyStatus", { enumerable: true, get: function () { return core_bentley_2.BentleyStatus; } });
|
|
@@ -26,6 +26,32 @@ class IModelError extends core_bentley_1.BentleyError {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
exports.IModelError = IModelError;
|
|
29
|
+
/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
var LockState;
|
|
33
|
+
(function (LockState) {
|
|
34
|
+
/** The element is not locked */
|
|
35
|
+
LockState[LockState["None"] = 0] = "None";
|
|
36
|
+
/** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */
|
|
37
|
+
LockState[LockState["Shared"] = 1] = "Shared";
|
|
38
|
+
/** A Lock that permits modifications to an element and blocks other users from making modifications to it.
|
|
39
|
+
* Holding an exclusive lock on an "owner" (a model or a parent element), implicitly exclusively locks all its members.
|
|
40
|
+
*/
|
|
41
|
+
LockState[LockState["Exclusive"] = 2] = "Exclusive";
|
|
42
|
+
})(LockState || (exports.LockState = LockState = {}));
|
|
43
|
+
/**
|
|
44
|
+
* An error raised when there is a lock conflict detected.
|
|
45
|
+
* Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
class ConflictingLocksError extends IModelError {
|
|
49
|
+
constructor(message, getMetaData, conflictingLocks) {
|
|
50
|
+
super(core_bentley_1.IModelHubStatus.LockOwnedByAnotherBriefcase, message, getMetaData);
|
|
51
|
+
this.conflictingLocks = conflictingLocks;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.ConflictingLocksError = ConflictingLocksError;
|
|
29
55
|
/** @public */
|
|
30
56
|
class ServerError extends IModelError {
|
|
31
57
|
constructor(errorNumber, message) {
|
|
@@ -50,16 +76,6 @@ class BackendError extends IModelError {
|
|
|
50
76
|
}
|
|
51
77
|
}
|
|
52
78
|
exports.BackendError = BackendError;
|
|
53
|
-
/**
|
|
54
|
-
* Channel constraint error
|
|
55
|
-
* @alpha
|
|
56
|
-
*/
|
|
57
|
-
class ChannelConstraintError extends IModelError {
|
|
58
|
-
constructor(message, getMetaData) {
|
|
59
|
-
super(core_bentley_1.RepositoryStatus.ChannelConstraintViolation, message, getMetaData);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.ChannelConstraintError = ChannelConstraintError;
|
|
63
79
|
/** Intended for API "no content" semantics where the error case should not trigger application failure monitoring systems.
|
|
64
80
|
* @public
|
|
65
81
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelError.js","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAE6B;AAE7B,oDAE6B;AAD3B,6GAAA,aAAa,OAAA;AAAE,4GAAA,YAAY,OAAA;AAAE,4GAAA,YAAY,OAAA;AAAE,+GAAA,eAAe,OAAA;AAAE,wGAAA,QAAQ,OAAA;AAAE,+GAAA,eAAe,OAAA;AAWvF;;;GAGG;AACH,MAAa,WAAY,SAAQ,2BAAY;IAC3C,YAAmB,WAAuC,EAAE,OAAe,EAAE,WAA6B;QACxG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;CACF;AAJD,kCAIC;AAED,cAAc;AACd,MAAa,WAAY,SAAQ,WAAW;IAC1C,YAAmB,WAAmB,EAAE,OAAe;QACrD,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,iBAAiB,WAAW,GAAG,CAAC;IAC9C,CAAC;CACF;AALD,kCAKC;AAED,cAAc;AACd,MAAa,kBAAmB,SAAQ,WAAW;IACjD,YAAmB,OAAe;QAChC,KAAK,CAAC,2BAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AALD,gDAKC;AAED,cAAc;AACd,MAAa,YAAa,SAAQ,WAAW;IAC3C,YAAmB,WAAmB,EAAE,IAAY,EAAE,OAAe,EAAE,WAA6B;QACl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AC9C,CAAC;CACF;AALD,kCAKC;AAED,cAAc;AACd,MAAa,kBAAmB,SAAQ,WAAW;IACjD,YAAmB,OAAe;QAChC,KAAK,CAAC,2BAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AALD,gDAKC;AAED,cAAc;AACd,MAAa,YAAa,SAAQ,WAAW;IAC3C,YAAmB,WAAmB,EAAE,IAAY,EAAE,OAAe,EAAE,WAA6B;QAClG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AALD,oCAKC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,WAAW;IAC7C;QACE,KAAK,CAAC,2BAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC9C,CAAC;CACF;AAJD,wCAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport {\r\n BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, IModelHubStatus, IModelStatus, LoggingMetaData,\r\n} from \"@itwin/core-bentley\";\r\n\r\nexport {\r\n BentleyStatus, BentleyError, IModelStatus, BriefcaseStatus, DbResult, ChangeSetStatus,\r\n} from \"@itwin/core-bentley\";\r\n\r\nexport type {GetMetaDataFunction, LogFunction, LoggingMetaData} from \"@itwin/core-bentley\";\r\n\r\n/** Numeric values for common errors produced by iTwin.js APIs, typically provided by [[IModelError]].\r\n * The values within each of these `enum`s are guaranteed not to conflict with one another.\r\n * @public\r\n */\r\nexport type IModelErrorNumber = IModelStatus | DbResult | BentleyStatus | BriefcaseStatus | ChangeSetStatus;\r\n\r\n/** The error type thrown by this module.\r\n * @see [[IModelErrorNumber]] for commonly-used error codes.\r\n * @public\r\n */\r\nexport class IModelError extends BentleyError {\r\n public constructor(errorNumber: IModelErrorNumber | number, message: string, getMetaData?: LoggingMetaData) {\r\n super(errorNumber, message, getMetaData);\r\n }\r\n}\r\n\r\n/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).\r\n * @public\r\n */\r\nexport enum LockState {\r\n /** The element is not locked */\r\n None = 0,\r\n /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */\r\n Shared = 1,\r\n /** A Lock that permits modifications to an element and blocks other users from making modifications to it.\r\n * Holding an exclusive lock on an \"owner\" (a model or a parent element), implicitly exclusively locks all its members.\r\n */\r\n Exclusive = 2,\r\n}\r\n\r\n/** Detailed information about a particular object Lock that is causing the Lock update conflict.\r\n * An example of a lock update conflict would be attempting to use [LockControl.acquireLocks]($backend) on an object that is already locked by another Briefcase.\r\n * @public\r\n*/\r\nexport interface ConflictingLock {\r\n /** Id of the object that is causing conflict. */\r\n objectId: string;\r\n /**\r\n * The level of conflicting lock. Possible values are {@link LockState.Shared}, {@link LockState.Exclusive}.\r\n * See {@link LockState}.\r\n */\r\n state: LockState;\r\n /** An array of Briefcase ids that hold this lock. */\r\n briefcaseIds: number[];\r\n}\r\n\r\n/**\r\n * An error raised when there is a lock conflict detected.\r\n * Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.\r\n * @public\r\n */\r\nexport class ConflictingLocksError extends IModelError {\r\n public conflictingLocks?: ConflictingLock[];\r\n constructor(message: string, getMetaData?: LoggingMetaData, conflictingLocks?: ConflictingLock[]) {\r\n super(IModelHubStatus.LockOwnedByAnotherBriefcase, message, getMetaData);\r\n this.conflictingLocks = conflictingLocks;\r\n }\r\n\r\n}\r\n\r\n/** @public */\r\nexport class ServerError extends IModelError {\r\n public constructor(errorNumber: number, message: string) {\r\n super(errorNumber, message);\r\n this.name = `Server error (${errorNumber})`;\r\n }\r\n}\r\n\r\n/** @public */\r\nexport class ServerTimeoutError extends ServerError {\r\n public constructor(message: string) {\r\n super(IModelStatus.ServerTimeout, message);\r\n this.name = \"Server timeout error\";\r\n }\r\n}\r\n\r\n/** @public */\r\nexport class BackendError extends IModelError {\r\n public constructor(errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData) {\r\n super(errorNumber, message, getMetaData);\r\n this.name = name;\r\n }\r\n}\r\n\r\n/** Intended for API \"no content\" semantics where the error case should not trigger application failure monitoring systems.\r\n * @public\r\n */\r\nexport class NoContentError extends IModelError {\r\n public constructor() {\r\n super(IModelStatus.NoContent, \"No Content\");\r\n }\r\n}\r\n"]}
|
|
@@ -12,15 +12,24 @@ export declare enum PlanarClipMaskMode {
|
|
|
12
12
|
/** Mask based on priority. Different types of models have different default priorities as enumerated by [[PlanarClipMaskPriority]].
|
|
13
13
|
* For example, background maps have the lowest priority, so they are masked by all other types, while design models have the highest priority and are therefore never masked.
|
|
14
14
|
* The priority of a reality model can be overridden by [[PlanarClipMaskSettings.priority]]. This is useful to allow one reality model to mask another overlapping one.
|
|
15
|
+
* Everything visible in the view creates the mask, so turning off models, categories, or elements (via fully transparent overrides) will make things not be in the mask.
|
|
15
16
|
*/
|
|
16
17
|
Priority = 1,
|
|
17
|
-
/** Indicates that masks should be produced from the geometry in a set of [GeometricModel]($backend)s.
|
|
18
|
+
/** Indicates that masks should be produced from the geometry in a set of [GeometricModel]($backend)s, regardless of what model is on or off in the view.
|
|
19
|
+
* However, things that are off from category settings or element feature overrides in the view will not be in the mask for these models.
|
|
20
|
+
*/
|
|
18
21
|
Models = 2,
|
|
19
|
-
/** Indicates that masks should be produced from geometry belonging to a set of subcategories.
|
|
22
|
+
/** Indicates that masks should be produced from geometry belonging to a set of subcategories.
|
|
23
|
+
* View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.
|
|
24
|
+
*/
|
|
20
25
|
IncludeSubCategories = 3,
|
|
21
|
-
/** Indicates that masks should be produced from the geometry of a set of [GeometricElement]($backend)s.
|
|
26
|
+
/** Indicates that masks should be produced from the geometry of a set of [GeometricElement]($backend)s.
|
|
27
|
+
* View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.
|
|
28
|
+
*/
|
|
22
29
|
IncludeElements = 4,
|
|
23
|
-
/** Indicates that masks should be produced from the geometry of all [GeometricElement]($backend)s in a view, **except** for a specified set of excluded elements.
|
|
30
|
+
/** Indicates that masks should be produced from the geometry of all [GeometricElement]($backend)s in a view, **except** for a specified set of excluded elements.
|
|
31
|
+
* View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.
|
|
32
|
+
*/
|
|
24
33
|
ExcludeElements = 5
|
|
25
34
|
}
|
|
26
35
|
/** The default priority values for a [[PlanarClipMaskSettings]], based on model type. Models with a lower priority are masked by models with a higher priority.
|
|
@@ -136,13 +145,14 @@ export interface PriorityPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {
|
|
|
136
145
|
export declare class PlanarClipMaskSettings {
|
|
137
146
|
/** Specifies how the mask geometry is produced. */
|
|
138
147
|
readonly mode: PlanarClipMaskMode;
|
|
139
|
-
/** For any mode other than [[PlanarClipMaskMode.Priority]], the Ids of the [GeometricModel]($backend)s containing the geometry used to produce the mask
|
|
140
|
-
*
|
|
148
|
+
/** For any mode other than [[PlanarClipMaskMode.Priority]], the Ids of the [GeometricModel]($backend)s containing the geometry used to produce the mask,
|
|
149
|
+
* and if `undefined`, no mask geometry will be created.
|
|
141
150
|
* The mask geometry can be filtered by [[subCategoryOrElementIds]].
|
|
142
151
|
*/
|
|
143
152
|
readonly modelIds?: OrderedId64Iterable;
|
|
144
153
|
/** For [[PlanarClipMaskMode.IncludeElements]] or [[PlanarClipMaskMode.ExcludedElements]], the Ids of the [GeometricElement]($backend)s to include or exclude from masking;
|
|
145
154
|
* for [[PlanarClipMaskMode.IncludeSubCategories]], the Ids of the subcategories whose geometry contributes to the mask.
|
|
155
|
+
* If undefined, Modes IncludeSubCategories, IncludeElements, and ExcludeElements behave like Models mode.
|
|
146
156
|
*/
|
|
147
157
|
readonly subCategoryOrElementIds?: OrderedId64Iterable;
|
|
148
158
|
/** For [[PlanarClipMaskMode.Priority]], the priority value. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanarClipMask.d.ts","sourceRoot":"","sources":["../../src/PlanarClipMask.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAEzF;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,kBAAkB;IAClB,IAAI,IAAI;IACR
|
|
1
|
+
{"version":3,"file":"PlanarClipMask.d.ts","sourceRoot":"","sources":["../../src/PlanarClipMask.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAEzF;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,kBAAkB;IAClB,IAAI,IAAI;IACR;;;;OAIG;IACH,QAAQ,IAAI;IACZ;;OAEG;IACH,MAAM,IAAI;IACV;;OAEG;IACH,oBAAoB,IAAI;IACxB;;OAEG;IACH,eAAe,IAAI;IACnB;;OAEG;IACH,eAAe,IAAI;CACpB;AAED;;;;GAIG;AACH,oBAAY,sBAAsB;IAChC,sBAAsB;IACtB,aAAa,QAAQ;IACrB,6EAA6E;IAC7E,kBAAkB,QAAQ;IAC1B,4CAA4C;IAC5C,YAAY,IAAI;IAChB,yDAAyD;IACzD,WAAW,OAAO;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,IAAI,EAAE,kBAAkB,CA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YpK,sEAAsE;IAC/D,MAAM,IAAI,mBAAmB;IAoBpC,0CAA0C;IAC1C,IAAW,OAAO,IAAI,OAAO,CAE5B;IAEM,MAAM,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO;IASrD;;;OAGG;IACI,KAAK,CAAC,YAAY,CAAC,EAAE,mBAAmB,GAAG,sBAAsB;IAUxE,OAAO;IAeP,oDAAoD;IACpD,OAAc,QAAQ,yBAAuD;CAC9E"}
|
|
@@ -20,15 +20,24 @@ var PlanarClipMaskMode;
|
|
|
20
20
|
/** Mask based on priority. Different types of models have different default priorities as enumerated by [[PlanarClipMaskPriority]].
|
|
21
21
|
* For example, background maps have the lowest priority, so they are masked by all other types, while design models have the highest priority and are therefore never masked.
|
|
22
22
|
* The priority of a reality model can be overridden by [[PlanarClipMaskSettings.priority]]. This is useful to allow one reality model to mask another overlapping one.
|
|
23
|
+
* Everything visible in the view creates the mask, so turning off models, categories, or elements (via fully transparent overrides) will make things not be in the mask.
|
|
23
24
|
*/
|
|
24
25
|
PlanarClipMaskMode[PlanarClipMaskMode["Priority"] = 1] = "Priority";
|
|
25
|
-
/** Indicates that masks should be produced from the geometry in a set of [GeometricModel]($backend)s.
|
|
26
|
+
/** Indicates that masks should be produced from the geometry in a set of [GeometricModel]($backend)s, regardless of what model is on or off in the view.
|
|
27
|
+
* However, things that are off from category settings or element feature overrides in the view will not be in the mask for these models.
|
|
28
|
+
*/
|
|
26
29
|
PlanarClipMaskMode[PlanarClipMaskMode["Models"] = 2] = "Models";
|
|
27
|
-
/** Indicates that masks should be produced from geometry belonging to a set of subcategories.
|
|
30
|
+
/** Indicates that masks should be produced from geometry belonging to a set of subcategories.
|
|
31
|
+
* View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.
|
|
32
|
+
*/
|
|
28
33
|
PlanarClipMaskMode[PlanarClipMaskMode["IncludeSubCategories"] = 3] = "IncludeSubCategories";
|
|
29
|
-
/** Indicates that masks should be produced from the geometry of a set of [GeometricElement]($backend)s.
|
|
34
|
+
/** Indicates that masks should be produced from the geometry of a set of [GeometricElement]($backend)s.
|
|
35
|
+
* View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.
|
|
36
|
+
*/
|
|
30
37
|
PlanarClipMaskMode[PlanarClipMaskMode["IncludeElements"] = 4] = "IncludeElements";
|
|
31
|
-
/** Indicates that masks should be produced from the geometry of all [GeometricElement]($backend)s in a view, **except** for a specified set of excluded elements.
|
|
38
|
+
/** Indicates that masks should be produced from the geometry of all [GeometricElement]($backend)s in a view, **except** for a specified set of excluded elements.
|
|
39
|
+
* View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.
|
|
40
|
+
*/
|
|
32
41
|
PlanarClipMaskMode[PlanarClipMaskMode["ExcludeElements"] = 5] = "ExcludeElements";
|
|
33
42
|
})(PlanarClipMaskMode || (exports.PlanarClipMaskMode = PlanarClipMaskMode = {}));
|
|
34
43
|
/** The default priority values for a [[PlanarClipMaskSettings]], based on model type. Models with a lower priority are masked by models with a higher priority.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanarClipMask.js","sourceRoot":"","sources":["../../src/PlanarClipMask.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyF;AAEzF;;;GAGG;AACH,IAAY,kBAgBX;AAhBD,WAAY,kBAAkB;IAC5B,kBAAkB;IAClB,2DAAQ,CAAA;IACR;;;OAGG;IACH,mEAAY,CAAA;IACZ,yGAAyG;IACzG,+DAAU,CAAA;IACV,iGAAiG;IACjG,2FAAwB,CAAA;IACxB,2GAA2G;IAC3G,iFAAmB,CAAA;IACnB,qKAAqK;IACrK,iFAAmB,CAAA;AACrB,CAAC,EAhBW,kBAAkB,kCAAlB,kBAAkB,QAgB7B;AAED;;;;GAIG;AACH,IAAY,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C,CAAC;QAEvD,IAAI,uBAAuB;YACzB,IAAI,CAAC,uBAAuB,GAAG,gCAAiB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IACvF,CAAC;;AA/GH,wDAmHC;AAFC,oDAAoD;AACtC,+BAAQ,GAAG,IAAI,sBAAsB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { CompressedId64Set, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\n\r\n/** The different modes by which a [[PlanarClipMaskSettings]] collects the geometry used to mask a model.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum PlanarClipMaskMode {\r\n /** No masking. */\r\n None = 0,\r\n /** Mask based on priority. Different types of models have different default priorities as enumerated by [[PlanarClipMaskPriority]].\r\n * For example, background maps have the lowest priority, so they are masked by all other types, while design models have the highest priority and are therefore never masked.\r\n * The priority of a reality model can be overridden by [[PlanarClipMaskSettings.priority]]. This is useful to allow one reality model to mask another overlapping one.\r\n */\r\n Priority = 1,\r\n /** Indicates that masks should be produced from the geometry in a set of [GeometricModel]($backend)s. */\r\n Models = 2,\r\n /** Indicates that masks should be produced from geometry belonging to a set of subcategories. */\r\n IncludeSubCategories = 3,\r\n /** Indicates that masks should be produced from the geometry of a set of [GeometricElement]($backend)s. */\r\n IncludeElements = 4,\r\n /** Indicates that masks should be produced from the geometry of all [GeometricElement]($backend)s in a view, **except** for a specified set of excluded elements. */\r\n ExcludeElements = 5,\r\n}\r\n\r\n/** The default priority values for a [[PlanarClipMaskSettings]], based on model type. Models with a lower priority are masked by models with a higher priority.\r\n * The default can be overridden by [[PlanarClipMaskSettings.priority]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum PlanarClipMaskPriority {\r\n /** Background map. */\r\n BackgroundMap = -2048,\r\n /** A reality model that spans the globe - e.g., OpenStreetMaps Buildings. */\r\n GlobalRealityModel = -1024,\r\n /** A reality model with a bounded range. */\r\n RealityModel = 0,\r\n /** A design model stored in the [IModelDb]($backend). */\r\n DesignModel = 2048,\r\n}\r\n\r\n/** JSON representation of a [[PlanarClipMaskSettings]].\r\n * @see [[DisplayStyleSettingsProps.planarClipOvr]] and [[ContextRealityModelProps.planarClipMask]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface PlanarClipMaskProps {\r\n /** Controls how the mask geometry is collected */\r\n mode: PlanarClipMaskMode;\r\n /** See [[PlanarClipMaskSettings.modelIds]]. */\r\n modelIds?: CompressedId64Set;\r\n /** See [[PlanarClipMaskSettings.subCategoryOrElementIds]]. */\r\n subCategoryOrElementIds?: CompressedId64Set;\r\n /** See [[PlanarClipMaskSettings.priority]]. */\r\n priority?: number;\r\n /** See [[PlanarClipMaskSettings.transparency]]. */\r\n transparency?: number;\r\n /** See PlanarClipMaskSettings.invert */\r\n invert?: boolean;\r\n}\r\n\r\n/** Basic arguments supplied to [[PlanarClipMaskSettings.create]].\r\n * @public\r\n */\r\nexport interface BasicPlanarClipMaskArgs {\r\n /** See [[PlanarClipMaskSettings.transparency]]. */\r\n transparency?: number;\r\n /** See [[PlanarClipMaskSettings.invert]]. */\r\n invert?: boolean;\r\n}\r\n\r\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.Models]].\r\n * @public\r\n */\r\nexport interface ModelPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\r\n /** See [[PlanarClipMaskSettings.modelIds]]. */\r\n modelIds?: Iterable<Id64String>;\r\n /** @internal */\r\n exclude?: never;\r\n /** @internal */\r\n elementIds?: never;\r\n /** @internal */\r\n subCategoryIds?: never;\r\n /** @internal */\r\n priority?: never;\r\n}\r\n\r\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.IncludeElements]] or [[PlanarClipMaskMode.ExcludeElements]].\r\n * @public\r\n */\r\nexport interface ElementPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\r\n /** See [[PlanarClipMaskSettings.modelIds]]. */\r\n modelIds?: Iterable<Id64String>;\r\n /** The elements used by the mask. @see [[PlanarClipMaskSettings.subCategoryOrElementIds]]. */\r\n elementIds: Iterable<Id64String>;\r\n /** If true, creates a mask of [[PlanarClipMaskMode.ExcludeElements]]; otherwise, [[PlanarClipMaskMode.IncludeElements]]. */\r\n exclude?: boolean;\r\n /** @internal */\r\n subCategoryIds?: never;\r\n /** @internal */\r\n priority?: never;\r\n}\r\n\r\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.IncludeSubCategories]].\r\n * @public\r\n */\r\nexport interface SubCategoryPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\r\n /** See [[PlanarClipMaskSettings.modelIds]]. */\r\n modelIds?: Iterable<Id64String>;\r\n /** The subcategories used by the mask. @see [[PlanarClipMaskSettings.subCategoryOrElementIds]]. */\r\n subCategoryIds: Iterable<Id64String>;\r\n /** @internal */\r\n exclude?: never;\r\n /** @internal */\r\n elementIds?: never;\r\n /** @internal */\r\n priority?: never;\r\n}\r\n\r\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.Priority]].\r\n * @public\r\n */\r\nexport interface PriorityPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\r\n /** See [[PlanarClipMaskSettings.priority]]. */\r\n priority: number;\r\n /** @internal */\r\n exclude?: never;\r\n /** @internal */\r\n elementIds?: never;\r\n /** @internal */\r\n modelIds?: never;\r\n}\r\n\r\n/** Describes how to mask the geometry of one [GeometricModel]($backend) for display. The mask is produced by projecting geometry from any number of other models -\r\n * optionally filtered by [SubCategory]($backend) or by a set of specific [GeometricElement]($backend)s - onto a plane. Regions of the masked model that intersect the\r\n * mask are rendered partially or completely transparent. This is useful for, e.g., making subsurface geometry visible below the background map, or clipping out portions\r\n * of a reality model that intersect a design model.\r\n * @note Currently reality models (including background maps and terrain) can be masked, but design models can only produce masks.\r\n * @see [[DisplayStyleSettings.planarClipMasks]] to define clip masks for a [DisplayStyle]($backend).\r\n * @see [[ContextRealityModel.planarClipMaskSettings]] to apply a clip mask to a context reality model.\r\n * @public\r\n */\r\nexport class PlanarClipMaskSettings {\r\n /** Specifies how the mask geometry is produced. */\r\n public readonly mode: PlanarClipMaskMode;\r\n /** For any mode other than [[PlanarClipMaskMode.Priority]], the Ids of the [GeometricModel]($backend)s containing the geometry used to produce the mask.\r\n * If `undefined`, the set of all models in the view's [ModelSelector]($backend) is used.\r\n * The mask geometry can be filtered by [[subCategoryOrElementIds]].\r\n */\r\n public readonly modelIds?: OrderedId64Iterable;\r\n /** For [[PlanarClipMaskMode.IncludeElements]] or [[PlanarClipMaskMode.ExcludedElements]], the Ids of the [GeometricElement]($backend)s to include or exclude from masking;\r\n * for [[PlanarClipMaskMode.IncludeSubCategories]], the Ids of the subcategories whose geometry contributes to the mask.\r\n */\r\n public readonly subCategoryOrElementIds?: OrderedId64Iterable;\r\n /** For [[PlanarClipMaskMode.Priority]], the priority value. */\r\n public readonly priority?: number;\r\n /** A value between 0 and 1 indicating an override for mask transparency. A transparency of 0 indicates complete masking. 1 is completely transparent (no masking).\r\n If no transparency is defined then the transparencies of the mask elements are used.\r\n */\r\n public readonly transparency?: number;\r\n /** A value of true indicates that the mask should be inverted and only content within the mask should be displayed, in other words the area inside the mask is displayed rather than outside. */\r\n public readonly invert: boolean;\r\n private readonly _modelIds?: CompressedId64Set;\r\n private readonly _subCategoryOrElementIds?: CompressedId64Set;\r\n\r\n /** The compressed representation of [[modelIds]]. */\r\n public get compressedModelIds(): CompressedId64Set | undefined {\r\n return this._modelIds;\r\n }\r\n\r\n /** Create a new [[PlanarClipMaskSettings]] object from its JSON representation. */\r\n public static fromJSON(json?: PlanarClipMaskProps): PlanarClipMaskSettings {\r\n if (!json || undefined === json.mode)\r\n return this.defaults;\r\n\r\n return new PlanarClipMaskSettings(json.mode, json.transparency, json.modelIds, json.subCategoryOrElementIds, json.priority, json.invert);\r\n }\r\n\r\n /** Create a new PlanarClipMaskSettings. */\r\n public static create(args: ModelPlanarClipMaskArgs | ElementPlanarClipMaskArgs | SubCategoryPlanarClipMaskArgs | PriorityPlanarClipMaskArgs): PlanarClipMaskSettings {\r\n const modelIds = args.modelIds ? CompressedId64Set.sortAndCompress(args.modelIds) : undefined;\r\n if (undefined !== args.priority)\r\n return new PlanarClipMaskSettings(PlanarClipMaskMode.Priority, args.transparency, undefined, undefined, args.priority, args.invert);\r\n else if (undefined !== args.subCategoryIds)\r\n return new PlanarClipMaskSettings(PlanarClipMaskMode.IncludeSubCategories, args.transparency, modelIds, CompressedId64Set.sortAndCompress(args.subCategoryIds), undefined, args.invert);\r\n else if (undefined !== args.elementIds)\r\n return new PlanarClipMaskSettings(args.exclude ? PlanarClipMaskMode.ExcludeElements : PlanarClipMaskMode.IncludeElements, args.transparency, modelIds, CompressedId64Set.sortAndCompress(args.elementIds), undefined, args.invert);\r\n else\r\n return new PlanarClipMaskSettings(PlanarClipMaskMode.Models, args.transparency, modelIds, undefined, undefined, args.invert);\r\n }\r\n\r\n /** Create JSON object representing this [[PlanarClipMaskSettings]] */\r\n public toJSON(): PlanarClipMaskProps {\r\n const props: PlanarClipMaskProps = { mode: this.mode };\r\n if (undefined !== this._modelIds)\r\n props.modelIds = this._modelIds;\r\n\r\n if (undefined !== this._subCategoryOrElementIds)\r\n props.subCategoryOrElementIds = this._subCategoryOrElementIds;\r\n\r\n if (undefined !== this.priority)\r\n props.priority = this.priority;\r\n\r\n if (undefined !== this.transparency)\r\n props.transparency = this.transparency;\r\n\r\n if (this.invert)\r\n props.invert = true;\r\n\r\n return props;\r\n }\r\n\r\n /** Returns true if masking is enabled. */\r\n public get isValid(): boolean {\r\n return this.mode !== PlanarClipMaskMode.None;\r\n }\r\n\r\n public equals(other: PlanarClipMaskSettings): boolean {\r\n return this.mode === other.mode &&\r\n this.priority === other.priority &&\r\n this.transparency === other.transparency &&\r\n this.invert === other.invert &&\r\n this._modelIds === other._modelIds &&\r\n this._subCategoryOrElementIds === other._subCategoryOrElementIds;\r\n }\r\n\r\n /** Create a copy of this TerrainSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A PlanarClipMaskSettings with all of its properties set to match those of`this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps?: PlanarClipMaskProps): PlanarClipMaskSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n return PlanarClipMaskSettings.fromJSON({\r\n ...this.toJSON(),\r\n ...changedProps,\r\n });\r\n }\r\n\r\n private constructor(mode: PlanarClipMaskMode, transparency?: number, modelIds?: CompressedId64Set, subCategoryOrElementIds?: CompressedId64Set, priority?: number, invert?: boolean) {\r\n this.mode = mode;\r\n this._modelIds = modelIds;\r\n this._subCategoryOrElementIds = subCategoryOrElementIds;\r\n this.priority = priority;\r\n this.invert = true === invert;\r\n this.transparency = undefined !== transparency ? Math.max(0, Math.min(1, transparency)) : undefined;\r\n\r\n if (modelIds)\r\n this.modelIds = CompressedId64Set.iterable(modelIds);\r\n\r\n if (subCategoryOrElementIds)\r\n this.subCategoryOrElementIds = CompressedId64Set.iterable(subCategoryOrElementIds);\r\n }\r\n\r\n /** A default PlanarClipMask which masks nothing. */\r\n public static defaults = new PlanarClipMaskSettings(PlanarClipMaskMode.None);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"PlanarClipMask.js","sourceRoot":"","sources":["../../src/PlanarClipMask.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyF;AAEzF;;;GAGG;AACH,IAAY,kBAyBX;AAzBD,WAAY,kBAAkB;IAC5B,kBAAkB;IAClB,2DAAQ,CAAA;IACR;;;;OAIG;IACH,mEAAY,CAAA;IACZ;;OAEG;IACH,+DAAU,CAAA;IACV;;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,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEpG,IAAI,QAAQ;YACV,IAAI,CAAC,QAAQ,GAAG,gCAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEvD,IAAI,uBAAuB;YACzB,IAAI,CAAC,uBAAuB,GAAG,gCAAiB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IACvF,CAAC;;AAhHH,wDAoHC;AAFC,oDAAoD;AACtC,+BAAQ,GAAG,IAAI,sBAAsB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { CompressedId64Set, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\n\r\n/** The different modes by which a [[PlanarClipMaskSettings]] collects the geometry used to mask a model.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum PlanarClipMaskMode {\r\n /** No masking. */\r\n None = 0,\r\n /** Mask based on priority. Different types of models have different default priorities as enumerated by [[PlanarClipMaskPriority]].\r\n * For example, background maps have the lowest priority, so they are masked by all other types, while design models have the highest priority and are therefore never masked.\r\n * The priority of a reality model can be overridden by [[PlanarClipMaskSettings.priority]]. This is useful to allow one reality model to mask another overlapping one.\r\n * Everything visible in the view creates the mask, so turning off models, categories, or elements (via fully transparent overrides) will make things not be in the mask.\r\n */\r\n Priority = 1,\r\n /** Indicates that masks should be produced from the geometry in a set of [GeometricModel]($backend)s, regardless of what model is on or off in the view.\r\n * However, things that are off from category settings or element feature overrides in the view will not be in the mask for these models.\r\n */\r\n Models = 2,\r\n /** Indicates that masks should be produced from geometry belonging to a set of subcategories.\r\n * View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.\r\n */\r\n IncludeSubCategories = 3,\r\n /** Indicates that masks should be produced from the geometry of a set of [GeometricElement]($backend)s.\r\n * View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.\r\n */\r\n IncludeElements = 4,\r\n /** Indicates that masks should be produced from the geometry of all [GeometricElement]($backend)s in a view, **except** for a specified set of excluded elements.\r\n * View settings do not affect what is in the mask, unless [[PlanarClipMaskSettings.subCategoryOrElementIds]] is undefined, in which case it behaves like Models mode.\r\n */\r\n ExcludeElements = 5,\r\n}\r\n\r\n/** The default priority values for a [[PlanarClipMaskSettings]], based on model type. Models with a lower priority are masked by models with a higher priority.\r\n * The default can be overridden by [[PlanarClipMaskSettings.priority]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum PlanarClipMaskPriority {\r\n /** Background map. */\r\n BackgroundMap = -2048,\r\n /** A reality model that spans the globe - e.g., OpenStreetMaps Buildings. */\r\n GlobalRealityModel = -1024,\r\n /** A reality model with a bounded range. */\r\n RealityModel = 0,\r\n /** A design model stored in the [IModelDb]($backend). */\r\n DesignModel = 2048,\r\n}\r\n\r\n/** JSON representation of a [[PlanarClipMaskSettings]].\r\n * @see [[DisplayStyleSettingsProps.planarClipOvr]] and [[ContextRealityModelProps.planarClipMask]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface PlanarClipMaskProps {\r\n /** Controls how the mask geometry is collected */\r\n mode: PlanarClipMaskMode;\r\n /** See [[PlanarClipMaskSettings.modelIds]]. */\r\n modelIds?: CompressedId64Set;\r\n /** See [[PlanarClipMaskSettings.subCategoryOrElementIds]]. */\r\n subCategoryOrElementIds?: CompressedId64Set;\r\n /** See [[PlanarClipMaskSettings.priority]]. */\r\n priority?: number;\r\n /** See [[PlanarClipMaskSettings.transparency]]. */\r\n transparency?: number;\r\n /** See PlanarClipMaskSettings.invert */\r\n invert?: boolean;\r\n}\r\n\r\n/** Basic arguments supplied to [[PlanarClipMaskSettings.create]].\r\n * @public\r\n */\r\nexport interface BasicPlanarClipMaskArgs {\r\n /** See [[PlanarClipMaskSettings.transparency]]. */\r\n transparency?: number;\r\n /** See [[PlanarClipMaskSettings.invert]]. */\r\n invert?: boolean;\r\n}\r\n\r\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.Models]].\r\n * @public\r\n */\r\nexport interface ModelPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\r\n /** See [[PlanarClipMaskSettings.modelIds]]. */\r\n modelIds?: Iterable<Id64String>;\r\n /** @internal */\r\n exclude?: never;\r\n /** @internal */\r\n elementIds?: never;\r\n /** @internal */\r\n subCategoryIds?: never;\r\n /** @internal */\r\n priority?: never;\r\n}\r\n\r\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.IncludeElements]] or [[PlanarClipMaskMode.ExcludeElements]].\r\n * @public\r\n */\r\nexport interface ElementPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\r\n /** See [[PlanarClipMaskSettings.modelIds]]. */\r\n modelIds?: Iterable<Id64String>;\r\n /** The elements used by the mask. @see [[PlanarClipMaskSettings.subCategoryOrElementIds]]. */\r\n elementIds: Iterable<Id64String>;\r\n /** If true, creates a mask of [[PlanarClipMaskMode.ExcludeElements]]; otherwise, [[PlanarClipMaskMode.IncludeElements]]. */\r\n exclude?: boolean;\r\n /** @internal */\r\n subCategoryIds?: never;\r\n /** @internal */\r\n priority?: never;\r\n}\r\n\r\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.IncludeSubCategories]].\r\n * @public\r\n */\r\nexport interface SubCategoryPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\r\n /** See [[PlanarClipMaskSettings.modelIds]]. */\r\n modelIds?: Iterable<Id64String>;\r\n /** The subcategories used by the mask. @see [[PlanarClipMaskSettings.subCategoryOrElementIds]]. */\r\n subCategoryIds: Iterable<Id64String>;\r\n /** @internal */\r\n exclude?: never;\r\n /** @internal */\r\n elementIds?: never;\r\n /** @internal */\r\n priority?: never;\r\n}\r\n\r\n/** Arguments supplied to [[PlanarClipMaskSettings.create]] to create a mask of [[PlanarClipMaskMode.Priority]].\r\n * @public\r\n */\r\nexport interface PriorityPlanarClipMaskArgs extends BasicPlanarClipMaskArgs {\r\n /** See [[PlanarClipMaskSettings.priority]]. */\r\n priority: number;\r\n /** @internal */\r\n exclude?: never;\r\n /** @internal */\r\n elementIds?: never;\r\n /** @internal */\r\n modelIds?: never;\r\n}\r\n\r\n/** Describes how to mask the geometry of one [GeometricModel]($backend) for display. The mask is produced by projecting geometry from any number of other models -\r\n * optionally filtered by [SubCategory]($backend) or by a set of specific [GeometricElement]($backend)s - onto a plane. Regions of the masked model that intersect the\r\n * mask are rendered partially or completely transparent. This is useful for, e.g., making subsurface geometry visible below the background map, or clipping out portions\r\n * of a reality model that intersect a design model.\r\n * @note Currently reality models (including background maps and terrain) can be masked, but design models can only produce masks.\r\n * @see [[DisplayStyleSettings.planarClipMasks]] to define clip masks for a [DisplayStyle]($backend).\r\n * @see [[ContextRealityModel.planarClipMaskSettings]] to apply a clip mask to a context reality model.\r\n * @public\r\n */\r\nexport class PlanarClipMaskSettings {\r\n /** Specifies how the mask geometry is produced. */\r\n public readonly mode: PlanarClipMaskMode;\r\n /** For any mode other than [[PlanarClipMaskMode.Priority]], the Ids of the [GeometricModel]($backend)s containing the geometry used to produce the mask,\r\n * and if `undefined`, no mask geometry will be created.\r\n * The mask geometry can be filtered by [[subCategoryOrElementIds]].\r\n */\r\n public readonly modelIds?: OrderedId64Iterable;\r\n /** For [[PlanarClipMaskMode.IncludeElements]] or [[PlanarClipMaskMode.ExcludedElements]], the Ids of the [GeometricElement]($backend)s to include or exclude from masking;\r\n * for [[PlanarClipMaskMode.IncludeSubCategories]], the Ids of the subcategories whose geometry contributes to the mask.\r\n * If undefined, Modes IncludeSubCategories, IncludeElements, and ExcludeElements behave like Models mode.\r\n */\r\n public readonly subCategoryOrElementIds?: OrderedId64Iterable;\r\n /** For [[PlanarClipMaskMode.Priority]], the priority value. */\r\n public readonly priority?: number;\r\n /** A value between 0 and 1 indicating an override for mask transparency. A transparency of 0 indicates complete masking. 1 is completely transparent (no masking).\r\n If no transparency is defined then the transparencies of the mask elements are used.\r\n */\r\n public readonly transparency?: number;\r\n /** A value of true indicates that the mask should be inverted and only content within the mask should be displayed, in other words the area inside the mask is displayed rather than outside. */\r\n public readonly invert: boolean;\r\n private readonly _modelIds?: CompressedId64Set;\r\n private readonly _subCategoryOrElementIds?: CompressedId64Set;\r\n\r\n /** The compressed representation of [[modelIds]]. */\r\n public get compressedModelIds(): CompressedId64Set | undefined {\r\n return this._modelIds;\r\n }\r\n\r\n /** Create a new [[PlanarClipMaskSettings]] object from its JSON representation. */\r\n public static fromJSON(json?: PlanarClipMaskProps): PlanarClipMaskSettings {\r\n if (!json || undefined === json.mode)\r\n return this.defaults;\r\n\r\n return new PlanarClipMaskSettings(json.mode, json.transparency, json.modelIds, json.subCategoryOrElementIds, json.priority, json.invert);\r\n }\r\n\r\n /** Create a new PlanarClipMaskSettings. */\r\n public static create(args: ModelPlanarClipMaskArgs | ElementPlanarClipMaskArgs | SubCategoryPlanarClipMaskArgs | PriorityPlanarClipMaskArgs): PlanarClipMaskSettings {\r\n const modelIds = args.modelIds ? CompressedId64Set.sortAndCompress(args.modelIds) : undefined;\r\n if (undefined !== args.priority)\r\n return new PlanarClipMaskSettings(PlanarClipMaskMode.Priority, args.transparency, undefined, undefined, args.priority, args.invert);\r\n else if (undefined !== args.subCategoryIds)\r\n return new PlanarClipMaskSettings(PlanarClipMaskMode.IncludeSubCategories, args.transparency, modelIds, CompressedId64Set.sortAndCompress(args.subCategoryIds), undefined, args.invert);\r\n else if (undefined !== args.elementIds)\r\n return new PlanarClipMaskSettings(args.exclude ? PlanarClipMaskMode.ExcludeElements : PlanarClipMaskMode.IncludeElements, args.transparency, modelIds, CompressedId64Set.sortAndCompress(args.elementIds), undefined, args.invert);\r\n else\r\n return new PlanarClipMaskSettings(PlanarClipMaskMode.Models, args.transparency, modelIds, undefined, undefined, args.invert);\r\n }\r\n\r\n /** Create JSON object representing this [[PlanarClipMaskSettings]] */\r\n public toJSON(): PlanarClipMaskProps {\r\n const props: PlanarClipMaskProps = { mode: this.mode };\r\n if (undefined !== this._modelIds)\r\n props.modelIds = this._modelIds;\r\n\r\n if (undefined !== this._subCategoryOrElementIds)\r\n props.subCategoryOrElementIds = this._subCategoryOrElementIds;\r\n\r\n if (undefined !== this.priority)\r\n props.priority = this.priority;\r\n\r\n if (undefined !== this.transparency)\r\n props.transparency = this.transparency;\r\n\r\n if (this.invert)\r\n props.invert = true;\r\n\r\n return props;\r\n }\r\n\r\n /** Returns true if masking is enabled. */\r\n public get isValid(): boolean {\r\n return this.mode !== PlanarClipMaskMode.None;\r\n }\r\n\r\n public equals(other: PlanarClipMaskSettings): boolean {\r\n return this.mode === other.mode &&\r\n this.priority === other.priority &&\r\n this.transparency === other.transparency &&\r\n this.invert === other.invert &&\r\n this._modelIds === other._modelIds &&\r\n this._subCategoryOrElementIds === other._subCategoryOrElementIds;\r\n }\r\n\r\n /** Create a copy of this TerrainSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A PlanarClipMaskSettings with all of its properties set to match those of`this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps?: PlanarClipMaskProps): PlanarClipMaskSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n return PlanarClipMaskSettings.fromJSON({\r\n ...this.toJSON(),\r\n ...changedProps,\r\n });\r\n }\r\n\r\n private constructor(mode: PlanarClipMaskMode, transparency?: number, modelIds?: CompressedId64Set, subCategoryOrElementIds?: CompressedId64Set, priority?: number, invert?: boolean) {\r\n this.mode = mode;\r\n this._modelIds = modelIds;\r\n this._subCategoryOrElementIds = subCategoryOrElementIds;\r\n this.priority = priority;\r\n this.invert = true === invert;\r\n this.transparency = undefined !== transparency ? Math.max(0, Math.min(1, transparency)) : undefined;\r\n\r\n if (modelIds)\r\n this.modelIds = CompressedId64Set.iterable(modelIds);\r\n\r\n if (subCategoryOrElementIds)\r\n this.subCategoryOrElementIds = CompressedId64Set.iterable(subCategoryOrElementIds);\r\n }\r\n\r\n /** A default PlanarClipMask which masks nothing. */\r\n public static defaults = new PlanarClipMaskSettings(PlanarClipMaskMode.None);\r\n}\r\n"]}
|
package/lib/cjs/Render.d.ts
CHANGED
|
@@ -3,11 +3,16 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { OctEncodedNormalPair } from "./OctEncodedNormal";
|
|
5
5
|
/** Describes the semantics of a [PolylineArgs]($frontend).
|
|
6
|
-
* @
|
|
6
|
+
* @public
|
|
7
7
|
*/
|
|
8
8
|
export declare enum PolylineTypeFlags {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/** Just an ordinary polyline with no special semantics. */
|
|
10
|
+
Normal = 0,
|
|
11
|
+
/** A polyline used to define the edges of a planar region. */
|
|
12
|
+
Edge = 1,
|
|
13
|
+
/** Like [[Edge]], but the edges are only displayed in [[RenderMode.Wireframe]] when the surface's fill is not displayed.
|
|
14
|
+
* [[FillFlags]] controls whether the fill is displayed.
|
|
15
|
+
*/
|
|
11
16
|
Outline = 2
|
|
12
17
|
}
|
|
13
18
|
/** Flags describing a [PolylineArgs]($frontend).
|
|
@@ -20,9 +25,7 @@ export interface PolylineFlags {
|
|
|
20
25
|
isPlanar?: boolean;
|
|
21
26
|
/** If `true`, the polylines' positions all have the same z coordinate. */
|
|
22
27
|
is2d?: boolean;
|
|
23
|
-
/** Default: Normal.
|
|
24
|
-
* @alpha
|
|
25
|
-
*/
|
|
28
|
+
/** Default: Normal. */
|
|
26
29
|
type?: PolylineTypeFlags;
|
|
27
30
|
}
|
|
28
31
|
/** Describes the vertex indices of a single line within a [PolylineArgs]($frontend).
|
package/lib/cjs/Render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Render.d.ts","sourceRoot":"","sources":["../../src/Render.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAI1D;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Render.d.ts","sourceRoot":"","sources":["../../src/Render.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAI1D;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,2DAA2D;IAC3D,MAAM,IAAI;IACV,8DAA8D;IAC9D,IAAI,IAAS;IACb;;OAEG;IACH,OAAO,IAAS;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8HAA8H;IAC9H,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uBAAuB;IACvB,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,EAAE,CAAC;AAEvC,gBAAgB;AAChB,qBAAa,YAAY;IACvB,SAAgB,OAAO,EAAE,eAAe,CAAC;gBAEtB,OAAO,GAAE,eAAoB;IAIzC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAMtB,KAAK;CACb;AAED,gBAAgB;AAChB,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,YAAY,CAAC;gBAC3C,GAAG,IAAI,EAAE,YAAY,EAAE;CAGpC;AAED,gBAAgB;AAChB,qBAAa,QAAQ;IACZ,OAAO,WAAU;gBAEL,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAY5C,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;CAO1C;AAED,gBAAgB;AAChB,qBAAa,SAAS;IACb,OAAO,EAAE,QAAQ,EAAE,CAAM;IACzB,UAAU,EAAE,QAAQ,EAAE,CAAM;IAC5B,SAAS,EAAE,gBAAgB,CAA0B;IACrD,iBAAiB,EAAE,oBAAoB,EAAE,CAAM;;CAEvD;AAED,gBAAgB;AAChB,qBAAa,QAAQ;IACZ,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEnB,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO;IAQpC,KAAK,IAAI,IAAI;IACpB,IAAW,OAAO,IAAI,OAAO,CAA8B;IAC3D,IAAW,QAAQ,WAA+D;CACnF;AAED,gBAAgB;AAChB,qBAAa,kBAAmB,SAAQ,QAAQ;IACvC,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAExB,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS;IAU1B,KAAK;CAItB;AAED,gBAAgB;AAChB,qBAAa,gBAAgB;IACpB,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;gBAEd,KAAK,CAAC,EAAE,eAAe,EAAE;IAErC,IAAI,CAAC,KAAK,CAAC,EAAE,eAAe,EAAE,GAAG,OAAO;IAK/C,IAAW,QAAQ,WAA+D;IAClF,IAAW,OAAO,YAAgC;IAC3C,KAAK;CACb"}
|
package/lib/cjs/Render.js
CHANGED
|
@@ -10,12 +10,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.PolylineEdgeArgs = exports.SilhouetteEdgeArgs = exports.EdgeArgs = exports.MeshEdges = exports.MeshEdge = exports.MeshPolylineList = exports.MeshPolyline = exports.PolylineTypeFlags = void 0;
|
|
11
11
|
// cSpell:ignore vals
|
|
12
12
|
/** Describes the semantics of a [PolylineArgs]($frontend).
|
|
13
|
-
* @
|
|
13
|
+
* @public
|
|
14
14
|
*/
|
|
15
15
|
var PolylineTypeFlags;
|
|
16
16
|
(function (PolylineTypeFlags) {
|
|
17
|
+
/** Just an ordinary polyline with no special semantics. */
|
|
17
18
|
PolylineTypeFlags[PolylineTypeFlags["Normal"] = 0] = "Normal";
|
|
19
|
+
/** A polyline used to define the edges of a planar region. */
|
|
18
20
|
PolylineTypeFlags[PolylineTypeFlags["Edge"] = 1] = "Edge";
|
|
21
|
+
/** Like [[Edge]], but the edges are only displayed in [[RenderMode.Wireframe]] when the surface's fill is not displayed.
|
|
22
|
+
* [[FillFlags]] controls whether the fill is displayed.
|
|
23
|
+
*/
|
|
19
24
|
PolylineTypeFlags[PolylineTypeFlags["Outline"] = 2] = "Outline";
|
|
20
25
|
})(PolylineTypeFlags || (exports.PolylineTypeFlags = PolylineTypeFlags = {}));
|
|
21
26
|
/** @internal */
|
package/lib/cjs/Render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Render.js","sourceRoot":"","sources":["../../src/Render.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,qBAAqB;AAErB;;GAEG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"Render.js","sourceRoot":"","sources":["../../src/Render.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,qBAAqB;AAErB;;GAEG;AACH,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B,2DAA2D;IAC3D,6DAAU,CAAA;IACV,8DAA8D;IAC9D,yDAAa,CAAA;IACb;;OAEG;IACH,+DAAgB,CAAA;AAClB,CAAC,EATW,iBAAiB,iCAAjB,iBAAiB,QAS5B;AAuBD,gBAAgB;AAChB,MAAa,YAAY;IAGvB,YAAmB,UAA2B,EAAE;QAC9C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAEM,QAAQ,CAAC,KAAa;QAC3B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QACzB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC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IAChB,CAAC;CACF;AAjBD,gDAiBC;AAED,gBAAgB;AAChB,MAAa,gBAAgB;IAG3B,YAAmB,KAAyB,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE5D,IAAI,CAAC,KAAyB;QACnC,IAAI,CAAC,KAAK,GAAG,SAAS,KAAK,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAW,QAAQ,KAAK,OAAO,SAAS,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClF,IAAW,OAAO,KAAK,OAAO,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3C,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC;CAC3C;AAbD,4CAaC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { OctEncodedNormalPair } from \"./OctEncodedNormal\";\r\n\r\n// cSpell:ignore vals\r\n\r\n/** Describes the semantics of a [PolylineArgs]($frontend).\r\n * @public\r\n */\r\nexport enum PolylineTypeFlags {\r\n /** Just an ordinary polyline with no special semantics. */\r\n Normal = 0,\r\n /** A polyline used to define the edges of a planar region. */\r\n Edge = 1 << 0,\r\n /** Like [[Edge]], but the edges are only displayed in [[RenderMode.Wireframe]] when the surface's fill is not displayed.\r\n * [[FillFlags]] controls whether the fill is displayed.\r\n */\r\n Outline = 1 << 1,\r\n}\r\n\r\n/** Flags describing a [PolylineArgs]($frontend).\r\n * @public\r\n */\r\nexport interface PolylineFlags {\r\n /** If `true`, the polylines are to be drawn as individual disconnected point strings instead of as connected line strings. */\r\n isDisjoint?: boolean;\r\n /** If `true`, the polylines' positions are all coplanar. */\r\n isPlanar?: boolean;\r\n /** If `true`, the polylines' positions all have the same z coordinate. */\r\n is2d?: boolean;\r\n /** Default: Normal. */\r\n type?: PolylineTypeFlags;\r\n}\r\n\r\n/** Describes the vertex indices of a single line within a [PolylineArgs]($frontend).\r\n * The indices represent either a line string as a connected series of points, or a point string as a set of disconnected points, depending\r\n * on the [[PolylineFlags.isDisjoint]] value of [PolylineArgs.flags]($frontend).\r\n * @public\r\n */\r\nexport type PolylineIndices = number[];\r\n\r\n/** @internal */\r\nexport class MeshPolyline {\r\n public readonly indices: PolylineIndices;\r\n\r\n public constructor(indices: PolylineIndices = []) {\r\n this.indices = indices.slice();\r\n }\r\n\r\n public addIndex(index: number) {\r\n const { indices } = this;\r\n if (indices.length === 0 || indices[indices.length - 1] !== index)\r\n indices.push(index);\r\n }\r\n\r\n public clear() { this.indices.length = 0; }\r\n}\r\n\r\n/** @internal */\r\nexport class MeshPolylineList extends Array<MeshPolyline> {\r\n constructor(...args: MeshPolyline[]) {\r\n super(...args);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class MeshEdge {\r\n public indices = [0, 0];\r\n\r\n public constructor(index0?: number, index1?: number) {\r\n if (undefined === index0 || undefined === index1)\r\n return;\r\n if (index0 < index1) {\r\n this.indices[0] = index0;\r\n this.indices[1] = index1;\r\n } else {\r\n this.indices[0] = index1;\r\n this.indices[1] = index0;\r\n }\r\n }\r\n\r\n public compareTo(other: MeshEdge): number {\r\n let diff = this.indices[0] - other.indices[0];\r\n if (0 === diff)\r\n diff = this.indices[1] - other.indices[1];\r\n\r\n return diff;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class MeshEdges {\r\n public visible: MeshEdge[] = [];\r\n public silhouette: MeshEdge[] = [];\r\n public polylines: MeshPolylineList = new MeshPolylineList();\r\n public silhouetteNormals: OctEncodedNormalPair[] = [];\r\n public constructor() { }\r\n}\r\n\r\n/** @internal */\r\nexport class EdgeArgs {\r\n public edges?: MeshEdge[];\r\n\r\n public init(meshEdges?: MeshEdges): boolean {\r\n this.clear();\r\n if (undefined !== meshEdges && 0 < meshEdges.visible.length)\r\n this.edges = meshEdges.visible;\r\n\r\n return this.isValid;\r\n }\r\n\r\n public clear(): void { this.edges = undefined; }\r\n public get isValid(): boolean { return 0 < this.numEdges; }\r\n public get numEdges() { return undefined !== this.edges ? this.edges.length : 0; }\r\n}\r\n\r\n/** @internal */\r\nexport class SilhouetteEdgeArgs extends EdgeArgs {\r\n public normals?: OctEncodedNormalPair[];\r\n\r\n public override init(meshEdges?: MeshEdges) {\r\n this.clear();\r\n if (undefined !== meshEdges && 0 < meshEdges.silhouette.length) {\r\n this.edges = meshEdges.silhouette;\r\n this.normals = meshEdges.silhouetteNormals;\r\n }\r\n\r\n return this.isValid;\r\n }\r\n\r\n public override clear() {\r\n this.normals = undefined;\r\n super.clear();\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PolylineEdgeArgs {\r\n public lines?: PolylineIndices[];\r\n\r\n public constructor(lines?: PolylineIndices[]) { this.init(lines); }\r\n\r\n public init(lines?: PolylineIndices[]): boolean {\r\n this.lines = undefined !== lines && 0 < lines.length ? lines : undefined;\r\n return this.isValid;\r\n }\r\n\r\n public get numLines() { return undefined !== this.lines ? this.lines.length : 0; }\r\n public get isValid() { return this.numLines > 0; }\r\n public clear() { this.lines = undefined; }\r\n}\r\n"]}
|
|
@@ -11,8 +11,15 @@ export declare abstract class RenderMaterial {
|
|
|
11
11
|
readonly key?: string;
|
|
12
12
|
/** Describes how to map an image to a surface to which this material is applied. */
|
|
13
13
|
readonly textureMapping?: TextureMapping;
|
|
14
|
-
|
|
14
|
+
/** Used for ordered comparisons, e.g. in DisplayParams.compareForMerge */
|
|
15
|
+
private readonly _guid;
|
|
16
|
+
protected constructor(params: {
|
|
17
|
+
key?: string;
|
|
18
|
+
textureMapping?: TextureMapping;
|
|
19
|
+
});
|
|
15
20
|
get hasTexture(): boolean;
|
|
21
|
+
/** An [OrderedComparator]($bentley) that compares this material against `other`. */
|
|
22
|
+
compare(other: RenderMaterial): number;
|
|
16
23
|
}
|
|
17
24
|
/** @public */
|
|
18
25
|
export declare namespace RenderMaterial {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMaterial.d.ts","sourceRoot":"","sources":["../../src/RenderMaterial.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"RenderMaterial.d.ts","sourceRoot":"","sources":["../../src/RenderMaterial.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;GAEG;AACH,8BAAsB,cAAc;IAClC,sGAAsG;IACtG,SAAgB,GAAG,CAAC,EAAE,MAAM,CAAC;IAC7B,oFAAoF;IACpF,SAAgB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChD,0EAA0E;IAC1E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IAEnC,SAAS,aAAa,MAAM,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,cAAc,CAAA;KAAE;IAM/E,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,oFAAoF;IAC7E,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM;CAG9C;AAED,cAAc;AACd,yBAAiB,cAAc,CAAC;IAK9B,qEAAqE;IACrE,MAAa,MAAM;QACjB,oGAAoG;QAC7F,GAAG,CAAC,EAAE,MAAM,CAAC;QACpB,8FAA8F;QACvF,YAAY,CAAC,EAAE,QAAQ,CAAC;QAC/B,sDAAsD;QAC/C,aAAa,CAAC,EAAE,QAAQ,CAAC;QAChC,+BAA+B;QACxB,aAAa,CAAC,EAAE,QAAQ,CAAC;QAChC,+BAA+B;QACxB,YAAY,CAAC,EAAE,QAAQ,CAAC;QAC/B,uDAAuD;QAChD,cAAc,CAAC,EAAE,cAAc,CAAC;QACvC,+BAA+B;QACxB,OAAO,EAAE,MAAM,CAAO;QAC7B,gCAAgC;QACzB,QAAQ,EAAE,MAAM,CAAO;QACvB,gBAAgB,EAAE,MAAM,CAAQ;QACvC,+BAA+B;QACxB,OAAO,EAAE,MAAM,CAAO;QAC7B,+BAA+B;QACxB,OAAO,EAAE,MAAM,CAAO;QAC7B,+BAA+B;QACxB,OAAO,EAAE,MAAM,CAAM;QAC5B,+BAA+B;QACxB,OAAO,UAAQ;QACtB,OAAO,CAAC,MAAM,CAAC,CAAS;oBAEL,GAAG,CAAC,EAAE,MAAM;QAE/B,oFAAoF;QAEpF,gBAAuB,QAAQ,SAAgB;QAE/C;;WAEG;QACH,IAAW,KAAK,IAAI,MAAM,GAAG,SAAS,CAAwB;QAC9D,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAEzC;QAED,6HAA6H;eAE/G,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,cAAc,GAAG,MAAM;KAWlL;CACF"}
|
|
@@ -8,18 +8,23 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.RenderMaterial = void 0;
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
11
12
|
/** Represents a material which can be applied to a surface to control aspects of its appearance such as color, reflectivity, texture, and so on.
|
|
12
13
|
* @public
|
|
13
14
|
*/
|
|
14
15
|
class RenderMaterial {
|
|
15
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
16
16
|
constructor(params) {
|
|
17
17
|
this.key = params.key;
|
|
18
18
|
this.textureMapping = params.textureMapping;
|
|
19
|
+
this._guid = core_bentley_1.Guid.createValue();
|
|
19
20
|
}
|
|
20
21
|
get hasTexture() {
|
|
21
22
|
return undefined !== this.textureMapping?.texture;
|
|
22
23
|
}
|
|
24
|
+
/** An [OrderedComparator]($bentley) that compares this material against `other`. */
|
|
25
|
+
compare(other) {
|
|
26
|
+
return (0, core_bentley_1.compareStrings)(this._guid, other._guid);
|
|
27
|
+
}
|
|
23
28
|
}
|
|
24
29
|
exports.RenderMaterial = RenderMaterial;
|
|
25
30
|
/** @public */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMaterial.js","sourceRoot":"","sources":["../../src/RenderMaterial.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"RenderMaterial.js","sourceRoot":"","sources":["../../src/RenderMaterial.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuE;AAIvE;;GAEG;AACH,MAAsB,cAAc;IAQlC,YAAsB,MAAyD;QAC7E,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QACtB,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,KAAK,GAAG,mBAAI,CAAC,WAAW,EAAE,CAAC;IAClC,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,SAAS,KAAK,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;IACpD,CAAC;IAED,oFAAoF;IAC7E,OAAO,CAAC,KAAqB;QAClC,OAAO,IAAA,6BAAc,EAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC;CACF;AAtBD,wCAsBC;AAED,cAAc;AACd,WAAiB,cAAc;IAC7B,SAAS,sBAAsB,CAAC,KAAa;QAC3C,OAAO,IAA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,cAAc,CAAC;QACxB,CAAC;;IAxBD,oFAAoF;IACpF,mDAAmD;IAC5B,eAAQ,GAAG,IAAI,MAAM,EAAE,AAAf,CAAgB;IAhCpC,qBAAM,SAuDlB,CAAA;AACH,CAAC,EA9DgB,cAAc,8BAAd,cAAc,QA8D9B;AAED,mDAAmD;AACnD,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { compareStrings, Guid, GuidString } from \"@itwin/core-bentley\";\r\nimport { ColorDef } from \"./ColorDef\";\r\nimport { TextureMapping } from \"./TextureMapping\";\r\n\r\n/** Represents a material which can be applied to a surface to control aspects of its appearance such as color, reflectivity, texture, and so on.\r\n * @public\r\n */\r\nexport abstract class RenderMaterial {\r\n /** If the material originated from a Material element in the [[IModelDb]], the Id of that element. */\r\n public readonly key?: string;\r\n /** Describes how to map an image to a surface to which this material is applied. */\r\n public readonly textureMapping?: TextureMapping;\r\n /** Used for ordered comparisons, e.g. in DisplayParams.compareForMerge */\r\n private readonly _guid: GuidString;\r\n\r\n protected constructor(params: { key?: string, textureMapping?: TextureMapping }) {\r\n this.key = params.key;\r\n this.textureMapping = params.textureMapping;\r\n this._guid = Guid.createValue();\r\n }\r\n\r\n public get hasTexture(): boolean {\r\n return undefined !== this.textureMapping?.texture;\r\n }\r\n\r\n /** An [OrderedComparator]($bentley) that compares this material against `other`. */\r\n public compare(other: RenderMaterial): number {\r\n return compareStrings(this._guid, other._guid);\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace RenderMaterial { // eslint-disable-line no-redeclare\r\n function clampToNormalizedRange(value: number): number {\r\n return Math.max(0.0, Math.min(1.0, value));\r\n }\r\n\r\n /** @deprecated in 3.x. Use [CreateRenderMaterialArgs]($frontend). */\r\n export class Params {\r\n /** If the material originates from a Material element in the [[IModel]], the Id of that element. */\r\n public key?: string;\r\n /** Diffuse color, or undefined if this material does not override the surface's own color. */\r\n public diffuseColor?: ColorDef;\r\n /** Specular color. Defaults to white if undefined. */\r\n public specularColor?: ColorDef;\r\n /** Currently unused. @alpha */\r\n public emissiveColor?: ColorDef;\r\n /** Currently unused. @alpha */\r\n public reflectColor?: ColorDef;\r\n /** Optional pattern mapping applied to the surface. */\r\n public textureMapping?: TextureMapping;\r\n /** Diffuse weight in [0..1] */\r\n public diffuse: number = 0.6;\r\n /** Specular weight in [0..1] */\r\n public specular: number = 0.4;\r\n public specularExponent: number = 13.5;\r\n /** Currently unused. @alpha */\r\n public reflect: number = 0.0;\r\n /** Currently unused. @alpha */\r\n public refract: number = 1.0;\r\n /** Currently unused. @alpha */\r\n public ambient: number = .3;\r\n /** Currently unused. @alpha */\r\n public shadows = true;\r\n private _alpha?: number;\r\n\r\n public constructor(key?: string) { this.key = key; }\r\n\r\n /** Obtain an immutable instance of a RenderMaterial with all default properties. */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public static readonly defaults = new Params();\r\n\r\n /** A value from 0.0 (fully-transparent) to 1.0 (fully-opaque) controlling the transparency of surfaces to which this material is applied;\r\n * or undefined if this material does not override surface transparency.\r\n */\r\n public get alpha(): number | undefined { return this._alpha; }\r\n public set alpha(alpha: number | undefined) {\r\n this._alpha = undefined !== alpha ? clampToNormalizedRange(alpha) : undefined;\r\n }\r\n\r\n /** Create a RenderMaterial params object using specified key and ColorDef values, as well as an optional texture mapping. */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public static fromColors(key?: string, diffuseColor?: ColorDef, specularColor?: ColorDef, emissiveColor?: ColorDef, reflectColor?: ColorDef, textureMap?: TextureMapping): Params {\r\n // eslint-disable-next-line deprecation/deprecation\r\n const materialParams = new Params();\r\n materialParams.key = key;\r\n materialParams.diffuseColor = diffuseColor;\r\n materialParams.specularColor = specularColor;\r\n materialParams.emissiveColor = emissiveColor;\r\n materialParams.reflectColor = reflectColor;\r\n materialParams.textureMapping = textureMap;\r\n return materialParams;\r\n }\r\n }\r\n}\r\n\r\n// eslint-disable-next-line deprecation/deprecation\r\nObject.freeze(RenderMaterial.Params.defaults);\r\n"]}
|
|
@@ -18,6 +18,8 @@ export type TextureImageSpec = Id64String | string;
|
|
|
18
18
|
export declare abstract class RenderTexture implements IDisposable {
|
|
19
19
|
/** Indicates the type of texture. */
|
|
20
20
|
readonly type: RenderTexture.Type;
|
|
21
|
+
/** Used for ordered comparisons, e.g. in DisplayParams.compareForMerge */
|
|
22
|
+
private readonly _guid;
|
|
21
23
|
get isTileSection(): boolean;
|
|
22
24
|
get isGlyph(): boolean;
|
|
23
25
|
get isSkyBox(): boolean;
|
|
@@ -29,6 +31,8 @@ export declare abstract class RenderTexture implements IDisposable {
|
|
|
29
31
|
* its disposal.
|
|
30
32
|
*/
|
|
31
33
|
abstract dispose(): void;
|
|
34
|
+
/** An [OrderedComparator]($bentley) that compares this texture against `other`. */
|
|
35
|
+
compare(other: RenderTexture): number;
|
|
32
36
|
}
|
|
33
37
|
/** @public */
|
|
34
38
|
export declare namespace RenderTexture {
|
|
@@ -48,7 +52,7 @@ export declare namespace RenderTexture {
|
|
|
48
52
|
ThematicGradient = 5
|
|
49
53
|
}
|
|
50
54
|
/** Parameters used to construct a [[RenderTexture]].
|
|
51
|
-
* @deprecated in 3.x. use RenderSystem.createTexture and
|
|
55
|
+
* @deprecated in 3.x. use RenderSystem.createTexture and CreateTextureArgs.
|
|
52
56
|
* @public
|
|
53
57
|
*/
|
|
54
58
|
class Params {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderTexture.d.ts","sourceRoot":"","sources":["../../src/RenderTexture.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"RenderTexture.d.ts","sourceRoot":"","sources":["../../src/Render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AW,aAAa,IAAI,OAAO,CAAyD;QAC5F,IAAW,OAAO,IAAI,OAAO,CAAmD;QAChF,IAAW,QAAQ,IAAI,OAAO,CAAoD;KACnF;CACF"}
|
package/lib/cjs/RenderTexture.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.RenderTexture = void 0;
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
11
12
|
/** Represents a texture image applied to a surface during rendering.
|
|
12
13
|
* A RenderTexture is typically - but not always - associated with a [[RenderMaterial]].
|
|
13
14
|
* @see [RenderSystem.createTextureFromImage]($frontend) to obtain a texture from an HTML image.
|
|
@@ -20,6 +21,11 @@ class RenderTexture {
|
|
|
20
21
|
get isSkyBox() { return RenderTexture.Type.SkyBox === this.type; }
|
|
21
22
|
constructor(type) {
|
|
22
23
|
this.type = type;
|
|
24
|
+
this._guid = core_bentley_1.Guid.createValue();
|
|
25
|
+
}
|
|
26
|
+
/** An [OrderedComparator]($bentley) that compares this texture against `other`. */
|
|
27
|
+
compare(other) {
|
|
28
|
+
return (0, core_bentley_1.compareStrings)(this._guid, other._guid);
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
exports.RenderTexture = RenderTexture;
|
|
@@ -42,7 +48,7 @@ exports.RenderTexture = RenderTexture;
|
|
|
42
48
|
Type[Type["ThematicGradient"] = 5] = "ThematicGradient";
|
|
43
49
|
})(Type = RenderTexture.Type || (RenderTexture.Type = {}));
|
|
44
50
|
/** Parameters used to construct a [[RenderTexture]].
|
|
45
|
-
* @deprecated in 3.x. use RenderSystem.createTexture and
|
|
51
|
+
* @deprecated in 3.x. use RenderSystem.createTexture and CreateTextureArgs.
|
|
46
52
|
* @public
|
|
47
53
|
*/
|
|
48
54
|
class Params {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderTexture.js","sourceRoot":"","sources":["../../src/RenderTexture.ts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,CAAC,IAAI,CAAC,MAAM,EAAE,UAAmB,KAAK;YAC7G,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;YACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;QAED,IAAW,aAAa,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5F,IAAW,OAAO,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAChF,IAAW,QAAQ,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KACnF;IArBY,oBAAM,SAqBlB,CAAA;AACH,CAAC,EA3CgB,aAAa,6BAAb,aAAa,QA2C7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { compareStrings, Guid, GuidString, Id64String, IDisposable } from \"@itwin/core-bentley\";\r\n\r\n/** Identifies an image to be used to produce a [[RenderTexture]] for a given purpose - for example,\r\n * as part of a [[SkyBox]]. If the string is a valid `Id64String`, it refers to a persistent [Texture]($backend) element stored in an iModel.\r\n * Otherwise, it is interpreted as a Url resolving to an HTMLImageElement.\r\n * @see [[SkySphereImageProps.texture]] and [[SkyCubeImageProps]].\r\n * @public\r\n */\r\nexport type TextureImageSpec = Id64String | string;\r\n\r\n/** Represents a texture image applied to a surface during rendering.\r\n * A RenderTexture is typically - but not always - associated with a [[RenderMaterial]].\r\n * @see [RenderSystem.createTextureFromImage]($frontend) to obtain a texture from an HTML image.\r\n * @see [RenderSystem.createTextureFromElement]($frontend) to obtain a texture from a [Texture]($backend) element.\r\n * @public\r\n */\r\nexport abstract class RenderTexture implements IDisposable {\r\n /** Indicates the type of texture. */\r\n public readonly type: RenderTexture.Type;\r\n /** Used for ordered comparisons, e.g. in DisplayParams.compareForMerge */\r\n private readonly _guid: GuidString;\r\n\r\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\r\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\r\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\r\n public abstract get bytesUsed(): number;\r\n\r\n protected constructor(type: RenderTexture.Type) {\r\n this.type = type;\r\n this._guid = Guid.createValue();\r\n }\r\n\r\n /** Releases any WebGL resources owned by this texture.\r\n * For a texture created by a [RenderSystem]($frontend) for which [CreateTextureArgs.ownership]($frontend) was specified as \"external\",\r\n * the caller is responsible for invoking this method when it is finished using the texture; otherwise, the [RenderSystem]($frontend) will handle\r\n * its disposal.\r\n */\r\n public abstract dispose(): void;\r\n\r\n /** An [OrderedComparator]($bentley) that compares this texture against `other`. */\r\n public compare(other: RenderTexture): number {\r\n return compareStrings(this._guid, other._guid);\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace RenderTexture { // eslint-disable-line no-redeclare\r\n /** The types of [[RenderTexture]]s that can be created by a [RenderSystem]($frontend). */\r\n export enum Type {\r\n /** An image applied to a surface, with support for mip-mapping and repetition. */\r\n Normal,\r\n /** An image containing any number of text glyphs, used for efficiently rendering readable small text. */\r\n Glyph,\r\n /** A non-repeating image with no mip-maps, used for example for reality models. */\r\n TileSection,\r\n /** A three-dimensional texture used for rendering a skybox. */\r\n SkyBox,\r\n /** A non-repeating image with mip-maps and and anisotropic filtering, used for map tiles when draped on terrain. */\r\n FilteredTileSection,\r\n /** A gradient image used for thematic display. */\r\n ThematicGradient,\r\n }\r\n\r\n /** Parameters used to construct a [[RenderTexture]].\r\n * @deprecated in 3.x. use RenderSystem.createTexture and CreateTextureArgs.\r\n * @public\r\n */\r\n export class Params {\r\n /** A string uniquely identifying this texture within the context of an [[IModel]]. Typically this is the element Id of the corresponding [Texture]($backend) element.\r\n * Textures created on the front-end generally have no key.\r\n */\r\n public readonly key?: string;\r\n /** Indicates the type of texture. */\r\n public readonly type: RenderTexture.Type;\r\n /** Indicates that some object is managing the lifetime of this texture and will take care of calling its dispose function appropriately.\r\n * An unowned texture associated with a [RenderGraphic]($frontend) will be disposed when the RenderGraphic is disposed.\r\n */\r\n public readonly isOwned: boolean;\r\n\r\n public constructor(key?: string, type: RenderTexture.Type = RenderTexture.Type.Normal, isOwned: boolean = false) {\r\n this.key = key;\r\n this.type = type;\r\n this.isOwned = isOwned;\r\n }\r\n\r\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\r\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\r\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\r\n }\r\n}\r\n"]}
|
|
@@ -33,6 +33,8 @@ export declare class TextureMapping {
|
|
|
33
33
|
constructor(tx: RenderTexture, params: TextureMapping.Params);
|
|
34
34
|
/** @internal */
|
|
35
35
|
computeUVParams(visitor: PolyfaceVisitor, transformToImodel: Transform): Point2d[] | undefined;
|
|
36
|
+
/** An [OrderedComparator]($bentley) that compares this mapping against `other`. */
|
|
37
|
+
compare(other: TextureMapping): number;
|
|
36
38
|
}
|
|
37
39
|
/** @public */
|
|
38
40
|
export declare namespace TextureMapping {
|
|
@@ -74,6 +76,8 @@ export declare namespace TextureMapping {
|
|
|
74
76
|
constructor(m00?: number, m01?: number, originX?: number, m10?: number, m11?: number, originY?: number);
|
|
75
77
|
/** An immutable 2x3 identity matrix. */
|
|
76
78
|
static readonly identity: Trans2x3;
|
|
79
|
+
/** An [OrderedComparator]($bentley) that compares this Trans2x3 against `other`. */
|
|
80
|
+
compare(other: Trans2x3): number;
|
|
77
81
|
}
|
|
78
82
|
/** Properties used to construct a [[TextureMapping.ConstantLodParams]]. */
|
|
79
83
|
interface ConstantLodParamProps {
|
|
@@ -136,6 +140,8 @@ export declare namespace TextureMapping {
|
|
|
136
140
|
/** Parameters for constantLod mapping mode. */
|
|
137
141
|
constantLodParams: ConstantLodParams;
|
|
138
142
|
constructor(props?: TextureMapping.ParamProps);
|
|
143
|
+
/** An [OrderedComparator]($bentley) that compares these Params against `other`. */
|
|
144
|
+
compare(other: Params): number;
|
|
139
145
|
/**
|
|
140
146
|
* Generates UV parameters for textured surfaces. Returns undefined on failure.
|
|
141
147
|
* @internal
|