@itwin/linear-referencing-backend 4.0.0-dev.8 → 4.0.0-dev.81

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 CHANGED
@@ -1,6 +1,46 @@
1
1
  # Change Log - @itwin/linear-referencing-backend
2
2
 
3
- This log was last generated on Thu, 26 Jan 2023 22:53:27 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 12 Apr 2023 13:12:42 GMT and should not be manually modified.
4
+
5
+ ## 3.7.2
6
+ Wed, 12 Apr 2023 13:12:42 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.7.1
11
+ Mon, 03 Apr 2023 15:15:37 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 3.7.0
16
+ Wed, 29 Mar 2023 15:02:27 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 3.6.3
21
+ Mon, 27 Mar 2023 16:26:47 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 3.6.2
26
+ Fri, 17 Mar 2023 17:52:32 GMT
27
+
28
+ _Version update only_
29
+
30
+ ## 3.6.1
31
+ Fri, 24 Feb 2023 22:00:48 GMT
32
+
33
+ _Version update only_
34
+
35
+ ## 3.6.0
36
+ Wed, 08 Feb 2023 14:58:40 GMT
37
+
38
+ _Version update only_
39
+
40
+ ## 3.5.6
41
+ Fri, 24 Feb 2023 16:02:47 GMT
42
+
43
+ _Version update only_
4
44
 
5
45
  ## 3.5.5
6
46
  Thu, 26 Jan 2023 22:53:27 GMT
@@ -1,54 +1,54 @@
1
- /** @packageDocumentation
2
- * @module LinearReferencing
3
- */
4
- import { Id64String } from "@itwin/core-bentley";
5
- import { ElementMultiAspect, IModelDb } from "@itwin/core-backend";
6
- import { DistanceExpressionProps, LinearlyReferencedAtLocationAspectProps, LinearlyReferencedFromToLocationAspectProps } from "@itwin/linear-referencing-common";
7
- import { LinearlyReferencedAtPositionRefersToReferent, LinearlyReferencedFromPositionRefersToReferent, LinearlyReferencedToPositionRefersToReferent } from "./LinearReferencingRelationships";
8
- /** Core structure carrying linearly-referenced information.
9
- * @beta
10
- */
11
- export declare class DistanceExpression implements DistanceExpressionProps {
12
- distanceAlongFromStart: number;
13
- lateralOffsetFromILinearElement?: number;
14
- verticalOffsetFromILinearElement?: number;
15
- distanceAlongFromReferent?: number;
16
- constructor(props: DistanceExpressionProps);
17
- static fromJSON(json: DistanceExpressionProps): DistanceExpression;
18
- }
19
- /** Base class for multi-aspects carrying linearly-referenced locations.
20
- * @beta
21
- */
22
- export declare class LinearlyReferencedLocation extends ElementMultiAspect {
23
- /** @internal */
24
- static get className(): string;
25
- }
26
- /** Concrete multi-aspect class carrying 'at' linearly-referenced positions along a Linear-Element.
27
- * @beta
28
- */
29
- export declare class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {
30
- /** @internal */
31
- static get className(): string;
32
- atPosition: DistanceExpression;
33
- fromReferent?: LinearlyReferencedAtPositionRefersToReferent;
34
- constructor(props: LinearlyReferencedAtLocationAspectProps, iModel: IModelDb);
35
- private static toProps;
36
- static create(iModel: IModelDb, locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocation;
37
- static insert(iModel: IModelDb, locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): void;
38
- }
39
- /** Concrete multi-aspect class carrying 'from-to' linearly-referenced positions along a Linear-Element.
40
- * @beta
41
- */
42
- export declare class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation {
43
- /** @internal */
44
- static get className(): string;
45
- fromPosition: DistanceExpression;
46
- fromPositionFromReferent?: LinearlyReferencedFromPositionRefersToReferent;
47
- toPosition: DistanceExpression;
48
- toPositionFromReferent?: LinearlyReferencedToPositionRefersToReferent;
49
- constructor(props: LinearlyReferencedFromToLocationAspectProps, iModel: IModelDb);
50
- private static toProps;
51
- static create(iModel: IModelDb, locatedElementId: Id64String, from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocation;
52
- static insert(iModel: IModelDb, locatedElementId: Id64String, from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;
53
- }
1
+ /** @packageDocumentation
2
+ * @module LinearReferencing
3
+ */
4
+ import { Id64String } from "@itwin/core-bentley";
5
+ import { ElementMultiAspect, IModelDb } from "@itwin/core-backend";
6
+ import { DistanceExpressionProps, LinearlyReferencedAtLocationAspectProps, LinearlyReferencedFromToLocationAspectProps } from "@itwin/linear-referencing-common";
7
+ import { LinearlyReferencedAtPositionRefersToReferent, LinearlyReferencedFromPositionRefersToReferent, LinearlyReferencedToPositionRefersToReferent } from "./LinearReferencingRelationships";
8
+ /** Core structure carrying linearly-referenced information.
9
+ * @beta
10
+ */
11
+ export declare class DistanceExpression implements DistanceExpressionProps {
12
+ distanceAlongFromStart: number;
13
+ lateralOffsetFromILinearElement?: number;
14
+ verticalOffsetFromILinearElement?: number;
15
+ distanceAlongFromReferent?: number;
16
+ constructor(props: DistanceExpressionProps);
17
+ static fromJSON(json: DistanceExpressionProps): DistanceExpression;
18
+ }
19
+ /** Base class for multi-aspects carrying linearly-referenced locations.
20
+ * @beta
21
+ */
22
+ export declare class LinearlyReferencedLocation extends ElementMultiAspect {
23
+ /** @internal */
24
+ static get className(): string;
25
+ }
26
+ /** Concrete multi-aspect class carrying 'at' linearly-referenced positions along a Linear-Element.
27
+ * @beta
28
+ */
29
+ export declare class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {
30
+ /** @internal */
31
+ static get className(): string;
32
+ atPosition: DistanceExpression;
33
+ fromReferent?: LinearlyReferencedAtPositionRefersToReferent;
34
+ constructor(props: LinearlyReferencedAtLocationAspectProps, iModel: IModelDb);
35
+ private static toProps;
36
+ static create(iModel: IModelDb, locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocation;
37
+ static insert(iModel: IModelDb, locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): void;
38
+ }
39
+ /** Concrete multi-aspect class carrying 'from-to' linearly-referenced positions along a Linear-Element.
40
+ * @beta
41
+ */
42
+ export declare class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation {
43
+ /** @internal */
44
+ static get className(): string;
45
+ fromPosition: DistanceExpression;
46
+ fromPositionFromReferent?: LinearlyReferencedFromPositionRefersToReferent;
47
+ toPosition: DistanceExpression;
48
+ toPositionFromReferent?: LinearlyReferencedToPositionRefersToReferent;
49
+ constructor(props: LinearlyReferencedFromToLocationAspectProps, iModel: IModelDb);
50
+ private static toProps;
51
+ static create(iModel: IModelDb, locatedElementId: Id64String, from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocation;
52
+ static insert(iModel: IModelDb, locatedElementId: Id64String, from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;
53
+ }
54
54
  //# sourceMappingURL=LinearReferencingElementAspects.d.ts.map
@@ -1,96 +1,96 @@
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 LinearReferencing
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.LinearlyReferencedFromToLocation = exports.LinearlyReferencedAtLocation = exports.LinearlyReferencedLocation = exports.DistanceExpression = void 0;
11
- const core_bentley_1 = require("@itwin/core-bentley");
12
- const core_backend_1 = require("@itwin/core-backend");
13
- const core_common_1 = require("@itwin/core-common");
14
- const LinearReferencingRelationships_1 = require("./LinearReferencingRelationships");
15
- /** Core structure carrying linearly-referenced information.
16
- * @beta
17
- */
18
- class DistanceExpression {
19
- constructor(props) {
20
- this.distanceAlongFromStart = core_bentley_1.JsonUtils.asDouble(props.distanceAlongFromStart);
21
- this.lateralOffsetFromILinearElement = core_bentley_1.JsonUtils.asDouble(props.lateralOffsetFromILinearElement);
22
- this.verticalOffsetFromILinearElement = core_bentley_1.JsonUtils.asDouble(props.verticalOffsetFromILinearElement);
23
- this.distanceAlongFromReferent = core_bentley_1.JsonUtils.asDouble(props.distanceAlongFromReferent);
24
- }
25
- static fromJSON(json) { return new DistanceExpression(json); }
26
- }
27
- exports.DistanceExpression = DistanceExpression;
28
- /** Base class for multi-aspects carrying linearly-referenced locations.
29
- * @beta
30
- */
31
- class LinearlyReferencedLocation extends core_backend_1.ElementMultiAspect {
32
- /** @internal */
33
- static get className() { return "LinearlyReferencedLocation"; }
34
- }
35
- exports.LinearlyReferencedLocation = LinearlyReferencedLocation;
36
- /** Concrete multi-aspect class carrying 'at' linearly-referenced positions along a Linear-Element.
37
- * @beta
38
- */
39
- class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {
40
- constructor(props, iModel) {
41
- super(props, iModel);
42
- this.atPosition = DistanceExpression.fromJSON(props.atPosition);
43
- this.fromReferent = core_common_1.RelatedElement.fromJSON(props.fromReferent);
44
- }
45
- /** @internal */
46
- static get className() { return "LinearlyReferencedAtLocation"; }
47
- static toProps(locatedElementId, at, fromReferentId) {
48
- const props = {
49
- classFullName: LinearlyReferencedAtLocation.classFullName,
50
- element: { id: locatedElementId },
51
- atPosition: at,
52
- fromReferent: (fromReferentId === undefined) ? undefined : new LinearReferencingRelationships_1.LinearlyReferencedAtPositionRefersToReferent(fromReferentId),
53
- };
54
- return props;
55
- }
56
- static create(iModel, locatedElementId, at, fromReferentId) {
57
- return new LinearlyReferencedAtLocation(this.toProps(locatedElementId, at, fromReferentId), iModel);
58
- }
59
- static insert(iModel, locatedElementId, at, fromReferentId) {
60
- iModel.elements.insertAspect(this.toProps(locatedElementId, at, fromReferentId));
61
- }
62
- }
63
- exports.LinearlyReferencedAtLocation = LinearlyReferencedAtLocation;
64
- /** Concrete multi-aspect class carrying 'from-to' linearly-referenced positions along a Linear-Element.
65
- * @beta
66
- */
67
- class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation {
68
- constructor(props, iModel) {
69
- super(props, iModel);
70
- this.fromPosition = DistanceExpression.fromJSON(props.fromPosition);
71
- this.toPosition = DistanceExpression.fromJSON(props.toPosition);
72
- this.fromPositionFromReferent = core_common_1.RelatedElement.fromJSON(props.fromPositionFromReferent);
73
- this.toPositionFromReferent = core_common_1.RelatedElement.fromJSON(props.toPositionFromReferent);
74
- }
75
- /** @internal */
76
- static get className() { return "LinearlyReferencedFromToLocation"; }
77
- static toProps(locatedElementId, from, to, fromReferentId, toReferentId) {
78
- const props = {
79
- classFullName: LinearlyReferencedFromToLocation.classFullName,
80
- element: { id: locatedElementId },
81
- fromPosition: from,
82
- fromPositionFromReferent: (fromReferentId === undefined) ? undefined : new LinearReferencingRelationships_1.LinearlyReferencedFromPositionRefersToReferent(fromReferentId),
83
- toPosition: to,
84
- toPositionFromReferent: (toReferentId === undefined) ? undefined : new LinearReferencingRelationships_1.LinearlyReferencedToPositionRefersToReferent(toReferentId),
85
- };
86
- return props;
87
- }
88
- static create(iModel, locatedElementId, from, to, fromReferentId, toReferentId) {
89
- return new LinearlyReferencedFromToLocation(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId), iModel);
90
- }
91
- static insert(iModel, locatedElementId, from, to, fromReferentId, toReferentId) {
92
- iModel.elements.insertAspect(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId));
93
- }
94
- }
95
- exports.LinearlyReferencedFromToLocation = LinearlyReferencedFromToLocation;
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 LinearReferencing
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.LinearlyReferencedFromToLocation = exports.LinearlyReferencedAtLocation = exports.LinearlyReferencedLocation = exports.DistanceExpression = void 0;
11
+ const core_bentley_1 = require("@itwin/core-bentley");
12
+ const core_backend_1 = require("@itwin/core-backend");
13
+ const core_common_1 = require("@itwin/core-common");
14
+ const LinearReferencingRelationships_1 = require("./LinearReferencingRelationships");
15
+ /** Core structure carrying linearly-referenced information.
16
+ * @beta
17
+ */
18
+ class DistanceExpression {
19
+ constructor(props) {
20
+ this.distanceAlongFromStart = core_bentley_1.JsonUtils.asDouble(props.distanceAlongFromStart);
21
+ this.lateralOffsetFromILinearElement = core_bentley_1.JsonUtils.asDouble(props.lateralOffsetFromILinearElement);
22
+ this.verticalOffsetFromILinearElement = core_bentley_1.JsonUtils.asDouble(props.verticalOffsetFromILinearElement);
23
+ this.distanceAlongFromReferent = core_bentley_1.JsonUtils.asDouble(props.distanceAlongFromReferent);
24
+ }
25
+ static fromJSON(json) { return new DistanceExpression(json); }
26
+ }
27
+ exports.DistanceExpression = DistanceExpression;
28
+ /** Base class for multi-aspects carrying linearly-referenced locations.
29
+ * @beta
30
+ */
31
+ class LinearlyReferencedLocation extends core_backend_1.ElementMultiAspect {
32
+ /** @internal */
33
+ static get className() { return "LinearlyReferencedLocation"; }
34
+ }
35
+ exports.LinearlyReferencedLocation = LinearlyReferencedLocation;
36
+ /** Concrete multi-aspect class carrying 'at' linearly-referenced positions along a Linear-Element.
37
+ * @beta
38
+ */
39
+ class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {
40
+ /** @internal */
41
+ static get className() { return "LinearlyReferencedAtLocation"; }
42
+ constructor(props, iModel) {
43
+ super(props, iModel);
44
+ this.atPosition = DistanceExpression.fromJSON(props.atPosition);
45
+ this.fromReferent = core_common_1.RelatedElement.fromJSON(props.fromReferent);
46
+ }
47
+ static toProps(locatedElementId, at, fromReferentId) {
48
+ const props = {
49
+ classFullName: LinearlyReferencedAtLocation.classFullName,
50
+ element: { id: locatedElementId },
51
+ atPosition: at,
52
+ fromReferent: (fromReferentId === undefined) ? undefined : new LinearReferencingRelationships_1.LinearlyReferencedAtPositionRefersToReferent(fromReferentId),
53
+ };
54
+ return props;
55
+ }
56
+ static create(iModel, locatedElementId, at, fromReferentId) {
57
+ return new LinearlyReferencedAtLocation(this.toProps(locatedElementId, at, fromReferentId), iModel);
58
+ }
59
+ static insert(iModel, locatedElementId, at, fromReferentId) {
60
+ iModel.elements.insertAspect(this.toProps(locatedElementId, at, fromReferentId));
61
+ }
62
+ }
63
+ exports.LinearlyReferencedAtLocation = LinearlyReferencedAtLocation;
64
+ /** Concrete multi-aspect class carrying 'from-to' linearly-referenced positions along a Linear-Element.
65
+ * @beta
66
+ */
67
+ class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation {
68
+ /** @internal */
69
+ static get className() { return "LinearlyReferencedFromToLocation"; }
70
+ constructor(props, iModel) {
71
+ super(props, iModel);
72
+ this.fromPosition = DistanceExpression.fromJSON(props.fromPosition);
73
+ this.toPosition = DistanceExpression.fromJSON(props.toPosition);
74
+ this.fromPositionFromReferent = core_common_1.RelatedElement.fromJSON(props.fromPositionFromReferent);
75
+ this.toPositionFromReferent = core_common_1.RelatedElement.fromJSON(props.toPositionFromReferent);
76
+ }
77
+ static toProps(locatedElementId, from, to, fromReferentId, toReferentId) {
78
+ const props = {
79
+ classFullName: LinearlyReferencedFromToLocation.classFullName,
80
+ element: { id: locatedElementId },
81
+ fromPosition: from,
82
+ fromPositionFromReferent: (fromReferentId === undefined) ? undefined : new LinearReferencingRelationships_1.LinearlyReferencedFromPositionRefersToReferent(fromReferentId),
83
+ toPosition: to,
84
+ toPositionFromReferent: (toReferentId === undefined) ? undefined : new LinearReferencingRelationships_1.LinearlyReferencedToPositionRefersToReferent(toReferentId),
85
+ };
86
+ return props;
87
+ }
88
+ static create(iModel, locatedElementId, from, to, fromReferentId, toReferentId) {
89
+ return new LinearlyReferencedFromToLocation(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId), iModel);
90
+ }
91
+ static insert(iModel, locatedElementId, from, to, fromReferentId, toReferentId) {
92
+ iModel.elements.insertAspect(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId));
93
+ }
94
+ }
95
+ exports.LinearlyReferencedFromToLocation = LinearlyReferencedFromToLocation;
96
96
  //# sourceMappingURL=LinearReferencingElementAspects.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinearReferencingElementAspects.js","sourceRoot":"","sources":["../../src/LinearReferencingElementAspects.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAC5D,sDAAmE;AACnE,oDAAoD;AAIpD,qFAE0C;AAE1C;;GAEG;AACH,MAAa,kBAAkB;IAM7B,YAAY,KAA8B;QACxC,IAAI,CAAC,sBAAsB,GAAG,wBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC/E,IAAI,CAAC,+BAA+B,GAAG,wBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACjG,IAAI,CAAC,gCAAgC,GAAG,wBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACnG,IAAI,CAAC,yBAAyB,GAAG,wBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACvF,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,IAA6B,IAAwB,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACnH;AAdD,gDAcC;AAED;;GAEG;AACH,MAAa,0BAA2B,SAAQ,iCAAkB;IAChE,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,4BAA4B,CAAC,CAAC,CAAC;CACxF;AAHD,gEAGC;AAED;;GAEG;AACH,MAAa,4BAA6B,SAAQ,0BAA0B;IAO1E,YAAY,KAA8C,EAAE,MAAgB;QAC1E,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAChE,IA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YAAyB;QACxG,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,EAAE,EAAE,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC;IACvG,CAAC;CACF;AAxCD,4EAwCC","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 LinearReferencing\r\n */\r\n\r\nimport { Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { ElementMultiAspect, IModelDb } from \"@itwin/core-backend\";\r\nimport { RelatedElement } from \"@itwin/core-common\";\r\nimport {\r\n DistanceExpressionProps, LinearlyReferencedAtLocationAspectProps, LinearlyReferencedFromToLocationAspectProps,\r\n} from \"@itwin/linear-referencing-common\";\r\nimport {\r\n LinearlyReferencedAtPositionRefersToReferent, LinearlyReferencedFromPositionRefersToReferent, LinearlyReferencedToPositionRefersToReferent,\r\n} from \"./LinearReferencingRelationships\";\r\n\r\n/** Core structure carrying linearly-referenced information.\r\n * @beta\r\n */\r\nexport class DistanceExpression implements DistanceExpressionProps {\r\n public distanceAlongFromStart: number;\r\n public lateralOffsetFromILinearElement?: number;\r\n public verticalOffsetFromILinearElement?: number;\r\n public distanceAlongFromReferent?: number;\r\n\r\n constructor(props: DistanceExpressionProps) {\r\n this.distanceAlongFromStart = JsonUtils.asDouble(props.distanceAlongFromStart);\r\n this.lateralOffsetFromILinearElement = JsonUtils.asDouble(props.lateralOffsetFromILinearElement);\r\n this.verticalOffsetFromILinearElement = JsonUtils.asDouble(props.verticalOffsetFromILinearElement);\r\n this.distanceAlongFromReferent = JsonUtils.asDouble(props.distanceAlongFromReferent);\r\n }\r\n\r\n public static fromJSON(json: DistanceExpressionProps): DistanceExpression { return new DistanceExpression(json); }\r\n}\r\n\r\n/** Base class for multi-aspects carrying linearly-referenced locations.\r\n * @beta\r\n */\r\nexport class LinearlyReferencedLocation extends ElementMultiAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"LinearlyReferencedLocation\"; }\r\n}\r\n\r\n/** Concrete multi-aspect class carrying 'at' linearly-referenced positions along a Linear-Element.\r\n * @beta\r\n */\r\nexport class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {\r\n /** @internal */\r\n public static override get className(): string { return \"LinearlyReferencedAtLocation\"; }\r\n\r\n public atPosition: DistanceExpression;\r\n public fromReferent?: LinearlyReferencedAtPositionRefersToReferent;\r\n\r\n constructor(props: LinearlyReferencedAtLocationAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.atPosition = DistanceExpression.fromJSON(props.atPosition);\r\n this.fromReferent = RelatedElement.fromJSON(props.fromReferent);\r\n }\r\n\r\n private static toProps(locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocationAspectProps {\r\n const props: LinearlyReferencedAtLocationAspectProps = {\r\n classFullName: LinearlyReferencedAtLocation.classFullName,\r\n element: { id: locatedElementId },\r\n atPosition: at,\r\n fromReferent: (fromReferentId === undefined) ? undefined : new LinearlyReferencedAtPositionRefersToReferent(fromReferentId),\r\n };\r\n\r\n return props;\r\n }\r\n\r\n public static create(iModel: IModelDb, locatedElementId: Id64String,\r\n at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocation {\r\n return new LinearlyReferencedAtLocation(this.toProps(locatedElementId, at, fromReferentId), iModel);\r\n }\r\n\r\n public static insert(iModel: IModelDb, locatedElementId: Id64String,\r\n at: DistanceExpression, fromReferentId?: Id64String): void {\r\n iModel.elements.insertAspect(this.toProps(locatedElementId, at, fromReferentId));\r\n }\r\n}\r\n\r\n/** Concrete multi-aspect class carrying 'from-to' linearly-referenced positions along a Linear-Element.\r\n * @beta\r\n */\r\nexport class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation {\r\n /** @internal */\r\n public static override get className(): string { return \"LinearlyReferencedFromToLocation\"; }\r\n\r\n public fromPosition: DistanceExpression;\r\n public fromPositionFromReferent?: LinearlyReferencedFromPositionRefersToReferent;\r\n public toPosition: DistanceExpression;\r\n public toPositionFromReferent?: LinearlyReferencedToPositionRefersToReferent;\r\n\r\n constructor(props: LinearlyReferencedFromToLocationAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.fromPosition = DistanceExpression.fromJSON(props.fromPosition);\r\n this.toPosition = DistanceExpression.fromJSON(props.toPosition);\r\n this.fromPositionFromReferent = RelatedElement.fromJSON(props.fromPositionFromReferent);\r\n this.toPositionFromReferent = RelatedElement.fromJSON(props.toPositionFromReferent);\r\n }\r\n\r\n private static toProps(locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocationAspectProps {\r\n const props: LinearlyReferencedFromToLocationAspectProps = {\r\n classFullName: LinearlyReferencedFromToLocation.classFullName,\r\n element: { id: locatedElementId },\r\n fromPosition: from,\r\n fromPositionFromReferent: (fromReferentId === undefined) ? undefined : new LinearlyReferencedFromPositionRefersToReferent(fromReferentId),\r\n toPosition: to,\r\n toPositionFromReferent: (toReferentId === undefined) ? undefined : new LinearlyReferencedToPositionRefersToReferent(toReferentId),\r\n };\r\n\r\n return props;\r\n }\r\n\r\n public static create(iModel: IModelDb, locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocation {\r\n return new LinearlyReferencedFromToLocation(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId), iModel);\r\n }\r\n\r\n public static insert(iModel: IModelDb, locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void {\r\n iModel.elements.insertAspect(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId));\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"LinearReferencingElementAspects.js","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;CACF;AAxCD,4EAwCC","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 LinearReferencing\r\n */\r\n\r\nimport { Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { ElementMultiAspect, IModelDb } from \"@itwin/core-backend\";\r\nimport { RelatedElement } from \"@itwin/core-common\";\r\nimport {\r\n DistanceExpressionProps, LinearlyReferencedAtLocationAspectProps, LinearlyReferencedFromToLocationAspectProps,\r\n} from \"@itwin/linear-referencing-common\";\r\nimport {\r\n LinearlyReferencedAtPositionRefersToReferent, LinearlyReferencedFromPositionRefersToReferent, LinearlyReferencedToPositionRefersToReferent,\r\n} from \"./LinearReferencingRelationships\";\r\n\r\n/** Core structure carrying linearly-referenced information.\r\n * @beta\r\n */\r\nexport class DistanceExpression implements DistanceExpressionProps {\r\n public distanceAlongFromStart: number;\r\n public lateralOffsetFromILinearElement?: number;\r\n public verticalOffsetFromILinearElement?: number;\r\n public distanceAlongFromReferent?: number;\r\n\r\n constructor(props: DistanceExpressionProps) {\r\n this.distanceAlongFromStart = JsonUtils.asDouble(props.distanceAlongFromStart);\r\n this.lateralOffsetFromILinearElement = JsonUtils.asDouble(props.lateralOffsetFromILinearElement);\r\n this.verticalOffsetFromILinearElement = JsonUtils.asDouble(props.verticalOffsetFromILinearElement);\r\n this.distanceAlongFromReferent = JsonUtils.asDouble(props.distanceAlongFromReferent);\r\n }\r\n\r\n public static fromJSON(json: DistanceExpressionProps): DistanceExpression { return new DistanceExpression(json); }\r\n}\r\n\r\n/** Base class for multi-aspects carrying linearly-referenced locations.\r\n * @beta\r\n */\r\nexport class LinearlyReferencedLocation extends ElementMultiAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"LinearlyReferencedLocation\"; }\r\n}\r\n\r\n/** Concrete multi-aspect class carrying 'at' linearly-referenced positions along a Linear-Element.\r\n * @beta\r\n */\r\nexport class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {\r\n /** @internal */\r\n public static override get className(): string { return \"LinearlyReferencedAtLocation\"; }\r\n\r\n public atPosition: DistanceExpression;\r\n public fromReferent?: LinearlyReferencedAtPositionRefersToReferent;\r\n\r\n constructor(props: LinearlyReferencedAtLocationAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.atPosition = DistanceExpression.fromJSON(props.atPosition);\r\n this.fromReferent = RelatedElement.fromJSON(props.fromReferent);\r\n }\r\n\r\n private static toProps(locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocationAspectProps {\r\n const props: LinearlyReferencedAtLocationAspectProps = {\r\n classFullName: LinearlyReferencedAtLocation.classFullName,\r\n element: { id: locatedElementId },\r\n atPosition: at,\r\n fromReferent: (fromReferentId === undefined) ? undefined : new LinearlyReferencedAtPositionRefersToReferent(fromReferentId),\r\n };\r\n\r\n return props;\r\n }\r\n\r\n public static create(iModel: IModelDb, locatedElementId: Id64String,\r\n at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocation {\r\n return new LinearlyReferencedAtLocation(this.toProps(locatedElementId, at, fromReferentId), iModel);\r\n }\r\n\r\n public static insert(iModel: IModelDb, locatedElementId: Id64String,\r\n at: DistanceExpression, fromReferentId?: Id64String): void {\r\n iModel.elements.insertAspect(this.toProps(locatedElementId, at, fromReferentId));\r\n }\r\n}\r\n\r\n/** Concrete multi-aspect class carrying 'from-to' linearly-referenced positions along a Linear-Element.\r\n * @beta\r\n */\r\nexport class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation {\r\n /** @internal */\r\n public static override get className(): string { return \"LinearlyReferencedFromToLocation\"; }\r\n\r\n public fromPosition: DistanceExpression;\r\n public fromPositionFromReferent?: LinearlyReferencedFromPositionRefersToReferent;\r\n public toPosition: DistanceExpression;\r\n public toPositionFromReferent?: LinearlyReferencedToPositionRefersToReferent;\r\n\r\n constructor(props: LinearlyReferencedFromToLocationAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.fromPosition = DistanceExpression.fromJSON(props.fromPosition);\r\n this.toPosition = DistanceExpression.fromJSON(props.toPosition);\r\n this.fromPositionFromReferent = RelatedElement.fromJSON(props.fromPositionFromReferent);\r\n this.toPositionFromReferent = RelatedElement.fromJSON(props.toPositionFromReferent);\r\n }\r\n\r\n private static toProps(locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocationAspectProps {\r\n const props: LinearlyReferencedFromToLocationAspectProps = {\r\n classFullName: LinearlyReferencedFromToLocation.classFullName,\r\n element: { id: locatedElementId },\r\n fromPosition: from,\r\n fromPositionFromReferent: (fromReferentId === undefined) ? undefined : new LinearlyReferencedFromPositionRefersToReferent(fromReferentId),\r\n toPosition: to,\r\n toPositionFromReferent: (toReferentId === undefined) ? undefined : new LinearlyReferencedToPositionRefersToReferent(toReferentId),\r\n };\r\n\r\n return props;\r\n }\r\n\r\n public static create(iModel: IModelDb, locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocation {\r\n return new LinearlyReferencedFromToLocation(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId), iModel);\r\n }\r\n\r\n public static insert(iModel: IModelDb, locatedElementId: Id64String,\r\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void {\r\n iModel.elements.insertAspect(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId));\r\n }\r\n}\r\n"]}