@itwin/linear-referencing-backend 5.9.0-dev.3 → 5.9.0-dev.5
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/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/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinearReferencingElements.js","sourceRoot":"","sources":["../../src/LinearReferencingElements.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmE;AACnE,sDAAuH;AACvH,oDAAoI;AACpI,gFAI0C;AAC1C,uFAAmH;AACnH,qFAE0C;AAE1C;;GAEG;AACH,MAAsB,0BAA2B,SAAQ,qCAAsB;IAC7E,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,4BAA4B,CAAC,CAAC,CAAC;IAEhF,iBAAiB,CAAqC;IAE7D,YAAmB,KAAsC,EAAE,MAAgB;QACzE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,iBAAiB,GAAG,4BAA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U,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;YAErC,OAAO,uBAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC9C,MAAM,iBAAiB,GAA4B;oBACjD,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBAC3C,4BAA4B,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE;oBAC1D,kBAAkB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE;oBAChD,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE;oBAC/C,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;iBAC3C,CAAC;gBAEF,kBAAkB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,kBAAkB,CAAC;IAC5B,CAAC;CACF;AA7BD,sCA6BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module LinearReferencing\n */\n\nimport { assert, DbResult, Id64String } from \"@itwin/core-bentley\";\nimport { ECSqlStatement, ElementAspect, IModelDb, PhysicalElement, SpatialLocationElement } from \"@itwin/core-backend\";\nimport { Code, ElementProps, GeometricElement3dProps, IModelError, PhysicalElementProps, RelatedElement } from \"@itwin/core-common\";\nimport {\n ComparisonOption, LinearLocationReference, LinearlyLocatedAttributionProps, LinearlyReferencedAtLocationAspectProps,\n LinearlyReferencedAtLocationProps, LinearlyReferencedFromToLocationAspectProps, LinearlyReferencedFromToLocationProps,\n LinearlyReferencedLocationType, QueryParams, ReferentElementProps,\n} from \"@itwin/linear-referencing-common\";\nimport { LinearlyReferencedAtLocation, LinearlyReferencedFromToLocation } from \"./LinearReferencingElementAspects\";\nimport {\n ILinearLocationLocatesElement, ILinearlyLocatedAlongILinearElement, ILinearlyLocatedAttributesElement, IReferentReferencesElement,\n} from \"./LinearReferencingRelationships\";\n\n/** Base class for Spatial Location Element subclasses representing properties whose value is located along a Linear-Element and only applies to a portion of an Element.\n * @beta\n */\nexport abstract class LinearlyLocatedAttribution extends SpatialLocationElement {\n /** @internal */\n public static override get className(): string { return \"LinearlyLocatedAttribution\"; }\n\n public attributedElement?: ILinearlyLocatedAttributesElement;\n\n public constructor(props: LinearlyLocatedAttributionProps, iModel: IModelDb) {\n super(props, iModel);\n this.attributedElement = RelatedElement.fromJSON(props.attributedElement);\n }\n\n public getLinearElementId(): Id64String | undefined {\n return LinearlyLocated.getLinearElementId(this.iModel, this.id);\n }\n}\n\n/** Base class for Spatial Location Element implementations that are linearly located along a Linear-Element.\n * @beta\n */\nexport abstract class LinearLocationElement extends SpatialLocationElement implements LinearlyLocatedBase {\n /** @internal */\n public static override get className(): string { return \"LinearLocationElement\"; }\n\n public constructor(props: GeometricElement3dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n public getLinearElementId(): Id64String | undefined {\n return LinearlyLocated.getLinearElementId(this.iModel, this.id);\n }\n}\n\n/** Linear Referencing Location attached to an Element not inherently Linearly Referenced.\n * @beta\n */\nexport class LinearLocation extends LinearLocationElement implements LinearlyLocatedBase {\n /** @internal */\n public static override get className(): string { return \"LinearLocation\"; }\n public constructor(props: GeometricElement3dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n private static toProps(modelId: Id64String, categoryId: Id64String): GeometricElement3dProps {\n const props: GeometricElement3dProps = {\n classFullName: LinearLocation.classFullName,\n category: categoryId,\n model: modelId,\n code: Code.createEmpty(),\n };\n\n return props;\n }\n\n public static create(iModel: IModelDb, modelId: Id64String, categoryId: Id64String): LinearLocation {\n return new LinearLocation(this.toProps(modelId, categoryId), iModel);\n }\n\n public static insertFromTo(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String,\n fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String {\n const newId = LinearlyLocated.insertFromTo(iModel, this.toProps(modelId, categoryId), linearElementId, fromToPosition);\n\n ILinearLocationLocatesElement.insert(iModel, newId, locatedElementId);\n\n return newId;\n }\n\n public insertFromTo(iModel: IModelDb, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String {\n const newId = LinearlyLocated.insertFromTo(iModel, this.toJSON(), linearElementId, fromToPosition);\n\n ILinearLocationLocatesElement.insert(iModel, newId, locatedElementId);\n\n return newId;\n }\n\n public static insertAt(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String,\n atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String {\n const newId = LinearlyLocated.insertAt(iModel, this.toProps(modelId, categoryId), linearElementId, atPosition);\n\n ILinearLocationLocatesElement.insert(iModel, newId, locatedElementId);\n\n return newId;\n }\n\n public insertAt(iModel: IModelDb, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String {\n const newId = LinearlyLocated.insertAt(iModel, this.toJSON(), linearElementId, atPosition);\n\n ILinearLocationLocatesElement.insert(iModel, newId, locatedElementId);\n\n return newId;\n }\n}\n\n/** Base class for Physical Elements that are inherently linearly located along a Linear-Element.\n * @beta\n */\nexport abstract class LinearPhysicalElement extends PhysicalElement {\n /** @internal */\n public static override get className(): string { return \"LinearPhysicalElement\"; }\n\n public constructor(props: PhysicalElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** Spatial Location Element that can play the role of a Referent (known location along a Linear-Element).\n * @beta\n */\nexport abstract class ReferentElement extends SpatialLocationElement implements LinearlyLocatedBase {\n /** @internal */\n public static override get className(): string { return \"ReferentElement\"; }\n\n public referencedElement?: IReferentReferencesElement;\n\n public constructor(props: ReferentElementProps, iModel: IModelDb) {\n super(props, iModel);\n this.referencedElement = RelatedElement.fromJSON(props.referencedElement);\n }\n\n public getLinearElementId(): Id64String | undefined {\n return LinearlyLocated.getLinearElementId(this.iModel, this.id);\n }\n}\n\n/** Referent-implementation turning any bis:SpatialElement not inherently Linearly-Referenced into a Referent for Linear-Referencing purposes.\n * @beta\n */\nexport class Referent extends ReferentElement {\n /** @internal */\n public static override get className(): string { return \"Referent\"; }\n public constructor(props: ReferentElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n private static toProps(modelId: Id64String, categoryId: Id64String, referencedElementId: Id64String): ReferentElementProps {\n const props: ReferentElementProps = {\n classFullName: LinearLocation.classFullName,\n category: categoryId,\n model: modelId,\n code: Code.createEmpty(),\n referencedElement: new IReferentReferencesElement(referencedElementId),\n };\n\n return props;\n }\n\n public static create(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, referencedElementId: Id64String): Referent {\n return new Referent(this.toProps(modelId, categoryId, referencedElementId), iModel);\n }\n\n public static insertAt(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String,\n atPosition: LinearlyReferencedAtLocationProps, referencedElementId: Id64String): Id64String {\n return LinearlyLocated.insertAt(iModel, this.toProps(modelId, categoryId, referencedElementId), linearElementId, atPosition);\n }\n\n public insertAt(iModel: IModelDb, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String {\n return LinearlyLocated.insertAt(iModel, this.toJSON(), linearElementId, atPosition);\n }\n}\n\nabstract class ECSQLGenImpl {\n public abstract genSelect(): string;\n public selectDistinct(): boolean {\n return false;\n }\n public abstract genFromJoin(): string;\n public abstract genWhere(bindVals?: any[], from?: number, inclusiveFrom?: boolean, to?: number, inclusiveTo?: boolean): string;\n public abstract genOrderBy(): string;\n}\n\nclass AtAndFromToECSQLGenImpl extends ECSQLGenImpl {\n public genSelect(): string {\n return \"coalesce(AtLocation.AtPosition.DistanceAlongFromStart, FromToLocation.FromPosition.DistanceAlongFromStart) StartDistanceAlong, \" +\n \"coalesce(AtLocation.AtPosition.DistanceAlongFromStart, FromToLocation.ToPosition.DistanceAlongFromStart) StopDistanceAlong, \" +\n \"coalesce(AtLocation.ECInstanceId, FromToLocation.ECInstanceId) LocationAspectId \";\n }\n public override selectDistinct(): boolean {\n return true;\n }\n public genFromJoin(): string {\n return \"LEFT JOIN LinearReferencing.LinearlyReferencedAtLocation AtLocation ON LinearlyLocated.InstanceId = AtLocation.Element.Id \" +\n \"LEFT JOIN LinearReferencing.LinearlyReferencedFromToLocation FromToLocation ON LinearlyLocated.InstanceId = FromToLocation.Element.Id \";\n }\n public genWhere(bindVals: any[], from?: number, inclusiveFrom?: boolean, to?: number, inclusiveTo?: boolean): string {\n const fromCompOp: string = (inclusiveFrom === undefined || inclusiveFrom) ? \">=\" : \">\";\n const toCompOp: string = (inclusiveTo === undefined || inclusiveTo) ? \"<=\" : \"<\";\n\n let ecSql = \"\";\n if (from !== undefined && to !== undefined) {\n ecSql += \"(AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? AND AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ?) OR (FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? AND FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ?) \" + \"OR (FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? AND FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ?) OR (FromToLocation.FromPosition.DistanceAlongFromStart <= ? AND FromToLocation.ToPosition.DistanceAlongFromStart >= ?) \";\n\n bindVals.push(from);\n bindVals.push(to);\n bindVals.push(from);\n bindVals.push(to);\n bindVals.push(from);\n bindVals.push(to);\n bindVals.push(from);\n bindVals.push(to);\n } else if (from !== undefined) {\n ecSql += \"AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? OR FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? OR FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? \";\n\n bindVals.push(from);\n bindVals.push(from);\n bindVals.push(from);\n } else if (to !== undefined) {\n ecSql += \"AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ? OR FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ? OR FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ? \";\n\n bindVals.push(to);\n bindVals.push(to);\n bindVals.push(to);\n } else {\n ecSql += \"(AtLocation.AtPosition.DistanceAlongFromStart IS NOT NULL) OR \";\n ecSql += \"(FromToLocation.FromPosition.DistanceAlongFromStart IS NOT NULL) \";\n }\n\n return ecSql;\n }\n public genOrderBy(): string {\n return \"coalesce(AtLocation.AtPosition.DistanceAlongFromStart, FromToLocation.FromPosition.DistanceAlongFromStart)\";\n }\n}\n\nclass FromToECSQLGenImpl extends ECSQLGenImpl {\n public genSelect(): string {\n return \"FromToLocation.FromPosition.DistanceAlongFromStart StartDistanceAlong, FromToLocation.ToPosition.DistanceAlongFromStart StopDistanceAlong, FromToLocation.ECInstanceId LocationAspectId \";\n }\n public genFromJoin(): string {\n return \"INNER JOIN LinearReferencing.LinearlyReferencedFromToLocation FromToLocation ON LinearlyLocated.InstanceId = FromToLocation.Element.Id \";\n }\n public genWhere(bindVals: any[], from?: number, inclusiveFrom?: boolean, to?: number, inclusiveTo?: boolean): string {\n const fromCompOp: string = (inclusiveFrom === undefined || inclusiveFrom) ? \">=\" : \">\";\n const toCompOp: string = (inclusiveTo === undefined || inclusiveTo) ? \"<=\" : \"<\";\n\n let ecSql = \"\";\n if (from !== undefined && to !== undefined) {\n ecSql += \"AND ((FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? AND FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ?) OR (FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? AND FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ?) OR (FromToLocation.FromPosition.DistanceAlongFromStart <= ? AND FromToLocation.ToPosition.DistanceAlongFromStart >= ?)) \";\n\n bindVals.push(from);\n bindVals.push(to);\n bindVals.push(from);\n bindVals.push(to);\n bindVals.push(from);\n bindVals.push(to);\n } else if (from !== undefined) {\n ecSql += \"AND (FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? OR FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ?)\";\n\n bindVals.push(from);\n bindVals.push(from);\n } else if (to !== undefined) {\n ecSql += \"AND (FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ? OR FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ?) \";\n\n bindVals.push(to);\n bindVals.push(to);\n } else {\n ecSql += \"FromToLocation.FromPosition.DistanceAlongFromStart IS NOT NULL \";\n }\n\n return ecSql;\n }\n public genOrderBy(): string {\n return \"FromToLocation.FromPosition.DistanceAlongFromStart\";\n }\n}\n\nclass AtECSQLGenImpl extends ECSQLGenImpl {\n public genSelect(): string {\n return \"AtLocation.AtPosition.DistanceAlongFromStart StartDistanceAlong, AtLocation.AtPosition.DistanceAlongFromStart StopDistanceAlong, AtLocation.ECInstanceId LocationAspectId \";\n }\n public genFromJoin(): string {\n return \"INNER JOIN LinearReferencing.LinearlyReferencedAtLocation AtLocation ON LinearlyLocated.InstanceId = AtLocation.Element.Id \";\n }\n public genWhere(bindVals: any[], from?: number, inclusiveFrom?: boolean, to?: number, inclusiveTo?: boolean): string {\n const fromCompOp: string = (inclusiveFrom === undefined || inclusiveFrom) ? \">=\" : \">\";\n const toCompOp: string = (inclusiveTo === undefined || inclusiveTo) ? \"<=\" : \"<\";\n\n let ecSql = \"\";\n if (from !== undefined && to !== undefined) {\n ecSql += \"AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? AND AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ? \";\n\n bindVals.push(from);\n bindVals.push(to);\n } else if (from !== undefined) {\n ecSql += \"AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? \";\n\n bindVals.push(from);\n } else if (to !== undefined) {\n ecSql += \"AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ? \";\n\n bindVals.push(to);\n } else\n ecSql += \"AtLocation.AtPosition.DistanceAlongFromStart IS NOT NULL \";\n\n return ecSql;\n }\n public genOrderBy(): string {\n return \"AtLocation.AtPosition.DistanceAlongFromStart\";\n }\n}\n\nclass QueryLinearLocationsECSQLGen {\n private readonly _params: QueryParams;\n private _ecSql: string;\n\n private _addSelectClause(impl: ECSQLGenImpl): void {\n let select = \"SELECT \";\n\n if (impl.selectDistinct())\n select += \"DISTINCT \";\n\n select += \"LinearlyLocated.InstanceId LinearlyLocatedId, printf('%s:%s', meta.ECSchemaDef.Name, meta.ECClassDef.Name) LinearlyLocatedClassFullName, \";\n select += impl.genSelect();\n\n this._ecSql += select;\n }\n\n private _parseClassFullName(classFullName: string): [string, string] | undefined {\n const parts = classFullName.split(\":\");\n if (parts.length !== 2)\n return undefined;\n\n return [parts[0], parts[1]];\n }\n\n private _genLinearlyLocated(): string {\n return \"meta.ECSchemaDef JOIN meta.ECClassDef USING meta.SchemaOwnsClasses JOIN \" +\n \"(SELECT coalesce(Located.TargetECInstanceId, Along.SourceECInstanceId) InstanceId, \" +\n \"coalesce(Located.TargetECClassId, Along.SourceECClassId) ClassId \" +\n \"FROM LinearReferencing.ILinearlyLocatedAlongILinearElement Along LEFT JOIN \" +\n \"LinearReferencing.ILinearLocationLocatesElement Located ON Along.SourceECInstanceId = Located.SourceECInstanceId \" +\n \"WHERE Along.TargetECInstanceId = ?) LinearlyLocated ON meta.ECClassDef.ECInstanceId = LinearlyLocated.ClassId \";\n }\n\n private _addFromClause(impl: ECSQLGenImpl/* bvector<double>& bindVals */): void {\n let from = \"FROM \";\n from += this._genLinearlyLocated();\n from += impl.genFromJoin();\n\n this._ecSql += from;\n }\n\n private _addWhereClause(impl: ECSQLGenImpl, bindVals: any[]) {\n let where = \"WHERE \";\n\n where += impl.genWhere(\n bindVals,\n this._params.fromDistanceAlong,\n (this._params.fromComparisonOption === undefined ||\n this._params.fromComparisonOption === ComparisonOption.Inclusive),\n this._params.toDistanceAlong,\n (this._params.toComparisonOption === undefined ||\n this._params.toComparisonOption === ComparisonOption.Inclusive));\n\n if (this._params.linearlyLocatedClassFullNames !== undefined) {\n if (where.length > 6)\n where += \"AND \";\n\n if (1 === this._params.linearlyLocatedClassFullNames.length) {\n const classFullName = this._params.linearlyLocatedClassFullNames[0];\n const schemaNameClassName = this._parseClassFullName(classFullName);\n if (schemaNameClassName === undefined)\n throw new IModelError(0, \"Invalid full class name\");\n\n where += `meta.ECSchemaDef.Name='${schemaNameClassName[0]}' AND meta.ECClassDef.Name='${schemaNameClassName[1]}' `;\n } else if (1 < this._params.linearlyLocatedClassFullNames.length) {\n where += \"(\";\n for (const classFullName of this._params.linearlyLocatedClassFullNames) {\n if (classFullName === undefined)\n continue;\n\n const schemaNameClassName = this._parseClassFullName(classFullName);\n if (schemaNameClassName === undefined)\n continue;\n\n where += `(meta.ECSchemaDef.Name='${schemaNameClassName[0]}' AND meta.ECClassDef.Name='${schemaNameClassName[1]}') OR `;\n }\n\n where = where.substring(0, where.length - 4); // Removing last OR\n where += \") \";\n }\n }\n\n this._ecSql += where;\n }\n\n private _addOrderByClause(impl: ECSQLGenImpl): void {\n let orderBy = \"ORDER BY \";\n orderBy += impl.genOrderBy();\n\n this._ecSql += orderBy;\n }\n\n private _createImpl(): ECSQLGenImpl {\n if (this._params.linearlyReferencedLocationTypeFilter === undefined ||\n this._params.linearlyReferencedLocationTypeFilter === LinearlyReferencedLocationType.Any) {\n return new AtAndFromToECSQLGenImpl();\n } else if (this._params.linearlyReferencedLocationTypeFilter === LinearlyReferencedLocationType.FromTo) {\n return new FromToECSQLGenImpl();\n } else {\n return new AtECSQLGenImpl();\n }\n }\n\n public constructor(params: QueryParams) {\n this._params = params;\n this._ecSql = \"\";\n }\n\n public generate(linearElementId: Id64String): [string, any[]] {\n this._ecSql = \"\";\n const impl = this._createImpl();\n\n const bindVals: any[] = [linearElementId];\n this._addSelectClause(impl);\n this._addFromClause(impl);\n this._addWhereClause(impl, bindVals);\n this._addOrderByClause(impl);\n\n return [this._ecSql, bindVals];\n }\n}\n\n/** A class offering services for LinearlyLocated elements.\n * @beta\n */\nexport class LinearlyLocated {\n private static insertBasic(iModel: IModelDb, elProps: ElementProps, linearElementId: Id64String): Id64String {\n const newId = iModel.elements.insertElement(elProps);\n\n const linearlyLocatedAlongLinearElement =\n ILinearlyLocatedAlongILinearElement.create(iModel, newId, linearElementId);\n linearlyLocatedAlongLinearElement.insert();\n\n return newId;\n }\n\n /** Insert a new LinearlyLocated element into an iModel at a specific location along an existing Linear-Element.\n * @param iModel The iModel to insert the new element into.\n * @param elProps The properties of the new element.\n * @param linearElementId The Id of the Linear-Element along which the new LinearlyLocated will be inserted.\n * @param atPosition Linear position.\n * @returns The newly inserted element's Id.\n * @throws [[IModelError]] if unable to insert the element.\n */\n public static insertAt(iModel: IModelDb, elProps: ElementProps, linearElementId: Id64String,\n atPosition: LinearlyReferencedAtLocationProps): Id64String {\n const newId: Id64String = this.insertBasic(iModel, elProps, linearElementId);\n\n LinearlyReferencedAtLocation.insert(iModel, newId, atPosition.atPosition,\n (atPosition.fromReferent === undefined) ? undefined : atPosition.fromReferent.id);\n\n return newId;\n }\n\n /** Insert a new LinearlyLocated element into an iModel at a specific from-to location along an existing Linear-Element.\n * @param iModel The iModel to insert the new element into.\n * @param elProps The properties of the new element.\n * @param linearElementId The Id of the Linear-Element along which the new LinearlyLocated will be inserted.\n * @param fromToPosition Linear position.\n * @returns The newly inserted element's Id.\n * @throws [[IModelError]] if unable to insert the element.\n */\n public static insertFromTo(iModel: IModelDb, elProps: ElementProps, linearElementId: Id64String,\n fromToPosition: LinearlyReferencedFromToLocationProps): Id64String {\n const newId: Id64String = this.insertBasic(iModel, elProps, linearElementId);\n\n LinearlyReferencedFromToLocation.insert(iModel, newId,\n fromToPosition.fromPosition, fromToPosition.toPosition,\n (fromToPosition.fromPositionFromReferent === undefined) ? undefined : fromToPosition.fromPositionFromReferent.id,\n (fromToPosition.toPositionFromReferent === undefined) ? undefined : fromToPosition.toPositionFromReferent.id);\n\n return newId;\n }\n\n private static getLinearLocations<T>(iModel: IModelDb, linearlyLocatedElementId: Id64String, fullClassName: string): T[] {\n const aspects: ElementAspect[] =\n iModel.elements.getAspects(linearlyLocatedElementId, fullClassName);\n\n if (aspects.length === 0)\n return [];\n\n const retVal: T[] = [];\n for (const aspect of aspects) {\n const linearAspect = (aspect as unknown) as T;\n retVal.push(linearAspect);\n }\n\n return retVal;\n }\n\n private static queryFirstLinearLocationAspectId(iModel: IModelDb, linearlyLocatedElementId: Id64String, className: string): Id64String | undefined {\n let aspectId: Id64String | undefined;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n iModel.withPreparedStatement(`SELECT ECInstanceId FROM LinearReferencing.${className} WHERE Element.Id=? LIMIT 1`, (stmt: ECSqlStatement) => {\n stmt.bindId(1, linearlyLocatedElementId);\n if (stmt.step() === DbResult.BE_SQLITE_ROW)\n aspectId = stmt.getValue(0).getId();\n });\n\n return aspectId;\n }\n\n /** Query for LinearlyReferenced AtLocation aspects owned by the specified LinearlyLocated Element.\n * @param iModel The iModel to query from.\n * @param linearlyLocatedElementId The id of the LinearlyLocated Element to query aspects about.\n * @returns Returns an array of LinearlyReferencedAtLocation.\n * @throws [[IModelError]]\n */\n public static getAtLocations(iModel: IModelDb, linearlyLocatedElementId: Id64String): LinearlyReferencedAtLocation[] {\n return this.getLinearLocations<LinearlyReferencedAtLocation>(\n iModel, linearlyLocatedElementId, \"LinearReferencing:LinearlyReferencedAtLocation\");\n }\n\n /** Query for the single LinearlyReferenced AtLocation aspect owned by the specified LinearlyLocated Element. If more than one aspect is expected, use [[getAtLocations]] instead.\n * @param iModel The iModel to query from.\n * @param linearlyLocatedElementId The id of the LinearlyLocated Element to query about.\n * @returns Returns an LinearlyReferencedAtLocation or undefined is none is found.\n * @throws [[IModelError]]\n */\n public static getAtLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String): LinearlyReferencedAtLocation | undefined {\n const linearLocations = this.getAtLocations(iModel, linearlyLocatedElementId);\n if (linearLocations.length === 0)\n return undefined;\n else {\n assert(linearLocations.length === 1);\n return linearLocations[0];\n }\n }\n\n /** Update an existing LinearlyReferencedAtLocation aspect within the iModel.\n * @param iModel The iModel to update.\n * @param linearlyLocatedElementId The Id of the owning Linearly Located Element.\n * @param linearLocationProps The properties to use to update the LinearlyReferencedAtLocation aspect.\n * @param aspectId The Id of the aspect to update. If not known, the first aspectId will be looked-up.\n * @throws [[IModelError]]\n */\n public static updateAtLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedAtLocationProps,\n aspectId?: Id64String): void {\n let linearLocAspectId: Id64String;\n if (aspectId !== undefined)\n linearLocAspectId = aspectId;\n else {\n linearLocAspectId = this.queryFirstLinearLocationAspectId(iModel, linearlyLocatedElementId, \"LinearlyReferencedAtLocation\")!;\n }\n\n const linearLocationAspectProps: LinearlyReferencedAtLocationAspectProps = {\n id: linearLocAspectId,\n element: { id: linearlyLocatedElementId },\n classFullName: \"LinearReferencing:LinearlyReferencedAtLocation\",\n atPosition: linearLocationProps.atPosition,\n fromReferent: linearLocationProps.fromReferent,\n };\n\n iModel.elements.updateAspect(linearLocationAspectProps);\n }\n\n /** Update an existing LinearlyReferencedFromToLocation aspect within the iModel.\n * @param iModel The iModel to update.\n * @param linearlyLocatedElementId The Id of the owning Linearly Located Element.\n * @param linearLocationProps The properties to use to update the LinearlyReferencedFromToLocation aspect.\n * @param aspectId The Id of the aspect to update. If not known, the first aspectId will be looked-up.\n * @throws [[IModelError]]\n */\n public static updateFromToLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedFromToLocationProps,\n aspectId?: Id64String): void {\n let linearLocAspectId: Id64String;\n if (aspectId !== undefined)\n linearLocAspectId = aspectId;\n else {\n linearLocAspectId = this.queryFirstLinearLocationAspectId(iModel, linearlyLocatedElementId, \"LinearlyReferencedFromToLocation\")!;\n }\n\n const linearLocationAspectProps: LinearlyReferencedFromToLocationAspectProps = {\n id: linearLocAspectId,\n element: { id: linearlyLocatedElementId, relClassName: \"LinearReferencing:ILinearlyLocatedOwnsFromToLocations\" },\n classFullName: \"LinearReferencing:LinearlyReferencedFromToLocation\",\n fromPosition: linearLocationProps.fromPosition,\n fromPositionFromReferent: linearLocationProps.fromPositionFromReferent,\n toPosition: linearLocationProps.toPosition,\n toPositionFromReferent: linearLocationProps.toPositionFromReferent,\n };\n\n iModel.elements.updateAspect(linearLocationAspectProps);\n }\n\n /** Query for the Id of the Linear-Element along which the specified LinearlyLocated Element is located.\n * @param iModel The iModel to query from.\n * @param linearlyLocatedElementId The id of the LinearlyLocated Element to query a Linear-Element for.\n * @returns Returns the Id of the Linear-Element or undefined is none is assigned.\n */\n public static getLinearElementId(iModel: IModelDb, linearlyLocatedElementId: Id64String): Id64String | undefined {\n let linearElementId: Id64String | undefined;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n iModel.withPreparedStatement(\"SELECT TargetECInstanceId FROM LinearReferencing.ILinearlyLocatedAlongILinearElement WHERE SourceECInstanceId = ?\", (stmt: ECSqlStatement) => {\n stmt.bindId(1, linearlyLocatedElementId);\n\n if (DbResult.BE_SQLITE_ROW === stmt.step())\n linearElementId = stmt.getValue(0).getId();\n else\n linearElementId = undefined;\n });\n\n return linearElementId;\n }\n\n /** Query for LinearlyReferenced FromToLocation aspects owned by the specified LinearlyLocated Element.\n * @param iModel The iModel to query from.\n * @param linearlyLocatedElementId The id of the LinearlyLocated Element to query aspects about.\n * @returns Returns an array of LinearlyReferencedFromToLocation.\n * @throws [[IModelError]]\n */\n public static getFromToLocations(iModel: IModelDb, linearlyLocatedElementId: Id64String): LinearlyReferencedFromToLocation[] {\n return this.getLinearLocations<LinearlyReferencedFromToLocation>(\n iModel, linearlyLocatedElementId, \"LinearReferencing:LinearlyReferencedFromToLocation\");\n }\n\n /** Query for the single LinearlyReferenced FromToLocation aspect owned by the specified LinearlyLocated Element. If more than one aspect is expected, use [[getFromToLocations]] instead.\n * @param iModel The iModel to query from.\n * @param linearlyLocatedElementId The id of the LinearlyLocated Element to query about.\n * @returns Returns an LinearlyReferencedFromToLocation or undefined is none is found.\n * @throws [[IModelError]]\n */\n public static getFromToLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String): LinearlyReferencedFromToLocation | undefined {\n const linearLocations = this.getFromToLocations(iModel, linearlyLocatedElementId);\n if (linearLocations.length === 0)\n return undefined;\n else {\n assert(linearLocations.length === 1);\n return linearLocations[0];\n }\n }\n}\n\n/** Base interface to optionally be implemented by Elements inherently Linearly-Located. Implementors should choose the\n * appropriate sub-interface rather than implementing LinearlyLocatedBase directly.\n * @beta\n */\nexport interface LinearlyLocatedBase {\n getLinearElementId(): Id64String | undefined;\n}\n\n/** Interface to optionally be implemented by Elements inherently Linearly-Located whose linear-locations are always a single at-position.\n * It also provides convenient APIs for callers to reach Linear-Referencing data stored on aspects. Classes implementing this interface should\n * make use of the services provided by [LinearlyLocated]($linear-referencing-backend).\n * @beta\n */\nexport interface LinearlyLocatedSingleAt extends LinearlyLocatedBase {\n getAtLocation(): LinearlyReferencedAtLocation | undefined;\n updateAtLocation(linearLocation: LinearlyReferencedAtLocationProps, aspectId?: Id64String): void;\n}\n\n/** Interface to optionally be implemented by Elements inherently Linearly-Located whose linear-locations are always at-positions.\n * It also provides convenient APIs for callers to reach Linear-Referencing data stored on aspects. Classes implementing this interface should\n * make use of the services provided by [LinearlyLocated]($linear-referencing-backend).\n * @beta\n */\nexport interface LinearlyLocatedMultipleAt extends LinearlyLocatedBase {\n getAtLocations(): LinearlyReferencedAtLocation[];\n updateAtLocation(linearLocation: LinearlyReferencedAtLocationProps, aspectId: Id64String): void;\n}\n\n/** Interface to optionally be implemented by Elements inherently Linearly-Located whose linear-locations are always a single from-to-position.\n * It also provides convenient APIs for callers to reach Linear-Referencing data stored on aspects. Classes implementing this interface should\n * make use of the services provided by [LinearlyLocated]($linear-referencing-backend).\n * @beta\n */\nexport interface LinearlyLocatedSingleFromTo extends LinearlyLocatedBase {\n getFromToLocation(): LinearlyReferencedFromToLocation | undefined;\n updateFromToLocation(linearLocation: LinearlyReferencedFromToLocationProps, aspectId?: Id64String): void;\n}\n\n/** Interface to optionally be implemented by Elements inherently Linearly-Located whose linear-locations are always from-to-positions.\n * It also provides convenient APIs for callers to reach Linear-Referencing data stored on aspects. Classes implementing this interface should\n * make use of the services provided by [LinearlyLocated]($linear-referencing-backend).\n * @beta\n */\nexport interface LinearlyLocatedMultipleFromTo extends LinearlyLocatedBase {\n getFromToLocations(): LinearlyReferencedFromToLocation[];\n updateFromToLocation(linearLocation: LinearlyReferencedFromToLocationProps, aspectId: Id64String): void;\n}\n\n/** A class offering services for linearly-located data along a Linear-Element.\n * @beta\n */\nexport class LinearElement {\n /** Query for LinearLocationReferences based on specified query parameters.\n * @returns Returns an array of LinearLocationReferences.\n * @throws [[IModelError]]\n */\n public static queryLinearLocations(iModel: IModelDb, linearElementId: Id64String, queryParams: QueryParams): LinearLocationReference[] {\n const ecSqlGen = new QueryLinearLocationsECSQLGen(queryParams);\n const ecsqlAndBindVals = ecSqlGen.generate(linearElementId);\n\n const linearLocationRefs: LinearLocationReference[] = [];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n iModel.withPreparedStatement(ecsqlAndBindVals[0], (stmt: ECSqlStatement) => {\n stmt.bindValues(ecsqlAndBindVals[1]);\n\n while (DbResult.BE_SQLITE_ROW === stmt.step()) {\n const linearLocationRef: LinearLocationReference = {\n linearlyLocatedId: stmt.getValue(0).getId(),\n linearlyLocatedClassFullName: stmt.getValue(1).getString(),\n startDistanceAlong: stmt.getValue(2).getDouble(),\n stopDistanceAlong: stmt.getValue(3).getDouble(),\n locationAspectId: stmt.getValue(4).getId(),\n };\n\n linearLocationRefs.push(linearLocationRef);\n }\n });\n\n return linearLocationRefs;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LinearReferencingElements.js","sourceRoot":"","sources":["../../src/LinearReferencingElements.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmE;AACnE,sDAAgI;AAChI,0EAA4E;AAC5E,oDAAoI;AACpI,gFAI0C;AAC1C,uFAAmH;AACnH,qFAE0C;AAE1C;;GAEG;AACH,MAAsB,0BAA2B,SAAQ,qCAAsB;IAC7E,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,4BAA4B,CAAC,CAAC,CAAC;IAEhF,iBAAiB,CAAqC;IAE7D,YAAmB,KAAsC,EAAE,MAAgB;QACzE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,iBAAiB,GAAG,4BAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC5E,CAAC;IAEM,kBAAkB;QACvB,OAAO,eAAe,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;CACF;AAdD,gEAcC;AAED;;GAEG;AACH,MAAsB,qBAAsB,SAAQ,qCAAsB;IACxE,gBAAgB;IACT,MAAM,KAAc,SAAS,KAA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4B;oBACjD,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;oBAC3C,4BAA4B,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE;oBAC1D,kBAAkB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE;oBAChD,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE;oBAC/C,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;iBAC3C,CAAC;gBAEF,kBAAkB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,kBAAkB,CAAC;IAC5B,CAAC;CACF;AA7BD,sCA6BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module LinearReferencing\n */\n\nimport { assert, DbResult, Id64String } from \"@itwin/core-bentley\";\nimport { ECSqlStatement, EditTxn, ElementAspect, IModelDb, PhysicalElement, SpatialLocationElement } from \"@itwin/core-backend\";\nimport { _implicitTxn } from \"@itwin/core-backend/lib/cjs/internal/Symbols\";\nimport { Code, ElementProps, GeometricElement3dProps, IModelError, PhysicalElementProps, RelatedElement } from \"@itwin/core-common\";\nimport {\n ComparisonOption, LinearLocationReference, LinearlyLocatedAttributionProps, LinearlyReferencedAtLocationAspectProps,\n LinearlyReferencedAtLocationProps, LinearlyReferencedFromToLocationAspectProps, LinearlyReferencedFromToLocationProps,\n LinearlyReferencedLocationType, QueryParams, ReferentElementProps,\n} from \"@itwin/linear-referencing-common\";\nimport { LinearlyReferencedAtLocation, LinearlyReferencedFromToLocation } from \"./LinearReferencingElementAspects\";\nimport {\n ILinearLocationLocatesElement, ILinearlyLocatedAlongILinearElement, ILinearlyLocatedAttributesElement, IReferentReferencesElement,\n} from \"./LinearReferencingRelationships\";\n\n/** Base class for Spatial Location Element subclasses representing properties whose value is located along a Linear-Element and only applies to a portion of an Element.\n * @beta\n */\nexport abstract class LinearlyLocatedAttribution extends SpatialLocationElement {\n /** @internal */\n public static override get className(): string { return \"LinearlyLocatedAttribution\"; }\n\n public attributedElement?: ILinearlyLocatedAttributesElement;\n\n public constructor(props: LinearlyLocatedAttributionProps, iModel: IModelDb) {\n super(props, iModel);\n this.attributedElement = RelatedElement.fromJSON(props.attributedElement);\n }\n\n public getLinearElementId(): Id64String | undefined {\n return LinearlyLocated.getLinearElementId(this.iModel, this.id);\n }\n}\n\n/** Base class for Spatial Location Element implementations that are linearly located along a Linear-Element.\n * @beta\n */\nexport abstract class LinearLocationElement extends SpatialLocationElement implements LinearlyLocatedBase {\n /** @internal */\n public static override get className(): string { return \"LinearLocationElement\"; }\n\n public constructor(props: GeometricElement3dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n public getLinearElementId(): Id64String | undefined {\n return LinearlyLocated.getLinearElementId(this.iModel, this.id);\n }\n}\n\n/** Linear Referencing Location attached to an Element not inherently Linearly Referenced.\n * @beta\n */\nexport class LinearLocation extends LinearLocationElement implements LinearlyLocatedBase {\n /** @internal */\n public static override get className(): string { return \"LinearLocation\"; }\n public constructor(props: GeometricElement3dProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n private static toProps(modelId: Id64String, categoryId: Id64String): GeometricElement3dProps {\n const props: GeometricElement3dProps = {\n classFullName: LinearLocation.classFullName,\n category: categoryId,\n model: modelId,\n code: Code.createEmpty(),\n };\n\n return props;\n }\n\n public static create(iModel: IModelDb, modelId: Id64String, categoryId: Id64String): LinearLocation {\n return new LinearLocation(this.toProps(modelId, categoryId), iModel);\n }\n\n /** Insert a new `LinearLocation` using an explicit transaction.\n * @beta\n */\n public static insertFromTo(txn: EditTxn, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String,\n fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;\n /** Insert a new `LinearLocation`.\n * @deprecated Use LinearLocation.insertFromTo(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\n */\n public static insertFromTo(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String,\n fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;\n public static insertFromTo(txnOrIModel: EditTxn | IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String,\n fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n const newId = LinearlyLocated.insertFromTo(txn, this.toProps(modelId, categoryId), linearElementId, fromToPosition);\n ILinearLocationLocatesElement.insert(txn, newId, locatedElementId);\n return newId;\n }\n\n /** Insert this `LinearLocation` using an explicit transaction.\n * @beta\n */\n public insertFromTo(txn: EditTxn, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;\n /** Insert this `LinearLocation`.\n * @deprecated Use LinearLocation.insertFromTo(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\n */\n public insertFromTo(iModel: IModelDb, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String;\n public insertFromTo(txnOrIModel: EditTxn | IModelDb, linearElementId: Id64String, fromToPosition: LinearlyReferencedFromToLocationProps, locatedElementId: Id64String): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n const newId = LinearlyLocated.insertFromTo(txn, this.toJSON(), linearElementId, fromToPosition);\n ILinearLocationLocatesElement.insert(txn, newId, locatedElementId);\n return newId;\n }\n\n /** Insert a new `LinearLocation` using an explicit transaction.\n * @beta\n */\n public static insertAt(txn: EditTxn, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String,\n atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;\n /** Insert a new `LinearLocation`.\n * @deprecated Use LinearLocation.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\n */\n public static insertAt(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String,\n atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;\n public static insertAt(txnOrIModel: EditTxn | IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String,\n atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n const newId = LinearlyLocated.insertAt(txn, this.toProps(modelId, categoryId), linearElementId, atPosition);\n ILinearLocationLocatesElement.insert(txn, newId, locatedElementId);\n return newId;\n }\n\n /** Insert this `LinearLocation` using an explicit transaction.\n * @beta\n */\n public insertAt(txn: EditTxn, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;\n /** Insert this `LinearLocation`.\n * @deprecated Use LinearLocation.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\n */\n public insertAt(iModel: IModelDb, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String;\n public insertAt(txnOrIModel: EditTxn | IModelDb, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps, locatedElementId: Id64String): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n const newId = LinearlyLocated.insertAt(txn, this.toJSON(), linearElementId, atPosition);\n ILinearLocationLocatesElement.insert(txn, newId, locatedElementId);\n return newId;\n }\n}\n\n/** Base class for Physical Elements that are inherently linearly located along a Linear-Element.\n * @beta\n */\nexport abstract class LinearPhysicalElement extends PhysicalElement {\n /** @internal */\n public static override get className(): string { return \"LinearPhysicalElement\"; }\n\n public constructor(props: PhysicalElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** Spatial Location Element that can play the role of a Referent (known location along a Linear-Element).\n * @beta\n */\nexport abstract class ReferentElement extends SpatialLocationElement implements LinearlyLocatedBase {\n /** @internal */\n public static override get className(): string { return \"ReferentElement\"; }\n\n public referencedElement?: IReferentReferencesElement;\n\n public constructor(props: ReferentElementProps, iModel: IModelDb) {\n super(props, iModel);\n this.referencedElement = RelatedElement.fromJSON(props.referencedElement);\n }\n\n public getLinearElementId(): Id64String | undefined {\n return LinearlyLocated.getLinearElementId(this.iModel, this.id);\n }\n}\n\n/** Referent-implementation turning any bis:SpatialElement not inherently Linearly-Referenced into a Referent for Linear-Referencing purposes.\n * @beta\n */\nexport class Referent extends ReferentElement {\n /** @internal */\n public static override get className(): string { return \"Referent\"; }\n public constructor(props: ReferentElementProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n private static toProps(modelId: Id64String, categoryId: Id64String, referencedElementId: Id64String): ReferentElementProps {\n const props: ReferentElementProps = {\n classFullName: LinearLocation.classFullName,\n category: categoryId,\n model: modelId,\n code: Code.createEmpty(),\n referencedElement: new IReferentReferencesElement(referencedElementId),\n };\n\n return props;\n }\n\n public static create(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, referencedElementId: Id64String): Referent {\n return new Referent(this.toProps(modelId, categoryId, referencedElementId), iModel);\n }\n\n /** Insert a new `Referent` using an explicit transaction.\n * @beta\n */\n public static insertAt(txn: EditTxn, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String,\n atPosition: LinearlyReferencedAtLocationProps, referencedElementId: Id64String): Id64String;\n /** Insert a new `Referent`.\n * @deprecated Use Referent.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\n */\n public static insertAt(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String,\n atPosition: LinearlyReferencedAtLocationProps, referencedElementId: Id64String): Id64String;\n public static insertAt(txnOrIModel: EditTxn | IModelDb, modelId: Id64String, categoryId: Id64String, linearElementId: Id64String,\n atPosition: LinearlyReferencedAtLocationProps, referencedElementId: Id64String): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n return LinearlyLocated.insertAt(txn, this.toProps(modelId, categoryId, referencedElementId), linearElementId, atPosition);\n }\n\n /** Insert this `Referent` using an explicit transaction.\n * @beta\n */\n public insertAt(txn: EditTxn, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;\n /** Insert this `Referent`.\n * @deprecated Use Referent.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\n */\n public insertAt(iModel: IModelDb, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String;\n public insertAt(txnOrIModel: EditTxn | IModelDb, linearElementId: Id64String, atPosition: LinearlyReferencedAtLocationProps): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n return LinearlyLocated.insertAt(txn, this.toJSON(), linearElementId, atPosition);\n }\n}\n\nabstract class ECSQLGenImpl {\n public abstract genSelect(): string;\n public selectDistinct(): boolean {\n return false;\n }\n public abstract genFromJoin(): string;\n public abstract genWhere(bindVals?: any[], from?: number, inclusiveFrom?: boolean, to?: number, inclusiveTo?: boolean): string;\n public abstract genOrderBy(): string;\n}\n\nclass AtAndFromToECSQLGenImpl extends ECSQLGenImpl {\n public genSelect(): string {\n return \"coalesce(AtLocation.AtPosition.DistanceAlongFromStart, FromToLocation.FromPosition.DistanceAlongFromStart) StartDistanceAlong, \" +\n \"coalesce(AtLocation.AtPosition.DistanceAlongFromStart, FromToLocation.ToPosition.DistanceAlongFromStart) StopDistanceAlong, \" +\n \"coalesce(AtLocation.ECInstanceId, FromToLocation.ECInstanceId) LocationAspectId \";\n }\n public override selectDistinct(): boolean {\n return true;\n }\n public genFromJoin(): string {\n return \"LEFT JOIN LinearReferencing.LinearlyReferencedAtLocation AtLocation ON LinearlyLocated.InstanceId = AtLocation.Element.Id \" +\n \"LEFT JOIN LinearReferencing.LinearlyReferencedFromToLocation FromToLocation ON LinearlyLocated.InstanceId = FromToLocation.Element.Id \";\n }\n public genWhere(bindVals: any[], from?: number, inclusiveFrom?: boolean, to?: number, inclusiveTo?: boolean): string {\n const fromCompOp: string = (inclusiveFrom === undefined || inclusiveFrom) ? \">=\" : \">\";\n const toCompOp: string = (inclusiveTo === undefined || inclusiveTo) ? \"<=\" : \"<\";\n\n let ecSql = \"\";\n if (from !== undefined && to !== undefined) {\n ecSql += \"(AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? AND AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ?) OR (FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? AND FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ?) \" + \"OR (FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? AND FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ?) OR (FromToLocation.FromPosition.DistanceAlongFromStart <= ? AND FromToLocation.ToPosition.DistanceAlongFromStart >= ?) \";\n\n bindVals.push(from);\n bindVals.push(to);\n bindVals.push(from);\n bindVals.push(to);\n bindVals.push(from);\n bindVals.push(to);\n bindVals.push(from);\n bindVals.push(to);\n } else if (from !== undefined) {\n ecSql += \"AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? OR FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? OR FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? \";\n\n bindVals.push(from);\n bindVals.push(from);\n bindVals.push(from);\n } else if (to !== undefined) {\n ecSql += \"AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ? OR FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ? OR FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ? \";\n\n bindVals.push(to);\n bindVals.push(to);\n bindVals.push(to);\n } else {\n ecSql += \"(AtLocation.AtPosition.DistanceAlongFromStart IS NOT NULL) OR \";\n ecSql += \"(FromToLocation.FromPosition.DistanceAlongFromStart IS NOT NULL) \";\n }\n\n return ecSql;\n }\n public genOrderBy(): string {\n return \"coalesce(AtLocation.AtPosition.DistanceAlongFromStart, FromToLocation.FromPosition.DistanceAlongFromStart)\";\n }\n}\n\nclass FromToECSQLGenImpl extends ECSQLGenImpl {\n public genSelect(): string {\n return \"FromToLocation.FromPosition.DistanceAlongFromStart StartDistanceAlong, FromToLocation.ToPosition.DistanceAlongFromStart StopDistanceAlong, FromToLocation.ECInstanceId LocationAspectId \";\n }\n public genFromJoin(): string {\n return \"INNER JOIN LinearReferencing.LinearlyReferencedFromToLocation FromToLocation ON LinearlyLocated.InstanceId = FromToLocation.Element.Id \";\n }\n public genWhere(bindVals: any[], from?: number, inclusiveFrom?: boolean, to?: number, inclusiveTo?: boolean): string {\n const fromCompOp: string = (inclusiveFrom === undefined || inclusiveFrom) ? \">=\" : \">\";\n const toCompOp: string = (inclusiveTo === undefined || inclusiveTo) ? \"<=\" : \"<\";\n\n let ecSql = \"\";\n if (from !== undefined && to !== undefined) {\n ecSql += \"AND ((FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? AND FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ?) OR (FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? AND FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ?) OR (FromToLocation.FromPosition.DistanceAlongFromStart <= ? AND FromToLocation.ToPosition.DistanceAlongFromStart >= ?)) \";\n\n bindVals.push(from);\n bindVals.push(to);\n bindVals.push(from);\n bindVals.push(to);\n bindVals.push(from);\n bindVals.push(to);\n } else if (from !== undefined) {\n ecSql += \"AND (FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? OR FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ?)\";\n\n bindVals.push(from);\n bindVals.push(from);\n } else if (to !== undefined) {\n ecSql += \"AND (FromToLocation.FromPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ? OR FromToLocation.ToPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ?) \";\n\n bindVals.push(to);\n bindVals.push(to);\n } else {\n ecSql += \"FromToLocation.FromPosition.DistanceAlongFromStart IS NOT NULL \";\n }\n\n return ecSql;\n }\n public genOrderBy(): string {\n return \"FromToLocation.FromPosition.DistanceAlongFromStart\";\n }\n}\n\nclass AtECSQLGenImpl extends ECSQLGenImpl {\n public genSelect(): string {\n return \"AtLocation.AtPosition.DistanceAlongFromStart StartDistanceAlong, AtLocation.AtPosition.DistanceAlongFromStart StopDistanceAlong, AtLocation.ECInstanceId LocationAspectId \";\n }\n public genFromJoin(): string {\n return \"INNER JOIN LinearReferencing.LinearlyReferencedAtLocation AtLocation ON LinearlyLocated.InstanceId = AtLocation.Element.Id \";\n }\n public genWhere(bindVals: any[], from?: number, inclusiveFrom?: boolean, to?: number, inclusiveTo?: boolean): string {\n const fromCompOp: string = (inclusiveFrom === undefined || inclusiveFrom) ? \">=\" : \">\";\n const toCompOp: string = (inclusiveTo === undefined || inclusiveTo) ? \"<=\" : \"<\";\n\n let ecSql = \"\";\n if (from !== undefined && to !== undefined) {\n ecSql += \"AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? AND AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ? \";\n\n bindVals.push(from);\n bindVals.push(to);\n } else if (from !== undefined) {\n ecSql += \"AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += fromCompOp;\n ecSql += \" ? \";\n\n bindVals.push(from);\n } else if (to !== undefined) {\n ecSql += \"AtLocation.AtPosition.DistanceAlongFromStart \";\n ecSql += toCompOp;\n ecSql += \" ? \";\n\n bindVals.push(to);\n } else\n ecSql += \"AtLocation.AtPosition.DistanceAlongFromStart IS NOT NULL \";\n\n return ecSql;\n }\n public genOrderBy(): string {\n return \"AtLocation.AtPosition.DistanceAlongFromStart\";\n }\n}\n\nclass QueryLinearLocationsECSQLGen {\n private readonly _params: QueryParams;\n private _ecSql: string;\n\n private _addSelectClause(impl: ECSQLGenImpl): void {\n let select = \"SELECT \";\n\n if (impl.selectDistinct())\n select += \"DISTINCT \";\n\n select += \"LinearlyLocated.InstanceId LinearlyLocatedId, printf('%s:%s', meta.ECSchemaDef.Name, meta.ECClassDef.Name) LinearlyLocatedClassFullName, \";\n select += impl.genSelect();\n\n this._ecSql += select;\n }\n\n private _parseClassFullName(classFullName: string): [string, string] | undefined {\n const parts = classFullName.split(\":\");\n if (parts.length !== 2)\n return undefined;\n\n return [parts[0], parts[1]];\n }\n\n private _genLinearlyLocated(): string {\n return \"meta.ECSchemaDef JOIN meta.ECClassDef USING meta.SchemaOwnsClasses JOIN \" +\n \"(SELECT coalesce(Located.TargetECInstanceId, Along.SourceECInstanceId) InstanceId, \" +\n \"coalesce(Located.TargetECClassId, Along.SourceECClassId) ClassId \" +\n \"FROM LinearReferencing.ILinearlyLocatedAlongILinearElement Along LEFT JOIN \" +\n \"LinearReferencing.ILinearLocationLocatesElement Located ON Along.SourceECInstanceId = Located.SourceECInstanceId \" +\n \"WHERE Along.TargetECInstanceId = ?) LinearlyLocated ON meta.ECClassDef.ECInstanceId = LinearlyLocated.ClassId \";\n }\n\n private _addFromClause(impl: ECSQLGenImpl/* bvector<double>& bindVals */): void {\n let from = \"FROM \";\n from += this._genLinearlyLocated();\n from += impl.genFromJoin();\n\n this._ecSql += from;\n }\n\n private _addWhereClause(impl: ECSQLGenImpl, bindVals: any[]) {\n let where = \"WHERE \";\n\n where += impl.genWhere(\n bindVals,\n this._params.fromDistanceAlong,\n (this._params.fromComparisonOption === undefined ||\n this._params.fromComparisonOption === ComparisonOption.Inclusive),\n this._params.toDistanceAlong,\n (this._params.toComparisonOption === undefined ||\n this._params.toComparisonOption === ComparisonOption.Inclusive));\n\n if (this._params.linearlyLocatedClassFullNames !== undefined) {\n if (where.length > 6)\n where += \"AND \";\n\n if (1 === this._params.linearlyLocatedClassFullNames.length) {\n const classFullName = this._params.linearlyLocatedClassFullNames[0];\n const schemaNameClassName = this._parseClassFullName(classFullName);\n if (schemaNameClassName === undefined)\n throw new IModelError(0, \"Invalid full class name\");\n\n where += `meta.ECSchemaDef.Name='${schemaNameClassName[0]}' AND meta.ECClassDef.Name='${schemaNameClassName[1]}' `;\n } else if (1 < this._params.linearlyLocatedClassFullNames.length) {\n where += \"(\";\n for (const classFullName of this._params.linearlyLocatedClassFullNames) {\n if (classFullName === undefined)\n continue;\n\n const schemaNameClassName = this._parseClassFullName(classFullName);\n if (schemaNameClassName === undefined)\n continue;\n\n where += `(meta.ECSchemaDef.Name='${schemaNameClassName[0]}' AND meta.ECClassDef.Name='${schemaNameClassName[1]}') OR `;\n }\n\n where = where.substring(0, where.length - 4); // Removing last OR\n where += \") \";\n }\n }\n\n this._ecSql += where;\n }\n\n private _addOrderByClause(impl: ECSQLGenImpl): void {\n let orderBy = \"ORDER BY \";\n orderBy += impl.genOrderBy();\n\n this._ecSql += orderBy;\n }\n\n private _createImpl(): ECSQLGenImpl {\n if (this._params.linearlyReferencedLocationTypeFilter === undefined ||\n this._params.linearlyReferencedLocationTypeFilter === LinearlyReferencedLocationType.Any) {\n return new AtAndFromToECSQLGenImpl();\n } else if (this._params.linearlyReferencedLocationTypeFilter === LinearlyReferencedLocationType.FromTo) {\n return new FromToECSQLGenImpl();\n } else {\n return new AtECSQLGenImpl();\n }\n }\n\n public constructor(params: QueryParams) {\n this._params = params;\n this._ecSql = \"\";\n }\n\n public generate(linearElementId: Id64String): [string, any[]] {\n this._ecSql = \"\";\n const impl = this._createImpl();\n\n const bindVals: any[] = [linearElementId];\n this._addSelectClause(impl);\n this._addFromClause(impl);\n this._addWhereClause(impl, bindVals);\n this._addOrderByClause(impl);\n\n return [this._ecSql, bindVals];\n }\n}\n\n/** A class offering services for LinearlyLocated elements.\n * @beta\n */\nexport class LinearlyLocated {\n private static insertBasic(txn: EditTxn, elProps: ElementProps, linearElementId: Id64String): Id64String {\n const newId = txn.insertElement(elProps);\n\n const linearlyLocatedAlongLinearElement =\n ILinearlyLocatedAlongILinearElement.create(txn.iModel, newId, linearElementId);\n linearlyLocatedAlongLinearElement.insert(txn);\n\n return newId;\n }\n\n /** Insert a new LinearlyLocated element into an iModel at a specific location along an existing Linear-Element.\n * @param txn The EditTxn used to perform inserts.\n * @param elProps The properties of the new element.\n * @param linearElementId The Id of the Linear-Element along which the new LinearlyLocated will be inserted.\n * @param atPosition Linear position.\n * @returns The newly inserted element's Id.\n * @throws [[IModelError]] if unable to insert the element.\n */\n public static insertAt(txn: EditTxn, elProps: ElementProps, linearElementId: Id64String,\n atPosition: LinearlyReferencedAtLocationProps): Id64String;\n /** Insert a new LinearlyLocated element into an iModel at a specific location along an existing Linear-Element.\n * @param iModel The iModel to insert the new element into.\n * @param elProps The properties of the new element.\n * @param linearElementId The Id of the Linear-Element along which the new LinearlyLocated will be inserted.\n * @param atPosition Linear position.\n * @returns The newly inserted element's Id.\n * @throws [[IModelError]] if unable to insert the element.\n * @deprecated Use LinearlyLocated.insertAt(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\n */\n public static insertAt(iModel: IModelDb, elProps: ElementProps, linearElementId: Id64String,\n atPosition: LinearlyReferencedAtLocationProps): Id64String;\n public static insertAt(txnOrIModel: EditTxn | IModelDb, elProps: ElementProps, linearElementId: Id64String,\n atPosition: LinearlyReferencedAtLocationProps): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n const newId: Id64String = this.insertBasic(txn, elProps, linearElementId);\n LinearlyReferencedAtLocation.insert(txn, newId, atPosition.atPosition,\n atPosition.fromReferent === undefined ? undefined : atPosition.fromReferent.id);\n return newId;\n }\n\n /** Insert a new LinearlyLocated element into an iModel at a specific from-to location along an existing Linear-Element.\n * @param txn The EditTxn used to perform inserts.\n * @param elProps The properties of the new element.\n * @param linearElementId The Id of the Linear-Element along which the new LinearlyLocated will be inserted.\n * @param fromToPosition Linear position.\n * @returns The newly inserted element's Id.\n * @throws [[IModelError]] if unable to insert the element.\n */\n public static insertFromTo(txn: EditTxn, elProps: ElementProps, linearElementId: Id64String,\n fromToPosition: LinearlyReferencedFromToLocationProps): Id64String;\n /** Insert a new LinearlyLocated element into an iModel at a specific from-to location along an existing Linear-Element.\n * @param iModel The iModel to insert the new element into.\n * @param elProps The properties of the new element.\n * @param linearElementId The Id of the Linear-Element along which the new LinearlyLocated will be inserted.\n * @param fromToPosition Linear position.\n * @returns The newly inserted element's Id.\n * @throws [[IModelError]] if unable to insert the element.\n * @deprecated Use LinearlyLocated.insertFromTo(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\n */\n public static insertFromTo(iModel: IModelDb, elProps: ElementProps, linearElementId: Id64String,\n fromToPosition: LinearlyReferencedFromToLocationProps): Id64String;\n public static insertFromTo(txnOrIModel: EditTxn | IModelDb, elProps: ElementProps, linearElementId: Id64String,\n fromToPosition: LinearlyReferencedFromToLocationProps): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n const newId: Id64String = this.insertBasic(txn, elProps, linearElementId);\n LinearlyReferencedFromToLocation.insert(txn, newId,\n fromToPosition.fromPosition, fromToPosition.toPosition,\n fromToPosition.fromPositionFromReferent === undefined ? undefined : fromToPosition.fromPositionFromReferent.id,\n fromToPosition.toPositionFromReferent === undefined ? undefined : fromToPosition.toPositionFromReferent.id);\n return newId;\n }\n\n private static getLinearLocations<T>(iModel: IModelDb, linearlyLocatedElementId: Id64String, fullClassName: string): T[] {\n const aspects: ElementAspect[] =\n iModel.elements.getAspects(linearlyLocatedElementId, fullClassName);\n\n if (aspects.length === 0)\n return [];\n\n const retVal: T[] = [];\n for (const aspect of aspects) {\n const linearAspect = (aspect as unknown) as T;\n retVal.push(linearAspect);\n }\n\n return retVal;\n }\n\n private static queryFirstLinearLocationAspectId(iModel: IModelDb, linearlyLocatedElementId: Id64String, className: string): Id64String | undefined {\n let aspectId: Id64String | undefined;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n iModel.withPreparedStatement(`SELECT ECInstanceId FROM LinearReferencing.${className} WHERE Element.Id=? LIMIT 1`, (stmt: ECSqlStatement) => {\n stmt.bindId(1, linearlyLocatedElementId);\n if (stmt.step() === DbResult.BE_SQLITE_ROW)\n aspectId = stmt.getValue(0).getId();\n });\n\n return aspectId;\n }\n\n /** Query for LinearlyReferenced AtLocation aspects owned by the specified LinearlyLocated Element.\n * @param iModel The iModel to query from.\n * @param linearlyLocatedElementId The id of the LinearlyLocated Element to query aspects about.\n * @returns Returns an array of LinearlyReferencedAtLocation.\n * @throws [[IModelError]]\n */\n public static getAtLocations(iModel: IModelDb, linearlyLocatedElementId: Id64String): LinearlyReferencedAtLocation[] {\n return this.getLinearLocations<LinearlyReferencedAtLocation>(\n iModel, linearlyLocatedElementId, \"LinearReferencing:LinearlyReferencedAtLocation\");\n }\n\n /** Query for the single LinearlyReferenced AtLocation aspect owned by the specified LinearlyLocated Element. If more than one aspect is expected, use [[getAtLocations]] instead.\n * @param iModel The iModel to query from.\n * @param linearlyLocatedElementId The id of the LinearlyLocated Element to query about.\n * @returns Returns an LinearlyReferencedAtLocation or undefined is none is found.\n * @throws [[IModelError]]\n */\n public static getAtLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String): LinearlyReferencedAtLocation | undefined {\n const linearLocations = this.getAtLocations(iModel, linearlyLocatedElementId);\n if (linearLocations.length === 0)\n return undefined;\n else {\n assert(linearLocations.length === 1);\n return linearLocations[0];\n }\n }\n\n /** Update an existing LinearlyReferencedAtLocation aspect within the iModel.\n * @param iModel The iModel to update.\n * @param linearlyLocatedElementId The Id of the owning Linearly Located Element.\n * @param linearLocationProps The properties to use to update the LinearlyReferencedAtLocation aspect.\n * @param aspectId The Id of the aspect to update. If not known, the first aspectId will be looked-up.\n * @throws [[IModelError]]\n * @deprecated Use LinearlyLocated.updateAtLocation(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\n */\n public static updateAtLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedAtLocationProps,\n aspectId?: Id64String): void;\n\n public static updateAtLocation(txn: EditTxn, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedAtLocationProps,\n aspectId?: Id64String): void;\n public static updateAtLocation(txnOrIModel: EditTxn | IModelDb, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedAtLocationProps,\n aspectId?: Id64String): void {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n const iModel = txn.iModel;\n let linearLocAspectId: Id64String;\n if (aspectId !== undefined)\n linearLocAspectId = aspectId;\n else {\n const queriedAspectId = this.queryFirstLinearLocationAspectId(iModel, linearlyLocatedElementId, \"LinearlyReferencedAtLocation\");\n if (queriedAspectId === undefined)\n throw new Error(\"LinearlyReferencedAtLocation aspect not found\");\n\n linearLocAspectId = queriedAspectId;\n }\n\n const linearLocationAspectProps: LinearlyReferencedAtLocationAspectProps = {\n id: linearLocAspectId,\n element: { id: linearlyLocatedElementId },\n classFullName: \"LinearReferencing:LinearlyReferencedAtLocation\",\n atPosition: linearLocationProps.atPosition,\n fromReferent: linearLocationProps.fromReferent,\n };\n\n txn.updateAspect(linearLocationAspectProps);\n }\n\n /** Update an existing LinearlyReferencedFromToLocation aspect within the iModel.\n * @param iModel The iModel to update.\n * @param linearlyLocatedElementId The Id of the owning Linearly Located Element.\n * @param linearLocationProps The properties to use to update the LinearlyReferencedFromToLocation aspect.\n * @param aspectId The Id of the aspect to update. If not known, the first aspectId will be looked-up.\n * @throws [[IModelError]]\n * @deprecated Use LinearlyLocated.updateFromToLocation(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\n */\n public static updateFromToLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedFromToLocationProps,\n aspectId?: Id64String): void;\n\n public static updateFromToLocation(txn: EditTxn, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedFromToLocationProps,\n aspectId?: Id64String): void;\n public static updateFromToLocation(txnOrIModel: EditTxn | IModelDb, linearlyLocatedElementId: Id64String, linearLocationProps: LinearlyReferencedFromToLocationProps,\n aspectId?: Id64String): void {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n const iModel = txn.iModel;\n let linearLocAspectId: Id64String;\n if (aspectId !== undefined)\n linearLocAspectId = aspectId;\n else {\n const queriedAspectId = this.queryFirstLinearLocationAspectId(iModel, linearlyLocatedElementId, \"LinearlyReferencedFromToLocation\");\n if (queriedAspectId === undefined)\n throw new Error(\"LinearlyReferencedFromToLocation aspect not found\");\n\n linearLocAspectId = queriedAspectId;\n }\n\n const linearLocationAspectProps: LinearlyReferencedFromToLocationAspectProps = {\n id: linearLocAspectId,\n element: { id: linearlyLocatedElementId, relClassName: \"LinearReferencing:ILinearlyLocatedOwnsFromToLocations\" },\n classFullName: \"LinearReferencing:LinearlyReferencedFromToLocation\",\n fromPosition: linearLocationProps.fromPosition,\n fromPositionFromReferent: linearLocationProps.fromPositionFromReferent,\n toPosition: linearLocationProps.toPosition,\n toPositionFromReferent: linearLocationProps.toPositionFromReferent,\n };\n\n txn.updateAspect(linearLocationAspectProps);\n }\n\n /** Query for the Id of the Linear-Element along which the specified LinearlyLocated Element is located.\n * @param iModel The iModel to query from.\n * @param linearlyLocatedElementId The id of the LinearlyLocated Element to query a Linear-Element for.\n * @returns Returns the Id of the Linear-Element or undefined is none is assigned.\n */\n public static getLinearElementId(iModel: IModelDb, linearlyLocatedElementId: Id64String): Id64String | undefined {\n let linearElementId: Id64String | undefined;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n iModel.withPreparedStatement(\"SELECT TargetECInstanceId FROM LinearReferencing.ILinearlyLocatedAlongILinearElement WHERE SourceECInstanceId = ?\", (stmt: ECSqlStatement) => {\n stmt.bindId(1, linearlyLocatedElementId);\n\n if (DbResult.BE_SQLITE_ROW === stmt.step())\n linearElementId = stmt.getValue(0).getId();\n else\n linearElementId = undefined;\n });\n\n return linearElementId;\n }\n\n /** Query for LinearlyReferenced FromToLocation aspects owned by the specified LinearlyLocated Element.\n * @param iModel The iModel to query from.\n * @param linearlyLocatedElementId The id of the LinearlyLocated Element to query aspects about.\n * @returns Returns an array of LinearlyReferencedFromToLocation.\n * @throws [[IModelError]]\n */\n public static getFromToLocations(iModel: IModelDb, linearlyLocatedElementId: Id64String): LinearlyReferencedFromToLocation[] {\n return this.getLinearLocations<LinearlyReferencedFromToLocation>(\n iModel, linearlyLocatedElementId, \"LinearReferencing:LinearlyReferencedFromToLocation\");\n }\n\n /** Query for the single LinearlyReferenced FromToLocation aspect owned by the specified LinearlyLocated Element. If more than one aspect is expected, use [[getFromToLocations]] instead.\n * @param iModel The iModel to query from.\n * @param linearlyLocatedElementId The id of the LinearlyLocated Element to query about.\n * @returns Returns an LinearlyReferencedFromToLocation or undefined is none is found.\n * @throws [[IModelError]]\n */\n public static getFromToLocation(iModel: IModelDb, linearlyLocatedElementId: Id64String): LinearlyReferencedFromToLocation | undefined {\n const linearLocations = this.getFromToLocations(iModel, linearlyLocatedElementId);\n if (linearLocations.length === 0)\n return undefined;\n else {\n assert(linearLocations.length === 1);\n return linearLocations[0];\n }\n }\n}\n\n/** Base interface to optionally be implemented by Elements inherently Linearly-Located. Implementors should choose the\n * appropriate sub-interface rather than implementing LinearlyLocatedBase directly.\n * @beta\n */\nexport interface LinearlyLocatedBase {\n getLinearElementId(): Id64String | undefined;\n}\n\n/** Interface to optionally be implemented by Elements inherently Linearly-Located whose linear-locations are always a single at-position.\n * It also provides convenient APIs for callers to reach Linear-Referencing data stored on aspects. Classes implementing this interface should\n * make use of the services provided by [LinearlyLocated]($linear-referencing-backend).\n * @beta\n */\nexport interface LinearlyLocatedSingleAt extends LinearlyLocatedBase {\n getAtLocation(): LinearlyReferencedAtLocation | undefined;\n updateAtLocation(linearLocation: LinearlyReferencedAtLocationProps, aspectId?: Id64String): void;\n}\n\n/** Interface to optionally be implemented by Elements inherently Linearly-Located whose linear-locations are always at-positions.\n * It also provides convenient APIs for callers to reach Linear-Referencing data stored on aspects. Classes implementing this interface should\n * make use of the services provided by [LinearlyLocated]($linear-referencing-backend).\n * @beta\n */\nexport interface LinearlyLocatedMultipleAt extends LinearlyLocatedBase {\n getAtLocations(): LinearlyReferencedAtLocation[];\n updateAtLocation(linearLocation: LinearlyReferencedAtLocationProps, aspectId: Id64String): void;\n}\n\n/** Interface to optionally be implemented by Elements inherently Linearly-Located whose linear-locations are always a single from-to-position.\n * It also provides convenient APIs for callers to reach Linear-Referencing data stored on aspects. Classes implementing this interface should\n * make use of the services provided by [LinearlyLocated]($linear-referencing-backend).\n * @beta\n */\nexport interface LinearlyLocatedSingleFromTo extends LinearlyLocatedBase {\n getFromToLocation(): LinearlyReferencedFromToLocation | undefined;\n updateFromToLocation(linearLocation: LinearlyReferencedFromToLocationProps, aspectId?: Id64String): void;\n}\n\n/** Interface to optionally be implemented by Elements inherently Linearly-Located whose linear-locations are always from-to-positions.\n * It also provides convenient APIs for callers to reach Linear-Referencing data stored on aspects. Classes implementing this interface should\n * make use of the services provided by [LinearlyLocated]($linear-referencing-backend).\n * @beta\n */\nexport interface LinearlyLocatedMultipleFromTo extends LinearlyLocatedBase {\n getFromToLocations(): LinearlyReferencedFromToLocation[];\n updateFromToLocation(linearLocation: LinearlyReferencedFromToLocationProps, aspectId: Id64String): void;\n}\n\n/** A class offering services for linearly-located data along a Linear-Element.\n * @beta\n */\nexport class LinearElement {\n /** Query for LinearLocationReferences based on specified query parameters.\n * @returns Returns an array of LinearLocationReferences.\n * @throws [[IModelError]]\n */\n public static queryLinearLocations(iModel: IModelDb, linearElementId: Id64String, queryParams: QueryParams): LinearLocationReference[] {\n const ecSqlGen = new QueryLinearLocationsECSQLGen(queryParams);\n const ecsqlAndBindVals = ecSqlGen.generate(linearElementId);\n\n const linearLocationRefs: LinearLocationReference[] = [];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n iModel.withPreparedStatement(ecsqlAndBindVals[0], (stmt: ECSqlStatement) => {\n stmt.bindValues(ecsqlAndBindVals[1]);\n\n while (DbResult.BE_SQLITE_ROW === stmt.step()) {\n const linearLocationRef: LinearLocationReference = {\n linearlyLocatedId: stmt.getValue(0).getId(),\n linearlyLocatedClassFullName: stmt.getValue(1).getString(),\n startDistanceAlong: stmt.getValue(2).getDouble(),\n stopDistanceAlong: stmt.getValue(3).getDouble(),\n locationAspectId: stmt.getValue(4).getId(),\n };\n\n linearLocationRefs.push(linearLocationRef);\n }\n });\n\n return linearLocationRefs;\n }\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module LinearReferencing
|
|
3
3
|
*/
|
|
4
4
|
import { Id64String } from "@itwin/core-bentley";
|
|
5
|
-
import { ElementMultiAspect, IModelDb } from "@itwin/core-backend";
|
|
5
|
+
import { EditTxn, ElementMultiAspect, IModelDb } from "@itwin/core-backend";
|
|
6
6
|
import { DistanceExpressionProps, LinearlyReferencedAtLocationAspectProps, LinearlyReferencedFromToLocationAspectProps } from "@itwin/linear-referencing-common";
|
|
7
7
|
import { LinearlyReferencedAtPositionRefersToReferent, LinearlyReferencedFromPositionRefersToReferent, LinearlyReferencedToPositionRefersToReferent } from "./LinearReferencingRelationships";
|
|
8
8
|
/** Core structure carrying linearly-referenced information.
|
|
@@ -34,6 +34,13 @@ export declare class LinearlyReferencedAtLocation extends LinearlyReferencedLoca
|
|
|
34
34
|
constructor(props: LinearlyReferencedAtLocationAspectProps, iModel: IModelDb);
|
|
35
35
|
private static toProps;
|
|
36
36
|
static create(iModel: IModelDb, locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocation;
|
|
37
|
+
/** Insert a new aspect using an explicit transaction.
|
|
38
|
+
* @beta
|
|
39
|
+
*/
|
|
40
|
+
static insert(txn: EditTxn, locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): void;
|
|
41
|
+
/** Insert a new aspect.
|
|
42
|
+
* @deprecated Use LinearlyReferencedAtLocation.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
43
|
+
*/
|
|
37
44
|
static insert(iModel: IModelDb, locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): void;
|
|
38
45
|
}
|
|
39
46
|
/** Concrete multi-aspect class carrying 'from-to' linearly-referenced positions along a Linear-Element.
|
|
@@ -49,6 +56,13 @@ export declare class LinearlyReferencedFromToLocation extends LinearlyReferenced
|
|
|
49
56
|
constructor(props: LinearlyReferencedFromToLocationAspectProps, iModel: IModelDb);
|
|
50
57
|
private static toProps;
|
|
51
58
|
static create(iModel: IModelDb, locatedElementId: Id64String, from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocation;
|
|
59
|
+
/** Insert a new aspect using an explicit transaction.
|
|
60
|
+
* @beta
|
|
61
|
+
*/
|
|
62
|
+
static insert(txn: EditTxn, locatedElementId: Id64String, from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;
|
|
63
|
+
/** Insert a new aspect.
|
|
64
|
+
* @deprecated Use LinearlyReferencedFromToLocation.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
|
|
65
|
+
*/
|
|
52
66
|
static insert(iModel: IModelDb, locatedElementId: Id64String, from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;
|
|
53
67
|
}
|
|
54
68
|
//# sourceMappingURL=LinearReferencingElementAspects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinearReferencingElementAspects.d.ts","sourceRoot":"","sources":["../../src/LinearReferencingElementAspects.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"LinearReferencingElementAspects.d.ts","sourceRoot":"","sources":["../../src/LinearReferencingElementAspects.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG5E,OAAO,EACL,uBAAuB,EAAE,uCAAuC,EAAE,2CAA2C,EAC9G,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,4CAA4C,EAAE,8CAA8C,EAAE,4CAA4C,EAC3I,MAAM,kCAAkC,CAAC;AAE1C;;GAEG;AACH,qBAAa,kBAAmB,YAAW,uBAAuB;IACzD,sBAAsB,EAAE,MAAM,CAAC;IAC/B,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,gCAAgC,CAAC,EAAE,MAAM,CAAC;IAC1C,yBAAyB,CAAC,EAAE,MAAM,CAAC;gBAE9B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O;WAcR,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,UAAU,EACjE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,kBAAkB,EAAE,cAAc,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,UAAU,GAAG,gCAAgC;IAI7I;;OAEG;WACW,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAC7D,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,kBAAkB,EAAE,cAAc,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,UAAU,GAAG,IAAI;IAEjH;;OAEG;WACW,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,UAAU,EACjE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,kBAAkB,EAAE,cAAc,CAAC,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,UAAU,GAAG,IAAI;CAOlH"}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* @module LinearReferencing
|
|
7
7
|
*/
|
|
8
8
|
import { JsonUtils } from "@itwin/core-bentley";
|
|
9
|
-
import { ElementMultiAspect } from "@itwin/core-backend";
|
|
9
|
+
import { EditTxn, ElementMultiAspect } from "@itwin/core-backend";
|
|
10
|
+
import { _implicitTxn } from "@itwin/core-backend/lib/cjs/internal/Symbols";
|
|
10
11
|
import { RelatedElement } from "@itwin/core-common";
|
|
11
12
|
import { LinearlyReferencedAtPositionRefersToReferent, LinearlyReferencedFromPositionRefersToReferent, LinearlyReferencedToPositionRefersToReferent, } from "./LinearReferencingRelationships";
|
|
12
13
|
/** Core structure carrying linearly-referenced information.
|
|
@@ -57,8 +58,9 @@ export class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {
|
|
|
57
58
|
static create(iModel, locatedElementId, at, fromReferentId) {
|
|
58
59
|
return new LinearlyReferencedAtLocation(this.toProps(locatedElementId, at, fromReferentId), iModel);
|
|
59
60
|
}
|
|
60
|
-
static insert(
|
|
61
|
-
|
|
61
|
+
static insert(txnOrIModel, locatedElementId, at, fromReferentId) {
|
|
62
|
+
const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];
|
|
63
|
+
txn.insertAspect(this.toProps(locatedElementId, at, fromReferentId));
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
/** Concrete multi-aspect class carrying 'from-to' linearly-referenced positions along a Linear-Element.
|
|
@@ -92,8 +94,9 @@ export class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation
|
|
|
92
94
|
static create(iModel, locatedElementId, from, to, fromReferentId, toReferentId) {
|
|
93
95
|
return new LinearlyReferencedFromToLocation(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId), iModel);
|
|
94
96
|
}
|
|
95
|
-
static insert(
|
|
96
|
-
|
|
97
|
+
static insert(txnOrIModel, locatedElementId, from, to, fromReferentId, toReferentId) {
|
|
98
|
+
const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];
|
|
99
|
+
txn.insertAspect(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId));
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
102
|
//# 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,OAAO,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAY,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,OAAO,EACL,4CAA4C,EAAE,8CAA8C,EAAE,4CAA4C,GAC3I,MAAM,kCAAkC,CAAC;AAE1C;;GAEG;AACH,MAAM,OAAO,kBAAkB;IACtB,sBAAsB,C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------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module LinearReferencing\n */\n\nimport { Id64String, JsonUtils } from \"@itwin/core-bentley\";\nimport { ElementMultiAspect, IModelDb } from \"@itwin/core-backend\";\nimport { RelatedElement } from \"@itwin/core-common\";\nimport {\n DistanceExpressionProps, LinearlyReferencedAtLocationAspectProps, LinearlyReferencedFromToLocationAspectProps,\n} from \"@itwin/linear-referencing-common\";\nimport {\n LinearlyReferencedAtPositionRefersToReferent, LinearlyReferencedFromPositionRefersToReferent, LinearlyReferencedToPositionRefersToReferent,\n} from \"./LinearReferencingRelationships\";\n\n/** Core structure carrying linearly-referenced information.\n * @beta\n */\nexport class DistanceExpression implements DistanceExpressionProps {\n public distanceAlongFromStart: number;\n public lateralOffsetFromILinearElement?: number;\n public verticalOffsetFromILinearElement?: number;\n public distanceAlongFromReferent?: number;\n\n constructor(props: DistanceExpressionProps) {\n this.distanceAlongFromStart = JsonUtils.asDouble(props.distanceAlongFromStart);\n this.lateralOffsetFromILinearElement = JsonUtils.asDouble(props.lateralOffsetFromILinearElement);\n this.verticalOffsetFromILinearElement = JsonUtils.asDouble(props.verticalOffsetFromILinearElement);\n this.distanceAlongFromReferent = JsonUtils.asDouble(props.distanceAlongFromReferent);\n }\n\n public static fromJSON(json: DistanceExpressionProps): DistanceExpression { return new DistanceExpression(json); }\n}\n\n/** Base class for multi-aspects carrying linearly-referenced locations.\n * @beta\n */\nexport class LinearlyReferencedLocation extends ElementMultiAspect {\n /** @internal */\n public static override get className(): string { return \"LinearlyReferencedLocation\"; }\n}\n\n/** Concrete multi-aspect class carrying 'at' linearly-referenced positions along a Linear-Element.\n * @beta\n */\nexport class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {\n /** @internal */\n public static override get className(): string { return \"LinearlyReferencedAtLocation\"; }\n\n public atPosition: DistanceExpression;\n public fromReferent?: LinearlyReferencedAtPositionRefersToReferent;\n\n constructor(props: LinearlyReferencedAtLocationAspectProps, iModel: IModelDb) {\n super(props, iModel);\n this.atPosition = DistanceExpression.fromJSON(props.atPosition);\n this.fromReferent = RelatedElement.fromJSON(props.fromReferent);\n }\n\n private static toProps(locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocationAspectProps {\n const props: LinearlyReferencedAtLocationAspectProps = {\n classFullName: LinearlyReferencedAtLocation.classFullName,\n element: { id: locatedElementId },\n atPosition: at,\n fromReferent: (fromReferentId === undefined) ? undefined : new LinearlyReferencedAtPositionRefersToReferent(fromReferentId),\n };\n\n return props;\n }\n\n public static create(iModel: IModelDb, locatedElementId: Id64String,\n at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocation {\n return new LinearlyReferencedAtLocation(this.toProps(locatedElementId, at, fromReferentId), iModel);\n }\n\n public static insert(iModel: IModelDb, locatedElementId: Id64String,\n at: DistanceExpression, fromReferentId?: Id64String): void {\n iModel.elements.insertAspect(this.toProps(locatedElementId, at, fromReferentId));\n }\n}\n\n/** Concrete multi-aspect class carrying 'from-to' linearly-referenced positions along a Linear-Element.\n * @beta\n */\nexport class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation {\n /** @internal */\n public static override get className(): string { return \"LinearlyReferencedFromToLocation\"; }\n\n public fromPosition: DistanceExpression;\n public fromPositionFromReferent?: LinearlyReferencedFromPositionRefersToReferent;\n public toPosition: DistanceExpression;\n public toPositionFromReferent?: LinearlyReferencedToPositionRefersToReferent;\n\n constructor(props: LinearlyReferencedFromToLocationAspectProps, iModel: IModelDb) {\n super(props, iModel);\n this.fromPosition = DistanceExpression.fromJSON(props.fromPosition);\n this.toPosition = DistanceExpression.fromJSON(props.toPosition);\n this.fromPositionFromReferent = RelatedElement.fromJSON(props.fromPositionFromReferent);\n this.toPositionFromReferent = RelatedElement.fromJSON(props.toPositionFromReferent);\n }\n\n private static toProps(locatedElementId: Id64String,\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocationAspectProps {\n const props: LinearlyReferencedFromToLocationAspectProps = {\n classFullName: LinearlyReferencedFromToLocation.classFullName,\n element: { id: locatedElementId },\n fromPosition: from,\n fromPositionFromReferent: (fromReferentId === undefined) ? undefined : new LinearlyReferencedFromPositionRefersToReferent(fromReferentId),\n toPosition: to,\n toPositionFromReferent: (toReferentId === undefined) ? undefined : new LinearlyReferencedToPositionRefersToReferent(toReferentId),\n };\n\n return props;\n }\n\n public static create(iModel: IModelDb, locatedElementId: Id64String,\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocation {\n return new LinearlyReferencedFromToLocation(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId), iModel);\n }\n\n public static insert(iModel: IModelDb, locatedElementId: Id64String,\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void {\n iModel.elements.insertAspect(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LinearReferencingElementAspects.js","sourceRoot":"","sources":["../../src/LinearReferencingElementAspects.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAY,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,OAAO,EACL,4CAA4C,EAAE,8CAA8C,EAAE,4CAA4C,GAC3I,MAAM,kCAAkC,CAAC;AAE1C;;GAEG;AACH,MAAM,OAAO,kBAAkB;IACtB,sBAAsB,CAAS;IAC/B,+BAA+B,CAAU;IACzC,gCAAgC,CAAU;IAC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AG,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,EAAE,EAAE,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC;IAC3F,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module LinearReferencing\n */\n\nimport { Id64String, JsonUtils } from \"@itwin/core-bentley\";\nimport { EditTxn, ElementMultiAspect, IModelDb } from \"@itwin/core-backend\";\nimport { _implicitTxn } from \"@itwin/core-backend/lib/cjs/internal/Symbols\";\nimport { RelatedElement } from \"@itwin/core-common\";\nimport {\n DistanceExpressionProps, LinearlyReferencedAtLocationAspectProps, LinearlyReferencedFromToLocationAspectProps,\n} from \"@itwin/linear-referencing-common\";\nimport {\n LinearlyReferencedAtPositionRefersToReferent, LinearlyReferencedFromPositionRefersToReferent, LinearlyReferencedToPositionRefersToReferent,\n} from \"./LinearReferencingRelationships\";\n\n/** Core structure carrying linearly-referenced information.\n * @beta\n */\nexport class DistanceExpression implements DistanceExpressionProps {\n public distanceAlongFromStart: number;\n public lateralOffsetFromILinearElement?: number;\n public verticalOffsetFromILinearElement?: number;\n public distanceAlongFromReferent?: number;\n\n constructor(props: DistanceExpressionProps) {\n this.distanceAlongFromStart = JsonUtils.asDouble(props.distanceAlongFromStart);\n this.lateralOffsetFromILinearElement = JsonUtils.asDouble(props.lateralOffsetFromILinearElement);\n this.verticalOffsetFromILinearElement = JsonUtils.asDouble(props.verticalOffsetFromILinearElement);\n this.distanceAlongFromReferent = JsonUtils.asDouble(props.distanceAlongFromReferent);\n }\n\n public static fromJSON(json: DistanceExpressionProps): DistanceExpression { return new DistanceExpression(json); }\n}\n\n/** Base class for multi-aspects carrying linearly-referenced locations.\n * @beta\n */\nexport class LinearlyReferencedLocation extends ElementMultiAspect {\n /** @internal */\n public static override get className(): string { return \"LinearlyReferencedLocation\"; }\n}\n\n/** Concrete multi-aspect class carrying 'at' linearly-referenced positions along a Linear-Element.\n * @beta\n */\nexport class LinearlyReferencedAtLocation extends LinearlyReferencedLocation {\n /** @internal */\n public static override get className(): string { return \"LinearlyReferencedAtLocation\"; }\n\n public atPosition: DistanceExpression;\n public fromReferent?: LinearlyReferencedAtPositionRefersToReferent;\n\n constructor(props: LinearlyReferencedAtLocationAspectProps, iModel: IModelDb) {\n super(props, iModel);\n this.atPosition = DistanceExpression.fromJSON(props.atPosition);\n this.fromReferent = RelatedElement.fromJSON(props.fromReferent);\n }\n\n private static toProps(locatedElementId: Id64String, at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocationAspectProps {\n const props: LinearlyReferencedAtLocationAspectProps = {\n classFullName: LinearlyReferencedAtLocation.classFullName,\n element: { id: locatedElementId },\n atPosition: at,\n fromReferent: (fromReferentId === undefined) ? undefined : new LinearlyReferencedAtPositionRefersToReferent(fromReferentId),\n };\n\n return props;\n }\n\n public static create(iModel: IModelDb, locatedElementId: Id64String,\n at: DistanceExpression, fromReferentId?: Id64String): LinearlyReferencedAtLocation {\n return new LinearlyReferencedAtLocation(this.toProps(locatedElementId, at, fromReferentId), iModel);\n }\n\n /** Insert a new aspect using an explicit transaction.\n * @beta\n */\n public static insert(txn: EditTxn, locatedElementId: Id64String,\n at: DistanceExpression, fromReferentId?: Id64String): void;\n\n /** Insert a new aspect.\n * @deprecated Use LinearlyReferencedAtLocation.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\n */\n public static insert(iModel: IModelDb, locatedElementId: Id64String,\n at: DistanceExpression, fromReferentId?: Id64String): void;\n\n public static insert(txnOrIModel: EditTxn | IModelDb, locatedElementId: Id64String,\n at: DistanceExpression, fromReferentId?: Id64String): void {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n txn.insertAspect(this.toProps(locatedElementId, at, fromReferentId));\n }\n}\n\n/** Concrete multi-aspect class carrying 'from-to' linearly-referenced positions along a Linear-Element.\n * @beta\n */\nexport class LinearlyReferencedFromToLocation extends LinearlyReferencedLocation {\n /** @internal */\n public static override get className(): string { return \"LinearlyReferencedFromToLocation\"; }\n\n public fromPosition: DistanceExpression;\n public fromPositionFromReferent?: LinearlyReferencedFromPositionRefersToReferent;\n public toPosition: DistanceExpression;\n public toPositionFromReferent?: LinearlyReferencedToPositionRefersToReferent;\n\n constructor(props: LinearlyReferencedFromToLocationAspectProps, iModel: IModelDb) {\n super(props, iModel);\n this.fromPosition = DistanceExpression.fromJSON(props.fromPosition);\n this.toPosition = DistanceExpression.fromJSON(props.toPosition);\n this.fromPositionFromReferent = RelatedElement.fromJSON(props.fromPositionFromReferent);\n this.toPositionFromReferent = RelatedElement.fromJSON(props.toPositionFromReferent);\n }\n\n private static toProps(locatedElementId: Id64String,\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocationAspectProps {\n const props: LinearlyReferencedFromToLocationAspectProps = {\n classFullName: LinearlyReferencedFromToLocation.classFullName,\n element: { id: locatedElementId },\n fromPosition: from,\n fromPositionFromReferent: (fromReferentId === undefined) ? undefined : new LinearlyReferencedFromPositionRefersToReferent(fromReferentId),\n toPosition: to,\n toPositionFromReferent: (toReferentId === undefined) ? undefined : new LinearlyReferencedToPositionRefersToReferent(toReferentId),\n };\n\n return props;\n }\n\n public static create(iModel: IModelDb, locatedElementId: Id64String,\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): LinearlyReferencedFromToLocation {\n return new LinearlyReferencedFromToLocation(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId), iModel);\n }\n\n /** Insert a new aspect using an explicit transaction.\n * @beta\n */\n public static insert(txn: EditTxn, locatedElementId: Id64String,\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;\n\n /** Insert a new aspect.\n * @deprecated Use LinearlyReferencedFromToLocation.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.\n */\n public static insert(iModel: IModelDb, locatedElementId: Id64String,\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void;\n\n public static insert(txnOrIModel: EditTxn | IModelDb, locatedElementId: Id64String,\n from: DistanceExpression, to: DistanceExpression, fromReferentId?: Id64String, toReferentId?: Id64String): void {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n txn.insertAspect(this.toProps(locatedElementId, from, to, fromReferentId, toReferentId));\n }\n}\n"]}
|
|
@@ -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,s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