@itwin/core-backend 4.6.0-dev.9 → 4.7.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -1
- package/lib/cjs/BackendHubAccess.js +1 -1
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js +1 -1
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
- package/lib/cjs/BisCoreSchema.js +2 -0
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.js +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.js +2 -2
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/Category.d.ts +1 -1
- package/lib/cjs/Category.js +1 -1
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +3 -3
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangedElementsManager.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +239 -239
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChannelControl.js +2 -2
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.js +4 -4
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts +3 -0
- package/lib/cjs/ClassRegistry.d.ts.map +1 -1
- package/lib/cjs/ClassRegistry.js +24 -13
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.js +1 -1
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js +1 -1
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.js +1 -1
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.js +2 -2
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.js +1 -1
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +0 -16
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +7 -23
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.js +1 -1
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.d.ts +0 -3
- package/lib/cjs/ElementGraphics.d.ts.map +1 -1
- package/lib/cjs/ElementGraphics.js +2 -5
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
- package/lib/cjs/ElementTreeWalker.js +5 -0
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.js +1 -1
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.d.ts +1 -1
- package/lib/cjs/ExportGraphics.js +2 -2
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.js +1 -1
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeometrySummary.js +47 -47
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/HubMock.js +1 -1
- package/lib/cjs/HubMock.js.map +1 -1
- package/lib/cjs/IModelCloneContext.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +8 -2
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +70 -29
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.js +2 -2
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/IpcHost.js +1 -1
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.d.ts +1 -1
- package/lib/cjs/LineStyle.js +2 -2
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.js +1 -1
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/Material.js +1 -1
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.js +1 -1
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.js +1 -1
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.js +21 -21
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.d.ts +0 -3
- package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
- package/lib/cjs/PromiseMemoizer.js +2 -5
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.js +2 -2
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.js +1 -1
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.js +1 -1
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/SqliteStatement.js +2 -2
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/TextAnnotationElement.d.ts +54 -0
- package/lib/cjs/TextAnnotationElement.d.ts.map +1 -0
- package/lib/cjs/TextAnnotationElement.js +94 -0
- package/lib/cjs/TextAnnotationElement.js.map +1 -0
- package/lib/cjs/TextAnnotationGeometry.d.ts +28 -0
- package/lib/cjs/TextAnnotationGeometry.d.ts.map +1 -0
- package/lib/cjs/TextAnnotationGeometry.js +154 -0
- package/lib/cjs/TextAnnotationGeometry.js.map +1 -0
- package/lib/cjs/TextAnnotationLayout.d.ts +124 -0
- package/lib/cjs/TextAnnotationLayout.d.ts.map +1 -0
- package/lib/cjs/TextAnnotationLayout.js +399 -0
- package/lib/cjs/TextAnnotationLayout.js.map +1 -0
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +53 -1
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.js +4 -4
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.d.ts +1 -0
- package/lib/cjs/ViewStateHydrator.d.ts.map +1 -1
- package/lib/cjs/ViewStateHydrator.js +1 -0
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.js +1 -1
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
- package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +44 -44
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
- package/lib/cjs/assets/Settings/backend.setting.json5 +132 -132
- package/lib/cjs/core-backend.d.ts +46 -61
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +46 -61
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js +1 -1
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.js +2 -2
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/logging.js +2 -2
- package/lib/cjs/rpc/web/logging.js.map +1 -1
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc/web/response.js +1 -1
- package/lib/cjs/rpc/web/response.js.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.js +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.d.ts +0 -5
- package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js +1 -10
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.js +4 -4
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportGraphics.js","sourceRoot":"","sources":["../../src/ExportGraphics.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoE;AACpE,wDAAgG;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a;QACvD,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACxD,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM;YACzD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM;YACzD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACzD,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM;YAC5D,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC;CAEF;AA5ID,8DA4IC","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 iModels\r\n */\r\n\r\nimport { assert, Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport { IndexedPolyface, Polyface, PolyfaceData, PolyfaceVisitor } from \"@itwin/core-geometry\";\r\nimport { ColorDefProps, GeometryClass } from \"@itwin/core-common\";\r\n\r\n/** A collection of line segments, suitable for direct use with graphics APIs.\r\n * The structure of this data matches GL_LINES in OpenGL.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsLines {\r\n /** Zero-based vertex indices, every two indices represent a line segment */\r\n indices: Int32Array;\r\n /** Vertices for these lines, laid out in the pattern XYZXYZ */\r\n points: Float64Array;\r\n}\r\n\r\n/** Info provided to ExportLinesFunction about linework graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportLinesInfo {\r\n /** The element ID for the element the graphics originated from */\r\n elementId: Id64String;\r\n /** ID for the [SubCategory]($core-backend) for these graphics */\r\n subCategory: Id64String;\r\n /** The color and transparency for these graphics */\r\n color: ColorDefProps;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** The linework for these graphics */\r\n lines: ExportGraphicsLines;\r\n}\r\n\r\n/** A callback function that receives generated line graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportLinesFunction = (info: ExportLinesInfo) => void;\r\n\r\n/** A triangulated mesh with unified indices, suitable for direct use with graphics APIs.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsMesh {\r\n /** Zero-based vertex indices, every three indices represent a triangle */\r\n indices: Int32Array;\r\n /** Vertices for this mesh, laid out in the pattern XYZXYZ */\r\n points: Float64Array;\r\n /** Normals for this mesh, laid out in the pattern XYZXYZ */\r\n normals: Float32Array;\r\n /** Parameters (uvs) for this mesh, laid out in the pattern XYXY */\r\n params: Float32Array;\r\n /** If true, clients should assume both sides of the mesh are visible and not cull backfaces. */\r\n isTwoSided: boolean;\r\n}\r\n\r\n/** Info provided to ExportGraphicsFunction about graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsInfo {\r\n /** The element ID for the element the graphics originated from */\r\n elementId: Id64String;\r\n /** ID for the [SubCategory]($core-backend) for these graphics */\r\n subCategory: Id64String;\r\n /** The color and transparency for these graphics */\r\n color: ColorDefProps;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\r\n materialId?: Id64String;\r\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\r\n textureId?: Id64String;\r\n /** The mesh for these graphics */\r\n mesh: ExportGraphicsMesh;\r\n}\r\n\r\n/** Information about the base display properties when a [GeometryPart]($core-backend) was\r\n * referenced. This is intended to be used with [IModelDb.exportPartGraphics]($core-backend).\r\n * * If two ExportPartInstanceInfo have the same ExportPartDisplayInfos, they will result in the\r\n * same graphics (with a different transform).\r\n * * If two ExportPartInstanceInfo have different ExportPartDisplayInfos, they may result in different\r\n * graphics.\r\n * @public\r\n */\r\nexport interface ExportPartDisplayInfo {\r\n categoryId: Id64String;\r\n subCategoryId: Id64String;\r\n geometryClass: GeometryClass;\r\n materialId: Id64String;\r\n elmTransparency: number;\r\n lineColor: number;\r\n}\r\n\r\n/** Information about references to [GeometryPart]($core-backend) elements found during\r\n * a call to [IModelDb.exportGraphics]($core-backend).\r\n * See [IModelDb.exportPartGraphics]($core-backend) for the intended use case.\r\n * @public\r\n */\r\nexport interface ExportPartInstanceInfo {\r\n /** ID for the [GeometryPart]($core-backend) */\r\n partId: Id64String;\r\n /** ID for the element that contained the reference to the [GeometryPart]($core-backend) */\r\n partInstanceId: Id64String;\r\n /** The base display properties when the [GeometryPart]($core-backend) was referenced. */\r\n displayProps: ExportPartDisplayInfo;\r\n /** A row-major storage 4x3 transform for this instance.\r\n * See export-gltf under test-apps in the iTwin.js monorepo for a working reference.\r\n */\r\n transform?: Float64Array;\r\n}\r\n\r\n/** A callback function that receives generated graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportGraphicsFunction = (info: ExportGraphicsInfo) => void;\r\n\r\n/** Parameters for [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsOptions {\r\n /** The source elements for the exported graphics */\r\n elementIdArray: Id64Array;\r\n /** A function to call for each unique element ID, color and texture combination */\r\n onGraphics: ExportGraphicsFunction;\r\n /** An optional function to call if line graphics are desired. */\r\n onLineGraphics?: ExportLinesFunction;\r\n /** If supplied, any references to [GeometryPart]($core-backend) elements found will be\r\n * recorded in this array. In this case, graphics that would result from the GeometryPart\r\n * will not be supplied via onGraphics. See [IModelDb.exportPartGraphics]($core-backend)\r\n */\r\n partInstanceArray?: ExportPartInstanceInfo[];\r\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry).\r\n * If not supplied, defaults to zero and angleTol will control the quality of the resulting mesh.\r\n */\r\n chordTol?: number;\r\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry).\r\n * If not supplied, defaults to PI/12 (15 degrees).\r\n */\r\n angleTol?: number;\r\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry).\r\n * If not supplied, there is no maximum length of an edge. Supplying this value can greatly increase the\r\n * size of the resulting geometry, and should only be done in cases where necessary (if you don't know\r\n * that it's necessary, it's almost certainly not!)\r\n */\r\n maxEdgeLength?: number;\r\n /** The longest dimension of a line style's largest component must be at least this size in order for\r\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\r\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\r\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\r\n * line strings.\r\n */\r\n minLineStyleComponentSize?: number;\r\n /** Max distance between mesh vertices for them to be collapsed.\r\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\r\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\r\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\r\n * anomalies so it is important to choose an appropriate setting for your use case.\r\n */\r\n decimationTol?: number;\r\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\r\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\r\n * like screws and screw holes.\r\n */\r\n minBRepFeatureSize?: number;\r\n}\r\n\r\n/** Info provided to ExportPartFunction about graphics.\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportPartInfo {\r\n /** The color and transparency for these graphics */\r\n color: ColorDefProps;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\r\n materialId?: Id64String;\r\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\r\n textureId?: Id64String;\r\n /** The mesh for these graphics */\r\n mesh: ExportGraphicsMesh;\r\n}\r\n\r\n/** A callback function that receives generated graphics for a [GeometryPart]($core-backend).\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportPartFunction = (info: ExportPartInfo) => void;\r\n\r\n/** Info provided to ExportPartFunction about line graphics.\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportPartLinesInfo {\r\n /** The color and transparency for these graphics */\r\n color: ColorDefProps;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** The linework for these graphics */\r\n lines: ExportGraphicsLines;\r\n}\r\n\r\n/** A callback function that receives generated line graphics for a [GeometryPart]($core-backend).\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportPartLinesFunction = (info: ExportPartLinesInfo) => void;\r\n\r\n/** Parameters for [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportPartGraphicsOptions {\r\n /** The ID for the source [GeometryPart]($core-backend) */\r\n elementId: Id64String;\r\n /** The base display properties to use for generating the graphics. This should come from an\r\n * ExportPartInstanceProps generated by [IModelDb.exportGraphics]($core-backend)\r\n */\r\n displayProps: ExportPartDisplayInfo;\r\n /** A function to call for each unique color and texture combination. */\r\n onPartGraphics: ExportPartFunction;\r\n /** An optional function to call if line graphics are desired. */\r\n onPartLineGraphics?: ExportPartLinesFunction;\r\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry).\r\n * If not supplied, defaults to zero and angleTol will control the quality of the resulting mesh.\r\n */\r\n chordTol?: number;\r\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry).\r\n * If not supplied, defaults to PI/12 (15 degrees).\r\n */\r\n angleTol?: number;\r\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry)\r\n * If not supplied, there is no maximum length of an edge. Supplying this value can greatly increase the\r\n * size of the resulting geometry, and should only be done in cases where necessary (if you don't know\r\n * that it's necessary, it's almost certainly not!)\r\n */\r\n maxEdgeLength?: number;\r\n /** The longest dimension of a line style's largest component must be at least this size in order for\r\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\r\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\r\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\r\n * line strings.\r\n */\r\n minLineStyleComponentSize?: number;\r\n /** Max distance between mesh vertices for them to be collapsed.\r\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\r\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\r\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\r\n * anomalies so it is important to choose an appropriate setting for your use case.\r\n */\r\n decimationTol?: number;\r\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\r\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\r\n * like screws and screw holes.\r\n */\r\n minBRepFeatureSize?: number;\r\n}\r\n\r\n/** Provides utility functions for working with data generated by [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport namespace ExportGraphics {\r\n /** Test if ExportPartDisplayInfos have exactly the same values.\r\n * @public\r\n */\r\n export function arePartDisplayInfosEqual(lhs: ExportPartDisplayInfo, rhs: ExportPartDisplayInfo): boolean {\r\n if (lhs.categoryId !== rhs.categoryId)\r\n return false;\r\n if (lhs.subCategoryId !== rhs.subCategoryId)\r\n return false;\r\n if (lhs.materialId !== rhs.materialId)\r\n return false;\r\n if (lhs.elmTransparency !== rhs.elmTransparency)\r\n return false;\r\n if (lhs.lineColor !== rhs.lineColor)\r\n return false;\r\n return true;\r\n }\r\n\r\n /**\r\n * Convert an ExportGraphicsMesh to an IndexedPolyface usable by the geometry API.\r\n * @note The resulting IndexedPolyface may have duplicate points, normals and params. If problematic, call [PolyfaceData.compress]($core-geometry)\r\n * @public\r\n */\r\n export function convertToIndexedPolyface(mesh: ExportGraphicsMesh): IndexedPolyface {\r\n const polyface = IndexedPolyface.create(true, true, false, mesh.isTwoSided);\r\n\r\n const p: Float64Array = mesh.points;\r\n for (let i = 0; i < p.length; i += 3)\r\n polyface.data.point.pushXYZ(p[i], p[i + 1], p[i + 2]);\r\n\r\n const n: Float32Array = mesh.normals;\r\n assert(undefined !== polyface.data.normal);\r\n for (let i = 0; i < n.length; i += 3)\r\n polyface.data.normal.pushXYZ(n[i], n[i + 1], n[i + 2]);\r\n\r\n const uv: Float32Array = mesh.params;\r\n assert(undefined !== polyface.data.param);\r\n for (let i = 0; i < uv.length; i += 2)\r\n polyface.data.param.pushXY(uv[i], uv[i + 1]);\r\n\r\n const indices = mesh.indices;\r\n const addIndex = (idx: number) => {\r\n polyface.addPointIndex(idx, true);\r\n polyface.addNormalIndex(idx);\r\n polyface.addParamIndex(idx);\r\n };\r\n for (let i = 0; i < indices.length; i += 3) {\r\n addIndex(indices[i]);\r\n addIndex(indices[i + 1]);\r\n addIndex(indices[i + 2]);\r\n polyface.terminateFacet(false);\r\n }\r\n\r\n return polyface;\r\n }\r\n}\r\n/**\r\n * * Iterator to walk the facets of an ExportGraphicsMesh and present them to the world as if visiting a Polyface.\r\n * * Because the ExportGraphicsMesh has limited data:\r\n * * There is no auxData in this visitor.\r\n * * There is no color in this visitor.\r\n * * All edgeVisible are true.\r\n * @public\r\n */\r\nexport class ExportGraphicsMeshVisitor extends PolyfaceData implements PolyfaceVisitor {\r\n private _currentFacetIndex: number;\r\n private _nextFacetIndex: number;\r\n private _numWrap: number;\r\n private _polyface: ExportGraphicsMesh;\r\n // to be called from static factory method that validates the polyface ...\r\n private constructor(facets: ExportGraphicsMesh, numWrap: number) {\r\n super(facets.normals.length > 0, facets.params.length > 0, false, facets.isTwoSided);\r\n this._polyface = facets;\r\n this._numWrap = numWrap;\r\n\r\n this._nextFacetIndex = 0;\r\n this._currentFacetIndex = -1;\r\n this.twoSided = facets.isTwoSided;\r\n this.reset();\r\n }\r\n /** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays\r\n * Typical wrap counts are:\r\n * * 0 -- leave the point arrays with \"missing final edge\"\r\n * * 1 -- add point 0 as closure point\r\n * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.\r\n */\r\n public static create(polyface: ExportGraphicsMesh, numWrap: number): ExportGraphicsMeshVisitor {\r\n return new ExportGraphicsMeshVisitor(polyface, numWrap);\r\n }\r\n /** Reset the iterator to start at the first facet of the polyface. */\r\n public reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.\r\n }\r\n /** Select a facet by simple index. */\r\n public moveToReadIndex(facetIndex: number): boolean {\r\n if (facetIndex < 0 || 2 + facetIndex * 3 >= this._polyface.indices.length)\r\n return false;\r\n this._currentFacetIndex = facetIndex;\r\n this._nextFacetIndex = facetIndex + 1;\r\n this.point.length = 0;\r\n const points = this.point;\r\n points.length = 0;\r\n this.pointIndex.length = 0;\r\n this.point.length = 0;\r\n this.edgeVisible.length = 0;\r\n const sourcePoints = this._polyface.points;\r\n const indices = this._polyface.indices;\r\n const i0 = 3 * facetIndex;\r\n for (let i = i0; i < i0 + 3; i++) {\r\n const k = 3 * indices[i];\r\n this.pointIndex.push(indices[i]);\r\n this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);\r\n this.edgeVisible.push(true);\r\n }\r\n for (let i = 0; i < this._numWrap; i++) {\r\n this.point.pushFromGrowableXYZArray(this.point, i);\r\n }\r\n\r\n const sourceParams = this._polyface.params;\r\n if (sourceParams.length > 0 && this.paramIndex && this.param) {\r\n this.paramIndex.length = 0;\r\n this.param.length = 0;\r\n for (let i = i0; i < i0 + 3; i++) {\r\n const k = 2 * indices[i];\r\n this.paramIndex.push(indices[i]);\r\n this.param.pushXY(sourceParams[k], sourceParams[k + 1]);\r\n }\r\n for (let i = 0; i < this._numWrap; i++) {\r\n this.param.pushFromGrowableXYArray(this.param, i);\r\n }\r\n }\r\n\r\n const sourceNormals = this._polyface.normals;\r\n if (sourceNormals.length > 0 && this.normalIndex && this.normal) {\r\n this.normalIndex.length = 0;\r\n this.normal.length = 0;\r\n for (let i = i0; i < i0 + 3; i++) {\r\n const k = 3 * indices[i];\r\n this.normalIndex.push(indices[i]);\r\n this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);\r\n }\r\n for (let i = 0; i < this._numWrap; i++) {\r\n this.normal.pushFromGrowableXYZArray(this.normal, i);\r\n }\r\n }\r\n return true;\r\n }\r\n public moveToNextFacet(): boolean {\r\n return this.moveToReadIndex(this._nextFacetIndex);\r\n }\r\n /** Set the number of vertices to replicate in visitor arrays. */\r\n public setNumWrap(numWrap: number): void { this._numWrap = numWrap; }\r\n\r\n /** Return the index (in the client polyface) of the current facet */\r\n public currentReadIndex(): number { return this._currentFacetIndex; }\r\n /** Return the point index of vertex i within the currently loaded facet */\r\n public clientPointIndex(i: number): number { return this.pointIndex[i]; }\r\n /** Return the param index of vertex i within the currently loaded facet.\r\n * Use the artificial paramIndex, which matches pointIndex.\r\n */\r\n public clientParamIndex(i: number): number { return this.paramIndex ? this.paramIndex[i] : -1; }\r\n /** Return the normal index of vertex i within the currently loaded facet.\r\n * Use the artificial paramIndex, which matches pointIndex.\r\n */\r\n public clientNormalIndex(i: number): number { return this.normalIndex ? this.normalIndex[i] : -1; }\r\n /** Return the color index of vertex i within the currently loaded facet */\r\n public clientColorIndex(_i: number): number { return 1; }\r\n /** Return the aux data index of vertex i within the currently loaded facet */\r\n public clientAuxIndex(_i: number): number { return -1; }\r\n\r\n /** return the client polyface */\r\n public clientPolyface(): Polyface { return (undefined as unknown) as Polyface; }\r\n /** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */\r\n public clearArrays(): void {\r\n if (this.point !== undefined)\r\n this.point.length = 0;\r\n if (this.param !== undefined)\r\n this.param.length = 0;\r\n if (this.normal !== undefined)\r\n this.normal.length = 0;\r\n // ignore color and aux -- they never exist.\r\n }\r\n /** transfer interpolated data from the other visitor.\r\n * * all data values are interpolated at `fraction` between `other` values at index0 and index1.\r\n */\r\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\r\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\r\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\r\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\r\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\r\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\r\n }\r\n /** transfer data from a specified index of the other visitor as new data in this visitor. */\r\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\r\n this.point.pushFromGrowableXYZArray(other.point, index);\r\n if (this.color && other.color && index < other.color.length)\r\n this.color.push(other.color[index]);\r\n if (this.param && other.param && index < other.param.length)\r\n this.param.pushFromGrowableXYArray(other.param, index);\r\n if (this.normal && other.normal && index < other.normal.length)\r\n this.normal.pushFromGrowableXYZArray(other.normal, index);\r\n }\r\n\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ExportGraphics.js","sourceRoot":"","sources":["../../src/ExportGraphics.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoE;AACpE,wDAAgG;AAkQhG;;GAEG;AACH,IAAiB,cAAc,CAuD9B;AAvDD,WAAiB,cAAc;IAC7B;;OAEG;IACH,SAAgB,wBAAwB,CAAC,GAA0B,EAAE,GAA0B;QAC7F,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU;YACnC,OAAO,KAAK,CAAC;QACf,IAAI,G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AAI,KAAK,CAAC,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM;YACzD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM;YACzD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACzD,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM;YAC5D,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC;CAEF;AA5ID,8DA4IC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ExportGraphics\n */\n\nimport { assert, Id64Array, Id64String } from \"@itwin/core-bentley\";\nimport { IndexedPolyface, Polyface, PolyfaceData, PolyfaceVisitor } from \"@itwin/core-geometry\";\nimport { ColorDefProps, GeometryClass } from \"@itwin/core-common\";\n\n/** A collection of line segments, suitable for direct use with graphics APIs.\n * The structure of this data matches GL_LINES in OpenGL.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportGraphicsLines {\n /** Zero-based vertex indices, every two indices represent a line segment */\n indices: Int32Array;\n /** Vertices for these lines, laid out in the pattern XYZXYZ */\n points: Float64Array;\n}\n\n/** Info provided to ExportLinesFunction about linework graphics.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportLinesInfo {\n /** The element ID for the element the graphics originated from */\n elementId: Id64String;\n /** ID for the [SubCategory]($core-backend) for these graphics */\n subCategory: Id64String;\n /** The color and transparency for these graphics */\n color: ColorDefProps;\n /** GeometryClass for these graphics */\n geometryClass: GeometryClass;\n /** The linework for these graphics */\n lines: ExportGraphicsLines;\n}\n\n/** A callback function that receives generated line graphics.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport type ExportLinesFunction = (info: ExportLinesInfo) => void;\n\n/** A triangulated mesh with unified indices, suitable for direct use with graphics APIs.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportGraphicsMesh {\n /** Zero-based vertex indices, every three indices represent a triangle */\n indices: Int32Array;\n /** Vertices for this mesh, laid out in the pattern XYZXYZ */\n points: Float64Array;\n /** Normals for this mesh, laid out in the pattern XYZXYZ */\n normals: Float32Array;\n /** Parameters (uvs) for this mesh, laid out in the pattern XYXY */\n params: Float32Array;\n /** If true, clients should assume both sides of the mesh are visible and not cull backfaces. */\n isTwoSided: boolean;\n}\n\n/** Info provided to ExportGraphicsFunction about graphics.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportGraphicsInfo {\n /** The element ID for the element the graphics originated from */\n elementId: Id64String;\n /** ID for the [SubCategory]($core-backend) for these graphics */\n subCategory: Id64String;\n /** The color and transparency for these graphics */\n color: ColorDefProps;\n /** GeometryClass for these graphics */\n geometryClass: GeometryClass;\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\n materialId?: Id64String;\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\n textureId?: Id64String;\n /** The mesh for these graphics */\n mesh: ExportGraphicsMesh;\n}\n\n/** Information about the base display properties when a [GeometryPart]($core-backend) was\n * referenced. This is intended to be used with [IModelDb.exportPartGraphics]($core-backend).\n * * If two ExportPartInstanceInfo have the same ExportPartDisplayInfos, they will result in the\n * same graphics (with a different transform).\n * * If two ExportPartInstanceInfo have different ExportPartDisplayInfos, they may result in different\n * graphics.\n * @public\n */\nexport interface ExportPartDisplayInfo {\n categoryId: Id64String;\n subCategoryId: Id64String;\n geometryClass: GeometryClass;\n materialId: Id64String;\n elmTransparency: number;\n lineColor: number;\n}\n\n/** Information about references to [GeometryPart]($core-backend) elements found during\n * a call to [IModelDb.exportGraphics]($core-backend).\n * See [IModelDb.exportPartGraphics]($core-backend) for the intended use case.\n * @public\n */\nexport interface ExportPartInstanceInfo {\n /** ID for the [GeometryPart]($core-backend) */\n partId: Id64String;\n /** ID for the element that contained the reference to the [GeometryPart]($core-backend) */\n partInstanceId: Id64String;\n /** The base display properties when the [GeometryPart]($core-backend) was referenced. */\n displayProps: ExportPartDisplayInfo;\n /** A row-major storage 4x3 transform for this instance.\n * See export-gltf under test-apps in the iTwin.js monorepo for a working reference.\n */\n transform?: Float64Array;\n}\n\n/** A callback function that receives generated graphics.\n * See [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport type ExportGraphicsFunction = (info: ExportGraphicsInfo) => void;\n\n/** Parameters for [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport interface ExportGraphicsOptions {\n /** The source elements for the exported graphics */\n elementIdArray: Id64Array;\n /** A function to call for each unique element ID, color and texture combination */\n onGraphics: ExportGraphicsFunction;\n /** An optional function to call if line graphics are desired. */\n onLineGraphics?: ExportLinesFunction;\n /** If supplied, any references to [GeometryPart]($core-backend) elements found will be\n * recorded in this array. In this case, graphics that would result from the GeometryPart\n * will not be supplied via onGraphics. See [IModelDb.exportPartGraphics]($core-backend)\n */\n partInstanceArray?: ExportPartInstanceInfo[];\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry).\n * If not supplied, defaults to zero and angleTol will control the quality of the resulting mesh.\n */\n chordTol?: number;\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry).\n * If not supplied, defaults to PI/12 (15 degrees).\n */\n angleTol?: number;\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry).\n * If not supplied, there is no maximum length of an edge. Supplying this value can greatly increase the\n * size of the resulting geometry, and should only be done in cases where necessary (if you don't know\n * that it's necessary, it's almost certainly not!)\n */\n maxEdgeLength?: number;\n /** The longest dimension of a line style's largest component must be at least this size in order for\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\n * line strings.\n */\n minLineStyleComponentSize?: number;\n /** Max distance between mesh vertices for them to be collapsed.\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\n * anomalies so it is important to choose an appropriate setting for your use case.\n */\n decimationTol?: number;\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\n * like screws and screw holes.\n */\n minBRepFeatureSize?: number;\n}\n\n/** Info provided to ExportPartFunction about graphics.\n * See [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport interface ExportPartInfo {\n /** The color and transparency for these graphics */\n color: ColorDefProps;\n /** GeometryClass for these graphics */\n geometryClass: GeometryClass;\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\n materialId?: Id64String;\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\n textureId?: Id64String;\n /** The mesh for these graphics */\n mesh: ExportGraphicsMesh;\n}\n\n/** A callback function that receives generated graphics for a [GeometryPart]($core-backend).\n * See [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport type ExportPartFunction = (info: ExportPartInfo) => void;\n\n/** Info provided to ExportPartFunction about line graphics.\n * See [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport interface ExportPartLinesInfo {\n /** The color and transparency for these graphics */\n color: ColorDefProps;\n /** GeometryClass for these graphics */\n geometryClass: GeometryClass;\n /** The linework for these graphics */\n lines: ExportGraphicsLines;\n}\n\n/** A callback function that receives generated line graphics for a [GeometryPart]($core-backend).\n * See [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport type ExportPartLinesFunction = (info: ExportPartLinesInfo) => void;\n\n/** Parameters for [IModelDb.exportPartGraphics]($core-backend)\n * @public\n */\nexport interface ExportPartGraphicsOptions {\n /** The ID for the source [GeometryPart]($core-backend) */\n elementId: Id64String;\n /** The base display properties to use for generating the graphics. This should come from an\n * ExportPartInstanceProps generated by [IModelDb.exportGraphics]($core-backend)\n */\n displayProps: ExportPartDisplayInfo;\n /** A function to call for each unique color and texture combination. */\n onPartGraphics: ExportPartFunction;\n /** An optional function to call if line graphics are desired. */\n onPartLineGraphics?: ExportPartLinesFunction;\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry).\n * If not supplied, defaults to zero and angleTol will control the quality of the resulting mesh.\n */\n chordTol?: number;\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry).\n * If not supplied, defaults to PI/12 (15 degrees).\n */\n angleTol?: number;\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry)\n * If not supplied, there is no maximum length of an edge. Supplying this value can greatly increase the\n * size of the resulting geometry, and should only be done in cases where necessary (if you don't know\n * that it's necessary, it's almost certainly not!)\n */\n maxEdgeLength?: number;\n /** The longest dimension of a line style's largest component must be at least this size in order for\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\n * line strings.\n */\n minLineStyleComponentSize?: number;\n /** Max distance between mesh vertices for them to be collapsed.\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\n * anomalies so it is important to choose an appropriate setting for your use case.\n */\n decimationTol?: number;\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\n * like screws and screw holes.\n */\n minBRepFeatureSize?: number;\n}\n\n/** Provides utility functions for working with data generated by [IModelDb.exportGraphics]($core-backend)\n * @public\n */\nexport namespace ExportGraphics {\n /** Test if ExportPartDisplayInfos have exactly the same values.\n * @public\n */\n export function arePartDisplayInfosEqual(lhs: ExportPartDisplayInfo, rhs: ExportPartDisplayInfo): boolean {\n if (lhs.categoryId !== rhs.categoryId)\n return false;\n if (lhs.subCategoryId !== rhs.subCategoryId)\n return false;\n if (lhs.materialId !== rhs.materialId)\n return false;\n if (lhs.elmTransparency !== rhs.elmTransparency)\n return false;\n if (lhs.lineColor !== rhs.lineColor)\n return false;\n return true;\n }\n\n /**\n * Convert an ExportGraphicsMesh to an IndexedPolyface usable by the geometry API.\n * @note The resulting IndexedPolyface may have duplicate points, normals and params. If problematic, call [PolyfaceData.compress]($core-geometry)\n * @public\n */\n export function convertToIndexedPolyface(mesh: ExportGraphicsMesh): IndexedPolyface {\n const polyface = IndexedPolyface.create(true, true, false, mesh.isTwoSided);\n\n const p: Float64Array = mesh.points;\n for (let i = 0; i < p.length; i += 3)\n polyface.data.point.pushXYZ(p[i], p[i + 1], p[i + 2]);\n\n const n: Float32Array = mesh.normals;\n assert(undefined !== polyface.data.normal);\n for (let i = 0; i < n.length; i += 3)\n polyface.data.normal.pushXYZ(n[i], n[i + 1], n[i + 2]);\n\n const uv: Float32Array = mesh.params;\n assert(undefined !== polyface.data.param);\n for (let i = 0; i < uv.length; i += 2)\n polyface.data.param.pushXY(uv[i], uv[i + 1]);\n\n const indices = mesh.indices;\n const addIndex = (idx: number) => {\n polyface.addPointIndex(idx, true);\n polyface.addNormalIndex(idx);\n polyface.addParamIndex(idx);\n };\n for (let i = 0; i < indices.length; i += 3) {\n addIndex(indices[i]);\n addIndex(indices[i + 1]);\n addIndex(indices[i + 2]);\n polyface.terminateFacet(false);\n }\n\n return polyface;\n }\n}\n/**\n * * Iterator to walk the facets of an ExportGraphicsMesh and present them to the world as if visiting a Polyface.\n * * Because the ExportGraphicsMesh has limited data:\n * * There is no auxData in this visitor.\n * * There is no color in this visitor.\n * * All edgeVisible are true.\n * @public\n */\nexport class ExportGraphicsMeshVisitor extends PolyfaceData implements PolyfaceVisitor {\n private _currentFacetIndex: number;\n private _nextFacetIndex: number;\n private _numWrap: number;\n private _polyface: ExportGraphicsMesh;\n // to be called from static factory method that validates the polyface ...\n private constructor(facets: ExportGraphicsMesh, numWrap: number) {\n super(facets.normals.length > 0, facets.params.length > 0, false, facets.isTwoSided);\n this._polyface = facets;\n this._numWrap = numWrap;\n\n this._nextFacetIndex = 0;\n this._currentFacetIndex = -1;\n this.twoSided = facets.isTwoSided;\n this.reset();\n }\n /** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays\n * Typical wrap counts are:\n * * 0 -- leave the point arrays with \"missing final edge\"\n * * 1 -- add point 0 as closure point\n * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.\n */\n public static create(polyface: ExportGraphicsMesh, numWrap: number): ExportGraphicsMeshVisitor {\n return new ExportGraphicsMeshVisitor(polyface, numWrap);\n }\n /** Reset the iterator to start at the first facet of the polyface. */\n public reset(): void {\n this.moveToReadIndex(0);\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.\n }\n /** Select a facet by simple index. */\n public moveToReadIndex(facetIndex: number): boolean {\n if (facetIndex < 0 || 2 + facetIndex * 3 >= this._polyface.indices.length)\n return false;\n this._currentFacetIndex = facetIndex;\n this._nextFacetIndex = facetIndex + 1;\n this.point.length = 0;\n const points = this.point;\n points.length = 0;\n this.pointIndex.length = 0;\n this.point.length = 0;\n this.edgeVisible.length = 0;\n const sourcePoints = this._polyface.points;\n const indices = this._polyface.indices;\n const i0 = 3 * facetIndex;\n for (let i = i0; i < i0 + 3; i++) {\n const k = 3 * indices[i];\n this.pointIndex.push(indices[i]);\n this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);\n this.edgeVisible.push(true);\n }\n for (let i = 0; i < this._numWrap; i++) {\n this.point.pushFromGrowableXYZArray(this.point, i);\n }\n\n const sourceParams = this._polyface.params;\n if (sourceParams.length > 0 && this.paramIndex && this.param) {\n this.paramIndex.length = 0;\n this.param.length = 0;\n for (let i = i0; i < i0 + 3; i++) {\n const k = 2 * indices[i];\n this.paramIndex.push(indices[i]);\n this.param.pushXY(sourceParams[k], sourceParams[k + 1]);\n }\n for (let i = 0; i < this._numWrap; i++) {\n this.param.pushFromGrowableXYArray(this.param, i);\n }\n }\n\n const sourceNormals = this._polyface.normals;\n if (sourceNormals.length > 0 && this.normalIndex && this.normal) {\n this.normalIndex.length = 0;\n this.normal.length = 0;\n for (let i = i0; i < i0 + 3; i++) {\n const k = 3 * indices[i];\n this.normalIndex.push(indices[i]);\n this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);\n }\n for (let i = 0; i < this._numWrap; i++) {\n this.normal.pushFromGrowableXYZArray(this.normal, i);\n }\n }\n return true;\n }\n public moveToNextFacet(): boolean {\n return this.moveToReadIndex(this._nextFacetIndex);\n }\n /** Set the number of vertices to replicate in visitor arrays. */\n public setNumWrap(numWrap: number): void { this._numWrap = numWrap; }\n\n /** Return the index (in the client polyface) of the current facet */\n public currentReadIndex(): number { return this._currentFacetIndex; }\n /** Return the point index of vertex i within the currently loaded facet */\n public clientPointIndex(i: number): number { return this.pointIndex[i]; }\n /** Return the param index of vertex i within the currently loaded facet.\n * Use the artificial paramIndex, which matches pointIndex.\n */\n public clientParamIndex(i: number): number { return this.paramIndex ? this.paramIndex[i] : -1; }\n /** Return the normal index of vertex i within the currently loaded facet.\n * Use the artificial paramIndex, which matches pointIndex.\n */\n public clientNormalIndex(i: number): number { return this.normalIndex ? this.normalIndex[i] : -1; }\n /** Return the color index of vertex i within the currently loaded facet */\n public clientColorIndex(_i: number): number { return 1; }\n /** Return the aux data index of vertex i within the currently loaded facet */\n public clientAuxIndex(_i: number): number { return -1; }\n\n /** return the client polyface */\n public clientPolyface(): Polyface { return (undefined as unknown) as Polyface; }\n /** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */\n public clearArrays(): void {\n if (this.point !== undefined)\n this.point.length = 0;\n if (this.param !== undefined)\n this.param.length = 0;\n if (this.normal !== undefined)\n this.normal.length = 0;\n // ignore color and aux -- they never exist.\n }\n /** transfer interpolated data from the other visitor.\n * * all data values are interpolated at `fraction` between `other` values at index0 and index1.\n */\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\n }\n /** transfer data from a specified index of the other visitor as new data in this visitor. */\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\n this.point.pushFromGrowableXYZArray(other.point, index);\n if (this.color && other.color && index < other.color.length)\n this.color.push(other.color[index]);\n if (this.param && other.param && index < other.param.length)\n this.param.pushFromGrowableXYArray(other.param, index);\n if (this.normal && other.normal && index < other.normal.length)\n this.normal.pushFromGrowableXYZArray(other.normal, index);\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalSource.js","sourceRoot":"","sources":["../../src/ExternalSource.ts"],"names":[],"mappings":";AACA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA+C;AAC/C,oDAG4B;AAC5B,uCAAiE;AAEjE,qEAAgH;AAEhH;;;GAGG;AACH,MAAa,cAAe,SAAQ,qCAA2B;IAO7D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,gBAAgB,CAAC,CAAC,CAAC;IAE3E,YAAsB,KAA0B,EAAE,MAAgB;QAChE,KAAK,CAAC,KAAK,EAAE,M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,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAClF,CAAC;CACF;AApDD,4DAoDC;AAED;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,cAAc;IACrD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,qBAAqB,CAAC,CAAC,CAAC;IAEhF,YAAsB,KAA0B,EAAE,MAAgB;QAChE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAPD,kDAOC;AAED;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,iBAAO;IAGpD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,2BAA2B,CAAC,CAAC,CAAC;IAEtF,YAAsB,KAAqC,EAAE,MAAgB;QAC3E,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;IAEe,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAoC,CAAC,CAAC,sDAAsD;IACjH,CAAC;CACF;AAbD,8DAaC","sourcesContent":["\r\n/*---------------------------------------------------------------------------------------------\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 Elements\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\nimport {\r\n BisCodeSpec, Code, CodeScopeSpec, EntityReferenceSet, ExternalSourceAttachmentProps, ExternalSourceAttachmentRole, ExternalSourceProps, IModel, RelatedElement,\r\n SynchronizationConfigLinkProps,\r\n} from \"@itwin/core-common\";\r\nimport { InformationReferenceElement, UrlLink } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { ExternalSourceAttachmentAttachesSource, ExternalSourceIsInRepository } from \"./NavigationRelationship\";\r\n\r\n/** An ExternalSource refers to an 'information container' found in a repository. In some cases, the container is the entire repository.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSource extends InformationReferenceElement {\r\n /** The repository that contains this ExternalSource. */\r\n public repository?: ExternalSourceIsInRepository;\r\n /** The name of the iModel Connecter that processed this ExternalSource. */\r\n public connectorName?: string;\r\n /** The version of the iModel Connecter that processed this ExternalSource. */\r\n public connectorVersion?: string;\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSource\"; }\r\n\r\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.repository)\r\n this.repository = new ExternalSourceIsInRepository(RelatedElement.idFromJson(props.repository));\r\n }\r\n\r\n public override toJSON(): ExternalSourceProps { // This override only specializes the return type\r\n return super.toJSON() as ExternalSourceProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n /** The [[CodeSpec]] for ExternalSource elements is not automatically created, so this method ensures that it exists. */\r\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String {\r\n try {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\r\n return codeSpec.id;\r\n } catch (e) {\r\n return iModelDb.codeSpecs.insert(BisCodeSpec.externalSource, CodeScopeSpec.Type.Repository);\r\n }\r\n }\r\n /** Create a Code for an ExternalSource element given a name that is meant to be unique within the scope of the iModel.\r\n * @param iModelDb The IModelDb\r\n * @param codeValue The ExternalSource name\r\n * @see [[ensureCodeSpec]]\r\n */\r\n public static createCode(iModelDb: IModelDb, codeValue: string): Code {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\r\n return new Code({ spec: codeSpec.id, scope: IModel.rootSubjectId, value: codeValue });\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.repository)\r\n referenceIds.addElement(this.repository.id);\r\n }\r\n}\r\n\r\n/** Attachment of an ExternalSource\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceAttachment extends InformationReferenceElement {\r\n /** The [[ExternalSource]] that is attached by this ExternalSourceAttachment. */\r\n public attaches?: ExternalSourceAttachmentAttachesSource;\r\n /** Specifies whether the attached [[ExternalSource]] provides context or models a part of the whole. */\r\n public role?: ExternalSourceAttachmentRole;\r\n /** The translation or offset in global coordinates of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public translation?: Point3d;\r\n /** The Yaw angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public yaw?: number;\r\n /** The Pitch angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public pitch?: number;\r\n /** The Roll angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public roll?: number;\r\n /** The scale of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public scale?: Point3d;\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceAttachment\"; }\r\n\r\n protected constructor(props: ExternalSourceAttachmentProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.attaches)\r\n this.attaches = new ExternalSourceAttachmentAttachesSource(RelatedElement.idFromJson(props.attaches));\r\n\r\n if (props.translation)\r\n this.translation = Point3d.fromJSON(props.translation);\r\n\r\n if (props.scale)\r\n this.scale = Point3d.fromJSON(props.scale);\r\n }\r\n\r\n public override toJSON(): ExternalSourceAttachmentProps { // This override only specializes the return type\r\n return super.toJSON() as ExternalSourceAttachmentProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n /** The [[CodeSpec]] for ExternalSourceAttachment elements is not automatically created, so this method ensures that it exists. */\r\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String {\r\n try {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\r\n return codeSpec.id;\r\n } catch (e) {\r\n return iModelDb.codeSpecs.insert(BisCodeSpec.externalSourceAttachment, CodeScopeSpec.Type.ParentElement);\r\n }\r\n }\r\n /** Create a Code for an ExternalSourceAttachment element given a name that is meant to be unique within the scope of its parent [[ExternalSource]].\r\n * @param iModelDb The IModelDb\r\n * @param scopeElementId The parent ExternalSource\r\n * @param codeValue The ExternalSourceAttachment name\r\n * @see [[ensureCodeSpec]]\r\n */\r\n public static createCode(iModelDb: IModelDb, scopeElementId: Id64String, codeValue: string): Code {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\r\n return new Code({ spec: codeSpec.id, scope: scopeElementId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A group of ExternalSources that are collectively a source of information for one or more elements.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceGroup extends ExternalSource {\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceGroup\"; }\r\n\r\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** Link to the Configuration for an iModel Synchronization Job\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class SynchronizationConfigLink extends UrlLink {\r\n /** Date/Time of last successful run of this synchronization configuration */\r\n public lastSuccessfulRun?: string;\r\n /** @internal */\r\n public static override get className(): string { return \"SynchronizationConfigLink\"; }\r\n\r\n protected constructor(props: SynchronizationConfigLinkProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n\r\n public override toJSON(): SynchronizationConfigLinkProps { // This override only specializes the return type\r\n return super.toJSON() as SynchronizationConfigLinkProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n}\r\n\r\n"]}
|
|
1
|
+
{"version":3,"file":"ExternalSource.js","sourceRoot":"","sources":["../../src/ExternalSource.ts"],"names":[],"mappings":";AACA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA+C;AAC/C,oDAG4B;AAC5B,uCAAiE;AAEjE,qEAAgH;AAEhH;;;GAGG;AACH,MAAa,cAAe,SAAQ,qCAA2B;IAO7D,g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,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,yBAAW,CAAC,wBAAwB,CAAC,CAAC;QACpF,OAAO,IAAI,kBAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAClF,CAAC;CACF;AApDD,4DAoDC;AAED;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,cAAc;IACrD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,qBAAqB,CAAC,CAAC,CAAC;IAEhF,YAAsB,KAA0B,EAAE,MAAgB;QAChE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAPD,kDAOC;AAED;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,iBAAO;IAGpD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,2BAA2B,CAAC,CAAC,CAAC;IAEtF,YAAsB,KAAqC,EAAE,MAAgB;QAC3E,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;IAEe,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAoC,CAAC,CAAC,sDAAsD;IACjH,CAAC;CACF;AAbD,8DAaC","sourcesContent":["\n/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Elements\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Point3d } from \"@itwin/core-geometry\";\nimport {\n BisCodeSpec, Code, CodeScopeSpec, EntityReferenceSet, ExternalSourceAttachmentProps, ExternalSourceAttachmentRole, ExternalSourceProps, IModel, RelatedElement,\n SynchronizationConfigLinkProps,\n} from \"@itwin/core-common\";\nimport { InformationReferenceElement, UrlLink } from \"./Element\";\nimport { IModelDb } from \"./IModelDb\";\nimport { ExternalSourceAttachmentAttachesSource, ExternalSourceIsInRepository } from \"./NavigationRelationship\";\n\n/** An ExternalSource refers to an 'information container' found in a repository. In some cases, the container is the entire repository.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSource extends InformationReferenceElement {\n /** The repository that contains this ExternalSource. */\n public repository?: ExternalSourceIsInRepository;\n /** The name of the iModel Connecter that processed this ExternalSource. */\n public connectorName?: string;\n /** The version of the iModel Connecter that processed this ExternalSource. */\n public connectorVersion?: string;\n /** @internal */\n public static override get className(): string { return \"ExternalSource\"; }\n\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\n super(props, iModel);\n if (props.repository)\n this.repository = new ExternalSourceIsInRepository(RelatedElement.idFromJson(props.repository));\n }\n\n public override toJSON(): ExternalSourceProps { // This override only specializes the return type\n return super.toJSON() as ExternalSourceProps; // Entity.toJSON takes care of auto-handled properties\n }\n /** The [[CodeSpec]] for ExternalSource elements is not automatically created, so this method ensures that it exists. */\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String {\n try {\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\n return codeSpec.id;\n } catch (e) {\n return iModelDb.codeSpecs.insert(BisCodeSpec.externalSource, CodeScopeSpec.Type.Repository);\n }\n }\n /** Create a Code for an ExternalSource element given a name that is meant to be unique within the scope of the iModel.\n * @param iModelDb The IModelDb\n * @param codeValue The ExternalSource name\n * @see [[ensureCodeSpec]]\n */\n public static createCode(iModelDb: IModelDb, codeValue: string): Code {\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\n return new Code({ spec: codeSpec.id, scope: IModel.rootSubjectId, value: codeValue });\n }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n if (this.repository)\n referenceIds.addElement(this.repository.id);\n }\n}\n\n/** Attachment of an ExternalSource\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceAttachment extends InformationReferenceElement {\n /** The [[ExternalSource]] that is attached by this ExternalSourceAttachment. */\n public attaches?: ExternalSourceAttachmentAttachesSource;\n /** Specifies whether the attached [[ExternalSource]] provides context or models a part of the whole. */\n public role?: ExternalSourceAttachmentRole;\n /** The translation or offset in global coordinates of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public translation?: Point3d;\n /** The Yaw angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public yaw?: number;\n /** The Pitch angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public pitch?: number;\n /** The Roll angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public roll?: number;\n /** The scale of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public scale?: Point3d;\n /** @internal */\n public static override get className(): string { return \"ExternalSourceAttachment\"; }\n\n protected constructor(props: ExternalSourceAttachmentProps, iModel: IModelDb) {\n super(props, iModel);\n if (props.attaches)\n this.attaches = new ExternalSourceAttachmentAttachesSource(RelatedElement.idFromJson(props.attaches));\n\n if (props.translation)\n this.translation = Point3d.fromJSON(props.translation);\n\n if (props.scale)\n this.scale = Point3d.fromJSON(props.scale);\n }\n\n public override toJSON(): ExternalSourceAttachmentProps { // This override only specializes the return type\n return super.toJSON() as ExternalSourceAttachmentProps; // Entity.toJSON takes care of auto-handled properties\n }\n /** The [[CodeSpec]] for ExternalSourceAttachment elements is not automatically created, so this method ensures that it exists. */\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String {\n try {\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\n return codeSpec.id;\n } catch (e) {\n return iModelDb.codeSpecs.insert(BisCodeSpec.externalSourceAttachment, CodeScopeSpec.Type.ParentElement);\n }\n }\n /** Create a Code for an ExternalSourceAttachment element given a name that is meant to be unique within the scope of its parent [[ExternalSource]].\n * @param iModelDb The IModelDb\n * @param scopeElementId The parent ExternalSource\n * @param codeValue The ExternalSourceAttachment name\n * @see [[ensureCodeSpec]]\n */\n public static createCode(iModelDb: IModelDb, scopeElementId: Id64String, codeValue: string): Code {\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\n return new Code({ spec: codeSpec.id, scope: scopeElementId, value: codeValue });\n }\n}\n\n/** A group of ExternalSources that are collectively a source of information for one or more elements.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceGroup extends ExternalSource {\n /** @internal */\n public static override get className(): string { return \"ExternalSourceGroup\"; }\n\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** Link to the Configuration for an iModel Synchronization Job\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class SynchronizationConfigLink extends UrlLink {\n /** Date/Time of last successful run of this synchronization configuration */\n public lastSuccessfulRun?: string;\n /** @internal */\n public static override get className(): string { return \"SynchronizationConfigLink\"; }\n\n protected constructor(props: SynchronizationConfigLinkProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n public override toJSON(): SynchronizationConfigLinkProps { // This override only specializes the return type\n return super.toJSON() as SynchronizationConfigLinkProps; // Entity.toJSON takes care of auto-handled properties\n }\n}\n\n"]}
|
|
@@ -77,8 +77,8 @@ class GeoCoordConfig {
|
|
|
77
77
|
this.loadAll(settings, "gcs/databases");
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
+
exports.GeoCoordConfig = GeoCoordConfig;
|
|
80
81
|
/** array of cloud prefetch tasks that may be awaited to permit offline usage */
|
|
81
82
|
GeoCoordConfig.prefetches = [];
|
|
82
83
|
GeoCoordConfig._defaultDbsLoaded = false;
|
|
83
|
-
exports.GeoCoordConfig = GeoCoordConfig;
|
|
84
84
|
//# sourceMappingURL=GeoCoordConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoCoordConfig.js","sourceRoot":"","sources":["../../src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;YACzL,qBAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,OAAO,CAAC,QAAkB,EAAE,WAAmB;QAC5D,QAAQ,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE;YAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;gBACvB,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;oBACxB,IAAI,OAAO,KAAK,KAAK,QAAQ;wBAC3B,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;gBAChC,CAAC;YACH,CAAC;YACD,OAAO,SAAS,CAAC,CAAC,sCAAsC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC;IAGM,MAAM,CAAC,SAAS;QACrB,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7B,CAAC;IAEM,MAAM,CAAC,oBAAoB;QAChC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;YAC9B,IAAI,CAAC,OAAO,CAAC,uBAAU,CAAC,YAAY,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,QAAkB;QAC5C,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;IAC1C,CAAC;;AAzEH,wCA0EC;AAzEC,gFAAgF;AACzD,yBAAU,GAAgC,EAAE,CAAC;AAuDrD,gCAAiB,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport { BentleyError, Logger } from \"@itwin/core-bentley\";\nimport { CloudSqlite } from \"./CloudSqlite\";\nimport { IModelHost } from \"./IModelHost\";\nimport { Settings } from \"./workspace/Settings\";\nimport { WorkspaceContainer, WorkspaceDb } from \"./workspace/Workspace\";\n\nconst loggerCat = \"GeoCoord\";\n\ninterface GcsDbProps extends WorkspaceDb.Props, WorkspaceContainer.Alias {\n prefetch?: boolean;\n priority?: number;\n}\n\n/**\n * Internal class to configure and load the gcs workspaces for an iModel.\n * @internal\n */\nexport class GeoCoordConfig {\n /** array of cloud prefetch tasks that may be awaited to permit offline usage */\n public static readonly prefetches: CloudSqlite.CloudPrefetch[] = [];\n\n private static addGcsWorkspace(gcsDbAlias: string) {\n // override to disable loading GCS data from workspaces\n if (IModelHost.appWorkspace.settings.getBoolean(\"gcs/disableWorkspaces\", false))\n return;\n\n let containerProps: WorkspaceContainer.Props | undefined;\n try {\n const ws = IModelHost.appWorkspace;\n const dbProps = ws.resolveDatabase(gcsDbAlias) as GcsDbProps;\n containerProps = ws.resolveContainer(dbProps.containerName);\n const container = ws.getContainer(containerProps);\n const cloudContainer = container.cloudContainer;\n if (!cloudContainer?.isConnected) {\n Logger.logError(\"GeoCoord\", `could not load gcs database \"${gcsDbAlias}\"`);\n return;\n }\n\n const gcsDbName = container.resolveDbFileName(dbProps);\n const gcsDbProps = cloudContainer.queryDatabase(gcsDbName);\n if (undefined === gcsDbProps)\n throw new Error(`database \"${gcsDbName}\" not found in container \"${containerProps.containerId}\"`);\n\n if (!IModelHost.platform.addGcsWorkspaceDb(gcsDbName, cloudContainer, dbProps.priority))\n return; // already had this db\n\n if (IModelHost.appWorkspace.settings.getBoolean(\"gcs/noLocalData\", false))\n IModelHost.platform.enableLocalGcsFiles(false);\n\n Logger.logInfo(loggerCat, `loaded gcsDb \"${gcsDbName}\", from \"${containerProps.baseUri}/${containerProps.containerId}\" size=${gcsDbProps.totalBlocks}, local=${gcsDbProps.localBlocks}`);\n\n if (true === dbProps.prefetch)\n this.prefetches.push(CloudSqlite.startCloudPrefetch(cloudContainer, gcsDbName));\n\n } catch (e: any) {\n let msg = `Cannot load GCS workspace (${e.errorNumber}): ${BentleyError.getErrorMessage(e)}`;\n if (containerProps)\n msg += `,container=${containerProps.baseUri}/${containerProps.containerId}, storage=${containerProps.storageType}, public=${containerProps.isPublic}, cacheDir=${IModelHost.cacheDir}`;\n Logger.logError(loggerCat, msg);\n }\n }\n\n private static loadAll(settings: Settings, settingName: string) {\n settings.resolveSetting(settingName, (val) => {\n if (Array.isArray(val)) {\n for (const entry of val) {\n if (typeof entry === \"string\")\n this.addGcsWorkspace(entry);\n }\n }\n return undefined; // keep going through all dictionaries\n });\n }\n\n private static _defaultDbsLoaded = false;\n public static onStartup() {\n this._defaultDbsLoaded = false;\n this.prefetches.length = 0;\n }\n\n public static loadDefaultDatabases(): void {\n if (!this._defaultDbsLoaded) {\n this._defaultDbsLoaded = true;\n this.loadAll(IModelHost.appWorkspace.settings, \"gcs/default/databases\");\n }\n }\n\n public static loadForImodel(settings: Settings) {\n this.loadDefaultDatabases();\n this.loadAll(settings, \"gcs/databases\");\n }\n}\n"]}
|
|
@@ -206,17 +206,17 @@ class ResponseGenerator {
|
|
|
206
206
|
case "pointCollection":
|
|
207
207
|
return `${summary} numPoints: ${query.points.length}`;
|
|
208
208
|
case "bsurf":
|
|
209
|
-
return `${summary}'
|
|
210
|
-
' poleDimension: ${query.poleDimension}'
|
|
211
|
-
' numPolesTotal: ${query.numPolesTotal()}'
|
|
212
|
-
' degree[U,V]: ${JSON.stringify([query.degreeUV(core_geometry_1.UVSelect.uDirection), query.degreeUV(core_geometry_1.UVSelect.vDirection)])}'
|
|
213
|
-
' order[U,V]: ${JSON.stringify([query.orderUV(core_geometry_1.UVSelect.uDirection), query.orderUV(core_geometry_1.UVSelect.vDirection)])}'
|
|
214
|
-
' numSpan[U,V]: ${JSON.stringify([query.numSpanUV(core_geometry_1.UVSelect.uDirection), query.numSpanUV(core_geometry_1.UVSelect.vDirection)])}'
|
|
215
|
-
' numPoles[U,V]: ${JSON.stringify([query.numPolesUV(core_geometry_1.UVSelect.uDirection), query.numPolesUV(core_geometry_1.UVSelect.vDirection)])}'
|
|
209
|
+
return `${summary}'
|
|
210
|
+
' poleDimension: ${query.poleDimension}'
|
|
211
|
+
' numPolesTotal: ${query.numPolesTotal()}'
|
|
212
|
+
' degree[U,V]: ${JSON.stringify([query.degreeUV(core_geometry_1.UVSelect.uDirection), query.degreeUV(core_geometry_1.UVSelect.vDirection)])}'
|
|
213
|
+
' order[U,V]: ${JSON.stringify([query.orderUV(core_geometry_1.UVSelect.uDirection), query.orderUV(core_geometry_1.UVSelect.vDirection)])}'
|
|
214
|
+
' numSpan[U,V]: ${JSON.stringify([query.numSpanUV(core_geometry_1.UVSelect.uDirection), query.numSpanUV(core_geometry_1.UVSelect.vDirection)])}'
|
|
215
|
+
' numPoles[U,V]: ${JSON.stringify([query.numPolesUV(core_geometry_1.UVSelect.uDirection), query.numPolesUV(core_geometry_1.UVSelect.vDirection)])}'
|
|
216
216
|
' poleStep[U,V]: ${JSON.stringify([query.poleStepUV(core_geometry_1.UVSelect.uDirection), query.poleStepUV(core_geometry_1.UVSelect.vDirection)])}`;
|
|
217
217
|
case "polyface": {
|
|
218
218
|
const data = query.data;
|
|
219
|
-
summary = `${summary} pointCount: ${data.point.length}'
|
|
219
|
+
summary = `${summary} pointCount: ${data.point.length}'
|
|
220
220
|
' pointIndexCount: ${data.pointIndex.length}`;
|
|
221
221
|
if (query.twoSided)
|
|
222
222
|
summary = `${summary} (two-sided)`;
|
|
@@ -237,40 +237,40 @@ class ResponseGenerator {
|
|
|
237
237
|
switch (solid.solidPrimitiveType) {
|
|
238
238
|
case "box":
|
|
239
239
|
const box = solid;
|
|
240
|
-
return `${summary}'
|
|
241
|
-
' origin: ${JSON.stringify(box.getBaseOrigin().toJSON())}'
|
|
242
|
-
' topOrigin: ${JSON.stringify(box.getTopOrigin().toJSON())}'
|
|
243
|
-
' baseX: ${box.getBaseX()}'
|
|
240
|
+
return `${summary}'
|
|
241
|
+
' origin: ${JSON.stringify(box.getBaseOrigin().toJSON())}'
|
|
242
|
+
' topOrigin: ${JSON.stringify(box.getTopOrigin().toJSON())}'
|
|
243
|
+
' baseX: ${box.getBaseX()}'
|
|
244
244
|
' baseY: ${box.getBaseY()}`;
|
|
245
245
|
case "cone":
|
|
246
246
|
const cone = solid;
|
|
247
|
-
return `${summary}'
|
|
248
|
-
' baseCenterPoint: ${JSON.stringify(cone.getCenterA())}'
|
|
249
|
-
' topCenterPoint: ${JSON.stringify(cone.getCenterB())}'
|
|
250
|
-
' baseCenterRadius: ${JSON.stringify(cone.getRadiusA())}'
|
|
247
|
+
return `${summary}'
|
|
248
|
+
' baseCenterPoint: ${JSON.stringify(cone.getCenterA())}'
|
|
249
|
+
' topCenterPoint: ${JSON.stringify(cone.getCenterB())}'
|
|
250
|
+
' baseCenterRadius: ${JSON.stringify(cone.getRadiusA())}'
|
|
251
251
|
' topCenterRadius: ${JSON.stringify(cone.getRadiusB())}`;
|
|
252
252
|
case "sphere":
|
|
253
253
|
const sphere = solid;
|
|
254
|
-
return `${summary}'
|
|
255
|
-
' centerPoint: ${JSON.stringify(sphere.cloneCenter().toJSON())}'
|
|
254
|
+
return `${summary}'
|
|
255
|
+
' centerPoint: ${JSON.stringify(sphere.cloneCenter().toJSON())}'
|
|
256
256
|
' radius: ${JSON.stringify(sphere.trueSphereRadius())}`;
|
|
257
257
|
case "linearSweep":
|
|
258
258
|
const linearSweep = solid;
|
|
259
|
-
return `${summary}'
|
|
260
|
-
' vector: ${linearSweep.cloneSweepVector().toJSON()}'
|
|
259
|
+
return `${summary}'
|
|
260
|
+
' vector: ${JSON.stringify(linearSweep.cloneSweepVector().toJSON())}'
|
|
261
261
|
' curves${this.summarizeCurveCollection(linearSweep.getCurvesRef())}`;
|
|
262
262
|
case "rotationalSweep":
|
|
263
263
|
const rotationalSweep = solid;
|
|
264
264
|
const axis = rotationalSweep.cloneAxisRay();
|
|
265
|
-
return `${summary}'
|
|
266
|
-
' center: ${axis.origin.toJSON()}'
|
|
267
|
-
' axis: ${JSON.stringify(axis.direction.toJSON())}'
|
|
265
|
+
return `${summary}'
|
|
266
|
+
' center: ${JSON.stringify(axis.origin.toJSON())}'
|
|
267
|
+
' axis: ${JSON.stringify(axis.direction.toJSON())}'
|
|
268
268
|
' sweepAngle: ${rotationalSweep.getSweep().degrees}`;
|
|
269
269
|
case "ruledSweep":
|
|
270
270
|
const ruledSweep = solid;
|
|
271
271
|
const summarizedCollection = ruledSweep.cloneContours().map((curveCollection) => this.summarizeCurveCollection(curveCollection));
|
|
272
|
-
return `${summary}'
|
|
273
|
-
' isClosedVolume${ruledSweep.isClosedVolume}'
|
|
272
|
+
return `${summary}'
|
|
273
|
+
' isClosedVolume${ruledSweep.isClosedVolume}'
|
|
274
274
|
' contours: ${JSON.stringify(summarizedCollection)}`;
|
|
275
275
|
case "torusPipe":
|
|
276
276
|
const torusPipe = solid;
|
|
@@ -281,11 +281,11 @@ class ResponseGenerator {
|
|
|
281
281
|
vectorY.scaleInPlace(-1.0);
|
|
282
282
|
sweep.setRadians(-sweep.radians);
|
|
283
283
|
}
|
|
284
|
-
return `${summary}'
|
|
285
|
-
' center: ${torusPipe.cloneCenter().toJSON()}'
|
|
286
|
-
' xyVectors: ${JSON.stringify([vectorX.toJSON(), vectorY.toJSON()])}'
|
|
287
|
-
' majorRadius: ${torusPipe.getMajorRadius()}'
|
|
288
|
-
' minorRadius: ${torusPipe.getMinorRadius()}'
|
|
284
|
+
return `${summary}'
|
|
285
|
+
' center: ${JSON.stringify(torusPipe.cloneCenter().toJSON())}'
|
|
286
|
+
' xyVectors: ${JSON.stringify([vectorX.toJSON(), vectorY.toJSON()])}'
|
|
287
|
+
' majorRadius: ${torusPipe.getMajorRadius()}'
|
|
288
|
+
' minorRadius: ${torusPipe.getMinorRadius()}'
|
|
289
289
|
' sweepAngle: ${sweep.degrees}`;
|
|
290
290
|
}
|
|
291
291
|
}
|
|
@@ -298,9 +298,9 @@ class ResponseGenerator {
|
|
|
298
298
|
summary = `${summary} center: ${JSON.stringify(arc.center.toJSON())}`;
|
|
299
299
|
if (undefined !== arc.circularRadius)
|
|
300
300
|
summary = `${summary} radius: ${arc.circularRadius()}`;
|
|
301
|
-
summary = `${summary}'
|
|
302
|
-
' vectorX:${arc.vector0.toJSON()}'
|
|
303
|
-
' vectorY:${arc.vector90.toJSON()}'
|
|
301
|
+
summary = `${summary}'
|
|
302
|
+
' vectorX:${JSON.stringify(arc.vector0.toJSON())}'
|
|
303
|
+
' vectorY:${JSON.stringify(arc.vector90.toJSON())}'
|
|
304
304
|
' sweepStartEnd [${arc.sweep.startDegrees}, ${arc.sweep.endDegrees}]`
|
|
305
305
|
+ ` curveLength: ${curve.curveLength()}`;
|
|
306
306
|
return summary;
|
|
@@ -311,34 +311,34 @@ class ResponseGenerator {
|
|
|
311
311
|
return summary;
|
|
312
312
|
case "lineString":
|
|
313
313
|
const lineString = curve;
|
|
314
|
-
summary = `${summary} pointCount: ${lineString.numPoints()}'
|
|
314
|
+
summary = `${summary} pointCount: ${lineString.numPoints()}'
|
|
315
315
|
' curveLength: ${curve.curveLength()}`;
|
|
316
316
|
return summary;
|
|
317
317
|
case "bsplineCurve":
|
|
318
318
|
const bsplineCurve = curve;
|
|
319
|
-
summary = `${summary}'
|
|
320
|
-
' curveOrder: ${bsplineCurve.order}'
|
|
321
|
-
' controlPointsCount: ${bsplineCurve.numPoles}'
|
|
319
|
+
summary = `${summary}'
|
|
320
|
+
' curveOrder: ${bsplineCurve.order}'
|
|
321
|
+
' controlPointsCount: ${bsplineCurve.numPoles}'
|
|
322
322
|
' curveLength: ${curve.curveLength()}`;
|
|
323
323
|
return summary;
|
|
324
324
|
case "interpolationCurve":
|
|
325
325
|
const interpolationCurve = curve;
|
|
326
326
|
const interpolationProps = interpolationCurve.cloneProps();
|
|
327
|
-
summary = `${summary}'
|
|
328
|
-
' curveOrder: ${interpolationProps.order}'
|
|
327
|
+
summary = `${summary}'
|
|
328
|
+
' curveOrder: ${interpolationProps.order}'
|
|
329
329
|
' controlPointsCount: ${interpolationProps.fitPoints.length}`;
|
|
330
330
|
return summary;
|
|
331
331
|
case "akimaCurve":
|
|
332
332
|
const akimaCurve = curve;
|
|
333
333
|
const akimaProps = akimaCurve.cloneProps();
|
|
334
|
-
summary = `${summary}'
|
|
334
|
+
summary = `${summary}'
|
|
335
335
|
' controlPointsCount: ${akimaProps.fitPoints.length}`;
|
|
336
336
|
return summary;
|
|
337
337
|
case "bezierCurve":
|
|
338
338
|
const bezierCurve = curve;
|
|
339
|
-
summary = `${summary}'
|
|
340
|
-
' curveOrder: ${bezierCurve.order}'
|
|
341
|
-
' controlPointsCount: ${bezierCurve.numPoles}'
|
|
339
|
+
summary = `${summary}'
|
|
340
|
+
' curveOrder: ${bezierCurve.order}'
|
|
341
|
+
' controlPointsCount: ${bezierCurve.numPoles}'
|
|
342
342
|
' curveLength: ${curve.curveLength()}`;
|
|
343
343
|
return summary;
|
|
344
344
|
case "transitionSpiral":
|
|
@@ -349,8 +349,8 @@ class ResponseGenerator {
|
|
|
349
349
|
case "curveChainWithDistanceIndex":
|
|
350
350
|
const curveChainWithDistanceIndex = curve;
|
|
351
351
|
const path = curveChainWithDistanceIndex.path;
|
|
352
|
-
summary = `${summary}'
|
|
353
|
-
' curveLength: ${curve.curveLength()}'
|
|
352
|
+
summary = `${summary}'
|
|
353
|
+
' curveLength: ${curve.curveLength()}'
|
|
354
354
|
' isOpen: ${path.isOpenPath}`;
|
|
355
355
|
return summary;
|
|
356
356
|
}
|
|
@@ -367,8 +367,8 @@ class ResponseGenerator {
|
|
|
367
367
|
summary = `${summary} isOpen: ${path.isOpenPath}`;
|
|
368
368
|
break;
|
|
369
369
|
}
|
|
370
|
-
return `${summary}'
|
|
371
|
-
' numCurves: ${curves.collectCurvePrimitives().length}'
|
|
370
|
+
return `${summary}'
|
|
371
|
+
' numCurves: ${curves.collectCurvePrimitives().length}'
|
|
372
372
|
' boundary: ${curves.dgnBoundaryType()}`;
|
|
373
373
|
}
|
|
374
374
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeometrySummary.js","sourceRoot":"","sources":["../../src/GeometrySummary.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAgG;AAChG,wDAK8B;AAC9B,oDAG4B;AAC5B,uCAAoE;AAQpE,uBAAuB;AAEvB,yDAAyD;AACzD,MAAM,iBAAiB;IAQrB,IAAW,UAAU,KAAK,OAAO,sCAAwB,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAEpF,YAAmB,OAAoC,EAAE,MAAgB;QATlE,cAAS,GAAG,sCAAwB,CAAC,KAAK,CAAC;QAC3C,qBAAgB,GAAG,KAAK,CAAC;QAEzB,qBAAgB,GAAG,KAAK,CAAC;QAO9B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;QAC7B,IAAI,SAAS,KAAK,IAAI,EAAE;YACtB,IAAI,CAAC,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,sCAAwB,CAAC,KAAK,CAAC;YAChH,IAAI,CAAC,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC,gBAAgB,CAAC;YACvD,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,CAAC;YACxD,IAAI,CAAC,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC,gBAAgB,CAAC;SACxD;IACH,CAAC;IAEM,iBAAiB;QACtB,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,KAAK,MAAM,SAAS,IAAI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ACT,MAAM,IAAI,GAAS,MAAc,CAAC;gBAClC,OAAO,GAAG,GAAG,OAAO,aAAa,IAAI,CAAC,OAAO,EAAE,CAAC;gBAChD,MAAM;YACR,KAAK,MAAM;gBACT,MAAM,IAAI,GAAS,MAAc,CAAC;gBAClC,OAAO,GAAG,GAAG,OAAO,YAAY,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClD,MAAM;SACT;QAED,OAAO,GAAG,OAAO;mBACF,MAAM,CAAC,sBAAsB,EAAE,CAAC,MAAM;kBACvC,MAAM,CAAC,eAAe,EAAE,EAAE,CAAC;IAC3C,CAAC;CACF;AAED,gBAAgB;AAChB,SAAgB,yBAAyB,CAAC,OAAoC,EAAE,MAAgB;IAC9F,MAAM,SAAS,GAAG,IAAI,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACzD,OAAO,SAAS,CAAC,iBAAiB,EAAE,CAAC;AACvC,CAAC;AAHD,8DAGC","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, BentleyError, Id64Array, Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n AkimaCurve3d, AnyGeometryQuery, Arc3d, BezierCurveBase, Box, BSplineCurve3d, Cone, CurveChainWithDistanceIndex, CurveCollection, CurvePrimitive, IModelJson,\r\n InterpolationCurve3d,\r\n LinearSweep, LineSegment3d, LineString3d, Loop, Path, Range3d, RotationalSweep, RuledSweep, SolidPrimitive, Sphere, TorusPipe, Transform,\r\n TransitionSpiral3d, UVSelect,\r\n} from \"@itwin/core-geometry\";\r\nimport {\r\n BRepEntity, GeometryParams, GeometryStreamIterator, GeometrySummaryRequestProps, GeometrySummaryVerbosity, ImagePrimitive,\r\n IModelError, TextStringPrimitive,\r\n} from \"@itwin/core-common\";\r\nimport { Element, GeometricElement, GeometryPart } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\ninterface ElementGeom {\r\n iterator: GeometryStreamIterator;\r\n geometricElement?: GeometricElement;\r\n}\r\n\r\n// cspell:ignore earlin\r\n\r\n/** Generates an array of GeometryStreamResponseProps. */\r\nclass ResponseGenerator {\r\n public verbosity = GeometrySummaryVerbosity.Basic;\r\n public includePlacement = false;\r\n public includePartReferences?: \"2d\" | \"3d\";\r\n public verboseSymbology = false;\r\n public elementIds: Id64Array;\r\n public iModel: IModelDb;\r\n\r\n public get wantSquish() { return GeometrySummaryVerbosity.Full !== this.verbosity; }\r\n\r\n public constructor(request: GeometrySummaryRequestProps, iModel: IModelDb) {\r\n this.elementIds = request.elementIds;\r\n this.iModel = iModel;\r\n const opts = request.options;\r\n if (undefined !== opts) {\r\n this.verbosity = undefined !== opts.geometryVerbosity ? opts.geometryVerbosity : GeometrySummaryVerbosity.Basic;\r\n this.includePlacement = true === opts.includePlacement;\r\n this.includePartReferences = opts.includePartReferences;\r\n this.verboseSymbology = true === opts.verboseSymbology;\r\n }\r\n }\r\n\r\n public generateSummaries(): string {\r\n const summaries: string[] = [];\r\n for (const elementId of this.elementIds)\r\n summaries.push(this.generateSummary(elementId));\r\n\r\n return summaries.join(\"\\n\");\r\n }\r\n\r\n public generateSummary(id: Id64String): string {\r\n let lines = [`[Geometry Summary for Element ${id}]`];\r\n try {\r\n const geom = this.getElementGeom(id);\r\n if (undefined === geom)\r\n throw new IModelError(IModelStatus.NoGeometry, \"Element is neither a geometric element nor a geometry part\");\r\n\r\n if (undefined !== geom.geometricElement)\r\n lines.push(this.summarizeElement(geom.geometricElement));\r\n else if (undefined !== this.includePartReferences)\r\n lines.push(this.summarizePartReferences(id, \"2d\" === this.includePartReferences)); // NB: Hideously inefficient if more than one element's summary was requested.\r\n\r\n let curGeomParams: GeometryParams | undefined;\r\n let curLocalRange: Range3d | undefined;\r\n for (const entry of geom.iterator) {\r\n if (this.verboseSymbology && (undefined === curGeomParams || !curGeomParams.isEquivalent(entry.geomParams))) {\r\n lines.push(`Symbology: ${this.stringify(entry.geomParams)}`);\r\n curGeomParams = entry.geomParams.clone();\r\n }\r\n\r\n if (undefined !== entry.localRange && (undefined === curLocalRange || !curLocalRange.isAlmostEqual(entry.localRange))) {\r\n lines.push(this.summarizeRange3d(entry.localRange));\r\n curLocalRange = entry.localRange;\r\n }\r\n\r\n const prim = entry.primitive;\r\n switch (prim.type) {\r\n case \"textString\":\r\n case \"image\":\r\n this.summarizePrimitive(lines, prim);\r\n break;\r\n case \"brep\":\r\n this.summarizeBRep(lines, prim.brep);\r\n break;\r\n case \"geometryQuery\":\r\n this.summarizeGeometryQuery(lines, prim.geometry);\r\n break;\r\n case \"partReference\":\r\n lines.push(this.summarizePartReference(prim.part.id, prim.part.toLocal));\r\n break;\r\n }\r\n }\r\n } catch (err) {\r\n lines = lines.slice(0, 1);\r\n lines.push(`ERROR: ${BentleyError.getErrorMessage(err)}`);\r\n }\r\n\r\n return lines.filter((line) => line !== \"\").join(\"\\n\");\r\n }\r\n\r\n public summarizeElement(elem: GeometricElement): string {\r\n const lines: string[] = [];\r\n lines.push(`(${elem.is2d() ? \"2D\" : \"3D\"}) Category: ${elem.category}`);\r\n lines.push(`Model: ${elem.model}`);\r\n if (this.includePlacement) {\r\n lines.push(`Range: ${this.stringify(elem.calculateRange3d())}`);\r\n lines.push(`Transform: ${this.stringify(elem.getPlacementTransform())}`);\r\n }\r\n\r\n return lines.join(\"\\n\");\r\n }\r\n\r\n public summarizePartReferences(id: Id64String, is2d: boolean): string {\r\n const refIds = this.iModel.nativeDb.findGeometryPartReferences([id], is2d);\r\n return `Part references (${refIds.length}): ${refIds.join()}`;\r\n }\r\n\r\n public getElementGeom(id: Id64String): ElementGeom | undefined {\r\n const elem = this.iModel.elements.getElement<Element>({ id, wantGeometry: true });\r\n let iterator: GeometryStreamIterator | undefined;\r\n let geometricElement: GeometricElement | undefined;\r\n if (elem instanceof GeometricElement) {\r\n geometricElement = elem;\r\n if (geometricElement.is2d()) {\r\n iterator = GeometryStreamIterator.fromGeometricElement2d(geometricElement);\r\n } else {\r\n assert(geometricElement.is3d());\r\n iterator = GeometryStreamIterator.fromGeometricElement3d(geometricElement);\r\n }\r\n } else if (elem instanceof GeometryPart) {\r\n iterator = GeometryStreamIterator.fromGeometryPart(elem);\r\n }\r\n\r\n return undefined !== iterator ? { iterator, geometricElement } : undefined;\r\n }\r\n\r\n public summarizeRange3d(range: Range3d): string {\r\n return `SubGraphicRange: ${this.stringify(range)}`;\r\n }\r\n\r\n public summarizePrimitive(lines: string[], primitive: TextStringPrimitive | ImagePrimitive): void {\r\n const summary = primitive.type;\r\n if (GeometrySummaryVerbosity.Basic >= this.verbosity) {\r\n lines.push(summary);\r\n return;\r\n }\r\n\r\n const json = this.stringify(primitive.type === \"textString\" ? primitive.textString : primitive.image);\r\n if (GeometrySummaryVerbosity.Detailed >= this.verbosity) {\r\n lines.push(`${summary}: ${json}`);\r\n return;\r\n }\r\n\r\n lines.push(`${summary}:`);\r\n lines.push(json);\r\n }\r\n\r\n public summarizeBRep(lines: string[], brep: BRepEntity.DataProps): void {\r\n const summary = \"brep\";\r\n if (GeometrySummaryVerbosity.Basic >= this.verbosity) {\r\n lines.push(summary);\r\n return;\r\n }\r\n\r\n const json = this.stringify({ type: brep.type, transform: brep.transform, faceSymbology: brep.faceSymbology });\r\n if (GeometrySummaryVerbosity.Detailed >= this.verbosity) {\r\n lines.push(`${summary}: ${json}`);\r\n return;\r\n }\r\n\r\n lines.push(`${summary}:`);\r\n lines.push(json);\r\n }\r\n\r\n public summarizePartReference(partId: string, partToLocal?: Transform): string {\r\n let line = `part id: ${partId}`;\r\n if (undefined !== partToLocal)\r\n line = `${line} transform: ${this.stringify(partToLocal)}`;\r\n\r\n return line;\r\n }\r\n\r\n public summarizeGeometryQuery(lines: string[], query: AnyGeometryQuery): void {\r\n switch (this.verbosity) {\r\n case GeometrySummaryVerbosity.Detailed:\r\n lines.push(this.summarizeGeometryQueryDetailed(query));\r\n break;\r\n case GeometrySummaryVerbosity.Full:\r\n lines.push(this.summarizeGeometryQueryFull(query));\r\n break;\r\n default:\r\n lines.push(this.summarizeGeometryQueryBasic(query));\r\n break;\r\n }\r\n }\r\n\r\n public summarizeGeometryQueryBasic(query: AnyGeometryQuery): string {\r\n switch (query.geometryCategory) {\r\n case \"solid\":\r\n return query.solidPrimitiveType;\r\n case \"curvePrimitive\":\r\n return query.curvePrimitiveType;\r\n case \"curveCollection\":\r\n return query.curveCollectionType;\r\n default:\r\n return query.geometryCategory;\r\n }\r\n }\r\n\r\n public summarizeGeometryQueryFull(query: AnyGeometryQuery): string {\r\n return this.geometryQueryToJson(query);\r\n }\r\n\r\n public geometryQueryToJson(query: AnyGeometryQuery): string {\r\n try {\r\n const json = IModelJson.Writer.toIModelJson(query);\r\n const str = JSON.stringify(json);\r\n return this.wantSquish ? this.squish(str) : str;\r\n } catch (err) {\r\n return BentleyError.getErrorMessage(err);\r\n }\r\n }\r\n\r\n // Earlin likes to put tons of whitespace + newlines into his JSON. Remove it.\r\n public squish(str: string): string {\r\n return str.replace(/\\s+/g, \"\");\r\n }\r\n\r\n public stringify(obj: object): string {\r\n const json = JSON.stringify(obj);\r\n return this.wantSquish ? this.squish(json) : json;\r\n }\r\n\r\n public summarizeGeometryQueryDetailed(query: AnyGeometryQuery): string {\r\n let summary = `${this.summarizeGeometryQueryBasic(query)}: `;\r\n switch (query.geometryCategory) {\r\n case \"solid\":\r\n return summary + this.summarizeSolidPrimitive(query);\r\n case \"curvePrimitive\":\r\n return summary + this.summarizeCurvePrimitive(query);\r\n case \"curveCollection\":\r\n return summary + this.summarizeCurveCollection(query);\r\n case \"pointCollection\":\r\n return `${summary} numPoints: ${query.points.length}`;\r\n case \"bsurf\":\r\n return `${summary}'\r\n ' poleDimension: ${query.poleDimension}'\r\n ' numPolesTotal: ${query.numPolesTotal()}'\r\n ' degree[U,V]: ${JSON.stringify([query.degreeUV(UVSelect.uDirection), query.degreeUV(UVSelect.vDirection)])}'\r\n ' order[U,V]: ${JSON.stringify([query.orderUV(UVSelect.uDirection), query.orderUV(UVSelect.vDirection)])}'\r\n ' numSpan[U,V]: ${JSON.stringify([query.numSpanUV(UVSelect.uDirection), query.numSpanUV(UVSelect.vDirection)])}'\r\n ' numPoles[U,V]: ${JSON.stringify([query.numPolesUV(UVSelect.uDirection), query.numPolesUV(UVSelect.vDirection)])}'\r\n ' poleStep[U,V]: ${JSON.stringify([query.poleStepUV(UVSelect.uDirection), query.poleStepUV(UVSelect.vDirection)])}`;\r\n case \"polyface\": {\r\n const data = query.data;\r\n summary = `${summary} pointCount: ${data.point.length}'\r\n ' pointIndexCount: ${data.pointIndex.length}`;\r\n if (query.twoSided)\r\n summary = `${summary} (two-sided)`;\r\n if (undefined !== data.normal)\r\n summary = `${summary} normalCount: ${data.normal.length}`;\r\n if (undefined !== data.param)\r\n summary = `${summary} paramCount: ${data.param.length}`;\r\n if (undefined !== data.color)\r\n summary = `${summary} colorCount: ${data.color.length}`;\r\n\r\n return summary;\r\n }\r\n case \"point\":\r\n return summary + this.geometryQueryToJson(query);\r\n }\r\n }\r\n\r\n public summarizeSolidPrimitive(solid: SolidPrimitive): string {\r\n const summary: string = solid.capped ? \" capped\" : \" uncapped\";\r\n switch (solid.solidPrimitiveType) {\r\n case \"box\":\r\n const box: Box = (solid as Box);\r\n return `${summary}'\r\n ' origin: ${JSON.stringify(box.getBaseOrigin().toJSON())}'\r\n ' topOrigin: ${JSON.stringify(box.getTopOrigin().toJSON())}'\r\n ' baseX: ${box.getBaseX()}'\r\n ' baseY: ${box.getBaseY()}`;\r\n case \"cone\":\r\n const cone: Cone = solid as Cone;\r\n return `${summary}'\r\n ' baseCenterPoint: ${JSON.stringify(cone.getCenterA())}'\r\n ' topCenterPoint: ${JSON.stringify(cone.getCenterB())}'\r\n ' baseCenterRadius: ${JSON.stringify(cone.getRadiusA())}'\r\n ' topCenterRadius: ${JSON.stringify(cone.getRadiusB())}`;\r\n case \"sphere\":\r\n const sphere: Sphere = solid as Sphere;\r\n return `${summary}'\r\n ' centerPoint: ${JSON.stringify(sphere.cloneCenter().toJSON())}'\r\n ' radius: ${JSON.stringify(sphere.trueSphereRadius())}`;\r\n case \"linearSweep\":\r\n const linearSweep: LinearSweep = solid as LinearSweep;\r\n return `${summary}'\r\n ' vector: ${linearSweep.cloneSweepVector().toJSON()}'\r\n ' curves${this.summarizeCurveCollection(linearSweep.getCurvesRef())}`;\r\n case \"rotationalSweep\":\r\n const rotationalSweep: RotationalSweep = solid as RotationalSweep;\r\n const axis = rotationalSweep.cloneAxisRay();\r\n return `${summary}'\r\n ' center: ${axis.origin.toJSON()}'\r\n ' axis: ${JSON.stringify(axis.direction.toJSON())}'\r\n ' sweepAngle: ${rotationalSweep.getSweep().degrees}`;\r\n case \"ruledSweep\":\r\n const ruledSweep: RuledSweep = solid as RuledSweep;\r\n const summarizedCollection = ruledSweep.cloneContours().map((curveCollection) => this.summarizeCurveCollection(curveCollection));\r\n return `${summary}'\r\n ' isClosedVolume${ruledSweep.isClosedVolume}'\r\n ' contours: ${JSON.stringify(summarizedCollection)}`;\r\n case \"torusPipe\":\r\n const torusPipe: TorusPipe = solid as TorusPipe;\r\n const vectorX = torusPipe.cloneVectorX();\r\n const vectorY = torusPipe.cloneVectorY();\r\n const sweep = torusPipe.getSweepAngle();\r\n if (torusPipe.getIsReversed()) {\r\n vectorY.scaleInPlace(-1.0);\r\n sweep.setRadians(-sweep.radians);\r\n }\r\n return `${summary}'\r\n ' center: ${torusPipe.cloneCenter().toJSON()}'\r\n ' xyVectors: ${JSON.stringify([vectorX.toJSON(), vectorY.toJSON()])}'\r\n ' majorRadius: ${torusPipe.getMajorRadius()}'\r\n ' minorRadius: ${torusPipe.getMinorRadius()}'\r\n ' sweepAngle: ${sweep.degrees}`;\r\n }\r\n }\r\n\r\n public summarizeCurvePrimitive(curve: CurvePrimitive): string {\r\n let summary: string = \"\";\r\n const writer = new IModelJson.Writer();\r\n switch (curve.curvePrimitiveType) {\r\n case \"arc\":\r\n const arc: Arc3d = curve as Arc3d;\r\n summary = `${summary} center: ${JSON.stringify(arc.center.toJSON())}`;\r\n if (undefined !== arc.circularRadius)\r\n summary = `${summary} radius: ${arc.circularRadius()}`;\r\n summary = `${summary}'\r\n ' vectorX:${arc.vector0.toJSON()}'\r\n ' vectorY:${arc.vector90.toJSON()}'\r\n ' sweepStartEnd [${arc.sweep.startDegrees}, ${arc.sweep.endDegrees}]`\r\n + ` curveLength: ${curve.curveLength()}`;\r\n return summary;\r\n case \"lineSegment\":\r\n const lineSegment: LineSegment3d = curve as LineSegment3d;\r\n summary = `${summary} points: ${JSON.stringify(lineSegment.toJSON())}`;\r\n summary = `${summary} curveLength: ${curve.curveLength()}`;\r\n return summary;\r\n case \"lineString\":\r\n const lineString: LineString3d = curve as LineString3d;\r\n summary = `${summary} pointCount: ${lineString.numPoints()}'\r\n ' curveLength: ${curve.curveLength()}`;\r\n return summary;\r\n case \"bsplineCurve\":\r\n const bsplineCurve: BSplineCurve3d = curve as BSplineCurve3d;\r\n summary = `${summary}'\r\n ' curveOrder: ${bsplineCurve.order}'\r\n ' controlPointsCount: ${bsplineCurve.numPoles}'\r\n ' curveLength: ${curve.curveLength()}`;\r\n return summary;\r\n case \"interpolationCurve\":\r\n const interpolationCurve: InterpolationCurve3d = curve as InterpolationCurve3d;\r\n const interpolationProps = interpolationCurve.cloneProps();\r\n summary = `${summary}'\r\n ' curveOrder: ${interpolationProps.order}'\r\n ' controlPointsCount: ${interpolationProps.fitPoints.length}`;\r\n return summary;\r\n case \"akimaCurve\":\r\n const akimaCurve: AkimaCurve3d = curve as AkimaCurve3d;\r\n const akimaProps = akimaCurve.cloneProps();\r\n summary = `${summary}'\r\n ' controlPointsCount: ${akimaProps.fitPoints.length}`;\r\n return summary;\r\n case \"bezierCurve\":\r\n const bezierCurve: BezierCurveBase = curve as BezierCurveBase;\r\n summary = `${summary}'\r\n ' curveOrder: ${bezierCurve.order}'\r\n ' controlPointsCount: ${bezierCurve.numPoles}'\r\n ' curveLength: ${curve.curveLength()}`;\r\n return summary;\r\n case \"transitionSpiral\":\r\n const transitionSpiral: TransitionSpiral3d = curve as TransitionSpiral3d;\r\n const json = writer.handleTransitionSpiral(transitionSpiral);\r\n summary = summary + JSON.stringify(json);\r\n return summary;\r\n case \"curveChainWithDistanceIndex\":\r\n const curveChainWithDistanceIndex: CurveChainWithDistanceIndex = curve as CurveChainWithDistanceIndex;\r\n const path = curveChainWithDistanceIndex.path;\r\n summary = `${summary}'\r\n ' curveLength: ${curve.curveLength()}'\r\n ' isOpen: ${path.isOpenPath}`;\r\n return summary;\r\n }\r\n }\r\n\r\n public summarizeCurveCollection(curves: CurveCollection): string {\r\n let summary: string = \"\";\r\n switch (curves.curveCollectionType) {\r\n case \"loop\":\r\n const loop: Loop = curves as Loop;\r\n summary = `${summary} isInner: ${loop.isInner}`;\r\n break;\r\n case \"path\":\r\n const path: Path = curves as Path;\r\n summary = `${summary} isOpen: ${path.isOpenPath}`;\r\n break;\r\n }\r\n\r\n return `${summary}'\r\n ' numCurves: ${curves.collectCurvePrimitives().length}'\r\n ' boundary: ${curves.dgnBoundaryType()}`;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function generateGeometrySummaries(request: GeometrySummaryRequestProps, iModel: IModelDb): string {\r\n const generator = new ResponseGenerator(request, iModel);\r\n return generator.generateSummaries();\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"GeometrySummary.js","sourceRoot":"","sources":["../../src/GeometrySummary.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAgG;AAChG,wDAK8B;AAC9B,oDAG4B;AAC5B,uCAAoE;AAQpE,uBAAuB;AAEvB,yDAAyD;AACzD,MAAM,iBAAiB;IAQrB,IAAW,UAAU,KAAK,OAAO,sCAAwB,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAEpF,YAAmB,OAAoC,EAAE,MAAgB;QATlE,cAAS,GAAG,s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GAAG,OAAO,aAAa,IAAI,CAAC,OAAO,EAAE,CAAC;gBAChD,MAAM;YACR,KAAK,MAAM;gBACT,MAAM,IAAI,GAAS,MAAc,CAAC;gBAClC,OAAO,GAAG,GAAG,OAAO,YAAY,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClD,MAAM;QACV,CAAC;QAED,OAAO,GAAG,OAAO;mBACF,MAAM,CAAC,sBAAsB,EAAE,CAAC,MAAM;kBACvC,MAAM,CAAC,eAAe,EAAE,EAAE,CAAC;IAC3C,CAAC;CACF;AAED,gBAAgB;AAChB,SAAgB,yBAAyB,CAAC,OAAoC,EAAE,MAAgB;IAC9F,MAAM,SAAS,GAAG,IAAI,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACzD,OAAO,SAAS,CAAC,iBAAiB,EAAE,CAAC;AACvC,CAAC;AAHD,8DAGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { assert, BentleyError, Id64Array, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n AkimaCurve3d, AnyGeometryQuery, Arc3d, BezierCurveBase, Box, BSplineCurve3d, Cone, CurveChainWithDistanceIndex, CurveCollection, CurvePrimitive, IModelJson,\n InterpolationCurve3d,\n LinearSweep, LineSegment3d, LineString3d, Loop, Path, Range3d, RotationalSweep, RuledSweep, SolidPrimitive, Sphere, TorusPipe, Transform,\n TransitionSpiral3d, UVSelect,\n} from \"@itwin/core-geometry\";\nimport {\n BRepEntity, GeometryParams, GeometryStreamIterator, GeometrySummaryRequestProps, GeometrySummaryVerbosity, ImagePrimitive,\n IModelError, TextStringPrimitive,\n} from \"@itwin/core-common\";\nimport { Element, GeometricElement, GeometryPart } from \"./Element\";\nimport { IModelDb } from \"./IModelDb\";\n\ninterface ElementGeom {\n iterator: GeometryStreamIterator;\n geometricElement?: GeometricElement;\n}\n\n// cspell:ignore earlin\n\n/** Generates an array of GeometryStreamResponseProps. */\nclass ResponseGenerator {\n public verbosity = GeometrySummaryVerbosity.Basic;\n public includePlacement = false;\n public includePartReferences?: \"2d\" | \"3d\";\n public verboseSymbology = false;\n public elementIds: Id64Array;\n public iModel: IModelDb;\n\n public get wantSquish() { return GeometrySummaryVerbosity.Full !== this.verbosity; }\n\n public constructor(request: GeometrySummaryRequestProps, iModel: IModelDb) {\n this.elementIds = request.elementIds;\n this.iModel = iModel;\n const opts = request.options;\n if (undefined !== opts) {\n this.verbosity = undefined !== opts.geometryVerbosity ? opts.geometryVerbosity : GeometrySummaryVerbosity.Basic;\n this.includePlacement = true === opts.includePlacement;\n this.includePartReferences = opts.includePartReferences;\n this.verboseSymbology = true === opts.verboseSymbology;\n }\n }\n\n public generateSummaries(): string {\n const summaries: string[] = [];\n for (const elementId of this.elementIds)\n summaries.push(this.generateSummary(elementId));\n\n return summaries.join(\"\\n\");\n }\n\n public generateSummary(id: Id64String): string {\n let lines = [`[Geometry Summary for Element ${id}]`];\n try {\n const geom = this.getElementGeom(id);\n if (undefined === geom)\n throw new IModelError(IModelStatus.NoGeometry, \"Element is neither a geometric element nor a geometry part\");\n\n if (undefined !== geom.geometricElement)\n lines.push(this.summarizeElement(geom.geometricElement));\n else if (undefined !== this.includePartReferences)\n lines.push(this.summarizePartReferences(id, \"2d\" === this.includePartReferences)); // NB: Hideously inefficient if more than one element's summary was requested.\n\n let curGeomParams: GeometryParams | undefined;\n let curLocalRange: Range3d | undefined;\n for (const entry of geom.iterator) {\n if (this.verboseSymbology && (undefined === curGeomParams || !curGeomParams.isEquivalent(entry.geomParams))) {\n lines.push(`Symbology: ${this.stringify(entry.geomParams)}`);\n curGeomParams = entry.geomParams.clone();\n }\n\n if (undefined !== entry.localRange && (undefined === curLocalRange || !curLocalRange.isAlmostEqual(entry.localRange))) {\n lines.push(this.summarizeRange3d(entry.localRange));\n curLocalRange = entry.localRange;\n }\n\n const prim = entry.primitive;\n switch (prim.type) {\n case \"textString\":\n case \"image\":\n this.summarizePrimitive(lines, prim);\n break;\n case \"brep\":\n this.summarizeBRep(lines, prim.brep);\n break;\n case \"geometryQuery\":\n this.summarizeGeometryQuery(lines, prim.geometry);\n break;\n case \"partReference\":\n lines.push(this.summarizePartReference(prim.part.id, prim.part.toLocal));\n break;\n }\n }\n } catch (err) {\n lines = lines.slice(0, 1);\n lines.push(`ERROR: ${BentleyError.getErrorMessage(err)}`);\n }\n\n return lines.filter((line) => line !== \"\").join(\"\\n\");\n }\n\n public summarizeElement(elem: GeometricElement): string {\n const lines: string[] = [];\n lines.push(`(${elem.is2d() ? \"2D\" : \"3D\"}) Category: ${elem.category}`);\n lines.push(`Model: ${elem.model}`);\n if (this.includePlacement) {\n lines.push(`Range: ${this.stringify(elem.calculateRange3d())}`);\n lines.push(`Transform: ${this.stringify(elem.getPlacementTransform())}`);\n }\n\n return lines.join(\"\\n\");\n }\n\n public summarizePartReferences(id: Id64String, is2d: boolean): string {\n const refIds = this.iModel.nativeDb.findGeometryPartReferences([id], is2d);\n return `Part references (${refIds.length}): ${refIds.join()}`;\n }\n\n public getElementGeom(id: Id64String): ElementGeom | undefined {\n const elem = this.iModel.elements.getElement<Element>({ id, wantGeometry: true });\n let iterator: GeometryStreamIterator | undefined;\n let geometricElement: GeometricElement | undefined;\n if (elem instanceof GeometricElement) {\n geometricElement = elem;\n if (geometricElement.is2d()) {\n iterator = GeometryStreamIterator.fromGeometricElement2d(geometricElement);\n } else {\n assert(geometricElement.is3d());\n iterator = GeometryStreamIterator.fromGeometricElement3d(geometricElement);\n }\n } else if (elem instanceof GeometryPart) {\n iterator = GeometryStreamIterator.fromGeometryPart(elem);\n }\n\n return undefined !== iterator ? { iterator, geometricElement } : undefined;\n }\n\n public summarizeRange3d(range: Range3d): string {\n return `SubGraphicRange: ${this.stringify(range)}`;\n }\n\n public summarizePrimitive(lines: string[], primitive: TextStringPrimitive | ImagePrimitive): void {\n const summary = primitive.type;\n if (GeometrySummaryVerbosity.Basic >= this.verbosity) {\n lines.push(summary);\n return;\n }\n\n const json = this.stringify(primitive.type === \"textString\" ? primitive.textString : primitive.image);\n if (GeometrySummaryVerbosity.Detailed >= this.verbosity) {\n lines.push(`${summary}: ${json}`);\n return;\n }\n\n lines.push(`${summary}:`);\n lines.push(json);\n }\n\n public summarizeBRep(lines: string[], brep: BRepEntity.DataProps): void {\n const summary = \"brep\";\n if (GeometrySummaryVerbosity.Basic >= this.verbosity) {\n lines.push(summary);\n return;\n }\n\n const json = this.stringify({ type: brep.type, transform: brep.transform, faceSymbology: brep.faceSymbology });\n if (GeometrySummaryVerbosity.Detailed >= this.verbosity) {\n lines.push(`${summary}: ${json}`);\n return;\n }\n\n lines.push(`${summary}:`);\n lines.push(json);\n }\n\n public summarizePartReference(partId: string, partToLocal?: Transform): string {\n let line = `part id: ${partId}`;\n if (undefined !== partToLocal)\n line = `${line} transform: ${this.stringify(partToLocal)}`;\n\n return line;\n }\n\n public summarizeGeometryQuery(lines: string[], query: AnyGeometryQuery): void {\n switch (this.verbosity) {\n case GeometrySummaryVerbosity.Detailed:\n lines.push(this.summarizeGeometryQueryDetailed(query));\n break;\n case GeometrySummaryVerbosity.Full:\n lines.push(this.summarizeGeometryQueryFull(query));\n break;\n default:\n lines.push(this.summarizeGeometryQueryBasic(query));\n break;\n }\n }\n\n public summarizeGeometryQueryBasic(query: AnyGeometryQuery): string {\n switch (query.geometryCategory) {\n case \"solid\":\n return query.solidPrimitiveType;\n case \"curvePrimitive\":\n return query.curvePrimitiveType;\n case \"curveCollection\":\n return query.curveCollectionType;\n default:\n return query.geometryCategory;\n }\n }\n\n public summarizeGeometryQueryFull(query: AnyGeometryQuery): string {\n return this.geometryQueryToJson(query);\n }\n\n public geometryQueryToJson(query: AnyGeometryQuery): string {\n try {\n const json = IModelJson.Writer.toIModelJson(query);\n const str = JSON.stringify(json);\n return this.wantSquish ? this.squish(str) : str;\n } catch (err) {\n return BentleyError.getErrorMessage(err);\n }\n }\n\n // Earlin likes to put tons of whitespace + newlines into his JSON. Remove it.\n public squish(str: string): string {\n return str.replace(/\\s+/g, \"\");\n }\n\n public stringify(obj: object): string {\n const json = JSON.stringify(obj);\n return this.wantSquish ? this.squish(json) : json;\n }\n\n public summarizeGeometryQueryDetailed(query: AnyGeometryQuery): string {\n let summary = `${this.summarizeGeometryQueryBasic(query)}: `;\n switch (query.geometryCategory) {\n case \"solid\":\n return summary + this.summarizeSolidPrimitive(query);\n case \"curvePrimitive\":\n return summary + this.summarizeCurvePrimitive(query);\n case \"curveCollection\":\n return summary + this.summarizeCurveCollection(query);\n case \"pointCollection\":\n return `${summary} numPoints: ${query.points.length}`;\n case \"bsurf\":\n return `${summary}'\n ' poleDimension: ${query.poleDimension}'\n ' numPolesTotal: ${query.numPolesTotal()}'\n ' degree[U,V]: ${JSON.stringify([query.degreeUV(UVSelect.uDirection), query.degreeUV(UVSelect.vDirection)])}'\n ' order[U,V]: ${JSON.stringify([query.orderUV(UVSelect.uDirection), query.orderUV(UVSelect.vDirection)])}'\n ' numSpan[U,V]: ${JSON.stringify([query.numSpanUV(UVSelect.uDirection), query.numSpanUV(UVSelect.vDirection)])}'\n ' numPoles[U,V]: ${JSON.stringify([query.numPolesUV(UVSelect.uDirection), query.numPolesUV(UVSelect.vDirection)])}'\n ' poleStep[U,V]: ${JSON.stringify([query.poleStepUV(UVSelect.uDirection), query.poleStepUV(UVSelect.vDirection)])}`;\n case \"polyface\": {\n const data = query.data;\n summary = `${summary} pointCount: ${data.point.length}'\n ' pointIndexCount: ${data.pointIndex.length}`;\n if (query.twoSided)\n summary = `${summary} (two-sided)`;\n if (undefined !== data.normal)\n summary = `${summary} normalCount: ${data.normal.length}`;\n if (undefined !== data.param)\n summary = `${summary} paramCount: ${data.param.length}`;\n if (undefined !== data.color)\n summary = `${summary} colorCount: ${data.color.length}`;\n\n return summary;\n }\n case \"point\":\n return summary + this.geometryQueryToJson(query);\n }\n }\n\n public summarizeSolidPrimitive(solid: SolidPrimitive): string {\n const summary: string = solid.capped ? \" capped\" : \" uncapped\";\n switch (solid.solidPrimitiveType) {\n case \"box\":\n const box: Box = (solid as Box);\n return `${summary}'\n ' origin: ${JSON.stringify(box.getBaseOrigin().toJSON())}'\n ' topOrigin: ${JSON.stringify(box.getTopOrigin().toJSON())}'\n ' baseX: ${box.getBaseX()}'\n ' baseY: ${box.getBaseY()}`;\n case \"cone\":\n const cone: Cone = solid as Cone;\n return `${summary}'\n ' baseCenterPoint: ${JSON.stringify(cone.getCenterA())}'\n ' topCenterPoint: ${JSON.stringify(cone.getCenterB())}'\n ' baseCenterRadius: ${JSON.stringify(cone.getRadiusA())}'\n ' topCenterRadius: ${JSON.stringify(cone.getRadiusB())}`;\n case \"sphere\":\n const sphere: Sphere = solid as Sphere;\n return `${summary}'\n ' centerPoint: ${JSON.stringify(sphere.cloneCenter().toJSON())}'\n ' radius: ${JSON.stringify(sphere.trueSphereRadius())}`;\n case \"linearSweep\":\n const linearSweep: LinearSweep = solid as LinearSweep;\n return `${summary}'\n ' vector: ${JSON.stringify(linearSweep.cloneSweepVector().toJSON())}'\n ' curves${this.summarizeCurveCollection(linearSweep.getCurvesRef())}`;\n case \"rotationalSweep\":\n const rotationalSweep: RotationalSweep = solid as RotationalSweep;\n const axis = rotationalSweep.cloneAxisRay();\n return `${summary}'\n ' center: ${JSON.stringify(axis.origin.toJSON())}'\n ' axis: ${JSON.stringify(axis.direction.toJSON())}'\n ' sweepAngle: ${rotationalSweep.getSweep().degrees}`;\n case \"ruledSweep\":\n const ruledSweep: RuledSweep = solid as RuledSweep;\n const summarizedCollection = ruledSweep.cloneContours().map((curveCollection) => this.summarizeCurveCollection(curveCollection));\n return `${summary}'\n ' isClosedVolume${ruledSweep.isClosedVolume}'\n ' contours: ${JSON.stringify(summarizedCollection)}`;\n case \"torusPipe\":\n const torusPipe: TorusPipe = solid as TorusPipe;\n const vectorX = torusPipe.cloneVectorX();\n const vectorY = torusPipe.cloneVectorY();\n const sweep = torusPipe.getSweepAngle();\n if (torusPipe.getIsReversed()) {\n vectorY.scaleInPlace(-1.0);\n sweep.setRadians(-sweep.radians);\n }\n return `${summary}'\n ' center: ${JSON.stringify(torusPipe.cloneCenter().toJSON())}'\n ' xyVectors: ${JSON.stringify([vectorX.toJSON(), vectorY.toJSON()])}'\n ' majorRadius: ${torusPipe.getMajorRadius()}'\n ' minorRadius: ${torusPipe.getMinorRadius()}'\n ' sweepAngle: ${sweep.degrees}`;\n }\n }\n\n public summarizeCurvePrimitive(curve: CurvePrimitive): string {\n let summary: string = \"\";\n const writer = new IModelJson.Writer();\n switch (curve.curvePrimitiveType) {\n case \"arc\":\n const arc: Arc3d = curve as Arc3d;\n summary = `${summary} center: ${JSON.stringify(arc.center.toJSON())}`;\n if (undefined !== arc.circularRadius)\n summary = `${summary} radius: ${arc.circularRadius()}`;\n summary = `${summary}'\n ' vectorX:${JSON.stringify(arc.vector0.toJSON())}'\n ' vectorY:${JSON.stringify(arc.vector90.toJSON())}'\n ' sweepStartEnd [${arc.sweep.startDegrees}, ${arc.sweep.endDegrees}]`\n + ` curveLength: ${curve.curveLength()}`;\n return summary;\n case \"lineSegment\":\n const lineSegment: LineSegment3d = curve as LineSegment3d;\n summary = `${summary} points: ${JSON.stringify(lineSegment.toJSON())}`;\n summary = `${summary} curveLength: ${curve.curveLength()}`;\n return summary;\n case \"lineString\":\n const lineString: LineString3d = curve as LineString3d;\n summary = `${summary} pointCount: ${lineString.numPoints()}'\n ' curveLength: ${curve.curveLength()}`;\n return summary;\n case \"bsplineCurve\":\n const bsplineCurve: BSplineCurve3d = curve as BSplineCurve3d;\n summary = `${summary}'\n ' curveOrder: ${bsplineCurve.order}'\n ' controlPointsCount: ${bsplineCurve.numPoles}'\n ' curveLength: ${curve.curveLength()}`;\n return summary;\n case \"interpolationCurve\":\n const interpolationCurve: InterpolationCurve3d = curve as InterpolationCurve3d;\n const interpolationProps = interpolationCurve.cloneProps();\n summary = `${summary}'\n ' curveOrder: ${interpolationProps.order}'\n ' controlPointsCount: ${interpolationProps.fitPoints.length}`;\n return summary;\n case \"akimaCurve\":\n const akimaCurve: AkimaCurve3d = curve as AkimaCurve3d;\n const akimaProps = akimaCurve.cloneProps();\n summary = `${summary}'\n ' controlPointsCount: ${akimaProps.fitPoints.length}`;\n return summary;\n case \"bezierCurve\":\n const bezierCurve: BezierCurveBase = curve as BezierCurveBase;\n summary = `${summary}'\n ' curveOrder: ${bezierCurve.order}'\n ' controlPointsCount: ${bezierCurve.numPoles}'\n ' curveLength: ${curve.curveLength()}`;\n return summary;\n case \"transitionSpiral\":\n const transitionSpiral: TransitionSpiral3d = curve as TransitionSpiral3d;\n const json = writer.handleTransitionSpiral(transitionSpiral);\n summary = summary + JSON.stringify(json);\n return summary;\n case \"curveChainWithDistanceIndex\":\n const curveChainWithDistanceIndex: CurveChainWithDistanceIndex = curve as CurveChainWithDistanceIndex;\n const path = curveChainWithDistanceIndex.path;\n summary = `${summary}'\n ' curveLength: ${curve.curveLength()}'\n ' isOpen: ${path.isOpenPath}`;\n return summary;\n }\n }\n\n public summarizeCurveCollection(curves: CurveCollection): string {\n let summary: string = \"\";\n switch (curves.curveCollectionType) {\n case \"loop\":\n const loop: Loop = curves as Loop;\n summary = `${summary} isInner: ${loop.isInner}`;\n break;\n case \"path\":\n const path: Path = curves as Path;\n summary = `${summary} isOpen: ${path.isOpenPath}`;\n break;\n }\n\n return `${summary}'\n ' numCurves: ${curves.collectCurvePrimitives().length}'\n ' boundary: ${curves.dgnBoundaryType()}`;\n }\n}\n\n/** @internal */\nexport function generateGeometrySummaries(request: GeometrySummaryRequestProps, iModel: IModelDb): string {\n const generator = new ResponseGenerator(request, iModel);\n return generator.generateSummaries();\n}\n"]}
|