@itwin/core-common 4.3.0-dev.9 → 4.4.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 +35 -1
- package/lib/cjs/ClipStyle.d.ts +63 -1
- package/lib/cjs/ClipStyle.d.ts.map +1 -1
- package/lib/cjs/ClipStyle.js +75 -11
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/MapLayerSettings.d.ts +25 -0
- package/lib/cjs/MapLayerSettings.d.ts.map +1 -1
- package/lib/cjs/MapLayerSettings.js +27 -0
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/ThematicDisplay.d.ts +27 -0
- package/lib/cjs/ThematicDisplay.d.ts.map +1 -1
- package/lib/cjs/ThematicDisplay.js +51 -18
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +3 -0
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/ClipStyle.d.ts +63 -1
- package/lib/esm/ClipStyle.d.ts.map +1 -1
- package/lib/esm/ClipStyle.js +74 -10
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/MapLayerSettings.d.ts +25 -0
- package/lib/esm/MapLayerSettings.d.ts.map +1 -1
- package/lib/esm/MapLayerSettings.js +27 -0
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/ThematicDisplay.d.ts +27 -0
- package/lib/esm/ThematicDisplay.d.ts.map +1 -1
- package/lib/esm/ThematicDisplay.js +50 -17
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +3 -0
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/package.json +6 -7
|
@@ -1 +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AO,oBAAoB,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IACpH,CAAC;CACF","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 MapLayers\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { BackgroundMapProvider, BackgroundMapProviderProps, BackgroundMapType } from \"./BackgroundMapProvider\";\r\nimport { DeprecatedBackgroundMapProps } from \"./BackgroundMapSettings\";\r\n\r\n/** The current set of supported map layer formats.\r\n * In order to be displayed, a corresponding format must have been registered in the [MapLayerFormatRegistry]($frontend)\r\n * @public\r\n */\r\nexport type ImageryMapLayerFormatId = \"ArcGIS\" | \"BingMaps\" | \"MapboxImagery\" | \"TileURL\" | \"WMS\" | \"WMTS\";\r\n\r\n/** @public */\r\nexport type SubLayerId = string | number;\r\n\r\n/** JSON representation of the settings associated with a map sublayer included within a [[MapLayerProps]].\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * @see [[MapLayerProps]]\r\n * @public\r\n */\r\nexport interface MapSubLayerProps {\r\n name: string;\r\n title?: string;\r\n visible?: boolean;\r\n id?: SubLayerId;\r\n parent?: SubLayerId;\r\n children?: SubLayerId[];\r\n}\r\n\r\n/** Normalized representation of a [[MapSubLayerProps]] for which values\r\n * have been validated and default values have been applied where explicit values not defined.\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * This class can represent a hierarchy, in this case a sub layer is visible only if all its ancestors are also visible.\r\n * @see [[MapLayerSettings]]\r\n * @public\r\n */\r\nexport class MapSubLayerSettings {\r\n /** Typically Name is a single word used for machine-to-machine communication while the Title is for the benefit of humans (WMS) */\r\n public readonly name: string;\r\n /** Title. */\r\n public readonly title?: string;\r\n /** If true the sub layer is visible. If part of a hierarchy, a sub layer is visible only if its ancestors are also visible. */\r\n public readonly visible: boolean;\r\n /** A unique string or number that may be used to identify the sub layer (ArcGIS) */\r\n public readonly id: SubLayerId;\r\n /** One or more sublayer children */\r\n public readonly children?: SubLayerId[];\r\n /** sublayer parent. */\r\n public readonly parent?: SubLayerId;\r\n\r\n constructor(name: string, title?: string, visible?: boolean, id?: SubLayerId, parent?: SubLayerId, children?: SubLayerId[]) {\r\n this.name = name;\r\n this.title = title;\r\n this.visible = visible !== undefined && visible;\r\n this.id = (id === undefined) ? this.name : id;\r\n this.parent = parent;\r\n this.children = children;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static fromJSON(json: MapSubLayerProps): MapSubLayerSettings {\r\n return new MapSubLayerSettings(json.name, json.title, json.visible, (json.id === json.name) ? undefined : json.id, json.parent, json.children);\r\n }\r\n\r\n public toJSON(): MapSubLayerProps {\r\n const props: MapSubLayerProps = { name: this.name, visible: this.visible };\r\n\r\n if (undefined !== this.id && this.id !== this.name)\r\n props.id = this.id;\r\n\r\n if (undefined !== this.title)\r\n props.title = this.title;\r\n\r\n if (this.children)\r\n props.children = [...this.children];\r\n\r\n if (undefined !== this.parent)\r\n props.parent = this.parent;\r\n\r\n return props;\r\n }\r\n\r\n /** Creating a copy of this MapSubLayer, optionally modifying some if its properties */\r\n public clone(changedProps: Partial<MapSubLayerProps>): MapSubLayerSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n const props = {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n id: undefined !== changedProps.id ? changedProps.id : this.id,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n parent: undefined !== changedProps.parent ? changedProps.parent : this.parent,\r\n children: undefined !== changedProps.children ? changedProps.children.slice() : this.children?.slice(),\r\n title: undefined !== changedProps.title ? changedProps.title : this.title,\r\n };\r\n return MapSubLayerSettings.fromJSON(props)!;\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapSubLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible;\r\n }\r\n\r\n /** return true if this sublayer is named. */\r\n public get isNamed(): boolean { return this.name.length > 0; }\r\n\r\n /** return true if this sublayer is a leaf (has no children) */\r\n public get isLeaf(): boolean { return this.children === undefined || this.children.length === 0; }\r\n\r\n /** return true if this sublayer is an unnamed group */\r\n public get isUnnamedGroup(): boolean { return !this.isLeaf && !this.isNamed; }\r\n\r\n /** return a string representing this sublayer id (converting to string if underlying id is number) */\r\n public get idString(): string { return (typeof this.id === \"number\") ? this.id.toString(10) : this.id; }\r\n}\r\n\r\n/** JSON representation of properties common to both [[ImageMapLayerProps]] and [[ModelMapLayerProps]].\r\n * @see [[MapImageryProps]]\r\n * @public\r\n */\r\nexport interface CommonMapLayerProps {\r\n /** Controls visibility of layer. Defaults to 'true'. */\r\n visible?: boolean;\r\n\r\n /** A user-friendly name for the layer. */\r\n name: string;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing,\r\n * or false to indicate the transparency should not be overridden.\r\n * Default value: 0.\r\n */\r\n transparency?: number;\r\n /** True to indicate background is transparent.\r\n * Default: true.\r\n */\r\n transparentBackground?: boolean;\r\n}\r\n\r\n/** JSON representation of an [[ImageMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @see [[ImageryMapLayerFormatId]].\r\n * @public\r\n */\r\nexport interface ImageMapLayerProps extends CommonMapLayerProps {\r\n /** URL */\r\n url: string;\r\n /** Identifies the map layers source.*/\r\n formatId: string;\r\n /** Source layers. If undefined all layers are displayed. */\r\n subLayers?: MapSubLayerProps[];\r\n /** Access Key for the Layer, like a subscription key or access token.\r\n * ###TODO This does not belong in the props object. It should never be persisted.\r\n */\r\n /** @internal */\r\n accessKey?: MapLayerKey;\r\n\r\n /** @internal */\r\n modelId?: never;\r\n}\r\n\r\n/** JSON representation of a [[ModelMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @public\r\n */\r\nexport interface ModelMapLayerProps extends CommonMapLayerProps {\r\n /** The Id of the [GeometricModel]($backend) containing the geometry to be drawn by the layer. */\r\n modelId: Id64String;\r\n\r\n /** @internal */\r\n url?: never;\r\n /** @internal */\r\n formatId?: never;\r\n /** @internal */\r\n subLayers?: never;\r\n /** @internal */\r\n accessKey?: never;\r\n}\r\n\r\n/** JSON representation of a [[MapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @public\r\n */\r\nexport type MapLayerProps = ImageMapLayerProps | ModelMapLayerProps;\r\n\r\n/**\r\n * stores key-value pair to be added to all requests made involving map layer.\r\n * @public\r\n */\r\nexport interface MapLayerKey {\r\n key: string;\r\n value: string;\r\n}\r\n\r\n/** Abstract base class for normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * This class is extended by [[ImageMapLayerSettings]] and [ModelMapLayerSettings]] to create the settings for image and model based layers.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @public\r\n */\r\nexport abstract class MapLayerSettings {\r\n public readonly visible: boolean;\r\n\r\n public readonly name: string;\r\n public readonly transparency: number;\r\n public readonly transparentBackground: boolean;\r\n public abstract get allSubLayersInvisible(): boolean;\r\n public abstract clone(changedProps: Partial<MapLayerProps>): MapLayerSettings;\r\n public abstract toJSON(): MapLayerProps;\r\n\r\n /** @internal */\r\n protected constructor(name: string, visible = true, transparency: number = 0, transparentBackground = true) {\r\n this.name = name;\r\n this.visible = visible;\r\n this.transparentBackground = transparentBackground;\r\n this.transparency = transparency;\r\n }\r\n\r\n /** Create a map layer settings from its JSON representation. */\r\n public static fromJSON(props: MapLayerProps): MapLayerSettings {\r\n return undefined !== props.modelId ? ModelMapLayerSettings.fromJSON(props) : ImageMapLayerSettings.fromJSON(props);\r\n }\r\n\r\n /** @internal */\r\n protected _toJSON(): CommonMapLayerProps {\r\n const props: CommonMapLayerProps = {\r\n name: this.name,\r\n visible: this.visible,\r\n };\r\n\r\n if (0 !== this.transparency)\r\n props.transparency = this.transparency;\r\n\r\n if (this.transparentBackground === false)\r\n props.transparentBackground = this.transparentBackground;\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n protected cloneProps(changedProps: Partial<MapLayerProps>): CommonMapLayerProps {\r\n return {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n transparency: undefined !== changedProps.transparency ? changedProps.transparency : this.transparency,\r\n transparentBackground: undefined !== changedProps.transparentBackground ? changedProps.transparentBackground : this.transparentBackground,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible && this.transparency === other.transparency && this.transparentBackground === other.transparentBackground;\r\n }\r\n\r\n /** Return a unique string identifying the layers source... The URL for image layer or modelID for model layer */\r\n public abstract get source(): string;\r\n\r\n /** @internal */\r\n public matchesNameAndSource(name: string, source: string): boolean {\r\n return this.name === name && this.source === source;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ImageMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Image map layers are created from servers that produce images that represent map tiles. Map layers map also be represented by models.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ModelMapLayerSettings]] for model based map layer settings.\r\n * @public\r\n */\r\nexport class ImageMapLayerSettings extends MapLayerSettings {\r\n public readonly formatId: string;\r\n public readonly url: string;\r\n public userName?: string;\r\n public password?: string;\r\n public accessKey?: MapLayerKey;\r\n public readonly subLayers: MapSubLayerSettings[];\r\n public override get source(): string { return this.url; }\r\n\r\n /** @internal */\r\n protected constructor(props: ImageMapLayerProps) {\r\n const transparentBackground = props.transparentBackground ?? true;\r\n super(props.name, props.visible, props.transparency, transparentBackground);\r\n\r\n this.formatId = props.formatId;\r\n this.url = props.url;\r\n this.accessKey = props.accessKey;\r\n this.subLayers = [];\r\n if (!props.subLayers)\r\n return;\r\n\r\n for (const subLayerProps of props.subLayers) {\r\n const subLayer = MapSubLayerSettings.fromJSON(subLayerProps);\r\n if (subLayer)\r\n this.subLayers.push(subLayer);\r\n }\r\n }\r\n\r\n public static override fromJSON(props: ImageMapLayerProps): ImageMapLayerSettings {\r\n return new this(props);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ImageMapLayerProps {\r\n const props = super._toJSON() as ImageMapLayerProps;\r\n props.url = this.url;\r\n props.formatId = this.formatId;\r\n\r\n if (this.subLayers.length > 0)\r\n props.subLayers = this.subLayers.map((x) => x.toJSON());\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerSettings {\r\n const clone = ImageMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n\r\n // Clone members not part of MapLayerProps\r\n clone.userName = this.userName;\r\n clone.password = this.password;\r\n clone.accessKey = this.accessKey;\r\n\r\n return clone;\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ImageMapLayerProps;\r\n\r\n props.formatId = changedProps.formatId ?? this.formatId;\r\n props.url = changedProps.url ?? this.url;\r\n props.accessKey = changedProps.accessKey ?? this.accessKey;\r\n props.subLayers = changedProps.subLayers ?? this.subLayers;\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (! (other instanceof ImageMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n if (this.userName !== other.userName || this.password !== other.password || this.subLayers.length !== other.subLayers.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < this.subLayers.length; i++)\r\n if (!this.subLayers[i].displayMatches(other.subLayers[i]))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n /** Return a sublayer matching id -- or undefined if not found */\r\n public subLayerById(id?: SubLayerId): MapSubLayerSettings | undefined {\r\n return id === undefined ? undefined : this.subLayers.find((subLayer) => subLayer.id === id);\r\n }\r\n\r\n private hasInvisibleAncestors(subLayer?: MapSubLayerSettings): boolean {\r\n if (!subLayer || !subLayer.parent)\r\n return false;\r\n\r\n const parent = this.subLayerById(subLayer.parent);\r\n if (!parent)\r\n return false;\r\n\r\n // Visibility of named group has no impact on the visibility of children (only unnamed group does)\r\n // i.e For WMS, its should be possible to request a child layer when its parent is not visible (if the parent is also named)\r\n return (!parent.visible && !parent.isNamed) || this.hasInvisibleAncestors(parent);\r\n }\r\n\r\n /** Return true if sublayer is visible -- testing ancestors for visibility if they exist. */\r\n public isSubLayerVisible(subLayer: MapSubLayerSettings): boolean {\r\n if (!subLayer.visible)\r\n return false;\r\n\r\n return !this.hasInvisibleAncestors(subLayer);\r\n }\r\n\r\n /** Return true if all sublayers are invisible. */\r\n public get allSubLayersInvisible(): boolean {\r\n if (this.subLayers.length === 0)\r\n return false;\r\n\r\n return this.subLayers.every((subLayer) => (subLayer.isUnnamedGroup || !this.isSubLayerVisible(subLayer)));\r\n }\r\n\r\n /** Return the children for a sublayer */\r\n public getSubLayerChildren(subLayer: MapSubLayerSettings): MapSubLayerSettings[] | undefined {\r\n if (!subLayer.children)\r\n return undefined;\r\n\r\n const children = new Array<MapSubLayerSettings>();\r\n subLayer.children.forEach((childId) => {\r\n const child = this.subLayerById(childId);\r\n if (child !== undefined)\r\n children.push(child);\r\n });\r\n\r\n return children;\r\n }\r\n\r\n /** @internal */\r\n protected static mapTypeName(type: BackgroundMapType) { // TBD.. Localization.\r\n switch (type) {\r\n case BackgroundMapType.Aerial:\r\n return \"Aerial Imagery\";\r\n default:\r\n case BackgroundMapType.Hybrid:\r\n return \"Aerial Imagery with labels\";\r\n case BackgroundMapType.Street:\r\n return \"Streets\";\r\n }\r\n }\r\n\r\n public setCredentials(userName?: string, password?: string) {\r\n this.userName = userName;\r\n this.password = password;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ImageMapLayerSettings]] for image based map layer settings.\r\n * @public\r\n */\r\nexport class ModelMapLayerSettings extends MapLayerSettings {\r\n public readonly modelId: Id64String;\r\n public override get source(): string { return this.modelId; }\r\n\r\n /** @internal */\r\n protected constructor(modelId: Id64String, name: string, visible = true,\r\n transparency: number = 0, transparentBackground = true) {\r\n super(name, visible, transparency, transparentBackground);\r\n this.modelId = modelId;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static override fromJSON(json: ModelMapLayerProps): ModelMapLayerSettings {\r\n const transparentBackground = (json.transparentBackground === undefined) ? true : json.transparentBackground;\r\n return new this(json.modelId, json.name, json.visible, json.transparency, transparentBackground);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ModelMapLayerProps {\r\n const props = super._toJSON() as ModelMapLayerProps;\r\n props.modelId = this.modelId;\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerSettings {\r\n return ModelMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ModelMapLayerProps;\r\n props.modelId = changedProps.modelId ?? this.modelId;\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (!(other instanceof ModelMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n return this.modelId === other.modelId;\r\n }\r\n\r\n /** Return true if all sublayers are invisible (always false as model layers do not include sublayers). */\r\n public get allSubLayersInvisible(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\n/** JSON representation of a [[BaseMapLayerSettings]].\r\n * @public\r\n */\r\nexport interface BaseMapLayerProps extends ImageMapLayerProps {\r\n provider?: BackgroundMapProviderProps;\r\n}\r\n\r\n/** A [[ImageMapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].\r\n * The base layer supports all of the same options as any other layer, but also allows for simplified configuration based\r\n * on a small set of known supported [[BackgroundMapProvider]]s like [Bing Maps](https://www.microsoft.com/en-us/maps).\r\n * If the base layer was configured from such a provider, that information will be preserved and can be queried; this allows\r\n * the imagery provider and/or type to be easily modified.\r\n * @see [[MapImagerySettings.backgroundBase]].\r\n * @public\r\n */\r\nexport class BaseMapLayerSettings extends ImageMapLayerSettings {\r\n private _provider?: BackgroundMapProvider;\r\n\r\n /** The provider from which this base layer was configured, if any. */\r\n public get provider(): BackgroundMapProvider | undefined { return this._provider; }\r\n\r\n /** Create a base layer from its JSON representation.\r\n * TODO: This, MapLayerSettings.fromJSON, and MapSubLayerSettings.fromJSON should never return undefined.\r\n * That means they should not accept undefined for props and should define props such that it fully describes the\r\n * layer - e.g., url and name must be defined.\r\n */\r\n public static override fromJSON(props: BaseMapLayerProps): BaseMapLayerSettings {\r\n const settings = super.fromJSON(props);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n if (props.provider)\r\n settings._provider = BackgroundMapProvider.fromJSON(props.provider);\r\n\r\n return settings;\r\n }\r\n\r\n /** Convert this layer to its JSON representation. */\r\n public override toJSON(): BaseMapLayerProps {\r\n const props = super.toJSON() as BaseMapLayerProps;\r\n if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override cloneProps(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerProps {\r\n const props = super.cloneProps(changedProps) as BaseMapLayerProps;\r\n\r\n if (changedProps.provider)\r\n props.provider = changedProps.provider;\r\n else if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this layer. */\r\n public override clone(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerSettings {\r\n const prevUrl = this.url;\r\n const clone = BaseMapLayerSettings.fromJSON(this.cloneProps(changedProps))!;\r\n\r\n if (this.provider && prevUrl !== this.url)\r\n clone._provider = undefined;\r\n\r\n return clone;\r\n }\r\n\r\n /** Create a base layer from a BackgroundMapProvider. */\r\n public static fromProvider(provider: BackgroundMapProvider, options?: { invisible?: boolean, transparency?: number }): BaseMapLayerSettings {\r\n let formatId: string, url: string, name: string;\r\n switch (provider.name) {\r\n case \"BingProvider\":\r\n default:\r\n formatId = \"BingMaps\";\r\n\r\n let imagerySet;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n imagerySet = \"Road\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n imagerySet = \"Aerial\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n default:\r\n imagerySet = \"AerialWithLabels\";\r\n break;\r\n }\r\n\r\n name = `Bing Maps: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n url = `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${imagerySet}?o=json&incl=ImageryProviders&key={bingKey}`;\r\n break;\r\n\r\n case \"MapBoxProvider\":\r\n formatId = \"MapboxImagery\";\r\n name = `MapBox: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/\";\r\n break;\r\n }\r\n\r\n break;\r\n }\r\n\r\n const settings = super.fromJSON({\r\n name,\r\n formatId,\r\n url,\r\n transparentBackground: false,\r\n visible: !options?.invisible,\r\n transparency: options?.transparency,\r\n });\r\n\r\n assert(undefined !== settings);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n\r\n settings._provider = provider;\r\n return settings;\r\n }\r\n\r\n /** @internal */\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BaseMapLayerSettings {\r\n return this.fromProvider(BackgroundMapProvider.fromBackgroundMapProps(props));\r\n }\r\n\r\n /** @alpha */\r\n public cloneWithProvider(provider: BackgroundMapProvider): BaseMapLayerSettings {\r\n return BaseMapLayerSettings.fromProvider(provider, { invisible: !this.visible, transparency: this.transparency });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"MapLayerSettings.js","sourceRoot":"","sources":["../../src/MapLayerSettings.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAA8B,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AA2B/G;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAmB;IAc9B,YAAY,IAAY,EAAE,KAAc,EAAE,OAAiB,EAAE,EAAe,EAAE,MAAmB,EAAE,QAAuB;QACxH,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC;QAChD,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AAO,EAAE,SAAS;YAC5B,YAAY,EAAE,OAAO,EAAE,YAAY;SACpC,CAAC,CAAC;QAEH,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;QAC/B,MAAM,CAAC,QAAQ,YAAY,oBAAoB,CAAC,CAAC;QAEjD,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC9B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,sBAAsB,CAAC,KAAmC;QACtE,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IAChF,CAAC;IAED,aAAa;IACN,iBAAiB,CAAC,QAA+B;QACtD,OAAO,oBAAoB,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IACpH,CAAC;CACF","sourcesContent":["/* eslint-disable deprecation/deprecation */\r\n/*---------------------------------------------------------------------------------------------\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 MapLayers\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { BackgroundMapProvider, BackgroundMapProviderProps, BackgroundMapType } from \"./BackgroundMapProvider\";\r\nimport { DeprecatedBackgroundMapProps } from \"./BackgroundMapSettings\";\r\n\r\n/** The current set of supported map layer formats.\r\n * In order to be displayed, a corresponding format must have been registered in the [MapLayerFormatRegistry]($frontend)\r\n * @public\r\n */\r\nexport type ImageryMapLayerFormatId = \"ArcGIS\" | \"BingMaps\" | \"MapboxImagery\" | \"TileURL\" | \"WMS\" | \"WMTS\";\r\n\r\n/** @public */\r\nexport type SubLayerId = string | number;\r\n\r\n/** JSON representation of the settings associated with a map sublayer included within a [[MapLayerProps]].\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * @see [[MapLayerProps]]\r\n * @public\r\n */\r\nexport interface MapSubLayerProps {\r\n name: string;\r\n title?: string;\r\n visible?: boolean;\r\n id?: SubLayerId;\r\n parent?: SubLayerId;\r\n children?: SubLayerId[];\r\n}\r\n\r\n/** Normalized representation of a [[MapSubLayerProps]] for which values\r\n * have been validated and default values have been applied where explicit values not defined.\r\n * A map sub layer represents a set of objects within the layer that can be controlled separately. These\r\n * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers.\r\n * This class can represent a hierarchy, in this case a sub layer is visible only if all its ancestors are also visible.\r\n * @see [[MapLayerSettings]]\r\n * @public\r\n */\r\nexport class MapSubLayerSettings {\r\n /** Typically Name is a single word used for machine-to-machine communication while the Title is for the benefit of humans (WMS) */\r\n public readonly name: string;\r\n /** Title. */\r\n public readonly title?: string;\r\n /** If true the sub layer is visible. If part of a hierarchy, a sub layer is visible only if its ancestors are also visible. */\r\n public readonly visible: boolean;\r\n /** A unique string or number that may be used to identify the sub layer (ArcGIS) */\r\n public readonly id: SubLayerId;\r\n /** One or more sublayer children */\r\n public readonly children?: SubLayerId[];\r\n /** sublayer parent. */\r\n public readonly parent?: SubLayerId;\r\n\r\n constructor(name: string, title?: string, visible?: boolean, id?: SubLayerId, parent?: SubLayerId, children?: SubLayerId[]) {\r\n this.name = name;\r\n this.title = title;\r\n this.visible = visible !== undefined && visible;\r\n this.id = (id === undefined) ? this.name : id;\r\n this.parent = parent;\r\n this.children = children;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static fromJSON(json: MapSubLayerProps): MapSubLayerSettings {\r\n return new MapSubLayerSettings(json.name, json.title, json.visible, (json.id === json.name) ? undefined : json.id, json.parent, json.children);\r\n }\r\n\r\n public toJSON(): MapSubLayerProps {\r\n const props: MapSubLayerProps = { name: this.name, visible: this.visible };\r\n\r\n if (undefined !== this.id && this.id !== this.name)\r\n props.id = this.id;\r\n\r\n if (undefined !== this.title)\r\n props.title = this.title;\r\n\r\n if (this.children)\r\n props.children = [...this.children];\r\n\r\n if (undefined !== this.parent)\r\n props.parent = this.parent;\r\n\r\n return props;\r\n }\r\n\r\n /** Creating a copy of this MapSubLayer, optionally modifying some if its properties */\r\n public clone(changedProps: Partial<MapSubLayerProps>): MapSubLayerSettings {\r\n if (undefined === changedProps)\r\n return this;\r\n\r\n const props = {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n id: undefined !== changedProps.id ? changedProps.id : this.id,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n parent: undefined !== changedProps.parent ? changedProps.parent : this.parent,\r\n children: undefined !== changedProps.children ? changedProps.children.slice() : this.children?.slice(),\r\n title: undefined !== changedProps.title ? changedProps.title : this.title,\r\n };\r\n return MapSubLayerSettings.fromJSON(props)!;\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapSubLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible;\r\n }\r\n\r\n /** return true if this sublayer is named. */\r\n public get isNamed(): boolean { return this.name.length > 0; }\r\n\r\n /** return true if this sublayer is a leaf (has no children) */\r\n public get isLeaf(): boolean { return this.children === undefined || this.children.length === 0; }\r\n\r\n /** return true if this sublayer is an unnamed group */\r\n public get isUnnamedGroup(): boolean { return !this.isLeaf && !this.isNamed; }\r\n\r\n /** return a string representing this sublayer id (converting to string if underlying id is number) */\r\n public get idString(): string { return (typeof this.id === \"number\") ? this.id.toString(10) : this.id; }\r\n}\r\n\r\n/** JSON representation of properties common to both [[ImageMapLayerProps]] and [[ModelMapLayerProps]].\r\n * @see [[MapImageryProps]]\r\n * @public\r\n */\r\nexport interface CommonMapLayerProps {\r\n /** Controls visibility of layer. Defaults to 'true'. */\r\n visible?: boolean;\r\n\r\n /** A user-friendly name for the layer. */\r\n name: string;\r\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing,\r\n * or false to indicate the transparency should not be overridden.\r\n * Default value: 0.\r\n */\r\n transparency?: number;\r\n /** True to indicate background is transparent.\r\n * Default: true.\r\n */\r\n transparentBackground?: boolean;\r\n}\r\n\r\n/** JSON representation of an [[ImageMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @see [[ImageryMapLayerFormatId]].\r\n * @public\r\n */\r\nexport interface ImageMapLayerProps extends CommonMapLayerProps {\r\n /** URL */\r\n url: string;\r\n /** Identifies the map layers source.*/\r\n formatId: string;\r\n /** Source layers. If undefined all layers are displayed. */\r\n subLayers?: MapSubLayerProps[];\r\n /** Access Key for the Layer, like a subscription key or access token.\r\n * ###TODO This does not belong in the props object. It should never be persisted.\r\n */\r\n /** @internal */\r\n accessKey?: MapLayerKey;\r\n\r\n /** @internal */\r\n modelId?: never;\r\n\r\n /** List of query parameters that will get appended to the source.\r\n * @beta\r\n */\r\n queryParams?: { [key: string]: string };\r\n\r\n}\r\n\r\n/** JSON representation of a [[ModelMapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @public\r\n */\r\nexport interface ModelMapLayerProps extends CommonMapLayerProps {\r\n /** The Id of the [GeometricModel]($backend) containing the geometry to be drawn by the layer. */\r\n modelId: Id64String;\r\n\r\n /** @internal */\r\n url?: never;\r\n /** @internal */\r\n formatId?: never;\r\n /** @internal */\r\n subLayers?: never;\r\n /** @internal */\r\n accessKey?: never;\r\n}\r\n\r\n/** JSON representation of a [[MapLayerSettings]].\r\n * @see [[MapImagerySettings]].\r\n * @public\r\n */\r\nexport type MapLayerProps = ImageMapLayerProps | ModelMapLayerProps;\r\n\r\n/**\r\n * stores key-value pair to be added to all requests made involving map layer.\r\n * @public\r\n */\r\nexport interface MapLayerKey {\r\n key: string;\r\n value: string;\r\n}\r\n\r\n/** Abstract base class for normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * This class is extended by [[ImageMapLayerSettings]] and [ModelMapLayerSettings]] to create the settings for image and model based layers.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @public\r\n */\r\nexport abstract class MapLayerSettings {\r\n public readonly visible: boolean;\r\n\r\n public readonly name: string;\r\n public readonly transparency: number;\r\n public readonly transparentBackground: boolean;\r\n public abstract get allSubLayersInvisible(): boolean;\r\n public abstract clone(changedProps: Partial<MapLayerProps>): MapLayerSettings;\r\n public abstract toJSON(): MapLayerProps;\r\n\r\n /** @internal */\r\n protected constructor(name: string, visible = true, transparency: number = 0, transparentBackground = true) {\r\n this.name = name;\r\n this.visible = visible;\r\n this.transparentBackground = transparentBackground;\r\n this.transparency = transparency;\r\n }\r\n\r\n /** Create a map layer settings from its JSON representation. */\r\n public static fromJSON(props: MapLayerProps): MapLayerSettings {\r\n return undefined !== props.modelId ? ModelMapLayerSettings.fromJSON(props) : ImageMapLayerSettings.fromJSON(props);\r\n }\r\n\r\n /** @internal */\r\n protected _toJSON(): CommonMapLayerProps {\r\n const props: CommonMapLayerProps = {\r\n name: this.name,\r\n visible: this.visible,\r\n };\r\n\r\n if (0 !== this.transparency)\r\n props.transparency = this.transparency;\r\n\r\n if (this.transparentBackground === false)\r\n props.transparentBackground = this.transparentBackground;\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n protected cloneProps(changedProps: Partial<MapLayerProps>): CommonMapLayerProps {\r\n return {\r\n name: undefined !== changedProps.name ? changedProps.name : this.name,\r\n visible: undefined !== changedProps.visible ? changedProps.visible : this.visible,\r\n transparency: undefined !== changedProps.transparency ? changedProps.transparency : this.transparency,\r\n transparentBackground: undefined !== changedProps.transparentBackground ? changedProps.transparentBackground : this.transparentBackground,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public displayMatches(other: MapLayerSettings): boolean {\r\n return this.name === other.name && this.visible === other.visible && this.transparency === other.transparency && this.transparentBackground === other.transparentBackground;\r\n }\r\n\r\n /** Return a unique string identifying the layers source... The URL for image layer or modelID for model layer */\r\n public abstract get source(): string;\r\n\r\n /** @internal */\r\n public matchesNameAndSource(name: string, source: string): boolean {\r\n return this.name === name && this.source === source;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ImageMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Image map layers are created from servers that produce images that represent map tiles. Map layers map also be represented by models.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ModelMapLayerSettings]] for model based map layer settings.\r\n * @public\r\n */\r\nexport class ImageMapLayerSettings extends MapLayerSettings {\r\n public readonly formatId: string;\r\n public readonly url: string;\r\n public userName?: string;\r\n public password?: string;\r\n public accessKey?: MapLayerKey;\r\n\r\n /** List of query parameters to append to the settings URL and persisted as part of the JSON representation.\r\n * @note Sensitive information like user credentials should be provided in [[unsavedQueryParams]] to ensure it is never persisted.\r\n * @beta\r\n */\r\n public savedQueryParams?: { [key: string]: string };\r\n\r\n /** List of query parameters that will get appended to the settings URL that should *not* be be persisted part of the JSON representation.\r\n * @beta\r\n */\r\n public unsavedQueryParams?: { [key: string]: string };\r\n public readonly subLayers: MapSubLayerSettings[];\r\n public override get source(): string { return this.url; }\r\n\r\n /** @internal */\r\n protected constructor(props: ImageMapLayerProps) {\r\n const transparentBackground = props.transparentBackground ?? true;\r\n super(props.name, props.visible, props.transparency, transparentBackground);\r\n\r\n this.formatId = props.formatId;\r\n this.url = props.url;\r\n this.accessKey = props.accessKey;\r\n if (props.queryParams) {\r\n this.savedQueryParams = {...props.queryParams};\r\n }\r\n this.subLayers = [];\r\n if (!props.subLayers)\r\n return;\r\n\r\n for (const subLayerProps of props.subLayers) {\r\n const subLayer = MapSubLayerSettings.fromJSON(subLayerProps);\r\n if (subLayer)\r\n this.subLayers.push(subLayer);\r\n }\r\n }\r\n\r\n public static override fromJSON(props: ImageMapLayerProps): ImageMapLayerSettings {\r\n return new this(props);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ImageMapLayerProps {\r\n const props = super._toJSON() as ImageMapLayerProps;\r\n props.url = this.url;\r\n props.formatId = this.formatId;\r\n\r\n if (this.subLayers.length > 0)\r\n props.subLayers = this.subLayers.map((x) => x.toJSON());\r\n\r\n if (this.savedQueryParams)\r\n props.queryParams = {...this.savedQueryParams};\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerSettings {\r\n const clone = ImageMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n\r\n // Clone members not part of MapLayerProps\r\n clone.userName = this.userName;\r\n clone.password = this.password;\r\n clone.accessKey = this.accessKey;\r\n if (this.unsavedQueryParams)\r\n clone.unsavedQueryParams = {...this.unsavedQueryParams};\r\n if (this.savedQueryParams)\r\n clone.savedQueryParams = {...this.savedQueryParams};\r\n\r\n return clone;\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ImageMapLayerProps>): ImageMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ImageMapLayerProps;\r\n\r\n props.formatId = changedProps.formatId ?? this.formatId;\r\n props.url = changedProps.url ?? this.url;\r\n props.accessKey = changedProps.accessKey ?? this.accessKey;\r\n props.subLayers = changedProps.subLayers ?? this.subLayers;\r\n if (changedProps.queryParams) {\r\n props.queryParams = {...changedProps.queryParams};\r\n } else if (this.savedQueryParams) {\r\n props.queryParams = {...this.savedQueryParams};\r\n }\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (! (other instanceof ImageMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n if (this.userName !== other.userName || this.password !== other.password || this.subLayers.length !== other.subLayers.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < this.subLayers.length; i++)\r\n if (!this.subLayers[i].displayMatches(other.subLayers[i]))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n /** Return a sublayer matching id -- or undefined if not found */\r\n public subLayerById(id?: SubLayerId): MapSubLayerSettings | undefined {\r\n return id === undefined ? undefined : this.subLayers.find((subLayer) => subLayer.id === id);\r\n }\r\n\r\n private hasInvisibleAncestors(subLayer?: MapSubLayerSettings): boolean {\r\n if (!subLayer || !subLayer.parent)\r\n return false;\r\n\r\n const parent = this.subLayerById(subLayer.parent);\r\n if (!parent)\r\n return false;\r\n\r\n // Visibility of named group has no impact on the visibility of children (only unnamed group does)\r\n // i.e For WMS, its should be possible to request a child layer when its parent is not visible (if the parent is also named)\r\n return (!parent.visible && !parent.isNamed) || this.hasInvisibleAncestors(parent);\r\n }\r\n\r\n /** Return true if sublayer is visible -- testing ancestors for visibility if they exist. */\r\n public isSubLayerVisible(subLayer: MapSubLayerSettings): boolean {\r\n if (!subLayer.visible)\r\n return false;\r\n\r\n return !this.hasInvisibleAncestors(subLayer);\r\n }\r\n\r\n /** Return true if all sublayers are invisible. */\r\n public get allSubLayersInvisible(): boolean {\r\n if (this.subLayers.length === 0)\r\n return false;\r\n\r\n return this.subLayers.every((subLayer) => (subLayer.isUnnamedGroup || !this.isSubLayerVisible(subLayer)));\r\n }\r\n\r\n /** Return the children for a sublayer */\r\n public getSubLayerChildren(subLayer: MapSubLayerSettings): MapSubLayerSettings[] | undefined {\r\n if (!subLayer.children)\r\n return undefined;\r\n\r\n const children = new Array<MapSubLayerSettings>();\r\n subLayer.children.forEach((childId) => {\r\n const child = this.subLayerById(childId);\r\n if (child !== undefined)\r\n children.push(child);\r\n });\r\n\r\n return children;\r\n }\r\n\r\n /** @internal */\r\n protected static mapTypeName(type: BackgroundMapType) { // TBD.. Localization.\r\n switch (type) {\r\n case BackgroundMapType.Aerial:\r\n return \"Aerial Imagery\";\r\n default:\r\n case BackgroundMapType.Hybrid:\r\n return \"Aerial Imagery with labels\";\r\n case BackgroundMapType.Street:\r\n return \"Streets\";\r\n }\r\n }\r\n\r\n public setCredentials(userName?: string, password?: string) {\r\n this.userName = userName;\r\n this.password = password;\r\n }\r\n\r\n /** Collect all query parameters\r\n * @beta\r\n */\r\n public collectQueryParams() {\r\n let queryParams: {[key: string]: string} = {};\r\n if (this.savedQueryParams)\r\n queryParams = {...this.savedQueryParams};\r\n\r\n if (this.unsavedQueryParams)\r\n queryParams = {...queryParams, ...this.unsavedQueryParams};\r\n\r\n return queryParams;\r\n }\r\n}\r\n\r\n/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.\r\n * Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.\r\n * One or more map layers may be included within [[MapImagerySettings]] object.\r\n * @see [[MapImagerySettings]]\r\n * @see [[ImageMapLayerSettings]] for image based map layer settings.\r\n * @public\r\n */\r\nexport class ModelMapLayerSettings extends MapLayerSettings {\r\n public readonly modelId: Id64String;\r\n public override get source(): string { return this.modelId; }\r\n\r\n /** @internal */\r\n protected constructor(modelId: Id64String, name: string, visible = true,\r\n transparency: number = 0, transparentBackground = true) {\r\n super(name, visible, transparency, transparentBackground);\r\n this.modelId = modelId;\r\n }\r\n\r\n /** Construct from JSON, performing validation and applying default values for undefined fields. */\r\n public static override fromJSON(json: ModelMapLayerProps): ModelMapLayerSettings {\r\n const transparentBackground = (json.transparentBackground === undefined) ? true : json.transparentBackground;\r\n return new this(json.modelId, json.name, json.visible, json.transparency, transparentBackground);\r\n }\r\n\r\n /** return JSON representation of this MapLayerSettings object */\r\n public override toJSON(): ModelMapLayerProps {\r\n const props = super._toJSON() as ModelMapLayerProps;\r\n props.modelId = this.modelId;\r\n return props;\r\n }\r\n\r\n /** Create a copy of this MapLayerSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerSettings {\r\n return ModelMapLayerSettings.fromJSON(this.cloneProps(changedProps));\r\n }\r\n\r\n /** @internal */\r\n protected override cloneProps(changedProps: Partial<ModelMapLayerProps>): ModelMapLayerProps {\r\n const props = super.cloneProps(changedProps) as ModelMapLayerProps;\r\n props.modelId = changedProps.modelId ?? this.modelId;\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override displayMatches(other: MapLayerSettings): boolean {\r\n if (!(other instanceof ModelMapLayerSettings) || !super.displayMatches(other))\r\n return false;\r\n\r\n return this.modelId === other.modelId;\r\n }\r\n\r\n /** Return true if all sublayers are invisible (always false as model layers do not include sublayers). */\r\n public get allSubLayersInvisible(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\n/** JSON representation of a [[BaseMapLayerSettings]].\r\n * @public\r\n */\r\nexport interface BaseMapLayerProps extends ImageMapLayerProps {\r\n provider?: BackgroundMapProviderProps;\r\n}\r\n\r\n/** A [[ImageMapLayerSettings]] that can serve as the base layer for a [[MapImagerySettings]].\r\n * The base layer supports all of the same options as any other layer, but also allows for simplified configuration based\r\n * on a small set of known supported [[BackgroundMapProvider]]s like [Bing Maps](https://www.microsoft.com/en-us/maps).\r\n * If the base layer was configured from such a provider, that information will be preserved and can be queried; this allows\r\n * the imagery provider and/or type to be easily modified.\r\n * @see [[MapImagerySettings.backgroundBase]].\r\n * @public\r\n */\r\nexport class BaseMapLayerSettings extends ImageMapLayerSettings {\r\n private _provider?: BackgroundMapProvider;\r\n\r\n /** The provider from which this base layer was configured, if any. */\r\n public get provider(): BackgroundMapProvider | undefined { return this._provider; }\r\n\r\n /** Create a base layer from its JSON representation.\r\n * TODO: This, MapLayerSettings.fromJSON, and MapSubLayerSettings.fromJSON should never return undefined.\r\n * That means they should not accept undefined for props and should define props such that it fully describes the\r\n * layer - e.g., url and name must be defined.\r\n */\r\n public static override fromJSON(props: BaseMapLayerProps): BaseMapLayerSettings {\r\n const settings = super.fromJSON(props);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n if (props.provider)\r\n settings._provider = BackgroundMapProvider.fromJSON(props.provider);\r\n\r\n return settings;\r\n }\r\n\r\n /** Convert this layer to its JSON representation. */\r\n public override toJSON(): BaseMapLayerProps {\r\n const props = super.toJSON() as BaseMapLayerProps;\r\n if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override cloneProps(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerProps {\r\n const props = super.cloneProps(changedProps) as BaseMapLayerProps;\r\n\r\n if (changedProps.provider)\r\n props.provider = changedProps.provider;\r\n else if (this.provider)\r\n props.provider = this.provider.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this layer. */\r\n public override clone(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerSettings {\r\n const prevUrl = this.url;\r\n const clone = BaseMapLayerSettings.fromJSON(this.cloneProps(changedProps))!;\r\n\r\n if (this.provider && prevUrl !== this.url)\r\n clone._provider = undefined;\r\n\r\n return clone;\r\n }\r\n\r\n /** Create a base layer from a BackgroundMapProvider. */\r\n public static fromProvider(provider: BackgroundMapProvider, options?: { invisible?: boolean, transparency?: number }): BaseMapLayerSettings {\r\n let formatId: string, url: string, name: string;\r\n switch (provider.name) {\r\n case \"BingProvider\":\r\n default:\r\n formatId = \"BingMaps\";\r\n\r\n let imagerySet;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n imagerySet = \"Road\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n imagerySet = \"Aerial\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n default:\r\n imagerySet = \"AerialWithLabels\";\r\n break;\r\n }\r\n\r\n name = `Bing Maps: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n url = `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${imagerySet}?o=json&incl=ImageryProviders&key={bingKey}`;\r\n break;\r\n\r\n case \"MapBoxProvider\":\r\n formatId = \"MapboxImagery\";\r\n name = `MapBox: ${ImageMapLayerSettings.mapTypeName(provider.type)}`;\r\n switch (provider.type) {\r\n case BackgroundMapType.Street:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/\";\r\n break;\r\n case BackgroundMapType.Aerial:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/\";\r\n break;\r\n case BackgroundMapType.Hybrid:\r\n url = \"https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/\";\r\n break;\r\n }\r\n\r\n break;\r\n }\r\n\r\n const settings = super.fromJSON({\r\n name,\r\n formatId,\r\n url,\r\n transparentBackground: false,\r\n visible: !options?.invisible,\r\n transparency: options?.transparency,\r\n });\r\n\r\n assert(undefined !== settings);\r\n assert(settings instanceof BaseMapLayerSettings);\r\n\r\n settings._provider = provider;\r\n return settings;\r\n }\r\n\r\n /** @internal */\r\n public static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): BaseMapLayerSettings {\r\n return this.fromProvider(BackgroundMapProvider.fromBackgroundMapProps(props));\r\n }\r\n\r\n /** @alpha */\r\n public cloneWithProvider(provider: BackgroundMapProvider): BaseMapLayerSettings {\r\n return BaseMapLayerSettings.fromProvider(provider, { invisible: !this.visible, transparency: this.transparency });\r\n }\r\n}\r\n"]}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { Point3d, Range1d, Range1dProps, Vector3d, XYZProps } from "@itwin/core-geometry";
|
|
5
5
|
import { ColorDef, ColorDefProps } from "./ColorDef";
|
|
6
6
|
import { Gradient } from "./Gradient";
|
|
7
|
+
import { TextureTransparency } from "./TextureProps";
|
|
7
8
|
/** A thematic gradient mode used to generate and apply a thematic effect to a scene.
|
|
8
9
|
* @see [[ThematicGradientSettings.mode]]
|
|
9
10
|
* @public
|
|
@@ -19,6 +20,23 @@ export declare enum ThematicGradientMode {
|
|
|
19
20
|
/** Apply isolines to the scene to achieve an effect similar to a contour map. Can only be used with [[ThematicDisplayMode.Height]]. */
|
|
20
21
|
IsoLines = 3
|
|
21
22
|
}
|
|
23
|
+
/** Describes how transparency is computed when applying a thematic gradient to a surface.
|
|
24
|
+
* Each [[Gradient.KeyColor]] in [[ThematicGradientSettings.customKeys]] has a transparency value.
|
|
25
|
+
* Each surface to which the gradient is applied has its own transparency.
|
|
26
|
+
* The transparency mode determines how these two values are combined to compute the final transparency.
|
|
27
|
+
* @see [[ThematicGradientSettings.transparencyMode]].
|
|
28
|
+
* @public
|
|
29
|
+
* @extensions
|
|
30
|
+
*/
|
|
31
|
+
export declare enum ThematicGradientTransparencyMode {
|
|
32
|
+
/** Ignore the gradient's transparency, applying only the surface's own transparency. */
|
|
33
|
+
SurfaceOnly = 0,
|
|
34
|
+
/** The final transparency is computed from the product of the surface and gradient alpha channels.
|
|
35
|
+
* (Alpha is the inverse of transparency, where `alpha = (255 - transparency) / 255`).
|
|
36
|
+
* If the gradient color is opaque, this produces the same result as [[SurfaceOnly]].
|
|
37
|
+
*/
|
|
38
|
+
MultiplySurfaceAndGradient = 1
|
|
39
|
+
}
|
|
22
40
|
/** A color scheme used to generate the colors of a thematic gradient within an applied range.
|
|
23
41
|
* @see [[ThematicGradientSettings.colorScheme]]
|
|
24
42
|
* @see [[ThematicDisplay.range]]
|
|
@@ -58,6 +76,8 @@ export interface ThematicGradientSettingsProps {
|
|
|
58
76
|
customKeys?: Gradient.KeyColorProps[];
|
|
59
77
|
/** See [[ThematicGradientSettings.colorMix]]. */
|
|
60
78
|
colorMix?: number;
|
|
79
|
+
/** See [[ThematicGradientSettings.transparencyMode]]. */
|
|
80
|
+
transparencyMode?: ThematicGradientTransparencyMode;
|
|
61
81
|
}
|
|
62
82
|
/** Thematic settings specific to creating a color gradient used by [[ThematicDisplay]].
|
|
63
83
|
* @public
|
|
@@ -79,11 +99,18 @@ export declare class ThematicGradientSettings {
|
|
|
79
99
|
/** The percentage to mix in the original color with the thematic display gradient color (0-1).
|
|
80
100
|
* Applies to background map terrain and point clouds only. Defaults to 0. */
|
|
81
101
|
readonly colorMix: number;
|
|
102
|
+
/** Specifies how the transparency is computed. Defaults to [[ThematicGradientTransparencyMode.SurfaceOnly]].
|
|
103
|
+
* @note This property is ignored for gradients applied using an [[AnalysisStyle]] via [[AnalysisStyleThematic]] - in that case, only the color and
|
|
104
|
+
* transparency of the thematic gradient are applied.
|
|
105
|
+
*/
|
|
106
|
+
readonly transparencyMode: ThematicGradientTransparencyMode;
|
|
82
107
|
static get margin(): number;
|
|
83
108
|
static get contentRange(): number;
|
|
84
109
|
static get contentMax(): number;
|
|
85
110
|
static readonly defaults: ThematicGradientSettings;
|
|
86
111
|
private static _defaultCustomKeys;
|
|
112
|
+
/** @alpha */
|
|
113
|
+
get textureTransparency(): TextureTransparency;
|
|
87
114
|
equals(other: ThematicGradientSettings): boolean;
|
|
88
115
|
/** Compares two sets of thematic gradient settings.
|
|
89
116
|
* @param lhs First set of thematic gradient settings to compare
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThematicDisplay.d.ts","sourceRoot":"","sources":["../../src/ThematicDisplay.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ThematicDisplay.d.ts","sourceRoot":"","sources":["../../src/ThematicDisplay.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,mBAA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CAAC;IACvC;;OAEG;IACH,SAAgB,cAAc,EAAE,6BAA6B,CAAC;IAEvD,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO;IAiB9C,OAAO;WAkCO,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB;IAI3C,MAAM,IAAI,oBAAoB;CActC"}
|
|
@@ -9,6 +9,7 @@ import { compareNumbers } from "@itwin/core-bentley";
|
|
|
9
9
|
import { Point3d, Range1d, Vector3d } from "@itwin/core-geometry";
|
|
10
10
|
import { ColorDef } from "./ColorDef";
|
|
11
11
|
import { Gradient } from "./Gradient";
|
|
12
|
+
import { TextureTransparency } from "./TextureProps";
|
|
12
13
|
/** A thematic gradient mode used to generate and apply a thematic effect to a scene.
|
|
13
14
|
* @see [[ThematicGradientSettings.mode]]
|
|
14
15
|
* @public
|
|
@@ -25,6 +26,24 @@ export var ThematicGradientMode;
|
|
|
25
26
|
/** Apply isolines to the scene to achieve an effect similar to a contour map. Can only be used with [[ThematicDisplayMode.Height]]. */
|
|
26
27
|
ThematicGradientMode[ThematicGradientMode["IsoLines"] = 3] = "IsoLines";
|
|
27
28
|
})(ThematicGradientMode || (ThematicGradientMode = {}));
|
|
29
|
+
/** Describes how transparency is computed when applying a thematic gradient to a surface.
|
|
30
|
+
* Each [[Gradient.KeyColor]] in [[ThematicGradientSettings.customKeys]] has a transparency value.
|
|
31
|
+
* Each surface to which the gradient is applied has its own transparency.
|
|
32
|
+
* The transparency mode determines how these two values are combined to compute the final transparency.
|
|
33
|
+
* @see [[ThematicGradientSettings.transparencyMode]].
|
|
34
|
+
* @public
|
|
35
|
+
* @extensions
|
|
36
|
+
*/
|
|
37
|
+
export var ThematicGradientTransparencyMode;
|
|
38
|
+
(function (ThematicGradientTransparencyMode) {
|
|
39
|
+
/** Ignore the gradient's transparency, applying only the surface's own transparency. */
|
|
40
|
+
ThematicGradientTransparencyMode[ThematicGradientTransparencyMode["SurfaceOnly"] = 0] = "SurfaceOnly";
|
|
41
|
+
/** The final transparency is computed from the product of the surface and gradient alpha channels.
|
|
42
|
+
* (Alpha is the inverse of transparency, where `alpha = (255 - transparency) / 255`).
|
|
43
|
+
* If the gradient color is opaque, this produces the same result as [[SurfaceOnly]].
|
|
44
|
+
*/
|
|
45
|
+
ThematicGradientTransparencyMode[ThematicGradientTransparencyMode["MultiplySurfaceAndGradient"] = 1] = "MultiplySurfaceAndGradient";
|
|
46
|
+
})(ThematicGradientTransparencyMode || (ThematicGradientTransparencyMode = {}));
|
|
28
47
|
/** A color scheme used to generate the colors of a thematic gradient within an applied range.
|
|
29
48
|
* @see [[ThematicGradientSettings.colorScheme]]
|
|
30
49
|
* @see [[ThematicDisplay.range]]
|
|
@@ -55,24 +74,32 @@ class ThematicGradientSettings {
|
|
|
55
74
|
static get margin() { return .001; } // A fixed portion of the gradient for out of range values.
|
|
56
75
|
static get contentRange() { return 1.0 - 2.0 * ThematicGradientSettings.margin; }
|
|
57
76
|
static get contentMax() { return 1.0 - ThematicGradientSettings.margin; }
|
|
77
|
+
/** @alpha */
|
|
78
|
+
get textureTransparency() {
|
|
79
|
+
let transp = TextureTransparency.Opaque;
|
|
80
|
+
if (ThematicGradientColorScheme.Custom === this.colorScheme) {
|
|
81
|
+
let haveOpaque = false;
|
|
82
|
+
let haveTransparent = false;
|
|
83
|
+
for (const key of this.customKeys) {
|
|
84
|
+
const isOpaque = key.color.isOpaque;
|
|
85
|
+
haveOpaque = haveOpaque || isOpaque;
|
|
86
|
+
haveTransparent = haveTransparent || !isOpaque;
|
|
87
|
+
}
|
|
88
|
+
if (haveTransparent)
|
|
89
|
+
transp = haveOpaque ? TextureTransparency.Mixed : TextureTransparency.Translucent;
|
|
90
|
+
}
|
|
91
|
+
if (transp !== TextureTransparency.Mixed)
|
|
92
|
+
if (this.marginColor.isOpaque !== (transp === TextureTransparency.Opaque))
|
|
93
|
+
transp = TextureTransparency.Mixed;
|
|
94
|
+
return transp;
|
|
95
|
+
}
|
|
58
96
|
equals(other) {
|
|
59
|
-
if (this.mode !== other.mode)
|
|
60
|
-
|
|
61
|
-
|
|
97
|
+
if (this.mode !== other.mode || this.stepCount !== other.stepCount || !this.marginColor.equals(other.marginColor)
|
|
98
|
+
|| this.colorScheme !== other.colorScheme || this.customKeys.length !== other.customKeys.length
|
|
99
|
+
|| this.colorMix !== other.colorMix || this.transparencyMode !== other.transparencyMode) {
|
|
62
100
|
return false;
|
|
63
|
-
if (!this.marginColor.equals(other.marginColor))
|
|
64
|
-
return false;
|
|
65
|
-
if (this.colorScheme !== other.colorScheme)
|
|
66
|
-
return false;
|
|
67
|
-
if (this.customKeys.length !== other.customKeys.length)
|
|
68
|
-
return false;
|
|
69
|
-
if (this.colorMix !== other.colorMix)
|
|
70
|
-
return false;
|
|
71
|
-
for (let i = 0; i < this.customKeys.length; i++) {
|
|
72
|
-
if (!Gradient.keyColorEquals(this.customKeys[i], other.customKeys[i]))
|
|
73
|
-
return false;
|
|
74
101
|
}
|
|
75
|
-
return
|
|
102
|
+
return this.customKeys.every((key, index) => Gradient.keyColorEquals(key, other.customKeys[index]));
|
|
76
103
|
}
|
|
77
104
|
/** Compares two sets of thematic gradient settings.
|
|
78
105
|
* @param lhs First set of thematic gradient settings to compare
|
|
@@ -93,10 +120,11 @@ class ThematicGradientSettings {
|
|
|
93
120
|
return diff;
|
|
94
121
|
if ((diff = compareNumbers(lhs.customKeys.length, rhs.customKeys.length)) !== 0)
|
|
95
122
|
return diff;
|
|
96
|
-
|
|
123
|
+
if ((diff = compareNumbers(lhs.transparencyMode, rhs.transparencyMode)) !== 0)
|
|
124
|
+
return diff;
|
|
125
|
+
for (let i = 0; i < lhs.customKeys.length; i++)
|
|
97
126
|
if ((diff = compareNumbers(lhs.customKeys[i].color.tbgr, rhs.customKeys[i].color.tbgr)) !== 0)
|
|
98
127
|
return diff;
|
|
99
|
-
}
|
|
100
128
|
return diff;
|
|
101
129
|
}
|
|
102
130
|
constructor(json) {
|
|
@@ -107,6 +135,7 @@ class ThematicGradientSettings {
|
|
|
107
135
|
this.marginColor = ColorDef.fromJSON();
|
|
108
136
|
this.colorScheme = ThematicGradientColorScheme.BlueRed;
|
|
109
137
|
this.colorMix = 0.0;
|
|
138
|
+
this.transparencyMode = ThematicGradientTransparencyMode.SurfaceOnly;
|
|
110
139
|
}
|
|
111
140
|
else {
|
|
112
141
|
this.mode = (json.mode !== undefined && json.mode !== null) ? json.mode : ThematicGradientMode.Smooth;
|
|
@@ -128,6 +157,7 @@ class ThematicGradientSettings {
|
|
|
128
157
|
this.customKeys.push(new Gradient.KeyColor({ value: keyValue[0], color: ColorDef.computeTbgrFromComponents(keyValue[1], keyValue[3], keyValue[2]) }));
|
|
129
158
|
}
|
|
130
159
|
this.colorMix = json.colorMix ?? 0.0;
|
|
160
|
+
this.transparencyMode = json.transparencyMode ?? ThematicGradientTransparencyMode.SurfaceOnly;
|
|
131
161
|
}
|
|
132
162
|
}
|
|
133
163
|
static fromJSON(json) {
|
|
@@ -146,6 +176,8 @@ class ThematicGradientSettings {
|
|
|
146
176
|
props.colorScheme = this.colorScheme;
|
|
147
177
|
if (0 !== this.colorMix)
|
|
148
178
|
props.colorMix = this.colorMix;
|
|
179
|
+
if (ThematicGradientTransparencyMode.SurfaceOnly !== this.transparencyMode)
|
|
180
|
+
props.transparencyMode = this.transparencyMode;
|
|
149
181
|
if (this.customKeys.length > 0)
|
|
150
182
|
props.customKeys = this.customKeys.map((key) => { return { value: key.value, color: key.color.toJSON() }; });
|
|
151
183
|
return props;
|
|
@@ -164,6 +196,7 @@ class ThematicGradientSettings {
|
|
|
164
196
|
colorScheme: undefined !== changedProps.colorScheme ? changedProps.colorScheme : this.colorScheme,
|
|
165
197
|
customKeys: undefined !== changedProps.customKeys ? changedProps.customKeys : this.customKeys.map((key) => ({ value: key.value, color: key.color.tbgr })),
|
|
166
198
|
colorMix: undefined !== changedProps.colorMix ? changedProps.colorMix : this.colorMix,
|
|
199
|
+
transparencyMode: changedProps.transparencyMode ?? this.transparencyMode,
|
|
167
200
|
};
|
|
168
201
|
return ThematicGradientSettings.fromJSON(props);
|
|
169
202
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThematicDisplay.js","sourceRoot":"","sources":["../../src/ThematicDisplay.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAgB,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;GAIG;AACH,MAAM,CAAN,IAAY,oBASX;AATD,WAAY,oBAAoB;IAC9B,kDAAkD;IAClD,mEAAU,CAAA;IACV,mDAAmD;IACnD,qEAAW,CAAA;IACX,yJAAyJ;IACzJ,+FAAwB,CAAA;IACxB,uIAAuI;IACvI,uEAAY,CAAA;AACd,CAAC,EATW,oBAAoB,KAApB,oBAAoB,QAS/B;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,2BAeX;AAfD,WAAY,2BAA2B;IACrC,uEAAuE;IACvE,mFAAW,CAAA;IACX,uEAAuE;IACvE,mFAAW,CAAA;IACX,uFAAuF;IACvF,yFAAc,CAAA;IACd,kEAAkE;IAClE,2FAAe,CAAA;IACf,mEAAmE;IACnE,2FAAe,CAAA;IACf;;OAEG;IACH,iFAAU,CAAA;AACZ,CAAC,EAfW,2BAA2B,KAA3B,2BAA2B,QAetC;AAqBD;;GAEG;AACH,MAAa,wBAAwB;IAkB5B,MAAM,KAAK,MAAM,KAAa,OAAO,IAAI,CAAC,CAAC,CAAC,CAAI,2DAA2D;IAC3G,MAAM,KAAK,YAAY,KAAa,OAAO,GAAG,GAAG,GAAG,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC;IACzF,MAAM,KAAK,UAAU,KAAa,OAAO,GAAG,GAA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AAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;gBACvB,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI;oBACxB,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;aAC1B;SACF;IACH,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,IAA2B;QAChD,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAEM,MAAM;QACX,MAAM,IAAI,GAAyB;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;YAChD,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACxB,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YACxC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;SAC3B,CAAC;QAEF,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;YACxC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;QAErD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","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 Symbology\r\n */\r\n\r\nimport { compareNumbers } from \"@itwin/core-bentley\";\r\nimport { Point3d, Range1d, Range1dProps, Vector3d, XYZProps } from \"@itwin/core-geometry\";\r\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\r\nimport { Gradient } from \"./Gradient\";\r\n\r\n/** A thematic gradient mode used to generate and apply a thematic effect to a scene.\r\n * @see [[ThematicGradientSettings.mode]]\r\n * @public\r\n * @extensions\r\n */\r\nexport enum ThematicGradientMode {\r\n /** Apply a smooth color gradient to the scene. */\r\n Smooth = 0,\r\n /** Apply a stepped color gradient to the scene. */\r\n Stepped = 1,\r\n /** Apply a stepped color gradient to the scene with delimiters (lines between the color steps). Can only be used with [[ThematicDisplayMode.Height]]. */\r\n SteppedWithDelimiter = 2,\r\n /** Apply isolines to the scene to achieve an effect similar to a contour map. Can only be used with [[ThematicDisplayMode.Height]]. */\r\n IsoLines = 3,\r\n}\r\n\r\n/** A color scheme used to generate the colors of a thematic gradient within an applied range.\r\n * @see [[ThematicGradientSettings.colorScheme]]\r\n * @see [[ThematicDisplay.range]]\r\n * @public\r\n * @extensions\r\n */\r\nexport enum ThematicGradientColorScheme {\r\n /** A color gradient scheme that represents a blue-to-red gradation. */\r\n BlueRed = 0,\r\n /** A color gradient scheme that represents a red-to-blue gradation. */\r\n RedBlue = 1,\r\n /** A color gradient scheme that represents a monochrome (black-to-white) gradation. */\r\n Monochrome = 2,\r\n /** A color gradient scheme that suits a topographic gradation. */\r\n Topographic = 3,\r\n /** A color gradient scheme that suits a sea-mountain gradation. */\r\n SeaMountain = 4,\r\n /** A custom color gradient scheme configured by the user.\r\n * @see [[ThematicGradientSettings.customKeys]]\r\n */\r\n Custom = 5,\r\n}\r\n\r\n/** JSON representation of a [[ThematicGradientSettings]].\r\n * @public\r\n * @extensions\r\n **/\r\nexport interface ThematicGradientSettingsProps {\r\n /** See [[ThematicGradientSettings.mode]]. */\r\n mode?: ThematicGradientMode;\r\n /** See [[ThematicGradientSettings.stepCount]]. */\r\n stepCount?: number;\r\n /** See [[ThematicGradientSettings.marginColor]]. */\r\n marginColor?: ColorDefProps;\r\n /** See [[ThematicGradientSettings.colorScheme]]. */\r\n colorScheme?: ThematicGradientColorScheme;\r\n /** See [[ThematicGradientSettings.customKeys. */\r\n customKeys?: Gradient.KeyColorProps[];\r\n /** See [[ThematicGradientSettings.colorMix]]. */\r\n colorMix?: number;\r\n}\r\n\r\n/** Thematic settings specific to creating a color gradient used by [[ThematicDisplay]].\r\n * @public\r\n */\r\nexport class ThematicGradientSettings {\r\n /** The thematic image mode used to generate the gradient. Defaults to [[ThematicGradientMode.Smooth]]. */\r\n public readonly mode: ThematicGradientMode;\r\n /** The step count value used for [[ThematicGradientMode.Stepped]], [[ThematicGradientMode.SteppedWithDelimiter]], and [[ThematicGradientMode.IsoLines]]. Defaults to 10. Cannot be less than 2. */\r\n public readonly stepCount: number;\r\n /** The margin color used at the extremes of the gradient, when outside the applied range. Defaults to a black color using [[ColorDef.fromJSON]] with no arguments. */\r\n public readonly marginColor: ColorDef;\r\n /** The color scheme used to generate the colors of the gradient color within the applied range. Defaults to [[ThematicGradientColorScheme.BlueRed]]. */\r\n public readonly colorScheme: ThematicGradientColorScheme;\r\n /** The key color values that must be provided when using a custom thematic color scheme.\r\n * Defaults to empty, unless using a custom thematic color scheme. In that case, this defaults to two key colors going from white to black.\r\n * When using a custom thematic color scheme, there must be at least two entries in here. If there are not, it will revert to the default settings.\r\n */\r\n public readonly customKeys: Gradient.KeyColor[];\r\n /** The percentage to mix in the original color with the thematic display gradient color (0-1).\r\n * Applies to background map terrain and point clouds only. Defaults to 0. */\r\n public readonly colorMix: number;\r\n\r\n public static get margin(): number { return .001; } // A fixed portion of the gradient for out of range values.\r\n public static get contentRange(): number { return 1.0 - 2.0 * ThematicGradientSettings.margin; }\r\n public static get contentMax(): number { return 1.0 - ThematicGradientSettings.margin; }\r\n\r\n public static readonly defaults = new ThematicGradientSettings({});\r\n\r\n private static _defaultCustomKeys = [[0.0, 255, 255, 255], [1.0, 0, 0, 0]];\r\n\r\n public equals(other: ThematicGradientSettings): boolean {\r\n if (this.mode !== other.mode)\r\n return false;\r\n if (this.stepCount !== other.stepCount)\r\n return false;\r\n if (!this.marginColor.equals(other.marginColor))\r\n return false;\r\n if (this.colorScheme !== other.colorScheme)\r\n return false;\r\n if (this.customKeys.length !== other.customKeys.length)\r\n return false;\r\n if (this.colorMix !== other.colorMix)\r\n return false;\r\n\r\n for (let i = 0; i < this.customKeys.length; i++) {\r\n if (!Gradient.keyColorEquals(this.customKeys[i], other.customKeys[i]))\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** Compares two sets of thematic gradient settings.\r\n * @param lhs First set of thematic gradient settings to compare\r\n * @param rhs Second set of thematic gradient settings to compare\r\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.\r\n */\r\n public static compare(lhs: ThematicGradientSettings, rhs: ThematicGradientSettings): number {\r\n let diff = 0;\r\n if ((diff = compareNumbers(lhs.mode, rhs.mode)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.stepCount, rhs.stepCount)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.marginColor.tbgr, rhs.marginColor.tbgr)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.colorScheme, rhs.colorScheme)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.colorMix, rhs.colorMix)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.customKeys.length, rhs.customKeys.length)) !== 0)\r\n return diff;\r\n\r\n for (let i = 0; i < lhs.customKeys.length; i++) {\r\n if ((diff = compareNumbers(lhs.customKeys[i].color.tbgr, rhs.customKeys[i].color.tbgr)) !== 0)\r\n return diff;\r\n }\r\n\r\n return diff;\r\n }\r\n\r\n private constructor(json?: ThematicGradientSettingsProps) {\r\n this.customKeys = [];\r\n if (undefined === json) {\r\n this.mode = ThematicGradientMode.Smooth;\r\n this.stepCount = 10;\r\n this.marginColor = ColorDef.fromJSON();\r\n this.colorScheme = ThematicGradientColorScheme.BlueRed;\r\n this.colorMix = 0.0;\r\n } else {\r\n this.mode = (json.mode !== undefined && json.mode !== null) ? json.mode : ThematicGradientMode.Smooth;\r\n if (this.mode < ThematicGradientMode.Smooth || this.mode > ThematicGradientMode.IsoLines)\r\n this.mode = ThematicGradientMode.Smooth;\r\n\r\n this.stepCount = (typeof json.stepCount === \"number\") ? json.stepCount : 10;\r\n if (this.stepCount < 2)\r\n this.stepCount = 2;\r\n\r\n this.marginColor = ColorDef.fromJSON(json.marginColor);\r\n\r\n this.colorScheme = (json.colorScheme !== undefined && json.colorScheme !== null) ? json.colorScheme : ThematicGradientColorScheme.BlueRed;\r\n if (this.colorScheme < ThematicGradientColorScheme.BlueRed || this.colorScheme > ThematicGradientColorScheme.Custom)\r\n this.colorScheme = ThematicGradientColorScheme.BlueRed;\r\n\r\n if (json.customKeys !== undefined && json.customKeys !== null)\r\n json.customKeys.forEach((key) => this.customKeys.push(new Gradient.KeyColor(key)));\r\n\r\n // Enforce 2 entries in custom color keys if violated\r\n if (this.colorScheme === ThematicGradientColorScheme.Custom && this.customKeys.length < 2) {\r\n this.customKeys = [];\r\n for (const keyValue of ThematicGradientSettings._defaultCustomKeys)\r\n this.customKeys.push(new Gradient.KeyColor({ value: keyValue[0], color: ColorDef.computeTbgrFromComponents(keyValue[1], keyValue[3], keyValue[2]) }));\r\n }\r\n\r\n this.colorMix = json.colorMix ?? 0.0;\r\n }\r\n }\r\n\r\n public static fromJSON(json?: ThematicGradientSettingsProps) {\r\n return json ? new ThematicGradientSettings(json) : this.defaults;\r\n }\r\n\r\n public toJSON(): ThematicGradientSettingsProps {\r\n const props: ThematicGradientSettingsProps = {};\r\n if (ThematicGradientMode.Smooth !== this.mode)\r\n props.mode = this.mode;\r\n\r\n if (10 !== this.stepCount)\r\n props.stepCount = this.stepCount;\r\n\r\n const marginColor = this.marginColor.toJSON();\r\n if (0 !== marginColor)\r\n props.marginColor = marginColor;\r\n\r\n if (ThematicGradientColorScheme.BlueRed !== this.colorScheme)\r\n props.colorScheme = this.colorScheme;\r\n\r\n if (0 !== this.colorMix)\r\n props.colorMix = this.colorMix;\r\n\r\n if (this.customKeys.length > 0)\r\n props.customKeys = this.customKeys.map((key) => { return { value: key.value, color: key.color.toJSON() }; });\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this ThematicGradientSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A ThematicGradientSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps?: ThematicGradientSettingsProps): ThematicGradientSettings {\r\n if (undefined === changedProps)\r\n return ThematicGradientSettings.fromJSON(this.toJSON());\r\n\r\n const props: ThematicGradientSettingsProps = {\r\n mode: undefined !== changedProps.mode ? changedProps.mode : this.mode,\r\n stepCount: undefined !== changedProps.stepCount ? changedProps.stepCount : this.stepCount,\r\n marginColor: undefined !== changedProps.marginColor ? changedProps.marginColor : this.marginColor.tbgr,\r\n colorScheme: undefined !== changedProps.colorScheme ? changedProps.colorScheme : this.colorScheme,\r\n customKeys: undefined !== changedProps.customKeys ? changedProps.customKeys : this.customKeys.map((key) => ({ value: key.value, color: key.color.tbgr })),\r\n colorMix: undefined !== changedProps.colorMix ? changedProps.colorMix : this.colorMix,\r\n };\r\n\r\n return ThematicGradientSettings.fromJSON(props);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[ThematicDisplaySensor]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ThematicDisplaySensorProps {\r\n /** The world position of the sensor in X, Y, and Z. Defaults to {0,0,0}. */\r\n position?: XYZProps;\r\n /** The value of the sensor used when accessing the thematic gradient texture; expected range is 0 to 1. Defaults to 0. */\r\n value?: number;\r\n}\r\n\r\n/** A sensor in world space, used for [[ThematicDisplayMode.InverseDistanceWeightedSensors]].\r\n * @public\r\n */\r\nexport class ThematicDisplaySensor {\r\n /** The world position of the sensor in X, Y, and Z. Defaults to {0,0,0}. */\r\n public position: Readonly<Point3d>;\r\n /** The value of the sensor used when accessing the thematic gradient texture; expected range is 0 to 1. Defaults to 0. */\r\n public readonly value: number;\r\n\r\n private constructor(json?: ThematicDisplaySensorProps) {\r\n if (undefined === json) {\r\n this.position = Point3d.fromJSON();\r\n this.value = 0;\r\n } else {\r\n this.position = Point3d.fromJSON(json.position);\r\n this.value = (typeof json.value !== \"number\") ? 0 : json.value;\r\n if (this.value < 0)\r\n this.value = 0;\r\n else if (this.value > 1)\r\n this.value = 1;\r\n }\r\n }\r\n\r\n public equals(other: ThematicDisplaySensor): boolean {\r\n return (this.value === other.value) && this.position.isAlmostEqual(other.position);\r\n }\r\n\r\n public static fromJSON(json?: ThematicDisplaySensorProps) {\r\n return new ThematicDisplaySensor(json);\r\n }\r\n\r\n public toJSON(): ThematicDisplaySensorProps {\r\n return {\r\n position: this.position.toJSON(),\r\n value: this.value,\r\n };\r\n }\r\n}\r\n\r\n/** JSON representation of a [[ThematicDisplaySensorSettings]] for [[ThematicDisplayMode.InverseDistanceWeightedSensors]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ThematicDisplaySensorSettingsProps {\r\n /** This is the list of sensors. Defaults to an empty array. */\r\n sensors?: ThematicDisplaySensorProps[];\r\n /** This is the distance cutoff in meters. For a position on screen to be affected by a sensor, it must be at least this close to the sensor.\r\n * If this is zero or negative, then no distance cutoff is applied (all sensors affect all positions regardless of nearness).\r\n * Defaults to zero.\r\n * @note Using a suitable distance cutoff imparts a significant performance benefit. The larger this value becomes, performance will degrade.\r\n */\r\n distanceCutoff?: number;\r\n}\r\n\r\n/** Settings for sensor-based thematic display for [[ThematicDisplayMode.InverseDistanceWeightedSensors]].\r\n * @public\r\n */\r\nexport class ThematicDisplaySensorSettings {\r\n /** This is the list of sensors. Defaults to an empty array. */\r\n public readonly sensors: ThematicDisplaySensor[];\r\n /** This is the distance cutoff in meters. For a position on screen to be affected by a sensor, it must be at least this close to the sensor.\r\n * If this is zero or negative, then no distance cutoff is applied (all sensors affect all positions regardless of nearness).\r\n * Defaults to zero.\r\n * @note Using a suitable distance cutoff imparts a significant performance benefit. The larger this value becomes, performance will degrade.\r\n */\r\n public readonly distanceCutoff: number;\r\n\r\n private constructor(json?: ThematicDisplaySensorSettingsProps) {\r\n this.sensors = [];\r\n if (undefined !== json) {\r\n if (json.sensors !== undefined && json.sensors !== null) {\r\n json.sensors.forEach((sensorJSON) => this.sensors.push(ThematicDisplaySensor.fromJSON(sensorJSON)));\r\n }\r\n this.distanceCutoff = (typeof json.distanceCutoff === \"number\") ? json.distanceCutoff : 0;\r\n } else {\r\n this.distanceCutoff = 0;\r\n }\r\n }\r\n\r\n public equals(other: ThematicDisplaySensorSettings): boolean {\r\n if (this.distanceCutoff !== other.distanceCutoff)\r\n return false;\r\n\r\n const thisSensors = this.sensors;\r\n const otherSensors = other.sensors;\r\n\r\n if (thisSensors.length !== otherSensors.length)\r\n return false;\r\n\r\n for (let i = 0; i < thisSensors.length; i++) {\r\n if (!thisSensors[i].equals(otherSensors[i]))\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public static fromJSON(json?: ThematicDisplaySensorSettingsProps) {\r\n return new ThematicDisplaySensorSettings(json);\r\n }\r\n\r\n public toJSON(): ThematicDisplaySensorSettingsProps {\r\n const json: ThematicDisplaySensorSettingsProps = {};\r\n\r\n json.sensors = [];\r\n this.sensors.forEach((sensor) => json.sensors!.push(sensor.toJSON()));\r\n\r\n json.distanceCutoff = this.distanceCutoff;\r\n\r\n return json;\r\n }\r\n}\r\n\r\n/** The thematic display mode. This determines how to apply the thematic color gradient to the geometry.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum ThematicDisplayMode {\r\n /** The color gradient will be mapped to surface geometry and point clouds based on world height in meters. */\r\n Height = 0,\r\n /** The color gradient will be mapped to surface geometry and point clouds using inverse distance weighting based on world positions and corresponding values from a list of sensors.\r\n * @note Performance will decrease as more sensors are added.\r\n */\r\n InverseDistanceWeightedSensors = 1,\r\n /** The color gradient will be mapped to surface geometry based on the slope of the surface. The slope value is calculated based on the angle between the surface and the axis specified in the associated [[ThematicDisplay]] object.\r\n * @note This display mode does not affect point clouds.\r\n */\r\n Slope = 2,\r\n /** The color gradient will be mapped to surface geometry based on the direction of a sun shining on the surface.\r\n * @note This display mode does not affect point clouds.\r\n */\r\n HillShade = 3,\r\n}\r\n\r\n/** JSON representation of the thematic display setup of a [[DisplayStyle3d]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ThematicDisplayProps {\r\n /** The thematic display mode. This determines how to apply the thematic color gradient to the geometry. Defaults to [[ThematicDisplayMode.Height]]. */\r\n displayMode?: ThematicDisplayMode;\r\n /** The settings used to create a color gradient applied to the geometry. Defaults to an instantiation using [[ThematicGradientSettings.fromJSON]] with no arguments. */\r\n gradientSettings?: ThematicGradientSettingsProps;\r\n /** The range to use when applying the thematic gradient for height and slope mode.\r\n * For [[ThematicDisplayMode.Height]], this is world space in meters and represents the range in which to apply the gradient along the specified axis.\r\n * For [[ThematicDisplayMode.Slope]], this is a range in degrees with a minimum low value of 0 degrees and a maximum high value of 90 degrees.\r\n * Defaults to a null range.\r\n */\r\n range?: Range1dProps;\r\n /** For [[ThematicDisplayMode.Height]], this is the axis along which to apply the thematic gradient in the scene. For [[ThematicDisplayMode.Slope]], calculating the slope of a surface is done in relation to the axis. Defaults to {0,0,0}. */\r\n axis?: XYZProps;\r\n /** For [[ThematicDisplayMode.HillShade]], this is the direction of the sun in world space. Defaults to {0,0,0}. */\r\n sunDirection?: XYZProps;\r\n /** For [[ThematicDisplayMode.InverseDistanceWeightedSensors]], these are the settings that control the sensors. Defaults to an instantiation using [[ThematicDisplaySensorSettings.fromJSON]] with no arguments.\r\n * @public\r\n */\r\n sensorSettings?: ThematicDisplaySensorSettingsProps;\r\n}\r\n\r\n/** The thematic display setup of a [[DisplayStyle3d]].\r\n * Thematic display allows a user to colorize a scene using a color gradient in a way that provides a visual cue about certain attributes of the rendered geometry. This scene colorization will be done based on certain geometric attributes like height, surface slope, position of surfaces relative to a sun position, or geometric position relative to a list of sensors.\r\n * The documentation for [[ThematicDisplayMode]] describes how each mode colorizes the scene.\r\n * @note Applying thematic display to geometry prevents shadows from applying to the same geometry.\r\n * @public\r\n */\r\nexport class ThematicDisplay {\r\n /** The thematic display mode. This determines how to apply the thematic color gradient to the geometry. Defaults to [[ThematicDisplayMode.Height]]. */\r\n public readonly displayMode: ThematicDisplayMode;\r\n /** The settings used to create a color gradient applied to the geometry. Defaults to an instantiation using [[ThematicGradientSettings.fromJSON]] with no arguments. */\r\n public readonly gradientSettings: ThematicGradientSettings;\r\n /** The range to use when applying the thematic gradient for height and slope mode.\r\n * For [[ThematicDisplayMode.Height]], this is world space in meters and represents the range in which to apply the gradient along the specified axis.\r\n * For [[ThematicDisplayMode.Slope]], this is a range in radians with a minimum low value of 0 degrees and a maximum high value of 90 degrees.\r\n * Defaults to a null range.\r\n */\r\n public readonly range: Range1d;\r\n /** For [[ThematicDisplayMode.Height]], this is the axis along which to apply the thematic gradient in the scene. For [[ThematicDisplayMode.Slope]], the slope of a surface is calculated in relation to this axis. Defaults to {0,0,0}. */\r\n public readonly axis: Vector3d;\r\n /** For [[ThematicDisplayMode.HillShade]], this is the direction of the sun in world space. Defaults to {0,0,0}. */\r\n public readonly sunDirection: Vector3d;\r\n /** For [[ThematicDisplayMode.InverseDistanceWeightedSensors]], these are the settings that control the sensors. Defaults to an instantiation using [[ThematicDisplaySensorSettings.fromJSON]] with no arguments.\r\n * @public\r\n */\r\n public readonly sensorSettings: ThematicDisplaySensorSettings;\r\n\r\n public equals(other: ThematicDisplay): boolean {\r\n if (this.displayMode !== other.displayMode)\r\n return false;\r\n if (!this.gradientSettings.equals(other.gradientSettings))\r\n return false;\r\n if (!this.range.isAlmostEqual(other.range))\r\n return false;\r\n if (!this.axis.isAlmostEqual(other.axis))\r\n return false;\r\n if (!this.sunDirection.isAlmostEqual(other.sunDirection))\r\n return false;\r\n if (!this.sensorSettings.equals(other.sensorSettings))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n private constructor(json?: ThematicDisplayProps) {\r\n if (undefined === json) {\r\n this.displayMode = ThematicDisplayMode.Height;\r\n this.gradientSettings = ThematicGradientSettings.fromJSON();\r\n this.axis = Vector3d.fromJSON();\r\n this.range = Range1d.fromJSON();\r\n this.sunDirection = Vector3d.fromJSON();\r\n this.sensorSettings = ThematicDisplaySensorSettings.fromJSON();\r\n } else {\r\n this.displayMode = (json.displayMode !== undefined && json.displayMode !== null) ? json.displayMode : ThematicDisplayMode.Height;\r\n if (this.displayMode < ThematicDisplayMode.Height || this.displayMode > ThematicDisplayMode.HillShade)\r\n this.displayMode = ThematicDisplayMode.Height;\r\n this.gradientSettings = ThematicGradientSettings.fromJSON(json.gradientSettings);\r\n this.axis = Vector3d.fromJSON(json.axis);\r\n this.range = Range1d.fromJSON(json.range);\r\n this.sunDirection = Vector3d.fromJSON(json.sunDirection);\r\n this.sensorSettings = ThematicDisplaySensorSettings.fromJSON(json.sensorSettings);\r\n }\r\n if (ThematicDisplayMode.Height !== this.displayMode) {\r\n // Disallow isoline and stepped-with-delimiter gradient modes in any mode other than height.\r\n if (ThematicGradientMode.IsoLines === this.gradientSettings.mode || ThematicGradientMode.SteppedWithDelimiter === this.gradientSettings.mode) {\r\n const gradientSettingsJSON = this.gradientSettings.toJSON();\r\n gradientSettingsJSON.mode = ThematicGradientMode.Smooth;\r\n this.gradientSettings = ThematicGradientSettings.fromJSON(gradientSettingsJSON);\r\n }\r\n if (ThematicDisplayMode.Slope === this.displayMode) {\r\n if (this.range.low < 0.0)\r\n this.range.low = 0.0;\r\n if (this.range.high > 90.0)\r\n this.range.high = 90.0;\r\n }\r\n }\r\n }\r\n\r\n public static fromJSON(json?: ThematicDisplayProps) {\r\n return new ThematicDisplay(json);\r\n }\r\n\r\n public toJSON(): ThematicDisplayProps {\r\n const json: ThematicDisplayProps = {\r\n displayMode: this.displayMode,\r\n gradientSettings: this.gradientSettings.toJSON(),\r\n axis: this.axis.toJSON(),\r\n sunDirection: this.sunDirection.toJSON(),\r\n range: this.range.toJSON(),\r\n };\r\n\r\n if (this.sensorSettings.sensors.length > 0)\r\n json.sensorSettings = this.sensorSettings.toJSON();\r\n\r\n return json;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ThematicDisplay.js","sourceRoot":"","sources":["../../src/ThematicDisplay.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;A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I,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;aAC1B;SACF;IACH,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,IAA2B;QAChD,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAEM,MAAM;QACX,MAAM,IAAI,GAAyB;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;YAChD,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACxB,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YACxC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;SAC3B,CAAC;QAEF,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;YACxC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;QAErD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","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 Symbology\r\n */\r\n\r\nimport { compareNumbers } from \"@itwin/core-bentley\";\r\nimport { Point3d, Range1d, Range1dProps, Vector3d, XYZProps } from \"@itwin/core-geometry\";\r\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\r\nimport { Gradient } from \"./Gradient\";\r\nimport { TextureTransparency } from \"./TextureProps\";\r\n\r\n/** A thematic gradient mode used to generate and apply a thematic effect to a scene.\r\n * @see [[ThematicGradientSettings.mode]]\r\n * @public\r\n * @extensions\r\n */\r\nexport enum ThematicGradientMode {\r\n /** Apply a smooth color gradient to the scene. */\r\n Smooth = 0,\r\n /** Apply a stepped color gradient to the scene. */\r\n Stepped = 1,\r\n /** Apply a stepped color gradient to the scene with delimiters (lines between the color steps). Can only be used with [[ThematicDisplayMode.Height]]. */\r\n SteppedWithDelimiter = 2,\r\n /** Apply isolines to the scene to achieve an effect similar to a contour map. Can only be used with [[ThematicDisplayMode.Height]]. */\r\n IsoLines = 3,\r\n}\r\n\r\n/** Describes how transparency is computed when applying a thematic gradient to a surface.\r\n * Each [[Gradient.KeyColor]] in [[ThematicGradientSettings.customKeys]] has a transparency value.\r\n * Each surface to which the gradient is applied has its own transparency.\r\n * The transparency mode determines how these two values are combined to compute the final transparency.\r\n * @see [[ThematicGradientSettings.transparencyMode]].\r\n * @public\r\n * @extensions\r\n */\r\nexport enum ThematicGradientTransparencyMode {\r\n /** Ignore the gradient's transparency, applying only the surface's own transparency. */\r\n SurfaceOnly = 0,\r\n /** The final transparency is computed from the product of the surface and gradient alpha channels.\r\n * (Alpha is the inverse of transparency, where `alpha = (255 - transparency) / 255`).\r\n * If the gradient color is opaque, this produces the same result as [[SurfaceOnly]].\r\n */\r\n MultiplySurfaceAndGradient = 1,\r\n}\r\n\r\n/** A color scheme used to generate the colors of a thematic gradient within an applied range.\r\n * @see [[ThematicGradientSettings.colorScheme]]\r\n * @see [[ThematicDisplay.range]]\r\n * @public\r\n * @extensions\r\n */\r\nexport enum ThematicGradientColorScheme {\r\n /** A color gradient scheme that represents a blue-to-red gradation. */\r\n BlueRed = 0,\r\n /** A color gradient scheme that represents a red-to-blue gradation. */\r\n RedBlue = 1,\r\n /** A color gradient scheme that represents a monochrome (black-to-white) gradation. */\r\n Monochrome = 2,\r\n /** A color gradient scheme that suits a topographic gradation. */\r\n Topographic = 3,\r\n /** A color gradient scheme that suits a sea-mountain gradation. */\r\n SeaMountain = 4,\r\n /** A custom color gradient scheme configured by the user.\r\n * @see [[ThematicGradientSettings.customKeys]]\r\n */\r\n Custom = 5,\r\n}\r\n\r\n/** JSON representation of a [[ThematicGradientSettings]].\r\n * @public\r\n * @extensions\r\n **/\r\nexport interface ThematicGradientSettingsProps {\r\n /** See [[ThematicGradientSettings.mode]]. */\r\n mode?: ThematicGradientMode;\r\n /** See [[ThematicGradientSettings.stepCount]]. */\r\n stepCount?: number;\r\n /** See [[ThematicGradientSettings.marginColor]]. */\r\n marginColor?: ColorDefProps;\r\n /** See [[ThematicGradientSettings.colorScheme]]. */\r\n colorScheme?: ThematicGradientColorScheme;\r\n /** See [[ThematicGradientSettings.customKeys. */\r\n customKeys?: Gradient.KeyColorProps[];\r\n /** See [[ThematicGradientSettings.colorMix]]. */\r\n colorMix?: number;\r\n /** See [[ThematicGradientSettings.transparencyMode]]. */\r\n transparencyMode?: ThematicGradientTransparencyMode;\r\n}\r\n\r\n/** Thematic settings specific to creating a color gradient used by [[ThematicDisplay]].\r\n * @public\r\n */\r\nexport class ThematicGradientSettings {\r\n /** The thematic image mode used to generate the gradient. Defaults to [[ThematicGradientMode.Smooth]]. */\r\n public readonly mode: ThematicGradientMode;\r\n /** The step count value used for [[ThematicGradientMode.Stepped]], [[ThematicGradientMode.SteppedWithDelimiter]], and [[ThematicGradientMode.IsoLines]]. Defaults to 10. Cannot be less than 2. */\r\n public readonly stepCount: number;\r\n /** The margin color used at the extremes of the gradient, when outside the applied range. Defaults to a black color using [[ColorDef.fromJSON]] with no arguments. */\r\n public readonly marginColor: ColorDef;\r\n /** The color scheme used to generate the colors of the gradient color within the applied range. Defaults to [[ThematicGradientColorScheme.BlueRed]]. */\r\n public readonly colorScheme: ThematicGradientColorScheme;\r\n /** The key color values that must be provided when using a custom thematic color scheme.\r\n * Defaults to empty, unless using a custom thematic color scheme. In that case, this defaults to two key colors going from white to black.\r\n * When using a custom thematic color scheme, there must be at least two entries in here. If there are not, it will revert to the default settings.\r\n */\r\n public readonly customKeys: Gradient.KeyColor[];\r\n /** The percentage to mix in the original color with the thematic display gradient color (0-1).\r\n * Applies to background map terrain and point clouds only. Defaults to 0. */\r\n public readonly colorMix: number;\r\n /** Specifies how the transparency is computed. Defaults to [[ThematicGradientTransparencyMode.SurfaceOnly]].\r\n * @note This property is ignored for gradients applied using an [[AnalysisStyle]] via [[AnalysisStyleThematic]] - in that case, only the color and\r\n * transparency of the thematic gradient are applied.\r\n */\r\n public readonly transparencyMode: ThematicGradientTransparencyMode;\r\n\r\n public static get margin(): number { return .001; } // A fixed portion of the gradient for out of range values.\r\n public static get contentRange(): number { return 1.0 - 2.0 * ThematicGradientSettings.margin; }\r\n public static get contentMax(): number { return 1.0 - ThematicGradientSettings.margin; }\r\n\r\n public static readonly defaults = new ThematicGradientSettings({});\r\n\r\n private static _defaultCustomKeys = [[0.0, 255, 255, 255], [1.0, 0, 0, 0]];\r\n\r\n /** @alpha */\r\n public get textureTransparency(): TextureTransparency {\r\n let transp = TextureTransparency.Opaque;\r\n if (ThematicGradientColorScheme.Custom === this.colorScheme) {\r\n let haveOpaque = false;\r\n let haveTransparent = false;\r\n for (const key of this.customKeys) {\r\n const isOpaque = key.color.isOpaque;\r\n haveOpaque = haveOpaque || isOpaque;\r\n haveTransparent = haveTransparent || !isOpaque;\r\n }\r\n\r\n if (haveTransparent)\r\n transp = haveOpaque ? TextureTransparency.Mixed : TextureTransparency.Translucent;\r\n }\r\n\r\n if (transp !== TextureTransparency.Mixed)\r\n if (this.marginColor.isOpaque !== (transp === TextureTransparency.Opaque))\r\n transp = TextureTransparency.Mixed;\r\n\r\n return transp;\r\n }\r\n\r\n public equals(other: ThematicGradientSettings): boolean {\r\n if (this.mode !== other.mode || this.stepCount !== other.stepCount || !this.marginColor.equals(other.marginColor)\r\n || this.colorScheme !== other.colorScheme || this.customKeys.length !== other.customKeys.length\r\n || this.colorMix !== other.colorMix || this.transparencyMode !== other.transparencyMode) {\r\n return false;\r\n }\r\n\r\n return this.customKeys.every((key, index) => Gradient.keyColorEquals(key, other.customKeys[index]));\r\n }\r\n\r\n /** Compares two sets of thematic gradient settings.\r\n * @param lhs First set of thematic gradient settings to compare\r\n * @param rhs Second set of thematic gradient settings to compare\r\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.\r\n */\r\n public static compare(lhs: ThematicGradientSettings, rhs: ThematicGradientSettings): number {\r\n let diff = 0;\r\n if ((diff = compareNumbers(lhs.mode, rhs.mode)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.stepCount, rhs.stepCount)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.marginColor.tbgr, rhs.marginColor.tbgr)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.colorScheme, rhs.colorScheme)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.colorMix, rhs.colorMix)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.customKeys.length, rhs.customKeys.length)) !== 0)\r\n return diff;\r\n if ((diff = compareNumbers(lhs.transparencyMode, rhs.transparencyMode)) !== 0)\r\n return diff;\r\n\r\n for (let i = 0; i < lhs.customKeys.length; i++)\r\n if ((diff = compareNumbers(lhs.customKeys[i].color.tbgr, rhs.customKeys[i].color.tbgr)) !== 0)\r\n return diff;\r\n\r\n return diff;\r\n }\r\n\r\n private constructor(json?: ThematicGradientSettingsProps) {\r\n this.customKeys = [];\r\n if (undefined === json) {\r\n this.mode = ThematicGradientMode.Smooth;\r\n this.stepCount = 10;\r\n this.marginColor = ColorDef.fromJSON();\r\n this.colorScheme = ThematicGradientColorScheme.BlueRed;\r\n this.colorMix = 0.0;\r\n this.transparencyMode = ThematicGradientTransparencyMode.SurfaceOnly;\r\n } else {\r\n this.mode = (json.mode !== undefined && json.mode !== null) ? json.mode : ThematicGradientMode.Smooth;\r\n if (this.mode < ThematicGradientMode.Smooth || this.mode > ThematicGradientMode.IsoLines)\r\n this.mode = ThematicGradientMode.Smooth;\r\n\r\n this.stepCount = (typeof json.stepCount === \"number\") ? json.stepCount : 10;\r\n if (this.stepCount < 2)\r\n this.stepCount = 2;\r\n\r\n this.marginColor = ColorDef.fromJSON(json.marginColor);\r\n\r\n this.colorScheme = (json.colorScheme !== undefined && json.colorScheme !== null) ? json.colorScheme : ThematicGradientColorScheme.BlueRed;\r\n if (this.colorScheme < ThematicGradientColorScheme.BlueRed || this.colorScheme > ThematicGradientColorScheme.Custom)\r\n this.colorScheme = ThematicGradientColorScheme.BlueRed;\r\n\r\n if (json.customKeys !== undefined && json.customKeys !== null)\r\n json.customKeys.forEach((key) => this.customKeys.push(new Gradient.KeyColor(key)));\r\n\r\n // Enforce 2 entries in custom color keys if violated\r\n if (this.colorScheme === ThematicGradientColorScheme.Custom && this.customKeys.length < 2) {\r\n this.customKeys = [];\r\n for (const keyValue of ThematicGradientSettings._defaultCustomKeys)\r\n this.customKeys.push(new Gradient.KeyColor({ value: keyValue[0], color: ColorDef.computeTbgrFromComponents(keyValue[1], keyValue[3], keyValue[2]) }));\r\n }\r\n\r\n this.colorMix = json.colorMix ?? 0.0;\r\n this.transparencyMode = json.transparencyMode ?? ThematicGradientTransparencyMode.SurfaceOnly;\r\n }\r\n }\r\n\r\n public static fromJSON(json?: ThematicGradientSettingsProps) {\r\n return json ? new ThematicGradientSettings(json) : this.defaults;\r\n }\r\n\r\n public toJSON(): ThematicGradientSettingsProps {\r\n const props: ThematicGradientSettingsProps = {};\r\n if (ThematicGradientMode.Smooth !== this.mode)\r\n props.mode = this.mode;\r\n\r\n if (10 !== this.stepCount)\r\n props.stepCount = this.stepCount;\r\n\r\n const marginColor = this.marginColor.toJSON();\r\n if (0 !== marginColor)\r\n props.marginColor = marginColor;\r\n\r\n if (ThematicGradientColorScheme.BlueRed !== this.colorScheme)\r\n props.colorScheme = this.colorScheme;\r\n\r\n if (0 !== this.colorMix)\r\n props.colorMix = this.colorMix;\r\n\r\n if (ThematicGradientTransparencyMode.SurfaceOnly !== this.transparencyMode)\r\n props.transparencyMode = this.transparencyMode;\r\n\r\n if (this.customKeys.length > 0)\r\n props.customKeys = this.customKeys.map((key) => { return { value: key.value, color: key.color.toJSON() }; });\r\n\r\n return props;\r\n }\r\n\r\n /** Create a copy of this ThematicGradientSettings, optionally modifying some of its properties.\r\n * @param changedProps JSON representation of the properties to change.\r\n * @returns A ThematicGradientSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\r\n */\r\n public clone(changedProps?: ThematicGradientSettingsProps): ThematicGradientSettings {\r\n if (undefined === changedProps)\r\n return ThematicGradientSettings.fromJSON(this.toJSON());\r\n\r\n const props: ThematicGradientSettingsProps = {\r\n mode: undefined !== changedProps.mode ? changedProps.mode : this.mode,\r\n stepCount: undefined !== changedProps.stepCount ? changedProps.stepCount : this.stepCount,\r\n marginColor: undefined !== changedProps.marginColor ? changedProps.marginColor : this.marginColor.tbgr,\r\n colorScheme: undefined !== changedProps.colorScheme ? changedProps.colorScheme : this.colorScheme,\r\n customKeys: undefined !== changedProps.customKeys ? changedProps.customKeys : this.customKeys.map((key) => ({ value: key.value, color: key.color.tbgr })),\r\n colorMix: undefined !== changedProps.colorMix ? changedProps.colorMix : this.colorMix,\r\n transparencyMode: changedProps.transparencyMode ?? this.transparencyMode,\r\n };\r\n\r\n return ThematicGradientSettings.fromJSON(props);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[ThematicDisplaySensor]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ThematicDisplaySensorProps {\r\n /** The world position of the sensor in X, Y, and Z. Defaults to {0,0,0}. */\r\n position?: XYZProps;\r\n /** The value of the sensor used when accessing the thematic gradient texture; expected range is 0 to 1. Defaults to 0. */\r\n value?: number;\r\n}\r\n\r\n/** A sensor in world space, used for [[ThematicDisplayMode.InverseDistanceWeightedSensors]].\r\n * @public\r\n */\r\nexport class ThematicDisplaySensor {\r\n /** The world position of the sensor in X, Y, and Z. Defaults to {0,0,0}. */\r\n public position: Readonly<Point3d>;\r\n /** The value of the sensor used when accessing the thematic gradient texture; expected range is 0 to 1. Defaults to 0. */\r\n public readonly value: number;\r\n\r\n private constructor(json?: ThematicDisplaySensorProps) {\r\n if (undefined === json) {\r\n this.position = Point3d.fromJSON();\r\n this.value = 0;\r\n } else {\r\n this.position = Point3d.fromJSON(json.position);\r\n this.value = (typeof json.value !== \"number\") ? 0 : json.value;\r\n if (this.value < 0)\r\n this.value = 0;\r\n else if (this.value > 1)\r\n this.value = 1;\r\n }\r\n }\r\n\r\n public equals(other: ThematicDisplaySensor): boolean {\r\n return (this.value === other.value) && this.position.isAlmostEqual(other.position);\r\n }\r\n\r\n public static fromJSON(json?: ThematicDisplaySensorProps) {\r\n return new ThematicDisplaySensor(json);\r\n }\r\n\r\n public toJSON(): ThematicDisplaySensorProps {\r\n return {\r\n position: this.position.toJSON(),\r\n value: this.value,\r\n };\r\n }\r\n}\r\n\r\n/** JSON representation of a [[ThematicDisplaySensorSettings]] for [[ThematicDisplayMode.InverseDistanceWeightedSensors]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ThematicDisplaySensorSettingsProps {\r\n /** This is the list of sensors. Defaults to an empty array. */\r\n sensors?: ThematicDisplaySensorProps[];\r\n /** This is the distance cutoff in meters. For a position on screen to be affected by a sensor, it must be at least this close to the sensor.\r\n * If this is zero or negative, then no distance cutoff is applied (all sensors affect all positions regardless of nearness).\r\n * Defaults to zero.\r\n * @note Using a suitable distance cutoff imparts a significant performance benefit. The larger this value becomes, performance will degrade.\r\n */\r\n distanceCutoff?: number;\r\n}\r\n\r\n/** Settings for sensor-based thematic display for [[ThematicDisplayMode.InverseDistanceWeightedSensors]].\r\n * @public\r\n */\r\nexport class ThematicDisplaySensorSettings {\r\n /** This is the list of sensors. Defaults to an empty array. */\r\n public readonly sensors: ThematicDisplaySensor[];\r\n /** This is the distance cutoff in meters. For a position on screen to be affected by a sensor, it must be at least this close to the sensor.\r\n * If this is zero or negative, then no distance cutoff is applied (all sensors affect all positions regardless of nearness).\r\n * Defaults to zero.\r\n * @note Using a suitable distance cutoff imparts a significant performance benefit. The larger this value becomes, performance will degrade.\r\n */\r\n public readonly distanceCutoff: number;\r\n\r\n private constructor(json?: ThematicDisplaySensorSettingsProps) {\r\n this.sensors = [];\r\n if (undefined !== json) {\r\n if (json.sensors !== undefined && json.sensors !== null) {\r\n json.sensors.forEach((sensorJSON) => this.sensors.push(ThematicDisplaySensor.fromJSON(sensorJSON)));\r\n }\r\n this.distanceCutoff = (typeof json.distanceCutoff === \"number\") ? json.distanceCutoff : 0;\r\n } else {\r\n this.distanceCutoff = 0;\r\n }\r\n }\r\n\r\n public equals(other: ThematicDisplaySensorSettings): boolean {\r\n if (this.distanceCutoff !== other.distanceCutoff)\r\n return false;\r\n\r\n const thisSensors = this.sensors;\r\n const otherSensors = other.sensors;\r\n\r\n if (thisSensors.length !== otherSensors.length)\r\n return false;\r\n\r\n for (let i = 0; i < thisSensors.length; i++) {\r\n if (!thisSensors[i].equals(otherSensors[i]))\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public static fromJSON(json?: ThematicDisplaySensorSettingsProps) {\r\n return new ThematicDisplaySensorSettings(json);\r\n }\r\n\r\n public toJSON(): ThematicDisplaySensorSettingsProps {\r\n const json: ThematicDisplaySensorSettingsProps = {};\r\n\r\n json.sensors = [];\r\n this.sensors.forEach((sensor) => json.sensors!.push(sensor.toJSON()));\r\n\r\n json.distanceCutoff = this.distanceCutoff;\r\n\r\n return json;\r\n }\r\n}\r\n\r\n/** The thematic display mode. This determines how to apply the thematic color gradient to the geometry.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum ThematicDisplayMode {\r\n /** The color gradient will be mapped to surface geometry and point clouds based on world height in meters. */\r\n Height = 0,\r\n /** The color gradient will be mapped to surface geometry and point clouds using inverse distance weighting based on world positions and corresponding values from a list of sensors.\r\n * @note Performance will decrease as more sensors are added.\r\n */\r\n InverseDistanceWeightedSensors = 1,\r\n /** The color gradient will be mapped to surface geometry based on the slope of the surface. The slope value is calculated based on the angle between the surface and the axis specified in the associated [[ThematicDisplay]] object.\r\n * @note This display mode does not affect point clouds.\r\n */\r\n Slope = 2,\r\n /** The color gradient will be mapped to surface geometry based on the direction of a sun shining on the surface.\r\n * @note This display mode does not affect point clouds.\r\n */\r\n HillShade = 3,\r\n}\r\n\r\n/** JSON representation of the thematic display setup of a [[DisplayStyle3d]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ThematicDisplayProps {\r\n /** The thematic display mode. This determines how to apply the thematic color gradient to the geometry. Defaults to [[ThematicDisplayMode.Height]]. */\r\n displayMode?: ThematicDisplayMode;\r\n /** The settings used to create a color gradient applied to the geometry. Defaults to an instantiation using [[ThematicGradientSettings.fromJSON]] with no arguments. */\r\n gradientSettings?: ThematicGradientSettingsProps;\r\n /** The range to use when applying the thematic gradient for height and slope mode.\r\n * For [[ThematicDisplayMode.Height]], this is world space in meters and represents the range in which to apply the gradient along the specified axis.\r\n * For [[ThematicDisplayMode.Slope]], this is a range in degrees with a minimum low value of 0 degrees and a maximum high value of 90 degrees.\r\n * Defaults to a null range.\r\n */\r\n range?: Range1dProps;\r\n /** For [[ThematicDisplayMode.Height]], this is the axis along which to apply the thematic gradient in the scene. For [[ThematicDisplayMode.Slope]], calculating the slope of a surface is done in relation to the axis. Defaults to {0,0,0}. */\r\n axis?: XYZProps;\r\n /** For [[ThematicDisplayMode.HillShade]], this is the direction of the sun in world space. Defaults to {0,0,0}. */\r\n sunDirection?: XYZProps;\r\n /** For [[ThematicDisplayMode.InverseDistanceWeightedSensors]], these are the settings that control the sensors. Defaults to an instantiation using [[ThematicDisplaySensorSettings.fromJSON]] with no arguments.\r\n * @public\r\n */\r\n sensorSettings?: ThematicDisplaySensorSettingsProps;\r\n}\r\n\r\n/** The thematic display setup of a [[DisplayStyle3d]].\r\n * Thematic display allows a user to colorize a scene using a color gradient in a way that provides a visual cue about certain attributes of the rendered geometry. This scene colorization will be done based on certain geometric attributes like height, surface slope, position of surfaces relative to a sun position, or geometric position relative to a list of sensors.\r\n * The documentation for [[ThematicDisplayMode]] describes how each mode colorizes the scene.\r\n * @note Applying thematic display to geometry prevents shadows from applying to the same geometry.\r\n * @public\r\n */\r\nexport class ThematicDisplay {\r\n /** The thematic display mode. This determines how to apply the thematic color gradient to the geometry. Defaults to [[ThematicDisplayMode.Height]]. */\r\n public readonly displayMode: ThematicDisplayMode;\r\n /** The settings used to create a color gradient applied to the geometry. Defaults to an instantiation using [[ThematicGradientSettings.fromJSON]] with no arguments. */\r\n public readonly gradientSettings: ThematicGradientSettings;\r\n /** The range to use when applying the thematic gradient for height and slope mode.\r\n * For [[ThematicDisplayMode.Height]], this is world space in meters and represents the range in which to apply the gradient along the specified axis.\r\n * For [[ThematicDisplayMode.Slope]], this is a range in radians with a minimum low value of 0 degrees and a maximum high value of 90 degrees.\r\n * Defaults to a null range.\r\n */\r\n public readonly range: Range1d;\r\n /** For [[ThematicDisplayMode.Height]], this is the axis along which to apply the thematic gradient in the scene. For [[ThematicDisplayMode.Slope]], the slope of a surface is calculated in relation to this axis. Defaults to {0,0,0}. */\r\n public readonly axis: Vector3d;\r\n /** For [[ThematicDisplayMode.HillShade]], this is the direction of the sun in world space. Defaults to {0,0,0}. */\r\n public readonly sunDirection: Vector3d;\r\n /** For [[ThematicDisplayMode.InverseDistanceWeightedSensors]], these are the settings that control the sensors. Defaults to an instantiation using [[ThematicDisplaySensorSettings.fromJSON]] with no arguments.\r\n * @public\r\n */\r\n public readonly sensorSettings: ThematicDisplaySensorSettings;\r\n\r\n public equals(other: ThematicDisplay): boolean {\r\n if (this.displayMode !== other.displayMode)\r\n return false;\r\n if (!this.gradientSettings.equals(other.gradientSettings))\r\n return false;\r\n if (!this.range.isAlmostEqual(other.range))\r\n return false;\r\n if (!this.axis.isAlmostEqual(other.axis))\r\n return false;\r\n if (!this.sunDirection.isAlmostEqual(other.sunDirection))\r\n return false;\r\n if (!this.sensorSettings.equals(other.sensorSettings))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n private constructor(json?: ThematicDisplayProps) {\r\n if (undefined === json) {\r\n this.displayMode = ThematicDisplayMode.Height;\r\n this.gradientSettings = ThematicGradientSettings.fromJSON();\r\n this.axis = Vector3d.fromJSON();\r\n this.range = Range1d.fromJSON();\r\n this.sunDirection = Vector3d.fromJSON();\r\n this.sensorSettings = ThematicDisplaySensorSettings.fromJSON();\r\n } else {\r\n this.displayMode = (json.displayMode !== undefined && json.displayMode !== null) ? json.displayMode : ThematicDisplayMode.Height;\r\n if (this.displayMode < ThematicDisplayMode.Height || this.displayMode > ThematicDisplayMode.HillShade)\r\n this.displayMode = ThematicDisplayMode.Height;\r\n this.gradientSettings = ThematicGradientSettings.fromJSON(json.gradientSettings);\r\n this.axis = Vector3d.fromJSON(json.axis);\r\n this.range = Range1d.fromJSON(json.range);\r\n this.sunDirection = Vector3d.fromJSON(json.sunDirection);\r\n this.sensorSettings = ThematicDisplaySensorSettings.fromJSON(json.sensorSettings);\r\n }\r\n if (ThematicDisplayMode.Height !== this.displayMode) {\r\n // Disallow isoline and stepped-with-delimiter gradient modes in any mode other than height.\r\n if (ThematicGradientMode.IsoLines === this.gradientSettings.mode || ThematicGradientMode.SteppedWithDelimiter === this.gradientSettings.mode) {\r\n const gradientSettingsJSON = this.gradientSettings.toJSON();\r\n gradientSettingsJSON.mode = ThematicGradientMode.Smooth;\r\n this.gradientSettings = ThematicGradientSettings.fromJSON(gradientSettingsJSON);\r\n }\r\n if (ThematicDisplayMode.Slope === this.displayMode) {\r\n if (this.range.low < 0.0)\r\n this.range.low = 0.0;\r\n if (this.range.high > 90.0)\r\n this.range.high = 90.0;\r\n }\r\n }\r\n }\r\n\r\n public static fromJSON(json?: ThematicDisplayProps) {\r\n return new ThematicDisplay(json);\r\n }\r\n\r\n public toJSON(): ThematicDisplayProps {\r\n const json: ThematicDisplayProps = {\r\n displayMode: this.displayMode,\r\n gradientSettings: this.gradientSettings.toJSON(),\r\n axis: this.axis.toJSON(),\r\n sunDirection: this.sunDirection.toJSON(),\r\n range: this.range.toJSON(),\r\n };\r\n\r\n if (this.sensorSettings.sensors.length > 0)\r\n json.sensorSettings = this.sensorSettings.toJSON();\r\n\r\n return json;\r\n }\r\n}\r\n"]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @module RpcInterface
|
|
3
3
|
*/
|
|
4
4
|
/// <reference types="node" />
|
|
5
|
+
/// <reference types="node" />
|
|
5
6
|
import { BackendReadable, BackendWritable } from "../../BackendTypes";
|
|
6
7
|
import { RpcConfiguration } from "../core/RpcConfiguration";
|
|
7
8
|
import { RpcContentType, RpcRequestStatus } from "../core/RpcConstants";
|
|
@@ -27,6 +28,7 @@ export interface HttpServerRequest extends BackendReadable {
|
|
|
27
28
|
trailers: {
|
|
28
29
|
[key: string]: string | undefined;
|
|
29
30
|
};
|
|
31
|
+
trailersDistinct: NodeJS.Dict<string[]>;
|
|
30
32
|
rawTrailers: string[];
|
|
31
33
|
setTimeout(msecs: number, callback: () => void): void;
|
|
32
34
|
setTimeout(msecs: number, callback: () => void): this;
|
|
@@ -40,6 +42,7 @@ export interface HttpServerRequest extends BackendReadable {
|
|
|
40
42
|
method: string;
|
|
41
43
|
ip?: string;
|
|
42
44
|
header: (field: string) => string | undefined;
|
|
45
|
+
headersDistinct: NodeJS.Dict<string[]>;
|
|
43
46
|
}
|
|
44
47
|
/** An HTTP server response object.
|
|
45
48
|
* @public
|