@itwin/core-backend 4.8.0-dev.9 → 4.9.0-dev.2
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 +45 -1
- package/lib/cjs/BackendHubAccess.d.ts +18 -16
- package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
- package/lib/cjs/BackendHubAccess.js +16 -15
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +19 -11
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/Category.d.ts +0 -6
- package/lib/cjs/Category.d.ts.map +1 -1
- package/lib/cjs/Category.js +0 -6
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +13 -11
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.d.ts.map +1 -1
- package/lib/cjs/ChangedElementsDb.js +5 -3
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangedElementsManager.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +242 -237
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChannelControl.d.ts +4 -26
- package/lib/cjs/ChannelControl.d.ts.map +1 -1
- package/lib/cjs/ChannelControl.js +2 -101
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.d.ts.map +1 -1
- package/lib/cjs/CheckpointManager.js +5 -3
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts.map +1 -1
- package/lib/cjs/ClassRegistry.js +8 -7
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +1 -1
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js +2 -2
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js.map +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.d.ts.map +1 -1
- package/lib/cjs/DevTools.js +2 -1
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +0 -3
- package/lib/cjs/DisplayStyle.d.ts.map +1 -1
- package/lib/cjs/DisplayStyle.js +0 -3
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +6 -1
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +19 -14
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js +2 -2
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +6 -3
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +3 -3
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +2 -59
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +7 -63
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +0 -5
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +4 -8
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.d.ts.map +1 -1
- package/lib/cjs/ElementGraphics.js +2 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts +19 -0
- package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
- package/lib/cjs/ElementTreeWalker.js +23 -9
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
- package/lib/cjs/GeoCoordConfig.js +2 -1
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.js +2 -2
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/GeometrySummary.d.ts.map +1 -1
- package/lib/cjs/GeometrySummary.js +49 -48
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/HubMock.js.map +1 -1
- package/lib/cjs/IModelCloneContext.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +24 -94
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +196 -151
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js +5 -4
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +5 -3
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +16 -18
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/IpcHost.d.ts.map +1 -1
- package/lib/cjs/IpcHost.js +15 -13
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.d.ts +2 -2
- package/lib/cjs/LocalHub.d.ts.map +1 -1
- package/lib/cjs/LocalHub.js +18 -18
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/LockControl.d.ts +73 -0
- package/lib/cjs/LockControl.d.ts.map +1 -0
- package/lib/cjs/LockControl.js +11 -0
- package/lib/cjs/LockControl.js.map +1 -0
- package/lib/cjs/Material.d.ts +2 -5
- package/lib/cjs/Material.d.ts.map +1 -1
- package/lib/cjs/Material.js +1 -4
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +0 -22
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js +5 -26
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.d.ts +0 -12
- package/lib/cjs/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +5 -16
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +6 -1
- package/lib/cjs/SQLiteDb.d.ts.map +1 -1
- package/lib/cjs/SQLiteDb.js +23 -16
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.d.ts +3 -0
- package/lib/cjs/SchemaSync.d.ts.map +1 -1
- package/lib/cjs/SchemaSync.js +24 -11
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js +3 -3
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js +2 -2
- 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.js.map +1 -1
- package/lib/cjs/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/TextAnnotationLayout.js.map +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +2 -1
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +4 -2
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +1 -18
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +1 -18
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.d.ts.map +1 -1
- package/lib/cjs/ViewStore.js +6 -5
- 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/Base.Schema.json +32 -32
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
- package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
- package/lib/cjs/core-backend.d.ts +2 -1
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +3 -5
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts +0 -10
- package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js +0 -10
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js +2 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.d.ts +0 -18
- package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
- package/lib/cjs/domains/GenericElements.js +0 -18
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/internal/ChangesetConflictArgs.d.ts +24 -0
- package/lib/cjs/internal/ChangesetConflictArgs.d.ts.map +1 -0
- package/lib/cjs/internal/ChangesetConflictArgs.js +7 -0
- package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -0
- package/lib/cjs/internal/ChannelAdmin.d.ts +34 -0
- package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -0
- package/lib/cjs/internal/ChannelAdmin.js +117 -0
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -0
- package/lib/cjs/internal/NativePlatform.d.ts +15 -0
- package/lib/cjs/internal/NativePlatform.d.ts.map +1 -0
- package/lib/cjs/internal/NativePlatform.js +49 -0
- package/lib/cjs/internal/NativePlatform.js.map +1 -0
- package/lib/cjs/internal/NoLocks.d.ts +6 -0
- package/lib/cjs/internal/NoLocks.d.ts.map +1 -0
- package/lib/cjs/internal/NoLocks.js +31 -0
- package/lib/cjs/internal/NoLocks.js.map +1 -0
- package/lib/cjs/{ServerBasedLocks.d.ts → internal/ServerBasedLocks.d.ts} +10 -16
- package/lib/cjs/internal/ServerBasedLocks.d.ts.map +1 -0
- package/lib/cjs/{ServerBasedLocks.js → internal/ServerBasedLocks.js} +29 -18
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -0
- package/lib/cjs/internal/Symbols.d.ts +11 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -0
- package/lib/cjs/internal/Symbols.js +21 -0
- package/lib/cjs/internal/Symbols.js.map +1 -0
- package/lib/cjs/internal/cross-package.d.ts +4 -0
- package/lib/cjs/internal/cross-package.d.ts.map +1 -0
- package/lib/cjs/internal/cross-package.js +16 -0
- package/lib/cjs/internal/cross-package.js.map +1 -0
- package/lib/cjs/internal/workspace/SettingsImpl.d.ts +2 -2
- package/lib/cjs/internal/workspace/SettingsImpl.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.js +3 -3
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js +2 -2
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js +31 -27
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js +2 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.d.ts.map +1 -1
- package/lib/cjs/rpc/tracing.js +5 -2
- package/lib/cjs/rpc/tracing.js.map +1 -1
- 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.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +1 -0
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +9 -4
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +5 -3
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +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.d.ts +3 -3
- package/lib/cjs/workspace/Settings.d.ts.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 +2 -2
- package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +4 -4
- package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
- package/lib/cjs/workspace/Workspace.js +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.d.ts +2 -2
- package/lib/cjs/workspace/WorkspaceEditor.d.ts.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +13 -13
- package/lib/cjs/ServerBasedLocks.d.ts.map +0 -1
- package/lib/cjs/ServerBasedLocks.js.map +0 -1
- package/lib/cjs/internal/ImplementationProhibited.d.ts +0 -44
- package/lib/cjs/internal/ImplementationProhibited.d.ts.map +0 -1
- package/lib/cjs/internal/ImplementationProhibited.js +0 -51
- package/lib/cjs/internal/ImplementationProhibited.js.map +0 -1
|
@@ -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;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,GAAG,CAAC,aAAa,KAAK,GAAG,CAAC,aAAa;YACzC,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU;YACnC,OAAO,KAAK,CAA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AK,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
|
+
{"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,GAAG,CAAC,aAAa,KAAK,GAAG,CAAC,aAAa;YACzC,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU;YACnC,OAAO,KAAK,CAAC;QACf,IAAI,GAAG,CAAC,e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,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 ExportGraphics\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 +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,MAAM,CAAC,CAAC;QACrB,IAAI,KAAK,CAAC,UAAU;YAClB,IAAI,CAAC,UAAU,GAAG,IAAI,qDAA4B,CAAC,4BAAc,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACpG,CAAC;IAEe,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAyB,CAAC,CAAC,sDAAsD;IACtG,CAAC;IAC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A0B,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"]}
|
|
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,MAAM,CAAC,CAAC;QACrB,IAAI,KAAK,CAAC,UAAU;YAClB,IAAI,CAAC,UAAU,GAAG,IAAI,qDAA4B,CAAC,4BAAc,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACpG,CAAC;IAEe,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAyB,CAAC,CAAC,sDAAsD;IACtG,CAAC;IACD,wHAAwH;IACjH,MAAM,CAAC,cAAc,CAAC,QAAkB;QAC7C,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,yBAAW,CAAC,cAAc,CAAC,CAAC;YAC1E,OAAO,QAAQ,CAAC,EAAE,CAAC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A2B,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoCoordConfig.d.ts","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"GeoCoordConfig.d.ts","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,gBAAgB;AAChB,MAAM,WAAW,UAAW,SAAQ,qBAAqB;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD;;;GAGG;AACH,qBAAa,cAAc;IACzB,gFAAgF;IAChF,gBAAuB,UAAU,EAAE,WAAW,CAAC,aAAa,EAAE,CAAM;IACpE,gBAAuB,WAAW;;;;MAIhC;IAEF,OAAO,CAAC,MAAM,CAAC,eAAe;IAkC9B,OAAO,CAAC,MAAM,CAAC,OAAO;IAStB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAS;WAC3B,SAAS;WAKT,oBAAoB,IAAI,IAAI;WAO5B,aAAa,CAAC,QAAQ,EAAE,QAAQ;CAI/C"}
|
|
@@ -11,6 +11,7 @@ exports.GeoCoordConfig = void 0;
|
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const CloudSqlite_1 = require("./CloudSqlite");
|
|
13
13
|
const IModelHost_1 = require("./IModelHost");
|
|
14
|
+
const NativePlatform_1 = require("./internal/NativePlatform");
|
|
14
15
|
const loggerCat = "GeoCoord";
|
|
15
16
|
const makeSettingName = (name) => `${"itwin/core/gcs"}/${name}`;
|
|
16
17
|
/**
|
|
@@ -34,7 +35,7 @@ class GeoCoordConfig {
|
|
|
34
35
|
const gcsDbProps = cloudContainer.queryDatabase(gcsDbName);
|
|
35
36
|
if (undefined === gcsDbProps)
|
|
36
37
|
throw new Error(`database "${gcsDbName}" not found in container "${dbProps.containerId}"`);
|
|
37
|
-
if (!
|
|
38
|
+
if (!NativePlatform_1.IModelNative.platform.addGcsWorkspaceDb(gcsDbName, cloudContainer, dbProps.priority))
|
|
38
39
|
return; // already had this db
|
|
39
40
|
core_bentley_1.Logger.logInfo(loggerCat, `loaded gcsDb "${gcsDbName}", from "${dbProps.baseUri}/${dbProps.containerId}" size=${gcsDbProps.totalBlocks}, local=${gcsDbProps.localBlocks}`);
|
|
40
41
|
if (true === dbProps.prefetch)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoCoordConfig.js","sourceRoot":"","sources":["../../src/GeoCoordConfig.ts"],"names":[],"mappings":";A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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,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QACpF,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,QAAkB;QAC5C,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;;AApEH,wCAqEC;AApEC,gFAAgF;AACzD,yBAAU,GAAgC,EAAE,CAAC;AAC7C,0BAAW,GAAG;IACnC,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC;IACvC,gBAAgB,EAAE,eAAe,CAAC,mBAAmB,CAAC;IACtD,iBAAiB,EAAE,eAAe,CAAC,mBAAmB,CAAC;CACxD,CAAC;AA6Ca,gCAAiB,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { BentleyError, Logger } from \"@itwin/core-bentley\";\r\nimport { CloudSqlite } from \"./CloudSqlite\";\r\nimport { IModelHost } from \"./IModelHost\";\r\nimport { Settings } from \"./workspace/Settings\";\r\nimport { WorkspaceDbCloudProps } from \"./workspace/Workspace\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\n\r\nconst loggerCat = \"GeoCoord\";\r\n\r\n/** @internal */\r\nexport interface GcsDbProps extends WorkspaceDbCloudProps {\r\n priority?: number;\r\n}\r\nconst makeSettingName = (name: string) => `${\"itwin/core/gcs\"}/${name}`;\r\n\r\n/**\r\n * Internal class to configure and load the gcs workspaces for an iModel.\r\n * @internal\r\n */\r\nexport class GeoCoordConfig {\r\n /** array of cloud prefetch tasks that may be awaited to permit offline usage */\r\n public static readonly prefetches: CloudSqlite.CloudPrefetch[] = [];\r\n public static readonly settingName = {\r\n databases: makeSettingName(\"databases\"),\r\n defaultDatabases: makeSettingName(\"default/databases\"),\r\n disableWorkspaces: makeSettingName(\"disableWorkspaces\"),\r\n };\r\n\r\n private static addGcsWorkspace(dbProps: GcsDbProps) {\r\n // override to disable loading GCS data from workspaces\r\n if (IModelHost.appWorkspace.settings.getBoolean(GeoCoordConfig.settingName.disableWorkspaces, false))\r\n return;\r\n\r\n try {\r\n const ws = IModelHost.appWorkspace;\r\n const container = ws.getContainer({ ...dbProps, accessToken: \"\" }); // all gcs containers are public so no accessToken is required\r\n const cloudContainer = container.cloudContainer;\r\n if (!cloudContainer?.isConnected) {\r\n Logger.logError(\"GeoCoord\", `could not load gcs database \"${dbProps.dbName}\"`);\r\n return;\r\n }\r\n\r\n const gcsDbName = container.resolveDbFileName(dbProps);\r\n const gcsDbProps = cloudContainer.queryDatabase(gcsDbName);\r\n if (undefined === gcsDbProps)\r\n throw new Error(`database \"${gcsDbName}\" not found in container \"${dbProps.containerId}\"`);\r\n\r\n if (!IModelNative.platform.addGcsWorkspaceDb(gcsDbName, cloudContainer, dbProps.priority))\r\n return; // already had this db\r\n\r\n Logger.logInfo(loggerCat, `loaded gcsDb \"${gcsDbName}\", from \"${dbProps.baseUri}/${dbProps.containerId}\" size=${gcsDbProps.totalBlocks}, local=${gcsDbProps.localBlocks}`);\r\n\r\n if (true === dbProps.prefetch)\r\n this.prefetches.push(CloudSqlite.startCloudPrefetch(cloudContainer, gcsDbName));\r\n\r\n } catch (e: any) {\r\n let msg = `Cannot load GCS workspace (${e.errorNumber}): ${BentleyError.getErrorMessage(e)}`;\r\n msg += `,container=${dbProps.baseUri}/${dbProps.containerId}, storage=${dbProps.storageType}, public=${dbProps.isPublic}, cacheDir=${IModelHost.cacheDir}`;\r\n Logger.logError(loggerCat, msg);\r\n }\r\n }\r\n\r\n private static loadAll(settings: Settings, settingName: string) {\r\n const dbProps = settings.getArray<GcsDbProps>(settingName);\r\n if (dbProps) {\r\n for (const entry of dbProps) {\r\n this.addGcsWorkspace(entry);\r\n }\r\n }\r\n }\r\n\r\n private static _defaultDbsLoaded = false;\r\n public static onStartup() {\r\n this._defaultDbsLoaded = false;\r\n this.prefetches.length = 0;\r\n }\r\n\r\n public static loadDefaultDatabases(): void {\r\n if (!this._defaultDbsLoaded) {\r\n this._defaultDbsLoaded = true;\r\n this.loadAll(IModelHost.appWorkspace.settings, this.settingName.defaultDatabases);\r\n }\r\n }\r\n\r\n public static loadForImodel(settings: Settings) {\r\n this.loadDefaultDatabases();\r\n this.loadAll(settings, this.settingName.databases);\r\n }\r\n}\r\n"]}
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.getAvailableCoordinateReferenceSystems = void 0;
|
|
11
|
-
const
|
|
11
|
+
const NativePlatform_1 = require("./internal/NativePlatform");
|
|
12
12
|
/** Get a list of Geographic Coordinate Reference Systems.
|
|
13
13
|
* @param options Specifies the parameters to filter the returned list.
|
|
14
14
|
* @returns The list of Geographic Coordinate Reference Systems, according to the supplied parameters.
|
|
15
15
|
* @beta
|
|
16
16
|
*/
|
|
17
17
|
async function getAvailableCoordinateReferenceSystems(args) {
|
|
18
|
-
return
|
|
18
|
+
return NativePlatform_1.IModelNative.platform.GeoServices.getListOfCRS(args.extent);
|
|
19
19
|
}
|
|
20
20
|
exports.getAvailableCoordinateReferenceSystems = getAvailableCoordinateReferenceSystems;
|
|
21
21
|
//# sourceMappingURL=GeographicCRSServices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeographicCRSServices.js","sourceRoot":"","sources":["../../src/GeographicCRSServices.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,
|
|
1
|
+
{"version":3,"file":"GeographicCRSServices.js","sourceRoot":"","sources":["../../src/GeographicCRSServices.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,8DAAyD;AAiCzD;;;;GAIG;AACI,KAAK,UAAU,sCAAsC,CAAC,IAAgD;IAC3G,OAAO,6BAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACrE,CAAC;AAFD,wFAEC","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 { Range2dProps } from \"@itwin/core-geometry\";\r\nimport { IModelNative } from \"./internal/NativePlatform\";\r\n\r\n/** Describes a geographic coordinate reference system produced by [[getAvailableCoordinateReferenceSystems]].\r\n * @beta\r\n */\r\nexport interface AvailableCoordinateReferenceSystemProps {\r\n /** The name of the coordinate reference system. It can be presented to the user in the UI as an identifier for the coordinate reference system. */\r\n name: string;\r\n /** The description of the coordinate reference system. It can be presented to the user in the UI as extra information for the coordinate reference system. */\r\n description: string;\r\n /** Indicate if the coordinate reference system is deprecated. A coordinate reference system is deprecated if it is no longer recommended for use.\r\n * A deprecated coordinate reference system can usually be substituted by a more accurate one. It is possible that an existing project uses a deprecated coordinate reference system.\r\n * However, for new projects, it is recommended to use a non-deprecated coordinate reference system.\r\n */\r\n deprecated: boolean;\r\n /** Extent of the coordinate reference system. This is the area where the coordinate reference system can be used.\r\n * Outside of this area, the coordinate reference system may not be accurate. The extent is defined by a range of longitude and latitude values.\r\n * Minimum longitude and latitude correspond to crsExtent.low.x and crsExtent.low.y, respectively.\r\n * Maximum longitude and latitude correspond to crsExtent.high.x and crsExtent.high.y, respectively.\r\n */\r\n crsExtent: Range2dProps;\r\n}\r\n\r\n/** Arguments supplied to [[getAvailableCoordinateReferenceSystems]].\r\n * @beta\r\n */\r\nexport interface GetAvailableCoordinateReferenceSystemsArgs {\r\n /** If provided, only return CRS's that contain the given extent. Minimum longitude and latitude correspond to extent.low.x and extent.low.y, respectively.\r\n * Maximum longitude and latitude correspond to extent.high.x and extent.high.y, respectively.\r\n */\r\n extent?: Range2dProps;\r\n}\r\n\r\n/** Get a list of Geographic Coordinate Reference Systems.\r\n * @param options Specifies the parameters to filter the returned list.\r\n * @returns The list of Geographic Coordinate Reference Systems, according to the supplied parameters.\r\n * @beta\r\n */\r\nexport async function getAvailableCoordinateReferenceSystems(args: GetAvailableCoordinateReferenceSystemsArgs): Promise<AvailableCoordinateReferenceSystemProps[]> {\r\n return IModelNative.platform.GeoServices.getListOfCRS(args.extent);\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeometrySummary.d.ts","sourceRoot":"","sources":["../../src/GeometrySummary.ts"],"names":[],"mappings":"AAYA,OAAO,EAC+C,2BAA2B,EAEhF,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"GeometrySummary.d.ts","sourceRoot":"","sources":["../../src/GeometrySummary.ts"],"names":[],"mappings":"AAYA,OAAO,EAC+C,2BAA2B,EAEhF,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAwZtC,gBAAgB;AAChB,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,2BAA2B,EAAE,MAAM,EAAE,QAAQ,GAAG,MAAM,CAGxG"}
|
|
@@ -9,6 +9,7 @@ const core_bentley_1 = require("@itwin/core-bentley");
|
|
|
9
9
|
const core_geometry_1 = require("@itwin/core-geometry");
|
|
10
10
|
const core_common_1 = require("@itwin/core-common");
|
|
11
11
|
const Element_1 = require("./Element");
|
|
12
|
+
const Symbols_1 = require("./internal/Symbols");
|
|
12
13
|
// cspell:ignore earlin
|
|
13
14
|
/** Generates an array of GeometryStreamResponseProps. */
|
|
14
15
|
class ResponseGenerator {
|
|
@@ -89,7 +90,7 @@ class ResponseGenerator {
|
|
|
89
90
|
return lines.join("\n");
|
|
90
91
|
}
|
|
91
92
|
summarizePartReferences(id, is2d) {
|
|
92
|
-
const refIds = this.iModel.
|
|
93
|
+
const refIds = this.iModel[Symbols_1._nativeDb].findGeometryPartReferences([id], is2d);
|
|
93
94
|
return `Part references (${refIds.length}): ${refIds.join()}`;
|
|
94
95
|
}
|
|
95
96
|
getElementGeom(id) {
|
|
@@ -206,17 +207,17 @@ class ResponseGenerator {
|
|
|
206
207
|
case "pointCollection":
|
|
207
208
|
return `${summary} numPoints: ${query.points.length}`;
|
|
208
209
|
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)])}'
|
|
210
|
+
return `${summary}'
|
|
211
|
+
' poleDimension: ${query.poleDimension}'
|
|
212
|
+
' numPolesTotal: ${query.numPolesTotal()}'
|
|
213
|
+
' degree[U,V]: ${JSON.stringify([query.degreeUV(core_geometry_1.UVSelect.uDirection), query.degreeUV(core_geometry_1.UVSelect.vDirection)])}'
|
|
214
|
+
' order[U,V]: ${JSON.stringify([query.orderUV(core_geometry_1.UVSelect.uDirection), query.orderUV(core_geometry_1.UVSelect.vDirection)])}'
|
|
215
|
+
' numSpan[U,V]: ${JSON.stringify([query.numSpanUV(core_geometry_1.UVSelect.uDirection), query.numSpanUV(core_geometry_1.UVSelect.vDirection)])}'
|
|
216
|
+
' numPoles[U,V]: ${JSON.stringify([query.numPolesUV(core_geometry_1.UVSelect.uDirection), query.numPolesUV(core_geometry_1.UVSelect.vDirection)])}'
|
|
216
217
|
' poleStep[U,V]: ${JSON.stringify([query.poleStepUV(core_geometry_1.UVSelect.uDirection), query.poleStepUV(core_geometry_1.UVSelect.vDirection)])}`;
|
|
217
218
|
case "polyface": {
|
|
218
219
|
const data = query.data;
|
|
219
|
-
summary = `${summary} pointCount: ${data.point.length}'
|
|
220
|
+
summary = `${summary} pointCount: ${data.point.length}'
|
|
220
221
|
' pointIndexCount: ${data.pointIndex.length}`;
|
|
221
222
|
if (query.twoSided)
|
|
222
223
|
summary = `${summary} (two-sided)`;
|
|
@@ -237,40 +238,40 @@ class ResponseGenerator {
|
|
|
237
238
|
switch (solid.solidPrimitiveType) {
|
|
238
239
|
case "box":
|
|
239
240
|
const box = solid;
|
|
240
|
-
return `${summary}'
|
|
241
|
-
' origin: ${JSON.stringify(box.getBaseOrigin().toJSON())}'
|
|
242
|
-
' topOrigin: ${JSON.stringify(box.getTopOrigin().toJSON())}'
|
|
243
|
-
' baseX: ${box.getBaseX()}'
|
|
241
|
+
return `${summary}'
|
|
242
|
+
' origin: ${JSON.stringify(box.getBaseOrigin().toJSON())}'
|
|
243
|
+
' topOrigin: ${JSON.stringify(box.getTopOrigin().toJSON())}'
|
|
244
|
+
' baseX: ${box.getBaseX()}'
|
|
244
245
|
' baseY: ${box.getBaseY()}`;
|
|
245
246
|
case "cone":
|
|
246
247
|
const cone = solid;
|
|
247
|
-
return `${summary}'
|
|
248
|
-
' baseCenterPoint: ${JSON.stringify(cone.getCenterA())}'
|
|
249
|
-
' topCenterPoint: ${JSON.stringify(cone.getCenterB())}'
|
|
250
|
-
' baseCenterRadius: ${JSON.stringify(cone.getRadiusA())}'
|
|
248
|
+
return `${summary}'
|
|
249
|
+
' baseCenterPoint: ${JSON.stringify(cone.getCenterA())}'
|
|
250
|
+
' topCenterPoint: ${JSON.stringify(cone.getCenterB())}'
|
|
251
|
+
' baseCenterRadius: ${JSON.stringify(cone.getRadiusA())}'
|
|
251
252
|
' topCenterRadius: ${JSON.stringify(cone.getRadiusB())}`;
|
|
252
253
|
case "sphere":
|
|
253
254
|
const sphere = solid;
|
|
254
|
-
return `${summary}'
|
|
255
|
-
' centerPoint: ${JSON.stringify(sphere.cloneCenter().toJSON())}'
|
|
255
|
+
return `${summary}'
|
|
256
|
+
' centerPoint: ${JSON.stringify(sphere.cloneCenter().toJSON())}'
|
|
256
257
|
' radius: ${JSON.stringify(sphere.trueSphereRadius())}`;
|
|
257
258
|
case "linearSweep":
|
|
258
259
|
const linearSweep = solid;
|
|
259
|
-
return `${summary}'
|
|
260
|
-
' vector: ${JSON.stringify(linearSweep.cloneSweepVector().toJSON())}'
|
|
260
|
+
return `${summary}'
|
|
261
|
+
' vector: ${JSON.stringify(linearSweep.cloneSweepVector().toJSON())}'
|
|
261
262
|
' curves${this.summarizeCurveCollection(linearSweep.getCurvesRef())}`;
|
|
262
263
|
case "rotationalSweep":
|
|
263
264
|
const rotationalSweep = solid;
|
|
264
265
|
const axis = rotationalSweep.cloneAxisRay();
|
|
265
|
-
return `${summary}'
|
|
266
|
-
' center: ${JSON.stringify(axis.origin.toJSON())}'
|
|
267
|
-
' axis: ${JSON.stringify(axis.direction.toJSON())}'
|
|
266
|
+
return `${summary}'
|
|
267
|
+
' center: ${JSON.stringify(axis.origin.toJSON())}'
|
|
268
|
+
' axis: ${JSON.stringify(axis.direction.toJSON())}'
|
|
268
269
|
' sweepAngle: ${rotationalSweep.getSweep().degrees}`;
|
|
269
270
|
case "ruledSweep":
|
|
270
271
|
const ruledSweep = solid;
|
|
271
272
|
const summarizedCollection = ruledSweep.cloneContours().map((curveCollection) => this.summarizeCurveCollection(curveCollection));
|
|
272
|
-
return `${summary}'
|
|
273
|
-
' isClosedVolume${ruledSweep.isClosedVolume}'
|
|
273
|
+
return `${summary}'
|
|
274
|
+
' isClosedVolume${ruledSweep.isClosedVolume}'
|
|
274
275
|
' contours: ${JSON.stringify(summarizedCollection)}`;
|
|
275
276
|
case "torusPipe":
|
|
276
277
|
const torusPipe = solid;
|
|
@@ -281,11 +282,11 @@ class ResponseGenerator {
|
|
|
281
282
|
vectorY.scaleInPlace(-1.0);
|
|
282
283
|
sweep.setRadians(-sweep.radians);
|
|
283
284
|
}
|
|
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()}'
|
|
285
|
+
return `${summary}'
|
|
286
|
+
' center: ${JSON.stringify(torusPipe.cloneCenter().toJSON())}'
|
|
287
|
+
' xyVectors: ${JSON.stringify([vectorX.toJSON(), vectorY.toJSON()])}'
|
|
288
|
+
' majorRadius: ${torusPipe.getMajorRadius()}'
|
|
289
|
+
' minorRadius: ${torusPipe.getMinorRadius()}'
|
|
289
290
|
' sweepAngle: ${sweep.degrees}`;
|
|
290
291
|
}
|
|
291
292
|
}
|
|
@@ -298,9 +299,9 @@ class ResponseGenerator {
|
|
|
298
299
|
summary = `${summary} center: ${JSON.stringify(arc.center.toJSON())}`;
|
|
299
300
|
if (undefined !== arc.circularRadius)
|
|
300
301
|
summary = `${summary} radius: ${arc.circularRadius()}`;
|
|
301
|
-
summary = `${summary}'
|
|
302
|
-
' vectorX:${JSON.stringify(arc.vector0.toJSON())}'
|
|
303
|
-
' vectorY:${JSON.stringify(arc.vector90.toJSON())}'
|
|
302
|
+
summary = `${summary}'
|
|
303
|
+
' vectorX:${JSON.stringify(arc.vector0.toJSON())}'
|
|
304
|
+
' vectorY:${JSON.stringify(arc.vector90.toJSON())}'
|
|
304
305
|
' sweepStartEnd [${arc.sweep.startDegrees}, ${arc.sweep.endDegrees}]`
|
|
305
306
|
+ ` curveLength: ${curve.curveLength()}`;
|
|
306
307
|
return summary;
|
|
@@ -311,34 +312,34 @@ class ResponseGenerator {
|
|
|
311
312
|
return summary;
|
|
312
313
|
case "lineString":
|
|
313
314
|
const lineString = curve;
|
|
314
|
-
summary = `${summary} pointCount: ${lineString.numPoints()}'
|
|
315
|
+
summary = `${summary} pointCount: ${lineString.numPoints()}'
|
|
315
316
|
' curveLength: ${curve.curveLength()}`;
|
|
316
317
|
return summary;
|
|
317
318
|
case "bsplineCurve":
|
|
318
319
|
const bsplineCurve = curve;
|
|
319
|
-
summary = `${summary}'
|
|
320
|
-
' curveOrder: ${bsplineCurve.order}'
|
|
321
|
-
' controlPointsCount: ${bsplineCurve.numPoles}'
|
|
320
|
+
summary = `${summary}'
|
|
321
|
+
' curveOrder: ${bsplineCurve.order}'
|
|
322
|
+
' controlPointsCount: ${bsplineCurve.numPoles}'
|
|
322
323
|
' curveLength: ${curve.curveLength()}`;
|
|
323
324
|
return summary;
|
|
324
325
|
case "interpolationCurve":
|
|
325
326
|
const interpolationCurve = curve;
|
|
326
327
|
const interpolationProps = interpolationCurve.cloneProps();
|
|
327
|
-
summary = `${summary}'
|
|
328
|
-
' curveOrder: ${interpolationProps.order}'
|
|
328
|
+
summary = `${summary}'
|
|
329
|
+
' curveOrder: ${interpolationProps.order}'
|
|
329
330
|
' controlPointsCount: ${interpolationProps.fitPoints.length}`;
|
|
330
331
|
return summary;
|
|
331
332
|
case "akimaCurve":
|
|
332
333
|
const akimaCurve = curve;
|
|
333
334
|
const akimaProps = akimaCurve.cloneProps();
|
|
334
|
-
summary = `${summary}'
|
|
335
|
+
summary = `${summary}'
|
|
335
336
|
' controlPointsCount: ${akimaProps.fitPoints.length}`;
|
|
336
337
|
return summary;
|
|
337
338
|
case "bezierCurve":
|
|
338
339
|
const bezierCurve = curve;
|
|
339
|
-
summary = `${summary}'
|
|
340
|
-
' curveOrder: ${bezierCurve.order}'
|
|
341
|
-
' controlPointsCount: ${bezierCurve.numPoles}'
|
|
340
|
+
summary = `${summary}'
|
|
341
|
+
' curveOrder: ${bezierCurve.order}'
|
|
342
|
+
' controlPointsCount: ${bezierCurve.numPoles}'
|
|
342
343
|
' curveLength: ${curve.curveLength()}`;
|
|
343
344
|
return summary;
|
|
344
345
|
case "transitionSpiral":
|
|
@@ -349,8 +350,8 @@ class ResponseGenerator {
|
|
|
349
350
|
case "curveChainWithDistanceIndex":
|
|
350
351
|
const curveChainWithDistanceIndex = curve;
|
|
351
352
|
const path = curveChainWithDistanceIndex.path;
|
|
352
|
-
summary = `${summary}'
|
|
353
|
-
' curveLength: ${curve.curveLength()}'
|
|
353
|
+
summary = `${summary}'
|
|
354
|
+
' curveLength: ${curve.curveLength()}'
|
|
354
355
|
' isOpen: ${path.isOpenPath}`;
|
|
355
356
|
return summary;
|
|
356
357
|
}
|
|
@@ -367,8 +368,8 @@ class ResponseGenerator {
|
|
|
367
368
|
summary = `${summary} isOpen: ${path.isOpenPath}`;
|
|
368
369
|
break;
|
|
369
370
|
}
|
|
370
|
-
return `${summary}'
|
|
371
|
-
' numCurves: ${curves.collectCurvePrimitives().length}'
|
|
371
|
+
return `${summary}'
|
|
372
|
+
' numCurves: ${curves.collectCurvePrimitives().length}'
|
|
372
373
|
' boundary: ${curves.dgnBoundaryType()}`;
|
|
373
374
|
}
|
|
374
375
|
}
|