@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
@@ -1,16 +1,16 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module HyperModeling
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.SectionDrawingLocationState = void 0;
11
- const core_common_1 = require("@itwin/core-common");
12
- const core_frontend_1 = require("@itwin/core-frontend");
13
- const core_geometry_1 = require("@itwin/core-geometry");
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module HyperModeling
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.SectionDrawingLocationState = void 0;
11
+ const core_common_1 = require("@itwin/core-common");
12
+ const core_frontend_1 = require("@itwin/core-frontend");
13
+ const core_geometry_1 = require("@itwin/core-geometry");
14
14
  const selectSectionDrawingLocationStatesECSql = `
15
15
  SELECT
16
16
  bis.SectionDrawingLocation.ECInstanceId as sectionLocationId,
@@ -40,98 +40,98 @@ const selectSectionDrawingLocationStatesECSql = `
40
40
  LEFT JOIN bis.ViewAttachment on bis.ViewDefinition2d.ECInstanceId = bis.ViewAttachment.View.Id
41
41
  LEFT JOIN bis.SheetViewDefinition on bis.SheetViewDefinition.BaseModel.Id = bis.ViewAttachment.Model.Id
42
42
  INNER JOIN bis.SpatialViewDefinition on bis.SpatialViewDefinition.ECInstanceId = bis.SectionDrawing.SpatialView.Id
43
- `;
44
- /** Represents a [SectionDrawingLocation]($backend), including data from related elements like [SectionDrawing]($backend) used in a hyper-modeling context.
45
- * @see [[SectionMarker]] for a widget that allows the user to interact with a section drawing location.
46
- * @public
47
- */
48
- class SectionDrawingLocationState {
49
- /** @internal */
50
- constructor(props, iModel) {
51
- this.iModel = iModel;
52
- this.id = props.sectionLocationId;
53
- this.model = props.sectionLocationModelId;
54
- this.userLabel = props.userLabel;
55
- this.category = props.categoryId;
56
- this.sectionType = props.sectionType;
57
- this.drawingViewId = props.sectionViewId;
58
- this.spatialViewId = props.spatialViewId;
59
- this.drawingToSpatialTransform = core_geometry_1.Transform.fromJSON(JSON.parse(props.drawingToSpatialTransform));
60
- const extractClip = (str) => {
61
- let clip;
62
- if (str) {
63
- try {
64
- clip = core_geometry_1.ClipVector.fromJSON(JSON.parse(str));
65
- }
66
- catch { }
67
- }
68
- return clip;
69
- };
70
- this.clip = extractClip(props.clipJSON) ?? core_geometry_1.ClipVector.createEmpty();
71
- const placementProps = {
72
- origin: props.origin ?? {},
73
- angles: {
74
- yaw: props.yaw,
75
- pitch: props.pitch,
76
- roll: props.roll,
77
- },
78
- placement: (props.bboxLow && props.bboxHigh) ? { low: props.bboxLow, high: props.bboxHigh } : undefined,
79
- };
80
- this.placement = core_common_1.Placement3d.fromJSON(placementProps);
81
- if (props.viewAttachmentId && props.sheetToSpatialTransform) {
82
- this.viewAttachment = {
83
- id: props.viewAttachmentId,
84
- transformToSpatial: core_geometry_1.Transform.fromJSON(JSON.parse(props.sheetToSpatialTransform)),
85
- clip: extractClip(props.sheetClip),
86
- viewId: props.sheetViewId,
87
- };
88
- }
89
- }
90
- /** Return a promise that resolves to the [DrawingViewState]($frontend) corresponding to `this.drawingViewId`, or undefined if an exception occurs. */
91
- async tryLoadDrawingView() {
92
- try {
93
- const view = await this.iModel.views.load(this.drawingViewId);
94
- if (view instanceof core_frontend_1.DrawingViewState)
95
- return view;
96
- }
97
- catch { }
98
- return undefined;
99
- }
100
- /** Return a promise that resolves to the [SpatialViewState]($frontend) corresponding to `this.spatialViewId`, or undefined if an exception occurs. */
101
- async tryLoadSpatialView() {
102
- try {
103
- const view = await this.iModel.views.load(this.spatialViewId);
104
- if (view instanceof core_frontend_1.SpatialViewState)
105
- return view;
106
- }
107
- catch { }
108
- return undefined;
109
- }
110
- /** Return a promise that resolves to the [SheetViewState]($frontend) corresponding to `this.viewAttachment.viewId`; or undefined if there is no corresponding [ViewAttachment]($backend) or an exception occurs. */
111
- async tryLoadSheetView() {
112
- if (undefined === this.viewAttachment || undefined === this.viewAttachment.viewId)
113
- return undefined;
114
- try {
115
- const view = await this.iModel.views.load(this.viewAttachment.viewId);
116
- if (view instanceof core_frontend_1.SheetViewState)
117
- return view;
118
- }
119
- catch { }
120
- return undefined;
121
- }
122
- /** Query the specified iModel for [SectionDrawingLocation]($backend)s and return a list of corresponding [[SectionDrawingLocationState]]s. */
123
- static async queryAll(iModel) {
124
- const states = [];
125
- try {
126
- // eslint-disable-next-line deprecation/deprecation
127
- for await (const row of iModel.query(selectSectionDrawingLocationStatesECSql, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames }))
128
- states.push(new SectionDrawingLocationState(row, iModel));
129
- }
130
- catch {
131
- // If the iModel contains a version of BisCore schema older than 1.12.0, the query will produce an exception due to missing SectionDrawingLocation class. That's fine.
132
- }
133
- return states;
134
- }
135
- }
136
- exports.SectionDrawingLocationState = SectionDrawingLocationState;
43
+ `;
44
+ /** Represents a [SectionDrawingLocation]($backend), including data from related elements like [SectionDrawing]($backend) used in a hyper-modeling context.
45
+ * @see [[SectionMarker]] for a widget that allows the user to interact with a section drawing location.
46
+ * @public
47
+ */
48
+ class SectionDrawingLocationState {
49
+ /** @internal */
50
+ constructor(props, iModel) {
51
+ this.iModel = iModel;
52
+ this.id = props.sectionLocationId;
53
+ this.model = props.sectionLocationModelId;
54
+ this.userLabel = props.userLabel;
55
+ this.category = props.categoryId;
56
+ this.sectionType = props.sectionType;
57
+ this.drawingViewId = props.sectionViewId;
58
+ this.spatialViewId = props.spatialViewId;
59
+ this.drawingToSpatialTransform = core_geometry_1.Transform.fromJSON(JSON.parse(props.drawingToSpatialTransform));
60
+ const extractClip = (str) => {
61
+ let clip;
62
+ if (str) {
63
+ try {
64
+ clip = core_geometry_1.ClipVector.fromJSON(JSON.parse(str));
65
+ }
66
+ catch { }
67
+ }
68
+ return clip;
69
+ };
70
+ this.clip = extractClip(props.clipJSON) ?? core_geometry_1.ClipVector.createEmpty();
71
+ const placementProps = {
72
+ origin: props.origin ?? {},
73
+ angles: {
74
+ yaw: props.yaw,
75
+ pitch: props.pitch,
76
+ roll: props.roll,
77
+ },
78
+ placement: (props.bboxLow && props.bboxHigh) ? { low: props.bboxLow, high: props.bboxHigh } : undefined,
79
+ };
80
+ this.placement = core_common_1.Placement3d.fromJSON(placementProps);
81
+ if (props.viewAttachmentId && props.sheetToSpatialTransform) {
82
+ this.viewAttachment = {
83
+ id: props.viewAttachmentId,
84
+ transformToSpatial: core_geometry_1.Transform.fromJSON(JSON.parse(props.sheetToSpatialTransform)),
85
+ clip: extractClip(props.sheetClip),
86
+ viewId: props.sheetViewId,
87
+ };
88
+ }
89
+ }
90
+ /** Return a promise that resolves to the [DrawingViewState]($frontend) corresponding to `this.drawingViewId`, or undefined if an exception occurs. */
91
+ async tryLoadDrawingView() {
92
+ try {
93
+ const view = await this.iModel.views.load(this.drawingViewId);
94
+ if (view instanceof core_frontend_1.DrawingViewState)
95
+ return view;
96
+ }
97
+ catch { }
98
+ return undefined;
99
+ }
100
+ /** Return a promise that resolves to the [SpatialViewState]($frontend) corresponding to `this.spatialViewId`, or undefined if an exception occurs. */
101
+ async tryLoadSpatialView() {
102
+ try {
103
+ const view = await this.iModel.views.load(this.spatialViewId);
104
+ if (view instanceof core_frontend_1.SpatialViewState)
105
+ return view;
106
+ }
107
+ catch { }
108
+ return undefined;
109
+ }
110
+ /** Return a promise that resolves to the [SheetViewState]($frontend) corresponding to `this.viewAttachment.viewId`; or undefined if there is no corresponding [ViewAttachment]($backend) or an exception occurs. */
111
+ async tryLoadSheetView() {
112
+ if (undefined === this.viewAttachment || undefined === this.viewAttachment.viewId)
113
+ return undefined;
114
+ try {
115
+ const view = await this.iModel.views.load(this.viewAttachment.viewId);
116
+ if (view instanceof core_frontend_1.SheetViewState)
117
+ return view;
118
+ }
119
+ catch { }
120
+ return undefined;
121
+ }
122
+ /** Query the specified iModel for [SectionDrawingLocation]($backend)s and return a list of corresponding [[SectionDrawingLocationState]]s. */
123
+ static async queryAll(iModel) {
124
+ const states = [];
125
+ try {
126
+ // eslint-disable-next-line deprecation/deprecation
127
+ for await (const row of iModel.query(selectSectionDrawingLocationStatesECSql, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames }))
128
+ states.push(new SectionDrawingLocationState(row, iModel));
129
+ }
130
+ catch {
131
+ // If the iModel contains a version of BisCore schema older than 1.12.0, the query will produce an exception due to missing SectionDrawingLocation class. That's fine.
132
+ }
133
+ return states;
134
+ }
135
+ }
136
+ exports.SectionDrawingLocationState = SectionDrawingLocationState;
137
137
  //# sourceMappingURL=SectionDrawingLocationState.js.map
@@ -1,14 +1,14 @@
1
- /** @packageDocumentation
2
- * @module HyperModeling
3
- */
4
- import { TiledGraphicsProvider } from "@itwin/core-frontend";
5
- import { SectionDrawingLocationState } from "./SectionDrawingLocationState";
6
- /** Creates a TiledGraphicsProvider that can be associated with a [Viewport]($frontend) to display 2d section graphics and annotations in the context of a [SpatialViewState]($frontend).
7
- * Typically used indirectly via [[HyperModelingDecorator]].
8
- * @param state The section drawing location specifying which section drawing to display.
9
- * @returns A provider suitable for passing to [Viewport.addTiledGraphicsProvider]($frontend).
10
- * @see [[HyperModelingDecorator.toggleAttachment]] to activate section graphics for a given [[SectionMarker]].
11
- * @public
12
- */
13
- export declare function createSectionGraphicsProvider(state: SectionDrawingLocationState): Promise<TiledGraphicsProvider>;
1
+ /** @packageDocumentation
2
+ * @module HyperModeling
3
+ */
4
+ import { TiledGraphicsProvider } from "@itwin/core-frontend";
5
+ import { SectionDrawingLocationState } from "./SectionDrawingLocationState";
6
+ /** Creates a TiledGraphicsProvider that can be associated with a [Viewport]($frontend) to display 2d section graphics and annotations in the context of a [SpatialViewState]($frontend).
7
+ * Typically used indirectly via [[HyperModelingDecorator]].
8
+ * @param state The section drawing location specifying which section drawing to display.
9
+ * @returns A provider suitable for passing to [Viewport.addTiledGraphicsProvider]($frontend).
10
+ * @see [[HyperModelingDecorator.toggleAttachment]] to activate section graphics for a given [[SectionMarker]].
11
+ * @public
12
+ */
13
+ export declare function createSectionGraphicsProvider(state: SectionDrawingLocationState): Promise<TiledGraphicsProvider>;
14
14
  //# sourceMappingURL=SectionGraphicsProvider.d.ts.map