@itwin/linear-referencing-backend 5.9.0-dev.4 → 5.9.0-dev.6
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/lib/cjs/LinearReferencingElementAspects.d.ts +15 -1
- package/lib/cjs/LinearReferencingElementAspects.d.ts.map +1 -1
- package/lib/cjs/LinearReferencingElementAspects.js +7 -4
- package/lib/cjs/LinearReferencingElementAspects.js.map +1 -1
- package/lib/cjs/LinearReferencingElements.d.ts +67 -1
- package/lib/cjs/LinearReferencingElements.d.ts.map +1 -1
- package/lib/cjs/LinearReferencingElements.js +51 -62
- package/lib/cjs/LinearReferencingElements.js.map +1 -1
- package/lib/cjs/LinearReferencingRelationships.js.map +1 -1
- package/lib/cjs/LinearReferencingSchema.js.map +1 -1
- package/lib/cjs/linear-referencing-backend.js.map +1 -1
- package/lib/esm/LinearReferencingElementAspects.d.ts +15 -1
- package/lib/esm/LinearReferencingElementAspects.d.ts.map +1 -1
- package/lib/esm/LinearReferencingElementAspects.js +8 -5
- package/lib/esm/LinearReferencingElementAspects.js.map +1 -1
- package/lib/esm/LinearReferencingElements.d.ts +67 -1
- package/lib/esm/LinearReferencingElements.d.ts.map +1 -1
- package/lib/esm/LinearReferencingElements.js +52 -63
- package/lib/esm/LinearReferencingElements.js.map +1 -1
- package/lib/esm/LinearReferencingRelationships.js.map +1 -1
- package/lib/esm/LinearReferencingSchema.js.map +1 -1
- package/lib/esm/linear-referencing-backend.js.map +1 -1
- package/package.json +10 -10
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module LinearReferencing
|
|
3
3
|
*/
|
|
4
4
|
import { Id64String } from "@itwin/core-bentley";
|
|
5
|
-
import { IModelDb, PhysicalElement, SpatialLocationElement } from "@itwin/core-backend";
|
|
5
|
+
import { EditTxn, IModelDb, PhysicalElement, SpatialLocationElement } from "@itwin/core-backend";
|
|
6
6
|
import { ElementProps, GeometricElement3dProps, PhysicalElementProps } from "@itwin/core-common";
|
|
7
7
|
import { LinearLocationReference, LinearlyLocatedAttributionProps, LinearlyReferencedAtLocationProps, LinearlyReferencedFromToLocationProps, QueryParams, ReferentElementProps } from "@itwin/linear-referencing-common";
|
|
8
8
|
import { LinearlyReferencedAtLocation, LinearlyReferencedFromToLocation } from "./LinearReferencingElementAspects";
|
|
@@ -35,9 +35,37 @@ export declare class LinearLocation extends LinearLocationElement implements Lin
|
|
|
35
35
|
constructor(props: GeometricElement3dProps, iModel: IModelDb);
|
|
36
36
|
private static toProps;
|
|
37
37
|
static create(iModel: IModelDb, modelId: Id64String, categoryId: Id64String): LinearLocation;
|
|
38
|
+
/** Insert a new `LinearLocation` using an explicit transaction.
|
|
39
|
+
* @beta
|
|
40
|
+
*/
|
|
41
|
+
static insertFromTo(txn: EditTxn, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;
|
|
42
|
+
/** Insert a new `LinearLocation`.
|
|
43
|
+
* @deprecated Use LinearLocation.insertFromTo(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
44
|
+
*/
|
|
38
45
|
static insertFromTo(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;
|
|
46
|
+
/** Insert this `LinearLocation` using an explicit transaction.
|
|
47
|
+
* @beta
|
|
48
|
+
*/
|
|
49
|
+
insertFromTo(txn: EditTxn, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;
|
|
50
|
+
/** Insert this `LinearLocation`.
|
|
51
|
+
* @deprecated Use LinearLocation.insertFromTo(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
52
|
+
*/
|
|
39
53
|
insertFromTo(iModel: IModelDb, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;
|
|
54
|
+
/** Insert a new `LinearLocation` using an explicit transaction.
|
|
55
|
+
* @beta
|
|
56
|
+
*/
|
|
57
|
+
static insertAt(txn: EditTxn, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;
|
|
58
|
+
/** Insert a new `LinearLocation`.
|
|
59
|
+
* @deprecated Use LinearLocation.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
60
|
+
*/
|
|
40
61
|
static insertAt(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;
|
|
62
|
+
/** Insert this `LinearLocation` using an explicit transaction.
|
|
63
|
+
* @beta
|
|
64
|
+
*/
|
|
65
|
+
insertAt(txn: EditTxn, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;
|
|
66
|
+
/** Insert this `LinearLocation`.
|
|
67
|
+
* @deprecated Use LinearLocation.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
68
|
+
*/
|
|
41
69
|
insertAt(iModel: IModelDb, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;
|
|
42
70
|
}
|
|
43
71
|
/** Base class for Physical Elements that are inherently linearly located along a Linear-Element.
|
|
@@ -67,7 +95,21 @@ export declare class Referent extends ReferentElement {
|
|
|
67
95
|
constructor(props: ReferentElementProps, iModel: IModelDb);
|
|
68
96
|
private static toProps;
|
|
69
97
|
static create(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, referencedElementId: Id64String): Referent;
|
|
98
|
+
/** Insert a new `Referent` using an explicit transaction.
|
|
99
|
+
* @beta
|
|
100
|
+
*/
|
|
101
|
+
static insertAt(txn: EditTxn, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, referencedElementId: Id64String): Id64String;
|
|
102
|
+
/** Insert a new `Referent`.
|
|
103
|
+
* @deprecated Use Referent.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
104
|
+
*/
|
|
70
105
|
static insertAt(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, referencedElementId: Id64String): Id64String;
|
|
106
|
+
/** Insert this `Referent` using an explicit transaction.
|
|
107
|
+
* @beta
|
|
108
|
+
*/
|
|
109
|
+
insertAt(txn: EditTxn, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;
|
|
110
|
+
/** Insert this `Referent`.
|
|
111
|
+
* @deprecated Use Referent.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
112
|
+
*/
|
|
71
113
|
insertAt(iModel: IModelDb, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;
|
|
72
114
|
}
|
|
73
115
|
/** A class offering services for LinearlyLocated elements.
|
|
@@ -75,6 +117,15 @@ export declare class Referent extends ReferentElement {
|
|
|
75
117
|
*/
|
|
76
118
|
export declare class LinearlyLocated {
|
|
77
119
|
private static insertBasic;
|
|
120
|
+
/** Insert a new LinearlyLocated element into an iModel at a specific location along an existing Linear-Element.
|
|
121
|
+
* @param txn The EditTxn used to perform inserts.
|
|
122
|
+
* @param elProps The properties of the new element.
|
|
123
|
+
* @param linearElementId The Id of the Linear-Element along which the new LinearlyLocated will be inserted.
|
|
124
|
+
* @param atPosition Linear position.
|
|
125
|
+
* @returns The newly inserted element's Id.
|
|
126
|
+
* @throws [[IModelError]] if unable to insert the element.
|
|
127
|
+
*/
|
|
128
|
+
static insertAt(txn: EditTxn, elProps: ElementProps, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;
|
|
78
129
|
/** Insert a new LinearlyLocated element into an iModel at a specific location along an existing Linear-Element.
|
|
79
130
|
* @param iModel The iModel to insert the new element into.
|
|
80
131
|
* @param elProps The properties of the new element.
|
|
@@ -82,8 +133,18 @@ export declare class LinearlyLocated {
|
|
|
82
133
|
* @param atPosition Linear position.
|
|
83
134
|
* @returns The newly inserted element's Id.
|
|
84
135
|
* @throws [[IModelError]] if unable to insert the element.
|
|
136
|
+
* @deprecated Use LinearlyLocated.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
85
137
|
*/
|
|
86
138
|
static insertAt(iModel: IModelDb, elProps: ElementProps, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;
|
|
139
|
+
/** Insert a new LinearlyLocated element into an iModel at a specific from-to location along an existing Linear-Element.
|
|
140
|
+
* @param txn The EditTxn used to perform inserts.
|
|
141
|
+
* @param elProps The properties of the new element.
|
|
142
|
+
* @param linearElementId The Id of the Linear-Element along which the new LinearlyLocated will be inserted.
|
|
143
|
+
* @param fromToPosition Linear position.
|
|
144
|
+
* @returns The newly inserted element's Id.
|
|
145
|
+
* @throws [[IModelError]] if unable to insert the element.
|
|
146
|
+
*/
|
|
147
|
+
static insertFromTo(txn: EditTxn, elProps: ElementProps, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps): Id64String;
|
|
87
148
|
/** Insert a new LinearlyLocated element into an iModel at a specific from-to location along an existing Linear-Element.
|
|
88
149
|
* @param iModel The iModel to insert the new element into.
|
|
89
150
|
* @param elProps The properties of the new element.
|
|
@@ -91,6 +152,7 @@ export declare class LinearlyLocated {
|
|
|
91
152
|
* @param fromToPosition Linear position.
|
|
92
153
|
* @returns The newly inserted element's Id.
|
|
93
154
|
* @throws [[IModelError]] if unable to insert the element.
|
|
155
|
+
* @deprecated Use LinearlyLocated.insertFromTo(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
94
156
|
*/
|
|
95
157
|
static insertFromTo(iModel: IModelDb, elProps: ElementProps, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps): Id64String;
|
|
96
158
|
private static getLinearLocations;
|
|
@@ -115,16 +177,20 @@ export declare class LinearlyLocated {
|
|
|
115
177
|
* @param linearLocationProps The properties to use to update the LinearlyReferencedAtLocation aspect.
|
|
116
178
|
* @param aspectId The Id of the aspect to update. If not known, the first aspectId will be looked-up.
|
|
117
179
|
* @throws [[IModelError]]
|
|
180
|
+
* @deprecated Use LinearlyLocated.updateAtLocation(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
118
181
|
*/
|
|
119
182
|
static updateAtLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedAtLocationProps, aspectId?: Id64String): void;
|
|
183
|
+
static updateAtLocation(txn: EditTxn, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedAtLocationProps, aspectId?: Id64String): void;
|
|
120
184
|
/** Update an existing LinearlyReferencedFromToLocation aspect within the iModel.
|
|
121
185
|
* @param iModel The iModel to update.
|
|
122
186
|
* @param linearlyLocatedElementId The Id of the owning Linearly Located Element.
|
|
123
187
|
* @param linearLocationProps The properties to use to update the LinearlyReferencedFromToLocation aspect.
|
|
124
188
|
* @param aspectId The Id of the aspect to update. If not known, the first aspectId will be looked-up.
|
|
125
189
|
* @throws [[IModelError]]
|
|
190
|
+
* @deprecated Use LinearlyLocated.updateFromToLocation(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
126
191
|
*/
|
|
127
192
|
static updateFromToLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedFromToLocationProps, aspectId?: Id64String): void;
|
|
193
|
+
static updateFromToLocation(txn: EditTxn, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedFromToLocationProps, aspectId?: Id64String): void;
|
|
128
194
|
/** Query for the Id of the Linear-Element along which the specified LinearlyLocated Element is located.
|
|
129
195
|
* @param iModel The iModel to query from.
|
|
130
196
|
* @param linearlyLocatedElementId The id of the LinearlyLocated Element to query a Linear-Element for.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinearReferencingElements.d.ts","sourceRoot":"","sources":["../../src/LinearReferencingElements.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAoB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,
|
|
1
|
+
{"version":3,"file":"LinearReferencingElements.d.ts","sourceRoot":"","sources":["../../src/LinearReferencingElements.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAoB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAkB,OAAO,EAAiB,QAAQ,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEhI,OAAO,EAAQ,YAAY,EAAE,uBAAuB,EAAe,oBAAoB,EAAkB,MAAM,oBAAoB,CAAC;AACpI,OAAO,EACa,uBAAuB,EAAE,+BAA+B,EAC1E,iCAAiC,EAA+C,qCAAqC,EACrF,WAAW,EAAE,oBAAoB,EAClE,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,4BAA4B,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AACnH,OAAO,EAC+D,iCAAiC,EAAE,0BAA0B,EAClI,MAAM,kCAAkC,CAAC;AAE1C;;GAEG;AACH,8BAAsB,0BAA2B,SAAQ,sBAAsB;IAC7E,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,CAAyC;IAEhF,iBAAiB,CAAC,EAAE,iCAAiC,CAAC;gBAE1C,KAAK,EAAE,+BAA+B,EAAE,MAAM,EAAE,QAAQ;IAKpE,kBAAkB,IAAI,UAAU,GAAG,SAAS;CAGpD;AAED;;GAEG;AACH,8BAAsB,qBAAsB,SAAQ,sBAAuB,YAAW,mBAAmB;IACvG,gBAAgB;IAChB,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gC,GAAG,SAAS;CAStI;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,IAAI,UAAU,GAAG,SAAS,CAAC;CAC9C;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAClE,aAAa,IAAI,4BAA4B,GAAG,SAAS,CAAC;IAC1D,gBAAgB,CAAC,cAAc,EAAE,iCAAiC,EAAE,QAAQ,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;CAClG;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,cAAc,IAAI,4BAA4B,EAAE,CAAC;IACjD,gBAAgB,CAAC,cAAc,EAAE,iCAAiC,EAAE,QAAQ,EAAE,UAAU,GAAG,IAAI,CAAC;CACjG;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE,iBAAiB,IAAI,gCAAgC,GAAG,SAAS,CAAC;IAClE,oBAAoB,CAAC,cAAc,EAAE,qCAAqC,EAAE,QAAQ,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;CAC1G;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB;IACxE,kBAAkB,IAAI,gCAAgC,EAAE,CAAC;IACzD,oBAAoB,CAAC,cAAc,EAAE,qCAAqC,EAAE,QAAQ,EAAE,UAAU,GAAG,IAAI,CAAC;CACzG;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB;;;OAGG;WACW,oBAAoB,CAAC,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,GAAG,uBAAuB,EAAE;CAwBvI"}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* @module LinearReferencing
|
|
7
7
|
*/
|
|
8
8
|
import { assert, DbResult } from "@itwin/core-bentley";
|
|
9
|
-
import { PhysicalElement, SpatialLocationElement } from "@itwin/core-backend";
|
|
9
|
+
import { EditTxn, PhysicalElement, SpatialLocationElement } from "@itwin/core-backend";
|
|
10
|
+
import { _implicitTxn } from "@itwin/core-backend/lib/cjs/internal/Symbols";
|
|
10
11
|
import { Code, IModelError, RelatedElement } from "@itwin/core-common";
|
|
11
12
|
import { ComparisonOption, LinearlyReferencedLocationType, } from "@itwin/linear-referencing-common";
|
|
12
13
|
import { LinearlyReferencedAtLocation, LinearlyReferencedFromToLocation } from "./LinearReferencingElementAspects";
|
|
@@ -60,24 +61,28 @@ export class LinearLocation extends LinearLocationElement {
|
|
|
60
61
|
static create(iModel, modelId, categoryId) {
|
|
61
62
|
return new LinearLocation(this.toProps(modelId, categoryId), iModel);
|
|
62
63
|
}
|
|
63
|
-
static insertFromTo(
|
|
64
|
-
const
|
|
65
|
-
|
|
64
|
+
static insertFromTo(txnOrIModel, modelId, categoryId, linearElementId, fromToPosition, locatedElementId) {
|
|
65
|
+
const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];
|
|
66
|
+
const newId = LinearlyLocated.insertFromTo(txn, this.toProps(modelId, categoryId), linearElementId, fromToPosition);
|
|
67
|
+
ILinearLocationLocatesElement.insert(txn, newId, locatedElementId);
|
|
66
68
|
return newId;
|
|
67
69
|
}
|
|
68
|
-
insertFromTo(
|
|
69
|
-
const
|
|
70
|
-
|
|
70
|
+
insertFromTo(txnOrIModel, linearElementId, fromToPosition, locatedElementId) {
|
|
71
|
+
const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];
|
|
72
|
+
const newId = LinearlyLocated.insertFromTo(txn, this.toJSON(), linearElementId, fromToPosition);
|
|
73
|
+
ILinearLocationLocatesElement.insert(txn, newId, locatedElementId);
|
|
71
74
|
return newId;
|
|
72
75
|
}
|
|
73
|
-
static insertAt(
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
+
static insertAt(txnOrIModel, modelId, categoryId, linearElementId, atPosition, locatedElementId) {
|
|
77
|
+
const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];
|
|
78
|
+
const newId = LinearlyLocated.insertAt(txn, this.toProps(modelId, categoryId), linearElementId, atPosition);
|
|
79
|
+
ILinearLocationLocatesElement.insert(txn, newId, locatedElementId);
|
|
76
80
|
return newId;
|
|
77
81
|
}
|
|
78
|
-
insertAt(
|
|
79
|
-
const
|
|
80
|
-
|
|
82
|
+
insertAt(txnOrIModel, linearElementId, atPosition, locatedElementId) {
|
|
83
|
+
const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];
|
|
84
|
+
const newId = LinearlyLocated.insertAt(txn, this.toJSON(), linearElementId, atPosition);
|
|
85
|
+
ILinearLocationLocatesElement.insert(txn, newId, locatedElementId);
|
|
81
86
|
return newId;
|
|
82
87
|
}
|
|
83
88
|
}
|
|
@@ -128,11 +133,13 @@ export class Referent extends ReferentElement {
|
|
|
128
133
|
static create(iModel, modelId, categoryId, referencedElementId) {
|
|
129
134
|
return new Referent(this.toProps(modelId, categoryId, referencedElementId), iModel);
|
|
130
135
|
}
|
|
131
|
-
static insertAt(
|
|
132
|
-
|
|
136
|
+
static insertAt(txnOrIModel, modelId, categoryId, linearElementId, atPosition, referencedElementId) {
|
|
137
|
+
const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];
|
|
138
|
+
return LinearlyLocated.insertAt(txn, this.toProps(modelId, categoryId, referencedElementId), linearElementId, atPosition);
|
|
133
139
|
}
|
|
134
|
-
insertAt(
|
|
135
|
-
|
|
140
|
+
insertAt(txnOrIModel, linearElementId, atPosition) {
|
|
141
|
+
const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];
|
|
142
|
+
return LinearlyLocated.insertAt(txn, this.toJSON(), linearElementId, atPosition);
|
|
136
143
|
}
|
|
137
144
|
}
|
|
138
145
|
class ECSQLGenImpl {
|
|
@@ -407,36 +414,22 @@ class QueryLinearLocationsECSQLGen {
|
|
|
407
414
|
* @beta
|
|
408
415
|
*/
|
|
409
416
|
export class LinearlyLocated {
|
|
410
|
-
static insertBasic(
|
|
411
|
-
const newId =
|
|
412
|
-
const linearlyLocatedAlongLinearElement = ILinearlyLocatedAlongILinearElement.create(iModel, newId, linearElementId);
|
|
413
|
-
linearlyLocatedAlongLinearElement.insert();
|
|
417
|
+
static insertBasic(txn, elProps, linearElementId) {
|
|
418
|
+
const newId = txn.insertElement(elProps);
|
|
419
|
+
const linearlyLocatedAlongLinearElement = ILinearlyLocatedAlongILinearElement.create(txn.iModel, newId, linearElementId);
|
|
420
|
+
linearlyLocatedAlongLinearElement.insert(txn);
|
|
414
421
|
return newId;
|
|
415
422
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
* @param atPosition Linear position.
|
|
421
|
-
* @returns The newly inserted element's Id.
|
|
422
|
-
* @throws [[IModelError]] if unable to insert the element.
|
|
423
|
-
*/
|
|
424
|
-
static insertAt(iModel, elProps, linearElementId, atPosition) {
|
|
425
|
-
const newId = this.insertBasic(iModel, elProps, linearElementId);
|
|
426
|
-
LinearlyReferencedAtLocation.insert(iModel, newId, atPosition.atPosition, (atPosition.fromReferent === undefined) ? undefined : atPosition.fromReferent.id);
|
|
423
|
+
static insertAt(txnOrIModel, elProps, linearElementId, atPosition) {
|
|
424
|
+
const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];
|
|
425
|
+
const newId = this.insertBasic(txn, elProps, linearElementId);
|
|
426
|
+
LinearlyReferencedAtLocation.insert(txn, newId, atPosition.atPosition, atPosition.fromReferent === undefined ? undefined : atPosition.fromReferent.id);
|
|
427
427
|
return newId;
|
|
428
428
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
* @param fromToPosition Linear position.
|
|
434
|
-
* @returns The newly inserted element's Id.
|
|
435
|
-
* @throws [[IModelError]] if unable to insert the element.
|
|
436
|
-
*/
|
|
437
|
-
static insertFromTo(iModel, elProps, linearElementId, fromToPosition) {
|
|
438
|
-
const newId = this.insertBasic(iModel, elProps, linearElementId);
|
|
439
|
-
LinearlyReferencedFromToLocation.insert(iModel, newId, fromToPosition.fromPosition, fromToPosition.toPosition, (fromToPosition.fromPositionFromReferent === undefined) ? undefined : fromToPosition.fromPositionFromReferent.id, (fromToPosition.toPositionFromReferent === undefined) ? undefined : fromToPosition.toPositionFromReferent.id);
|
|
429
|
+
static insertFromTo(txnOrIModel, elProps, linearElementId, fromToPosition) {
|
|
430
|
+
const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];
|
|
431
|
+
const newId = this.insertBasic(txn, elProps, linearElementId);
|
|
432
|
+
LinearlyReferencedFromToLocation.insert(txn, newId, fromToPosition.fromPosition, fromToPosition.toPosition, fromToPosition.fromPositionFromReferent === undefined ? undefined : fromToPosition.fromPositionFromReferent.id, fromToPosition.toPositionFromReferent === undefined ? undefined : fromToPosition.toPositionFromReferent.id);
|
|
440
433
|
return newId;
|
|
441
434
|
}
|
|
442
435
|
static getLinearLocations(iModel, linearlyLocatedElementId, fullClassName) {
|
|
@@ -484,19 +477,17 @@ export class LinearlyLocated {
|
|
|
484
477
|
return linearLocations[0];
|
|
485
478
|
}
|
|
486
479
|
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
* @param linearLocationProps The properties to use to update the LinearlyReferencedAtLocation aspect.
|
|
491
|
-
* @param aspectId The Id of the aspect to update. If not known, the first aspectId will be looked-up.
|
|
492
|
-
* @throws [[IModelError]]
|
|
493
|
-
*/
|
|
494
|
-
static updateAtLocation(iModel, linearlyLocatedElementId, linearLocationProps, aspectId) {
|
|
480
|
+
static updateAtLocation(txnOrIModel, linearlyLocatedElementId, linearLocationProps, aspectId) {
|
|
481
|
+
const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];
|
|
482
|
+
const iModel = txn.iModel;
|
|
495
483
|
let linearLocAspectId;
|
|
496
484
|
if (aspectId !== undefined)
|
|
497
485
|
linearLocAspectId = aspectId;
|
|
498
486
|
else {
|
|
499
|
-
|
|
487
|
+
const queriedAspectId = this.queryFirstLinearLocationAspectId(iModel, linearlyLocatedElementId, "LinearlyReferencedAtLocation");
|
|
488
|
+
if (queriedAspectId === undefined)
|
|
489
|
+
throw new Error("LinearlyReferencedAtLocation aspect not found");
|
|
490
|
+
linearLocAspectId = queriedAspectId;
|
|
500
491
|
}
|
|
501
492
|
const linearLocationAspectProps = {
|
|
502
493
|
id: linearLocAspectId,
|
|
@@ -505,21 +496,19 @@ export class LinearlyLocated {
|
|
|
505
496
|
atPosition: linearLocationProps.atPosition,
|
|
506
497
|
fromReferent: linearLocationProps.fromReferent,
|
|
507
498
|
};
|
|
508
|
-
|
|
499
|
+
txn.updateAspect(linearLocationAspectProps);
|
|
509
500
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
* @param linearLocationProps The properties to use to update the LinearlyReferencedFromToLocation aspect.
|
|
514
|
-
* @param aspectId The Id of the aspect to update. If not known, the first aspectId will be looked-up.
|
|
515
|
-
* @throws [[IModelError]]
|
|
516
|
-
*/
|
|
517
|
-
static updateFromToLocation(iModel, linearlyLocatedElementId, linearLocationProps, aspectId) {
|
|
501
|
+
static updateFromToLocation(txnOrIModel, linearlyLocatedElementId, linearLocationProps, aspectId) {
|
|
502
|
+
const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];
|
|
503
|
+
const iModel = txn.iModel;
|
|
518
504
|
let linearLocAspectId;
|
|
519
505
|
if (aspectId !== undefined)
|
|
520
506
|
linearLocAspectId = aspectId;
|
|
521
507
|
else {
|
|
522
|
-
|
|
508
|
+
const queriedAspectId = this.queryFirstLinearLocationAspectId(iModel, linearlyLocatedElementId, "LinearlyReferencedFromToLocation");
|
|
509
|
+
if (queriedAspectId === undefined)
|
|
510
|
+
throw new Error("LinearlyReferencedFromToLocation aspect not found");
|
|
511
|
+
linearLocAspectId = queriedAspectId;
|
|
523
512
|
}
|
|
524
513
|
const linearLocationAspectProps = {
|
|
525
514
|
id: linearLocAspectId,
|
|
@@ -530,7 +519,7 @@ export class LinearlyLocated {
|
|
|
530
519
|
toPosition: linearLocationProps.toPosition,
|
|
531
520
|
toPositionFromReferent: linearLocationProps.toPositionFromReferent,
|
|
532
521
|
};
|
|
533
|
-
|
|
522
|
+
txn.updateAspect(linearLocationAspectProps);
|
|
534
523
|
}
|
|
535
524
|
/** Query for the Id of the Linear-Element along which the specified LinearlyLocated Element is located.
|
|
536
525
|
* @param iModel The iModel to query from.
|