@itwin/core-common 4.3.0-dev.9 → 4.3.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 +55 -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
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
# Change Log - @itwin/core-common
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 13 Dec 2023 17:25:55 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.3.1
|
|
6
|
+
Wed, 13 Dec 2023 17:25:55 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 4.3.0
|
|
11
|
+
Thu, 07 Dec 2023 17:43:09 GMT
|
|
12
|
+
|
|
13
|
+
### Updates
|
|
14
|
+
|
|
15
|
+
- Add tests for `QueryBinder`.
|
|
16
|
+
- Added support for recoloring geometry intersecting a clip volume
|
|
17
|
+
- Custom query parameters can now be configured on map layer objects.
|
|
18
|
+
- Add support for transparency in thematic display gradient.
|
|
19
|
+
|
|
20
|
+
## 4.2.4
|
|
21
|
+
Mon, 20 Nov 2023 16:14:45 GMT
|
|
22
|
+
|
|
23
|
+
_Version update only_
|
|
24
|
+
|
|
25
|
+
## 4.2.3
|
|
26
|
+
Mon, 06 Nov 2023 14:01:52 GMT
|
|
27
|
+
|
|
28
|
+
_Version update only_
|
|
29
|
+
|
|
30
|
+
## 4.2.2
|
|
31
|
+
Thu, 02 Nov 2023 15:36:20 GMT
|
|
32
|
+
|
|
33
|
+
_Version update only_
|
|
34
|
+
|
|
35
|
+
## 4.2.1
|
|
36
|
+
Tue, 24 Oct 2023 15:09:13 GMT
|
|
37
|
+
|
|
38
|
+
_Version update only_
|
|
39
|
+
|
|
40
|
+
## 4.2.0
|
|
41
|
+
Tue, 17 Oct 2023 15:14:32 GMT
|
|
42
|
+
|
|
43
|
+
### Updates
|
|
44
|
+
|
|
45
|
+
- Add ECSqlExpr api
|
|
46
|
+
- ECSqlReader is now public
|
|
47
|
+
- ECSqlReader.formatCurrentRow and ECSqlReader.getRowInternal are now internal
|
|
4
48
|
|
|
5
49
|
## 4.1.9
|
|
6
50
|
Tue, 10 Oct 2023 18:48:12 GMT
|
|
@@ -115,6 +159,16 @@ Mon, 22 May 2023 15:34:14 GMT
|
|
|
115
159
|
- Add interfaces representing 3d tileset schema.
|
|
116
160
|
- add Atmosphere class as a property of Environment
|
|
117
161
|
|
|
162
|
+
## 3.8.0
|
|
163
|
+
Fri, 08 Dec 2023 15:23:59 GMT
|
|
164
|
+
|
|
165
|
+
_Version update only_
|
|
166
|
+
|
|
167
|
+
## 3.7.17
|
|
168
|
+
Mon, 20 Nov 2023 18:24:23 GMT
|
|
169
|
+
|
|
170
|
+
_Version update only_
|
|
171
|
+
|
|
118
172
|
## 3.7.16
|
|
119
173
|
Mon, 16 Oct 2023 12:49:07 GMT
|
|
120
174
|
|
package/lib/cjs/ClipStyle.d.ts
CHANGED
|
@@ -40,6 +40,58 @@ export declare class CutStyle {
|
|
|
40
40
|
/** Returns true if this style matches the default style - that is, it overrides none of the view's settings. */
|
|
41
41
|
get matchesDefaults(): boolean;
|
|
42
42
|
}
|
|
43
|
+
/** Wire format describing a [[ClipIntersectionStyle]].
|
|
44
|
+
* @see [[ClipStyleProps.ClipIntersectionStyle]].
|
|
45
|
+
* @public
|
|
46
|
+
* @extensions
|
|
47
|
+
*/
|
|
48
|
+
export interface ClipIntersectionStyleProps {
|
|
49
|
+
/** Color to apply to intersection of geometry and clip planes, default white */
|
|
50
|
+
color?: RgbColorProps;
|
|
51
|
+
/** Number of pixels to be considered intersecting the clip plane, default 1 */
|
|
52
|
+
width?: number;
|
|
53
|
+
}
|
|
54
|
+
/** As part of a [[ClipStyle]], describes how to colorize geometry intersecting the clip planes.
|
|
55
|
+
* @note Edges are highlighted only if [[ClipStyle.ClipIntersectionStyle]] is `true`.
|
|
56
|
+
* @public
|
|
57
|
+
* @extensions
|
|
58
|
+
*/
|
|
59
|
+
export declare class ClipIntersectionStyle {
|
|
60
|
+
/** Color to apply to intersection of geometry and clip planes, default white */
|
|
61
|
+
readonly color: RgbColor;
|
|
62
|
+
/** Number of pixels to be considered intersecting the clip plane, default 1 */
|
|
63
|
+
readonly width: number;
|
|
64
|
+
private constructor();
|
|
65
|
+
/** Create a highlight from its components. */
|
|
66
|
+
static create(color?: RgbColor, width?: number): ClipIntersectionStyle;
|
|
67
|
+
static readonly defaults: ClipIntersectionStyle;
|
|
68
|
+
static fromJSON(props?: ClipIntersectionStyleProps): ClipIntersectionStyle;
|
|
69
|
+
/** The JSON representation of this style. It is `undefined` if this style matches the defaults. */
|
|
70
|
+
toJSON(): ClipIntersectionStyleProps | undefined;
|
|
71
|
+
get matchesDefaults(): boolean;
|
|
72
|
+
}
|
|
73
|
+
/** Arguments supplied to [[ClipStyle.create]].
|
|
74
|
+
* @public
|
|
75
|
+
* @extensions
|
|
76
|
+
*/
|
|
77
|
+
export interface ClipStyleCreateArgs {
|
|
78
|
+
/** If `true`, geometry will be produced at the clip planes in a 3d view.
|
|
79
|
+
* - Solids (closed volumes) will produce facets on the clip planes.
|
|
80
|
+
* - Other surfaces will produce line strings representing the edges of the surface at the clip planes.
|
|
81
|
+
* @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.
|
|
82
|
+
*/
|
|
83
|
+
produceCutGeometry?: boolean;
|
|
84
|
+
/** If `true`, intersection of geometry and clip planes will be colorized */
|
|
85
|
+
colorizeIntersection?: boolean;
|
|
86
|
+
/** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */
|
|
87
|
+
cutStyle?: CutStyle;
|
|
88
|
+
/** If defined, geometry inside the clip planes will be drawn in this color. */
|
|
89
|
+
insideColor?: RgbColor;
|
|
90
|
+
/** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */
|
|
91
|
+
outsideColor?: RgbColor;
|
|
92
|
+
/** Controls the style of the intersection of geometry and clip planes */
|
|
93
|
+
intersectionStyle?: ClipIntersectionStyle;
|
|
94
|
+
}
|
|
43
95
|
/** Wire format describing a [[ClipStyle]].
|
|
44
96
|
* @see [[DisplayStyleSettingsProps.clipStyle]].
|
|
45
97
|
* @public
|
|
@@ -52,12 +104,16 @@ export interface ClipStyleProps {
|
|
|
52
104
|
* @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.
|
|
53
105
|
*/
|
|
54
106
|
produceCutGeometry?: boolean;
|
|
107
|
+
/** If 'true', intersection of geometry and clip planes will be colorized */
|
|
108
|
+
colorizeIntersection?: boolean;
|
|
55
109
|
/** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */
|
|
56
110
|
cutStyle?: CutStyleProps;
|
|
57
111
|
/** If defined, geometry inside the clip planes will be drawn in this color. */
|
|
58
112
|
insideColor?: RgbColorProps;
|
|
59
113
|
/** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */
|
|
60
114
|
outsideColor?: RgbColorProps;
|
|
115
|
+
/** Controls the style of the intersection of geometry and clip planes */
|
|
116
|
+
intersectionStyle?: ClipIntersectionStyleProps;
|
|
61
117
|
}
|
|
62
118
|
/** Describes symbology and behavior applied to a [ClipVector]($core-geometry) when applied to a [ViewState]($frontend) or [[ModelClipGroup]].
|
|
63
119
|
* @see [[DisplayStyleSettings.clipStyle]].
|
|
@@ -70,17 +126,23 @@ export declare class ClipStyle {
|
|
|
70
126
|
* @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.
|
|
71
127
|
*/
|
|
72
128
|
readonly produceCutGeometry: boolean;
|
|
129
|
+
/** If 'true', intersection of geometry and clip planes will be colorized */
|
|
130
|
+
readonly colorizeIntersection: boolean;
|
|
73
131
|
/** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */
|
|
74
132
|
readonly cutStyle: CutStyle;
|
|
75
133
|
/** If defined, geometry inside the clip planes will be drawn in this color. */
|
|
76
134
|
readonly insideColor?: RgbColor;
|
|
77
135
|
/** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */
|
|
78
136
|
readonly outsideColor?: RgbColor;
|
|
137
|
+
/** Controls the style of the intersection of geometry and clip planes */
|
|
138
|
+
readonly intersectionStyle?: ClipIntersectionStyle;
|
|
79
139
|
/** The default style, which overrides none of the view's settings. */
|
|
80
140
|
static readonly defaults: ClipStyle;
|
|
81
141
|
private constructor();
|
|
82
|
-
/**
|
|
142
|
+
/** @deprecated in 4.x. Use [[create(style: ClipStyleCreateArgs]] */
|
|
83
143
|
static create(produceCutGeometry: boolean, cutStyle: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle;
|
|
144
|
+
/** Create a style from its components. */
|
|
145
|
+
static create(style: ClipStyleCreateArgs): ClipStyle;
|
|
84
146
|
static fromJSON(props?: ClipStyleProps): ClipStyle;
|
|
85
147
|
/** The JSON representation of this style. It is `undefined` if this style matches the defaults. */
|
|
86
148
|
toJSON(): ClipStyleProps | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipStyle.d.ts","sourceRoot":"","sources":["../../src/ClipStyle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ClipStyle.d.ts","sourceRoot":"","sources":["../../src/ClipStyle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAG/E;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,+FAA+F;IAC/F,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9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AE1D,sEAAsE;IACtE,gBAAuB,QAAQ,YAAmF;IAElH,OAAO;IASP,oEAAoE;WACtD,MAAM,CAAC,kBAAkB,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,QAAQ,GAAG,SAAS;IAEjI,0CAA0C;WAC5B,MAAM,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS;WA0B7C,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,GAAG,SAAS;IAezD,mGAAmG;IAC5F,MAAM,IAAI,cAAc,GAAG,SAAS;IA6B3C,uHAAuH;IACvH,IAAW,eAAe,IAAI,OAAO,CAKpC;CACF"}
|
package/lib/cjs/ClipStyle.js
CHANGED
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
* @module Views
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.ClipStyle = exports.CutStyle = void 0;
|
|
10
|
+
exports.ClipStyle = exports.ClipIntersectionStyle = exports.CutStyle = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const RgbColor_1 = require("./RgbColor");
|
|
13
13
|
const HiddenLine_1 = require("./HiddenLine");
|
|
14
14
|
const FeatureSymbology_1 = require("./FeatureSymbology");
|
|
15
|
+
const ColorDef_1 = require("./ColorDef");
|
|
15
16
|
/** As part of a [[ClipStyle]], describes how section-cut graphics should be displayed.
|
|
16
17
|
* @note Section-cut graphics are only produced if [[ClipStyle.produceCutGeometry]] is `true`.
|
|
17
18
|
* @public
|
|
@@ -64,30 +65,89 @@ class CutStyle {
|
|
|
64
65
|
/** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */
|
|
65
66
|
CutStyle.defaults = new CutStyle();
|
|
66
67
|
exports.CutStyle = CutStyle;
|
|
68
|
+
/** As part of a [[ClipStyle]], describes how to colorize geometry intersecting the clip planes.
|
|
69
|
+
* @note Edges are highlighted only if [[ClipStyle.ClipIntersectionStyle]] is `true`.
|
|
70
|
+
* @public
|
|
71
|
+
* @extensions
|
|
72
|
+
*/
|
|
73
|
+
class ClipIntersectionStyle {
|
|
74
|
+
constructor(color = RgbColor_1.RgbColor.fromColorDef(ColorDef_1.ColorDef.white), width = 1) {
|
|
75
|
+
this.color = color;
|
|
76
|
+
this.width = width;
|
|
77
|
+
}
|
|
78
|
+
/** Create a highlight from its components. */
|
|
79
|
+
static create(color, width) {
|
|
80
|
+
if (!color && !width)
|
|
81
|
+
return this.defaults;
|
|
82
|
+
return new ClipIntersectionStyle(color, width);
|
|
83
|
+
}
|
|
84
|
+
static fromJSON(props) {
|
|
85
|
+
if (props === undefined) {
|
|
86
|
+
return ClipIntersectionStyle.defaults;
|
|
87
|
+
}
|
|
88
|
+
const color = props.color ? RgbColor_1.RgbColor.fromJSON(props.color) : RgbColor_1.RgbColor.fromColorDef(ColorDef_1.ColorDef.white);
|
|
89
|
+
const width = props.width ? props.width : 1;
|
|
90
|
+
return new ClipIntersectionStyle(color, width);
|
|
91
|
+
}
|
|
92
|
+
/** The JSON representation of this style. It is `undefined` if this style matches the defaults. */
|
|
93
|
+
toJSON() {
|
|
94
|
+
const props = {};
|
|
95
|
+
if (this.matchesDefaults) {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
if (this.color)
|
|
99
|
+
props.color = this.color.toJSON();
|
|
100
|
+
if (this.width)
|
|
101
|
+
props.width = this.width;
|
|
102
|
+
return props;
|
|
103
|
+
}
|
|
104
|
+
get matchesDefaults() {
|
|
105
|
+
if (this === ClipIntersectionStyle.defaults)
|
|
106
|
+
return true;
|
|
107
|
+
return !this.color && !this.width;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
ClipIntersectionStyle.defaults = new ClipIntersectionStyle();
|
|
111
|
+
exports.ClipIntersectionStyle = ClipIntersectionStyle;
|
|
67
112
|
/** Describes symbology and behavior applied to a [ClipVector]($core-geometry) when applied to a [ViewState]($frontend) or [[ModelClipGroup]].
|
|
68
113
|
* @see [[DisplayStyleSettings.clipStyle]].
|
|
69
114
|
* @public
|
|
70
115
|
*/
|
|
71
116
|
class ClipStyle {
|
|
72
|
-
constructor(produceCutGeometry, cutStyle, inside, outside) {
|
|
117
|
+
constructor(produceCutGeometry, colorizeIntersection, cutStyle, inside, outside, intersectionStyle) {
|
|
73
118
|
this.produceCutGeometry = produceCutGeometry;
|
|
119
|
+
this.colorizeIntersection = colorizeIntersection;
|
|
74
120
|
this.cutStyle = cutStyle;
|
|
75
121
|
this.insideColor = inside;
|
|
76
122
|
this.outsideColor = outside;
|
|
123
|
+
this.intersectionStyle = intersectionStyle;
|
|
77
124
|
}
|
|
78
|
-
/**
|
|
79
|
-
static create(
|
|
80
|
-
if (
|
|
125
|
+
/** @internal */
|
|
126
|
+
static create(styleOrProduceCutGeometry, cutStyle, insideColor, outsideColor) {
|
|
127
|
+
if (typeof styleOrProduceCutGeometry === "boolean") {
|
|
128
|
+
cutStyle = cutStyle === undefined ? CutStyle.defaults : cutStyle;
|
|
129
|
+
if (!styleOrProduceCutGeometry && cutStyle.matchesDefaults && !insideColor && !outsideColor) {
|
|
130
|
+
return this.defaults;
|
|
131
|
+
}
|
|
132
|
+
return new ClipStyle(styleOrProduceCutGeometry, false, cutStyle, insideColor, outsideColor, undefined);
|
|
133
|
+
}
|
|
134
|
+
const style = styleOrProduceCutGeometry;
|
|
135
|
+
if (!style.produceCutGeometry && !style.colorizeIntersection && (!style.cutStyle || style.cutStyle.matchesDefaults) && !style.insideColor && !style.outsideColor && !style.intersectionStyle)
|
|
81
136
|
return this.defaults;
|
|
82
|
-
|
|
137
|
+
const produceCutGeometry = style.produceCutGeometry ? true : false;
|
|
138
|
+
const colorizeIntersection = style.colorizeIntersection ? true : false;
|
|
139
|
+
cutStyle = style.cutStyle === undefined ? CutStyle.defaults : style.cutStyle;
|
|
140
|
+
return new ClipStyle(produceCutGeometry, colorizeIntersection, cutStyle, style.insideColor, style.outsideColor, style.intersectionStyle);
|
|
83
141
|
}
|
|
84
142
|
static fromJSON(props) {
|
|
85
143
|
if (core_bentley_1.JsonUtils.isNonEmptyObject(props)) {
|
|
86
144
|
const produceCutGeometry = props.produceCutGeometry ?? false;
|
|
145
|
+
const colorizeIntersection = props.colorizeIntersection ? true : false;
|
|
87
146
|
const cutStyle = CutStyle.fromJSON(props.cutStyle);
|
|
88
|
-
const
|
|
89
|
-
const
|
|
90
|
-
|
|
147
|
+
const insideColor = props.insideColor ? RgbColor_1.RgbColor.fromJSON(props.insideColor) : undefined;
|
|
148
|
+
const outsideColor = props.outsideColor ? RgbColor_1.RgbColor.fromJSON(props.outsideColor) : undefined;
|
|
149
|
+
const intersectionStyle = props.intersectionStyle ? ClipIntersectionStyle.fromJSON(props.intersectionStyle) : undefined;
|
|
150
|
+
return this.create({ produceCutGeometry, colorizeIntersection, cutStyle, insideColor, outsideColor, intersectionStyle });
|
|
91
151
|
}
|
|
92
152
|
return this.defaults;
|
|
93
153
|
}
|
|
@@ -98,6 +158,8 @@ class ClipStyle {
|
|
|
98
158
|
const props = {};
|
|
99
159
|
if (this.produceCutGeometry)
|
|
100
160
|
props.produceCutGeometry = true;
|
|
161
|
+
if (this.colorizeIntersection)
|
|
162
|
+
props.colorizeIntersection = true;
|
|
101
163
|
const cutStyle = this.cutStyle.toJSON();
|
|
102
164
|
if (cutStyle) {
|
|
103
165
|
(0, core_bentley_1.assert)(!this.cutStyle.matchesDefaults);
|
|
@@ -107,16 +169,18 @@ class ClipStyle {
|
|
|
107
169
|
props.insideColor = this.insideColor.toJSON();
|
|
108
170
|
if (this.outsideColor)
|
|
109
171
|
props.outsideColor = this.outsideColor.toJSON();
|
|
172
|
+
if (this.intersectionStyle)
|
|
173
|
+
props.intersectionStyle = this.intersectionStyle.toJSON();
|
|
110
174
|
return props;
|
|
111
175
|
}
|
|
112
176
|
/** Returns true if this style matches the [[ClipStyle.defaults]] - that is, it overrides no settings from the view. */
|
|
113
177
|
get matchesDefaults() {
|
|
114
178
|
if (this === ClipStyle.defaults)
|
|
115
179
|
return true;
|
|
116
|
-
return !this.produceCutGeometry && !this.insideColor && !this.outsideColor && this.cutStyle.matchesDefaults;
|
|
180
|
+
return !this.produceCutGeometry && !this.colorizeIntersection && !this.insideColor && !this.outsideColor && this.cutStyle.matchesDefaults && !this.intersectionStyle;
|
|
117
181
|
}
|
|
118
182
|
}
|
|
119
183
|
/** The default style, which overrides none of the view's settings. */
|
|
120
|
-
ClipStyle.defaults = new ClipStyle(false, CutStyle.defaults, undefined, undefined);
|
|
184
|
+
ClipStyle.defaults = new ClipStyle(false, false, CutStyle.defaults, undefined, undefined, undefined);
|
|
121
185
|
exports.ClipStyle = ClipStyle;
|
|
122
186
|
//# sourceMappingURL=ClipStyle.js.map
|
package/lib/cjs/ClipStyle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipStyle.js","sourceRoot":"","sources":["../../src/ClipStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAwD;AAExD,yCAAqD;AACrD,6CAA0C;AAC1C,yDAA+E;AAgB/E;;;GAGG;AACH,MAAa,QAAQ;IAWnB,YAAoB,SAAuC,EAAE,UAAgC,EAAE,UAA8B;QAC3H,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,EAAE,CAAC;QACjC,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe;YAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE/B,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe;YAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED,6CAA6C;IACtC,MAAM,CAAC,MAAM,CAAC,SAAuC,EAAE,UAAgC,EAAE,UAA8B;QAC5H,IAAI,CAAC,SAAS,IAAI,wBAAS,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,C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AAE,CAAC;QAElD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,uHAAuH;IACvH,IAAW,eAAe;QACxB,IAAI,IAAI,KAAK,SAAS,CAAC,QAAQ;YAC7B,OAAO,IAAI,CAAC;QAEd,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;IAC9G,CAAC;;AA7DD,sEAAsE;AAC/C,kBAAQ,GAAG,IAAI,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAfrF,8BAAS","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 Views\r\n */\r\n\r\nimport { assert, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { ViewFlagOverrides } from \"./ViewFlags\";\r\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\r\nimport { HiddenLine } from \"./HiddenLine\";\r\nimport { FeatureAppearance, FeatureAppearanceProps } from \"./FeatureSymbology\";\r\n\r\n/** Wire format describing a [[CutStyle]] applied to section-cut geometry produced at intersections with a view's [ClipVector]($core-geometry).\r\n * @see [[ClipStyleProps.cutStyle]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface CutStyleProps {\r\n /** If defined, overrides aspects of the view's [[ViewFlags]] when drawing the cut geometry. */\r\n viewflags?: ViewFlagOverrides;\r\n /** If defined, overrides the view's [[HiddenLine.Settings]] when drawing the cut geometry. */\r\n hiddenLine?: HiddenLine.SettingsProps;\r\n /** If defined, overrides aspects of the cut geometry's symbology. */\r\n appearance?: FeatureAppearanceProps;\r\n}\r\n\r\n/** As part of a [[ClipStyle]], describes how section-cut graphics should be displayed.\r\n * @note Section-cut graphics are only produced if [[ClipStyle.produceCutGeometry]] is `true`.\r\n * @public\r\n */\r\nexport class CutStyle {\r\n /** Selectively overrides some of the view's [[ViewFlags]] when drawing the section-cut graphics. */\r\n public readonly viewflags: Readonly<ViewFlagOverrides>;\r\n /** If defined, overrides the settings the view uses to draw the edges of the section-cut graphics. */\r\n public readonly hiddenLine?: HiddenLine.Settings;\r\n /** If defined, overrides aspects of the symbology of the section-cut graphics. */\r\n public readonly appearance?: FeatureAppearance;\r\n\r\n /** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */\r\n public static readonly defaults = new CutStyle();\r\n\r\n private constructor(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance) {\r\n this.viewflags = viewflags ?? {};\r\n if (hiddenLine && !hiddenLine.matchesDefaults)\r\n this.hiddenLine = hiddenLine;\r\n\r\n if (appearance && !appearance.matchesDefaults)\r\n this.appearance = appearance;\r\n }\r\n\r\n /** Create a CutStyle from its components. */\r\n public static create(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance): CutStyle {\r\n if ((viewflags && JsonUtils.isNonEmptyObject(viewflags)) || (hiddenLine && !hiddenLine.matchesDefaults) || (appearance && !appearance.matchesDefaults))\r\n return new CutStyle(viewflags, hiddenLine, appearance);\r\n\r\n return this.defaults;\r\n }\r\n\r\n public static fromJSON(props?: CutStyleProps): CutStyle {\r\n if (JsonUtils.isNonEmptyObject(props)) {\r\n const viewflags = { ...props?.viewflags };\r\n const hiddenLine = props?.hiddenLine ? HiddenLine.Settings.fromJSON(props.hiddenLine) : undefined;\r\n const appearance = props?.appearance ? FeatureAppearance.fromJSON(props.appearance) : undefined;\r\n\r\n return this.create(viewflags, hiddenLine, appearance);\r\n } else {\r\n return this.defaults;\r\n }\r\n }\r\n\r\n /** Return JSON representation. The representation is `undefined` if this style matches the default style. */\r\n public toJSON(): CutStyleProps | undefined {\r\n if (this.matchesDefaults)\r\n return undefined;\r\n\r\n const props: CutStyleProps = {};\r\n if (JsonUtils.isNonEmptyObject(this.viewflags))\r\n props.viewflags = this.viewflags;\r\n\r\n if (this.hiddenLine && !this.hiddenLine.matchesDefaults)\r\n props.hiddenLine = this.hiddenLine?.toJSON();\r\n\r\n if (this.appearance && !this.appearance.matchesDefaults)\r\n props.appearance = this.appearance.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Returns true if this style matches the default style - that is, it overrides none of the view's settings. */\r\n public get matchesDefaults(): boolean {\r\n if (this === CutStyle.defaults)\r\n return true;\r\n\r\n return !JsonUtils.isNonEmptyObject(this.viewflags) && (!this.hiddenLine || this.hiddenLine.matchesDefaults) && (!this.appearance || this.appearance.matchesDefaults);\r\n }\r\n}\r\n\r\n/** Wire format describing a [[ClipStyle]].\r\n * @see [[DisplayStyleSettingsProps.clipStyle]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ClipStyleProps {\r\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\r\n * - Solids (closed volumes) will produce facets on the clip planes.\r\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\r\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\r\n */\r\n produceCutGeometry?: boolean;\r\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\r\n cutStyle?: CutStyleProps;\r\n /** If defined, geometry inside the clip planes will be drawn in this color. */\r\n insideColor?: RgbColorProps;\r\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\r\n outsideColor?: RgbColorProps;\r\n}\r\n\r\n/** Describes symbology and behavior applied to a [ClipVector]($core-geometry) when applied to a [ViewState]($frontend) or [[ModelClipGroup]].\r\n * @see [[DisplayStyleSettings.clipStyle]].\r\n * @public\r\n */\r\nexport class ClipStyle {\r\n /** If `true`, geometry will be produced at the clip planes.\r\n * - Solids (closed volumes) will produce facets on the clip planes.\r\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\r\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\r\n */\r\n public readonly produceCutGeometry: boolean;\r\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\r\n public readonly cutStyle: CutStyle;\r\n /** If defined, geometry inside the clip planes will be drawn in this color. */\r\n public readonly insideColor?: RgbColor;\r\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\r\n public readonly outsideColor?: RgbColor;\r\n\r\n /** The default style, which overrides none of the view's settings. */\r\n public static readonly defaults = new ClipStyle(false, CutStyle.defaults, undefined, undefined);\r\n\r\n private constructor(produceCutGeometry: boolean, cutStyle: CutStyle, inside: RgbColor | undefined, outside: RgbColor | undefined) {\r\n this.produceCutGeometry = produceCutGeometry;\r\n this.cutStyle = cutStyle;\r\n this.insideColor = inside;\r\n this.outsideColor = outside;\r\n }\r\n\r\n /** Create a style from its components. */\r\n public static create(produceCutGeometry: boolean, cutStyle: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle {\r\n if (!produceCutGeometry && cutStyle.matchesDefaults && !insideColor && !outsideColor)\r\n return this.defaults;\r\n\r\n return new ClipStyle(produceCutGeometry, cutStyle, insideColor, outsideColor);\r\n }\r\n\r\n public static fromJSON(props?: ClipStyleProps): ClipStyle {\r\n if (JsonUtils.isNonEmptyObject(props)) {\r\n const produceCutGeometry = props.produceCutGeometry ?? false;\r\n const cutStyle = CutStyle.fromJSON(props.cutStyle);\r\n const inside = props.insideColor ? RgbColor.fromJSON(props.insideColor) : undefined;\r\n const outside = props.outsideColor ? RgbColor.fromJSON(props.outsideColor) : undefined;\r\n\r\n return this.create(produceCutGeometry, cutStyle, inside, outside);\r\n }\r\n\r\n return this.defaults;\r\n }\r\n\r\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\r\n public toJSON(): ClipStyleProps | undefined {\r\n if (this.matchesDefaults)\r\n return undefined;\r\n\r\n const props: ClipStyleProps = {};\r\n if (this.produceCutGeometry)\r\n props.produceCutGeometry = true;\r\n\r\n const cutStyle = this.cutStyle.toJSON();\r\n if (cutStyle) {\r\n assert(!this.cutStyle.matchesDefaults);\r\n props.cutStyle = cutStyle;\r\n }\r\n\r\n if (this.insideColor)\r\n props.insideColor = this.insideColor.toJSON();\r\n\r\n if (this.outsideColor)\r\n props.outsideColor = this.outsideColor.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Returns true if this style matches the [[ClipStyle.defaults]] - that is, it overrides no settings from the view. */\r\n public get matchesDefaults(): boolean {\r\n if (this === ClipStyle.defaults)\r\n return true;\r\n\r\n return !this.produceCutGeometry && !this.insideColor && !this.outsideColor && this.cutStyle.matchesDefaults;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ClipStyle.js","sourceRoot":"","sources":["../../src/ClipStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAwD;AAExD,yCAAqD;AACrD,6CAA0C;AAC1C,yDAA+E;AAC/E,yCAAsC;AAgBtC;;;GAGG;AACH,MAAa,QAAQ;IAWnB,YAAoB,SAAuC,EAAE,UAAgC,EAAE,UAA8B;QAC3H,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,EAAE,CAAC;QACjC,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe;YAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE/B,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe;YAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED,6CAA6C;IACtC,MAAM,CAAC,MAAM,CAAC,SAAuC,EAAE,UAAgC,EAAE,UAA8B;QAC5H,IAAI,CAAC,SAAS,IAAI,wBAAS,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe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AElC,IAAI,IAAI,CAAC,oBAAoB;YAC3B,KAAK,CAAC,oBAAoB,GAAG,IAAI,CAAC;QAEpC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACxC,IAAI,QAAQ,EAAE;YACZ,IAAA,qBAAM,EAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;YACvC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;SAC3B;QAED,IAAI,IAAI,CAAC,WAAW;YAClB,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QAEhD,IAAI,IAAI,CAAC,YAAY;YACnB,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;QAElD,IAAI,IAAI,CAAC,iBAAiB;YACxB,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAE5D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,uHAAuH;IACvH,IAAW,eAAe;QACxB,IAAI,IAAI,KAAK,SAAS,CAAC,QAAQ;YAC7B,OAAO,IAAI,CAAC;QAEd,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;IACvK,CAAC;;AA7FD,sEAAsE;AAC/C,kBAAQ,GAAG,IAAI,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAnBvG,8BAAS","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 Views\r\n */\r\n\r\nimport { assert, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { ViewFlagOverrides } from \"./ViewFlags\";\r\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\r\nimport { HiddenLine } from \"./HiddenLine\";\r\nimport { FeatureAppearance, FeatureAppearanceProps } from \"./FeatureSymbology\";\r\nimport { ColorDef } from \"./ColorDef\";\r\n\r\n/** Wire format describing a [[CutStyle]] applied to section-cut geometry produced at intersections with a view's [ClipVector]($core-geometry).\r\n * @see [[ClipStyleProps.cutStyle]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface CutStyleProps {\r\n /** If defined, overrides aspects of the view's [[ViewFlags]] when drawing the cut geometry. */\r\n viewflags?: ViewFlagOverrides;\r\n /** If defined, overrides the view's [[HiddenLine.Settings]] when drawing the cut geometry. */\r\n hiddenLine?: HiddenLine.SettingsProps;\r\n /** If defined, overrides aspects of the cut geometry's symbology. */\r\n appearance?: FeatureAppearanceProps;\r\n}\r\n\r\n/** As part of a [[ClipStyle]], describes how section-cut graphics should be displayed.\r\n * @note Section-cut graphics are only produced if [[ClipStyle.produceCutGeometry]] is `true`.\r\n * @public\r\n */\r\nexport class CutStyle {\r\n /** Selectively overrides some of the view's [[ViewFlags]] when drawing the section-cut graphics. */\r\n public readonly viewflags: Readonly<ViewFlagOverrides>;\r\n /** If defined, overrides the settings the view uses to draw the edges of the section-cut graphics. */\r\n public readonly hiddenLine?: HiddenLine.Settings;\r\n /** If defined, overrides aspects of the symbology of the section-cut graphics. */\r\n public readonly appearance?: FeatureAppearance;\r\n\r\n /** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */\r\n public static readonly defaults = new CutStyle();\r\n\r\n private constructor(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance) {\r\n this.viewflags = viewflags ?? {};\r\n if (hiddenLine && !hiddenLine.matchesDefaults)\r\n this.hiddenLine = hiddenLine;\r\n\r\n if (appearance && !appearance.matchesDefaults)\r\n this.appearance = appearance;\r\n }\r\n\r\n /** Create a CutStyle from its components. */\r\n public static create(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance): CutStyle {\r\n if ((viewflags && JsonUtils.isNonEmptyObject(viewflags)) || (hiddenLine && !hiddenLine.matchesDefaults) || (appearance && !appearance.matchesDefaults))\r\n return new CutStyle(viewflags, hiddenLine, appearance);\r\n\r\n return this.defaults;\r\n }\r\n\r\n public static fromJSON(props?: CutStyleProps): CutStyle {\r\n if (JsonUtils.isNonEmptyObject(props)) {\r\n const viewflags = { ...props?.viewflags };\r\n const hiddenLine = props?.hiddenLine ? HiddenLine.Settings.fromJSON(props.hiddenLine) : undefined;\r\n const appearance = props?.appearance ? FeatureAppearance.fromJSON(props.appearance) : undefined;\r\n\r\n return this.create(viewflags, hiddenLine, appearance);\r\n } else {\r\n return this.defaults;\r\n }\r\n }\r\n\r\n /** Return JSON representation. The representation is `undefined` if this style matches the default style. */\r\n public toJSON(): CutStyleProps | undefined {\r\n if (this.matchesDefaults)\r\n return undefined;\r\n\r\n const props: CutStyleProps = {};\r\n if (JsonUtils.isNonEmptyObject(this.viewflags))\r\n props.viewflags = this.viewflags;\r\n\r\n if (this.hiddenLine && !this.hiddenLine.matchesDefaults)\r\n props.hiddenLine = this.hiddenLine?.toJSON();\r\n\r\n if (this.appearance && !this.appearance.matchesDefaults)\r\n props.appearance = this.appearance.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Returns true if this style matches the default style - that is, it overrides none of the view's settings. */\r\n public get matchesDefaults(): boolean {\r\n if (this === CutStyle.defaults)\r\n return true;\r\n\r\n return !JsonUtils.isNonEmptyObject(this.viewflags) && (!this.hiddenLine || this.hiddenLine.matchesDefaults) && (!this.appearance || this.appearance.matchesDefaults);\r\n }\r\n}\r\n\r\n/** Wire format describing a [[ClipIntersectionStyle]].\r\n * @see [[ClipStyleProps.ClipIntersectionStyle]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ClipIntersectionStyleProps {\r\n /** Color to apply to intersection of geometry and clip planes, default white */\r\n color?: RgbColorProps;\r\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\r\n width?: number;\r\n}\r\n\r\n/** As part of a [[ClipStyle]], describes how to colorize geometry intersecting the clip planes.\r\n * @note Edges are highlighted only if [[ClipStyle.ClipIntersectionStyle]] is `true`.\r\n * @public\r\n * @extensions\r\n */\r\nexport class ClipIntersectionStyle {\r\n /** Color to apply to intersection of geometry and clip planes, default white */\r\n public readonly color: RgbColor;\r\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\r\n public readonly width: number;\r\n\r\n private constructor(color: RgbColor = RgbColor.fromColorDef(ColorDef.white), width: number = 1) {\r\n this.color = color;\r\n this.width = width;\r\n }\r\n /** Create a highlight from its components. */\r\n public static create(color?: RgbColor, width?: number): ClipIntersectionStyle {\r\n if (!color && !width)\r\n return this.defaults;\r\n\r\n return new ClipIntersectionStyle(color, width);\r\n }\r\n\r\n public static readonly defaults = new ClipIntersectionStyle();\r\n\r\n public static fromJSON(props?: ClipIntersectionStyleProps): ClipIntersectionStyle {\r\n if (props === undefined) {\r\n return ClipIntersectionStyle.defaults;\r\n }\r\n\r\n const color = props.color ? RgbColor.fromJSON(props.color) : RgbColor.fromColorDef(ColorDef.white);\r\n const width = props.width ? props.width : 1;\r\n return new ClipIntersectionStyle(color, width);\r\n }\r\n\r\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\r\n public toJSON(): ClipIntersectionStyleProps | undefined {\r\n const props: ClipIntersectionStyleProps = {};\r\n\r\n if (this.matchesDefaults) {\r\n return undefined;\r\n }\r\n\r\n if (this.color)\r\n props.color = this.color.toJSON();\r\n\r\n if (this.width)\r\n props.width = this.width;\r\n\r\n return props;\r\n }\r\n\r\n public get matchesDefaults(): boolean {\r\n if (this === ClipIntersectionStyle.defaults)\r\n return true;\r\n\r\n return !this.color && !this.width;\r\n }\r\n}\r\n\r\n/** Arguments supplied to [[ClipStyle.create]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ClipStyleCreateArgs {\r\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\r\n * - Solids (closed volumes) will produce facets on the clip planes.\r\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\r\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\r\n */\r\n produceCutGeometry?: boolean;\r\n /** If `true`, intersection of geometry and clip planes will be colorized */\r\n colorizeIntersection?: boolean;\r\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\r\n cutStyle?: CutStyle;\r\n /** If defined, geometry inside the clip planes will be drawn in this color. */\r\n insideColor?: RgbColor;\r\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\r\n outsideColor?: RgbColor;\r\n /** Controls the style of the intersection of geometry and clip planes */\r\n intersectionStyle?: ClipIntersectionStyle;\r\n}\r\n\r\n/** Wire format describing a [[ClipStyle]].\r\n * @see [[DisplayStyleSettingsProps.clipStyle]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ClipStyleProps {\r\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\r\n * - Solids (closed volumes) will produce facets on the clip planes.\r\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\r\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\r\n */\r\n produceCutGeometry?: boolean;\r\n /** If 'true', intersection of geometry and clip planes will be colorized */\r\n colorizeIntersection?: boolean;\r\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\r\n cutStyle?: CutStyleProps;\r\n /** If defined, geometry inside the clip planes will be drawn in this color. */\r\n insideColor?: RgbColorProps;\r\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\r\n outsideColor?: RgbColorProps;\r\n /** Controls the style of the intersection of geometry and clip planes */\r\n intersectionStyle?: ClipIntersectionStyleProps;\r\n}\r\n\r\n/** Describes symbology and behavior applied to a [ClipVector]($core-geometry) when applied to a [ViewState]($frontend) or [[ModelClipGroup]].\r\n * @see [[DisplayStyleSettings.clipStyle]].\r\n * @public\r\n */\r\nexport class ClipStyle {\r\n /** If `true`, geometry will be produced at the clip planes.\r\n * - Solids (closed volumes) will produce facets on the clip planes.\r\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\r\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\r\n */\r\n public readonly produceCutGeometry: boolean;\r\n /** If 'true', intersection of geometry and clip planes will be colorized */\r\n public readonly colorizeIntersection: boolean;\r\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\r\n public readonly cutStyle: CutStyle;\r\n /** If defined, geometry inside the clip planes will be drawn in this color. */\r\n public readonly insideColor?: RgbColor;\r\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\r\n public readonly outsideColor?: RgbColor;\r\n /** Controls the style of the intersection of geometry and clip planes */\r\n public readonly intersectionStyle?: ClipIntersectionStyle;\r\n\r\n /** The default style, which overrides none of the view's settings. */\r\n public static readonly defaults = new ClipStyle(false, false, CutStyle.defaults, undefined, undefined, undefined);\r\n\r\n private constructor(produceCutGeometry: boolean, colorizeIntersection: boolean, cutStyle: CutStyle, inside: RgbColor | undefined, outside: RgbColor | undefined, intersectionStyle: ClipIntersectionStyle | undefined) {\r\n this.produceCutGeometry = produceCutGeometry;\r\n this.colorizeIntersection = colorizeIntersection;\r\n this.cutStyle = cutStyle;\r\n this.insideColor = inside;\r\n this.outsideColor = outside;\r\n this.intersectionStyle = intersectionStyle;\r\n }\r\n\r\n /** @deprecated in 4.x. Use [[create(style: ClipStyleCreateArgs]] */\r\n public static create(produceCutGeometry: boolean, cutStyle: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle;\r\n\r\n /** Create a style from its components. */\r\n public static create(style: ClipStyleCreateArgs): ClipStyle;\r\n\r\n /** @internal */\r\n public static create(styleOrProduceCutGeometry: ClipStyleCreateArgs | boolean, cutStyle?: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle {\r\n\r\n if (typeof styleOrProduceCutGeometry === \"boolean\") {\r\n cutStyle = cutStyle === undefined ? CutStyle.defaults : cutStyle;\r\n\r\n if (!styleOrProduceCutGeometry && cutStyle.matchesDefaults && !insideColor && !outsideColor) {\r\n return this.defaults;\r\n }\r\n\r\n return new ClipStyle(styleOrProduceCutGeometry, false, cutStyle, insideColor, outsideColor, undefined);\r\n }\r\n\r\n const style = styleOrProduceCutGeometry;\r\n if (!style.produceCutGeometry && !style.colorizeIntersection && (!style.cutStyle || style.cutStyle.matchesDefaults) && !style.insideColor && !style.outsideColor && !style.intersectionStyle)\r\n return this.defaults;\r\n\r\n const produceCutGeometry = style.produceCutGeometry ? true : false;\r\n const colorizeIntersection = style.colorizeIntersection ? true : false;\r\n cutStyle = style.cutStyle === undefined ? CutStyle.defaults : style.cutStyle;\r\n\r\n return new ClipStyle(produceCutGeometry, colorizeIntersection, cutStyle, style.insideColor, style.outsideColor, style.intersectionStyle);\r\n }\r\n\r\n public static fromJSON(props?: ClipStyleProps): ClipStyle {\r\n if (JsonUtils.isNonEmptyObject(props)) {\r\n const produceCutGeometry = props.produceCutGeometry ?? false;\r\n const colorizeIntersection = props.colorizeIntersection ? true : false;\r\n const cutStyle = CutStyle.fromJSON(props.cutStyle);\r\n const insideColor = props.insideColor ? RgbColor.fromJSON(props.insideColor) : undefined;\r\n const outsideColor = props.outsideColor ? RgbColor.fromJSON(props.outsideColor) : undefined;\r\n const intersectionStyle = props.intersectionStyle ? ClipIntersectionStyle.fromJSON(props.intersectionStyle) : undefined;\r\n\r\n return this.create({produceCutGeometry, colorizeIntersection, cutStyle, insideColor, outsideColor, intersectionStyle});\r\n }\r\n\r\n return this.defaults;\r\n }\r\n\r\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\r\n public toJSON(): ClipStyleProps | undefined {\r\n if (this.matchesDefaults)\r\n return undefined;\r\n\r\n const props: ClipStyleProps = {};\r\n if (this.produceCutGeometry)\r\n props.produceCutGeometry = true;\r\n\r\n if (this.colorizeIntersection)\r\n props.colorizeIntersection = true;\r\n\r\n const cutStyle = this.cutStyle.toJSON();\r\n if (cutStyle) {\r\n assert(!this.cutStyle.matchesDefaults);\r\n props.cutStyle = cutStyle;\r\n }\r\n\r\n if (this.insideColor)\r\n props.insideColor = this.insideColor.toJSON();\r\n\r\n if (this.outsideColor)\r\n props.outsideColor = this.outsideColor.toJSON();\r\n\r\n if (this.intersectionStyle)\r\n props.intersectionStyle = this.intersectionStyle.toJSON();\r\n\r\n return props;\r\n }\r\n\r\n /** Returns true if this style matches the [[ClipStyle.defaults]] - that is, it overrides no settings from the view. */\r\n public get matchesDefaults(): boolean {\r\n if (this === ClipStyle.defaults)\r\n return true;\r\n\r\n return !this.produceCutGeometry && !this.colorizeIntersection && !this.insideColor && !this.outsideColor && this.cutStyle.matchesDefaults && !this.intersectionStyle;\r\n }\r\n}\r\n"]}
|
|
@@ -101,6 +101,12 @@ export interface ImageMapLayerProps extends CommonMapLayerProps {
|
|
|
101
101
|
accessKey?: MapLayerKey;
|
|
102
102
|
/** @internal */
|
|
103
103
|
modelId?: never;
|
|
104
|
+
/** List of query parameters that will get appended to the source.
|
|
105
|
+
* @beta
|
|
106
|
+
*/
|
|
107
|
+
queryParams?: {
|
|
108
|
+
[key: string]: string;
|
|
109
|
+
};
|
|
104
110
|
}
|
|
105
111
|
/** JSON representation of a [[ModelMapLayerSettings]].
|
|
106
112
|
* @see [[MapImagerySettings]].
|
|
@@ -173,6 +179,19 @@ export declare class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
173
179
|
userName?: string;
|
|
174
180
|
password?: string;
|
|
175
181
|
accessKey?: MapLayerKey;
|
|
182
|
+
/** List of query parameters to append to the settings URL and persisted as part of the JSON representation.
|
|
183
|
+
* @note Sensitive information like user credentials should be provided in [[unsavedQueryParams]] to ensure it is never persisted.
|
|
184
|
+
* @beta
|
|
185
|
+
*/
|
|
186
|
+
savedQueryParams?: {
|
|
187
|
+
[key: string]: string;
|
|
188
|
+
};
|
|
189
|
+
/** List of query parameters that will get appended to the settings URL that should *not* be be persisted part of the JSON representation.
|
|
190
|
+
* @beta
|
|
191
|
+
*/
|
|
192
|
+
unsavedQueryParams?: {
|
|
193
|
+
[key: string]: string;
|
|
194
|
+
};
|
|
176
195
|
readonly subLayers: MapSubLayerSettings[];
|
|
177
196
|
get source(): string;
|
|
178
197
|
/** @internal */
|
|
@@ -201,6 +220,12 @@ export declare class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
201
220
|
/** @internal */
|
|
202
221
|
protected static mapTypeName(type: BackgroundMapType): "Aerial Imagery" | "Aerial Imagery with labels" | "Streets";
|
|
203
222
|
setCredentials(userName?: string, password?: string): void;
|
|
223
|
+
/** Collect all query parameters
|
|
224
|
+
* @beta
|
|
225
|
+
*/
|
|
226
|
+
collectQueryParams(): {
|
|
227
|
+
[key: string]: string;
|
|
228
|
+
};
|
|
204
229
|
}
|
|
205
230
|
/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
|
|
206
231
|
* Model map layers are produced from models, typically from two dimensional geometry that may originate in a GIS system.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerSettings.d.ts","sourceRoot":"","sources":["../../src/MapLayerSettings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapLayerSettings.d.ts","sourceRoot":"","sources":["../../src/MapLayerSettings.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAU,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC/G,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE;;;GA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C1C,YAAY,CAAC,QAAQ,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,oBAAoB;IA2D3I,gBAAgB;WACF,sBAAsB,CAAC,KAAK,EAAE,4BAA4B,GAAG,oBAAoB;IAI/F,aAAa;IACN,iBAAiB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,oBAAoB;CAGhF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable deprecation/deprecation */
|
|
2
3
|
/*---------------------------------------------------------------------------------------------
|
|
3
4
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
5
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -136,6 +137,9 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
136
137
|
this.formatId = props.formatId;
|
|
137
138
|
this.url = props.url;
|
|
138
139
|
this.accessKey = props.accessKey;
|
|
140
|
+
if (props.queryParams) {
|
|
141
|
+
this.savedQueryParams = { ...props.queryParams };
|
|
142
|
+
}
|
|
139
143
|
this.subLayers = [];
|
|
140
144
|
if (!props.subLayers)
|
|
141
145
|
return;
|
|
@@ -155,6 +159,8 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
155
159
|
props.formatId = this.formatId;
|
|
156
160
|
if (this.subLayers.length > 0)
|
|
157
161
|
props.subLayers = this.subLayers.map((x) => x.toJSON());
|
|
162
|
+
if (this.savedQueryParams)
|
|
163
|
+
props.queryParams = { ...this.savedQueryParams };
|
|
158
164
|
return props;
|
|
159
165
|
}
|
|
160
166
|
/** Create a copy of this MapLayerSettings, optionally modifying some of its properties.
|
|
@@ -167,6 +173,10 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
167
173
|
clone.userName = this.userName;
|
|
168
174
|
clone.password = this.password;
|
|
169
175
|
clone.accessKey = this.accessKey;
|
|
176
|
+
if (this.unsavedQueryParams)
|
|
177
|
+
clone.unsavedQueryParams = { ...this.unsavedQueryParams };
|
|
178
|
+
if (this.savedQueryParams)
|
|
179
|
+
clone.savedQueryParams = { ...this.savedQueryParams };
|
|
170
180
|
return clone;
|
|
171
181
|
}
|
|
172
182
|
/** @internal */
|
|
@@ -176,6 +186,12 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
176
186
|
props.url = changedProps.url ?? this.url;
|
|
177
187
|
props.accessKey = changedProps.accessKey ?? this.accessKey;
|
|
178
188
|
props.subLayers = changedProps.subLayers ?? this.subLayers;
|
|
189
|
+
if (changedProps.queryParams) {
|
|
190
|
+
props.queryParams = { ...changedProps.queryParams };
|
|
191
|
+
}
|
|
192
|
+
else if (this.savedQueryParams) {
|
|
193
|
+
props.queryParams = { ...this.savedQueryParams };
|
|
194
|
+
}
|
|
179
195
|
return props;
|
|
180
196
|
}
|
|
181
197
|
/** @internal */
|
|
@@ -244,6 +260,17 @@ class ImageMapLayerSettings extends MapLayerSettings {
|
|
|
244
260
|
this.userName = userName;
|
|
245
261
|
this.password = password;
|
|
246
262
|
}
|
|
263
|
+
/** Collect all query parameters
|
|
264
|
+
* @beta
|
|
265
|
+
*/
|
|
266
|
+
collectQueryParams() {
|
|
267
|
+
let queryParams = {};
|
|
268
|
+
if (this.savedQueryParams)
|
|
269
|
+
queryParams = { ...this.savedQueryParams };
|
|
270
|
+
if (this.unsavedQueryParams)
|
|
271
|
+
queryParams = { ...queryParams, ...this.unsavedQueryParams };
|
|
272
|
+
return queryParams;
|
|
273
|
+
}
|
|
247
274
|
}
|
|
248
275
|
exports.ImageMapLayerSettings = ImageMapLayerSettings;
|
|
249
276
|
/** Normalized representation of a [[ModelMapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined.
|