@itwin/core-backend 5.7.0-dev.12 → 5.7.0-dev.13
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/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +2 -0
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js +2 -0
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/test/standalone/ViewDefinition.test.js +14 -2
- package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewDefinition.d.ts","sourceRoot":"","sources":["../../src/ViewDefinition.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAkB,SAAS,EAAE,UAAU,EAA2B,MAAM,qBAAqB,CAAC;AACrG,OAAO,EACL,KAAK,EAAY,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAa,QAAQ,EAAE,kBAAkB,EAChH,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAe,MAAM,EAAE,qBAAqB,EAAE,IAAI,EAAE,cAAc,EACzH,mBAAmB,EAAE,kBAAkB,EAAe,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EACtH,0BAA0B,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,WAAW,EAC/H,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAg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;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,sBAAsB;IACvD,WAA2B,SAAS,IAAI,MAAM,CAA4B;IAC1E,iDAAiD;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAEzB,SAAS,aAAa,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,QAAQ;CAIlE"}
|
|
@@ -617,6 +617,8 @@ class ViewDefinition2d extends ViewDefinition {
|
|
|
617
617
|
constructor(props, iModel) {
|
|
618
618
|
super(props, iModel);
|
|
619
619
|
this.baseModelId = core_bentley_1.Id64.fromJSON(props.baseModelId);
|
|
620
|
+
if (!core_bentley_1.Id64.isValid(this.baseModelId))
|
|
621
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadArg, `baseModelId is invalid`);
|
|
620
622
|
this.origin = core_geometry_1.Point2d.fromJSON(props.origin);
|
|
621
623
|
this.delta = core_geometry_1.Point2d.fromJSON(props.delta);
|
|
622
624
|
this.angle = core_geometry_1.Angle.fromJSON(props.angle);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewDefinition.js","sourceRoot":"","sources":["../../src/ViewDefinition.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAqG;AACrG,wDAE8B;AAC9B,oDAK4B;AAC5B,uCAA0F;AAM1F;;;GAGG;AACH,MAAa,aAAc,SAAQ,2BAAiB;IAC3C,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IAE1E,mFAAmF;IAC5E,MAAM,CAAe;IAE5B,YAAsB,KAAyB,EAAE,MAAgB;QAC/D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IAEe,MAAM;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAwB,CAAC;QACjD,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,M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,aAAc,SAAQ,gCAAsB;IAChD,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IAC1E,iDAAiD;IAC1C,OAAO,CAAW;IAEzB,YAAsB,KAAyB,EAAE,MAAgB;QAC/D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC/B,CAAC;CACF;AATD,sCASC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ViewDefinitions\r\n */\r\n\r\nimport { DbResult, Id64, Id64Array, Id64String, IModelStatus, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, Matrix3d, Point2d, Point3d, Range2d, Range3d, StandardViewIndex, Transform, Vector3d, YawPitchRollAngles,\r\n} from \"@itwin/core-geometry\";\r\nimport {\r\n AuxCoordSystem2dProps, AuxCoordSystem3dProps, AuxCoordSystemProps, BisCodeSpec, Camera, CategorySelectorProps, Code, CodeScopeProps,\r\n CodeSpec, ConcreteEntityTypes, EntityReferenceSet, IModelError, LightLocationProps, ModelSelectorProps, RelatedElement,\r\n SpatialViewDefinitionProps, ViewAttachmentProps, ViewDefinition2dProps, ViewDefinition3dProps, ViewDefinitionProps, ViewDetails,\r\n ViewDetails3d,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionElement, GraphicalElement2d, SpatialLocationElement } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { DisplayStyle, DisplayStyle2d, DisplayStyle3d } from \"./DisplayStyle\";\r\nimport { IModelElementCloneContext } from \"./IModelElementCloneContext\";\r\nimport { CustomHandledProperty, DeserializeEntityArgs, ECSqlRow } from \"./Entity\";\r\n\r\n/** Holds the list of Ids of GeometricModels displayed by a [[SpatialViewDefinition]]. Multiple SpatialViewDefinitions may point to the same ModelSelector.\r\n * @see [ModelSelectorState]($frontend)\r\n * @public @preview\r\n */\r\nexport class ModelSelector extends DefinitionElement {\r\n public static override get className(): string { return \"ModelSelector\"; }\r\n\r\n /** The array of modelIds of the GeometricModels displayed by this ModelSelector */\r\n public models: Id64String[];\r\n\r\n protected constructor(props: ModelSelectorProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.models = props.models;\r\n }\r\n\r\n public override toJSON(): ModelSelectorProps {\r\n const val = super.toJSON() as ModelSelectorProps;\r\n val.models = this.models;\r\n return val;\r\n }\r\n\r\n /**\r\n * ModelSelector custom HandledProps includes 'models'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"models\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ModelSelector deserializes 'models'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ModelSelectorProps {\r\n const elProps = super.deserialize(props) as ModelSelectorProps;\r\n const instance = props.row;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n elProps.models = props.iModel.withPreparedStatement(\"SELECT TargetECInstanceId FROM Bis.ModelSelectorRefersToModels WHERE SourceECInstanceId=?\", (statement) => {\r\n statement.bindId(1, instance.id);\r\n const ids: Id64Array = [];\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n ids.push(statement.getValue(0).getId());\r\n }\r\n return ids;\r\n });\r\n return elProps;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n this.models.forEach((modelId: Id64String) => referenceIds.addModel(modelId));\r\n }\r\n\r\n /** Create a Code for a ModelSelector given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the ModelSelector and provides the scope for its name.\r\n * @param codeValue The ModelSelector name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.modelSelector);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /**\r\n * Create a ModelSelector to select which Models are displayed by a ViewDefinition.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the ModelSelector\r\n * @param models Array of models to select for display\r\n * @returns The newly constructed ModelSelector element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, models: Id64Array): ModelSelector {\r\n const modelSelectorProps: ModelSelectorProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n model: definitionModelId,\r\n models,\r\n isPrivate: false,\r\n };\r\n return new ModelSelector(modelSelectorProps, iModelDb);\r\n }\r\n /**\r\n * Insert a ModelSelector to select which Models are displayed by a ViewDefinition.\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new ModelSelector into this DefinitionModel\r\n * @param name The name/CodeValue of the ModelSelector\r\n * @param models Array of models to select for display\r\n * @returns The Id of the newly inserted ModelSelector element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, models: Id64Array): Id64String {\r\n const modelSelector = this.create(iModelDb, definitionModelId, name, models);\r\n return iModelDb.elements.insertElement(modelSelector.toJSON());\r\n }\r\n}\r\n\r\n/** Holds a list of Ids of Categories to be displayed in a view.\r\n * @see [CategorySelectorState]($frontend)\r\n * See [how to create a CategorySelector]($docs/learning/backend/CreateElements.md#CategorySelector).\r\n * @public @preview\r\n */\r\nexport class CategorySelector extends DefinitionElement {\r\n public static override get className(): string { return \"CategorySelector\"; }\r\n /** The array of element Ids of the Categories selected by this CategorySelector */\r\n public categories: Id64String[];\r\n\r\n protected constructor(props: CategorySelectorProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.categories = props.categories;\r\n }\r\n\r\n public override toJSON(): CategorySelectorProps {\r\n const val = super.toJSON() as CategorySelectorProps;\r\n val.categories = this.categories;\r\n return val;\r\n }\r\n\r\n /**\r\n * CategorySelector custom HandledProps includes 'categories'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"categories\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * CategorySelector deserializes 'categories'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): CategorySelectorProps {\r\n const elProps = super.deserialize(props) as CategorySelectorProps;\r\n const instance = props.row;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n elProps.categories = props.iModel.withPreparedStatement(\"SELECT TargetECInstanceId FROM Bis.CategorySelectorRefersToCategories WHERE SourceECInstanceId=?\", (statement) => {\r\n statement.bindId(1, instance.id);\r\n const ids: Id64Array = [];\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n ids.push(statement.getValue(0).getId());\r\n }\r\n return ids;\r\n });\r\n return elProps;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n this.categories.forEach((categoryId: Id64String) => referenceIds.addElement(categoryId));\r\n }\r\n\r\n /** Create a Code for a CategorySelector given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the CategorySelector and provides the scope for its name.\r\n * @param codeValue The CategorySelector name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.categorySelector);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /**\r\n * Create a CategorySelector to select which categories are displayed by a ViewDefinition.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name of the CategorySelector\r\n * @param categories Array of categories to select for display\r\n * @returns The newly constructed CategorySelector element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, categories: Id64Array): CategorySelector {\r\n const categorySelectorProps: CategorySelectorProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n model: definitionModelId,\r\n categories,\r\n isPrivate: false,\r\n };\r\n return new CategorySelector(categorySelectorProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a CategorySelector to select which categories are displayed by a ViewDefinition.\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new CategorySelector into this DefinitionModel\r\n * @param name The name of the CategorySelector\r\n * @param categories Array of categories to select for display\r\n * @returns The Id of the newly inserted CategorySelector element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, categories: Id64Array): Id64String {\r\n const categorySelector = this.create(iModelDb, definitionModelId, name, categories);\r\n return iModelDb.elements.insertElement(categorySelector.toJSON());\r\n }\r\n}\r\n\r\n/**\r\n * The definition element for a view. ViewDefinitions specify the area/volume that is viewed, the Ids of a DisplayStyle and a CategorySelector,\r\n * plus additional view-specific parameters in their [[Element.jsonProperties]].\r\n * Subclasses of ViewDefinition determine which model(s) are viewed.\r\n * @note ViewDefinition is only available in the backend. See [ViewState]($frontend) for usage in the frontend.\r\n * @public @preview\r\n */\r\nexport abstract class ViewDefinition extends DefinitionElement {\r\n public static override get className(): string { return \"ViewDefinition\"; }\r\n /** The element Id of the [[CategorySelector]] for this ViewDefinition */\r\n public categorySelectorId: Id64String;\r\n /** The element Id of the [[DisplayStyle]] for this ViewDefinition */\r\n public displayStyleId: Id64String;\r\n\r\n protected constructor(props: ViewDefinitionProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n\r\n this.categorySelectorId = Id64.fromJSON(props.categorySelectorId);\r\n if (!Id64.isValid(this.categorySelectorId))\r\n throw new IModelError(IModelStatus.BadArg, `categorySelectorId is invalid`);\r\n\r\n this.displayStyleId = Id64.fromJSON(props.displayStyleId);\r\n if (!Id64.isValid(this.displayStyleId))\r\n throw new IModelError(IModelStatus.BadArg, `displayStyleId is invalid`);\r\n }\r\n\r\n /**\r\n * ViewDefinition custom HandledProps includes 'categorySelector', and 'displayStyle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"categorySelector\", source: \"Class\" },\r\n { propertyName: \"displayStyle\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ViewDefinition deserializes 'categorySelector', and 'displayStyle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ViewDefinitionProps {\r\n const elProps = super.deserialize(props) as ViewDefinitionProps;\r\n const instance = props.row;\r\n if (instance.isPrivate !== undefined)\r\n elProps.isPrivate = instance.isPrivate;\r\n elProps.categorySelectorId = instance.categorySelector.id;\r\n elProps.displayStyleId = instance.displayStyle.id;\r\n return elProps;\r\n }\r\n\r\n /**\r\n * ViewDefinition serializes 'categorySelector', and 'displayStyle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: ViewDefinitionProps, _iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, _iModel);\r\n inst.categorySelector.id = props.categorySelectorId;\r\n inst.displayStyle.id = props.displayStyleId;\r\n return inst;\r\n }\r\n\r\n public override toJSON(): ViewDefinitionProps {\r\n const json = super.toJSON() as ViewDefinitionProps;\r\n json.categorySelectorId = this.categorySelectorId;\r\n json.displayStyleId = this.displayStyleId;\r\n return json;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.categorySelectorId);\r\n referenceIds.addElement(this.displayStyleId);\r\n const acsId: Id64String = this.getAuxiliaryCoordinateSystemId();\r\n if (Id64.isValidId64(acsId)) {\r\n referenceIds.addElement(acsId);\r\n }\r\n }\r\n\r\n /** @beta */\r\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"categorySelectorId\", \"displayStyleId\"];\r\n /** @alpha */\r\n public static override readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes> = {\r\n ...super.requiredReferenceKeyTypeMap,\r\n categorySelectorId: ConcreteEntityTypes.Element,\r\n displayStyleId: ConcreteEntityTypes.Element,\r\n };\r\n\r\n /** @beta */\r\n protected static override async onCloned(context: IModelElementCloneContext, sourceElementProps: ViewDefinitionProps, targetElementProps: ViewDefinitionProps): Promise<void> {\r\n await super.onCloned(context, sourceElementProps, targetElementProps);\r\n if (context.isBetweenIModels && targetElementProps.jsonProperties && targetElementProps.jsonProperties.viewDetails) {\r\n const acsId: Id64String = Id64.fromJSON(targetElementProps.jsonProperties.viewDetails.acs);\r\n if (Id64.isValidId64(acsId)) {\r\n targetElementProps.jsonProperties.viewDetails.acs = context.findTargetElementId(acsId);\r\n }\r\n }\r\n }\r\n\r\n /** Type guard for `instanceof ViewDefinition3d` */\r\n public isView3d(): this is ViewDefinition3d { return this instanceof ViewDefinition3d; }\r\n /** Type guard for 'instanceof ViewDefinition2d` */\r\n public isView2d(): this is ViewDefinition2d { return this instanceof ViewDefinition2d; }\r\n /** Type guard for `instanceof SpatialViewDefinition` */\r\n public isSpatialView(): this is SpatialViewDefinition { return this instanceof SpatialViewDefinition; }\r\n /** Type guard for 'instanceof DrawingViewDefinition' */\r\n public isDrawingView(): this is DrawingViewDefinition { return this instanceof DrawingViewDefinition; }\r\n\r\n /** Load this view's DisplayStyle from the IModelDb. */\r\n public loadDisplayStyle(): DisplayStyle { return this.iModel.elements.getElement<DisplayStyle>(this.displayStyleId); }\r\n\r\n /** Load this view's CategorySelector from the IModelDb. */\r\n public loadCategorySelector(): CategorySelector { return this.iModel.elements.getElement<CategorySelector>(this.categorySelectorId); }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public abstract get details(): ViewDetails;\r\n\r\n /** The Id of the AuxiliaryCoordinateSystem for this ViewDefinition, or an invalid Id if no ACS is defined. */\r\n public getAuxiliaryCoordinateSystemId(): Id64String {\r\n return this.details.auxiliaryCoordinateSystemId;\r\n }\r\n\r\n /** Set or clear the AuxiliaryCoordinateSystem for this ViewDefinition.\r\n * @param acsId The Id of the new AuxiliaryCoordinateSystem. If `Id64.invalid` is passed, then no AuxiliaryCoordinateSystem will be used.\r\n */\r\n public setAuxiliaryCoordinateSystemId(acsId: Id64String) {\r\n this.details.auxiliaryCoordinateSystemId = acsId;\r\n }\r\n\r\n /** Create a Code for a ViewDefinition given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel to contain the ViewDefinition and provides the scope for its name.\r\n * @param codeValue The ViewDefinition name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.viewDefinition);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Defines a view of one or more 3d models.\r\n * @public @preview\r\n */\r\nexport abstract class ViewDefinition3d extends ViewDefinition {\r\n private readonly _details: ViewDetails3d;\r\n public static override get className(): string { return \"ViewDefinition3d\"; }\r\n /** If true, camera is used. Otherwise, use an orthographic projection. */\r\n public cameraOn: boolean;\r\n /** The lower left back corner of the view frustum. */\r\n public origin: Point3d;\r\n /** The extent (size) of the view frustum, in meters, along its x,y,z axes. */\r\n public extents: Vector3d;\r\n /** Rotation from world coordinates to view coordinates. */\r\n public angles: YawPitchRollAngles;\r\n /** The camera used for this view, if `cameraOn` is true. */\r\n public camera: Camera;\r\n\r\n protected constructor(props: ViewDefinition3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.cameraOn = JsonUtils.asBool(props.cameraOn);\r\n this.origin = Point3d.fromJSON(props.origin);\r\n this.extents = Vector3d.fromJSON(props.extents);\r\n this.angles = YawPitchRollAngles.fromJSON(props.angles);\r\n this.camera = new Camera(props.camera);\r\n this._details = new ViewDetails3d(this.jsonProperties);\r\n }\r\n\r\n /**\r\n * ViewDefinition3d custom HandledProps includes 'eyePoint', 'focusDistance', 'lensAngle', 'yaw', 'pitch', 'roll',\r\n * 'origin', 'extents', and 'isCameraOn'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"eyePoint\", source: \"Class\" },\r\n { propertyName: \"focusDistance\", source: \"Class\" },\r\n { propertyName: \"lensAngle\", source: \"Class\" },\r\n { propertyName: \"yaw\", source: \"Class\" },\r\n { propertyName: \"roll\", source: \"Class\" },\r\n { propertyName: \"pitch\", source: \"Class\" },\r\n { propertyName: \"origin\", source: \"Class\" },\r\n { propertyName: \"extents\", source: \"Class\" },\r\n { propertyName: \"isCameraOn\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ViewDefinition3d deserializes 'eyePoint', 'focusDistance', 'lensAngle', 'yaw', 'pitch', 'roll',\r\n * 'origin', 'extents', and 'isCameraOn'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ViewDefinition3dProps {\r\n const instance = props.row;\r\n const elProps = super.deserialize(props) as ViewDefinition3dProps;\r\n // ViewDefinition3dProps\r\n elProps.cameraOn = instance.isCameraOn as boolean;\r\n elProps.origin = [ instance.origin.x, instance.origin.y, instance.origin.z ];\r\n elProps.extents = [ instance.extents.x, instance.extents.y, instance.extents.z ];\r\n elProps.camera = { eye: [instance.eyePoint.x, instance.eyePoint.y, instance.eyePoint.z], focusDist: instance.focusDistance, lens: Angle.createRadians(instance.lensAngle).toJSON() };\r\n elProps.angles = YawPitchRollAngles.createDegrees(instance.yaw ?? 0, instance.pitch ?? 0, instance.roll ?? 0).toJSON();\r\n return elProps;\r\n }\r\n\r\n /**\r\n * ViewDefinition3d serializes 'eyePoint', 'focusDistance', 'lensAngle', 'yaw', 'pitch', 'roll',\r\n * 'origin', 'extents', and 'isCameraOn'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: ViewDefinition3dProps, _iModel: IModelDb): ECSqlRow {\r\n const row = super.serialize(props, _iModel);\r\n row.isCameraOn = props.cameraOn;\r\n row.eyePoint = props.camera.eye;\r\n row.focusDistance = props.camera.focusDist;\r\n row.lensAngle = props.camera.lens;\r\n if (props.angles) {\r\n row.yaw = props.angles.yaw;\r\n row.roll = props.angles.roll;\r\n row.pitch = props.angles.pitch;\r\n }\r\n return row;\r\n }\r\n\r\n public override toJSON(): ViewDefinition3dProps {\r\n const val = super.toJSON() as ViewDefinition3dProps;\r\n val.cameraOn = this.cameraOn;\r\n val.origin = this.origin;\r\n val.extents = this.extents;\r\n val.angles = this.angles;\r\n val.camera = this.camera;\r\n return val;\r\n }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public get details(): ViewDetails3d { return this._details; }\r\n\r\n /** Load this view's DisplayStyle3d from the IModelDb. */\r\n public loadDisplayStyle3d(): DisplayStyle3d { return this.iModel.elements.getElement<DisplayStyle3d>(this.displayStyleId); }\r\n}\r\n\r\n/** Defines a view of one or more SpatialModels.\r\n * The list of viewed models is stored by the ModelSelector.\r\n *\r\n * This is how a SpatialViewDefinition selects the elements to display:\r\n *\r\n * SpatialViewDefinition\r\n * * ModelSelector\r\n * * ModelIds -------> SpatialModels <----------GeometricElement3d.Model\r\n * * CategorySelector\r\n * * CategoryIds -----> SpatialCategories <----------GeometricElement3d.Category\r\n * @public @preview\r\n */\r\nexport class SpatialViewDefinition extends ViewDefinition3d {\r\n public static override get className(): string { return \"SpatialViewDefinition\"; }\r\n /** The Id of the [[ModelSelector]] for this SpatialViewDefinition. */\r\n public modelSelectorId: Id64String;\r\n\r\n protected constructor(props: SpatialViewDefinitionProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.modelSelectorId = Id64.fromJSON(props.modelSelectorId);\r\n if (!Id64.isValid(this.modelSelectorId))\r\n throw new IModelError(IModelStatus.BadArg, `modelSelectorId is invalid`);\r\n }\r\n\r\n /** Construct a SpatialViewDefinition from its JSON representation. */\r\n public static fromJSON(props: Omit<SpatialViewDefinitionProps, \"classFullName\">, iModel: IModelDb) {\r\n return new SpatialViewDefinition({ ...props, classFullName: this.classFullName }, iModel);\r\n }\r\n\r\n public override toJSON(): SpatialViewDefinitionProps {\r\n const json = super.toJSON() as SpatialViewDefinitionProps;\r\n json.modelSelectorId = this.modelSelectorId;\r\n return json;\r\n }\r\n\r\n /**\r\n * SpatialViewDefinition custom HandledProps includes 'modelSelector'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"modelSelector\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * SpatialViewDefinition deserializes 'modelSelector'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): SpatialViewDefinitionProps {\r\n const elProps = super.deserialize(props) as SpatialViewDefinitionProps;\r\n const instance = props.row;\r\n elProps.modelSelectorId = instance.modelSelector.id;\r\n return elProps;\r\n }\r\n\r\n /**\r\n * SpatialViewDefinition serializes 'modelSelector'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: SpatialViewDefinitionProps, _iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, _iModel);\r\n inst.modelSelector.id = props.modelSelectorId;\r\n return inst;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.modelSelectorId);\r\n }\r\n\r\n /** @beta */\r\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"modelSelectorId\"];\r\n\r\n /** @alpha */\r\n public static override readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes> = {\r\n ...super.requiredReferenceKeyTypeMap,\r\n modelSelectorId: ConcreteEntityTypes.Element,\r\n };\r\n\r\n /** Load this view's ModelSelector from the IModelDb. */\r\n public loadModelSelector(): ModelSelector { return this.iModel.elements.getElement<ModelSelector>(this.modelSelectorId); }\r\n /**\r\n * Create a SpatialViewDefinition with the camera turned on.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @param cameraAngle Camera angle in radians.\r\n * @returns The newly constructed SpatialViewDefinition element\r\n * @throws [[IModelError]] if there is a problem creating the view\r\n */\r\n public static createWithCamera(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso, cameraAngle = Angle.piOver2Radians): SpatialViewDefinition {\r\n const rotation = Matrix3d.createStandardWorldToView(standardView);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n const cameraDistance = 2 * (rotatedRange.diagonal().magnitudeXY() / 2.0) / Math.tan(cameraAngle / 2.0);\r\n const cameraLocation = rotatedRange.diagonalFractionToPoint(.5); // Start at center.\r\n cameraLocation.z += cameraDistance; // Back up by camera distance.\r\n rotation.multiplyTransposeVectorInPlace(cameraLocation);\r\n\r\n const viewDefinitionProps: SpatialViewDefinitionProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n modelSelectorId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\r\n extents: rotatedRange.diagonal(),\r\n angles,\r\n cameraOn: true,\r\n camera: { lens: { radians: cameraAngle }, focusDist: cameraDistance, eye: cameraLocation },\r\n };\r\n\r\n return new SpatialViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n /**\r\n * Insert an SpatialViewDefinition with the camera turned on.\r\n * @see [[createWithCamera]] for details.\r\n * @returns The Id of the newly inserted SpatialViewDefinition element\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insertWithCamera(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso, cameraAngle = Angle.piOver2Radians): Id64String {\r\n const viewDefinition = this.createWithCamera(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView, cameraAngle);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n}\r\n\r\n/** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.\r\n * See [how to create a OrthographicViewDefinition]($docs/learning/backend/CreateElements.md#OrthographicViewDefinition).\r\n * @public @preview\r\n */\r\nexport class OrthographicViewDefinition extends SpatialViewDefinition {\r\n public static override get className(): string { return \"OrthographicViewDefinition\"; }\r\n\r\n constructor(props: SpatialViewDefinitionProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /**\r\n * Create an OrthographicViewDefinition\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @returns The newly constructed OrthographicViewDefinition element\r\n * @throws [[IModelError]] if there is a problem creating the view\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): OrthographicViewDefinition {\r\n const rotation = Matrix3d.createStandardWorldToView(standardView);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n const viewDefinitionProps: SpatialViewDefinitionProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n modelSelectorId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\r\n extents: rotatedRange.diagonal(),\r\n angles,\r\n cameraOn: false,\r\n camera: new Camera(), // not used when cameraOn === false\r\n };\r\n return new OrthographicViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert an OrthographicViewDefinition\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new OrthographicViewDefinition into this DefinitionModel\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @returns The Id of the newly inserted OrthographicViewDefinition element\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): Id64String {\r\n const viewDefinition = this.create(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n\r\n /** Set a new viewed range without changing the rotation or any other properties. */\r\n public setRange(range: Range3d): void {\r\n const rotation = this.angles.toMatrix3d();\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n this.origin = Point3d.createFrom(rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z));\r\n this.extents = rotatedRange.diagonal();\r\n }\r\n}\r\n\r\n/** Defines a view of a single 2d model. Each 2d model has its own coordinate system, so only one may appear per view.\r\n * @public @preview\r\n */\r\nexport class ViewDefinition2d extends ViewDefinition {\r\n private readonly _details: ViewDetails;\r\n\r\n public static override get className(): string { return \"ViewDefinition2d\"; }\r\n /** The Id of the Model displayed by this view. */\r\n public baseModelId: Id64String;\r\n /** The lower-left corner of this view in Model coordinates. */\r\n public origin: Point2d;\r\n /** The delta (size) of this view, in meters, aligned with view x,y. */\r\n public delta: Point2d;\r\n /** The rotation of this view. */\r\n public angle: Angle;\r\n\r\n protected constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.baseModelId = Id64.fromJSON(props.baseModelId);\r\n this.origin = Point2d.fromJSON(props.origin);\r\n this.delta = Point2d.fromJSON(props.delta);\r\n this.angle = Angle.fromJSON(props.angle);\r\n this._details = new ViewDetails(this.jsonProperties);\r\n }\r\n\r\n public override toJSON(): ViewDefinition2dProps {\r\n const val = super.toJSON() as ViewDefinition2dProps;\r\n val.baseModelId = this.baseModelId;\r\n val.origin = this.origin;\r\n val.delta = this.delta;\r\n val.angle = this.angle;\r\n return val;\r\n }\r\n\r\n /**\r\n * ViewDefinition2d custom HandledProps includes 'baseModel', 'origin', 'extents', and 'rotationAngle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"baseModel\", source: \"Class\" },\r\n { propertyName: \"origin\", source: \"Class\" },\r\n { propertyName: \"extents\", source: \"Class\" },\r\n { propertyName: \"rotationAngle\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ViewDefinition2d deserializes 'baseModel', 'origin', 'extents', and 'rotationAngle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ViewDefinition2dProps {\r\n const elProps = super.deserialize(props) as ViewDefinition2dProps;\r\n const instance = props.row;\r\n elProps.baseModelId = instance.baseModel.id;\r\n elProps.origin = [ instance.origin.x, instance.origin.y ];\r\n elProps.delta = [ instance.extents.x, instance.extents.y ];\r\n elProps.angle = instance.rotationAngle;\r\n return elProps;\r\n }\r\n\r\n /**\r\n * ViewDefinition2d serializes 'baseModel', 'origin', 'extents', and 'rotationAngle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: ViewDefinition2dProps, _iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, _iModel);\r\n inst.baseModel.id = props.baseModelId;\r\n inst.origin = props.origin;\r\n inst.extents = props.delta;\r\n inst.rotationAngle = props.angle;\r\n return inst;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.baseModelId);\r\n }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public get details(): ViewDetails { return this._details; }\r\n\r\n /** Load this view's DisplayStyle2d from the IModelDb. */\r\n public loadDisplayStyle2d(): DisplayStyle2d { return this.iModel.elements.getElement<DisplayStyle2d>(this.displayStyleId); }\r\n}\r\n\r\n/** Defines a view of a [[DrawingModel]].\r\n * @public @preview\r\n */\r\nexport class DrawingViewDefinition extends ViewDefinition2d {\r\n public static override get className(): string { return \"DrawingViewDefinition\"; }\r\n\r\n protected constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n\r\n /** Create a DrawingViewDefinition\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param baseModelId The base [[DrawingModel]]\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle2d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @throws [[IModelError]] if there is a problem creating the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, baseModelId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range2d): DrawingViewDefinition {\r\n const viewDefinitionProps: ViewDefinition2dProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n baseModelId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: { x: range.low.x, y: range.low.y },\r\n delta: range.diagonal(),\r\n angle: 0,\r\n };\r\n return new DrawingViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n\r\n /** Construct a DrawingViewDefinition from its JSON representation. */\r\n public static fromJSON(props: Omit<ViewDefinition2dProps, \"classFullName\">, iModel: IModelDb) {\r\n return new DrawingViewDefinition({ ...props, classFullName: this.classFullName }, iModel);\r\n }\r\n\r\n /** Insert a DrawingViewDefinition\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new DrawingViewDefinition into this [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param baseModelId The base [[DrawingModel]]\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle2d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, baseModelId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range2d): Id64String {\r\n const viewDefinition = this.create(iModelDb, definitionModelId, name, baseModelId, categorySelectorId, displayStyleId, range);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n}\r\n\r\n/** Arguments to be passed in to [[SheetViewDefinition.create]]\r\n * @public\r\n*/\r\nexport interface CreateSheetViewDefinitionArgs {\r\n /** The iModel in which the sheet view will be created. */\r\n iModel: IModelDb;\r\n /** The Id of the [[DefinitionModel]] into which the sheet view will be inserted. */\r\n definitionModelId: Id64String;\r\n /** The name to use as the view's Code value. */\r\n name: string;\r\n /** The Id of the sheet model whose contents will be displayed by this view. */\r\n baseModelId: Id64String;\r\n /** The [[CategorySelector]] that this view should use. */\r\n categorySelectorId: Id64String;\r\n /** The [[DisplayStyle2d]] that this view should use. */\r\n displayStyleId: Id64String;\r\n /** Defines the view origin and extents. */\r\n range: Range2d;\r\n}\r\n\r\n/** Defines a view of a [[SheetModel]].\r\n * @public @preview\r\n */\r\nexport class SheetViewDefinition extends ViewDefinition2d {\r\n public static override get className(): string { return \"SheetViewDefinition\"; }\r\n\r\n protected constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n\r\n /** Create a SheetViewDefinition */\r\n public static create(args: CreateSheetViewDefinitionArgs): SheetViewDefinition {\r\n const { baseModelId, categorySelectorId, displayStyleId, range } = args;\r\n const props: ViewDefinition2dProps = {\r\n classFullName: this.classFullName,\r\n model: args.definitionModelId,\r\n code: this.createCode(args.iModel, args.definitionModelId, args.name),\r\n baseModelId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: { x: range.low.x, y: range.low.y },\r\n delta: range.diagonal(),\r\n angle: 0,\r\n };\r\n\r\n return new SheetViewDefinition(props, args.iModel);\r\n }\r\n\r\n /** Insert a SheetViewDefinition into an IModelDb */\r\n public static insert(args: CreateSheetViewDefinitionArgs): Id64String {\r\n const view = this.create(args);\r\n return args.iModel.elements.insertElement(view.toJSON());\r\n }\r\n\r\n /** Create a SheetViewDefinition from JSON props */\r\n public static fromJSON(props: Omit<ViewDefinition2dProps, \"classFullName\">, iModel: IModelDb): SheetViewDefinition {\r\n return new SheetViewDefinition({ ...props, classFullName: this.classFullName }, iModel);\r\n }\r\n}\r\n\r\n/** A ViewDefinition used to display a 2d template model.\r\n * @internal\r\n */\r\nexport class TemplateViewDefinition2d extends ViewDefinition2d {\r\n public static override get className(): string { return \"TemplateViewDefinition2d\"; }\r\n}\r\n\r\n/** A ViewDefinition used to display a 3d template model.\r\n * @internal\r\n */\r\nexport class TemplateViewDefinition3d extends ViewDefinition3d {\r\n public static override get className(): string { return \"TemplateViewDefinition3d\"; }\r\n}\r\n\r\n/** An auxiliary coordinate system element. Auxiliary coordinate systems can be used by views to show\r\n * coordinate information in different units and/or orientations.\r\n * @public @preview\r\n */\r\nexport abstract class AuxCoordSystem extends DefinitionElement {\r\n public static override get className(): string { return \"AuxCoordSystem\"; }\r\n public type?: number;\r\n public description?: string;\r\n public constructor(props: AuxCoordSystemProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.type = props.type;\r\n this.description = props.description;\r\n }\r\n}\r\n\r\n/** A 2d auxiliary coordinate system.\r\n * @public @preview\r\n */\r\nexport class AuxCoordSystem2d extends AuxCoordSystem {\r\n public static override get className(): string { return \"AuxCoordSystem2d\"; }\r\n public origin?: Point2d;\r\n public angle?: number;\r\n public constructor(props: AuxCoordSystem2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.origin = props.origin ? Point2d.fromJSON(props.origin) : undefined;\r\n this.angle = props.angle ? Angle.fromJSON(props.angle).degrees : undefined;\r\n }\r\n\r\n /** Create a Code for a AuxCoordSystem2d element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem2d element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystem2d name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystem2d);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A 3d auxiliary coordinate system.\r\n * @public @preview\r\n */\r\nexport class AuxCoordSystem3d extends AuxCoordSystem {\r\n public static override get className(): string { return \"AuxCoordSystem3d\"; }\r\n public origin?: Point3d;\r\n public yaw?: number;\r\n public pitch?: number;\r\n public roll?: number;\r\n public constructor(props: AuxCoordSystem3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.origin = props.origin ? Point3d.fromJSON(props.origin) : undefined;\r\n this.yaw = props.yaw ? Angle.fromJSON(props.yaw).degrees : undefined;\r\n this.pitch = props.pitch ? Angle.fromJSON(props.pitch).degrees : undefined;\r\n this.roll = props.roll ? Angle.fromJSON(props.roll).degrees : undefined;\r\n }\r\n\r\n /** Create a Code for a AuxCoordSystem3d element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem3d element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystem3d name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystem3d);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A spatial auxiliary coordinate system.\r\n * @public @preview\r\n */\r\nexport class AuxCoordSystemSpatial extends AuxCoordSystem3d {\r\n public static override get className(): string { return \"AuxCoordSystemSpatial\"; }\r\n /** Create a Code for a AuxCoordSystemSpatial element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystemSpatial element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystemSpatial name\r\n */\r\n public static override createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystemSpatial);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Represents an *attachment* of a [[ViewDefinition]] to a [[Sheet]].\r\n * @public @preview\r\n */\r\nexport class ViewAttachment extends GraphicalElement2d {\r\n public static override get className(): string { return \"ViewAttachment\"; }\r\n public view: RelatedElement;\r\n public constructor(props: ViewAttachmentProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.view = new RelatedElement(props.view);\r\n // ###NOTE: scale, displayPriority, and clipping vectors are stored in ViewAttachmentProps.jsonProperties.\r\n }\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.view.id);\r\n }\r\n}\r\n\r\n/** The position in space of a Light.\r\n * @internal\r\n */\r\nexport class LightLocation extends SpatialLocationElement {\r\n public static override get className(): string { return \"LightLocation\"; }\r\n /** Whether this light is currently turned on. */\r\n public enabled?: boolean;\r\n\r\n protected constructor(props: LightLocationProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.enabled = props.enabled;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ViewDefinition.js","sourceRoot":"","sources":["../../src/ViewDefinition.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAqG;AACrG,wDAE8B;AAC9B,oDAK4B;AAC5B,uCAA0F;AAM1F;;;GAGG;AACH,MAAa,aAAc,SAAQ,2BAAiB;IAC3C,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IAE1E,mFAAmF;IAC5E,MAAM,CAAe;IAE5B,YAAsB,KAAyB,EAAE,MAAgB;QAC/D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IAEe,MAAM;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAw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mBAAmB,CAAC,YAAgC;QACrE,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACxC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;CACF;AAZD,wCAYC;AAED;;GAEG;AACH,MAAa,aAAc,SAAQ,gCAAsB;IAChD,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IAC1E,iDAAiD;IAC1C,OAAO,CAAW;IAEzB,YAAsB,KAAyB,EAAE,MAAgB;QAC/D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC/B,CAAC;CACF;AATD,sCASC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ViewDefinitions\r\n */\r\n\r\nimport { DbResult, Id64, Id64Array, Id64String, IModelStatus, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, Matrix3d, Point2d, Point3d, Range2d, Range3d, StandardViewIndex, Transform, Vector3d, YawPitchRollAngles,\r\n} from \"@itwin/core-geometry\";\r\nimport {\r\n AuxCoordSystem2dProps, AuxCoordSystem3dProps, AuxCoordSystemProps, BisCodeSpec, Camera, CategorySelectorProps, Code, CodeScopeProps,\r\n CodeSpec, ConcreteEntityTypes, EntityReferenceSet, IModelError, LightLocationProps, ModelSelectorProps, RelatedElement,\r\n SpatialViewDefinitionProps, ViewAttachmentProps, ViewDefinition2dProps, ViewDefinition3dProps, ViewDefinitionProps, ViewDetails,\r\n ViewDetails3d,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionElement, GraphicalElement2d, SpatialLocationElement } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { DisplayStyle, DisplayStyle2d, DisplayStyle3d } from \"./DisplayStyle\";\r\nimport { IModelElementCloneContext } from \"./IModelElementCloneContext\";\r\nimport { CustomHandledProperty, DeserializeEntityArgs, ECSqlRow } from \"./Entity\";\r\n\r\n/** Holds the list of Ids of GeometricModels displayed by a [[SpatialViewDefinition]]. Multiple SpatialViewDefinitions may point to the same ModelSelector.\r\n * @see [ModelSelectorState]($frontend)\r\n * @public @preview\r\n */\r\nexport class ModelSelector extends DefinitionElement {\r\n public static override get className(): string { return \"ModelSelector\"; }\r\n\r\n /** The array of modelIds of the GeometricModels displayed by this ModelSelector */\r\n public models: Id64String[];\r\n\r\n protected constructor(props: ModelSelectorProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.models = props.models;\r\n }\r\n\r\n public override toJSON(): ModelSelectorProps {\r\n const val = super.toJSON() as ModelSelectorProps;\r\n val.models = this.models;\r\n return val;\r\n }\r\n\r\n /**\r\n * ModelSelector custom HandledProps includes 'models'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"models\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ModelSelector deserializes 'models'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ModelSelectorProps {\r\n const elProps = super.deserialize(props) as ModelSelectorProps;\r\n const instance = props.row;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n elProps.models = props.iModel.withPreparedStatement(\"SELECT TargetECInstanceId FROM Bis.ModelSelectorRefersToModels WHERE SourceECInstanceId=?\", (statement) => {\r\n statement.bindId(1, instance.id);\r\n const ids: Id64Array = [];\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n ids.push(statement.getValue(0).getId());\r\n }\r\n return ids;\r\n });\r\n return elProps;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n this.models.forEach((modelId: Id64String) => referenceIds.addModel(modelId));\r\n }\r\n\r\n /** Create a Code for a ModelSelector given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the ModelSelector and provides the scope for its name.\r\n * @param codeValue The ModelSelector name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.modelSelector);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /**\r\n * Create a ModelSelector to select which Models are displayed by a ViewDefinition.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the ModelSelector\r\n * @param models Array of models to select for display\r\n * @returns The newly constructed ModelSelector element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, models: Id64Array): ModelSelector {\r\n const modelSelectorProps: ModelSelectorProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n model: definitionModelId,\r\n models,\r\n isPrivate: false,\r\n };\r\n return new ModelSelector(modelSelectorProps, iModelDb);\r\n }\r\n /**\r\n * Insert a ModelSelector to select which Models are displayed by a ViewDefinition.\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new ModelSelector into this DefinitionModel\r\n * @param name The name/CodeValue of the ModelSelector\r\n * @param models Array of models to select for display\r\n * @returns The Id of the newly inserted ModelSelector element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, models: Id64Array): Id64String {\r\n const modelSelector = this.create(iModelDb, definitionModelId, name, models);\r\n return iModelDb.elements.insertElement(modelSelector.toJSON());\r\n }\r\n}\r\n\r\n/** Holds a list of Ids of Categories to be displayed in a view.\r\n * @see [CategorySelectorState]($frontend)\r\n * See [how to create a CategorySelector]($docs/learning/backend/CreateElements.md#CategorySelector).\r\n * @public @preview\r\n */\r\nexport class CategorySelector extends DefinitionElement {\r\n public static override get className(): string { return \"CategorySelector\"; }\r\n /** The array of element Ids of the Categories selected by this CategorySelector */\r\n public categories: Id64String[];\r\n\r\n protected constructor(props: CategorySelectorProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.categories = props.categories;\r\n }\r\n\r\n public override toJSON(): CategorySelectorProps {\r\n const val = super.toJSON() as CategorySelectorProps;\r\n val.categories = this.categories;\r\n return val;\r\n }\r\n\r\n /**\r\n * CategorySelector custom HandledProps includes 'categories'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"categories\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * CategorySelector deserializes 'categories'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): CategorySelectorProps {\r\n const elProps = super.deserialize(props) as CategorySelectorProps;\r\n const instance = props.row;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n elProps.categories = props.iModel.withPreparedStatement(\"SELECT TargetECInstanceId FROM Bis.CategorySelectorRefersToCategories WHERE SourceECInstanceId=?\", (statement) => {\r\n statement.bindId(1, instance.id);\r\n const ids: Id64Array = [];\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n ids.push(statement.getValue(0).getId());\r\n }\r\n return ids;\r\n });\r\n return elProps;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n this.categories.forEach((categoryId: Id64String) => referenceIds.addElement(categoryId));\r\n }\r\n\r\n /** Create a Code for a CategorySelector given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the CategorySelector and provides the scope for its name.\r\n * @param codeValue The CategorySelector name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.categorySelector);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /**\r\n * Create a CategorySelector to select which categories are displayed by a ViewDefinition.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name of the CategorySelector\r\n * @param categories Array of categories to select for display\r\n * @returns The newly constructed CategorySelector element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, categories: Id64Array): CategorySelector {\r\n const categorySelectorProps: CategorySelectorProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n model: definitionModelId,\r\n categories,\r\n isPrivate: false,\r\n };\r\n return new CategorySelector(categorySelectorProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a CategorySelector to select which categories are displayed by a ViewDefinition.\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new CategorySelector into this DefinitionModel\r\n * @param name The name of the CategorySelector\r\n * @param categories Array of categories to select for display\r\n * @returns The Id of the newly inserted CategorySelector element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, categories: Id64Array): Id64String {\r\n const categorySelector = this.create(iModelDb, definitionModelId, name, categories);\r\n return iModelDb.elements.insertElement(categorySelector.toJSON());\r\n }\r\n}\r\n\r\n/**\r\n * The definition element for a view. ViewDefinitions specify the area/volume that is viewed, the Ids of a DisplayStyle and a CategorySelector,\r\n * plus additional view-specific parameters in their [[Element.jsonProperties]].\r\n * Subclasses of ViewDefinition determine which model(s) are viewed.\r\n * @note ViewDefinition is only available in the backend. See [ViewState]($frontend) for usage in the frontend.\r\n * @public @preview\r\n */\r\nexport abstract class ViewDefinition extends DefinitionElement {\r\n public static override get className(): string { return \"ViewDefinition\"; }\r\n /** The element Id of the [[CategorySelector]] for this ViewDefinition */\r\n public categorySelectorId: Id64String;\r\n /** The element Id of the [[DisplayStyle]] for this ViewDefinition */\r\n public displayStyleId: Id64String;\r\n\r\n protected constructor(props: ViewDefinitionProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n\r\n this.categorySelectorId = Id64.fromJSON(props.categorySelectorId);\r\n if (!Id64.isValid(this.categorySelectorId))\r\n throw new IModelError(IModelStatus.BadArg, `categorySelectorId is invalid`);\r\n\r\n this.displayStyleId = Id64.fromJSON(props.displayStyleId);\r\n if (!Id64.isValid(this.displayStyleId))\r\n throw new IModelError(IModelStatus.BadArg, `displayStyleId is invalid`);\r\n }\r\n\r\n /**\r\n * ViewDefinition custom HandledProps includes 'categorySelector', and 'displayStyle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"categorySelector\", source: \"Class\" },\r\n { propertyName: \"displayStyle\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ViewDefinition deserializes 'categorySelector', and 'displayStyle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ViewDefinitionProps {\r\n const elProps = super.deserialize(props) as ViewDefinitionProps;\r\n const instance = props.row;\r\n if (instance.isPrivate !== undefined)\r\n elProps.isPrivate = instance.isPrivate;\r\n elProps.categorySelectorId = instance.categorySelector.id;\r\n elProps.displayStyleId = instance.displayStyle.id;\r\n return elProps;\r\n }\r\n\r\n /**\r\n * ViewDefinition serializes 'categorySelector', and 'displayStyle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: ViewDefinitionProps, _iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, _iModel);\r\n inst.categorySelector.id = props.categorySelectorId;\r\n inst.displayStyle.id = props.displayStyleId;\r\n return inst;\r\n }\r\n\r\n public override toJSON(): ViewDefinitionProps {\r\n const json = super.toJSON() as ViewDefinitionProps;\r\n json.categorySelectorId = this.categorySelectorId;\r\n json.displayStyleId = this.displayStyleId;\r\n return json;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.categorySelectorId);\r\n referenceIds.addElement(this.displayStyleId);\r\n const acsId: Id64String = this.getAuxiliaryCoordinateSystemId();\r\n if (Id64.isValidId64(acsId)) {\r\n referenceIds.addElement(acsId);\r\n }\r\n }\r\n\r\n /** @beta */\r\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"categorySelectorId\", \"displayStyleId\"];\r\n /** @alpha */\r\n public static override readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes> = {\r\n ...super.requiredReferenceKeyTypeMap,\r\n categorySelectorId: ConcreteEntityTypes.Element,\r\n displayStyleId: ConcreteEntityTypes.Element,\r\n };\r\n\r\n /** @beta */\r\n protected static override async onCloned(context: IModelElementCloneContext, sourceElementProps: ViewDefinitionProps, targetElementProps: ViewDefinitionProps): Promise<void> {\r\n await super.onCloned(context, sourceElementProps, targetElementProps);\r\n if (context.isBetweenIModels && targetElementProps.jsonProperties && targetElementProps.jsonProperties.viewDetails) {\r\n const acsId: Id64String = Id64.fromJSON(targetElementProps.jsonProperties.viewDetails.acs);\r\n if (Id64.isValidId64(acsId)) {\r\n targetElementProps.jsonProperties.viewDetails.acs = context.findTargetElementId(acsId);\r\n }\r\n }\r\n }\r\n\r\n /** Type guard for `instanceof ViewDefinition3d` */\r\n public isView3d(): this is ViewDefinition3d { return this instanceof ViewDefinition3d; }\r\n /** Type guard for 'instanceof ViewDefinition2d` */\r\n public isView2d(): this is ViewDefinition2d { return this instanceof ViewDefinition2d; }\r\n /** Type guard for `instanceof SpatialViewDefinition` */\r\n public isSpatialView(): this is SpatialViewDefinition { return this instanceof SpatialViewDefinition; }\r\n /** Type guard for 'instanceof DrawingViewDefinition' */\r\n public isDrawingView(): this is DrawingViewDefinition { return this instanceof DrawingViewDefinition; }\r\n\r\n /** Load this view's DisplayStyle from the IModelDb. */\r\n public loadDisplayStyle(): DisplayStyle { return this.iModel.elements.getElement<DisplayStyle>(this.displayStyleId); }\r\n\r\n /** Load this view's CategorySelector from the IModelDb. */\r\n public loadCategorySelector(): CategorySelector { return this.iModel.elements.getElement<CategorySelector>(this.categorySelectorId); }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public abstract get details(): ViewDetails;\r\n\r\n /** The Id of the AuxiliaryCoordinateSystem for this ViewDefinition, or an invalid Id if no ACS is defined. */\r\n public getAuxiliaryCoordinateSystemId(): Id64String {\r\n return this.details.auxiliaryCoordinateSystemId;\r\n }\r\n\r\n /** Set or clear the AuxiliaryCoordinateSystem for this ViewDefinition.\r\n * @param acsId The Id of the new AuxiliaryCoordinateSystem. If `Id64.invalid` is passed, then no AuxiliaryCoordinateSystem will be used.\r\n */\r\n public setAuxiliaryCoordinateSystemId(acsId: Id64String) {\r\n this.details.auxiliaryCoordinateSystemId = acsId;\r\n }\r\n\r\n /** Create a Code for a ViewDefinition given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel to contain the ViewDefinition and provides the scope for its name.\r\n * @param codeValue The ViewDefinition name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.viewDefinition);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Defines a view of one or more 3d models.\r\n * @public @preview\r\n */\r\nexport abstract class ViewDefinition3d extends ViewDefinition {\r\n private readonly _details: ViewDetails3d;\r\n public static override get className(): string { return \"ViewDefinition3d\"; }\r\n /** If true, camera is used. Otherwise, use an orthographic projection. */\r\n public cameraOn: boolean;\r\n /** The lower left back corner of the view frustum. */\r\n public origin: Point3d;\r\n /** The extent (size) of the view frustum, in meters, along its x,y,z axes. */\r\n public extents: Vector3d;\r\n /** Rotation from world coordinates to view coordinates. */\r\n public angles: YawPitchRollAngles;\r\n /** The camera used for this view, if `cameraOn` is true. */\r\n public camera: Camera;\r\n\r\n protected constructor(props: ViewDefinition3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.cameraOn = JsonUtils.asBool(props.cameraOn);\r\n this.origin = Point3d.fromJSON(props.origin);\r\n this.extents = Vector3d.fromJSON(props.extents);\r\n this.angles = YawPitchRollAngles.fromJSON(props.angles);\r\n this.camera = new Camera(props.camera);\r\n this._details = new ViewDetails3d(this.jsonProperties);\r\n }\r\n\r\n /**\r\n * ViewDefinition3d custom HandledProps includes 'eyePoint', 'focusDistance', 'lensAngle', 'yaw', 'pitch', 'roll',\r\n * 'origin', 'extents', and 'isCameraOn'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"eyePoint\", source: \"Class\" },\r\n { propertyName: \"focusDistance\", source: \"Class\" },\r\n { propertyName: \"lensAngle\", source: \"Class\" },\r\n { propertyName: \"yaw\", source: \"Class\" },\r\n { propertyName: \"roll\", source: \"Class\" },\r\n { propertyName: \"pitch\", source: \"Class\" },\r\n { propertyName: \"origin\", source: \"Class\" },\r\n { propertyName: \"extents\", source: \"Class\" },\r\n { propertyName: \"isCameraOn\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ViewDefinition3d deserializes 'eyePoint', 'focusDistance', 'lensAngle', 'yaw', 'pitch', 'roll',\r\n * 'origin', 'extents', and 'isCameraOn'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ViewDefinition3dProps {\r\n const instance = props.row;\r\n const elProps = super.deserialize(props) as ViewDefinition3dProps;\r\n // ViewDefinition3dProps\r\n elProps.cameraOn = instance.isCameraOn as boolean;\r\n elProps.origin = [ instance.origin.x, instance.origin.y, instance.origin.z ];\r\n elProps.extents = [ instance.extents.x, instance.extents.y, instance.extents.z ];\r\n elProps.camera = { eye: [instance.eyePoint.x, instance.eyePoint.y, instance.eyePoint.z], focusDist: instance.focusDistance, lens: Angle.createRadians(instance.lensAngle).toJSON() };\r\n elProps.angles = YawPitchRollAngles.createDegrees(instance.yaw ?? 0, instance.pitch ?? 0, instance.roll ?? 0).toJSON();\r\n return elProps;\r\n }\r\n\r\n /**\r\n * ViewDefinition3d serializes 'eyePoint', 'focusDistance', 'lensAngle', 'yaw', 'pitch', 'roll',\r\n * 'origin', 'extents', and 'isCameraOn'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: ViewDefinition3dProps, _iModel: IModelDb): ECSqlRow {\r\n const row = super.serialize(props, _iModel);\r\n row.isCameraOn = props.cameraOn;\r\n row.eyePoint = props.camera.eye;\r\n row.focusDistance = props.camera.focusDist;\r\n row.lensAngle = props.camera.lens;\r\n if (props.angles) {\r\n row.yaw = props.angles.yaw;\r\n row.roll = props.angles.roll;\r\n row.pitch = props.angles.pitch;\r\n }\r\n return row;\r\n }\r\n\r\n public override toJSON(): ViewDefinition3dProps {\r\n const val = super.toJSON() as ViewDefinition3dProps;\r\n val.cameraOn = this.cameraOn;\r\n val.origin = this.origin;\r\n val.extents = this.extents;\r\n val.angles = this.angles;\r\n val.camera = this.camera;\r\n return val;\r\n }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public get details(): ViewDetails3d { return this._details; }\r\n\r\n /** Load this view's DisplayStyle3d from the IModelDb. */\r\n public loadDisplayStyle3d(): DisplayStyle3d { return this.iModel.elements.getElement<DisplayStyle3d>(this.displayStyleId); }\r\n}\r\n\r\n/** Defines a view of one or more SpatialModels.\r\n * The list of viewed models is stored by the ModelSelector.\r\n *\r\n * This is how a SpatialViewDefinition selects the elements to display:\r\n *\r\n * SpatialViewDefinition\r\n * * ModelSelector\r\n * * ModelIds -------> SpatialModels <----------GeometricElement3d.Model\r\n * * CategorySelector\r\n * * CategoryIds -----> SpatialCategories <----------GeometricElement3d.Category\r\n * @public @preview\r\n */\r\nexport class SpatialViewDefinition extends ViewDefinition3d {\r\n public static override get className(): string { return \"SpatialViewDefinition\"; }\r\n /** The Id of the [[ModelSelector]] for this SpatialViewDefinition. */\r\n public modelSelectorId: Id64String;\r\n\r\n protected constructor(props: SpatialViewDefinitionProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.modelSelectorId = Id64.fromJSON(props.modelSelectorId);\r\n if (!Id64.isValid(this.modelSelectorId))\r\n throw new IModelError(IModelStatus.BadArg, `modelSelectorId is invalid`);\r\n }\r\n\r\n /** Construct a SpatialViewDefinition from its JSON representation. */\r\n public static fromJSON(props: Omit<SpatialViewDefinitionProps, \"classFullName\">, iModel: IModelDb) {\r\n return new SpatialViewDefinition({ ...props, classFullName: this.classFullName }, iModel);\r\n }\r\n\r\n public override toJSON(): SpatialViewDefinitionProps {\r\n const json = super.toJSON() as SpatialViewDefinitionProps;\r\n json.modelSelectorId = this.modelSelectorId;\r\n return json;\r\n }\r\n\r\n /**\r\n * SpatialViewDefinition custom HandledProps includes 'modelSelector'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"modelSelector\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * SpatialViewDefinition deserializes 'modelSelector'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): SpatialViewDefinitionProps {\r\n const elProps = super.deserialize(props) as SpatialViewDefinitionProps;\r\n const instance = props.row;\r\n elProps.modelSelectorId = instance.modelSelector.id;\r\n return elProps;\r\n }\r\n\r\n /**\r\n * SpatialViewDefinition serializes 'modelSelector'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: SpatialViewDefinitionProps, _iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, _iModel);\r\n inst.modelSelector.id = props.modelSelectorId;\r\n return inst;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.modelSelectorId);\r\n }\r\n\r\n /** @beta */\r\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"modelSelectorId\"];\r\n\r\n /** @alpha */\r\n public static override readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes> = {\r\n ...super.requiredReferenceKeyTypeMap,\r\n modelSelectorId: ConcreteEntityTypes.Element,\r\n };\r\n\r\n /** Load this view's ModelSelector from the IModelDb. */\r\n public loadModelSelector(): ModelSelector { return this.iModel.elements.getElement<ModelSelector>(this.modelSelectorId); }\r\n /**\r\n * Create a SpatialViewDefinition with the camera turned on.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @param cameraAngle Camera angle in radians.\r\n * @returns The newly constructed SpatialViewDefinition element\r\n * @throws [[IModelError]] if there is a problem creating the view\r\n */\r\n public static createWithCamera(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso, cameraAngle = Angle.piOver2Radians): SpatialViewDefinition {\r\n const rotation = Matrix3d.createStandardWorldToView(standardView);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n const cameraDistance = 2 * (rotatedRange.diagonal().magnitudeXY() / 2.0) / Math.tan(cameraAngle / 2.0);\r\n const cameraLocation = rotatedRange.diagonalFractionToPoint(.5); // Start at center.\r\n cameraLocation.z += cameraDistance; // Back up by camera distance.\r\n rotation.multiplyTransposeVectorInPlace(cameraLocation);\r\n\r\n const viewDefinitionProps: SpatialViewDefinitionProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n modelSelectorId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\r\n extents: rotatedRange.diagonal(),\r\n angles,\r\n cameraOn: true,\r\n camera: { lens: { radians: cameraAngle }, focusDist: cameraDistance, eye: cameraLocation },\r\n };\r\n\r\n return new SpatialViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n /**\r\n * Insert an SpatialViewDefinition with the camera turned on.\r\n * @see [[createWithCamera]] for details.\r\n * @returns The Id of the newly inserted SpatialViewDefinition element\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insertWithCamera(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso, cameraAngle = Angle.piOver2Radians): Id64String {\r\n const viewDefinition = this.createWithCamera(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView, cameraAngle);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n}\r\n\r\n/** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.\r\n * See [how to create a OrthographicViewDefinition]($docs/learning/backend/CreateElements.md#OrthographicViewDefinition).\r\n * @public @preview\r\n */\r\nexport class OrthographicViewDefinition extends SpatialViewDefinition {\r\n public static override get className(): string { return \"OrthographicViewDefinition\"; }\r\n\r\n constructor(props: SpatialViewDefinitionProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /**\r\n * Create an OrthographicViewDefinition\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @returns The newly constructed OrthographicViewDefinition element\r\n * @throws [[IModelError]] if there is a problem creating the view\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): OrthographicViewDefinition {\r\n const rotation = Matrix3d.createStandardWorldToView(standardView);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n const viewDefinitionProps: SpatialViewDefinitionProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n modelSelectorId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\r\n extents: rotatedRange.diagonal(),\r\n angles,\r\n cameraOn: false,\r\n camera: new Camera(), // not used when cameraOn === false\r\n };\r\n return new OrthographicViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert an OrthographicViewDefinition\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new OrthographicViewDefinition into this DefinitionModel\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @returns The Id of the newly inserted OrthographicViewDefinition element\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): Id64String {\r\n const viewDefinition = this.create(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n\r\n /** Set a new viewed range without changing the rotation or any other properties. */\r\n public setRange(range: Range3d): void {\r\n const rotation = this.angles.toMatrix3d();\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n this.origin = Point3d.createFrom(rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z));\r\n this.extents = rotatedRange.diagonal();\r\n }\r\n}\r\n\r\n/** Defines a view of a single 2d model. Each 2d model has its own coordinate system, so only one may appear per view.\r\n * @public @preview\r\n */\r\nexport class ViewDefinition2d extends ViewDefinition {\r\n private readonly _details: ViewDetails;\r\n\r\n public static override get className(): string { return \"ViewDefinition2d\"; }\r\n /** The Id of the Model displayed by this view. */\r\n public baseModelId: Id64String;\r\n /** The lower-left corner of this view in Model coordinates. */\r\n public origin: Point2d;\r\n /** The delta (size) of this view, in meters, aligned with view x,y. */\r\n public delta: Point2d;\r\n /** The rotation of this view. */\r\n public angle: Angle;\r\n\r\n protected constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.baseModelId = Id64.fromJSON(props.baseModelId);\r\n if (!Id64.isValid(this.baseModelId))\r\n throw new IModelError(IModelStatus.BadArg, `baseModelId is invalid`);\r\n this.origin = Point2d.fromJSON(props.origin);\r\n this.delta = Point2d.fromJSON(props.delta);\r\n this.angle = Angle.fromJSON(props.angle);\r\n this._details = new ViewDetails(this.jsonProperties);\r\n }\r\n\r\n public override toJSON(): ViewDefinition2dProps {\r\n const val = super.toJSON() as ViewDefinition2dProps;\r\n val.baseModelId = this.baseModelId;\r\n val.origin = this.origin;\r\n val.delta = this.delta;\r\n val.angle = this.angle;\r\n return val;\r\n }\r\n\r\n /**\r\n * ViewDefinition2d custom HandledProps includes 'baseModel', 'origin', 'extents', and 'rotationAngle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"baseModel\", source: \"Class\" },\r\n { propertyName: \"origin\", source: \"Class\" },\r\n { propertyName: \"extents\", source: \"Class\" },\r\n { propertyName: \"rotationAngle\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ViewDefinition2d deserializes 'baseModel', 'origin', 'extents', and 'rotationAngle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ViewDefinition2dProps {\r\n const elProps = super.deserialize(props) as ViewDefinition2dProps;\r\n const instance = props.row;\r\n elProps.baseModelId = instance.baseModel.id;\r\n elProps.origin = [ instance.origin.x, instance.origin.y ];\r\n elProps.delta = [ instance.extents.x, instance.extents.y ];\r\n elProps.angle = instance.rotationAngle;\r\n return elProps;\r\n }\r\n\r\n /**\r\n * ViewDefinition2d serializes 'baseModel', 'origin', 'extents', and 'rotationAngle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: ViewDefinition2dProps, _iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, _iModel);\r\n inst.baseModel.id = props.baseModelId;\r\n inst.origin = props.origin;\r\n inst.extents = props.delta;\r\n inst.rotationAngle = props.angle;\r\n return inst;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.baseModelId);\r\n }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public get details(): ViewDetails { return this._details; }\r\n\r\n /** Load this view's DisplayStyle2d from the IModelDb. */\r\n public loadDisplayStyle2d(): DisplayStyle2d { return this.iModel.elements.getElement<DisplayStyle2d>(this.displayStyleId); }\r\n}\r\n\r\n/** Defines a view of a [[DrawingModel]].\r\n * @public @preview\r\n */\r\nexport class DrawingViewDefinition extends ViewDefinition2d {\r\n public static override get className(): string { return \"DrawingViewDefinition\"; }\r\n\r\n protected constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n\r\n /** Create a DrawingViewDefinition\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param baseModelId The base [[DrawingModel]]\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle2d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @throws [[IModelError]] if there is a problem creating the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, baseModelId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range2d): DrawingViewDefinition {\r\n const viewDefinitionProps: ViewDefinition2dProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n baseModelId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: { x: range.low.x, y: range.low.y },\r\n delta: range.diagonal(),\r\n angle: 0,\r\n };\r\n return new DrawingViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n\r\n /** Construct a DrawingViewDefinition from its JSON representation. */\r\n public static fromJSON(props: Omit<ViewDefinition2dProps, \"classFullName\">, iModel: IModelDb) {\r\n return new DrawingViewDefinition({ ...props, classFullName: this.classFullName }, iModel);\r\n }\r\n\r\n /** Insert a DrawingViewDefinition\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new DrawingViewDefinition into this [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param baseModelId The base [[DrawingModel]]\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle2d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, baseModelId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range2d): Id64String {\r\n const viewDefinition = this.create(iModelDb, definitionModelId, name, baseModelId, categorySelectorId, displayStyleId, range);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n}\r\n\r\n/** Arguments to be passed in to [[SheetViewDefinition.create]]\r\n * @public\r\n*/\r\nexport interface CreateSheetViewDefinitionArgs {\r\n /** The iModel in which the sheet view will be created. */\r\n iModel: IModelDb;\r\n /** The Id of the [[DefinitionModel]] into which the sheet view will be inserted. */\r\n definitionModelId: Id64String;\r\n /** The name to use as the view's Code value. */\r\n name: string;\r\n /** The Id of the sheet model whose contents will be displayed by this view. */\r\n baseModelId: Id64String;\r\n /** The [[CategorySelector]] that this view should use. */\r\n categorySelectorId: Id64String;\r\n /** The [[DisplayStyle2d]] that this view should use. */\r\n displayStyleId: Id64String;\r\n /** Defines the view origin and extents. */\r\n range: Range2d;\r\n}\r\n\r\n/** Defines a view of a [[SheetModel]].\r\n * @public @preview\r\n */\r\nexport class SheetViewDefinition extends ViewDefinition2d {\r\n public static override get className(): string { return \"SheetViewDefinition\"; }\r\n\r\n protected constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n\r\n /** Create a SheetViewDefinition */\r\n public static create(args: CreateSheetViewDefinitionArgs): SheetViewDefinition {\r\n const { baseModelId, categorySelectorId, displayStyleId, range } = args;\r\n const props: ViewDefinition2dProps = {\r\n classFullName: this.classFullName,\r\n model: args.definitionModelId,\r\n code: this.createCode(args.iModel, args.definitionModelId, args.name),\r\n baseModelId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: { x: range.low.x, y: range.low.y },\r\n delta: range.diagonal(),\r\n angle: 0,\r\n };\r\n\r\n return new SheetViewDefinition(props, args.iModel);\r\n }\r\n\r\n /** Insert a SheetViewDefinition into an IModelDb */\r\n public static insert(args: CreateSheetViewDefinitionArgs): Id64String {\r\n const view = this.create(args);\r\n return args.iModel.elements.insertElement(view.toJSON());\r\n }\r\n\r\n /** Create a SheetViewDefinition from JSON props */\r\n public static fromJSON(props: Omit<ViewDefinition2dProps, \"classFullName\">, iModel: IModelDb): SheetViewDefinition {\r\n return new SheetViewDefinition({ ...props, classFullName: this.classFullName }, iModel);\r\n }\r\n}\r\n\r\n/** A ViewDefinition used to display a 2d template model.\r\n * @internal\r\n */\r\nexport class TemplateViewDefinition2d extends ViewDefinition2d {\r\n public static override get className(): string { return \"TemplateViewDefinition2d\"; }\r\n}\r\n\r\n/** A ViewDefinition used to display a 3d template model.\r\n * @internal\r\n */\r\nexport class TemplateViewDefinition3d extends ViewDefinition3d {\r\n public static override get className(): string { return \"TemplateViewDefinition3d\"; }\r\n}\r\n\r\n/** An auxiliary coordinate system element. Auxiliary coordinate systems can be used by views to show\r\n * coordinate information in different units and/or orientations.\r\n * @public @preview\r\n */\r\nexport abstract class AuxCoordSystem extends DefinitionElement {\r\n public static override get className(): string { return \"AuxCoordSystem\"; }\r\n public type?: number;\r\n public description?: string;\r\n public constructor(props: AuxCoordSystemProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.type = props.type;\r\n this.description = props.description;\r\n }\r\n}\r\n\r\n/** A 2d auxiliary coordinate system.\r\n * @public @preview\r\n */\r\nexport class AuxCoordSystem2d extends AuxCoordSystem {\r\n public static override get className(): string { return \"AuxCoordSystem2d\"; }\r\n public origin?: Point2d;\r\n public angle?: number;\r\n public constructor(props: AuxCoordSystem2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.origin = props.origin ? Point2d.fromJSON(props.origin) : undefined;\r\n this.angle = props.angle ? Angle.fromJSON(props.angle).degrees : undefined;\r\n }\r\n\r\n /** Create a Code for a AuxCoordSystem2d element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem2d element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystem2d name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystem2d);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A 3d auxiliary coordinate system.\r\n * @public @preview\r\n */\r\nexport class AuxCoordSystem3d extends AuxCoordSystem {\r\n public static override get className(): string { return \"AuxCoordSystem3d\"; }\r\n public origin?: Point3d;\r\n public yaw?: number;\r\n public pitch?: number;\r\n public roll?: number;\r\n public constructor(props: AuxCoordSystem3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.origin = props.origin ? Point3d.fromJSON(props.origin) : undefined;\r\n this.yaw = props.yaw ? Angle.fromJSON(props.yaw).degrees : undefined;\r\n this.pitch = props.pitch ? Angle.fromJSON(props.pitch).degrees : undefined;\r\n this.roll = props.roll ? Angle.fromJSON(props.roll).degrees : undefined;\r\n }\r\n\r\n /** Create a Code for a AuxCoordSystem3d element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem3d element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystem3d name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystem3d);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A spatial auxiliary coordinate system.\r\n * @public @preview\r\n */\r\nexport class AuxCoordSystemSpatial extends AuxCoordSystem3d {\r\n public static override get className(): string { return \"AuxCoordSystemSpatial\"; }\r\n /** Create a Code for a AuxCoordSystemSpatial element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystemSpatial element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystemSpatial name\r\n */\r\n public static override createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystemSpatial);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Represents an *attachment* of a [[ViewDefinition]] to a [[Sheet]].\r\n * @public @preview\r\n */\r\nexport class ViewAttachment extends GraphicalElement2d {\r\n public static override get className(): string { return \"ViewAttachment\"; }\r\n public view: RelatedElement;\r\n public constructor(props: ViewAttachmentProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.view = new RelatedElement(props.view);\r\n // ###NOTE: scale, displayPriority, and clipping vectors are stored in ViewAttachmentProps.jsonProperties.\r\n }\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.view.id);\r\n }\r\n}\r\n\r\n/** The position in space of a Light.\r\n * @internal\r\n */\r\nexport class LightLocation extends SpatialLocationElement {\r\n public static override get className(): string { return \"LightLocation\"; }\r\n /** Whether this light is currently turned on. */\r\n public enabled?: boolean;\r\n\r\n protected constructor(props: LightLocationProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.enabled = props.enabled;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewDefinition.d.ts","sourceRoot":"","sources":["../../src/ViewDefinition.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAkB,SAAS,EAAE,UAAU,EAA2B,MAAM,qBAAqB,CAAC;AACrG,OAAO,EACL,KAAK,EAAY,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,i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Q;IAQjE;;;;OAIG;WACW,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;CAIlG;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,gBAAgB;IACzD,WAA2B,SAAS,IAAI,MAAM,CAAoC;IAClF;;;;OAIG;WACoB,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;CAI3G;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;IACpD,WAA2B,SAAS,IAAI,MAAM,CAA6B;IACpE,IAAI,EAAE,cAAc,CAAC;gBACT,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ;cAK5C,mBAAmB,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;CAI/E;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,sBAAsB;IACvD,WAA2B,SAAS,IAAI,MAAM,CAA4B;IAC1E,iDAAiD;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAEzB,SAAS,aAAa,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,QAAQ;CAIlE"}
|
|
@@ -608,6 +608,8 @@ export class ViewDefinition2d extends ViewDefinition {
|
|
|
608
608
|
constructor(props, iModel) {
|
|
609
609
|
super(props, iModel);
|
|
610
610
|
this.baseModelId = Id64.fromJSON(props.baseModelId);
|
|
611
|
+
if (!Id64.isValid(this.baseModelId))
|
|
612
|
+
throw new IModelError(IModelStatus.BadArg, `baseModelId is invalid`);
|
|
611
613
|
this.origin = Point2d.fromJSON(props.origin);
|
|
612
614
|
this.delta = Point2d.fromJSON(props.delta);
|
|
613
615
|
this.angle = Angle.fromJSON(props.angle);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewDefinition.js","sourceRoot":"","sources":["../../src/ViewDefinition.ts"],"names":[],"mappings":"AAAA;;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,qBAAqB,CAAC,CAAC;QACzF,OAAO,IAAI,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAChF,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,kBAAkB;IAC7C,MAAM,KAAc,SAAS,KAAa,OAAO,gBAAgB,CAAC,CAAC,CAAC;IACpE,IAAI,CAAiB;IAC5B,YAAmB,KAA0B,EAAE,MAAgB;QAC7D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3C,0GAA0G;IAC5G,CAAC;IACkB,mBAAmB,CAAC,YAAgC;QACrE,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACxC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,sBAAsB;IAChD,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IAC1E,iDAAiD;IAC1C,OAAO,CAAW;IAEzB,YAAsB,KAAyB,EAAE,MAAgB;QAC/D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ViewDefinitions\r\n */\r\n\r\nimport { DbResult, Id64, Id64Array, Id64String, IModelStatus, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, Matrix3d, Point2d, Point3d, Range2d, Range3d, StandardViewIndex, Transform, Vector3d, YawPitchRollAngles,\r\n} from \"@itwin/core-geometry\";\r\nimport {\r\n AuxCoordSystem2dProps, AuxCoordSystem3dProps, AuxCoordSystemProps, BisCodeSpec, Camera, CategorySelectorProps, Code, CodeScopeProps,\r\n CodeSpec, ConcreteEntityTypes, EntityReferenceSet, IModelError, LightLocationProps, ModelSelectorProps, RelatedElement,\r\n SpatialViewDefinitionProps, ViewAttachmentProps, ViewDefinition2dProps, ViewDefinition3dProps, ViewDefinitionProps, ViewDetails,\r\n ViewDetails3d,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionElement, GraphicalElement2d, SpatialLocationElement } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { DisplayStyle, DisplayStyle2d, DisplayStyle3d } from \"./DisplayStyle\";\r\nimport { IModelElementCloneContext } from \"./IModelElementCloneContext\";\r\nimport { CustomHandledProperty, DeserializeEntityArgs, ECSqlRow } from \"./Entity\";\r\n\r\n/** Holds the list of Ids of GeometricModels displayed by a [[SpatialViewDefinition]]. Multiple SpatialViewDefinitions may point to the same ModelSelector.\r\n * @see [ModelSelectorState]($frontend)\r\n * @public @preview\r\n */\r\nexport class ModelSelector extends DefinitionElement {\r\n public static override get className(): string { return \"ModelSelector\"; }\r\n\r\n /** The array of modelIds of the GeometricModels displayed by this ModelSelector */\r\n public models: Id64String[];\r\n\r\n protected constructor(props: ModelSelectorProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.models = props.models;\r\n }\r\n\r\n public override toJSON(): ModelSelectorProps {\r\n const val = super.toJSON() as ModelSelectorProps;\r\n val.models = this.models;\r\n return val;\r\n }\r\n\r\n /**\r\n * ModelSelector custom HandledProps includes 'models'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"models\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ModelSelector deserializes 'models'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ModelSelectorProps {\r\n const elProps = super.deserialize(props) as ModelSelectorProps;\r\n const instance = props.row;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n elProps.models = props.iModel.withPreparedStatement(\"SELECT TargetECInstanceId FROM Bis.ModelSelectorRefersToModels WHERE SourceECInstanceId=?\", (statement) => {\r\n statement.bindId(1, instance.id);\r\n const ids: Id64Array = [];\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n ids.push(statement.getValue(0).getId());\r\n }\r\n return ids;\r\n });\r\n return elProps;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n this.models.forEach((modelId: Id64String) => referenceIds.addModel(modelId));\r\n }\r\n\r\n /** Create a Code for a ModelSelector given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the ModelSelector and provides the scope for its name.\r\n * @param codeValue The ModelSelector name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.modelSelector);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /**\r\n * Create a ModelSelector to select which Models are displayed by a ViewDefinition.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the ModelSelector\r\n * @param models Array of models to select for display\r\n * @returns The newly constructed ModelSelector element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, models: Id64Array): ModelSelector {\r\n const modelSelectorProps: ModelSelectorProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n model: definitionModelId,\r\n models,\r\n isPrivate: false,\r\n };\r\n return new ModelSelector(modelSelectorProps, iModelDb);\r\n }\r\n /**\r\n * Insert a ModelSelector to select which Models are displayed by a ViewDefinition.\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new ModelSelector into this DefinitionModel\r\n * @param name The name/CodeValue of the ModelSelector\r\n * @param models Array of models to select for display\r\n * @returns The Id of the newly inserted ModelSelector element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, models: Id64Array): Id64String {\r\n const modelSelector = this.create(iModelDb, definitionModelId, name, models);\r\n return iModelDb.elements.insertElement(modelSelector.toJSON());\r\n }\r\n}\r\n\r\n/** Holds a list of Ids of Categories to be displayed in a view.\r\n * @see [CategorySelectorState]($frontend)\r\n * See [how to create a CategorySelector]($docs/learning/backend/CreateElements.md#CategorySelector).\r\n * @public @preview\r\n */\r\nexport class CategorySelector extends DefinitionElement {\r\n public static override get className(): string { return \"CategorySelector\"; }\r\n /** The array of element Ids of the Categories selected by this CategorySelector */\r\n public categories: Id64String[];\r\n\r\n protected constructor(props: CategorySelectorProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.categories = props.categories;\r\n }\r\n\r\n public override toJSON(): CategorySelectorProps {\r\n const val = super.toJSON() as CategorySelectorProps;\r\n val.categories = this.categories;\r\n return val;\r\n }\r\n\r\n /**\r\n * CategorySelector custom HandledProps includes 'categories'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"categories\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * CategorySelector deserializes 'categories'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): CategorySelectorProps {\r\n const elProps = super.deserialize(props) as CategorySelectorProps;\r\n const instance = props.row;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n elProps.categories = props.iModel.withPreparedStatement(\"SELECT TargetECInstanceId FROM Bis.CategorySelectorRefersToCategories WHERE SourceECInstanceId=?\", (statement) => {\r\n statement.bindId(1, instance.id);\r\n const ids: Id64Array = [];\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n ids.push(statement.getValue(0).getId());\r\n }\r\n return ids;\r\n });\r\n return elProps;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n this.categories.forEach((categoryId: Id64String) => referenceIds.addElement(categoryId));\r\n }\r\n\r\n /** Create a Code for a CategorySelector given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the CategorySelector and provides the scope for its name.\r\n * @param codeValue The CategorySelector name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.categorySelector);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /**\r\n * Create a CategorySelector to select which categories are displayed by a ViewDefinition.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name of the CategorySelector\r\n * @param categories Array of categories to select for display\r\n * @returns The newly constructed CategorySelector element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, categories: Id64Array): CategorySelector {\r\n const categorySelectorProps: CategorySelectorProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n model: definitionModelId,\r\n categories,\r\n isPrivate: false,\r\n };\r\n return new CategorySelector(categorySelectorProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a CategorySelector to select which categories are displayed by a ViewDefinition.\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new CategorySelector into this DefinitionModel\r\n * @param name The name of the CategorySelector\r\n * @param categories Array of categories to select for display\r\n * @returns The Id of the newly inserted CategorySelector element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, categories: Id64Array): Id64String {\r\n const categorySelector = this.create(iModelDb, definitionModelId, name, categories);\r\n return iModelDb.elements.insertElement(categorySelector.toJSON());\r\n }\r\n}\r\n\r\n/**\r\n * The definition element for a view. ViewDefinitions specify the area/volume that is viewed, the Ids of a DisplayStyle and a CategorySelector,\r\n * plus additional view-specific parameters in their [[Element.jsonProperties]].\r\n * Subclasses of ViewDefinition determine which model(s) are viewed.\r\n * @note ViewDefinition is only available in the backend. See [ViewState]($frontend) for usage in the frontend.\r\n * @public @preview\r\n */\r\nexport abstract class ViewDefinition extends DefinitionElement {\r\n public static override get className(): string { return \"ViewDefinition\"; }\r\n /** The element Id of the [[CategorySelector]] for this ViewDefinition */\r\n public categorySelectorId: Id64String;\r\n /** The element Id of the [[DisplayStyle]] for this ViewDefinition */\r\n public displayStyleId: Id64String;\r\n\r\n protected constructor(props: ViewDefinitionProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n\r\n this.categorySelectorId = Id64.fromJSON(props.categorySelectorId);\r\n if (!Id64.isValid(this.categorySelectorId))\r\n throw new IModelError(IModelStatus.BadArg, `categorySelectorId is invalid`);\r\n\r\n this.displayStyleId = Id64.fromJSON(props.displayStyleId);\r\n if (!Id64.isValid(this.displayStyleId))\r\n throw new IModelError(IModelStatus.BadArg, `displayStyleId is invalid`);\r\n }\r\n\r\n /**\r\n * ViewDefinition custom HandledProps includes 'categorySelector', and 'displayStyle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"categorySelector\", source: \"Class\" },\r\n { propertyName: \"displayStyle\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ViewDefinition deserializes 'categorySelector', and 'displayStyle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ViewDefinitionProps {\r\n const elProps = super.deserialize(props) as ViewDefinitionProps;\r\n const instance = props.row;\r\n if (instance.isPrivate !== undefined)\r\n elProps.isPrivate = instance.isPrivate;\r\n elProps.categorySelectorId = instance.categorySelector.id;\r\n elProps.displayStyleId = instance.displayStyle.id;\r\n return elProps;\r\n }\r\n\r\n /**\r\n * ViewDefinition serializes 'categorySelector', and 'displayStyle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: ViewDefinitionProps, _iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, _iModel);\r\n inst.categorySelector.id = props.categorySelectorId;\r\n inst.displayStyle.id = props.displayStyleId;\r\n return inst;\r\n }\r\n\r\n public override toJSON(): ViewDefinitionProps {\r\n const json = super.toJSON() as ViewDefinitionProps;\r\n json.categorySelectorId = this.categorySelectorId;\r\n json.displayStyleId = this.displayStyleId;\r\n return json;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.categorySelectorId);\r\n referenceIds.addElement(this.displayStyleId);\r\n const acsId: Id64String = this.getAuxiliaryCoordinateSystemId();\r\n if (Id64.isValidId64(acsId)) {\r\n referenceIds.addElement(acsId);\r\n }\r\n }\r\n\r\n /** @beta */\r\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"categorySelectorId\", \"displayStyleId\"];\r\n /** @alpha */\r\n public static override readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes> = {\r\n ...super.requiredReferenceKeyTypeMap,\r\n categorySelectorId: ConcreteEntityTypes.Element,\r\n displayStyleId: ConcreteEntityTypes.Element,\r\n };\r\n\r\n /** @beta */\r\n protected static override async onCloned(context: IModelElementCloneContext, sourceElementProps: ViewDefinitionProps, targetElementProps: ViewDefinitionProps): Promise<void> {\r\n await super.onCloned(context, sourceElementProps, targetElementProps);\r\n if (context.isBetweenIModels && targetElementProps.jsonProperties && targetElementProps.jsonProperties.viewDetails) {\r\n const acsId: Id64String = Id64.fromJSON(targetElementProps.jsonProperties.viewDetails.acs);\r\n if (Id64.isValidId64(acsId)) {\r\n targetElementProps.jsonProperties.viewDetails.acs = context.findTargetElementId(acsId);\r\n }\r\n }\r\n }\r\n\r\n /** Type guard for `instanceof ViewDefinition3d` */\r\n public isView3d(): this is ViewDefinition3d { return this instanceof ViewDefinition3d; }\r\n /** Type guard for 'instanceof ViewDefinition2d` */\r\n public isView2d(): this is ViewDefinition2d { return this instanceof ViewDefinition2d; }\r\n /** Type guard for `instanceof SpatialViewDefinition` */\r\n public isSpatialView(): this is SpatialViewDefinition { return this instanceof SpatialViewDefinition; }\r\n /** Type guard for 'instanceof DrawingViewDefinition' */\r\n public isDrawingView(): this is DrawingViewDefinition { return this instanceof DrawingViewDefinition; }\r\n\r\n /** Load this view's DisplayStyle from the IModelDb. */\r\n public loadDisplayStyle(): DisplayStyle { return this.iModel.elements.getElement<DisplayStyle>(this.displayStyleId); }\r\n\r\n /** Load this view's CategorySelector from the IModelDb. */\r\n public loadCategorySelector(): CategorySelector { return this.iModel.elements.getElement<CategorySelector>(this.categorySelectorId); }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public abstract get details(): ViewDetails;\r\n\r\n /** The Id of the AuxiliaryCoordinateSystem for this ViewDefinition, or an invalid Id if no ACS is defined. */\r\n public getAuxiliaryCoordinateSystemId(): Id64String {\r\n return this.details.auxiliaryCoordinateSystemId;\r\n }\r\n\r\n /** Set or clear the AuxiliaryCoordinateSystem for this ViewDefinition.\r\n * @param acsId The Id of the new AuxiliaryCoordinateSystem. If `Id64.invalid` is passed, then no AuxiliaryCoordinateSystem will be used.\r\n */\r\n public setAuxiliaryCoordinateSystemId(acsId: Id64String) {\r\n this.details.auxiliaryCoordinateSystemId = acsId;\r\n }\r\n\r\n /** Create a Code for a ViewDefinition given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel to contain the ViewDefinition and provides the scope for its name.\r\n * @param codeValue The ViewDefinition name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.viewDefinition);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Defines a view of one or more 3d models.\r\n * @public @preview\r\n */\r\nexport abstract class ViewDefinition3d extends ViewDefinition {\r\n private readonly _details: ViewDetails3d;\r\n public static override get className(): string { return \"ViewDefinition3d\"; }\r\n /** If true, camera is used. Otherwise, use an orthographic projection. */\r\n public cameraOn: boolean;\r\n /** The lower left back corner of the view frustum. */\r\n public origin: Point3d;\r\n /** The extent (size) of the view frustum, in meters, along its x,y,z axes. */\r\n public extents: Vector3d;\r\n /** Rotation from world coordinates to view coordinates. */\r\n public angles: YawPitchRollAngles;\r\n /** The camera used for this view, if `cameraOn` is true. */\r\n public camera: Camera;\r\n\r\n protected constructor(props: ViewDefinition3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.cameraOn = JsonUtils.asBool(props.cameraOn);\r\n this.origin = Point3d.fromJSON(props.origin);\r\n this.extents = Vector3d.fromJSON(props.extents);\r\n this.angles = YawPitchRollAngles.fromJSON(props.angles);\r\n this.camera = new Camera(props.camera);\r\n this._details = new ViewDetails3d(this.jsonProperties);\r\n }\r\n\r\n /**\r\n * ViewDefinition3d custom HandledProps includes 'eyePoint', 'focusDistance', 'lensAngle', 'yaw', 'pitch', 'roll',\r\n * 'origin', 'extents', and 'isCameraOn'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"eyePoint\", source: \"Class\" },\r\n { propertyName: \"focusDistance\", source: \"Class\" },\r\n { propertyName: \"lensAngle\", source: \"Class\" },\r\n { propertyName: \"yaw\", source: \"Class\" },\r\n { propertyName: \"roll\", source: \"Class\" },\r\n { propertyName: \"pitch\", source: \"Class\" },\r\n { propertyName: \"origin\", source: \"Class\" },\r\n { propertyName: \"extents\", source: \"Class\" },\r\n { propertyName: \"isCameraOn\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ViewDefinition3d deserializes 'eyePoint', 'focusDistance', 'lensAngle', 'yaw', 'pitch', 'roll',\r\n * 'origin', 'extents', and 'isCameraOn'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ViewDefinition3dProps {\r\n const instance = props.row;\r\n const elProps = super.deserialize(props) as ViewDefinition3dProps;\r\n // ViewDefinition3dProps\r\n elProps.cameraOn = instance.isCameraOn as boolean;\r\n elProps.origin = [ instance.origin.x, instance.origin.y, instance.origin.z ];\r\n elProps.extents = [ instance.extents.x, instance.extents.y, instance.extents.z ];\r\n elProps.camera = { eye: [instance.eyePoint.x, instance.eyePoint.y, instance.eyePoint.z], focusDist: instance.focusDistance, lens: Angle.createRadians(instance.lensAngle).toJSON() };\r\n elProps.angles = YawPitchRollAngles.createDegrees(instance.yaw ?? 0, instance.pitch ?? 0, instance.roll ?? 0).toJSON();\r\n return elProps;\r\n }\r\n\r\n /**\r\n * ViewDefinition3d serializes 'eyePoint', 'focusDistance', 'lensAngle', 'yaw', 'pitch', 'roll',\r\n * 'origin', 'extents', and 'isCameraOn'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: ViewDefinition3dProps, _iModel: IModelDb): ECSqlRow {\r\n const row = super.serialize(props, _iModel);\r\n row.isCameraOn = props.cameraOn;\r\n row.eyePoint = props.camera.eye;\r\n row.focusDistance = props.camera.focusDist;\r\n row.lensAngle = props.camera.lens;\r\n if (props.angles) {\r\n row.yaw = props.angles.yaw;\r\n row.roll = props.angles.roll;\r\n row.pitch = props.angles.pitch;\r\n }\r\n return row;\r\n }\r\n\r\n public override toJSON(): ViewDefinition3dProps {\r\n const val = super.toJSON() as ViewDefinition3dProps;\r\n val.cameraOn = this.cameraOn;\r\n val.origin = this.origin;\r\n val.extents = this.extents;\r\n val.angles = this.angles;\r\n val.camera = this.camera;\r\n return val;\r\n }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public get details(): ViewDetails3d { return this._details; }\r\n\r\n /** Load this view's DisplayStyle3d from the IModelDb. */\r\n public loadDisplayStyle3d(): DisplayStyle3d { return this.iModel.elements.getElement<DisplayStyle3d>(this.displayStyleId); }\r\n}\r\n\r\n/** Defines a view of one or more SpatialModels.\r\n * The list of viewed models is stored by the ModelSelector.\r\n *\r\n * This is how a SpatialViewDefinition selects the elements to display:\r\n *\r\n * SpatialViewDefinition\r\n * * ModelSelector\r\n * * ModelIds -------> SpatialModels <----------GeometricElement3d.Model\r\n * * CategorySelector\r\n * * CategoryIds -----> SpatialCategories <----------GeometricElement3d.Category\r\n * @public @preview\r\n */\r\nexport class SpatialViewDefinition extends ViewDefinition3d {\r\n public static override get className(): string { return \"SpatialViewDefinition\"; }\r\n /** The Id of the [[ModelSelector]] for this SpatialViewDefinition. */\r\n public modelSelectorId: Id64String;\r\n\r\n protected constructor(props: SpatialViewDefinitionProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.modelSelectorId = Id64.fromJSON(props.modelSelectorId);\r\n if (!Id64.isValid(this.modelSelectorId))\r\n throw new IModelError(IModelStatus.BadArg, `modelSelectorId is invalid`);\r\n }\r\n\r\n /** Construct a SpatialViewDefinition from its JSON representation. */\r\n public static fromJSON(props: Omit<SpatialViewDefinitionProps, \"classFullName\">, iModel: IModelDb) {\r\n return new SpatialViewDefinition({ ...props, classFullName: this.classFullName }, iModel);\r\n }\r\n\r\n public override toJSON(): SpatialViewDefinitionProps {\r\n const json = super.toJSON() as SpatialViewDefinitionProps;\r\n json.modelSelectorId = this.modelSelectorId;\r\n return json;\r\n }\r\n\r\n /**\r\n * SpatialViewDefinition custom HandledProps includes 'modelSelector'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"modelSelector\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * SpatialViewDefinition deserializes 'modelSelector'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): SpatialViewDefinitionProps {\r\n const elProps = super.deserialize(props) as SpatialViewDefinitionProps;\r\n const instance = props.row;\r\n elProps.modelSelectorId = instance.modelSelector.id;\r\n return elProps;\r\n }\r\n\r\n /**\r\n * SpatialViewDefinition serializes 'modelSelector'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: SpatialViewDefinitionProps, _iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, _iModel);\r\n inst.modelSelector.id = props.modelSelectorId;\r\n return inst;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.modelSelectorId);\r\n }\r\n\r\n /** @beta */\r\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"modelSelectorId\"];\r\n\r\n /** @alpha */\r\n public static override readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes> = {\r\n ...super.requiredReferenceKeyTypeMap,\r\n modelSelectorId: ConcreteEntityTypes.Element,\r\n };\r\n\r\n /** Load this view's ModelSelector from the IModelDb. */\r\n public loadModelSelector(): ModelSelector { return this.iModel.elements.getElement<ModelSelector>(this.modelSelectorId); }\r\n /**\r\n * Create a SpatialViewDefinition with the camera turned on.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @param cameraAngle Camera angle in radians.\r\n * @returns The newly constructed SpatialViewDefinition element\r\n * @throws [[IModelError]] if there is a problem creating the view\r\n */\r\n public static createWithCamera(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso, cameraAngle = Angle.piOver2Radians): SpatialViewDefinition {\r\n const rotation = Matrix3d.createStandardWorldToView(standardView);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n const cameraDistance = 2 * (rotatedRange.diagonal().magnitudeXY() / 2.0) / Math.tan(cameraAngle / 2.0);\r\n const cameraLocation = rotatedRange.diagonalFractionToPoint(.5); // Start at center.\r\n cameraLocation.z += cameraDistance; // Back up by camera distance.\r\n rotation.multiplyTransposeVectorInPlace(cameraLocation);\r\n\r\n const viewDefinitionProps: SpatialViewDefinitionProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n modelSelectorId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\r\n extents: rotatedRange.diagonal(),\r\n angles,\r\n cameraOn: true,\r\n camera: { lens: { radians: cameraAngle }, focusDist: cameraDistance, eye: cameraLocation },\r\n };\r\n\r\n return new SpatialViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n /**\r\n * Insert an SpatialViewDefinition with the camera turned on.\r\n * @see [[createWithCamera]] for details.\r\n * @returns The Id of the newly inserted SpatialViewDefinition element\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insertWithCamera(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso, cameraAngle = Angle.piOver2Radians): Id64String {\r\n const viewDefinition = this.createWithCamera(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView, cameraAngle);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n}\r\n\r\n/** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.\r\n * See [how to create a OrthographicViewDefinition]($docs/learning/backend/CreateElements.md#OrthographicViewDefinition).\r\n * @public @preview\r\n */\r\nexport class OrthographicViewDefinition extends SpatialViewDefinition {\r\n public static override get className(): string { return \"OrthographicViewDefinition\"; }\r\n\r\n constructor(props: SpatialViewDefinitionProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /**\r\n * Create an OrthographicViewDefinition\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @returns The newly constructed OrthographicViewDefinition element\r\n * @throws [[IModelError]] if there is a problem creating the view\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): OrthographicViewDefinition {\r\n const rotation = Matrix3d.createStandardWorldToView(standardView);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n const viewDefinitionProps: SpatialViewDefinitionProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n modelSelectorId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\r\n extents: rotatedRange.diagonal(),\r\n angles,\r\n cameraOn: false,\r\n camera: new Camera(), // not used when cameraOn === false\r\n };\r\n return new OrthographicViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert an OrthographicViewDefinition\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new OrthographicViewDefinition into this DefinitionModel\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @returns The Id of the newly inserted OrthographicViewDefinition element\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): Id64String {\r\n const viewDefinition = this.create(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n\r\n /** Set a new viewed range without changing the rotation or any other properties. */\r\n public setRange(range: Range3d): void {\r\n const rotation = this.angles.toMatrix3d();\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n this.origin = Point3d.createFrom(rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z));\r\n this.extents = rotatedRange.diagonal();\r\n }\r\n}\r\n\r\n/** Defines a view of a single 2d model. Each 2d model has its own coordinate system, so only one may appear per view.\r\n * @public @preview\r\n */\r\nexport class ViewDefinition2d extends ViewDefinition {\r\n private readonly _details: ViewDetails;\r\n\r\n public static override get className(): string { return \"ViewDefinition2d\"; }\r\n /** The Id of the Model displayed by this view. */\r\n public baseModelId: Id64String;\r\n /** The lower-left corner of this view in Model coordinates. */\r\n public origin: Point2d;\r\n /** The delta (size) of this view, in meters, aligned with view x,y. */\r\n public delta: Point2d;\r\n /** The rotation of this view. */\r\n public angle: Angle;\r\n\r\n protected constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.baseModelId = Id64.fromJSON(props.baseModelId);\r\n this.origin = Point2d.fromJSON(props.origin);\r\n this.delta = Point2d.fromJSON(props.delta);\r\n this.angle = Angle.fromJSON(props.angle);\r\n this._details = new ViewDetails(this.jsonProperties);\r\n }\r\n\r\n public override toJSON(): ViewDefinition2dProps {\r\n const val = super.toJSON() as ViewDefinition2dProps;\r\n val.baseModelId = this.baseModelId;\r\n val.origin = this.origin;\r\n val.delta = this.delta;\r\n val.angle = this.angle;\r\n return val;\r\n }\r\n\r\n /**\r\n * ViewDefinition2d custom HandledProps includes 'baseModel', 'origin', 'extents', and 'rotationAngle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"baseModel\", source: \"Class\" },\r\n { propertyName: \"origin\", source: \"Class\" },\r\n { propertyName: \"extents\", source: \"Class\" },\r\n { propertyName: \"rotationAngle\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ViewDefinition2d deserializes 'baseModel', 'origin', 'extents', and 'rotationAngle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ViewDefinition2dProps {\r\n const elProps = super.deserialize(props) as ViewDefinition2dProps;\r\n const instance = props.row;\r\n elProps.baseModelId = instance.baseModel.id;\r\n elProps.origin = [ instance.origin.x, instance.origin.y ];\r\n elProps.delta = [ instance.extents.x, instance.extents.y ];\r\n elProps.angle = instance.rotationAngle;\r\n return elProps;\r\n }\r\n\r\n /**\r\n * ViewDefinition2d serializes 'baseModel', 'origin', 'extents', and 'rotationAngle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: ViewDefinition2dProps, _iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, _iModel);\r\n inst.baseModel.id = props.baseModelId;\r\n inst.origin = props.origin;\r\n inst.extents = props.delta;\r\n inst.rotationAngle = props.angle;\r\n return inst;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.baseModelId);\r\n }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public get details(): ViewDetails { return this._details; }\r\n\r\n /** Load this view's DisplayStyle2d from the IModelDb. */\r\n public loadDisplayStyle2d(): DisplayStyle2d { return this.iModel.elements.getElement<DisplayStyle2d>(this.displayStyleId); }\r\n}\r\n\r\n/** Defines a view of a [[DrawingModel]].\r\n * @public @preview\r\n */\r\nexport class DrawingViewDefinition extends ViewDefinition2d {\r\n public static override get className(): string { return \"DrawingViewDefinition\"; }\r\n\r\n protected constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n\r\n /** Create a DrawingViewDefinition\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param baseModelId The base [[DrawingModel]]\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle2d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @throws [[IModelError]] if there is a problem creating the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, baseModelId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range2d): DrawingViewDefinition {\r\n const viewDefinitionProps: ViewDefinition2dProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n baseModelId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: { x: range.low.x, y: range.low.y },\r\n delta: range.diagonal(),\r\n angle: 0,\r\n };\r\n return new DrawingViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n\r\n /** Construct a DrawingViewDefinition from its JSON representation. */\r\n public static fromJSON(props: Omit<ViewDefinition2dProps, \"classFullName\">, iModel: IModelDb) {\r\n return new DrawingViewDefinition({ ...props, classFullName: this.classFullName }, iModel);\r\n }\r\n\r\n /** Insert a DrawingViewDefinition\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new DrawingViewDefinition into this [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param baseModelId The base [[DrawingModel]]\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle2d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, baseModelId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range2d): Id64String {\r\n const viewDefinition = this.create(iModelDb, definitionModelId, name, baseModelId, categorySelectorId, displayStyleId, range);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n}\r\n\r\n/** Arguments to be passed in to [[SheetViewDefinition.create]]\r\n * @public\r\n*/\r\nexport interface CreateSheetViewDefinitionArgs {\r\n /** The iModel in which the sheet view will be created. */\r\n iModel: IModelDb;\r\n /** The Id of the [[DefinitionModel]] into which the sheet view will be inserted. */\r\n definitionModelId: Id64String;\r\n /** The name to use as the view's Code value. */\r\n name: string;\r\n /** The Id of the sheet model whose contents will be displayed by this view. */\r\n baseModelId: Id64String;\r\n /** The [[CategorySelector]] that this view should use. */\r\n categorySelectorId: Id64String;\r\n /** The [[DisplayStyle2d]] that this view should use. */\r\n displayStyleId: Id64String;\r\n /** Defines the view origin and extents. */\r\n range: Range2d;\r\n}\r\n\r\n/** Defines a view of a [[SheetModel]].\r\n * @public @preview\r\n */\r\nexport class SheetViewDefinition extends ViewDefinition2d {\r\n public static override get className(): string { return \"SheetViewDefinition\"; }\r\n\r\n protected constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n\r\n /** Create a SheetViewDefinition */\r\n public static create(args: CreateSheetViewDefinitionArgs): SheetViewDefinition {\r\n const { baseModelId, categorySelectorId, displayStyleId, range } = args;\r\n const props: ViewDefinition2dProps = {\r\n classFullName: this.classFullName,\r\n model: args.definitionModelId,\r\n code: this.createCode(args.iModel, args.definitionModelId, args.name),\r\n baseModelId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: { x: range.low.x, y: range.low.y },\r\n delta: range.diagonal(),\r\n angle: 0,\r\n };\r\n\r\n return new SheetViewDefinition(props, args.iModel);\r\n }\r\n\r\n /** Insert a SheetViewDefinition into an IModelDb */\r\n public static insert(args: CreateSheetViewDefinitionArgs): Id64String {\r\n const view = this.create(args);\r\n return args.iModel.elements.insertElement(view.toJSON());\r\n }\r\n\r\n /** Create a SheetViewDefinition from JSON props */\r\n public static fromJSON(props: Omit<ViewDefinition2dProps, \"classFullName\">, iModel: IModelDb): SheetViewDefinition {\r\n return new SheetViewDefinition({ ...props, classFullName: this.classFullName }, iModel);\r\n }\r\n}\r\n\r\n/** A ViewDefinition used to display a 2d template model.\r\n * @internal\r\n */\r\nexport class TemplateViewDefinition2d extends ViewDefinition2d {\r\n public static override get className(): string { return \"TemplateViewDefinition2d\"; }\r\n}\r\n\r\n/** A ViewDefinition used to display a 3d template model.\r\n * @internal\r\n */\r\nexport class TemplateViewDefinition3d extends ViewDefinition3d {\r\n public static override get className(): string { return \"TemplateViewDefinition3d\"; }\r\n}\r\n\r\n/** An auxiliary coordinate system element. Auxiliary coordinate systems can be used by views to show\r\n * coordinate information in different units and/or orientations.\r\n * @public @preview\r\n */\r\nexport abstract class AuxCoordSystem extends DefinitionElement {\r\n public static override get className(): string { return \"AuxCoordSystem\"; }\r\n public type?: number;\r\n public description?: string;\r\n public constructor(props: AuxCoordSystemProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.type = props.type;\r\n this.description = props.description;\r\n }\r\n}\r\n\r\n/** A 2d auxiliary coordinate system.\r\n * @public @preview\r\n */\r\nexport class AuxCoordSystem2d extends AuxCoordSystem {\r\n public static override get className(): string { return \"AuxCoordSystem2d\"; }\r\n public origin?: Point2d;\r\n public angle?: number;\r\n public constructor(props: AuxCoordSystem2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.origin = props.origin ? Point2d.fromJSON(props.origin) : undefined;\r\n this.angle = props.angle ? Angle.fromJSON(props.angle).degrees : undefined;\r\n }\r\n\r\n /** Create a Code for a AuxCoordSystem2d element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem2d element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystem2d name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystem2d);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A 3d auxiliary coordinate system.\r\n * @public @preview\r\n */\r\nexport class AuxCoordSystem3d extends AuxCoordSystem {\r\n public static override get className(): string { return \"AuxCoordSystem3d\"; }\r\n public origin?: Point3d;\r\n public yaw?: number;\r\n public pitch?: number;\r\n public roll?: number;\r\n public constructor(props: AuxCoordSystem3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.origin = props.origin ? Point3d.fromJSON(props.origin) : undefined;\r\n this.yaw = props.yaw ? Angle.fromJSON(props.yaw).degrees : undefined;\r\n this.pitch = props.pitch ? Angle.fromJSON(props.pitch).degrees : undefined;\r\n this.roll = props.roll ? Angle.fromJSON(props.roll).degrees : undefined;\r\n }\r\n\r\n /** Create a Code for a AuxCoordSystem3d element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem3d element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystem3d name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystem3d);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A spatial auxiliary coordinate system.\r\n * @public @preview\r\n */\r\nexport class AuxCoordSystemSpatial extends AuxCoordSystem3d {\r\n public static override get className(): string { return \"AuxCoordSystemSpatial\"; }\r\n /** Create a Code for a AuxCoordSystemSpatial element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystemSpatial element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystemSpatial name\r\n */\r\n public static override createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystemSpatial);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Represents an *attachment* of a [[ViewDefinition]] to a [[Sheet]].\r\n * @public @preview\r\n */\r\nexport class ViewAttachment extends GraphicalElement2d {\r\n public static override get className(): string { return \"ViewAttachment\"; }\r\n public view: RelatedElement;\r\n public constructor(props: ViewAttachmentProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.view = new RelatedElement(props.view);\r\n // ###NOTE: scale, displayPriority, and clipping vectors are stored in ViewAttachmentProps.jsonProperties.\r\n }\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.view.id);\r\n }\r\n}\r\n\r\n/** The position in space of a Light.\r\n * @internal\r\n */\r\nexport class LightLocation extends SpatialLocationElement {\r\n public static override get className(): string { return \"LightLocation\"; }\r\n /** Whether this light is currently turned on. */\r\n public enabled?: boolean;\r\n\r\n protected constructor(props: LightLocationProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.enabled = props.enabled;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ViewDefinition.js","sourceRoot":"","sources":["../../src/ViewDefinition.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAyB,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrG,OAAO,EACL,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAoB,iBAAiB,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,GAChH,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAC8D,WAAW,EAAE,MAAM,EAAyB,IAAI,EACzG,mBAAmB,EAAsB,WAAW,EAA0C,cAAc,EACF,WAAW,EAC/H,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAM1F;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAC3C,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IAE1E,mFAAmF;IAC5E,MAAM,CAAe;IAE5B,YAAsB,KAAyB,EAAE,MAAgB;QAC/D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IAEe,MAAM;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAwB,CAAC;QACjD,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzB,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;;;OAIG;IACO,MAAM,CAAmB,mBAAmB,GAA4B;QAChF,EA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KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ViewDefinitions\r\n */\r\n\r\nimport { DbResult, Id64, Id64Array, Id64String, IModelStatus, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n Angle, Matrix3d, Point2d, Point3d, Range2d, Range3d, StandardViewIndex, Transform, Vector3d, YawPitchRollAngles,\r\n} from \"@itwin/core-geometry\";\r\nimport {\r\n AuxCoordSystem2dProps, AuxCoordSystem3dProps, AuxCoordSystemProps, BisCodeSpec, Camera, CategorySelectorProps, Code, CodeScopeProps,\r\n CodeSpec, ConcreteEntityTypes, EntityReferenceSet, IModelError, LightLocationProps, ModelSelectorProps, RelatedElement,\r\n SpatialViewDefinitionProps, ViewAttachmentProps, ViewDefinition2dProps, ViewDefinition3dProps, ViewDefinitionProps, ViewDetails,\r\n ViewDetails3d,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionElement, GraphicalElement2d, SpatialLocationElement } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { DisplayStyle, DisplayStyle2d, DisplayStyle3d } from \"./DisplayStyle\";\r\nimport { IModelElementCloneContext } from \"./IModelElementCloneContext\";\r\nimport { CustomHandledProperty, DeserializeEntityArgs, ECSqlRow } from \"./Entity\";\r\n\r\n/** Holds the list of Ids of GeometricModels displayed by a [[SpatialViewDefinition]]. Multiple SpatialViewDefinitions may point to the same ModelSelector.\r\n * @see [ModelSelectorState]($frontend)\r\n * @public @preview\r\n */\r\nexport class ModelSelector extends DefinitionElement {\r\n public static override get className(): string { return \"ModelSelector\"; }\r\n\r\n /** The array of modelIds of the GeometricModels displayed by this ModelSelector */\r\n public models: Id64String[];\r\n\r\n protected constructor(props: ModelSelectorProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.models = props.models;\r\n }\r\n\r\n public override toJSON(): ModelSelectorProps {\r\n const val = super.toJSON() as ModelSelectorProps;\r\n val.models = this.models;\r\n return val;\r\n }\r\n\r\n /**\r\n * ModelSelector custom HandledProps includes 'models'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"models\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ModelSelector deserializes 'models'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ModelSelectorProps {\r\n const elProps = super.deserialize(props) as ModelSelectorProps;\r\n const instance = props.row;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n elProps.models = props.iModel.withPreparedStatement(\"SELECT TargetECInstanceId FROM Bis.ModelSelectorRefersToModels WHERE SourceECInstanceId=?\", (statement) => {\r\n statement.bindId(1, instance.id);\r\n const ids: Id64Array = [];\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n ids.push(statement.getValue(0).getId());\r\n }\r\n return ids;\r\n });\r\n return elProps;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n this.models.forEach((modelId: Id64String) => referenceIds.addModel(modelId));\r\n }\r\n\r\n /** Create a Code for a ModelSelector given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the ModelSelector and provides the scope for its name.\r\n * @param codeValue The ModelSelector name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.modelSelector);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /**\r\n * Create a ModelSelector to select which Models are displayed by a ViewDefinition.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the ModelSelector\r\n * @param models Array of models to select for display\r\n * @returns The newly constructed ModelSelector element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, models: Id64Array): ModelSelector {\r\n const modelSelectorProps: ModelSelectorProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n model: definitionModelId,\r\n models,\r\n isPrivate: false,\r\n };\r\n return new ModelSelector(modelSelectorProps, iModelDb);\r\n }\r\n /**\r\n * Insert a ModelSelector to select which Models are displayed by a ViewDefinition.\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new ModelSelector into this DefinitionModel\r\n * @param name The name/CodeValue of the ModelSelector\r\n * @param models Array of models to select for display\r\n * @returns The Id of the newly inserted ModelSelector element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, models: Id64Array): Id64String {\r\n const modelSelector = this.create(iModelDb, definitionModelId, name, models);\r\n return iModelDb.elements.insertElement(modelSelector.toJSON());\r\n }\r\n}\r\n\r\n/** Holds a list of Ids of Categories to be displayed in a view.\r\n * @see [CategorySelectorState]($frontend)\r\n * See [how to create a CategorySelector]($docs/learning/backend/CreateElements.md#CategorySelector).\r\n * @public @preview\r\n */\r\nexport class CategorySelector extends DefinitionElement {\r\n public static override get className(): string { return \"CategorySelector\"; }\r\n /** The array of element Ids of the Categories selected by this CategorySelector */\r\n public categories: Id64String[];\r\n\r\n protected constructor(props: CategorySelectorProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.categories = props.categories;\r\n }\r\n\r\n public override toJSON(): CategorySelectorProps {\r\n const val = super.toJSON() as CategorySelectorProps;\r\n val.categories = this.categories;\r\n return val;\r\n }\r\n\r\n /**\r\n * CategorySelector custom HandledProps includes 'categories'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"categories\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * CategorySelector deserializes 'categories'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): CategorySelectorProps {\r\n const elProps = super.deserialize(props) as CategorySelectorProps;\r\n const instance = props.row;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n elProps.categories = props.iModel.withPreparedStatement(\"SELECT TargetECInstanceId FROM Bis.CategorySelectorRefersToCategories WHERE SourceECInstanceId=?\", (statement) => {\r\n statement.bindId(1, instance.id);\r\n const ids: Id64Array = [];\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n ids.push(statement.getValue(0).getId());\r\n }\r\n return ids;\r\n });\r\n return elProps;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n this.categories.forEach((categoryId: Id64String) => referenceIds.addElement(categoryId));\r\n }\r\n\r\n /** Create a Code for a CategorySelector given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the CategorySelector and provides the scope for its name.\r\n * @param codeValue The CategorySelector name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.categorySelector);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /**\r\n * Create a CategorySelector to select which categories are displayed by a ViewDefinition.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name of the CategorySelector\r\n * @param categories Array of categories to select for display\r\n * @returns The newly constructed CategorySelector element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, categories: Id64Array): CategorySelector {\r\n const categorySelectorProps: CategorySelectorProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n model: definitionModelId,\r\n categories,\r\n isPrivate: false,\r\n };\r\n return new CategorySelector(categorySelectorProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a CategorySelector to select which categories are displayed by a ViewDefinition.\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new CategorySelector into this DefinitionModel\r\n * @param name The name of the CategorySelector\r\n * @param categories Array of categories to select for display\r\n * @returns The Id of the newly inserted CategorySelector element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, categories: Id64Array): Id64String {\r\n const categorySelector = this.create(iModelDb, definitionModelId, name, categories);\r\n return iModelDb.elements.insertElement(categorySelector.toJSON());\r\n }\r\n}\r\n\r\n/**\r\n * The definition element for a view. ViewDefinitions specify the area/volume that is viewed, the Ids of a DisplayStyle and a CategorySelector,\r\n * plus additional view-specific parameters in their [[Element.jsonProperties]].\r\n * Subclasses of ViewDefinition determine which model(s) are viewed.\r\n * @note ViewDefinition is only available in the backend. See [ViewState]($frontend) for usage in the frontend.\r\n * @public @preview\r\n */\r\nexport abstract class ViewDefinition extends DefinitionElement {\r\n public static override get className(): string { return \"ViewDefinition\"; }\r\n /** The element Id of the [[CategorySelector]] for this ViewDefinition */\r\n public categorySelectorId: Id64String;\r\n /** The element Id of the [[DisplayStyle]] for this ViewDefinition */\r\n public displayStyleId: Id64String;\r\n\r\n protected constructor(props: ViewDefinitionProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n\r\n this.categorySelectorId = Id64.fromJSON(props.categorySelectorId);\r\n if (!Id64.isValid(this.categorySelectorId))\r\n throw new IModelError(IModelStatus.BadArg, `categorySelectorId is invalid`);\r\n\r\n this.displayStyleId = Id64.fromJSON(props.displayStyleId);\r\n if (!Id64.isValid(this.displayStyleId))\r\n throw new IModelError(IModelStatus.BadArg, `displayStyleId is invalid`);\r\n }\r\n\r\n /**\r\n * ViewDefinition custom HandledProps includes 'categorySelector', and 'displayStyle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"categorySelector\", source: \"Class\" },\r\n { propertyName: \"displayStyle\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ViewDefinition deserializes 'categorySelector', and 'displayStyle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ViewDefinitionProps {\r\n const elProps = super.deserialize(props) as ViewDefinitionProps;\r\n const instance = props.row;\r\n if (instance.isPrivate !== undefined)\r\n elProps.isPrivate = instance.isPrivate;\r\n elProps.categorySelectorId = instance.categorySelector.id;\r\n elProps.displayStyleId = instance.displayStyle.id;\r\n return elProps;\r\n }\r\n\r\n /**\r\n * ViewDefinition serializes 'categorySelector', and 'displayStyle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: ViewDefinitionProps, _iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, _iModel);\r\n inst.categorySelector.id = props.categorySelectorId;\r\n inst.displayStyle.id = props.displayStyleId;\r\n return inst;\r\n }\r\n\r\n public override toJSON(): ViewDefinitionProps {\r\n const json = super.toJSON() as ViewDefinitionProps;\r\n json.categorySelectorId = this.categorySelectorId;\r\n json.displayStyleId = this.displayStyleId;\r\n return json;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.categorySelectorId);\r\n referenceIds.addElement(this.displayStyleId);\r\n const acsId: Id64String = this.getAuxiliaryCoordinateSystemId();\r\n if (Id64.isValidId64(acsId)) {\r\n referenceIds.addElement(acsId);\r\n }\r\n }\r\n\r\n /** @beta */\r\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"categorySelectorId\", \"displayStyleId\"];\r\n /** @alpha */\r\n public static override readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes> = {\r\n ...super.requiredReferenceKeyTypeMap,\r\n categorySelectorId: ConcreteEntityTypes.Element,\r\n displayStyleId: ConcreteEntityTypes.Element,\r\n };\r\n\r\n /** @beta */\r\n protected static override async onCloned(context: IModelElementCloneContext, sourceElementProps: ViewDefinitionProps, targetElementProps: ViewDefinitionProps): Promise<void> {\r\n await super.onCloned(context, sourceElementProps, targetElementProps);\r\n if (context.isBetweenIModels && targetElementProps.jsonProperties && targetElementProps.jsonProperties.viewDetails) {\r\n const acsId: Id64String = Id64.fromJSON(targetElementProps.jsonProperties.viewDetails.acs);\r\n if (Id64.isValidId64(acsId)) {\r\n targetElementProps.jsonProperties.viewDetails.acs = context.findTargetElementId(acsId);\r\n }\r\n }\r\n }\r\n\r\n /** Type guard for `instanceof ViewDefinition3d` */\r\n public isView3d(): this is ViewDefinition3d { return this instanceof ViewDefinition3d; }\r\n /** Type guard for 'instanceof ViewDefinition2d` */\r\n public isView2d(): this is ViewDefinition2d { return this instanceof ViewDefinition2d; }\r\n /** Type guard for `instanceof SpatialViewDefinition` */\r\n public isSpatialView(): this is SpatialViewDefinition { return this instanceof SpatialViewDefinition; }\r\n /** Type guard for 'instanceof DrawingViewDefinition' */\r\n public isDrawingView(): this is DrawingViewDefinition { return this instanceof DrawingViewDefinition; }\r\n\r\n /** Load this view's DisplayStyle from the IModelDb. */\r\n public loadDisplayStyle(): DisplayStyle { return this.iModel.elements.getElement<DisplayStyle>(this.displayStyleId); }\r\n\r\n /** Load this view's CategorySelector from the IModelDb. */\r\n public loadCategorySelector(): CategorySelector { return this.iModel.elements.getElement<CategorySelector>(this.categorySelectorId); }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public abstract get details(): ViewDetails;\r\n\r\n /** The Id of the AuxiliaryCoordinateSystem for this ViewDefinition, or an invalid Id if no ACS is defined. */\r\n public getAuxiliaryCoordinateSystemId(): Id64String {\r\n return this.details.auxiliaryCoordinateSystemId;\r\n }\r\n\r\n /** Set or clear the AuxiliaryCoordinateSystem for this ViewDefinition.\r\n * @param acsId The Id of the new AuxiliaryCoordinateSystem. If `Id64.invalid` is passed, then no AuxiliaryCoordinateSystem will be used.\r\n */\r\n public setAuxiliaryCoordinateSystemId(acsId: Id64String) {\r\n this.details.auxiliaryCoordinateSystemId = acsId;\r\n }\r\n\r\n /** Create a Code for a ViewDefinition given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel to contain the ViewDefinition and provides the scope for its name.\r\n * @param codeValue The ViewDefinition name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.viewDefinition);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Defines a view of one or more 3d models.\r\n * @public @preview\r\n */\r\nexport abstract class ViewDefinition3d extends ViewDefinition {\r\n private readonly _details: ViewDetails3d;\r\n public static override get className(): string { return \"ViewDefinition3d\"; }\r\n /** If true, camera is used. Otherwise, use an orthographic projection. */\r\n public cameraOn: boolean;\r\n /** The lower left back corner of the view frustum. */\r\n public origin: Point3d;\r\n /** The extent (size) of the view frustum, in meters, along its x,y,z axes. */\r\n public extents: Vector3d;\r\n /** Rotation from world coordinates to view coordinates. */\r\n public angles: YawPitchRollAngles;\r\n /** The camera used for this view, if `cameraOn` is true. */\r\n public camera: Camera;\r\n\r\n protected constructor(props: ViewDefinition3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.cameraOn = JsonUtils.asBool(props.cameraOn);\r\n this.origin = Point3d.fromJSON(props.origin);\r\n this.extents = Vector3d.fromJSON(props.extents);\r\n this.angles = YawPitchRollAngles.fromJSON(props.angles);\r\n this.camera = new Camera(props.camera);\r\n this._details = new ViewDetails3d(this.jsonProperties);\r\n }\r\n\r\n /**\r\n * ViewDefinition3d custom HandledProps includes 'eyePoint', 'focusDistance', 'lensAngle', 'yaw', 'pitch', 'roll',\r\n * 'origin', 'extents', and 'isCameraOn'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"eyePoint\", source: \"Class\" },\r\n { propertyName: \"focusDistance\", source: \"Class\" },\r\n { propertyName: \"lensAngle\", source: \"Class\" },\r\n { propertyName: \"yaw\", source: \"Class\" },\r\n { propertyName: \"roll\", source: \"Class\" },\r\n { propertyName: \"pitch\", source: \"Class\" },\r\n { propertyName: \"origin\", source: \"Class\" },\r\n { propertyName: \"extents\", source: \"Class\" },\r\n { propertyName: \"isCameraOn\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ViewDefinition3d deserializes 'eyePoint', 'focusDistance', 'lensAngle', 'yaw', 'pitch', 'roll',\r\n * 'origin', 'extents', and 'isCameraOn'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ViewDefinition3dProps {\r\n const instance = props.row;\r\n const elProps = super.deserialize(props) as ViewDefinition3dProps;\r\n // ViewDefinition3dProps\r\n elProps.cameraOn = instance.isCameraOn as boolean;\r\n elProps.origin = [ instance.origin.x, instance.origin.y, instance.origin.z ];\r\n elProps.extents = [ instance.extents.x, instance.extents.y, instance.extents.z ];\r\n elProps.camera = { eye: [instance.eyePoint.x, instance.eyePoint.y, instance.eyePoint.z], focusDist: instance.focusDistance, lens: Angle.createRadians(instance.lensAngle).toJSON() };\r\n elProps.angles = YawPitchRollAngles.createDegrees(instance.yaw ?? 0, instance.pitch ?? 0, instance.roll ?? 0).toJSON();\r\n return elProps;\r\n }\r\n\r\n /**\r\n * ViewDefinition3d serializes 'eyePoint', 'focusDistance', 'lensAngle', 'yaw', 'pitch', 'roll',\r\n * 'origin', 'extents', and 'isCameraOn'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: ViewDefinition3dProps, _iModel: IModelDb): ECSqlRow {\r\n const row = super.serialize(props, _iModel);\r\n row.isCameraOn = props.cameraOn;\r\n row.eyePoint = props.camera.eye;\r\n row.focusDistance = props.camera.focusDist;\r\n row.lensAngle = props.camera.lens;\r\n if (props.angles) {\r\n row.yaw = props.angles.yaw;\r\n row.roll = props.angles.roll;\r\n row.pitch = props.angles.pitch;\r\n }\r\n return row;\r\n }\r\n\r\n public override toJSON(): ViewDefinition3dProps {\r\n const val = super.toJSON() as ViewDefinition3dProps;\r\n val.cameraOn = this.cameraOn;\r\n val.origin = this.origin;\r\n val.extents = this.extents;\r\n val.angles = this.angles;\r\n val.camera = this.camera;\r\n return val;\r\n }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public get details(): ViewDetails3d { return this._details; }\r\n\r\n /** Load this view's DisplayStyle3d from the IModelDb. */\r\n public loadDisplayStyle3d(): DisplayStyle3d { return this.iModel.elements.getElement<DisplayStyle3d>(this.displayStyleId); }\r\n}\r\n\r\n/** Defines a view of one or more SpatialModels.\r\n * The list of viewed models is stored by the ModelSelector.\r\n *\r\n * This is how a SpatialViewDefinition selects the elements to display:\r\n *\r\n * SpatialViewDefinition\r\n * * ModelSelector\r\n * * ModelIds -------> SpatialModels <----------GeometricElement3d.Model\r\n * * CategorySelector\r\n * * CategoryIds -----> SpatialCategories <----------GeometricElement3d.Category\r\n * @public @preview\r\n */\r\nexport class SpatialViewDefinition extends ViewDefinition3d {\r\n public static override get className(): string { return \"SpatialViewDefinition\"; }\r\n /** The Id of the [[ModelSelector]] for this SpatialViewDefinition. */\r\n public modelSelectorId: Id64String;\r\n\r\n protected constructor(props: SpatialViewDefinitionProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.modelSelectorId = Id64.fromJSON(props.modelSelectorId);\r\n if (!Id64.isValid(this.modelSelectorId))\r\n throw new IModelError(IModelStatus.BadArg, `modelSelectorId is invalid`);\r\n }\r\n\r\n /** Construct a SpatialViewDefinition from its JSON representation. */\r\n public static fromJSON(props: Omit<SpatialViewDefinitionProps, \"classFullName\">, iModel: IModelDb) {\r\n return new SpatialViewDefinition({ ...props, classFullName: this.classFullName }, iModel);\r\n }\r\n\r\n public override toJSON(): SpatialViewDefinitionProps {\r\n const json = super.toJSON() as SpatialViewDefinitionProps;\r\n json.modelSelectorId = this.modelSelectorId;\r\n return json;\r\n }\r\n\r\n /**\r\n * SpatialViewDefinition custom HandledProps includes 'modelSelector'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"modelSelector\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * SpatialViewDefinition deserializes 'modelSelector'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): SpatialViewDefinitionProps {\r\n const elProps = super.deserialize(props) as SpatialViewDefinitionProps;\r\n const instance = props.row;\r\n elProps.modelSelectorId = instance.modelSelector.id;\r\n return elProps;\r\n }\r\n\r\n /**\r\n * SpatialViewDefinition serializes 'modelSelector'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: SpatialViewDefinitionProps, _iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, _iModel);\r\n inst.modelSelector.id = props.modelSelectorId;\r\n return inst;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.modelSelectorId);\r\n }\r\n\r\n /** @beta */\r\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"modelSelectorId\"];\r\n\r\n /** @alpha */\r\n public static override readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes> = {\r\n ...super.requiredReferenceKeyTypeMap,\r\n modelSelectorId: ConcreteEntityTypes.Element,\r\n };\r\n\r\n /** Load this view's ModelSelector from the IModelDb. */\r\n public loadModelSelector(): ModelSelector { return this.iModel.elements.getElement<ModelSelector>(this.modelSelectorId); }\r\n /**\r\n * Create a SpatialViewDefinition with the camera turned on.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @param cameraAngle Camera angle in radians.\r\n * @returns The newly constructed SpatialViewDefinition element\r\n * @throws [[IModelError]] if there is a problem creating the view\r\n */\r\n public static createWithCamera(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso, cameraAngle = Angle.piOver2Radians): SpatialViewDefinition {\r\n const rotation = Matrix3d.createStandardWorldToView(standardView);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n const cameraDistance = 2 * (rotatedRange.diagonal().magnitudeXY() / 2.0) / Math.tan(cameraAngle / 2.0);\r\n const cameraLocation = rotatedRange.diagonalFractionToPoint(.5); // Start at center.\r\n cameraLocation.z += cameraDistance; // Back up by camera distance.\r\n rotation.multiplyTransposeVectorInPlace(cameraLocation);\r\n\r\n const viewDefinitionProps: SpatialViewDefinitionProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n modelSelectorId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\r\n extents: rotatedRange.diagonal(),\r\n angles,\r\n cameraOn: true,\r\n camera: { lens: { radians: cameraAngle }, focusDist: cameraDistance, eye: cameraLocation },\r\n };\r\n\r\n return new SpatialViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n /**\r\n * Insert an SpatialViewDefinition with the camera turned on.\r\n * @see [[createWithCamera]] for details.\r\n * @returns The Id of the newly inserted SpatialViewDefinition element\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insertWithCamera(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso, cameraAngle = Angle.piOver2Radians): Id64String {\r\n const viewDefinition = this.createWithCamera(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView, cameraAngle);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n}\r\n\r\n/** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.\r\n * See [how to create a OrthographicViewDefinition]($docs/learning/backend/CreateElements.md#OrthographicViewDefinition).\r\n * @public @preview\r\n */\r\nexport class OrthographicViewDefinition extends SpatialViewDefinition {\r\n public static override get className(): string { return \"OrthographicViewDefinition\"; }\r\n\r\n constructor(props: SpatialViewDefinitionProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /**\r\n * Create an OrthographicViewDefinition\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @returns The newly constructed OrthographicViewDefinition element\r\n * @throws [[IModelError]] if there is a problem creating the view\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): OrthographicViewDefinition {\r\n const rotation = Matrix3d.createStandardWorldToView(standardView);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n const viewDefinitionProps: SpatialViewDefinitionProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n modelSelectorId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\r\n extents: rotatedRange.diagonal(),\r\n angles,\r\n cameraOn: false,\r\n camera: new Camera(), // not used when cameraOn === false\r\n };\r\n return new OrthographicViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert an OrthographicViewDefinition\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new OrthographicViewDefinition into this DefinitionModel\r\n * @param name The name/CodeValue of the view\r\n * @param modelSelectorId The [[ModelSelector]] that this view should use\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle3d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @param standardView Optionally defines the view's rotation\r\n * @returns The Id of the newly inserted OrthographicViewDefinition element\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, modelSelectorId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range3d, standardView = StandardViewIndex.Iso): Id64String {\r\n const viewDefinition = this.create(iModelDb, definitionModelId, name, modelSelectorId, categorySelectorId, displayStyleId, range, standardView);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n\r\n /** Set a new viewed range without changing the rotation or any other properties. */\r\n public setRange(range: Range3d): void {\r\n const rotation = this.angles.toMatrix3d();\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n this.origin = Point3d.createFrom(rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z));\r\n this.extents = rotatedRange.diagonal();\r\n }\r\n}\r\n\r\n/** Defines a view of a single 2d model. Each 2d model has its own coordinate system, so only one may appear per view.\r\n * @public @preview\r\n */\r\nexport class ViewDefinition2d extends ViewDefinition {\r\n private readonly _details: ViewDetails;\r\n\r\n public static override get className(): string { return \"ViewDefinition2d\"; }\r\n /** The Id of the Model displayed by this view. */\r\n public baseModelId: Id64String;\r\n /** The lower-left corner of this view in Model coordinates. */\r\n public origin: Point2d;\r\n /** The delta (size) of this view, in meters, aligned with view x,y. */\r\n public delta: Point2d;\r\n /** The rotation of this view. */\r\n public angle: Angle;\r\n\r\n protected constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.baseModelId = Id64.fromJSON(props.baseModelId);\r\n if (!Id64.isValid(this.baseModelId))\r\n throw new IModelError(IModelStatus.BadArg, `baseModelId is invalid`);\r\n this.origin = Point2d.fromJSON(props.origin);\r\n this.delta = Point2d.fromJSON(props.delta);\r\n this.angle = Angle.fromJSON(props.angle);\r\n this._details = new ViewDetails(this.jsonProperties);\r\n }\r\n\r\n public override toJSON(): ViewDefinition2dProps {\r\n const val = super.toJSON() as ViewDefinition2dProps;\r\n val.baseModelId = this.baseModelId;\r\n val.origin = this.origin;\r\n val.delta = this.delta;\r\n val.angle = this.angle;\r\n return val;\r\n }\r\n\r\n /**\r\n * ViewDefinition2d custom HandledProps includes 'baseModel', 'origin', 'extents', and 'rotationAngle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"baseModel\", source: \"Class\" },\r\n { propertyName: \"origin\", source: \"Class\" },\r\n { propertyName: \"extents\", source: \"Class\" },\r\n { propertyName: \"rotationAngle\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * ViewDefinition2d deserializes 'baseModel', 'origin', 'extents', and 'rotationAngle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): ViewDefinition2dProps {\r\n const elProps = super.deserialize(props) as ViewDefinition2dProps;\r\n const instance = props.row;\r\n elProps.baseModelId = instance.baseModel.id;\r\n elProps.origin = [ instance.origin.x, instance.origin.y ];\r\n elProps.delta = [ instance.extents.x, instance.extents.y ];\r\n elProps.angle = instance.rotationAngle;\r\n return elProps;\r\n }\r\n\r\n /**\r\n * ViewDefinition2d serializes 'baseModel', 'origin', 'extents', and 'rotationAngle'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: ViewDefinition2dProps, _iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, _iModel);\r\n inst.baseModel.id = props.baseModelId;\r\n inst.origin = props.origin;\r\n inst.extents = props.delta;\r\n inst.rotationAngle = props.angle;\r\n return inst;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.baseModelId);\r\n }\r\n\r\n /** Provides access to optional detail settings for this view. */\r\n public get details(): ViewDetails { return this._details; }\r\n\r\n /** Load this view's DisplayStyle2d from the IModelDb. */\r\n public loadDisplayStyle2d(): DisplayStyle2d { return this.iModel.elements.getElement<DisplayStyle2d>(this.displayStyleId); }\r\n}\r\n\r\n/** Defines a view of a [[DrawingModel]].\r\n * @public @preview\r\n */\r\nexport class DrawingViewDefinition extends ViewDefinition2d {\r\n public static override get className(): string { return \"DrawingViewDefinition\"; }\r\n\r\n protected constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n\r\n /** Create a DrawingViewDefinition\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param baseModelId The base [[DrawingModel]]\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle2d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @throws [[IModelError]] if there is a problem creating the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, baseModelId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range2d): DrawingViewDefinition {\r\n const viewDefinitionProps: ViewDefinition2dProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n baseModelId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: { x: range.low.x, y: range.low.y },\r\n delta: range.diagonal(),\r\n angle: 0,\r\n };\r\n return new DrawingViewDefinition(viewDefinitionProps, iModelDb);\r\n }\r\n\r\n /** Construct a DrawingViewDefinition from its JSON representation. */\r\n public static fromJSON(props: Omit<ViewDefinition2dProps, \"classFullName\">, iModel: IModelDb) {\r\n return new DrawingViewDefinition({ ...props, classFullName: this.classFullName }, iModel);\r\n }\r\n\r\n /** Insert a DrawingViewDefinition\r\n * @param iModelDb Insert into this iModel\r\n * @param definitionModelId Insert the new DrawingViewDefinition into this [[DefinitionModel]]\r\n * @param name The name/CodeValue of the view\r\n * @param baseModelId The base [[DrawingModel]]\r\n * @param categorySelectorId The [[CategorySelector]] that this view should use\r\n * @param displayStyleId The [[DisplayStyle2d]] that this view should use\r\n * @param range Defines the view origin and extents\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, baseModelId: Id64String, categorySelectorId: Id64String, displayStyleId: Id64String, range: Range2d): Id64String {\r\n const viewDefinition = this.create(iModelDb, definitionModelId, name, baseModelId, categorySelectorId, displayStyleId, range);\r\n return iModelDb.elements.insertElement(viewDefinition.toJSON());\r\n }\r\n}\r\n\r\n/** Arguments to be passed in to [[SheetViewDefinition.create]]\r\n * @public\r\n*/\r\nexport interface CreateSheetViewDefinitionArgs {\r\n /** The iModel in which the sheet view will be created. */\r\n iModel: IModelDb;\r\n /** The Id of the [[DefinitionModel]] into which the sheet view will be inserted. */\r\n definitionModelId: Id64String;\r\n /** The name to use as the view's Code value. */\r\n name: string;\r\n /** The Id of the sheet model whose contents will be displayed by this view. */\r\n baseModelId: Id64String;\r\n /** The [[CategorySelector]] that this view should use. */\r\n categorySelectorId: Id64String;\r\n /** The [[DisplayStyle2d]] that this view should use. */\r\n displayStyleId: Id64String;\r\n /** Defines the view origin and extents. */\r\n range: Range2d;\r\n}\r\n\r\n/** Defines a view of a [[SheetModel]].\r\n * @public @preview\r\n */\r\nexport class SheetViewDefinition extends ViewDefinition2d {\r\n public static override get className(): string { return \"SheetViewDefinition\"; }\r\n\r\n protected constructor(props: ViewDefinition2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n\r\n /** Create a SheetViewDefinition */\r\n public static create(args: CreateSheetViewDefinitionArgs): SheetViewDefinition {\r\n const { baseModelId, categorySelectorId, displayStyleId, range } = args;\r\n const props: ViewDefinition2dProps = {\r\n classFullName: this.classFullName,\r\n model: args.definitionModelId,\r\n code: this.createCode(args.iModel, args.definitionModelId, args.name),\r\n baseModelId,\r\n categorySelectorId,\r\n displayStyleId,\r\n origin: { x: range.low.x, y: range.low.y },\r\n delta: range.diagonal(),\r\n angle: 0,\r\n };\r\n\r\n return new SheetViewDefinition(props, args.iModel);\r\n }\r\n\r\n /** Insert a SheetViewDefinition into an IModelDb */\r\n public static insert(args: CreateSheetViewDefinitionArgs): Id64String {\r\n const view = this.create(args);\r\n return args.iModel.elements.insertElement(view.toJSON());\r\n }\r\n\r\n /** Create a SheetViewDefinition from JSON props */\r\n public static fromJSON(props: Omit<ViewDefinition2dProps, \"classFullName\">, iModel: IModelDb): SheetViewDefinition {\r\n return new SheetViewDefinition({ ...props, classFullName: this.classFullName }, iModel);\r\n }\r\n}\r\n\r\n/** A ViewDefinition used to display a 2d template model.\r\n * @internal\r\n */\r\nexport class TemplateViewDefinition2d extends ViewDefinition2d {\r\n public static override get className(): string { return \"TemplateViewDefinition2d\"; }\r\n}\r\n\r\n/** A ViewDefinition used to display a 3d template model.\r\n * @internal\r\n */\r\nexport class TemplateViewDefinition3d extends ViewDefinition3d {\r\n public static override get className(): string { return \"TemplateViewDefinition3d\"; }\r\n}\r\n\r\n/** An auxiliary coordinate system element. Auxiliary coordinate systems can be used by views to show\r\n * coordinate information in different units and/or orientations.\r\n * @public @preview\r\n */\r\nexport abstract class AuxCoordSystem extends DefinitionElement {\r\n public static override get className(): string { return \"AuxCoordSystem\"; }\r\n public type?: number;\r\n public description?: string;\r\n public constructor(props: AuxCoordSystemProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.type = props.type;\r\n this.description = props.description;\r\n }\r\n}\r\n\r\n/** A 2d auxiliary coordinate system.\r\n * @public @preview\r\n */\r\nexport class AuxCoordSystem2d extends AuxCoordSystem {\r\n public static override get className(): string { return \"AuxCoordSystem2d\"; }\r\n public origin?: Point2d;\r\n public angle?: number;\r\n public constructor(props: AuxCoordSystem2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.origin = props.origin ? Point2d.fromJSON(props.origin) : undefined;\r\n this.angle = props.angle ? Angle.fromJSON(props.angle).degrees : undefined;\r\n }\r\n\r\n /** Create a Code for a AuxCoordSystem2d element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem2d element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystem2d name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystem2d);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A 3d auxiliary coordinate system.\r\n * @public @preview\r\n */\r\nexport class AuxCoordSystem3d extends AuxCoordSystem {\r\n public static override get className(): string { return \"AuxCoordSystem3d\"; }\r\n public origin?: Point3d;\r\n public yaw?: number;\r\n public pitch?: number;\r\n public roll?: number;\r\n public constructor(props: AuxCoordSystem3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.origin = props.origin ? Point3d.fromJSON(props.origin) : undefined;\r\n this.yaw = props.yaw ? Angle.fromJSON(props.yaw).degrees : undefined;\r\n this.pitch = props.pitch ? Angle.fromJSON(props.pitch).degrees : undefined;\r\n this.roll = props.roll ? Angle.fromJSON(props.roll).degrees : undefined;\r\n }\r\n\r\n /** Create a Code for a AuxCoordSystem3d element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem3d element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystem3d name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystem3d);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A spatial auxiliary coordinate system.\r\n * @public @preview\r\n */\r\nexport class AuxCoordSystemSpatial extends AuxCoordSystem3d {\r\n public static override get className(): string { return \"AuxCoordSystemSpatial\"; }\r\n /** Create a Code for a AuxCoordSystemSpatial element given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystemSpatial element and provides the scope for its name.\r\n * @param codeValue The AuxCoordSystemSpatial name\r\n */\r\n public static override createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.auxCoordSystemSpatial);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Represents an *attachment* of a [[ViewDefinition]] to a [[Sheet]].\r\n * @public @preview\r\n */\r\nexport class ViewAttachment extends GraphicalElement2d {\r\n public static override get className(): string { return \"ViewAttachment\"; }\r\n public view: RelatedElement;\r\n public constructor(props: ViewAttachmentProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.view = new RelatedElement(props.view);\r\n // ###NOTE: scale, displayPriority, and clipping vectors are stored in ViewAttachmentProps.jsonProperties.\r\n }\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.view.id);\r\n }\r\n}\r\n\r\n/** The position in space of a Light.\r\n * @internal\r\n */\r\nexport class LightLocation extends SpatialLocationElement {\r\n public static override get className(): string { return \"LightLocation\"; }\r\n /** Whether this light is currently turned on. */\r\n public enabled?: boolean;\r\n\r\n protected constructor(props: LightLocationProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.enabled = props.enabled;\r\n }\r\n}\r\n"]}
|
|
@@ -6,8 +6,8 @@ import { assert, expect } from "chai";
|
|
|
6
6
|
import { join } from "path";
|
|
7
7
|
import { CompressedId64Set, Guid, Id64, OpenMode } from "@itwin/core-bentley";
|
|
8
8
|
import { Camera, Code, ColorByName, ColorDef, IModel, IModelError, PlanProjectionSettings, SubCategoryAppearance, } from "@itwin/core-common";
|
|
9
|
-
import { Matrix3d, Range3d, StandardViewIndex, Transform, YawPitchRollAngles } from "@itwin/core-geometry";
|
|
10
|
-
import { CategorySelector, DisplayStyle3d, ModelSelector, SpatialCategory, SpatialViewDefinition, StandaloneDb, ViewStore, } from "../../core-backend";
|
|
9
|
+
import { Matrix3d, Range2d, Range3d, StandardViewIndex, Transform, YawPitchRollAngles } from "@itwin/core-geometry";
|
|
10
|
+
import { CategorySelector, DefinitionModel, DisplayStyle2d, DisplayStyle3d, DrawingCategory, DrawingViewDefinition, ModelSelector, SpatialCategory, SpatialViewDefinition, StandaloneDb, Subject, ViewStore, } from "../../core-backend";
|
|
11
11
|
import { IModelTestUtils } from "../IModelTestUtils";
|
|
12
12
|
import { KnownTestLocations } from "../KnownTestLocations";
|
|
13
13
|
function createNewModelAndCategory(rwIModel) {
|
|
@@ -275,5 +275,17 @@ describe("ViewDefinition", () => {
|
|
|
275
275
|
// Best way to create and insert
|
|
276
276
|
SpatialViewDefinition.insertWithCamera(iModel, IModel.dictionaryId, "default", modelSelectorId, categorySelectorId, displayStyleId, iModel.projectExtents);
|
|
277
277
|
});
|
|
278
|
+
describe("DrawingViewDefinition", () => {
|
|
279
|
+
it("fails on insert without a valid baseModelId", () => {
|
|
280
|
+
const subjectId = Subject.insert(iModel, IModel.rootSubjectId, "Subject", "Subject Description");
|
|
281
|
+
const definitionModelId = DefinitionModel.insert(iModel, subjectId, "Definition");
|
|
282
|
+
const drawingCategoryId = DrawingCategory.insert(iModel, definitionModelId, "DrawingCategory", new SubCategoryAppearance());
|
|
283
|
+
const drawingCategorySelectorId = CategorySelector.insert(iModel, definitionModelId, "DrawingCategories", [drawingCategoryId]);
|
|
284
|
+
const displayStyle2dId = DisplayStyle2d.insert(iModel, definitionModelId, "DisplayStyle2d");
|
|
285
|
+
assert.throws(() => {
|
|
286
|
+
DrawingViewDefinition.insert(iModel, definitionModelId, "Drawing View", "0", drawingCategorySelectorId, displayStyle2dId, new Range2d(0, 0, 100, 100));
|
|
287
|
+
}, IModelError, "baseModelId is invalid");
|
|
288
|
+
});
|
|
289
|
+
});
|
|
278
290
|
});
|
|
279
291
|
//# sourceMappingURL=ViewDefinition.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewDefinition.test.js","sourceRoot":"","sources":["../../../../src/test/standalone/ViewDefinition.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAc,IAAI,E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,kCAAkC;QAClC,MAAM,KAAK,GAA+B,EAAE,GAAG,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC;QACjH,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAwB,KAAK,CAAC,CAAC;QACnF,MAAM,gBAAgB,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC;QAChF,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;QACpC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAE9C,gCAAgC;QAChC,qBAAqB,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAC7J,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { assert, expect } from \"chai\";\r\nimport { join } from \"path\";\r\nimport { CompressedId64Set, Guid, GuidString, Id64, Id64String, OpenMode } from \"@itwin/core-bentley\";\r\nimport {\r\n Camera, Code, ColorByName, ColorDef, DisplayStyle3dProps, ElementProps, IModel, IModelError, PlanProjectionSettings, SpatialViewDefinitionProps,\r\n SubCategoryAppearance,\r\n} from \"@itwin/core-common\";\r\nimport { Matrix3d, Range3d, StandardViewIndex, Transform, YawPitchRollAngles } from \"@itwin/core-geometry\";\r\nimport {\r\n CategorySelector, DictionaryModel, DisplayStyle3d, IModelDb, ModelSelector, SpatialCategory, SpatialViewDefinition, StandaloneDb, ViewStore,\r\n} from \"../../core-backend\";\r\nimport { IModelTestUtils } from \"../IModelTestUtils\";\r\nimport { KnownTestLocations } from \"../KnownTestLocations\";\r\n\r\nfunction createNewModelAndCategory(rwIModel: IModelDb) {\r\n const modelId = IModelTestUtils.createAndInsertPhysicalPartitionAndModel(rwIModel, IModelTestUtils.getUniqueModelCode(rwIModel, \"newPhysicalModel\"))[1];\r\n const modelId2 = IModelTestUtils.createAndInsertPhysicalPartitionAndModel(rwIModel, IModelTestUtils.getUniqueModelCode(rwIModel, \"PhysicalModel2\"), true)[1];\r\n const dictionary: DictionaryModel = rwIModel.models.getModel<DictionaryModel>(IModel.dictionaryId);\r\n const newCategoryCode = IModelTestUtils.getUniqueSpatialCategoryCode(dictionary, \"TestSpatialCategory\");\r\n const category = SpatialCategory.create(rwIModel, IModel.dictionaryId, newCategoryCode.value);\r\n const spatialCategoryId = category.insert();\r\n category.setDefaultAppearance(new SubCategoryAppearance({ color: 0xff0000 }));\r\n\r\n newCategoryCode.value = \"spatial category 2\";\r\n SpatialCategory.create(rwIModel, IModel.dictionaryId, newCategoryCode.value).insert();\r\n\r\n rwIModel.elements.insertElement(IModelTestUtils.createPhysicalObject(rwIModel, modelId2, spatialCategoryId).toJSON());\r\n\r\n return { modelId, modelId2, spatialCategoryId };\r\n}\r\n\r\n// cspell:disable\r\n\r\nlet vs1: ViewStore.ViewDb;\r\n\r\ndescribe(\"ViewDefinition\", () => {\r\n // to simulate elements with guids without having to add elements to the iModel\r\n class FakeGuids {\r\n private _ids = new Map<Id64String, GuidString>();\r\n private _guids = new Map<GuidString, Id64String>();\r\n private add(id: Id64String, guid: GuidString) {\r\n this._ids.set(id, guid);\r\n this._guids.set(guid, id);\r\n return guid;\r\n }\r\n public getFederationGuidFromId(id: Id64String): GuidString | undefined {\r\n return this._ids.get(id) ?? this.add(id, Guid.createValue());\r\n }\r\n public getIdFromFederationGuid(guid?: GuidString): Id64String | undefined {\r\n return guid ? this._guids.get(guid) : undefined;\r\n }\r\n }\r\n\r\n let iModel: StandaloneDb;\r\n before(() => {\r\n iModel = StandaloneDb.createEmpty(IModelTestUtils.prepareOutputFile(\"ViewDefinition\", \"ViewDefinition.bim\"), {\r\n rootSubject: { name: \"ViewDefinition tests\", description: \"ViewDefinition tests\" },\r\n client: \"ViewDefinition\",\r\n globalOrigin: { x: 0, y: 0 },\r\n projectExtents: { low: { x: -500, y: -500, z: -50 }, high: { x: 500, y: 500, z: 50 } },\r\n guid: Guid.createValue(),\r\n });\r\n\r\n const dbName = join(KnownTestLocations.outputDir, \"viewDefTest.db\");\r\n ViewStore.ViewDb.createNewDb(dbName);\r\n vs1 = new ViewStore.ViewDb({ iModel, guidMap: new FakeGuids() });\r\n vs1.openDb(dbName, OpenMode.ReadWrite);\r\n });\r\n\r\n after(() => {\r\n iModel.abandonChanges();\r\n iModel.close();\r\n vs1.closeDb(true);\r\n });\r\n\r\n it(\"SpatialViewDefinition\", async () => {\r\n const { modelId, modelId2, spatialCategoryId } = createNewModelAndCategory(iModel);\r\n const displayStyleId = DisplayStyle3d.insert(iModel, IModel.dictionaryId, \"default\", { backgroundColor: ColorDef.fromString(\"rgb(255,0,0)\") });\r\n const modelSelectorId = ModelSelector.insert(iModel, IModel.dictionaryId, \"default\", [modelId, modelId2]);\r\n const categorySelectorId = CategorySelector.insert(iModel, IModel.dictionaryId, \"default\", [spatialCategoryId]);\r\n iModel.saveChanges(\"Basic setup\");\r\n\r\n const standardView = StandardViewIndex.Iso;\r\n const rotation = Matrix3d.createStandardWorldToView(standardView);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const range = new Range3d(1, 1, 1, 8, 8, 8);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n const basicProps = {\r\n code: Code.createEmpty(),\r\n model: IModel.dictionaryId,\r\n classFullName: \"BisCore:SpatialViewDefinition\",\r\n cameraOn: false,\r\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\r\n extents: rotatedRange.diagonal(),\r\n angles,\r\n camera: new Camera(),\r\n };\r\n\r\n const ms1 = iModel.elements.getElement<ModelSelector>(modelSelectorId);\r\n const ms1Row = await vs1.addModelSelector({ name: ms1.code.value, selector: { ids: ms1.models } });\r\n expect(ms1Row).equal(\"@1\");\r\n let ms1out = vs1.getModelSelectorSync({ id: ms1Row });\r\n expect(ms1out.classFullName).equal(\"BisCore:ModelSelector\");\r\n expect(ms1out.models.length).equal(2);\r\n expect(ms1out.models[0]).equal(modelId);\r\n expect(ms1out.models[1]).equal(modelId2);\r\n ms1out.models.push(\"0x123\");\r\n await vs1.updateModelSelector({ id: ms1Row, selector: { ids: ms1out.models } });\r\n ms1out = vs1.getModelSelectorSync({ id: ms1Row });\r\n expect(ms1out.models.length).equal(3);\r\n expect(ms1out.models[2]).equal(\"0x123\");\r\n\r\n const cs1 = iModel.elements.getElement<CategorySelector>(categorySelectorId);\r\n const cs1Row = await vs1.addCategorySelector({ selector: { ids: cs1.categories } });\r\n expect(cs1Row).equal(\"@1\");\r\n let cs1out = vs1.getCategorySelectorSync({ id: cs1Row });\r\n expect(cs1out.classFullName).equal(\"BisCore:CategorySelector\");\r\n expect(cs1out.categories.length).equal(1);\r\n expect(cs1out.categories[0]).equal(spatialCategoryId);\r\n cs1out.categories.push(\"0x1234\");\r\n await vs1.updateCategorySelector({ id: cs1Row, selector: { ids: cs1out.categories } });\r\n cs1out = vs1.getCategorySelectorSync({ id: cs1Row });\r\n expect(cs1out.categories.length).equal(2);\r\n expect(cs1out.categories[1]).equal(\"0x1234\");\r\n\r\n const longElementList = CompressedId64Set.sortAndCompress([\"0x2a\", \"0x2b\", \"0x2d\", \"0x2e\", \"0x43\", \"0x1a\", \"0x1d\", \"0x12\", \"0x22\",\r\n \"0x8\", \"0x21\", \"0x1b\", \"0x1c\", \"0x1e\", \"0x1f\", \"0x2c\", \"0x2f\", \"0x3a\", \"0x3b\", \"0x3d\", \"0x3e\", \"0x43\",\r\n \"0x4a\", \"0x4b\", \"0x4d\", \"0x4e\", \"0x5a\", \"0x5b\", \"0x5d\", \"0x5e\", \"0x6a\", \"0x6b\", \"0x6d\", \"0x6e\", \"0x7a\",\r\n \"0x7b\", \"0x7d\", \"0x7e\", \"0x8a\", \"0x8b\", \"0x8d\", \"0x8e\", \"0x9a\", \"0x9b\", \"0x9d\", \"0x9e\", \"0xaa\", \"0xab\", \"0xad\",\r\n \"0xae\", \"0xba\", \"0xbb\", \"0xbd\", \"0xbe\", \"0xf5ca\", \"0xcb\", \"0xcd\", \"0xce\", \"0xda\", \"0xdb\", \"0xdd\", \"0xde\", \"0xea\",\r\n \"0xeb\", \"0xed\", \"0xee\", \"0xfa\", \"0xfb\", \"0xfd\", \"0xfe\", \"0x10a\", \"0x10b\", \"0x10d\", \"0x10e\", \"0x11a\", \"0x11b\", \"0x11d\",\r\n \"0x11e\", \"0x12a\", \"0x12b\", \"0x12d\", \"0x12e\", \"0x13a\", \"0x13b\", \"0x13d\", \"0x13e\", \"0x14a\", \"0x14b\", \"0x14d\", \"0x14e\",\r\n \"0x15a\", \"0x15b\", \"0x15d\", \"0x15e\", \"0x16a\", \"0x16b\", \"0x16d\"]);\r\n\r\n await expect(vs1.addCategorySelector({ selector: { query: { from: \"BisCore:SubCategory\" } } })).to.be.rejectedWith(\"must select from BisCore:Category\");\r\n const cs2 = (await vs1.addCategorySelector({ selector: { query: { from: \"BisCore:Category\" } } }));\r\n expect(cs2).equal(\"@2\");\r\n const cs3 = (await vs1.addCategorySelector({ selector: { query: { from: \"BisCore:Category\", adds: longElementList } } }));\r\n const cs4 = (await vs1.addCategorySelector({ selector: { query: { from: \"BisCore:Category\", removes: [\"0x233\", \"0x21\"], adds: longElementList } } }));\r\n const onlyUsedProps = {\r\n name: \"only used spatial categories\",\r\n selector: {\r\n query: {\r\n from: \"BisCore.Category\",\r\n where: \"ECInstanceId IN (SELECT DISTINCT Category.Id FROM BisCore.GeometricElement3d)\",\r\n },\r\n },\r\n };\r\n await vs1.addCategorySelector(onlyUsedProps);\r\n let selected = vs1.getCategorySelectorSync({ id: cs2 });\r\n expect(selected.categories.length).equal(2);\r\n selected = vs1.getCategorySelectorSync({ id: cs3 });\r\n expect(selected.categories.length).equal(98);\r\n selected = vs1.getCategorySelectorSync({ id: cs4 });\r\n expect(selected.categories.length).equal(97);\r\n selected = vs1.getCategorySelectorSync({ name: onlyUsedProps.name });\r\n expect(selected.categories.length).equal(1);\r\n expect(selected.categories[0]).equal(spatialCategoryId);\r\n\r\n const ms3 = (await vs1.addModelSelector({ name: \"model selector 2\", selector: { query: { from: \"Bis.GeometricModel3d\" } } }));\r\n let selectedModels = vs1.getModelSelectorSync({ id: ms3 });\r\n expect(selectedModels.models.length).equal(2);\r\n const ms4Props = {\r\n name: \"spatial, non-private models\",\r\n selector: {\r\n query: {\r\n from: \"BisCore.GeometricModel3d\",\r\n where: \"IsPrivate=false AND IsTemplate=false AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated=false)\",\r\n },\r\n },\r\n };\r\n\r\n await vs1.addModelSelector(ms4Props);\r\n selectedModels = vs1.getModelSelectorSync({ name: ms4Props.name });\r\n expect(selectedModels.models.length).equal(1);\r\n expect(selectedModels.models[0]).equal(modelId);\r\n\r\n const ds1 = iModel.elements.getElement<DisplayStyle3d>(displayStyleId);\r\n ds1.settings.setPlanProjectionSettings(\"0x1\", PlanProjectionSettings.fromJSON({ elevation: 1 }));\r\n ds1.settings.setPlanProjectionSettings(\"0x2\", PlanProjectionSettings.fromJSON({ elevation: 2 }));\r\n\r\n const styles = (ds1.toJSON() as DisplayStyle3dProps).jsonProperties!.styles!;\r\n styles.subCategoryOvr =\r\n [{\r\n subCategory: spatialCategoryId,\r\n color: ColorByName.fuchsia,\r\n invisible: true,\r\n style: \"0xaaa\",\r\n weight: 10,\r\n transp: 0.5,\r\n },\r\n ];\r\n\r\n styles.excludedElements = CompressedId64Set.sortAndCompress([\"0x8\", \"0x12\", \"0x22\"]);\r\n styles.scheduleScript = [{\r\n modelId: \"0x21\",\r\n realityModelUrl: \"altavista.com\",\r\n elementTimelines: [{\r\n batchId: 64,\r\n elementIds: CompressedId64Set.sortAndCompress([\"0x1a\", \"0x1d\"]),\r\n }, {\r\n batchId: 65,\r\n elementIds: longElementList,\r\n }],\r\n }];\r\n\r\n const ds1Row = await vs1.addDisplayStyle({ className: ds1.classFullName, settings: ds1.toJSON().jsonProperties.styles });\r\n expect(ds1Row).equal(\"@1\");\r\n const ds1out = vs1.getDisplayStyleSync({ id: ds1Row });\r\n expect(ds1out.classFullName).equal(\"BisCore:DisplayStyle3d\");\r\n expect(ds1out.jsonProperties?.styles).deep.equal(JSON.parse(JSON.stringify(styles)));\r\n ds1out.jsonProperties!.styles!.scheduleScript![0].elementTimelines[0].elementIds = CompressedId64Set.sortAndCompress([\"0x11a\", \"0x11d\", \"0x11e\", \"0x12a\"]);\r\n await vs1.updateDisplayStyle({ id: ds1Row, className: ds1.classFullName, settings: ds1out.jsonProperties!.styles! });\r\n const ds1out2 = vs1.getDisplayStyleSync({ id: ds1Row });\r\n expect(ds1out2.jsonProperties?.styles).deep.equal(ds1out.jsonProperties!.styles!);\r\n\r\n const tl1Row = await vs1.addTimeline({ name: \"TestRenderTimeline\", timeline: styles.scheduleScript, owner: \"owner2\" });\r\n expect(tl1Row).equal(\"@1\");\r\n const tl1out = vs1.getTimelineSync({ id: tl1Row });\r\n expect(tl1out.classFullName).equal(\"BisCore:RenderTimeline\");\r\n expect(tl1out.id).equal(tl1Row);\r\n expect(tl1out.code.value).equal(\"TestRenderTimeline\");\r\n expect(tl1out.script).equal(JSON.stringify(styles.scheduleScript));\r\n\r\n const viewDefProps: SpatialViewDefinitionProps = {\r\n ...basicProps,\r\n modelSelectorId: ms1Row,\r\n categorySelectorId: cs1Row,\r\n displayStyleId: ds1Row,\r\n };\r\n\r\n viewDefProps.code = { value: \"TestViewDefinition\", spec: \"0x1\", scope: \"0x1\" };\r\n const v1 = await vs1.addView({ viewDefinition: viewDefProps, tags: [\"big\", \"in progress\", \"done\"] });\r\n expect(v1).equal(\"@1\");\r\n let viewDefOut = vs1.getViewDefinitionSync({ viewId: v1 }) as SpatialViewDefinitionProps;\r\n expect(viewDefOut.code.value).equal(\"TestViewDefinition\");\r\n expect(viewDefOut.classFullName).equal(\"BisCore:SpatialViewDefinition\");\r\n expect(viewDefOut.modelSelectorId).equal(ms1Row);\r\n expect(viewDefOut.categorySelectorId).equal(cs1Row);\r\n expect(viewDefOut.displayStyleId).equal(ds1Row);\r\n expect(viewDefOut.cameraOn).equal(false);\r\n expect(JSON.stringify(viewDefOut.origin)).equal(JSON.stringify(basicProps.origin));\r\n expect(JSON.stringify(viewDefOut.extents)).equal(JSON.stringify(basicProps.extents));\r\n expect(JSON.stringify(viewDefOut.angles)).equal(JSON.stringify(basicProps.angles));\r\n expect(JSON.stringify(viewDefOut.camera)).equal(JSON.stringify(basicProps.camera));\r\n viewDefOut.cameraOn = true;\r\n viewDefOut.origin = [1, 2, 3];\r\n await vs1.updateViewDefinition({ viewId: v1, viewDefinition: viewDefOut });\r\n viewDefOut = vs1.getViewDefinitionSync({ viewId: v1 }) as SpatialViewDefinitionProps;\r\n expect(viewDefOut.cameraOn).equal(true);\r\n expect(JSON.stringify(viewDefOut.origin)).equal(JSON.stringify([1, 2, 3]));\r\n viewDefOut.displayStyleId = \"@2\";\r\n await expect(vs1.updateViewDefinition({ viewId: v1, viewDefinition: viewDefOut })).to.be.rejectedWith(\"invalid Id for displayStyles\");\r\n // add a new display style and uodate the view to use it\r\n viewDefOut.displayStyleId = await vs1.addDisplayStyle({ className: ds1.classFullName, settings: ds1.toJSON().jsonProperties.styles });\r\n await vs1.updateViewDefinition({ viewId: v1, viewDefinition: viewDefOut });\r\n viewDefOut = vs1.getViewDefinitionSync({ viewId: v1 }) as SpatialViewDefinitionProps;\r\n expect(viewDefOut.displayStyleId).equal(\"@2\");\r\n const vinfo = await vs1.getViewInfo({ viewId: v1 });\r\n expect(vinfo?.displayStyleId).equal(viewDefOut.displayStyleId);\r\n viewDefOut.displayStyleId = \"@1\";\r\n await vs1.updateViewDefinition({ viewId: v1, viewDefinition: viewDefOut }); // change it back for sharing test below\r\n\r\n viewDefProps.code.value = \"TestViewDefinition2\";\r\n const v2 = await vs1.addView({ viewDefinition: viewDefProps, tags: [\"big\", \"done\"] });\r\n await vs1.addTagsToView({ viewId: v2, tags: [\"problems\", \"finished\", \"big\"] });\r\n\r\n let tags = vs1.getTagsForView(v2);\r\n expect(tags?.length).equal(4);\r\n expect(tags).includes(\"big\");\r\n expect(tags).includes(\"done\");\r\n await vs1.removeTagFromView({ viewId: v2, tag: \"done\" });\r\n tags = vs1.getTagsForView(v2);\r\n expect(tags).not.includes(\"done\");\r\n expect(tags?.length).equal(3);\r\n\r\n // v1 and v2 share modelselector, categoryselector, and displaystyle so when v2 is deleted they should not be deleted\r\n await vs1.deleteView({ viewId: v2 });\r\n expect(() => vs1.getViewDefinitionSync({ viewId: v2 })).throws(\"View not found\");\r\n expect(vs1.getDisplayStyleRow(1)).not.undefined;\r\n expect(vs1.getModelSelectorRow(1)).not.undefined;\r\n expect(vs1.getCategorySelectorRow(1)).not.undefined;\r\n\r\n // the categoryselector, and displaystyle are no longer shared, so they should be deleted when v1 is deleted\r\n await vs1.deleteView({ viewId: v1 });\r\n expect(() => vs1.getViewDefinitionSync({ viewId: v1 })).throws(\"View not found\");\r\n expect(vs1.getDisplayStyleRow(1)).undefined;\r\n expect(vs1.getCategorySelectorRow(1)).undefined;\r\n expect(vs1.getModelSelectorRow(1)).not.undefined; // modelselector has a name so it should not be deleted\r\n\r\n // attempt to create a ViewDefinition element with invalid properties\r\n assert.throws(() => iModel.elements.createElement({ ...basicProps, modelSelectorId, categorySelectorId } as ElementProps), IModelError, \"displayStyleId is invalid\");\r\n assert.throws(() => iModel.elements.createElement({ ...basicProps, categorySelectorId, displayStyleId } as ElementProps), IModelError, \"modelSelectorId is invalid\");\r\n assert.throws(() => iModel.elements.createElement({ ...basicProps, modelSelectorId, displayStyleId } as ElementProps), IModelError, \"categorySelectorId is invalid\");\r\n\r\n // attempt to insert a ViewDefinition with invalid properties\r\n assert.throws(() => iModel.elements.insertElement({ ...basicProps, modelSelectorId, categorySelectorId, displayStyleId: modelId } as ElementProps), \"invalid displayStyle\");\r\n assert.throws(() => iModel.elements.insertElement({ ...basicProps, modelSelectorId: modelId, displayStyleId, categorySelectorId } as ElementProps), \"invalid modelSelector\");\r\n assert.throws(() => iModel.elements.insertElement({ ...basicProps, modelSelectorId, categorySelectorId: modelId, displayStyleId } as ElementProps), \"invalid categorySelector\");\r\n\r\n // Better way to create and insert\r\n const props: SpatialViewDefinitionProps = { ...basicProps, modelSelectorId, categorySelectorId, displayStyleId };\r\n const viewDefinition = iModel.elements.createElement<SpatialViewDefinition>(props);\r\n const viewDefinitionId = iModel.elements.insertElement(viewDefinition.toJSON());\r\n assert.isNotEmpty(viewDefinitionId);\r\n assert.isTrue(Id64.isValid(viewDefinitionId));\r\n\r\n // Best way to create and insert\r\n SpatialViewDefinition.insertWithCamera(iModel, IModel.dictionaryId, \"default\", modelSelectorId, categorySelectorId, displayStyleId, iModel.projectExtents);\r\n });\r\n});\r\n"]}
|
|
1
|
+
{"version":3,"file":"ViewDefinition.test.js","sourceRoot":"","sources":["../../../../src/test/standalone/ViewDefinition.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAc,IAAI,EAAc,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtG,OAAO,EACL,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAqC,MAAM,EAAE,WAAW,EAAE,sBAAsB,EACnH,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB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AI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAC5B,CAAC;YACJ,CAAC,EAAE,WAAW,EAAE,wBAAwB,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { assert, expect } from \"chai\";\r\nimport { join } from \"path\";\r\nimport { CompressedId64Set, Guid, GuidString, Id64, Id64String, OpenMode } from \"@itwin/core-bentley\";\r\nimport {\r\n Camera, Code, ColorByName, ColorDef, DisplayStyle3dProps, ElementProps, IModel, IModelError, PlanProjectionSettings, SpatialViewDefinitionProps,\r\n SubCategoryAppearance,\r\n} from \"@itwin/core-common\";\r\nimport { Matrix3d, Range2d, Range3d, StandardViewIndex, Transform, YawPitchRollAngles } from \"@itwin/core-geometry\";\r\nimport {\r\n CategorySelector, DefinitionModel, DictionaryModel, DisplayStyle2d, DisplayStyle3d, DrawingCategory, DrawingViewDefinition, IModelDb, ModelSelector, SpatialCategory, SpatialViewDefinition, StandaloneDb, Subject, ViewStore,\r\n} from \"../../core-backend\";\r\nimport { IModelTestUtils } from \"../IModelTestUtils\";\r\nimport { KnownTestLocations } from \"../KnownTestLocations\";\r\n\r\nfunction createNewModelAndCategory(rwIModel: IModelDb) {\r\n const modelId = IModelTestUtils.createAndInsertPhysicalPartitionAndModel(rwIModel, IModelTestUtils.getUniqueModelCode(rwIModel, \"newPhysicalModel\"))[1];\r\n const modelId2 = IModelTestUtils.createAndInsertPhysicalPartitionAndModel(rwIModel, IModelTestUtils.getUniqueModelCode(rwIModel, \"PhysicalModel2\"), true)[1];\r\n const dictionary: DictionaryModel = rwIModel.models.getModel<DictionaryModel>(IModel.dictionaryId);\r\n const newCategoryCode = IModelTestUtils.getUniqueSpatialCategoryCode(dictionary, \"TestSpatialCategory\");\r\n const category = SpatialCategory.create(rwIModel, IModel.dictionaryId, newCategoryCode.value);\r\n const spatialCategoryId = category.insert();\r\n category.setDefaultAppearance(new SubCategoryAppearance({ color: 0xff0000 }));\r\n\r\n newCategoryCode.value = \"spatial category 2\";\r\n SpatialCategory.create(rwIModel, IModel.dictionaryId, newCategoryCode.value).insert();\r\n\r\n rwIModel.elements.insertElement(IModelTestUtils.createPhysicalObject(rwIModel, modelId2, spatialCategoryId).toJSON());\r\n\r\n return { modelId, modelId2, spatialCategoryId };\r\n}\r\n\r\n// cspell:disable\r\n\r\nlet vs1: ViewStore.ViewDb;\r\n\r\ndescribe(\"ViewDefinition\", () => {\r\n // to simulate elements with guids without having to add elements to the iModel\r\n class FakeGuids {\r\n private _ids = new Map<Id64String, GuidString>();\r\n private _guids = new Map<GuidString, Id64String>();\r\n private add(id: Id64String, guid: GuidString) {\r\n this._ids.set(id, guid);\r\n this._guids.set(guid, id);\r\n return guid;\r\n }\r\n public getFederationGuidFromId(id: Id64String): GuidString | undefined {\r\n return this._ids.get(id) ?? this.add(id, Guid.createValue());\r\n }\r\n public getIdFromFederationGuid(guid?: GuidString): Id64String | undefined {\r\n return guid ? this._guids.get(guid) : undefined;\r\n }\r\n }\r\n\r\n let iModel: StandaloneDb;\r\n before(() => {\r\n iModel = StandaloneDb.createEmpty(IModelTestUtils.prepareOutputFile(\"ViewDefinition\", \"ViewDefinition.bim\"), {\r\n rootSubject: { name: \"ViewDefinition tests\", description: \"ViewDefinition tests\" },\r\n client: \"ViewDefinition\",\r\n globalOrigin: { x: 0, y: 0 },\r\n projectExtents: { low: { x: -500, y: -500, z: -50 }, high: { x: 500, y: 500, z: 50 } },\r\n guid: Guid.createValue(),\r\n });\r\n\r\n const dbName = join(KnownTestLocations.outputDir, \"viewDefTest.db\");\r\n ViewStore.ViewDb.createNewDb(dbName);\r\n vs1 = new ViewStore.ViewDb({ iModel, guidMap: new FakeGuids() });\r\n vs1.openDb(dbName, OpenMode.ReadWrite);\r\n });\r\n\r\n after(() => {\r\n iModel.abandonChanges();\r\n iModel.close();\r\n vs1.closeDb(true);\r\n });\r\n\r\n it(\"SpatialViewDefinition\", async () => {\r\n const { modelId, modelId2, spatialCategoryId } = createNewModelAndCategory(iModel);\r\n const displayStyleId = DisplayStyle3d.insert(iModel, IModel.dictionaryId, \"default\", { backgroundColor: ColorDef.fromString(\"rgb(255,0,0)\") });\r\n const modelSelectorId = ModelSelector.insert(iModel, IModel.dictionaryId, \"default\", [modelId, modelId2]);\r\n const categorySelectorId = CategorySelector.insert(iModel, IModel.dictionaryId, \"default\", [spatialCategoryId]);\r\n iModel.saveChanges(\"Basic setup\");\r\n\r\n const standardView = StandardViewIndex.Iso;\r\n const rotation = Matrix3d.createStandardWorldToView(standardView);\r\n const angles = YawPitchRollAngles.createFromMatrix3d(rotation);\r\n const rotationTransform = Transform.createOriginAndMatrix(undefined, rotation);\r\n const range = new Range3d(1, 1, 1, 8, 8, 8);\r\n const rotatedRange = rotationTransform.multiplyRange(range);\r\n const basicProps = {\r\n code: Code.createEmpty(),\r\n model: IModel.dictionaryId,\r\n classFullName: \"BisCore:SpatialViewDefinition\",\r\n cameraOn: false,\r\n origin: rotation.multiplyTransposeXYZ(rotatedRange.low.x, rotatedRange.low.y, rotatedRange.low.z),\r\n extents: rotatedRange.diagonal(),\r\n angles,\r\n camera: new Camera(),\r\n };\r\n\r\n const ms1 = iModel.elements.getElement<ModelSelector>(modelSelectorId);\r\n const ms1Row = await vs1.addModelSelector({ name: ms1.code.value, selector: { ids: ms1.models } });\r\n expect(ms1Row).equal(\"@1\");\r\n let ms1out = vs1.getModelSelectorSync({ id: ms1Row });\r\n expect(ms1out.classFullName).equal(\"BisCore:ModelSelector\");\r\n expect(ms1out.models.length).equal(2);\r\n expect(ms1out.models[0]).equal(modelId);\r\n expect(ms1out.models[1]).equal(modelId2);\r\n ms1out.models.push(\"0x123\");\r\n await vs1.updateModelSelector({ id: ms1Row, selector: { ids: ms1out.models } });\r\n ms1out = vs1.getModelSelectorSync({ id: ms1Row });\r\n expect(ms1out.models.length).equal(3);\r\n expect(ms1out.models[2]).equal(\"0x123\");\r\n\r\n const cs1 = iModel.elements.getElement<CategorySelector>(categorySelectorId);\r\n const cs1Row = await vs1.addCategorySelector({ selector: { ids: cs1.categories } });\r\n expect(cs1Row).equal(\"@1\");\r\n let cs1out = vs1.getCategorySelectorSync({ id: cs1Row });\r\n expect(cs1out.classFullName).equal(\"BisCore:CategorySelector\");\r\n expect(cs1out.categories.length).equal(1);\r\n expect(cs1out.categories[0]).equal(spatialCategoryId);\r\n cs1out.categories.push(\"0x1234\");\r\n await vs1.updateCategorySelector({ id: cs1Row, selector: { ids: cs1out.categories } });\r\n cs1out = vs1.getCategorySelectorSync({ id: cs1Row });\r\n expect(cs1out.categories.length).equal(2);\r\n expect(cs1out.categories[1]).equal(\"0x1234\");\r\n\r\n const longElementList = CompressedId64Set.sortAndCompress([\"0x2a\", \"0x2b\", \"0x2d\", \"0x2e\", \"0x43\", \"0x1a\", \"0x1d\", \"0x12\", \"0x22\",\r\n \"0x8\", \"0x21\", \"0x1b\", \"0x1c\", \"0x1e\", \"0x1f\", \"0x2c\", \"0x2f\", \"0x3a\", \"0x3b\", \"0x3d\", \"0x3e\", \"0x43\",\r\n \"0x4a\", \"0x4b\", \"0x4d\", \"0x4e\", \"0x5a\", \"0x5b\", \"0x5d\", \"0x5e\", \"0x6a\", \"0x6b\", \"0x6d\", \"0x6e\", \"0x7a\",\r\n \"0x7b\", \"0x7d\", \"0x7e\", \"0x8a\", \"0x8b\", \"0x8d\", \"0x8e\", \"0x9a\", \"0x9b\", \"0x9d\", \"0x9e\", \"0xaa\", \"0xab\", \"0xad\",\r\n \"0xae\", \"0xba\", \"0xbb\", \"0xbd\", \"0xbe\", \"0xf5ca\", \"0xcb\", \"0xcd\", \"0xce\", \"0xda\", \"0xdb\", \"0xdd\", \"0xde\", \"0xea\",\r\n \"0xeb\", \"0xed\", \"0xee\", \"0xfa\", \"0xfb\", \"0xfd\", \"0xfe\", \"0x10a\", \"0x10b\", \"0x10d\", \"0x10e\", \"0x11a\", \"0x11b\", \"0x11d\",\r\n \"0x11e\", \"0x12a\", \"0x12b\", \"0x12d\", \"0x12e\", \"0x13a\", \"0x13b\", \"0x13d\", \"0x13e\", \"0x14a\", \"0x14b\", \"0x14d\", \"0x14e\",\r\n \"0x15a\", \"0x15b\", \"0x15d\", \"0x15e\", \"0x16a\", \"0x16b\", \"0x16d\"]);\r\n\r\n await expect(vs1.addCategorySelector({ selector: { query: { from: \"BisCore:SubCategory\" } } })).to.be.rejectedWith(\"must select from BisCore:Category\");\r\n const cs2 = (await vs1.addCategorySelector({ selector: { query: { from: \"BisCore:Category\" } } }));\r\n expect(cs2).equal(\"@2\");\r\n const cs3 = (await vs1.addCategorySelector({ selector: { query: { from: \"BisCore:Category\", adds: longElementList } } }));\r\n const cs4 = (await vs1.addCategorySelector({ selector: { query: { from: \"BisCore:Category\", removes: [\"0x233\", \"0x21\"], adds: longElementList } } }));\r\n const onlyUsedProps = {\r\n name: \"only used spatial categories\",\r\n selector: {\r\n query: {\r\n from: \"BisCore.Category\",\r\n where: \"ECInstanceId IN (SELECT DISTINCT Category.Id FROM BisCore.GeometricElement3d)\",\r\n },\r\n },\r\n };\r\n await vs1.addCategorySelector(onlyUsedProps);\r\n let selected = vs1.getCategorySelectorSync({ id: cs2 });\r\n expect(selected.categories.length).equal(2);\r\n selected = vs1.getCategorySelectorSync({ id: cs3 });\r\n expect(selected.categories.length).equal(98);\r\n selected = vs1.getCategorySelectorSync({ id: cs4 });\r\n expect(selected.categories.length).equal(97);\r\n selected = vs1.getCategorySelectorSync({ name: onlyUsedProps.name });\r\n expect(selected.categories.length).equal(1);\r\n expect(selected.categories[0]).equal(spatialCategoryId);\r\n\r\n const ms3 = (await vs1.addModelSelector({ name: \"model selector 2\", selector: { query: { from: \"Bis.GeometricModel3d\" } } }));\r\n let selectedModels = vs1.getModelSelectorSync({ id: ms3 });\r\n expect(selectedModels.models.length).equal(2);\r\n const ms4Props = {\r\n name: \"spatial, non-private models\",\r\n selector: {\r\n query: {\r\n from: \"BisCore.GeometricModel3d\",\r\n where: \"IsPrivate=false AND IsTemplate=false AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated=false)\",\r\n },\r\n },\r\n };\r\n\r\n await vs1.addModelSelector(ms4Props);\r\n selectedModels = vs1.getModelSelectorSync({ name: ms4Props.name });\r\n expect(selectedModels.models.length).equal(1);\r\n expect(selectedModels.models[0]).equal(modelId);\r\n\r\n const ds1 = iModel.elements.getElement<DisplayStyle3d>(displayStyleId);\r\n ds1.settings.setPlanProjectionSettings(\"0x1\", PlanProjectionSettings.fromJSON({ elevation: 1 }));\r\n ds1.settings.setPlanProjectionSettings(\"0x2\", PlanProjectionSettings.fromJSON({ elevation: 2 }));\r\n\r\n const styles = (ds1.toJSON() as DisplayStyle3dProps).jsonProperties!.styles!;\r\n styles.subCategoryOvr =\r\n [{\r\n subCategory: spatialCategoryId,\r\n color: ColorByName.fuchsia,\r\n invisible: true,\r\n style: \"0xaaa\",\r\n weight: 10,\r\n transp: 0.5,\r\n },\r\n ];\r\n\r\n styles.excludedElements = CompressedId64Set.sortAndCompress([\"0x8\", \"0x12\", \"0x22\"]);\r\n styles.scheduleScript = [{\r\n modelId: \"0x21\",\r\n realityModelUrl: \"altavista.com\",\r\n elementTimelines: [{\r\n batchId: 64,\r\n elementIds: CompressedId64Set.sortAndCompress([\"0x1a\", \"0x1d\"]),\r\n }, {\r\n batchId: 65,\r\n elementIds: longElementList,\r\n }],\r\n }];\r\n\r\n const ds1Row = await vs1.addDisplayStyle({ className: ds1.classFullName, settings: ds1.toJSON().jsonProperties.styles });\r\n expect(ds1Row).equal(\"@1\");\r\n const ds1out = vs1.getDisplayStyleSync({ id: ds1Row });\r\n expect(ds1out.classFullName).equal(\"BisCore:DisplayStyle3d\");\r\n expect(ds1out.jsonProperties?.styles).deep.equal(JSON.parse(JSON.stringify(styles)));\r\n ds1out.jsonProperties!.styles!.scheduleScript![0].elementTimelines[0].elementIds = CompressedId64Set.sortAndCompress([\"0x11a\", \"0x11d\", \"0x11e\", \"0x12a\"]);\r\n await vs1.updateDisplayStyle({ id: ds1Row, className: ds1.classFullName, settings: ds1out.jsonProperties!.styles! });\r\n const ds1out2 = vs1.getDisplayStyleSync({ id: ds1Row });\r\n expect(ds1out2.jsonProperties?.styles).deep.equal(ds1out.jsonProperties!.styles!);\r\n\r\n const tl1Row = await vs1.addTimeline({ name: \"TestRenderTimeline\", timeline: styles.scheduleScript, owner: \"owner2\" });\r\n expect(tl1Row).equal(\"@1\");\r\n const tl1out = vs1.getTimelineSync({ id: tl1Row });\r\n expect(tl1out.classFullName).equal(\"BisCore:RenderTimeline\");\r\n expect(tl1out.id).equal(tl1Row);\r\n expect(tl1out.code.value).equal(\"TestRenderTimeline\");\r\n expect(tl1out.script).equal(JSON.stringify(styles.scheduleScript));\r\n\r\n const viewDefProps: SpatialViewDefinitionProps = {\r\n ...basicProps,\r\n modelSelectorId: ms1Row,\r\n categorySelectorId: cs1Row,\r\n displayStyleId: ds1Row,\r\n };\r\n\r\n viewDefProps.code = { value: \"TestViewDefinition\", spec: \"0x1\", scope: \"0x1\" };\r\n const v1 = await vs1.addView({ viewDefinition: viewDefProps, tags: [\"big\", \"in progress\", \"done\"] });\r\n expect(v1).equal(\"@1\");\r\n let viewDefOut = vs1.getViewDefinitionSync({ viewId: v1 }) as SpatialViewDefinitionProps;\r\n expect(viewDefOut.code.value).equal(\"TestViewDefinition\");\r\n expect(viewDefOut.classFullName).equal(\"BisCore:SpatialViewDefinition\");\r\n expect(viewDefOut.modelSelectorId).equal(ms1Row);\r\n expect(viewDefOut.categorySelectorId).equal(cs1Row);\r\n expect(viewDefOut.displayStyleId).equal(ds1Row);\r\n expect(viewDefOut.cameraOn).equal(false);\r\n expect(JSON.stringify(viewDefOut.origin)).equal(JSON.stringify(basicProps.origin));\r\n expect(JSON.stringify(viewDefOut.extents)).equal(JSON.stringify(basicProps.extents));\r\n expect(JSON.stringify(viewDefOut.angles)).equal(JSON.stringify(basicProps.angles));\r\n expect(JSON.stringify(viewDefOut.camera)).equal(JSON.stringify(basicProps.camera));\r\n viewDefOut.cameraOn = true;\r\n viewDefOut.origin = [1, 2, 3];\r\n await vs1.updateViewDefinition({ viewId: v1, viewDefinition: viewDefOut });\r\n viewDefOut = vs1.getViewDefinitionSync({ viewId: v1 }) as SpatialViewDefinitionProps;\r\n expect(viewDefOut.cameraOn).equal(true);\r\n expect(JSON.stringify(viewDefOut.origin)).equal(JSON.stringify([1, 2, 3]));\r\n viewDefOut.displayStyleId = \"@2\";\r\n await expect(vs1.updateViewDefinition({ viewId: v1, viewDefinition: viewDefOut })).to.be.rejectedWith(\"invalid Id for displayStyles\");\r\n // add a new display style and uodate the view to use it\r\n viewDefOut.displayStyleId = await vs1.addDisplayStyle({ className: ds1.classFullName, settings: ds1.toJSON().jsonProperties.styles });\r\n await vs1.updateViewDefinition({ viewId: v1, viewDefinition: viewDefOut });\r\n viewDefOut = vs1.getViewDefinitionSync({ viewId: v1 }) as SpatialViewDefinitionProps;\r\n expect(viewDefOut.displayStyleId).equal(\"@2\");\r\n const vinfo = await vs1.getViewInfo({ viewId: v1 });\r\n expect(vinfo?.displayStyleId).equal(viewDefOut.displayStyleId);\r\n viewDefOut.displayStyleId = \"@1\";\r\n await vs1.updateViewDefinition({ viewId: v1, viewDefinition: viewDefOut }); // change it back for sharing test below\r\n\r\n viewDefProps.code.value = \"TestViewDefinition2\";\r\n const v2 = await vs1.addView({ viewDefinition: viewDefProps, tags: [\"big\", \"done\"] });\r\n await vs1.addTagsToView({ viewId: v2, tags: [\"problems\", \"finished\", \"big\"] });\r\n\r\n let tags = vs1.getTagsForView(v2);\r\n expect(tags?.length).equal(4);\r\n expect(tags).includes(\"big\");\r\n expect(tags).includes(\"done\");\r\n await vs1.removeTagFromView({ viewId: v2, tag: \"done\" });\r\n tags = vs1.getTagsForView(v2);\r\n expect(tags).not.includes(\"done\");\r\n expect(tags?.length).equal(3);\r\n\r\n // v1 and v2 share modelselector, categoryselector, and displaystyle so when v2 is deleted they should not be deleted\r\n await vs1.deleteView({ viewId: v2 });\r\n expect(() => vs1.getViewDefinitionSync({ viewId: v2 })).throws(\"View not found\");\r\n expect(vs1.getDisplayStyleRow(1)).not.undefined;\r\n expect(vs1.getModelSelectorRow(1)).not.undefined;\r\n expect(vs1.getCategorySelectorRow(1)).not.undefined;\r\n\r\n // the categoryselector, and displaystyle are no longer shared, so they should be deleted when v1 is deleted\r\n await vs1.deleteView({ viewId: v1 });\r\n expect(() => vs1.getViewDefinitionSync({ viewId: v1 })).throws(\"View not found\");\r\n expect(vs1.getDisplayStyleRow(1)).undefined;\r\n expect(vs1.getCategorySelectorRow(1)).undefined;\r\n expect(vs1.getModelSelectorRow(1)).not.undefined; // modelselector has a name so it should not be deleted\r\n\r\n // attempt to create a ViewDefinition element with invalid properties\r\n assert.throws(() => iModel.elements.createElement({ ...basicProps, modelSelectorId, categorySelectorId } as ElementProps), IModelError, \"displayStyleId is invalid\");\r\n assert.throws(() => iModel.elements.createElement({ ...basicProps, categorySelectorId, displayStyleId } as ElementProps), IModelError, \"modelSelectorId is invalid\");\r\n assert.throws(() => iModel.elements.createElement({ ...basicProps, modelSelectorId, displayStyleId } as ElementProps), IModelError, \"categorySelectorId is invalid\");\r\n\r\n // attempt to insert a ViewDefinition with invalid properties\r\n assert.throws(() => iModel.elements.insertElement({ ...basicProps, modelSelectorId, categorySelectorId, displayStyleId: modelId } as ElementProps), \"invalid displayStyle\");\r\n assert.throws(() => iModel.elements.insertElement({ ...basicProps, modelSelectorId: modelId, displayStyleId, categorySelectorId } as ElementProps), \"invalid modelSelector\");\r\n assert.throws(() => iModel.elements.insertElement({ ...basicProps, modelSelectorId, categorySelectorId: modelId, displayStyleId } as ElementProps), \"invalid categorySelector\");\r\n\r\n // Better way to create and insert\r\n const props: SpatialViewDefinitionProps = { ...basicProps, modelSelectorId, categorySelectorId, displayStyleId };\r\n const viewDefinition = iModel.elements.createElement<SpatialViewDefinition>(props);\r\n const viewDefinitionId = iModel.elements.insertElement(viewDefinition.toJSON());\r\n assert.isNotEmpty(viewDefinitionId);\r\n assert.isTrue(Id64.isValid(viewDefinitionId));\r\n\r\n // Best way to create and insert\r\n SpatialViewDefinition.insertWithCamera(iModel, IModel.dictionaryId, \"default\", modelSelectorId, categorySelectorId, displayStyleId, iModel.projectExtents);\r\n });\r\n\r\n describe(\"DrawingViewDefinition\", () => {\r\n it(\"fails on insert without a valid baseModelId\", () => {\r\n const subjectId = Subject.insert(\r\n iModel,\r\n IModel.rootSubjectId,\r\n \"Subject\",\r\n \"Subject Description\"\r\n );\r\n const definitionModelId = DefinitionModel.insert(\r\n iModel,\r\n subjectId,\r\n \"Definition\"\r\n );\r\n const drawingCategoryId = DrawingCategory.insert(\r\n iModel,\r\n definitionModelId,\r\n \"DrawingCategory\",\r\n new SubCategoryAppearance()\r\n );\r\n const drawingCategorySelectorId = CategorySelector.insert(\r\n iModel,\r\n definitionModelId,\r\n \"DrawingCategories\",\r\n [drawingCategoryId]\r\n );\r\n const displayStyle2dId = DisplayStyle2d.insert(\r\n iModel,\r\n definitionModelId,\r\n \"DisplayStyle2d\"\r\n );\r\n\r\n assert.throws(() => {\r\n DrawingViewDefinition.insert(\r\n iModel,\r\n definitionModelId,\r\n \"Drawing View\",\r\n \"0\",\r\n drawingCategorySelectorId,\r\n displayStyle2dId,\r\n new Range2d(0, 0, 100, 100)\r\n );\r\n }, IModelError, \"baseModelId is invalid\");\r\n });\r\n });\r\n});\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-backend",
|
|
3
|
-
"version": "5.7.0-dev.
|
|
3
|
+
"version": "5.7.0-dev.13",
|
|
4
4
|
"description": "iTwin.js backend components",
|
|
5
5
|
"main": "lib/cjs/core-backend.js",
|
|
6
6
|
"module": "lib/esm/core-backend.js",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@opentelemetry/api": "^1.0.4",
|
|
30
|
-
"@itwin/core-bentley": "5.7.0-dev.
|
|
31
|
-
"@itwin/core-common": "5.7.0-dev.
|
|
32
|
-
"@itwin/
|
|
33
|
-
"@itwin/
|
|
30
|
+
"@itwin/core-bentley": "5.7.0-dev.13",
|
|
31
|
+
"@itwin/core-common": "5.7.0-dev.13",
|
|
32
|
+
"@itwin/ecschema-metadata": "5.7.0-dev.13",
|
|
33
|
+
"@itwin/core-geometry": "5.7.0-dev.13"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|
|
36
36
|
"@opentelemetry/api": {
|
|
@@ -77,14 +77,14 @@
|
|
|
77
77
|
"marked": "^14.1.3",
|
|
78
78
|
"sql-formatter": "^15.4.6",
|
|
79
79
|
"webpack": "^5.97.1",
|
|
80
|
-
"@itwin/
|
|
81
|
-
"@itwin/
|
|
82
|
-
"@itwin/
|
|
83
|
-
"@itwin/core-common": "5.7.0-dev.
|
|
84
|
-
"@itwin/
|
|
85
|
-
"@itwin/ecschema-metadata": "5.7.0-dev.
|
|
86
|
-
"
|
|
87
|
-
"
|
|
80
|
+
"@itwin/ecschema-locaters": "5.7.0-dev.13",
|
|
81
|
+
"@itwin/build-tools": "5.7.0-dev.13",
|
|
82
|
+
"@itwin/core-geometry": "5.7.0-dev.13",
|
|
83
|
+
"@itwin/core-common": "5.7.0-dev.13",
|
|
84
|
+
"@itwin/core-bentley": "5.7.0-dev.13",
|
|
85
|
+
"@itwin/ecschema-metadata": "5.7.0-dev.13",
|
|
86
|
+
"@itwin/ecsql-common": "5.7.0-dev.13",
|
|
87
|
+
"internal-tools": "3.0.0-dev.69"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@bentley/imodeljs-native": "5.7.5",
|