@itwin/core-common 5.0.0-dev.99 → 5.1.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/lib/cjs/CatalogIModel.d.ts +152 -0
- package/lib/cjs/CatalogIModel.d.ts.map +1 -0
- package/lib/cjs/CatalogIModel.js +30 -0
- package/lib/cjs/CatalogIModel.js.map +1 -0
- package/lib/cjs/CesiumIonAssets.d.ts +23 -0
- package/lib/cjs/CesiumIonAssets.d.ts.map +1 -0
- package/lib/cjs/CesiumIonAssets.js +32 -0
- package/lib/cjs/CesiumIonAssets.js.map +1 -0
- package/lib/cjs/ContourDisplay.d.ts +9 -0
- package/lib/cjs/ContourDisplay.d.ts.map +1 -1
- package/lib/cjs/ContourDisplay.js +19 -15
- package/lib/cjs/ContourDisplay.js.map +1 -1
- package/lib/cjs/ITwinCoreErrors.d.ts +87 -8
- package/lib/cjs/ITwinCoreErrors.d.ts.map +1 -1
- package/lib/cjs/ITwinCoreErrors.js +74 -12
- package/lib/cjs/ITwinCoreErrors.js.map +1 -1
- package/lib/cjs/MapLayerSettings.d.ts +4 -2
- package/lib/cjs/MapLayerSettings.d.ts.map +1 -1
- package/lib/cjs/MapLayerSettings.js +4 -2
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/TerrainSettings.d.ts +0 -12
- package/lib/cjs/TerrainSettings.d.ts.map +1 -1
- package/lib/cjs/TerrainSettings.js +3 -15
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/core-common.d.ts +2 -0
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +2 -0
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/esm/CatalogIModel.d.ts +152 -0
- package/lib/esm/CatalogIModel.d.ts.map +1 -0
- package/lib/esm/CatalogIModel.js +27 -0
- package/lib/esm/CatalogIModel.js.map +1 -0
- package/lib/esm/CesiumIonAssets.d.ts +23 -0
- package/lib/esm/CesiumIonAssets.d.ts.map +1 -0
- package/lib/esm/CesiumIonAssets.js +29 -0
- package/lib/esm/CesiumIonAssets.js.map +1 -0
- package/lib/esm/ContourDisplay.d.ts +9 -0
- package/lib/esm/ContourDisplay.d.ts.map +1 -1
- package/lib/esm/ContourDisplay.js +20 -16
- package/lib/esm/ContourDisplay.js.map +1 -1
- package/lib/esm/ITwinCoreErrors.d.ts +87 -8
- package/lib/esm/ITwinCoreErrors.d.ts.map +1 -1
- package/lib/esm/ITwinCoreErrors.js +73 -11
- package/lib/esm/ITwinCoreErrors.js.map +1 -1
- package/lib/esm/MapLayerSettings.d.ts +4 -2
- package/lib/esm/MapLayerSettings.d.ts.map +1 -1
- package/lib/esm/MapLayerSettings.js +4 -2
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/TerrainSettings.d.ts +0 -12
- package/lib/esm/TerrainSettings.d.ts.map +1 -1
- package/lib/esm/TerrainSettings.js +1 -13
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/core-common.d.ts +2 -0
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +2 -0
- package/lib/esm/core-common.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Change Log - @itwin/core-common
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 10 Apr 2025 17:50:15 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.10.13
|
|
6
|
+
Thu, 10 Apr 2025 17:47:21 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
4
9
|
|
|
5
10
|
## 4.10.12
|
|
6
11
|
Wed, 02 Apr 2025 19:35:47 GMT
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module NativeApp
|
|
3
|
+
*/
|
|
4
|
+
import { Id64String, ITwinError } from "@itwin/core-bentley";
|
|
5
|
+
import { LocalFileName } from "./ChangesetProps";
|
|
6
|
+
import { IModelConnectionProps, SnapshotOpenOptions } from "./IModel";
|
|
7
|
+
/**
|
|
8
|
+
* Errors produced by the [[CatalogIModel]] API.
|
|
9
|
+
* @beta
|
|
10
|
+
*/
|
|
11
|
+
export declare namespace CatalogError {
|
|
12
|
+
const scope = "itwin-Catalog";
|
|
13
|
+
type Key = "invalid-seed-catalog" | "manifest-missing";
|
|
14
|
+
/** Determine whether an error object is a CatalogError */
|
|
15
|
+
function isError(error: unknown, key?: Key): error is ITwinError;
|
|
16
|
+
/** Instantiate and throw a CatalogError */
|
|
17
|
+
function throwError<T extends ITwinError>(key: Key, e: Omit<T, "name" | "iTwinErrorId">): never;
|
|
18
|
+
}
|
|
19
|
+
/** A "catalog iModel" is an [[IModel]] containing elements (e.g., component definitions) that are intended to be copied into another iModel by applications.
|
|
20
|
+
* They can be stored in [BlobContainer]($backend)s managed by a "reference data service" that uses [semantic versioning](https://semver.org/), much like [WorkspaceDb]($backend)s.
|
|
21
|
+
* @see [CatalogDb]($backend) to interact with catalog iModels on the backend
|
|
22
|
+
* @see [CatalogConnection]($frontend) to interact with catalog iModels on the frontend.
|
|
23
|
+
* @beta
|
|
24
|
+
*/
|
|
25
|
+
export declare namespace CatalogIModel {
|
|
26
|
+
/** Metadata describing a catalog iModel.
|
|
27
|
+
* @note Only the [[catalogName]] field is required, and users may add additional fields for their own purposes.
|
|
28
|
+
* @note The manifest is stored inside of the CatalogIModel, so it is versioned along with the rest of the catalog's contents.
|
|
29
|
+
* @beta
|
|
30
|
+
*/
|
|
31
|
+
interface Manifest {
|
|
32
|
+
/** The iTwinId for the Catalog */
|
|
33
|
+
readonly iTwinId?: Id64String;
|
|
34
|
+
/**
|
|
35
|
+
* The name of the Catalog to be shown in user interfaces. Organizations should attempt to make this name informative enough
|
|
36
|
+
* so that uses may refer to it in conversations. It should also be unique enough that there's no confusion when it appears in
|
|
37
|
+
* lists of catalogs.
|
|
38
|
+
* @note it is possible and valid to change the catalogName between versions of a CatalogIModel (e.g. incorporating a date).
|
|
39
|
+
*/
|
|
40
|
+
readonly catalogName: string;
|
|
41
|
+
/** A description of the contents of this catalog to help users understand its purpose and appropriate usage. */
|
|
42
|
+
readonly description?: string;
|
|
43
|
+
/** The name of the person to contact with questions about this catalog */
|
|
44
|
+
readonly contactName?: string;
|
|
45
|
+
/** The name of the person who last modified this catalog. */
|
|
46
|
+
lastEditedBy?: string;
|
|
47
|
+
}
|
|
48
|
+
/** Arguments for creating a new [BlobContainer]($backend) that holds (versions of) a CatalogIModel. */
|
|
49
|
+
interface CreateNewContainerArgs {
|
|
50
|
+
/** supplies the iTwinId for the new container */
|
|
51
|
+
readonly iTwinId: Id64String;
|
|
52
|
+
/** metadata stored with the new container */
|
|
53
|
+
readonly metadata: {
|
|
54
|
+
/** a "name" for the Catalog container. Should be long enough to be unique, but this is not enforced. */
|
|
55
|
+
label: string;
|
|
56
|
+
/** Optional human-readable explanation of the information held in the container. This will be displayed in the administrator RBAC panel, and on usage reports. */
|
|
57
|
+
description?: string;
|
|
58
|
+
/** optional properties for the container */
|
|
59
|
+
json?: {
|
|
60
|
+
[key: string]: any;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
/** The manifest to be stored in the catalog */
|
|
64
|
+
readonly manifest: Manifest;
|
|
65
|
+
/** The name for the CatalogIModel database within the container. May not contain a version. Default is "catalog-db" */
|
|
66
|
+
readonly dbName?: string;
|
|
67
|
+
/** version for the catalog created [[localCatalogFile]]. Defaults to "0.0.0" */
|
|
68
|
+
readonly version?: string;
|
|
69
|
+
/** A filename on the local computer of the "seed" CatalogIModel to be uploaded into the new container */
|
|
70
|
+
readonly localCatalogFile: LocalFileName;
|
|
71
|
+
}
|
|
72
|
+
/** Properties of a newly created container created from [[CatalogIModel.CreateNewContainerArgs]]. Most importantly, this holds the ContainerId of the new container. */
|
|
73
|
+
interface NewContainerProps {
|
|
74
|
+
/** The ContainerId of the new container (usually a [Guid]($bentley)). Applications should store this value to access the container via the CatalogIModel apis. */
|
|
75
|
+
readonly containerId: string;
|
|
76
|
+
/** the uri of the BlobContainer service where the new container resides. */
|
|
77
|
+
readonly baseUri: string;
|
|
78
|
+
/** name of the blob storage provider. */
|
|
79
|
+
readonly provider: "azure" | "google";
|
|
80
|
+
}
|
|
81
|
+
/** Properties to identify a specific CatalogIModel within a container. */
|
|
82
|
+
interface NameAndVersion {
|
|
83
|
+
/** The name of the catalog database. Defaults to "catalog-db" for CatalogIModels stored in cloud containers. */
|
|
84
|
+
readonly dbName?: string;
|
|
85
|
+
/** The range of acceptable versions of the database of the specified [[dbName]].
|
|
86
|
+
* If not present, defaults to the newest available version.
|
|
87
|
+
*/
|
|
88
|
+
readonly version?: VersionRange;
|
|
89
|
+
}
|
|
90
|
+
/** Arguments to open an existing version of a CatalogIModel. */
|
|
91
|
+
interface OpenArgs extends NameAndVersion, SnapshotOpenOptions {
|
|
92
|
+
/** The ContainerId of the cloud container. If not present, dbName is the name of a file on the local computer. */
|
|
93
|
+
containerId?: string;
|
|
94
|
+
/** If true, attempt to synchronize the container with any changes in the cloud. Since this automatically happens the first time a
|
|
95
|
+
* container is accessed within a session, this is usually not necessary except for tests.
|
|
96
|
+
*/
|
|
97
|
+
syncWithCloud?: boolean;
|
|
98
|
+
/** Start a prefetch operation on the CatalogIModel as it is opened. */
|
|
99
|
+
prefetch?: boolean;
|
|
100
|
+
}
|
|
101
|
+
/** Arguments to create a new version of a CatalogIModel from (a copy of) an existing version in a cloud container. */
|
|
102
|
+
interface CreateNewVersionArgs {
|
|
103
|
+
/** The id of cloud container. */
|
|
104
|
+
readonly containerId: string;
|
|
105
|
+
/** the source version of the CatalogIModel, from which the new version will copied. */
|
|
106
|
+
readonly fromDb: NameAndVersion;
|
|
107
|
+
/** The type of version increment to apply to the source version. */
|
|
108
|
+
readonly versionType: "major" | "minor" | "patch" | "premajor" | "preminor" | "prepatch" | "prerelease";
|
|
109
|
+
/** For prerelease versions, a string that becomes part of the version name. */
|
|
110
|
+
readonly identifier?: string;
|
|
111
|
+
}
|
|
112
|
+
/** A [semver string](https://github.com/npm/node-semver?tab=readme-ov-file#ranges) describing a range of acceptable [[CatalogIModel]]s,
|
|
113
|
+
* e.g., ">=1.2.7 <1.3.0".
|
|
114
|
+
*/
|
|
115
|
+
type VersionRange = string;
|
|
116
|
+
/** The name of the ipc channel for [[IpcMethods]]
|
|
117
|
+
* @internal
|
|
118
|
+
*/
|
|
119
|
+
type IpcChannel = "catalogIModel/ipc";
|
|
120
|
+
/** @internal */
|
|
121
|
+
interface IpcMethods {
|
|
122
|
+
/** create a new container from the BlobContainerService for holding a CatalogIModel. Also uploads the seed file */
|
|
123
|
+
createNewContainer(args: CreateNewContainerArgs): Promise<NewContainerProps>;
|
|
124
|
+
/** Acquire the write lock for a CatalogIModel container. */
|
|
125
|
+
acquireWriteLock(args: {
|
|
126
|
+
containerId: string;
|
|
127
|
+
username: string;
|
|
128
|
+
}): Promise<void>;
|
|
129
|
+
/** Release the write lock for a CatalogIModel container. */
|
|
130
|
+
releaseWriteLock(args: {
|
|
131
|
+
containerId: string;
|
|
132
|
+
abandon?: true;
|
|
133
|
+
}): Promise<void>;
|
|
134
|
+
/** create a new version of a CatalogIModel from an existing version. */
|
|
135
|
+
createNewVersion(args: CreateNewVersionArgs): Promise<{
|
|
136
|
+
oldDb: NameAndVersion;
|
|
137
|
+
newDb: NameAndVersion;
|
|
138
|
+
}>;
|
|
139
|
+
/** Attempt to open a CatalogIModel readonly*/
|
|
140
|
+
openReadonly(args: OpenArgs): Promise<IModelConnectionProps>;
|
|
141
|
+
/** Attempt to open a CatalogIModel for editing */
|
|
142
|
+
openEditable(args: OpenArgs): Promise<IModelConnectionProps>;
|
|
143
|
+
/** Get the manifest and version number for an open CatalogConnection. */
|
|
144
|
+
getInfo(key: string): Promise<{
|
|
145
|
+
manifest?: CatalogIModel.Manifest;
|
|
146
|
+
version: string;
|
|
147
|
+
}>;
|
|
148
|
+
/** Update the manifest stored in an open EditableCatalog */
|
|
149
|
+
updateCatalogManifest(key: string, manifest: CatalogIModel.Manifest): Promise<void>;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=CatalogIModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CatalogIModel.d.ts","sourceRoot":"","sources":["../../src/CatalogIModel.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEtE;;;GAGG;AACH,yBAAiB,YAAY,CAAC;IACrB,MAAM,KAAK,kBAAkB,CAAC;IAErC,KAAY,GAAG,GACb,sBAAsB,GACtB,kBAAkB,CAAC;IAErB,0DAA0D;IAC1D,SAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,IAAI,UAAU,CAEtE;IAED,2CAA2C;IAC3C,SAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,GAAG,KAAK,CAErG;CACF;AAED;;;;;GAKG;AACH,yBAAiB,aAAa,CAAC;IAE7B;;;;OAIG;IACH,UAAiB,QAAQ;QACvB,kCAAkC;QAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC;QAE9B;;;;;WAKG;QACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,gHAAgH;QAChH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAC9B,0EAA0E;QAC1E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAC9B,6DAA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O,CAAC,qBAAqB,CAAC,CAAC;QAC7D,yEAAyE;QACzE,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;YAAE,QAAQ,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACtF,4DAA4D;QAC5D,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACrF;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module NativeApp
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.CatalogError = void 0;
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
+
/**
|
|
13
|
+
* Errors produced by the [[CatalogIModel]] API.
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
var CatalogError;
|
|
17
|
+
(function (CatalogError) {
|
|
18
|
+
CatalogError.scope = "itwin-Catalog";
|
|
19
|
+
/** Determine whether an error object is a CatalogError */
|
|
20
|
+
function isError(error, key) {
|
|
21
|
+
return core_bentley_1.ITwinError.isError(error, CatalogError.scope, key);
|
|
22
|
+
}
|
|
23
|
+
CatalogError.isError = isError;
|
|
24
|
+
/** Instantiate and throw a CatalogError */
|
|
25
|
+
function throwError(key, e) {
|
|
26
|
+
core_bentley_1.ITwinError.throwError({ ...e, iTwinErrorId: { scope: CatalogError.scope, key } });
|
|
27
|
+
}
|
|
28
|
+
CatalogError.throwError = throwError;
|
|
29
|
+
})(CatalogError || (exports.CatalogError = CatalogError = {}));
|
|
30
|
+
//# sourceMappingURL=CatalogIModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CatalogIModel.js","sourceRoot":"","sources":["../../src/CatalogIModel.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6D;AAI7D;;;GAGG;AACH,IAAiB,YAAY,CAgB5B;AAhBD,WAAiB,YAAY;IACd,kBAAK,GAAG,eAAe,CAAC;IAMrC,0DAA0D;IAC1D,SAAgB,OAAO,CAAC,KAAc,EAAE,GAAS;QAC/C,OAAO,yBAAU,CAAC,OAAO,CAAa,KAAK,EAAE,aAAA,KAAK,EAAE,GAAG,CAAC,CAAC;IAC3D,CAAC;IAFe,oBAAO,UAEtB,CAAA;IAED,2CAA2C;IAC3C,SAAgB,UAAU,CAAuB,GAAQ,EAAE,CAAmC;QAC5F,yBAAU,CAAC,UAAU,CAAa,EAAE,GAAG,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAL,aAAA,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAFe,uBAAU,aAEzB,CAAA;AACH,CAAC,EAhBgB,YAAY,4BAAZ,YAAY,QAgB5B","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 NativeApp\n */\n\nimport { Id64String, ITwinError } from \"@itwin/core-bentley\";\nimport { LocalFileName } from \"./ChangesetProps\";\nimport { IModelConnectionProps, SnapshotOpenOptions } from \"./IModel\";\n\n/**\n * Errors produced by the [[CatalogIModel]] API.\n * @beta\n */\nexport namespace CatalogError {\n export const scope = \"itwin-Catalog\";\n\n export type Key =\n \"invalid-seed-catalog\" |\n \"manifest-missing\";\n\n /** Determine whether an error object is a CatalogError */\n export function isError(error: unknown, key?: Key): error is ITwinError {\n return ITwinError.isError<ITwinError>(error, scope, key);\n }\n\n /** Instantiate and throw a CatalogError */\n export function throwError<T extends ITwinError>(key: Key, e: Omit<T, \"name\" | \"iTwinErrorId\">): never {\n ITwinError.throwError<ITwinError>({ ...e, iTwinErrorId: { scope, key } });\n }\n}\n\n/** A \"catalog iModel\" is an [[IModel]] containing elements (e.g., component definitions) that are intended to be copied into another iModel by applications.\n * They can be stored in [BlobContainer]($backend)s managed by a \"reference data service\" that uses [semantic versioning](https://semver.org/), much like [WorkspaceDb]($backend)s.\n * @see [CatalogDb]($backend) to interact with catalog iModels on the backend\n * @see [CatalogConnection]($frontend) to interact with catalog iModels on the frontend.\n * @beta\n */\nexport namespace CatalogIModel {\n\n /** Metadata describing a catalog iModel.\n * @note Only the [[catalogName]] field is required, and users may add additional fields for their own purposes.\n * @note The manifest is stored inside of the CatalogIModel, so it is versioned along with the rest of the catalog's contents.\n * @beta\n */\n export interface Manifest {\n /** The iTwinId for the Catalog */\n readonly iTwinId?: Id64String;\n\n /**\n * The name of the Catalog to be shown in user interfaces. Organizations should attempt to make this name informative enough\n * so that uses may refer to it in conversations. It should also be unique enough that there's no confusion when it appears in\n * lists of catalogs.\n * @note it is possible and valid to change the catalogName between versions of a CatalogIModel (e.g. incorporating a date).\n */\n readonly catalogName: string;\n /** A description of the contents of this catalog to help users understand its purpose and appropriate usage. */\n readonly description?: string;\n /** The name of the person to contact with questions about this catalog */\n readonly contactName?: string;\n /** The name of the person who last modified this catalog. */\n lastEditedBy?: string;\n }\n\n /** Arguments for creating a new [BlobContainer]($backend) that holds (versions of) a CatalogIModel. */\n export interface CreateNewContainerArgs {\n /** supplies the iTwinId for the new container */\n readonly iTwinId: Id64String;\n /** metadata stored with the new container */\n readonly metadata: {\n /** a \"name\" for the Catalog container. Should be long enough to be unique, but this is not enforced. */\n label: string;\n /** Optional human-readable explanation of the information held in the container. This will be displayed in the administrator RBAC panel, and on usage reports. */\n description?: string;\n /** optional properties for the container */\n json?: { [key: string]: any };\n }\n\n /** The manifest to be stored in the catalog */\n readonly manifest: Manifest;\n /** The name for the CatalogIModel database within the container. May not contain a version. Default is \"catalog-db\" */\n readonly dbName?: string,\n /** version for the catalog created [[localCatalogFile]]. Defaults to \"0.0.0\" */\n readonly version?: string;\n /** A filename on the local computer of the \"seed\" CatalogIModel to be uploaded into the new container */\n readonly localCatalogFile: LocalFileName;\n }\n\n /** Properties of a newly created container created from [[CatalogIModel.CreateNewContainerArgs]]. Most importantly, this holds the ContainerId of the new container. */\n export interface NewContainerProps {\n /** The ContainerId of the new container (usually a [Guid]($bentley)). Applications should store this value to access the container via the CatalogIModel apis. */\n readonly containerId: string;\n /** the uri of the BlobContainer service where the new container resides. */\n readonly baseUri: string;\n /** name of the blob storage provider. */\n readonly provider: \"azure\" | \"google\";\n }\n\n /** Properties to identify a specific CatalogIModel within a container. */\n export interface NameAndVersion {\n /** The name of the catalog database. Defaults to \"catalog-db\" for CatalogIModels stored in cloud containers. */\n readonly dbName?: string;\n /** The range of acceptable versions of the database of the specified [[dbName]].\n * If not present, defaults to the newest available version.\n */\n readonly version?: VersionRange;\n }\n\n /** Arguments to open an existing version of a CatalogIModel. */\n export interface OpenArgs extends NameAndVersion, SnapshotOpenOptions {\n /** The ContainerId of the cloud container. If not present, dbName is the name of a file on the local computer. */\n containerId?: string;\n /** If true, attempt to synchronize the container with any changes in the cloud. Since this automatically happens the first time a\n * container is accessed within a session, this is usually not necessary except for tests.\n */\n syncWithCloud?: boolean;\n /** Start a prefetch operation on the CatalogIModel as it is opened. */\n prefetch?: boolean;\n }\n\n /** Arguments to create a new version of a CatalogIModel from (a copy of) an existing version in a cloud container. */\n export interface CreateNewVersionArgs {\n /** The id of cloud container. */\n readonly containerId: string;\n /** the source version of the CatalogIModel, from which the new version will copied. */\n readonly fromDb: NameAndVersion;\n /** The type of version increment to apply to the source version. */\n readonly versionType: \"major\" | \"minor\" | \"patch\" | \"premajor\" | \"preminor\" | \"prepatch\" | \"prerelease\";\n /** For prerelease versions, a string that becomes part of the version name. */\n readonly identifier?: string;\n }\n\n /** A [semver string](https://github.com/npm/node-semver?tab=readme-ov-file#ranges) describing a range of acceptable [[CatalogIModel]]s,\n * e.g., \">=1.2.7 <1.3.0\".\n */\n export type VersionRange = string;\n\n /** The name of the ipc channel for [[IpcMethods]]\n * @internal\n */\n export type IpcChannel = \"catalogIModel/ipc\";\n\n /** @internal */\n export interface IpcMethods {\n /** create a new container from the BlobContainerService for holding a CatalogIModel. Also uploads the seed file */\n createNewContainer(args: CreateNewContainerArgs): Promise<NewContainerProps>;\n /** Acquire the write lock for a CatalogIModel container. */\n acquireWriteLock(args: { containerId: string, username: string }): Promise<void>;\n /** Release the write lock for a CatalogIModel container. */\n releaseWriteLock(args: { containerId: string, abandon?: true }): Promise<void>;\n /** create a new version of a CatalogIModel from an existing version. */\n createNewVersion(args: CreateNewVersionArgs): Promise<{ oldDb: NameAndVersion, newDb: NameAndVersion }>;\n /** Attempt to open a CatalogIModel readonly*/\n openReadonly(args: OpenArgs): Promise<IModelConnectionProps>;\n /** Attempt to open a CatalogIModel for editing */\n openEditable(args: OpenArgs): Promise<IModelConnectionProps>;\n /** Get the manifest and version number for an open CatalogConnection. */\n getInfo(key: string): Promise<{ manifest?: CatalogIModel.Manifest, version: string }>;\n /** Update the manifest stored in an open EditableCatalog */\n updateCatalogManifest(key: string, manifest: CatalogIModel.Manifest): Promise<void>;\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module DisplayStyles
|
|
3
|
+
*/
|
|
4
|
+
/** Ids of [Cesium ion assets](https://cesium.com/platform/cesium-ion/content/) providing global terrain data.
|
|
5
|
+
* These values are appropriate to use with [[TerrainSettings.dataSource]] when [[TerrainSettings.providerName]] is set to "CesiumWorldTerrain".
|
|
6
|
+
* You may alternatively use the Id of any ion asset to which you have access.
|
|
7
|
+
* @see [[TerrainSettings.fromCesiumIonAsset]] to create TerrainSettings that obtain terrain from a specified ion asset.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare enum CesiumTerrainAssetId {
|
|
11
|
+
/** Default [global 3d terrain](https://cesium.com/platform/cesium-ion/content/cesium-world-terrain/). */
|
|
12
|
+
Default = "1",
|
|
13
|
+
/** Global 3d terrain that includes [bathymetry](https://cesium.com/platform/cesium-ion/content/cesium-world-bathymetry/) (seafloor) terrain. */
|
|
14
|
+
Bathymetry = "2426648"
|
|
15
|
+
}
|
|
16
|
+
/** Ids of [Cesium ion assets](https://cesium.com/platform/cesium-ion/content/) providing data not covered by [[CesiumTerrainAssetId]].
|
|
17
|
+
* @beta
|
|
18
|
+
*/
|
|
19
|
+
export declare enum CesiumIonAssetId {
|
|
20
|
+
/** [Cesium OSM Buildings](https://cesium.com/platform/cesium-ion/content/cesium-osm-buildings/). */
|
|
21
|
+
OSMBuildings = "96188"
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=CesiumIonAssets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CesiumIonAssets.d.ts","sourceRoot":"","sources":["../../src/CesiumIonAssets.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;;;GAKG;AACH,oBAAY,oBAAoB;IAC9B,yGAAyG;IACzG,OAAO,MAAM;IACb,gJAAgJ;IAChJ,UAAU,YAAY;CACvB;AAED;;GAEG;AACH,oBAAY,gBAAgB;IAC1B,oGAAoG;IACpG,YAAY,UAAU;CACvB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module DisplayStyles
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.CesiumIonAssetId = exports.CesiumTerrainAssetId = void 0;
|
|
11
|
+
/** Ids of [Cesium ion assets](https://cesium.com/platform/cesium-ion/content/) providing global terrain data.
|
|
12
|
+
* These values are appropriate to use with [[TerrainSettings.dataSource]] when [[TerrainSettings.providerName]] is set to "CesiumWorldTerrain".
|
|
13
|
+
* You may alternatively use the Id of any ion asset to which you have access.
|
|
14
|
+
* @see [[TerrainSettings.fromCesiumIonAsset]] to create TerrainSettings that obtain terrain from a specified ion asset.
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
var CesiumTerrainAssetId;
|
|
18
|
+
(function (CesiumTerrainAssetId) {
|
|
19
|
+
/** Default [global 3d terrain](https://cesium.com/platform/cesium-ion/content/cesium-world-terrain/). */
|
|
20
|
+
CesiumTerrainAssetId["Default"] = "1";
|
|
21
|
+
/** Global 3d terrain that includes [bathymetry](https://cesium.com/platform/cesium-ion/content/cesium-world-bathymetry/) (seafloor) terrain. */
|
|
22
|
+
CesiumTerrainAssetId["Bathymetry"] = "2426648";
|
|
23
|
+
})(CesiumTerrainAssetId || (exports.CesiumTerrainAssetId = CesiumTerrainAssetId = {}));
|
|
24
|
+
/** Ids of [Cesium ion assets](https://cesium.com/platform/cesium-ion/content/) providing data not covered by [[CesiumTerrainAssetId]].
|
|
25
|
+
* @beta
|
|
26
|
+
*/
|
|
27
|
+
var CesiumIonAssetId;
|
|
28
|
+
(function (CesiumIonAssetId) {
|
|
29
|
+
/** [Cesium OSM Buildings](https://cesium.com/platform/cesium-ion/content/cesium-osm-buildings/). */
|
|
30
|
+
CesiumIonAssetId["OSMBuildings"] = "96188";
|
|
31
|
+
})(CesiumIonAssetId || (exports.CesiumIonAssetId = CesiumIonAssetId = {}));
|
|
32
|
+
//# sourceMappingURL=CesiumIonAssets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CesiumIonAssets.js","sourceRoot":"","sources":["../../src/CesiumIonAssets.ts"],"names":[],"mappings":";AACA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;;;GAKG;AACH,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,yGAAyG;IACzG,qCAAa,CAAA;IACb,gJAAgJ;IAChJ,8CAAsB,CAAA;AACxB,CAAC,EALW,oBAAoB,oCAApB,oBAAoB,QAK/B;AAED;;GAEG;AACH,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,oGAAoG;IACpG,0CAAsB,CAAA;AACxB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B","sourcesContent":["\n/*---------------------------------------------------------------------------------------------\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\n/** Ids of [Cesium ion assets](https://cesium.com/platform/cesium-ion/content/) providing global terrain data.\n * These values are appropriate to use with [[TerrainSettings.dataSource]] when [[TerrainSettings.providerName]] is set to \"CesiumWorldTerrain\".\n * You may alternatively use the Id of any ion asset to which you have access.\n * @see [[TerrainSettings.fromCesiumIonAsset]] to create TerrainSettings that obtain terrain from a specified ion asset.\n * @public\n */\nexport enum CesiumTerrainAssetId {\n /** Default [global 3d terrain](https://cesium.com/platform/cesium-ion/content/cesium-world-terrain/). */\n Default = \"1\",\n /** Global 3d terrain that includes [bathymetry](https://cesium.com/platform/cesium-ion/content/cesium-world-bathymetry/) (seafloor) terrain. */\n Bathymetry = \"2426648\",\n}\n\n/** Ids of [Cesium ion assets](https://cesium.com/platform/cesium-ion/content/) providing data not covered by [[CesiumTerrainAssetId]].\n * @beta\n */\nexport enum CesiumIonAssetId {\n /** [Cesium OSM Buildings](https://cesium.com/platform/cesium-ion/content/cesium-osm-buildings/). */\n OSMBuildings = \"96188\",\n}\n"]}
|
|
@@ -37,6 +37,8 @@ export declare class ContourStyle {
|
|
|
37
37
|
readonly pattern: LinePixels;
|
|
38
38
|
/** Returns true if `this` and `other` are logically equivalent. */
|
|
39
39
|
equals(other: ContourStyle): boolean;
|
|
40
|
+
/** Perform ordered comparison between this and another contour style. */
|
|
41
|
+
compare(other: ContourStyle): number;
|
|
40
42
|
/** Performs ordered comparison of two contour styles.
|
|
41
43
|
* @param lhs First contour style to compare
|
|
42
44
|
* @param rhs Second contour style to compare
|
|
@@ -96,7 +98,10 @@ export declare class Contour {
|
|
|
96
98
|
/** If true, show underlying geometry along with the associated contours. If false, only show the contours, not the underlying geometry. Defaults to true. */
|
|
97
99
|
readonly showGeometry: boolean;
|
|
98
100
|
static readonly defaults: Contour;
|
|
101
|
+
/** Returns true if `this` is logically equivalent to `other`. */
|
|
99
102
|
equals(other: Contour): boolean;
|
|
103
|
+
/** Performs ordered comparison between this and another contour. */
|
|
104
|
+
compare(other: Contour): number;
|
|
100
105
|
/** Performs ordered comparison of two contours.
|
|
101
106
|
* @param lhs First contour to compare
|
|
102
107
|
* @param rhs Second contour to compare
|
|
@@ -154,6 +159,8 @@ export declare class ContourGroup {
|
|
|
154
159
|
get isDefaultGroup(): boolean;
|
|
155
160
|
/** Returns true if `this` and `other` contain the exact same set of subcategories. */
|
|
156
161
|
subCategoriesEqual(other: ContourGroup): boolean;
|
|
162
|
+
/** Perform ordered comparison between this and another contour group. */
|
|
163
|
+
compare(other: ContourGroup): number;
|
|
157
164
|
/** Returns true if `this` and `other` are logically equivalent, having the same styling, name, and set of subcategories. */
|
|
158
165
|
equals(other: ContourGroup | undefined): boolean;
|
|
159
166
|
private constructor();
|
|
@@ -199,6 +206,8 @@ export declare class ContourDisplay {
|
|
|
199
206
|
* for display purposes.
|
|
200
207
|
*/
|
|
201
208
|
static readonly maxContourGroups = 5;
|
|
209
|
+
/** Perform ordered comparison between this and another `ContourDisplay`. */
|
|
210
|
+
compare(other: ContourDisplay): number;
|
|
202
211
|
/** Returns true if `this` and `other` are logically equivalent, having the same groups and styling. */
|
|
203
212
|
equals(other: ContourDisplay): boolean;
|
|
204
213
|
private constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContourDisplay.d.ts","sourceRoot":"","sources":["../../src/ContourDisplay.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"ContourDisplay.d.ts","sourceRoot":"","sources":["../../src/ContourDisplay.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAkE,iBAAiB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACtK,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,kCAAkC;IAClC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,uBAAuB,CAAC,YAAY,CAAC,CAAC;AAE3E;;;;GAIG;AACH,qBAAa,YAAY;IACvB,oEAAoE;IACpE,SAAgB,KAAK,EAAE,QAAQ,CAAC;IAChC;;;OAGG;IACH,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,uFAAuF;IACvF,SAAgB,OAAO,EAAE,UAAU,CAAC;IAEpC,mEAAmE;IAC5D,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;IAO3C,yEAAyE;IAClE,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM;IAI3C;;;;;OAKG;WACW,OAAO,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,GAAG,MAAM;IAYnE,OAAO;WAMO,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB;IAWzC,MAAM,IAAI,iBAAiB;IAelC,sH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,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,CAAC,cAAc,CAAC,CAAC;AAE/E;;;;GAIG;AACH,qBAAa,cAAc;IACzB;;;OAGG;IACH,SAAgB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvC;;OAEG;IACH,SAAgB,eAAe,EAAE,OAAO,CAAC;IACzC;;OAEG;IACH,gBAAuB,gBAAgB,KAAK;IAE5C,4EAA4E;IACrE,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM;IAI7C,uGAAuG;IAChG,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO;IAa7C,OAAO;WAKO,QAAQ,CAAC,KAAK,CAAC,EAAE,mBAAmB;IAiB3C,MAAM,IAAI,mBAAmB;IAYpC,wHAAwH;WAC1G,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,cAAc;IAI/E,yFAAyF;IAClF,mBAAmB,CAAC,eAAe,EAAE,OAAO,GAAG,cAAc;IAIpE;;OAEG;IACI,KAAK,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,cAAc;CAM/E"}
|
|
@@ -33,6 +33,10 @@ class ContourStyle {
|
|
|
33
33
|
}
|
|
34
34
|
return true;
|
|
35
35
|
}
|
|
36
|
+
/** Perform ordered comparison between this and another contour style. */
|
|
37
|
+
compare(other) {
|
|
38
|
+
return ContourStyle.compare(this, other);
|
|
39
|
+
}
|
|
36
40
|
/** Performs ordered comparison of two contour styles.
|
|
37
41
|
* @param lhs First contour style to compare
|
|
38
42
|
* @param rhs Second contour style to compare
|
|
@@ -109,11 +113,13 @@ class Contour {
|
|
|
109
113
|
/** If true, show underlying geometry along with the associated contours. If false, only show the contours, not the underlying geometry. Defaults to true. */
|
|
110
114
|
showGeometry;
|
|
111
115
|
static defaults = new Contour({});
|
|
116
|
+
/** Returns true if `this` is logically equivalent to `other`. */
|
|
112
117
|
equals(other) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
118
|
+
return this.compare(other) === 0;
|
|
119
|
+
}
|
|
120
|
+
/** Performs ordered comparison between this and another contour. */
|
|
121
|
+
compare(other) {
|
|
122
|
+
return Contour.compare(this, other);
|
|
117
123
|
}
|
|
118
124
|
/** Performs ordered comparison of two contours.
|
|
119
125
|
* @param lhs First contour to compare
|
|
@@ -204,19 +210,13 @@ class ContourGroup {
|
|
|
204
210
|
subCategoriesEqual(other) {
|
|
205
211
|
return this._subCategories === other._subCategories;
|
|
206
212
|
}
|
|
213
|
+
/** Perform ordered comparison between this and another contour group. */
|
|
214
|
+
compare(other) {
|
|
215
|
+
return (0, core_bentley_1.compareStrings)(this.name, other.name) || (0, core_bentley_1.compareStrings)(this._subCategories, other._subCategories) || this.contourDef.compare(other.contourDef);
|
|
216
|
+
}
|
|
207
217
|
/** Returns true if `this` and `other` are logically equivalent, having the same styling, name, and set of subcategories. */
|
|
208
218
|
equals(other) {
|
|
209
|
-
|
|
210
|
-
return true;
|
|
211
|
-
if (this === undefined || other === undefined)
|
|
212
|
-
return false;
|
|
213
|
-
if (!this.contourDef.equals(other.contourDef))
|
|
214
|
-
return false;
|
|
215
|
-
if (this._subCategories !== other._subCategories)
|
|
216
|
-
return false;
|
|
217
|
-
if (this.name !== other.name)
|
|
218
|
-
return false;
|
|
219
|
-
return true;
|
|
219
|
+
return undefined !== other && this.compare(other) === 0;
|
|
220
220
|
}
|
|
221
221
|
constructor(props) {
|
|
222
222
|
this.contourDef = props?.contourDef ?? Contour.fromJSON();
|
|
@@ -274,6 +274,10 @@ class ContourDisplay {
|
|
|
274
274
|
* for display purposes.
|
|
275
275
|
*/
|
|
276
276
|
static maxContourGroups = 5;
|
|
277
|
+
/** Perform ordered comparison between this and another `ContourDisplay`. */
|
|
278
|
+
compare(other) {
|
|
279
|
+
return (0, core_bentley_1.compareBooleans)(this.displayContours, other.displayContours) || (0, core_bentley_1.compareArrays)(this.groups, other.groups, (lhs, rhs) => lhs.compare(rhs));
|
|
280
|
+
}
|
|
277
281
|
/** Returns true if `this` and `other` are logically equivalent, having the same groups and styling. */
|
|
278
282
|
equals(other) {
|
|
279
283
|
if (this.displayContours !== other.displayContours)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContourDisplay.js","sourceRoot":"","sources":["../../src/ContourDisplay.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuI;AACvI,6CAA0C;AAC1C,yCAAqD;AAoBrD;;;;GAIG;AACH,MAAa,YAAY;IACvB,oEAAoE;IACpD,KAAK,CAAW;IAChC;;;OAGG;IACa,UAAU,CAAS;IACnC,uFAAuF;IACvE,OAAO,CAAa;IAEpC,mEAAmE;IAC5D,MAAM,CAAC,KAAmB;QAC/B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;YAC9G,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,OAAO,CAAC,GAAiB,EAAE,GAAiB;QACxD,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,IAAA,6BAAc,EAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;YAC/D,OAAO,IAAI,CAAC;QACd,IAAI,C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CAAC,CAAC;IAC/G,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,YAAgD;QAC3D,IAAI,CAAC,YAAY;YACf,OAAO,IAAI,CAAC;QAEd,OAAO,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC;IAC7D,CAAC;;AAjFH,wCAkFC","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 Symbology\n */\n\nimport { compareBooleans, compareNumbers, CompressedId64Set, NonFunctionPropertiesOf, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport { LinePixels } from \"./LinePixels\";\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\n\n/** JSON representation of a [[ContourStyle]].\n * @public\n */\nexport interface ContourStyleProps {\n /** See [[ContourStyle.color]]. */\n color?: RgbColorProps;\n /** See [[ContourStyle.pixelWidth]]. */\n pixelWidth?: number;\n /** See [[ContourStyle.pattern]]. */\n pattern?: LinePixels;\n}\n\n/** A type containing all of the properties of [[ContourStyle]] with none of the methods and with the `readonly` modifiers removed.\n * Used by [[ContourStyle.create]] and [[ContourStyle.clone]].\n * @public\n */\nexport type ContourStyleProperties = NonFunctionPropertiesOf<ContourStyle>;\n\n/** The style settings used by either a minor or major contour.\n * @see [[Contour.majorStyle]]\n * @see [[Contour.minorStyle]]\n * @public\n */\nexport class ContourStyle {\n /** The color in which to draw the contour lines. Default: black. */\n public readonly color: RgbColor;\n /** The width in screen pixels of the contour lines.\n * Useful values range between 1 and 8.5, in increments of 0.5. Other values will be rounded to meet these criteria.\n * Default: 1.0.\n */\n public readonly pixelWidth: number;\n /** The pattern for a major or minor contour line. Defaults to [[LinePixels.Solid]]. */\n public readonly pattern: LinePixels;\n\n /** Returns true if `this` and `other` are logically equivalent. */\n public equals(other: ContourStyle): boolean {\n if (!this.color.equals(other.color) || this.pixelWidth !== other.pixelWidth || this.pattern !== other.pattern) {\n return false;\n }\n return true;\n }\n\n /** Performs ordered comparison of two contour styles.\n * @param lhs First contour style to compare\n * @param rhs Second contour style to compare\n * @returns 0 if lhs is equivalent to rhs, a negative number if lhs compares less than rhs, or a positive number if lhs compares greater than rhs.\n * @public\n */\n public static compare(lhs: ContourStyle, rhs: ContourStyle): number {\n let diff = 0;\n if ((diff = lhs.color.compareTo(rhs.color)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.pixelWidth, rhs.pixelWidth)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.pattern, rhs.pattern)) !== 0)\n return diff;\n\n return diff;\n }\n\n private constructor(props?: Partial<ContourStyleProperties>) {\n this.color = props?.color ?? RgbColor.fromJSON({r: 0, g: 0, b: 0});\n this.pixelWidth = props?.pixelWidth ?? 1;\n this.pattern = props?.pattern ?? LinePixels.Solid;\n }\n\n public static fromJSON(props?: ContourStyleProps) {\n if (!props)\n return new ContourStyle();\n\n return new this({\n color: props?.color ? RgbColor.fromJSON(props.color) : undefined,\n pixelWidth: props?.pixelWidth,\n pattern: props?.pattern,\n });\n }\n\n public toJSON(): ContourStyleProps {\n const props: ContourStyleProps = {};\n\n if (!this.color.equals(RgbColor.fromJSON({r: 0, g: 0, b: 0})))\n props.color = this.color.toJSON();\n\n if (1 !== this.pixelWidth)\n props.pixelWidth = this.pixelWidth;\n\n if (0 !== this.pattern)\n props.pattern = this.pattern;\n\n return props;\n }\n\n /** Create a new ContourStyle. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<ContourStyleProperties>): ContourStyle {\n return props ? new this(props) : new ContourStyle();\n }\n\n /** Create a copy of this ContourStyle, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<ContourStyleProperties>): ContourStyle {\n if (!changedProps)\n return this;\n\n return ContourStyle.create({ ...this, ...changedProps });\n }\n}\n\n/** JSON representation of a [[Contour]].\n * @public\n */\nexport interface ContourProps {\n /** See [[Contour.majorStyle]]. */\n majorStyle?: ContourStyleProps;\n /** See [[Contour.minor]]. */\n minorStyle?: ContourStyleProps;\n /** See [[Contour.minorInterval]]. */\n minorInterval?: number;\n /** See [[Contour.majorIntervalCount]]. */\n majorIntervalCount?: number;\n /** See [[Contour.showGeometry]] */\n showGeometry?: boolean;\n}\n\n/** A type containing all of the properties of [[Contour]] with none of the methods and with the `readonly` modifiers removed.\n * Used by [[Contour.create]] and [[Contour.clone]].\n * @public\n */\nexport type ContourProperties = NonFunctionPropertiesOf<Contour>;\n\n/** Describes how to generate and style contour lines for geometry within a single [[ContourGroup]].\n * Contours provide a way to visualize elevation within a 3d scene by drawing lines at fixed intervals along the z-axis.\n * There are actually 2 kinds of contour lines: major and minor. Each kind can be styled independently.\n * A contour line is generated every [[minorInterval]] meters. Every `nth` line will be a *major* contour, where `n` = [[majorIntervalCount]]; the intervening lines will\n * all be *minor* contours.\n * For example, with a [[majorIntervalCount]] of `1`, every contour will be major; of `2`, every other contour will be major; and of `3`, there will be two minor contours in between\n * each major contour.\n *\n * @public\n */\nexport class Contour {\n /** Settings that describe how a major contour is styled. Defaults to an instantation of [[ContourStyle]] using `pixelWidth` of 2 and default values for the other properties. */\n public readonly majorStyle: ContourStyle;\n /** Settings that describe how a minor contour is styled. Defaults to an instantation of [[ContourStyle]] using default values for the properties. */\n public readonly minorStyle: ContourStyle;\n /** The interval for the minor contour occurrence in meters; these can be specified as fractional. Defaults to 1. If a value <= 0 is specified, this will be treated as 1 meter. */\n public readonly minorInterval: number;\n /** The count of minor contour intervals that define a major interval (integer > 0). A value of 1 means no minor contours will be shown, only major contours. Defaults to 5. If a value < 1 is specified, this will be treated as 1. If a non-integer value is specified, it will be treated as if it were rounded to the nearest integer. */\n public readonly majorIntervalCount: number;\n /** If true, show underlying geometry along with the associated contours. If false, only show the contours, not the underlying geometry. Defaults to true. */\n public readonly showGeometry: boolean;\n\n public static readonly defaults = new Contour({});\n\n public equals(other: Contour): boolean {\n if (!this.majorStyle.equals(other.majorStyle) || !this.minorStyle.equals(other.minorStyle) || this.minorInterval !== other.minorInterval || this.majorIntervalCount !== other.majorIntervalCount || this.showGeometry !== other.showGeometry) {\n return false;\n }\n return true;\n }\n\n /** Performs ordered comparison of two contours.\n * @param lhs First contour to compare\n * @param rhs Second contour to compare\n * @returns 0 if lhs is equivalent to rhs, a negative number if lhs compares less than rhs, or a positive number if lhs compares greater than rhs.\n */\n public static compare(lhs: Contour, rhs: Contour): number {\n return ContourStyle.compare(lhs.majorStyle, rhs.majorStyle)\n || ContourStyle.compare(lhs.minorStyle, rhs.minorStyle)\n || compareNumbers(lhs.minorInterval, rhs.minorInterval)\n || compareNumbers(lhs.majorIntervalCount, rhs.majorIntervalCount)\n || compareBooleans(lhs.showGeometry, rhs.showGeometry);\n }\n\n private constructor(props?: Partial<ContourProperties>) {\n this.majorStyle = props?.majorStyle ?? ContourStyle.fromJSON({ pixelWidth: 2 });\n this.minorStyle = props?.minorStyle ?? ContourStyle.fromJSON();\n this.minorInterval = props?.minorInterval ?? 1;\n this.majorIntervalCount = props?.majorIntervalCount ?? 5;\n this.showGeometry = props?.showGeometry ?? true;\n }\n\n public static fromJSON(props?: ContourProps) {\n if (!props)\n return new Contour();\n\n return new this({\n majorStyle: props?.majorStyle ? ContourStyle.fromJSON(props.majorStyle) : undefined,\n minorStyle: props?.minorStyle ? ContourStyle.fromJSON(props.minorStyle) : undefined,\n minorInterval: props?.minorInterval,\n majorIntervalCount: props?.majorIntervalCount,\n showGeometry: props?.showGeometry,\n });\n }\n\n public toJSON(): ContourProps {\n const props: ContourProps = {};\n\n if (!this.majorStyle.equals(ContourStyle.fromJSON({ pixelWidth: 2 })))\n props.majorStyle = this.majorStyle.toJSON();\n\n if (!this.minorStyle.equals(ContourStyle.fromJSON()))\n props.minorStyle = this.minorStyle.toJSON();\n\n if (1 !== this.minorInterval)\n props.minorInterval = this.minorInterval;\n\n if (5 !== this.majorIntervalCount)\n props.majorIntervalCount = this.majorIntervalCount;\n\n if (true !== this.showGeometry)\n props.showGeometry = this.showGeometry;\n\n return props;\n }\n\n /** Create a new Contour. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<ContourProperties>): Contour {\n return props ? new this(props) : new Contour();\n }\n\n /** Create a copy of this Contour, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<ContourProperties>): Contour {\n if (!changedProps)\n return this;\n\n return Contour.create({ ...this, ...changedProps });\n }\n}\n\n/** JSON representation of a [[ContourGroup]].\n * @public\n */\nexport interface ContourGroupProps {\n /** See [[ContourGroup.contourDef]]. */\n contourDef?: ContourProps;\n /** See [[ContourGroup.subCategories]]. */\n subCategories?: CompressedId64Set;\n /** See [[ContourGroup.name]]. */\n name?: string;\n}\n\n/** A type containing all of the properties of [[ContourGroup]] with none of the methods and with the `readonly` modifiers removed.\n * Used by [[ContourGroup.create]] and [[ContourGroup.clone]].\n * @public\n */\nexport type ContourGroupProperties = NonFunctionPropertiesOf<ContourGroup>;\n\n/** Defines a group of objects to which to apply [[Contour]] lines in a particular style.\n * The [[ContourDisplay]] settings can contain multiple groups.\n * Each group is described by a set of [SubCategory]($backend)'s; all geometry belonging to any of those subcategories belongs to the group.\n * An empty set of subcategories indicates that this is a default group, implicitly containing all subcategories that are not explicitly included in another group.\n * Each group has an optional, non-user-facing name that applications can use to assign semantics to particular groups.\n * @public\n */\nexport class ContourGroup {\n private _subCategories: CompressedId64Set;\n\n /** Describes the appearance of all of the contours applied to geometry belonging to this group. */\n public readonly contourDef: Contour;\n /** An optional, non-user-facing name that applications can use to assign semantics to particular groups.\n * Default: an empty string.\n */\n public readonly name: string;\n\n /** The set of subcategories belonging to this group, or an empty set if this is a default group. If more than one empty set exists in the [[ContourDisplay]] object's `groups` array, the last entry in that array is used for rendering the default styling.\n * @see [[isDefaultGroup]] to test if this is a default group.\n */\n public get subCategories(): OrderedId64Iterable {\n return CompressedId64Set.iterable(this._subCategories);\n }\n\n /** Returns true if [[subCategories]] is an empty set, indicating that any subcategory not included in any other [[ContourGroup]] is implicitly\n * included in this group.\n */\n public get isDefaultGroup(): boolean {\n return OrderedId64Iterable.isEmptySet(this._subCategories);\n }\n\n /** Returns true if `this` and `other` contain the exact same set of subcategories. */\n public subCategoriesEqual(other: ContourGroup): boolean {\n return this._subCategories === other._subCategories;\n }\n\n /** Returns true if `this` and `other` are logically equivalent, having the same styling, name, and set of subcategories. */\n public equals(other: ContourGroup | undefined): boolean {\n if (this === undefined && other === undefined)\n return true;\n if (this === undefined || other === undefined)\n return false;\n if (!this.contourDef.equals(other.contourDef))\n return false;\n if (this._subCategories !== other._subCategories)\n return false;\n if (this.name !== other.name)\n return false;\n return true;\n }\n\n private constructor(props?: Partial<ContourGroupProperties>) {\n this.contourDef = props?.contourDef ?? Contour.fromJSON();\n this._subCategories = props?.subCategories ? CompressedId64Set.sortAndCompress(props.subCategories) : \"\";\n this.name = props?.name ?? \"\";\n }\n\n public static fromJSON(props?: ContourGroupProps) {\n if (!props)\n return new ContourGroup();\n\n return new this({\n contourDef: props?.contourDef ? Contour.fromJSON(props.contourDef) : undefined,\n name: props?.name,\n subCategories: props?.subCategories ? CompressedId64Set.iterable(props.subCategories) : undefined,\n });\n }\n\n public toJSON(): ContourGroupProps {\n const props: ContourGroupProps = {};\n\n if (!this.contourDef.equals(Contour.defaults))\n props.contourDef = this.contourDef.toJSON();\n\n if (this.name)\n props.name = this.name;\n\n props.subCategories = this._subCategories;\n return props;\n }\n\n /** Create a new ContourGroup. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<ContourGroupProperties>): ContourGroup {\n return props ? new this(props) : new ContourGroup();\n }\n\n /** Create a copy of this ContourGroup, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<ContourGroupProperties>): ContourGroup {\n if (!changedProps)\n return this;\n\n return ContourGroup.create({ ...this, ...changedProps });\n }\n}\n\n/** JSON representation of [[ContourDisplay]] settings.\n * @public\n */\nexport interface ContourDisplayProps {\n /** See [[ContourDisplay.groups]]. */\n groups?: ContourGroupProps[];\n /** See [[ContourDisplay.displayContours]]. */\n displayContours?: boolean;\n}\n\n/** A type containing all of the properties of [[ContourDisplay]] with none of the methods and with the `readonly` modifiers removed.\n * Used by [[ContourDisplay.create]] and [[ContourDisplay.clone]].\n * @public\n */\nexport type ContourDisplayProperties = NonFunctionPropertiesOf<ContourDisplay>;\n\n/** Settings that specify how to apply [contour lines]($docs/learning/display/ContourDisplay.md) to groups of geometry\n * within a 3d scene.\n * @see [[DisplayStyle3dSettings.contours]] to associate contour settings with a display style.\n * @public\n */\nexport class ContourDisplay {\n /** A list of the groups, each describing their own specific contour display settings. Defaults to an empty array.\n * @note The display system supports no more than [[ContourDisplay.maxContourGroups]]. Entries in this array exceeding that maximum will\n * have no effect on the display of contour lines.\n */\n public readonly groups: ContourGroup[];\n /** Whether to display the contour lines described by these settings. Default: false.\n * @see [[withDisplayContours]] to change this flag.\n */\n public readonly displayContours: boolean;\n /** The maximum number of contour groups that the system will allow. Any contour groups added to the [[groups]] array beyond this number will be ignored\n * for display purposes.\n */\n public static readonly maxContourGroups = 5;\n\n /** Returns true if `this` and `other` are logically equivalent, having the same groups and styling. */\n public equals(other: ContourDisplay): boolean {\n if (this.displayContours !== other.displayContours)\n return false;\n if (this.groups.length !== other.groups.length)\n return false;\n for (let index = 0, len = this.groups.length; index < len && index < ContourDisplay.maxContourGroups; ++index) {\n const match = this.groups[index].equals(other.groups[index]);\n if (!match)\n return false;\n }\n return true;\n }\n\n private constructor(props?: Partial<ContourDisplayProperties>) {\n this.displayContours = props?.displayContours ?? false;\n this.groups = props?.groups ?? [];\n }\n\n public static fromJSON(props?: ContourDisplayProps) {\n if (!props)\n return new ContourDisplay();\n\n const groups: ContourGroup[] = [];\n if (undefined !== props && undefined !== props.groups) {\n for (let n = 0; n < props.groups.length; n++) {\n groups[n] = ContourGroup.fromJSON(props.groups[n]);\n }\n }\n\n return new this({\n displayContours: props?.displayContours,\n groups: props.groups ? groups : undefined,\n });\n }\n\n public toJSON(): ContourDisplayProps {\n const props: ContourDisplayProps = {};\n\n props.groups = [];\n for (let n = 0; n < this.groups.length; n++) {\n props.groups[n] = this.groups[n].toJSON();\n }\n\n props.displayContours = this.displayContours;\n return props;\n }\n\n /** Create a new ContourDisplay. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<ContourDisplayProperties>): ContourDisplay {\n return props ? new this(props) : new ContourDisplay();\n }\n\n /** Create a copy of these settings, changing the `displayContours` flag as specified. */\n public withDisplayContours(displayContours: boolean): ContourDisplay {\n return displayContours === this.displayContours ? this : ContourDisplay.create({ ...this, displayContours });\n }\n\n /** Create a copy of this ContourDisplay, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<ContourDisplayProperties>): ContourDisplay {\n if (!changedProps)\n return this;\n\n return ContourDisplay.create({ ...this, ...changedProps });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContourDisplay.js","sourceRoot":"","sources":["../../src/ContourDisplay.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsK;AACtK,6CAA0C;AAC1C,yCAAqD;AAoBrD;;;;GAIG;AACH,MAAa,YAAY;IACvB,oEAAoE;IACpD,KAAK,CAAW;IAChC;;;OAGG;IACa,UAAU,CAAS;IACnC,uFAAuF;IACvE,OAAO,CAAa;IAEpC,mEAAmE;IAC5D,MAAM,CAAC,KAAmB;QAC/B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,E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C,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5C,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAC5C,CAAC;QAED,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAC7C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,wHAAwH;IACjH,MAAM,CAAC,MAAM,CAAC,KAAyC;QAC5D,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,cAAc,EAAE,CAAC;IACxD,CAAC;IAED,yFAAyF;IAClF,mBAAmB,CAAC,eAAwB;QACjD,OAAO,eAAe,KAAK,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IAC/G,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,YAAgD;QAC3D,IAAI,CAAC,YAAY;YACf,OAAO,IAAI,CAAC;QAEd,OAAO,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC;IAC7D,CAAC;;AAtFH,wCAuFC","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 Symbology\n */\n\nimport { compareArrays, compareBooleans, compareNumbers, compareStrings, CompressedId64Set, NonFunctionPropertiesOf, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport { LinePixels } from \"./LinePixels\";\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\n\n/** JSON representation of a [[ContourStyle]].\n * @public\n */\nexport interface ContourStyleProps {\n /** See [[ContourStyle.color]]. */\n color?: RgbColorProps;\n /** See [[ContourStyle.pixelWidth]]. */\n pixelWidth?: number;\n /** See [[ContourStyle.pattern]]. */\n pattern?: LinePixels;\n}\n\n/** A type containing all of the properties of [[ContourStyle]] with none of the methods and with the `readonly` modifiers removed.\n * Used by [[ContourStyle.create]] and [[ContourStyle.clone]].\n * @public\n */\nexport type ContourStyleProperties = NonFunctionPropertiesOf<ContourStyle>;\n\n/** The style settings used by either a minor or major contour.\n * @see [[Contour.majorStyle]]\n * @see [[Contour.minorStyle]]\n * @public\n */\nexport class ContourStyle {\n /** The color in which to draw the contour lines. Default: black. */\n public readonly color: RgbColor;\n /** The width in screen pixels of the contour lines.\n * Useful values range between 1 and 8.5, in increments of 0.5. Other values will be rounded to meet these criteria.\n * Default: 1.0.\n */\n public readonly pixelWidth: number;\n /** The pattern for a major or minor contour line. Defaults to [[LinePixels.Solid]]. */\n public readonly pattern: LinePixels;\n\n /** Returns true if `this` and `other` are logically equivalent. */\n public equals(other: ContourStyle): boolean {\n if (!this.color.equals(other.color) || this.pixelWidth !== other.pixelWidth || this.pattern !== other.pattern) {\n return false;\n }\n return true;\n }\n\n /** Perform ordered comparison between this and another contour style. */\n public compare(other: ContourStyle): number {\n return ContourStyle.compare(this, other);\n }\n\n /** Performs ordered comparison of two contour styles.\n * @param lhs First contour style to compare\n * @param rhs Second contour style to compare\n * @returns 0 if lhs is equivalent to rhs, a negative number if lhs compares less than rhs, or a positive number if lhs compares greater than rhs.\n * @public\n */\n public static compare(lhs: ContourStyle, rhs: ContourStyle): number {\n let diff = 0;\n if ((diff = lhs.color.compareTo(rhs.color)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.pixelWidth, rhs.pixelWidth)) !== 0)\n return diff;\n if ((diff = compareNumbers(lhs.pattern, rhs.pattern)) !== 0)\n return diff;\n\n return diff;\n }\n\n private constructor(props?: Partial<ContourStyleProperties>) {\n this.color = props?.color ?? RgbColor.fromJSON({r: 0, g: 0, b: 0});\n this.pixelWidth = props?.pixelWidth ?? 1;\n this.pattern = props?.pattern ?? LinePixels.Solid;\n }\n\n public static fromJSON(props?: ContourStyleProps) {\n if (!props)\n return new ContourStyle();\n\n return new this({\n color: props?.color ? RgbColor.fromJSON(props.color) : undefined,\n pixelWidth: props?.pixelWidth,\n pattern: props?.pattern,\n });\n }\n\n public toJSON(): ContourStyleProps {\n const props: ContourStyleProps = {};\n\n if (!this.color.equals(RgbColor.fromJSON({r: 0, g: 0, b: 0})))\n props.color = this.color.toJSON();\n\n if (1 !== this.pixelWidth)\n props.pixelWidth = this.pixelWidth;\n\n if (0 !== this.pattern)\n props.pattern = this.pattern;\n\n return props;\n }\n\n /** Create a new ContourStyle. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<ContourStyleProperties>): ContourStyle {\n return props ? new this(props) : new ContourStyle();\n }\n\n /** Create a copy of this ContourStyle, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<ContourStyleProperties>): ContourStyle {\n if (!changedProps)\n return this;\n\n return ContourStyle.create({ ...this, ...changedProps });\n }\n}\n\n/** JSON representation of a [[Contour]].\n * @public\n */\nexport interface ContourProps {\n /** See [[Contour.majorStyle]]. */\n majorStyle?: ContourStyleProps;\n /** See [[Contour.minor]]. */\n minorStyle?: ContourStyleProps;\n /** See [[Contour.minorInterval]]. */\n minorInterval?: number;\n /** See [[Contour.majorIntervalCount]]. */\n majorIntervalCount?: number;\n /** See [[Contour.showGeometry]] */\n showGeometry?: boolean;\n}\n\n/** A type containing all of the properties of [[Contour]] with none of the methods and with the `readonly` modifiers removed.\n * Used by [[Contour.create]] and [[Contour.clone]].\n * @public\n */\nexport type ContourProperties = NonFunctionPropertiesOf<Contour>;\n\n/** Describes how to generate and style contour lines for geometry within a single [[ContourGroup]].\n * Contours provide a way to visualize elevation within a 3d scene by drawing lines at fixed intervals along the z-axis.\n * There are actually 2 kinds of contour lines: major and minor. Each kind can be styled independently.\n * A contour line is generated every [[minorInterval]] meters. Every `nth` line will be a *major* contour, where `n` = [[majorIntervalCount]]; the intervening lines will\n * all be *minor* contours.\n * For example, with a [[majorIntervalCount]] of `1`, every contour will be major; of `2`, every other contour will be major; and of `3`, there will be two minor contours in between\n * each major contour.\n *\n * @public\n */\nexport class Contour {\n /** Settings that describe how a major contour is styled. Defaults to an instantation of [[ContourStyle]] using `pixelWidth` of 2 and default values for the other properties. */\n public readonly majorStyle: ContourStyle;\n /** Settings that describe how a minor contour is styled. Defaults to an instantation of [[ContourStyle]] using default values for the properties. */\n public readonly minorStyle: ContourStyle;\n /** The interval for the minor contour occurrence in meters; these can be specified as fractional. Defaults to 1. If a value <= 0 is specified, this will be treated as 1 meter. */\n public readonly minorInterval: number;\n /** The count of minor contour intervals that define a major interval (integer > 0). A value of 1 means no minor contours will be shown, only major contours. Defaults to 5. If a value < 1 is specified, this will be treated as 1. If a non-integer value is specified, it will be treated as if it were rounded to the nearest integer. */\n public readonly majorIntervalCount: number;\n /** If true, show underlying geometry along with the associated contours. If false, only show the contours, not the underlying geometry. Defaults to true. */\n public readonly showGeometry: boolean;\n\n public static readonly defaults = new Contour({});\n\n /** Returns true if `this` is logically equivalent to `other`. */\n public equals(other: Contour): boolean {\n return this.compare(other) === 0;\n }\n\n /** Performs ordered comparison between this and another contour. */\n public compare(other: Contour): number {\n return Contour.compare(this, other);\n }\n\n /** Performs ordered comparison of two contours.\n * @param lhs First contour to compare\n * @param rhs Second contour to compare\n * @returns 0 if lhs is equivalent to rhs, a negative number if lhs compares less than rhs, or a positive number if lhs compares greater than rhs.\n */\n public static compare(lhs: Contour, rhs: Contour): number {\n return ContourStyle.compare(lhs.majorStyle, rhs.majorStyle)\n || ContourStyle.compare(lhs.minorStyle, rhs.minorStyle)\n || compareNumbers(lhs.minorInterval, rhs.minorInterval)\n || compareNumbers(lhs.majorIntervalCount, rhs.majorIntervalCount)\n || compareBooleans(lhs.showGeometry, rhs.showGeometry);\n }\n\n private constructor(props?: Partial<ContourProperties>) {\n this.majorStyle = props?.majorStyle ?? ContourStyle.fromJSON({ pixelWidth: 2 });\n this.minorStyle = props?.minorStyle ?? ContourStyle.fromJSON();\n this.minorInterval = props?.minorInterval ?? 1;\n this.majorIntervalCount = props?.majorIntervalCount ?? 5;\n this.showGeometry = props?.showGeometry ?? true;\n }\n\n public static fromJSON(props?: ContourProps) {\n if (!props)\n return new Contour();\n\n return new this({\n majorStyle: props?.majorStyle ? ContourStyle.fromJSON(props.majorStyle) : undefined,\n minorStyle: props?.minorStyle ? ContourStyle.fromJSON(props.minorStyle) : undefined,\n minorInterval: props?.minorInterval,\n majorIntervalCount: props?.majorIntervalCount,\n showGeometry: props?.showGeometry,\n });\n }\n\n public toJSON(): ContourProps {\n const props: ContourProps = {};\n\n if (!this.majorStyle.equals(ContourStyle.fromJSON({ pixelWidth: 2 })))\n props.majorStyle = this.majorStyle.toJSON();\n\n if (!this.minorStyle.equals(ContourStyle.fromJSON()))\n props.minorStyle = this.minorStyle.toJSON();\n\n if (1 !== this.minorInterval)\n props.minorInterval = this.minorInterval;\n\n if (5 !== this.majorIntervalCount)\n props.majorIntervalCount = this.majorIntervalCount;\n\n if (true !== this.showGeometry)\n props.showGeometry = this.showGeometry;\n\n return props;\n }\n\n /** Create a new Contour. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<ContourProperties>): Contour {\n return props ? new this(props) : new Contour();\n }\n\n /** Create a copy of this Contour, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<ContourProperties>): Contour {\n if (!changedProps)\n return this;\n\n return Contour.create({ ...this, ...changedProps });\n }\n}\n\n/** JSON representation of a [[ContourGroup]].\n * @public\n */\nexport interface ContourGroupProps {\n /** See [[ContourGroup.contourDef]]. */\n contourDef?: ContourProps;\n /** See [[ContourGroup.subCategories]]. */\n subCategories?: CompressedId64Set;\n /** See [[ContourGroup.name]]. */\n name?: string;\n}\n\n/** A type containing all of the properties of [[ContourGroup]] with none of the methods and with the `readonly` modifiers removed.\n * Used by [[ContourGroup.create]] and [[ContourGroup.clone]].\n * @public\n */\nexport type ContourGroupProperties = NonFunctionPropertiesOf<ContourGroup>;\n\n/** Defines a group of objects to which to apply [[Contour]] lines in a particular style.\n * The [[ContourDisplay]] settings can contain multiple groups.\n * Each group is described by a set of [SubCategory]($backend)'s; all geometry belonging to any of those subcategories belongs to the group.\n * An empty set of subcategories indicates that this is a default group, implicitly containing all subcategories that are not explicitly included in another group.\n * Each group has an optional, non-user-facing name that applications can use to assign semantics to particular groups.\n * @public\n */\nexport class ContourGroup {\n private _subCategories: CompressedId64Set;\n\n /** Describes the appearance of all of the contours applied to geometry belonging to this group. */\n public readonly contourDef: Contour;\n /** An optional, non-user-facing name that applications can use to assign semantics to particular groups.\n * Default: an empty string.\n */\n public readonly name: string;\n\n /** The set of subcategories belonging to this group, or an empty set if this is a default group. If more than one empty set exists in the [[ContourDisplay]] object's `groups` array, the last entry in that array is used for rendering the default styling.\n * @see [[isDefaultGroup]] to test if this is a default group.\n */\n public get subCategories(): OrderedId64Iterable {\n return CompressedId64Set.iterable(this._subCategories);\n }\n\n /** Returns true if [[subCategories]] is an empty set, indicating that any subcategory not included in any other [[ContourGroup]] is implicitly\n * included in this group.\n */\n public get isDefaultGroup(): boolean {\n return OrderedId64Iterable.isEmptySet(this._subCategories);\n }\n\n /** Returns true if `this` and `other` contain the exact same set of subcategories. */\n public subCategoriesEqual(other: ContourGroup): boolean {\n return this._subCategories === other._subCategories;\n }\n\n /** Perform ordered comparison between this and another contour group. */\n public compare(other: ContourGroup): number {\n return compareStrings(this.name, other.name) || compareStrings(this._subCategories, other._subCategories) || this.contourDef.compare(other.contourDef);\n }\n\n /** Returns true if `this` and `other` are logically equivalent, having the same styling, name, and set of subcategories. */\n public equals(other: ContourGroup | undefined): boolean {\n return undefined !== other && this.compare(other) === 0;\n }\n\n private constructor(props?: Partial<ContourGroupProperties>) {\n this.contourDef = props?.contourDef ?? Contour.fromJSON();\n this._subCategories = props?.subCategories ? CompressedId64Set.sortAndCompress(props.subCategories) : \"\";\n this.name = props?.name ?? \"\";\n }\n\n public static fromJSON(props?: ContourGroupProps) {\n if (!props)\n return new ContourGroup();\n\n return new this({\n contourDef: props?.contourDef ? Contour.fromJSON(props.contourDef) : undefined,\n name: props?.name,\n subCategories: props?.subCategories ? CompressedId64Set.iterable(props.subCategories) : undefined,\n });\n }\n\n public toJSON(): ContourGroupProps {\n const props: ContourGroupProps = {};\n\n if (!this.contourDef.equals(Contour.defaults))\n props.contourDef = this.contourDef.toJSON();\n\n if (this.name)\n props.name = this.name;\n\n props.subCategories = this._subCategories;\n return props;\n }\n\n /** Create a new ContourGroup. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<ContourGroupProperties>): ContourGroup {\n return props ? new this(props) : new ContourGroup();\n }\n\n /** Create a copy of this ContourGroup, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<ContourGroupProperties>): ContourGroup {\n if (!changedProps)\n return this;\n\n return ContourGroup.create({ ...this, ...changedProps });\n }\n}\n\n/** JSON representation of [[ContourDisplay]] settings.\n * @public\n */\nexport interface ContourDisplayProps {\n /** See [[ContourDisplay.groups]]. */\n groups?: ContourGroupProps[];\n /** See [[ContourDisplay.displayContours]]. */\n displayContours?: boolean;\n}\n\n/** A type containing all of the properties of [[ContourDisplay]] with none of the methods and with the `readonly` modifiers removed.\n * Used by [[ContourDisplay.create]] and [[ContourDisplay.clone]].\n * @public\n */\nexport type ContourDisplayProperties = NonFunctionPropertiesOf<ContourDisplay>;\n\n/** Settings that specify how to apply [contour lines]($docs/learning/display/ContourDisplay.md) to groups of geometry\n * within a 3d scene.\n * @see [[DisplayStyle3dSettings.contours]] to associate contour settings with a display style.\n * @public\n */\nexport class ContourDisplay {\n /** A list of the groups, each describing their own specific contour display settings. Defaults to an empty array.\n * @note The display system supports no more than [[ContourDisplay.maxContourGroups]]. Entries in this array exceeding that maximum will\n * have no effect on the display of contour lines.\n */\n public readonly groups: ContourGroup[];\n /** Whether to display the contour lines described by these settings. Default: false.\n * @see [[withDisplayContours]] to change this flag.\n */\n public readonly displayContours: boolean;\n /** The maximum number of contour groups that the system will allow. Any contour groups added to the [[groups]] array beyond this number will be ignored\n * for display purposes.\n */\n public static readonly maxContourGroups = 5;\n\n /** Perform ordered comparison between this and another `ContourDisplay`. */\n public compare(other: ContourDisplay): number {\n return compareBooleans(this.displayContours, other.displayContours) || compareArrays(this.groups, other.groups, (lhs, rhs) => lhs.compare(rhs));\n }\n\n /** Returns true if `this` and `other` are logically equivalent, having the same groups and styling. */\n public equals(other: ContourDisplay): boolean {\n if (this.displayContours !== other.displayContours)\n return false;\n if (this.groups.length !== other.groups.length)\n return false;\n for (let index = 0, len = this.groups.length; index < len && index < ContourDisplay.maxContourGroups; ++index) {\n const match = this.groups[index].equals(other.groups[index]);\n if (!match)\n return false;\n }\n return true;\n }\n\n private constructor(props?: Partial<ContourDisplayProperties>) {\n this.displayContours = props?.displayContours ?? false;\n this.groups = props?.groups ?? [];\n }\n\n public static fromJSON(props?: ContourDisplayProps) {\n if (!props)\n return new ContourDisplay();\n\n const groups: ContourGroup[] = [];\n if (undefined !== props && undefined !== props.groups) {\n for (let n = 0; n < props.groups.length; n++) {\n groups[n] = ContourGroup.fromJSON(props.groups[n]);\n }\n }\n\n return new this({\n displayContours: props?.displayContours,\n groups: props.groups ? groups : undefined,\n });\n }\n\n public toJSON(): ContourDisplayProps {\n const props: ContourDisplayProps = {};\n\n props.groups = [];\n for (let n = 0; n < this.groups.length; n++) {\n props.groups[n] = this.groups[n].toJSON();\n }\n\n props.displayContours = this.displayContours;\n return props;\n }\n\n /** Create a new ContourDisplay. Any properties not specified by `props` will be initialized to their default values. */\n public static create(props?: Partial<ContourDisplayProperties>): ContourDisplay {\n return props ? new this(props) : new ContourDisplay();\n }\n\n /** Create a copy of these settings, changing the `displayContours` flag as specified. */\n public withDisplayContours(displayContours: boolean): ContourDisplay {\n return displayContours === this.displayContours ? this : ContourDisplay.create({ ...this, displayContours });\n }\n\n /** Create a copy of this ContourDisplay, identical except for any properties specified by `changedProps`.\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\n */\n public clone(changedProps?: Partial<ContourDisplayProperties>): ContourDisplay {\n if (!changedProps)\n return this;\n\n return ContourDisplay.create({ ...this, ...changedProps });\n }\n}\n"]}
|