@itwin/hypermodeling-frontend 4.0.0-dev.52 → 4.0.0-dev.55

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.
Files changed (48) hide show
  1. package/lib/cjs/HyperModeling.d.ts +114 -114
  2. package/lib/cjs/HyperModeling.js +238 -238
  3. package/lib/cjs/HyperModeling.js.map +1 -1
  4. package/lib/cjs/HyperModelingConfig.d.ts +54 -54
  5. package/lib/cjs/HyperModelingConfig.js +9 -9
  6. package/lib/cjs/HyperModelingDecorator.d.ts +110 -110
  7. package/lib/cjs/HyperModelingDecorator.js +335 -335
  8. package/lib/cjs/HyperModelingDecorator.js.map +1 -1
  9. package/lib/cjs/PopupToolbar.d.ts +24 -24
  10. package/lib/cjs/PopupToolbar.js +57 -57
  11. package/lib/cjs/PopupToolbar.js.map +1 -1
  12. package/lib/cjs/SectionDrawingLocationState.d.ts +90 -90
  13. package/lib/cjs/SectionDrawingLocationState.js +107 -107
  14. package/lib/cjs/SectionGraphicsProvider.d.ts +13 -13
  15. package/lib/cjs/SectionGraphicsProvider.js +272 -272
  16. package/lib/cjs/SectionMarkerHandler.d.ts +52 -52
  17. package/lib/cjs/SectionMarkerHandler.js +111 -111
  18. package/lib/cjs/SectionMarkers.d.ts +82 -82
  19. package/lib/cjs/SectionMarkers.js +174 -174
  20. package/lib/cjs/Tools.d.ts +5 -5
  21. package/lib/cjs/Tools.js +170 -170
  22. package/lib/cjs/hypermodeling-frontend.d.ts +13 -13
  23. package/lib/cjs/hypermodeling-frontend.js +33 -29
  24. package/lib/cjs/hypermodeling-frontend.js.map +1 -1
  25. package/lib/esm/HyperModeling.d.ts +114 -114
  26. package/lib/esm/HyperModeling.js +235 -234
  27. package/lib/esm/HyperModeling.js.map +1 -1
  28. package/lib/esm/HyperModelingConfig.d.ts +54 -54
  29. package/lib/esm/HyperModelingConfig.js +8 -8
  30. package/lib/esm/HyperModelingDecorator.d.ts +110 -110
  31. package/lib/esm/HyperModelingDecorator.js +331 -331
  32. package/lib/esm/HyperModelingDecorator.js.map +1 -1
  33. package/lib/esm/PopupToolbar.d.ts +24 -24
  34. package/lib/esm/PopupToolbar.js +54 -53
  35. package/lib/esm/PopupToolbar.js.map +1 -1
  36. package/lib/esm/SectionDrawingLocationState.d.ts +90 -90
  37. package/lib/esm/SectionDrawingLocationState.js +103 -103
  38. package/lib/esm/SectionGraphicsProvider.d.ts +13 -13
  39. package/lib/esm/SectionGraphicsProvider.js +268 -268
  40. package/lib/esm/SectionMarkerHandler.d.ts +52 -52
  41. package/lib/esm/SectionMarkerHandler.js +107 -107
  42. package/lib/esm/SectionMarkers.d.ts +82 -82
  43. package/lib/esm/SectionMarkers.js +168 -168
  44. package/lib/esm/Tools.d.ts +5 -5
  45. package/lib/esm/Tools.js +166 -166
  46. package/lib/esm/hypermodeling-frontend.d.ts +13 -13
  47. package/lib/esm/hypermodeling-frontend.js +17 -17
  48. package/package.json +14 -14
package/lib/esm/Tools.js CHANGED
@@ -1,167 +1,167 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- /** @packageDocumentation
6
- * @module HyperModeling
7
- */
8
- import { SectionType } from "@itwin/core-common";
9
- import { IModelApp, Tool } from "@itwin/core-frontend";
10
- import { HyperModeling } from "./HyperModeling";
11
- import { HyperModelingDecorator } from "./HyperModelingDecorator";
12
- /** Parses a string case-insensitively returning true for "ON", false for "OFF", undefined for "TOGGLE" or undefined, and the input string for anything else. */
13
- function parseToggle(arg) {
14
- if (undefined === arg)
15
- return undefined;
16
- switch (arg.toLowerCase()) {
17
- case "on": return true;
18
- case "off": return false;
19
- case "toggle": return undefined;
20
- default: return arg;
21
- }
22
- }
23
- class HyperModelingTool extends Tool {
24
- static get minArgs() { return 0; }
25
- static get maxArgs() { return 1; }
26
- async run(enable, vp) {
27
- vp = vp ?? IModelApp.viewManager.selectedView;
28
- if (vp)
29
- await HyperModeling.startOrStop(vp, enable);
30
- return true;
31
- }
32
- async parseAndRun(...args) {
33
- const enable = parseToggle(args[0]);
34
- return typeof enable !== "string" && this.run(enable);
35
- }
36
- }
37
- HyperModelingTool.toolId = "HyperModeling";
38
- /** Configures how section graphics are displayed. These are global settings. If no arguments are supplied, the defaults are restored.
39
- * Otherwise, each argument is of the form "name=value" where value is 0 (disable) or 1 (enable). Only the first letter of each argument matters.
40
- * - drawings: Whether to display the section drawing graphics. Default: 1.
41
- * - sheets: Whether to display the sheet annotation graphics. Default: 1.
42
- * - clip: Whether to apply clip volumes to the 2d graphics. Default: 1.
43
- * - boundaries: Whether to display clip volumes as boundary shapes for debugging purposes. Default: 0.
44
- */
45
- class SectionGraphicsConfigTool extends Tool {
46
- static get minArgs() { return 0; }
47
- static get maxArgs() { return 4; }
48
- async run(config) {
49
- if (!config) {
50
- config = {
51
- ignoreClip: false,
52
- debugClipVolumes: false,
53
- hideSectionGraphics: false,
54
- hideSheetAnnotations: false,
55
- };
56
- }
57
- HyperModeling.updateConfiguration({ graphics: config });
58
- return true;
59
- }
60
- async parseAndRun(...args) {
61
- if (0 === args.length)
62
- return this.run(); // restore defaults...
63
- const config = {};
64
- for (const arg of args) {
65
- const parts = arg.toLowerCase().split("=");
66
- if (2 !== parts.length)
67
- continue;
68
- const value = Number.parseInt(parts[1], 10);
69
- if (Number.isNaN(value) || (0 !== value && 1 !== value))
70
- continue;
71
- const enable = 1 === value;
72
- switch (parts[0][0]) {
73
- case "d":
74
- config.hideSectionGraphics = !enable;
75
- break;
76
- case "s":
77
- config.hideSheetAnnotations = !enable;
78
- break;
79
- case "c":
80
- config.ignoreClip = !enable;
81
- break;
82
- case "b":
83
- config.debugClipVolumes = enable;
84
- break;
85
- }
86
- }
87
- return this.run(config);
88
- }
89
- }
90
- SectionGraphicsConfigTool.toolId = "HyperModeling.Graphics.Config";
91
- class SectionMarkerConfigTool extends Tool {
92
- static get minArgs() { return 0; }
93
- static get maxArgs() { return 3; }
94
- async run(config) {
95
- config = config ?? { ignoreModelSelector: false, ignoreCategorySelector: false, hiddenSectionTypes: [] };
96
- this.update(config);
97
- return true;
98
- }
99
- async parseAndRun(...args) {
100
- if (0 === args.length)
101
- return this.run(); // restore defaults...
102
- const config = {};
103
- for (const arg of args) {
104
- const parts = arg.toLowerCase().split("=");
105
- if (2 !== parts.length)
106
- continue;
107
- const setting = parts[0][0];
108
- switch (setting) {
109
- case "h": {
110
- config.hiddenSectionTypes = [];
111
- for (const c of parts[1]) {
112
- switch (c) {
113
- case "s":
114
- config.hiddenSectionTypes.push(SectionType.Section);
115
- break;
116
- case "d":
117
- config.hiddenSectionTypes.push(SectionType.Detail);
118
- break;
119
- case "e":
120
- config.hiddenSectionTypes.push(SectionType.Elevation);
121
- break;
122
- case "p":
123
- config.hiddenSectionTypes.push(SectionType.Plan);
124
- break;
125
- }
126
- }
127
- break;
128
- }
129
- default: {
130
- const intVal = Number.parseInt(parts[1], 10);
131
- if (!Number.isNaN(intVal) && (0 === intVal || 1 === intVal)) {
132
- if ("c" === setting)
133
- config.ignoreCategorySelector = 0 === intVal;
134
- else if ("m" === setting)
135
- config.ignoreModelSelector = 0 === intVal;
136
- }
137
- break;
138
- }
139
- }
140
- }
141
- return this.run(config);
142
- }
143
- }
144
- class SectionMarkerDefaultConfigTool extends SectionMarkerConfigTool {
145
- update(config) {
146
- HyperModeling.updateConfiguration({ markers: config });
147
- }
148
- }
149
- SectionMarkerDefaultConfigTool.toolId = "HyperModeling.Marker.Default.Config";
150
- class SectionMarkerDecoratorConfigTool extends SectionMarkerConfigTool {
151
- update(config) {
152
- const vp = IModelApp.viewManager.selectedView;
153
- const decorator = vp ? HyperModelingDecorator.getForViewport(vp) : undefined;
154
- if (decorator)
155
- decorator.updateConfiguration(config);
156
- }
157
- }
158
- SectionMarkerDecoratorConfigTool.toolId = "HyperModeling.Marker.Config";
159
- /** @internal */
160
- export function registerTools(namespace) {
161
- const register = (tool) => IModelApp.tools.register(tool, namespace);
162
- register(HyperModelingTool);
163
- register(SectionGraphicsConfigTool);
164
- register(SectionMarkerDecoratorConfigTool);
165
- register(SectionMarkerDefaultConfigTool);
166
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module HyperModeling
7
+ */
8
+ import { SectionType } from "@itwin/core-common";
9
+ import { IModelApp, Tool } from "@itwin/core-frontend";
10
+ import { HyperModeling } from "./HyperModeling";
11
+ import { HyperModelingDecorator } from "./HyperModelingDecorator";
12
+ /** Parses a string case-insensitively returning true for "ON", false for "OFF", undefined for "TOGGLE" or undefined, and the input string for anything else. */
13
+ function parseToggle(arg) {
14
+ if (undefined === arg)
15
+ return undefined;
16
+ switch (arg.toLowerCase()) {
17
+ case "on": return true;
18
+ case "off": return false;
19
+ case "toggle": return undefined;
20
+ default: return arg;
21
+ }
22
+ }
23
+ class HyperModelingTool extends Tool {
24
+ static get minArgs() { return 0; }
25
+ static get maxArgs() { return 1; }
26
+ async run(enable, vp) {
27
+ vp = vp ?? IModelApp.viewManager.selectedView;
28
+ if (vp)
29
+ await HyperModeling.startOrStop(vp, enable);
30
+ return true;
31
+ }
32
+ async parseAndRun(...args) {
33
+ const enable = parseToggle(args[0]);
34
+ return typeof enable !== "string" && this.run(enable);
35
+ }
36
+ }
37
+ HyperModelingTool.toolId = "HyperModeling";
38
+ /** Configures how section graphics are displayed. These are global settings. If no arguments are supplied, the defaults are restored.
39
+ * Otherwise, each argument is of the form "name=value" where value is 0 (disable) or 1 (enable). Only the first letter of each argument matters.
40
+ * - drawings: Whether to display the section drawing graphics. Default: 1.
41
+ * - sheets: Whether to display the sheet annotation graphics. Default: 1.
42
+ * - clip: Whether to apply clip volumes to the 2d graphics. Default: 1.
43
+ * - boundaries: Whether to display clip volumes as boundary shapes for debugging purposes. Default: 0.
44
+ */
45
+ class SectionGraphicsConfigTool extends Tool {
46
+ static get minArgs() { return 0; }
47
+ static get maxArgs() { return 4; }
48
+ async run(config) {
49
+ if (!config) {
50
+ config = {
51
+ ignoreClip: false,
52
+ debugClipVolumes: false,
53
+ hideSectionGraphics: false,
54
+ hideSheetAnnotations: false,
55
+ };
56
+ }
57
+ HyperModeling.updateConfiguration({ graphics: config });
58
+ return true;
59
+ }
60
+ async parseAndRun(...args) {
61
+ if (0 === args.length)
62
+ return this.run(); // restore defaults...
63
+ const config = {};
64
+ for (const arg of args) {
65
+ const parts = arg.toLowerCase().split("=");
66
+ if (2 !== parts.length)
67
+ continue;
68
+ const value = Number.parseInt(parts[1], 10);
69
+ if (Number.isNaN(value) || (0 !== value && 1 !== value))
70
+ continue;
71
+ const enable = 1 === value;
72
+ switch (parts[0][0]) {
73
+ case "d":
74
+ config.hideSectionGraphics = !enable;
75
+ break;
76
+ case "s":
77
+ config.hideSheetAnnotations = !enable;
78
+ break;
79
+ case "c":
80
+ config.ignoreClip = !enable;
81
+ break;
82
+ case "b":
83
+ config.debugClipVolumes = enable;
84
+ break;
85
+ }
86
+ }
87
+ return this.run(config);
88
+ }
89
+ }
90
+ SectionGraphicsConfigTool.toolId = "HyperModeling.Graphics.Config";
91
+ class SectionMarkerConfigTool extends Tool {
92
+ static get minArgs() { return 0; }
93
+ static get maxArgs() { return 3; }
94
+ async run(config) {
95
+ config = config ?? { ignoreModelSelector: false, ignoreCategorySelector: false, hiddenSectionTypes: [] };
96
+ this.update(config);
97
+ return true;
98
+ }
99
+ async parseAndRun(...args) {
100
+ if (0 === args.length)
101
+ return this.run(); // restore defaults...
102
+ const config = {};
103
+ for (const arg of args) {
104
+ const parts = arg.toLowerCase().split("=");
105
+ if (2 !== parts.length)
106
+ continue;
107
+ const setting = parts[0][0];
108
+ switch (setting) {
109
+ case "h": {
110
+ config.hiddenSectionTypes = [];
111
+ for (const c of parts[1]) {
112
+ switch (c) {
113
+ case "s":
114
+ config.hiddenSectionTypes.push(SectionType.Section);
115
+ break;
116
+ case "d":
117
+ config.hiddenSectionTypes.push(SectionType.Detail);
118
+ break;
119
+ case "e":
120
+ config.hiddenSectionTypes.push(SectionType.Elevation);
121
+ break;
122
+ case "p":
123
+ config.hiddenSectionTypes.push(SectionType.Plan);
124
+ break;
125
+ }
126
+ }
127
+ break;
128
+ }
129
+ default: {
130
+ const intVal = Number.parseInt(parts[1], 10);
131
+ if (!Number.isNaN(intVal) && (0 === intVal || 1 === intVal)) {
132
+ if ("c" === setting)
133
+ config.ignoreCategorySelector = 0 === intVal;
134
+ else if ("m" === setting)
135
+ config.ignoreModelSelector = 0 === intVal;
136
+ }
137
+ break;
138
+ }
139
+ }
140
+ }
141
+ return this.run(config);
142
+ }
143
+ }
144
+ class SectionMarkerDefaultConfigTool extends SectionMarkerConfigTool {
145
+ update(config) {
146
+ HyperModeling.updateConfiguration({ markers: config });
147
+ }
148
+ }
149
+ SectionMarkerDefaultConfigTool.toolId = "HyperModeling.Marker.Default.Config";
150
+ class SectionMarkerDecoratorConfigTool extends SectionMarkerConfigTool {
151
+ update(config) {
152
+ const vp = IModelApp.viewManager.selectedView;
153
+ const decorator = vp ? HyperModelingDecorator.getForViewport(vp) : undefined;
154
+ if (decorator)
155
+ decorator.updateConfiguration(config);
156
+ }
157
+ }
158
+ SectionMarkerDecoratorConfigTool.toolId = "HyperModeling.Marker.Config";
159
+ /** @internal */
160
+ export function registerTools(namespace) {
161
+ const register = (tool) => IModelApp.tools.register(tool, namespace);
162
+ register(HyperModelingTool);
163
+ register(SectionGraphicsConfigTool);
164
+ register(SectionMarkerDecoratorConfigTool);
165
+ register(SectionMarkerDefaultConfigTool);
166
+ }
167
167
  //# sourceMappingURL=Tools.js.map
@@ -1,14 +1,14 @@
1
- export * from "./HyperModeling";
2
- export * from "./HyperModelingConfig";
3
- export * from "./HyperModelingDecorator";
4
- export * from "./SectionMarkerHandler";
5
- export * from "./SectionDrawingLocationState";
6
- export * from "./SectionGraphicsProvider";
7
- export * from "./SectionMarkers";
8
- /** @docs-package-description
9
- * The hypermodeling package enables visualization of section drawings in a spatial context.
10
- */
11
- /** @docs-group-description HyperModeling
12
- * APIs for controlling visualization of section drawings in a spatial context.
13
- */
1
+ export * from "./HyperModeling";
2
+ export * from "./HyperModelingConfig";
3
+ export * from "./HyperModelingDecorator";
4
+ export * from "./SectionMarkerHandler";
5
+ export * from "./SectionDrawingLocationState";
6
+ export * from "./SectionGraphicsProvider";
7
+ export * from "./SectionMarkers";
8
+ /** @docs-package-description
9
+ * The hypermodeling package enables visualization of section drawings in a spatial context.
10
+ */
11
+ /** @docs-group-description HyperModeling
12
+ * APIs for controlling visualization of section drawings in a spatial context.
13
+ */
14
14
  //# sourceMappingURL=hypermodeling-frontend.d.ts.map
@@ -1,18 +1,18 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- export * from "./HyperModeling";
6
- export * from "./HyperModelingConfig";
7
- export * from "./HyperModelingDecorator";
8
- export * from "./SectionMarkerHandler";
9
- export * from "./SectionDrawingLocationState";
10
- export * from "./SectionGraphicsProvider";
11
- export * from "./SectionMarkers";
12
- /** @docs-package-description
13
- * The hypermodeling package enables visualization of section drawings in a spatial context.
14
- */
15
- /** @docs-group-description HyperModeling
16
- * APIs for controlling visualization of section drawings in a spatial context.
17
- */
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ export * from "./HyperModeling";
6
+ export * from "./HyperModelingConfig";
7
+ export * from "./HyperModelingDecorator";
8
+ export * from "./SectionMarkerHandler";
9
+ export * from "./SectionDrawingLocationState";
10
+ export * from "./SectionGraphicsProvider";
11
+ export * from "./SectionMarkers";
12
+ /** @docs-package-description
13
+ * The hypermodeling package enables visualization of section drawings in a spatial context.
14
+ */
15
+ /** @docs-group-description HyperModeling
16
+ * APIs for controlling visualization of section drawings in a spatial context.
17
+ */
18
18
  //# sourceMappingURL=hypermodeling-frontend.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/hypermodeling-frontend",
3
- "version": "4.0.0-dev.52",
3
+ "version": "4.0.0-dev.55",
4
4
  "description": "iTwin.js hypermodeling package",
5
5
  "main": "lib/cjs/hypermodeling-frontend.js",
6
6
  "module": "lib/esm/hypermodeling-frontend.js",
@@ -21,19 +21,19 @@
21
21
  "url": "http://www.bentley.com"
22
22
  },
23
23
  "peerDependencies": {
24
- "@itwin/core-bentley": "^4.0.0-dev.52",
25
- "@itwin/core-common": "^4.0.0-dev.52",
26
- "@itwin/core-frontend": "^4.0.0-dev.52",
27
- "@itwin/core-geometry": "^4.0.0-dev.52"
24
+ "@itwin/core-bentley": "^4.0.0-dev.55",
25
+ "@itwin/core-common": "^4.0.0-dev.55",
26
+ "@itwin/core-frontend": "^4.0.0-dev.55",
27
+ "@itwin/core-geometry": "^4.0.0-dev.55"
28
28
  },
29
29
  "devDependencies": {
30
- "@itwin/build-tools": "4.0.0-dev.52",
31
- "@itwin/core-bentley": "4.0.0-dev.52",
32
- "@itwin/core-common": "4.0.0-dev.52",
33
- "@itwin/core-frontend": "4.0.0-dev.52",
34
- "@itwin/core-geometry": "4.0.0-dev.52",
35
- "@itwin/certa": "4.0.0-dev.52",
36
- "@itwin/eslint-plugin": "nightly",
30
+ "@itwin/build-tools": "4.0.0-dev.55",
31
+ "@itwin/core-bentley": "4.0.0-dev.55",
32
+ "@itwin/core-common": "4.0.0-dev.55",
33
+ "@itwin/core-frontend": "4.0.0-dev.55",
34
+ "@itwin/core-geometry": "4.0.0-dev.55",
35
+ "@itwin/certa": "4.0.0-dev.55",
36
+ "@itwin/eslint-plugin": "^4.0.0-dev.32",
37
37
  "@types/chai": "4.3.1",
38
38
  "@types/mocha": "^8.2.2",
39
39
  "@types/node": "^18.11.5",
@@ -47,11 +47,11 @@
47
47
  "nyc": "^15.1.0",
48
48
  "rimraf": "^3.0.2",
49
49
  "source-map-loader": "^4.0.0",
50
- "typescript": "~4.4.0",
50
+ "typescript": "~5.0.2",
51
51
  "webpack": "^5.76.0"
52
52
  },
53
53
  "dependencies": {
54
- "@itwin/appui-abstract": "4.0.0-dev.52"
54
+ "@itwin/appui-abstract": "4.0.0-dev.55"
55
55
  },
56
56
  "nyc": {
57
57
  "extends": "./node_modules/@itwin/build-tools/.nycrc"