@itwin/core-backend 5.1.0-dev.9 → 5.1.1
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 +160 -1
- package/lib/cjs/BackendHubAccess.d.ts +1 -1
- package/lib/cjs/BackendHubAccess.js +1 -1
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
- package/lib/cjs/BisCoreSchema.js +4 -2
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts +10 -2
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +16 -0
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/CatalogDb.js.map +1 -1
- package/lib/cjs/Category.d.ts +4 -4
- package/lib/cjs/Category.js +4 -4
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +2 -2
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts +67 -8
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +490 -275
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts +9 -1
- package/lib/cjs/ClassRegistry.d.ts.map +1 -1
- package/lib/cjs/ClassRegistry.js +14 -6
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.js +1 -1
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +1 -1
- package/lib/cjs/CodeSpecs.js +1 -1
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +4 -4
- package/lib/cjs/DisplayStyle.js +3 -3
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +4 -4
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +4 -4
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +15 -6
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +19 -4
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +54 -51
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +67 -52
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +8 -8
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +8 -8
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.d.ts +10 -7
- package/lib/cjs/Entity.d.ts.map +1 -1
- package/lib/cjs/Entity.js +35 -13
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.d.ts +54 -8
- package/lib/cjs/ExportGraphics.d.ts.map +1 -1
- package/lib/cjs/ExportGraphics.js +158 -59
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/FontFile.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.d.ts +6 -2
- package/lib/cjs/GeographicCRSServices.d.ts.map +1 -1
- package/lib/cjs/GeographicCRSServices.js +1 -1
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/GeometrySummary.js +47 -47
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +37 -26
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +132 -55
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelDbFonts.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js +1 -1
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +2 -3
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +2 -3
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.d.ts +36 -0
- package/lib/cjs/IModelIncrementalSchemaLocater.d.ts.map +1 -0
- package/lib/cjs/IModelIncrementalSchemaLocater.js +69 -0
- package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -0
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/ImageSourceConversion.js.map +1 -1
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.d.ts.map +1 -1
- package/lib/cjs/LocalHub.js +6 -4
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/LockControl.js.map +1 -1
- package/lib/cjs/Material.d.ts +4 -3
- package/lib/cjs/Material.d.ts.map +1 -1
- package/lib/cjs/Material.js +5 -5
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +22 -22
- package/lib/cjs/Model.js +22 -22
- 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 +3 -0
- package/lib/cjs/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +15 -0
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +1 -1
- package/lib/cjs/SQLiteDb.js +1 -1
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.d.ts +25 -0
- package/lib/cjs/Schema.d.ts.map +1 -1
- package/lib/cjs/Schema.js +25 -0
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/SheetIndex.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/SqliteStatement.d.ts +1 -1
- package/lib/cjs/SqliteStatement.d.ts.map +1 -1
- package/lib/cjs/SqliteStatement.js +1 -1
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/Texture.d.ts +1 -1
- package/lib/cjs/Texture.js +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +4 -4
- package/lib/cjs/TxnManager.js +1 -1
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +40 -14
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +42 -14
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +61 -0
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -0
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +110 -0
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -0
- package/lib/cjs/annotations/FrameGeometry.d.ts +51 -0
- package/lib/cjs/annotations/FrameGeometry.d.ts.map +1 -0
- package/lib/cjs/annotations/FrameGeometry.js +249 -0
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -0
- package/lib/cjs/annotations/LeaderGeometry.d.ts +53 -0
- package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -0
- package/lib/cjs/annotations/LeaderGeometry.js +184 -0
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -0
- package/lib/cjs/annotations/TextAnnotationElement.d.ts +204 -0
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -0
- package/lib/cjs/annotations/TextAnnotationElement.js +411 -0
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts +33 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.js +137 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -0
- package/lib/cjs/annotations/TextBlockGeometry.d.ts +16 -0
- package/lib/cjs/annotations/TextBlockGeometry.d.ts.map +1 -0
- package/lib/cjs/{TextAnnotationGeometry.js → annotations/TextBlockGeometry.js} +28 -70
- package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -0
- package/lib/cjs/{TextAnnotationLayout.d.ts → annotations/TextBlockLayout.d.ts} +69 -22
- package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -0
- package/lib/cjs/{TextAnnotationLayout.js → annotations/TextBlockLayout.js} +174 -49
- package/lib/cjs/annotations/TextBlockLayout.js.map +1 -0
- 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 +7 -3
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +27 -6
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/internal/ElementLRUCache.d.ts +23 -0
- package/lib/cjs/internal/ElementLRUCache.d.ts.map +1 -1
- package/lib/cjs/internal/ElementLRUCache.js +167 -3
- package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
- package/lib/cjs/internal/FontFileImpl.js.map +1 -1
- package/lib/cjs/internal/HubMock.js.map +1 -1
- package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/cjs/internal/NativePlatform.js.map +1 -1
- package/lib/cjs/internal/NoLocks.js.map +1 -1
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/internal/Symbols.d.ts +1 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -1
- package/lib/cjs/internal/Symbols.js +2 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/internal/annotations/fields.d.ts +22 -0
- package/lib/cjs/internal/annotations/fields.d.ts.map +1 -0
- package/lib/cjs/internal/annotations/fields.js +237 -0
- package/lib/cjs/internal/annotations/fields.js.map +1 -0
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -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.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 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +0 -1
- package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/lib/esm/BackendHubAccess.d.ts +1 -1
- package/lib/esm/BackendHubAccess.js +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/BackendLoggerCategory.js.map +1 -1
- package/lib/esm/BisCoreSchema.d.ts.map +1 -1
- package/lib/esm/BisCoreSchema.js +4 -2
- package/lib/esm/BisCoreSchema.js.map +1 -1
- package/lib/esm/BlobContainerService.js.map +1 -1
- package/lib/esm/BriefcaseManager.d.ts +10 -2
- package/lib/esm/BriefcaseManager.d.ts.map +1 -1
- package/lib/esm/BriefcaseManager.js +17 -1
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/CatalogDb.js.map +1 -1
- package/lib/esm/Category.d.ts +4 -4
- package/lib/esm/Category.js +4 -4
- package/lib/esm/Category.js.map +1 -1
- package/lib/esm/ChangeSummaryManager.js +2 -2
- package/lib/esm/ChangeSummaryManager.js.map +1 -1
- package/lib/esm/ChangedElementsDb.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.d.ts +67 -8
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +490 -275
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/ChannelControl.js.map +1 -1
- package/lib/esm/CheckpointManager.js.map +1 -1
- package/lib/esm/ClassRegistry.d.ts +9 -1
- package/lib/esm/ClassRegistry.d.ts.map +1 -1
- package/lib/esm/ClassRegistry.js +14 -6
- package/lib/esm/ClassRegistry.js.map +1 -1
- package/lib/esm/CloudSqlite.js +1 -1
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/CodeService.js.map +1 -1
- package/lib/esm/CodeSpecs.d.ts +1 -1
- package/lib/esm/CodeSpecs.js +1 -1
- package/lib/esm/CodeSpecs.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/CustomViewState3dCreator.js.map +1 -1
- package/lib/esm/DevTools.js.map +1 -1
- package/lib/esm/DisplayStyle.d.ts +4 -4
- package/lib/esm/DisplayStyle.js +3 -3
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/ECDb.d.ts +4 -4
- package/lib/esm/ECDb.d.ts.map +1 -1
- package/lib/esm/ECDb.js +4 -4
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/ECSchemaXmlContext.js.map +1 -1
- package/lib/esm/ECSqlStatement.d.ts +15 -6
- package/lib/esm/ECSqlStatement.d.ts.map +1 -1
- package/lib/esm/ECSqlStatement.js +19 -4
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/Element.d.ts +54 -51
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +67 -52
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts +8 -8
- package/lib/esm/ElementAspect.d.ts.map +1 -1
- package/lib/esm/ElementAspect.js +8 -8
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/ElementGraphics.js.map +1 -1
- package/lib/esm/ElementTreeWalker.js.map +1 -1
- package/lib/esm/Entity.d.ts +10 -7
- package/lib/esm/Entity.d.ts.map +1 -1
- package/lib/esm/Entity.js +36 -14
- package/lib/esm/Entity.js.map +1 -1
- package/lib/esm/EntityReferences.js.map +1 -1
- package/lib/esm/ExportGraphics.d.ts +54 -8
- package/lib/esm/ExportGraphics.d.ts.map +1 -1
- package/lib/esm/ExportGraphics.js +156 -58
- package/lib/esm/ExportGraphics.js.map +1 -1
- package/lib/esm/ExternalSource.js.map +1 -1
- package/lib/esm/FontFile.js.map +1 -1
- package/lib/esm/GeoCoordConfig.js.map +1 -1
- package/lib/esm/GeographicCRSServices.d.ts +6 -2
- package/lib/esm/GeographicCRSServices.d.ts.map +1 -1
- package/lib/esm/GeographicCRSServices.js +1 -1
- package/lib/esm/GeographicCRSServices.js.map +1 -1
- package/lib/esm/GeometrySummary.js +47 -47
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +37 -26
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +136 -59
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelDbFonts.js.map +1 -1
- package/lib/esm/IModelElementCloneContext.d.ts +1 -1
- package/lib/esm/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/esm/IModelElementCloneContext.js +1 -1
- package/lib/esm/IModelElementCloneContext.js.map +1 -1
- package/lib/esm/IModelHost.d.ts +2 -3
- package/lib/esm/IModelHost.d.ts.map +1 -1
- package/lib/esm/IModelHost.js +2 -3
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.d.ts +36 -0
- package/lib/esm/IModelIncrementalSchemaLocater.d.ts.map +1 -0
- package/lib/esm/IModelIncrementalSchemaLocater.js +65 -0
- package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -0
- package/lib/esm/IModelJsFs.js.map +1 -1
- package/lib/esm/ImageSourceConversion.js.map +1 -1
- package/lib/esm/IpcHost.js.map +1 -1
- package/lib/esm/LineStyle.js.map +1 -1
- package/lib/esm/LocalHub.d.ts.map +1 -1
- package/lib/esm/LocalHub.js +6 -4
- package/lib/esm/LocalHub.js.map +1 -1
- package/lib/esm/LocalhostIpcHost.js.map +1 -1
- package/lib/esm/LockControl.js.map +1 -1
- package/lib/esm/Material.d.ts +4 -3
- package/lib/esm/Material.d.ts.map +1 -1
- package/lib/esm/Material.js +5 -5
- package/lib/esm/Material.js.map +1 -1
- package/lib/esm/Model.d.ts +22 -22
- package/lib/esm/Model.js +22 -22
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/NativeAppStorage.js.map +1 -1
- package/lib/esm/NativeHost.js.map +1 -1
- package/lib/esm/NavigationRelationship.js.map +1 -1
- package/lib/esm/PromiseMemoizer.js.map +1 -1
- package/lib/esm/PropertyStore.js.map +1 -1
- package/lib/esm/Relationship.d.ts +3 -0
- package/lib/esm/Relationship.d.ts.map +1 -1
- package/lib/esm/Relationship.js +15 -0
- package/lib/esm/Relationship.js.map +1 -1
- package/lib/esm/RpcBackend.js.map +1 -1
- package/lib/esm/SQLiteDb.d.ts +1 -1
- package/lib/esm/SQLiteDb.js +1 -1
- package/lib/esm/SQLiteDb.js.map +1 -1
- package/lib/esm/Schema.d.ts +25 -0
- package/lib/esm/Schema.d.ts.map +1 -1
- package/lib/esm/Schema.js +25 -0
- package/lib/esm/Schema.js.map +1 -1
- package/lib/esm/SchemaSync.js.map +1 -1
- package/lib/esm/SchemaUtils.js.map +1 -1
- package/lib/esm/SheetIndex.js.map +1 -1
- package/lib/esm/SqliteChangesetReader.js.map +1 -1
- package/lib/esm/SqliteStatement.d.ts +1 -1
- package/lib/esm/SqliteStatement.d.ts.map +1 -1
- package/lib/esm/SqliteStatement.js +1 -1
- package/lib/esm/SqliteStatement.js.map +1 -1
- package/lib/esm/Texture.d.ts +1 -1
- package/lib/esm/Texture.js +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TileStorage.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +4 -4
- package/lib/esm/TxnManager.js +1 -1
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +40 -14
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js +42 -14
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/ViewStateHydrator.js.map +1 -1
- package/lib/esm/ViewStore.js.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +61 -0
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -0
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js +105 -0
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -0
- package/lib/esm/annotations/FrameGeometry.d.ts +51 -0
- package/lib/esm/annotations/FrameGeometry.d.ts.map +1 -0
- package/lib/esm/annotations/FrameGeometry.js +244 -0
- package/lib/esm/annotations/FrameGeometry.js.map +1 -0
- package/lib/esm/annotations/LeaderGeometry.d.ts +53 -0
- package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -0
- package/lib/esm/annotations/LeaderGeometry.js +179 -0
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -0
- package/lib/esm/annotations/TextAnnotationElement.d.ts +204 -0
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -0
- package/lib/esm/annotations/TextAnnotationElement.js +405 -0
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -0
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts +33 -0
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -0
- package/lib/esm/annotations/TextAnnotationGeometry.js +134 -0
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -0
- package/lib/esm/annotations/TextBlockGeometry.d.ts +16 -0
- package/lib/esm/annotations/TextBlockGeometry.d.ts.map +1 -0
- package/lib/esm/{TextAnnotationGeometry.js → annotations/TextBlockGeometry.js} +28 -70
- package/lib/esm/annotations/TextBlockGeometry.js.map +1 -0
- package/lib/esm/{TextAnnotationLayout.d.ts → annotations/TextBlockLayout.d.ts} +69 -22
- package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -0
- package/lib/esm/{TextAnnotationLayout.js → annotations/TextBlockLayout.js} +172 -48
- package/lib/esm/annotations/TextBlockLayout.js.map +1 -0
- package/lib/esm/core-backend.d.ts +7 -3
- package/lib/esm/core-backend.d.ts.map +1 -1
- package/lib/esm/core-backend.js +27 -3
- package/lib/esm/core-backend.js.map +1 -1
- package/lib/esm/domains/FunctionalElements.js.map +1 -1
- package/lib/esm/domains/FunctionalSchema.js.map +1 -1
- package/lib/esm/domains/GenericElements.js.map +1 -1
- package/lib/esm/domains/GenericSchema.js.map +1 -1
- package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/esm/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/internal/ElementLRUCache.d.ts +23 -0
- package/lib/esm/internal/ElementLRUCache.d.ts.map +1 -1
- package/lib/esm/internal/ElementLRUCache.js +165 -2
- package/lib/esm/internal/ElementLRUCache.js.map +1 -1
- package/lib/esm/internal/FontFileImpl.js.map +1 -1
- package/lib/esm/internal/HubMock.js.map +1 -1
- package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/esm/internal/NativePlatform.js.map +1 -1
- package/lib/esm/internal/NoLocks.js.map +1 -1
- package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
- package/lib/esm/internal/Symbols.d.ts +1 -0
- package/lib/esm/internal/Symbols.d.ts.map +1 -1
- package/lib/esm/internal/Symbols.js +1 -0
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/internal/annotations/fields.d.ts +22 -0
- package/lib/esm/internal/annotations/fields.d.ts.map +1 -0
- package/lib/esm/internal/annotations/fields.js +231 -0
- package/lib/esm/internal/annotations/fields.js.map +1 -0
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/esm/rpc/multipart.js.map +1 -1
- package/lib/esm/rpc/tracing.js.map +1 -1
- package/lib/esm/rpc/web/logging.js.map +1 -1
- package/lib/esm/rpc/web/request.js.map +1 -1
- package/lib/esm/rpc/web/response.js.map +1 -1
- package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.d.ts +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/esm/test/AdvancedEqual.js.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.d.ts +15 -0
- package/lib/esm/test/AnnotationTestUtils.d.ts.map +1 -0
- package/lib/esm/test/AnnotationTestUtils.js +41 -0
- package/lib/esm/test/AnnotationTestUtils.js.map +1 -0
- package/lib/esm/test/AttachDb.test.js +11 -11
- package/lib/esm/test/AttachDb.test.js.map +1 -1
- package/lib/esm/test/ElementLRUCache.test.js +224 -1
- package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
- package/lib/esm/test/GeometryTestUtil.js.map +1 -1
- package/lib/esm/test/IModelHost.test.js.map +1 -1
- package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
- package/lib/esm/test/IModelTestUtils.js +1 -0
- package/lib/esm/test/IModelTestUtils.js.map +1 -1
- package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
- package/lib/esm/test/IpcHost.test.js.map +1 -1
- package/lib/esm/test/KnownTestLocations.js.map +1 -1
- package/lib/esm/test/PrintElementTree.js.map +1 -1
- package/lib/esm/test/PropertyDb.test.js.map +1 -1
- package/lib/esm/test/RevisionUtility.js.map +1 -1
- package/lib/esm/test/SchemaUtils.test.js +25 -25
- package/lib/esm/test/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
- package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
- package/lib/esm/test/TestUtils.d.ts +1 -1
- package/lib/esm/test/TestUtils.d.ts.map +1 -1
- package/lib/esm/test/TestUtils.js +1 -1
- package/lib/esm/test/TestUtils.js.map +1 -1
- package/lib/esm/test/annotations/Fields.test.d.ts +2 -0
- package/lib/esm/test/annotations/Fields.test.d.ts.map +1 -0
- package/lib/esm/test/annotations/Fields.test.js +576 -0
- package/lib/esm/test/annotations/Fields.test.js.map +1 -0
- package/lib/esm/test/annotations/FrameGeometry.test.d.ts +2 -0
- package/lib/esm/test/annotations/FrameGeometry.test.d.ts.map +1 -0
- package/lib/esm/test/annotations/FrameGeometry.test.js +86 -0
- package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -0
- package/lib/esm/test/annotations/LeaderGeometry.test.d.ts +2 -0
- package/lib/esm/test/annotations/LeaderGeometry.test.d.ts.map +1 -0
- package/lib/esm/test/annotations/LeaderGeometry.test.js +256 -0
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -0
- package/lib/esm/test/annotations/TextAnnotation.test.js +269 -1047
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.d.ts +2 -0
- package/lib/esm/test/annotations/TextBlock.test.d.ts.map +1 -0
- package/lib/esm/test/annotations/TextBlock.test.js +1199 -0
- package/lib/esm/test/annotations/TextBlock.test.js.map +1 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.d.ts +60 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.d.ts.map +1 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js +69 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts +1442 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts.map +1 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js +817 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -0
- package/lib/esm/test/categories/Category.test.js.map +1 -1
- package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
- package/lib/esm/test/ecdb/CTE.test.js +88 -88
- package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQuery.test.d.ts +2 -0
- package/lib/esm/test/ecdb/ConcurrentQuery.test.d.ts.map +1 -0
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js +164 -0
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -0
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +35 -45
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDb.test.js +86 -65
- package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
- package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlAst.test.js +65 -65
- package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js +0 -55
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlReader.test.js +16 -16
- package/lib/esm/test/ecdb/ECSqlReader.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +484 -292
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
- package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
- package/lib/esm/test/element/ElementAspect.test.js +22 -22
- package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
- package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
- package/lib/esm/test/element/ElementRoundTrip.test.js +139 -139
- package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
- package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
- package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
- package/lib/esm/test/element/NullStructArray.test.js +13 -13
- package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
- package/lib/esm/test/element/UrlLink.test.js.map +1 -1
- package/lib/esm/test/font/FontFile.test.js.map +1 -1
- package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
- package/lib/esm/test/hubaccess/ApplyChangeset.test.d.ts +2 -0
- package/lib/esm/test/hubaccess/ApplyChangeset.test.d.ts.map +1 -0
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js +86 -0
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -0
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
- package/lib/esm/test/imageData.js.map +1 -1
- package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
- package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +313 -5
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
- package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.d.ts +2 -0
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.d.ts.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js +343 -0
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.d.ts +2 -0
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.d.ts.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js +207 -0
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts +11 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.d.ts.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js +36 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts +17 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.d.ts.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js +116 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts +9 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js +20 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +1 -0
- package/lib/esm/test/index.js.map +1 -1
- package/lib/esm/test/misc/DevTools.test.js.map +1 -1
- package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
- package/lib/esm/test/misc/GeoServices.test.js +36 -10
- package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
- package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
- package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
- package/lib/esm/test/rpc/response.test.js.map +1 -1
- package/lib/esm/test/schema/ClassRegistry.test.js +175 -73
- package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
- package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
- package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
- package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +575 -164
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
- package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
- package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
- package/lib/esm/test/standalone/ExportGraphics.test.js +67 -15
- package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryStream.test.js +49 -1
- package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
- package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelLimits.test.d.ts +2 -0
- package/lib/esm/test/standalone/IModelLimits.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/IModelLimits.test.js +103 -0
- package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -0
- package/lib/esm/test/standalone/IModelWrite.test.js +27 -27
- package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
- package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
- package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
- package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderMaterialElement.test.js +24 -1
- package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
- package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
- package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
- package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
- package/lib/esm/test/standalone/Setting.test.js.map +1 -1
- package/lib/esm/test/standalone/Settings.test.js.map +1 -1
- package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js +19 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Texture.test.js.map +1 -1
- package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
- package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
- package/lib/esm/workspace/Settings.js.map +1 -1
- package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
- package/lib/esm/workspace/Workspace.d.ts +0 -1
- package/lib/esm/workspace/Workspace.d.ts.map +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +22 -16
- package/lib/cjs/TextAnnotationElement.d.ts +0 -54
- package/lib/cjs/TextAnnotationElement.d.ts.map +0 -1
- package/lib/cjs/TextAnnotationElement.js +0 -94
- package/lib/cjs/TextAnnotationElement.js.map +0 -1
- package/lib/cjs/TextAnnotationGeometry.d.ts +0 -32
- package/lib/cjs/TextAnnotationGeometry.d.ts.map +0 -1
- package/lib/cjs/TextAnnotationGeometry.js.map +0 -1
- package/lib/cjs/TextAnnotationLayout.d.ts.map +0 -1
- package/lib/cjs/TextAnnotationLayout.js.map +0 -1
- package/lib/esm/TextAnnotationElement.d.ts +0 -54
- package/lib/esm/TextAnnotationElement.d.ts.map +0 -1
- package/lib/esm/TextAnnotationElement.js +0 -89
- package/lib/esm/TextAnnotationElement.js.map +0 -1
- package/lib/esm/TextAnnotationGeometry.d.ts +0 -32
- package/lib/esm/TextAnnotationGeometry.d.ts.map +0 -1
- package/lib/esm/TextAnnotationGeometry.js.map +0 -1
- package/lib/esm/TextAnnotationLayout.d.ts.map +0 -1
- package/lib/esm/TextAnnotationLayout.js.map +0 -1
package/lib/cjs/Entity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../src/Entity.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuD;AACvD,oDAA6H;AAG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;;;;;;OAOG;IACO,mBAAmB,CAAC,aAAiC;QAC7D,OAAO,CAAC,2BAA2B;IACrC,CAAC;;AArQH,wBAsQC","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 Schema\n */\n\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\nimport { ElementLoadOptions, EntityProps, EntityReferenceSet, PropertyCallback, PropertyMetaData } from \"@itwin/core-common\";\nimport type { IModelDb } from \"./IModelDb\";\nimport { Schema } from \"./Schema\";\nimport { EntityClass, Property, SchemaItemKey } from \"@itwin/ecschema-metadata\";\nimport { _nativeDb } from \"./internal/Symbols\";\n\n/** Represents a row returned by an ECSql query. The row is returned as a map of property names to values.\n * ECSqlRow has same schema as declared in ECSchema for the class and similar to if ECSQL SELECT * FROM <schema>:<class> were executed.\n * @beta */\nexport interface ECSqlRow {\n [key: string]: any\n}\n\n/** Set of properties that are used to deserialize an [[EntityProps]] from an ECSqlRow.\n * @beta */\nexport interface DeserializeEntityArgs {\n /** Row to deserialize */\n row: ECSqlRow;\n /** The IModel that contains this Entity */\n iModel: IModelDb;\n /** The options used when loading */\n options?: {\n /** Options used when loading an element */\n element?: ElementLoadOptions;\n }\n}\n\n/** A property of an [[Entity]] that needs to be custom handled during deserialization and serialization.\n * @beta */\nexport interface CustomHandledProperty {\n /** The name of the property as it appears in the ECSqlRow */\n readonly propertyName: string;\n /** Where the property is defined */\n readonly source: \"Class\" | \"Computed\";\n}\n\n/** Represents one of the fundamental building block in an [[IModelDb]]: as an [[Element]], [[Model]], or [[Relationship]].\n * Every subclass of Entity represents one BIS [ECClass]($ecschema-metadata).\n * An Entity is typically instantiated from an [EntityProps]($common) and can be converted back to this representation via [[Entity.toJSON]].\n * @public\n */\nexport class Entity {\n /** An immutable property used to discriminate between [[Entity]] and [EntityProps]($common), used to inform the TypeScript compiler that these two types\n * are never substitutable for one another. To obtain an EntityProps from an Entity, use [[Entity.toJSON]].\n */\n public readonly isInstanceOfEntity = true as const;\n /** The Schema that defines this class. */\n public static schema: typeof Schema; // TODO: Schema key on the static level, but it requires a version which may differ between imodels\n\n private get _ctor(): typeof Entity { return this.constructor as typeof Entity; }\n\n /** The name of the BIS class associated with this class.\n * @note Every subclass of Entity **MUST** override this method to identify its BIS class.\n * Failure to do so will ordinarily result in an error when the class is registered, since there may only\n * be one JavaScript class for a given BIS class (usually the errant class will collide with its superclass.)\n */\n public static get className(): string { return \"Entity\"; }\n\n /** Serves as a unique identifier for this class. Typed variant of [[classFullName]].\n * @public @preview\n */\n public static get schemaItemKey(): SchemaItemKey {\n // We cannot cache this here because the className gets overridden in subclasses\n return new SchemaItemKey(this.className, this.schema.schemaKey);\n }\n\n private _metadata?: EntityClass;\n\n /** When working with an Entity it can be useful to set property values directly, bypassing the compiler's type checking.\n * This property makes such code slightly less tedious to read and write.\n * @internal\n */\n public get asAny(): any { return this; }\n\n /** The name of the BIS Schema that defines this class */\n public get schemaName(): string { return this._ctor.schema.schemaName; }\n\n /** The name of the BIS class associated with this class. */\n public get className(): string { return this._ctor.className; }\n\n /** The [[IModelDb]] that contains this Entity */\n public iModel: IModelDb;\n\n /** The Id of this Entity. May be invalid if the Entity has not yet been saved in the database. */\n public id: Id64String;\n\n\n protected constructor(props: EntityProps, iModel: IModelDb) {\n this.iModel = iModel;\n this.id = Id64.fromJSON(props.id);\n // copy all auto-handled properties from input to the object being constructed\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.forEachProperty((propName: string, meta: PropertyMetaData) => (this as any)[propName] = meta.createProperty((props as any)[propName]), false);\n }\n\n /** Invoke the constructor of the specified `Entity` subclass.\n * @internal\n */\n public static instantiate(subclass: typeof Entity, props: EntityProps, iModel: IModelDb): Entity {\n return new subclass(props, iModel);\n }\n\n /** List of properties that are need to be custom handled during deserialization and serialization.\n * These properties differ between the ECSql instance of an Entity and the Entity itself.\n * @beta */\n protected static readonly _customHandledProps: CustomHandledProperty[] = [\n { propertyName: \"id\", source: \"Class\" },\n { propertyName: \"className\", source: \"Class\" },\n { propertyName: \"jsonProperties\", source: \"Class\" }\n ];\n\n /** Get the list of properties that are custom handled by this class and its superclasses.\n * @internal */\n private static getCustomHandledProperties(): readonly CustomHandledProperty[] {\n if (this.name === \"Entity\") {\n return this._customHandledProps;\n }\n\n const superClass = Object.getPrototypeOf(this) as typeof Entity;\n return [\n ...superClass.getCustomHandledProperties(),\n ...this._customHandledProps,\n ];\n }\n\n /** Converts an ECSqlRow of an Entity to an EntityProps. This is used to deserialize an Entity from the database.\n * @beta */\n public static deserialize(props: DeserializeEntityArgs): EntityProps {\n const enProps: EntityProps = {\n classFullName: props.row.classFullName,\n id: props.row.id,\n }\n\n // Handles cases where id64 ints are stored in the jsonProperties and converts them to hex before parsing as a json object in js\n if (props.row.jsonProperties) {\n enProps.jsonProperties = JSON.parse(props.iModel[_nativeDb].patchJsonProperties(props.row.jsonProperties));\n }\n // Auto handles all properties that are not in the 'customHandledProperties' list\n const customHandledProperties = this.getCustomHandledProperties();\n Object.keys(props.row)\n .filter((propertyName) => customHandledProperties.find((val) => val.propertyName === propertyName) === undefined)\n .forEach((propertyName) => (enProps as ECSqlRow)[propertyName] = props.row[propertyName]\n );\n // Handles custom relClassNames to use '.' instead of ':'\n Object.keys(enProps).forEach((propertyName) => {\n if ((enProps as ECSqlRow)[propertyName].relClassName !== undefined && propertyName !== \"modeledElement\" && propertyName !== \"parentModel\") {\n (enProps as ECSqlRow)[propertyName].relClassName = (enProps as ECSqlRow)[propertyName].relClassName.replace(':', '.');\n }\n });\n return enProps;\n }\n\n /** Converts an EntityProps to an ECSqlRow. This is used to serialize an Entity to prepare to write it to the database.\n * @beta */\n public static serialize(props: EntityProps, _iModel: IModelDb): ECSqlRow {\n const inst: ECSqlRow = {\n classFullName: props.classFullName,\n id: props.id,\n }\n\n const customHandledProperties = this.getCustomHandledProperties();\n Object.keys(props)\n .filter((propertyName) => customHandledProperties.find((val) => val.propertyName === propertyName) === undefined)\n .forEach((propertyName) => inst[propertyName] = (props as ECSqlRow)[propertyName]\n );\n return inst;\n }\n\n /** Obtain the JSON representation of this Entity. Subclasses of [[Entity]] typically override this method to return their corresponding sub-type of [EntityProps]($common) -\n * for example, [[GeometricElement.toJSON]] returns a [GeometricElementProps]($common).\n */\n public toJSON(): EntityProps {\n const val: any = {};\n val.classFullName = this.classFullName;\n if (Id64.isValid(this.id))\n val.id = this.id;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.forEachProperty((propName: string) => val[propName] = (this as any)[propName], false);\n return val;\n }\n\n /** Call a function for each property of this Entity.\n * @param func The callback to be invoked on each property\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\n * @deprecated in 5.0. Please use `forEach` to get the metadata and iterate over the properties instead.\n *\n * @example\n * ```typescript\n * // Deprecated method\n * entity.forEachProperty((name, propMetaData) => {\n * console.log(`Property name: ${name}, Property type: ${propMetaData.primitiveType}`);\n * });\n *\n * // New method\n * entity.forEach((name, property) => {\n * console.log(`Property name: ${name}, Property type: ${property.propertyType}`);\n * });\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public forEachProperty(func: PropertyCallback, includeCustom: boolean = true) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.iModel.forEachMetaData(this.classFullName, true, func, includeCustom);\n }\n\n /**\n * Call a function for each property of this Entity.\n * @param func The callback to be invoked on each property.\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\n * @throws Error if metadata for the class cannot be retrieved.\n *\n * @example\n * ```typescript\n * entity.forEach((name, property) => {\n * console.log(`Property name: ${name}, Property type: ${property.propertyType}`);\n * });\n * ```\n */\n public forEach(func: PropertyHandler, includeCustom: boolean = true) {\n const metaData = this.iModel.schemaContext.getSchemaItemSync(this.schemaItemKey, EntityClass);\n if (!metaData)\n throw new Error(`Cannot get metadata for ${this.classFullName}`);\n\n for (const property of metaData.getPropertiesSync()) {\n if (includeCustom || !property.customAttributes?.has(`BisCore.CustomHandledProperty`))\n func(property.name, property);\n }\n }\n\n /** Get the full BIS class name of this Entity in the form \"schema:class\" */\n public static get classFullName(): string { return `${this.schema.schemaName}:${this.className}`; }\n\n /** Get the full BIS class name of this Entity in the form \"schema:class\". */\n public get classFullName(): string { return this._ctor.classFullName; }\n /**\n * Get the item key used by the ecschema-metadata package to identify this entity class\n * @public @preview\n */\n public get schemaItemKey(): SchemaItemKey { return this._ctor.schemaItemKey; }\n\n /** query metadata for this entity class from the iModel's schema\n * @throws [[IModelError]] if there is a problem querying the schema\n * @returns The metadata for the current entity\n * @public @preview\n */\n public async getMetaData(): Promise<EntityClass> {\n if (!this._metadata) {\n this._metadata = await this.iModel.schemaContext.getSchemaItem(this.schemaItemKey, EntityClass);\n }\n\n if (!this._metadata) {\n throw new Error(`Cannot get metadata for ${this.classFullName}`);\n }\n\n return this._metadata;\n }\n\n\n /** @internal */\n public static get protectedOperations(): string[] { return []; }\n\n /** return whether this Entity class is a subclass of another Entity class\n * @note the subclass-ness is checked according to JavaScript inheritance, to check the underlying raw EC class's\n * inheritance, you can use [ECClass.is]($ecschema-metadata)\n * @note this should have a type of `is<T extends typeof Entity>(otherClass: T): this is T` but can't because of\n * typescript's restriction on the `this` type in static methods\n */\n public static is(otherClass: typeof Entity): boolean {\n // inline of @itwin/core-bentley's isSubclassOf due to protected constructor.\n return this === otherClass || this.prototype instanceof otherClass;\n }\n\n /** whether this JavaScript class was generated for this ECClass because there was no registered custom implementation\n * ClassRegistry overrides this when generating a class\n * @internal\n */\n public static get isGeneratedClass() { return false; }\n\n /** Get the set of this entity's *entity references*, [EntityReferenceSet]($backend). An *entity reference* is any id\n * stored on the entity, in its EC properties or json fields.\n * This is important for cloning operations but can be useful in other situations as well.\n * @see this.collectReferenceIds\n * @beta\n */\n public getReferenceIds(): EntityReferenceSet {\n const referenceIds = new EntityReferenceSet();\n this.collectReferenceIds(referenceIds);\n return referenceIds;\n }\n\n /** Collect the Ids of this entity's *references* at this level of the class hierarchy.\n * A *reference* is any entity referenced by this entity's EC Data, including json fields.\n * This is important for cloning operations but can be useful in other situations as well.\n * @param _referenceIds The Id64Set to populate with reference Ids.\n * @note This should be overridden (with `super` called) at each level the class hierarchy that introduces references.\n * @see getReferenceIds\n * @beta\n */\n protected collectReferenceIds(_referenceIds: EntityReferenceSet): void {\n return; // no references by default\n }\n}\n\n/** A callback function to process properties of an Entity\n * @public @preview\n */\nexport type PropertyHandler = (name: string, property: Property) => void;\n\n/** Parameter type that can accept both abstract constructor types and non-abstract constructor types for `instanceof` to test.\n * @public\n */\nexport type EntityClassType<T> = Function & { prototype: T }; // eslint-disable-line @typescript-eslint/no-unsafe-function-type\n"]}
|
|
1
|
+
{"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../src/Entity.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuD;AACvD,oDAA6H;AAG7H,gEAA4G;AAC5G,gDAA+C;AAgC/C;;;;GAIG;AACH,MAAa,MAAM;IACjB;;OAEG;IACa,kBAAkB,GAAG,IAAa,CAAC;IACnD,0CAA0C;IACnC,MAAM,CAAC,MAAM,CAAgB,CAAC,mGAAmG;IAExI,IAAY,KAAK,KAAoB,OAAO,IAAI,CAAC,WAA4B,CAAC,CAAC,CAAC;IAEhF;;;;OAIG;IACI,MAAM,KAAK,SAAS,KAAa,OAAO,QAAQ,CAAC,CAAC,CAAC;IAE1D;;OAEG;IACI,MAAM,KAAK,aAAa;QAC7B,gFAAgF;QAChF,OAAO,IAAI,iCAAa,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAClE,CAAC;IAED,sCAAsC;IAC5B,SAAS,CAAmC;IAEtD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AAI,KAAK,UAAU,IAAI,IAAI,CAAC,SAAS,YAAY,UAAU,CAAC;IACrE,CAAC;IAED;;;OAGG;IACI,MAAM,KAAK,gBAAgB,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC;IAEtD;;;;;OAKG;IACI,eAAe;QACpB,MAAM,YAAY,GAAG,IAAI,gCAAkB,EAAE,CAAC;QAC9C,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACvC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;;;;OAOG;IACO,mBAAmB,CAAC,aAAiC;QAC7D,OAAO,CAAC,2BAA2B;IACrC,CAAC;;AAxRH,wBAyRC","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 Schema\r\n */\r\n\r\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { ElementLoadOptions, EntityProps, EntityReferenceSet, PropertyCallback, PropertyMetaData } from \"@itwin/core-common\";\r\nimport type { IModelDb } from \"./IModelDb\";\r\nimport { Schema } from \"./Schema\";\r\nimport { ECClass, EntityClass, Property, RelationshipClass, SchemaItemKey } from \"@itwin/ecschema-metadata\";\r\nimport { _nativeDb } from \"./internal/Symbols\";\r\n\r\n/** Represents a row returned by an ECSql query. The row is returned as a map of property names to values.\r\n * ECSqlRow has same schema as declared in ECSchema for the class and similar to if ECSQL SELECT * FROM <schema>:<class> were executed.\r\n * @beta */\r\nexport interface ECSqlRow {\r\n [key: string]: any\r\n}\r\n\r\n/** Set of properties that are used to deserialize an [[EntityProps]] from an ECSqlRow.\r\n * @beta */\r\nexport interface DeserializeEntityArgs {\r\n /** Row to deserialize */\r\n row: ECSqlRow;\r\n /** The IModel that contains this Entity */\r\n iModel: IModelDb;\r\n /** The options used when loading */\r\n options?: {\r\n /** Options used when loading an element */\r\n element?: ElementLoadOptions;\r\n }\r\n}\r\n\r\n/** A property of an [[Entity]] that needs to be custom handled during deserialization and serialization.\r\n * @beta */\r\nexport interface CustomHandledProperty {\r\n /** The name of the property as it appears in the ECSqlRow */\r\n readonly propertyName: string;\r\n /** Where the property is defined */\r\n readonly source: \"Class\" | \"Computed\";\r\n}\r\n\r\n/** Represents one of the fundamental building block in an [[IModelDb]]: as an [[Element]], [[Model]], or [[Relationship]].\r\n * Every subclass of Entity represents one BIS [ECClass]($ecschema-metadata).\r\n * An Entity is typically instantiated from an [EntityProps]($common) and can be converted back to this representation via [[Entity.toJSON]].\r\n * @public @preview\r\n */\r\nexport class Entity {\r\n /** An immutable property used to discriminate between [[Entity]] and [EntityProps]($common), used to inform the TypeScript compiler that these two types\r\n * are never substitutable for one another. To obtain an EntityProps from an Entity, use [[Entity.toJSON]].\r\n */\r\n public readonly isInstanceOfEntity = true as const;\r\n /** The Schema that defines this class. */\r\n public static schema: typeof Schema; // TODO: Schema key on the static level, but it requires a version which may differ between imodels\r\n\r\n private get _ctor(): typeof Entity { return this.constructor as typeof Entity; }\r\n\r\n /** The name of the BIS class associated with this class.\r\n * @note Every subclass of Entity **MUST** override this method to identify its BIS class.\r\n * Failure to do so will ordinarily result in an error when the class is registered, since there may only\r\n * be one JavaScript class for a given BIS class (usually the errant class will collide with its superclass.)\r\n */\r\n public static get className(): string { return \"Entity\"; }\r\n\r\n /** Serves as a unique identifier for this class. Typed variant of [[classFullName]].\r\n * @public @preview\r\n */\r\n public static get schemaItemKey(): SchemaItemKey {\r\n // We cannot cache this here because the className gets overridden in subclasses\r\n return new SchemaItemKey(this.className, this.schema.schemaKey);\r\n }\r\n\r\n /** Cached Metadata for the ECClass */\r\n protected _metadata?: EntityClass | RelationshipClass;\r\n\r\n /** When working with an Entity it can be useful to set property values directly, bypassing the compiler's type checking.\r\n * This property makes such code slightly less tedious to read and write.\r\n * @internal\r\n */\r\n public get asAny(): any { return this; }\r\n\r\n /** The name of the BIS Schema that defines this class */\r\n public get schemaName(): string { return this._ctor.schema.schemaName; }\r\n\r\n /** The name of the BIS class associated with this class. */\r\n public get className(): string { return this._ctor.className; }\r\n\r\n /** The [[IModelDb]] that contains this Entity */\r\n public iModel: IModelDb;\r\n\r\n /** The Id of this Entity. May be invalid if the Entity has not yet been saved in the database. */\r\n public id: Id64String;\r\n\r\n\r\n protected constructor(props: EntityProps, iModel: IModelDb) {\r\n this.iModel = iModel;\r\n this.id = Id64.fromJSON(props.id);\r\n // copy all auto-handled properties from input to the object being constructed\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this.forEachProperty((propName: string, meta: PropertyMetaData) => (this as any)[propName] = meta.createProperty((props as any)[propName]), false);\r\n }\r\n\r\n /** Invoke the constructor of the specified `Entity` subclass.\r\n * @internal\r\n */\r\n public static instantiate(subclass: typeof Entity, props: EntityProps, iModel: IModelDb): Entity {\r\n return new subclass(props, iModel);\r\n }\r\n\r\n /** List of properties that are need to be custom handled during deserialization and serialization.\r\n * These properties differ between the ECSql instance of an Entity and the Entity itself.\r\n * @beta */\r\n protected static readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"id\", source: \"Class\" },\r\n { propertyName: \"className\", source: \"Class\" },\r\n { propertyName: \"jsonProperties\", source: \"Class\" }\r\n ];\r\n\r\n /** Get the list of properties that are custom handled by this class and its superclasses.\r\n * @internal */\r\n private static getCustomHandledProperties(): readonly CustomHandledProperty[] {\r\n if (this.name === \"Entity\") {\r\n return this._customHandledProps;\r\n }\r\n\r\n const superClass = Object.getPrototypeOf(this) as typeof Entity;\r\n return [\r\n ...superClass.getCustomHandledProperties(),\r\n ...this._customHandledProps,\r\n ];\r\n }\r\n\r\n /** Converts an ECSqlRow of an Entity to an EntityProps. This is used to deserialize an Entity from the database.\r\n * @beta */\r\n public static deserialize(props: DeserializeEntityArgs): EntityProps {\r\n const enProps: EntityProps = {\r\n classFullName: props.row.classFullName,\r\n id: props.row.id,\r\n }\r\n\r\n // Handles cases where id64 ints are stored in the jsonProperties and converts them to hex before parsing as a json object in js\r\n if (props.row.jsonProperties) {\r\n enProps.jsonProperties = JSON.parse(props.iModel[_nativeDb].patchJsonProperties(props.row.jsonProperties));\r\n }\r\n // Auto handles all properties that are not in the 'customHandledProperties' list\r\n const customHandledProperties = this.getCustomHandledProperties();\r\n Object.keys(props.row)\r\n .filter((propertyName) => customHandledProperties.find((val) => val.propertyName === propertyName) === undefined)\r\n .forEach((propertyName) => (enProps as ECSqlRow)[propertyName] = props.row[propertyName]\r\n );\r\n // Handles custom relClassNames to use '.' instead of ':'\r\n Object.keys(enProps).forEach((propertyName) => {\r\n if ((enProps as ECSqlRow)[propertyName].relClassName !== undefined && propertyName !== \"modeledElement\" && propertyName !== \"parentModel\") {\r\n (enProps as ECSqlRow)[propertyName].relClassName = (enProps as ECSqlRow)[propertyName].relClassName.replace(':', '.');\r\n }\r\n });\r\n return enProps;\r\n }\r\n\r\n /** Converts an EntityProps to an ECSqlRow. This is used to serialize an Entity to prepare to write it to the database.\r\n * @beta */\r\n public static serialize(props: EntityProps, _iModel: IModelDb): ECSqlRow {\r\n const inst: ECSqlRow = {\r\n classFullName: props.classFullName,\r\n id: props.id,\r\n }\r\n\r\n const customHandledProperties = this.getCustomHandledProperties();\r\n Object.keys(props)\r\n .filter((propertyName) => customHandledProperties.find((val) => val.propertyName === propertyName) === undefined)\r\n .forEach((propertyName) => inst[propertyName] = (props as ECSqlRow)[propertyName]\r\n );\r\n return inst;\r\n }\r\n\r\n /** Obtain the JSON representation of this Entity. Subclasses of [[Entity]] typically override this method to return their corresponding sub-type of [EntityProps]($common) -\r\n * for example, [[GeometricElement.toJSON]] returns a [GeometricElementProps]($common).\r\n */\r\n public toJSON(): EntityProps {\r\n const val: any = {};\r\n val.classFullName = this.classFullName;\r\n if (Id64.isValid(this.id))\r\n val.id = this.id;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this.forEachProperty((propName: string) => val[propName] = (this as any)[propName], false);\r\n return val;\r\n }\r\n\r\n /** Call a function for each property of this Entity.\r\n * @param func The callback to be invoked on each property\r\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\r\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `forEach` to get the metadata and iterate over the properties instead.\r\n *\r\n * @example\r\n * ```typescript\r\n * // Deprecated method\r\n * entity.forEachProperty((name, propMetaData) => {\r\n * console.log(`Property name: ${name}, Property type: ${propMetaData.primitiveType}`);\r\n * });\r\n *\r\n * // New method\r\n * entity.forEach((name, property) => {\r\n * console.log(`Property name: ${name}, Property type: ${property.propertyType}`);\r\n * });\r\n * ```\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n public forEachProperty(func: PropertyCallback, includeCustom: boolean = true) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n this.iModel.forEachMetaData(this.classFullName, true, func, includeCustom);\r\n }\r\n\r\n /**\r\n * Call a function for each property of this Entity.\r\n * @param func The callback to be invoked on each property.\r\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\r\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\r\n * @throws Error if metadata for the class cannot be retrieved.\r\n *\r\n * @example\r\n * ```typescript\r\n * entity.forEach((name, property) => {\r\n * console.log(`Property name: ${name}, Property type: ${property.propertyType}`);\r\n * });\r\n * ```\r\n */\r\n public forEach(func: PropertyHandler, includeCustom: boolean = true) {\r\n const item = this._metadata ?? this.iModel.schemaContext.getSchemaItemSync(this.schemaItemKey);\r\n\r\n if (EntityClass.isEntityClass(item) || RelationshipClass.isRelationshipClass(item)) {\r\n for (const property of item.getPropertiesSync()) {\r\n if (includeCustom || !property.customAttributes?.has(`BisCore.CustomHandledProperty`))\r\n func(property.name, property);\r\n }\r\n } else {\r\n throw new Error(`Cannot get metadata for ${this.classFullName}. Class is not an EntityClass or RelationshipClass.`);\r\n }\r\n }\r\n\r\n /** Get the full BIS class name of this Entity in the form \"schema:class\" */\r\n public static get classFullName(): string { return `${this.schema.schemaName}:${this.className}`; }\r\n\r\n /** Get the full BIS class name of this Entity in the form \"schema:class\". */\r\n public get classFullName(): string { return this._ctor.classFullName; }\r\n /**\r\n * Get the item key used by the ecschema-metadata package to identify this entity class\r\n * @public @preview\r\n */\r\n public get schemaItemKey(): SchemaItemKey { return this._ctor.schemaItemKey; }\r\n\r\n /** Query metadata for this entity class from the iModel's schema. Returns cached metadata if available.\r\n * @throws [[IModelError]] if there is a problem querying the schema\r\n * @returns The metadata for the current entity\r\n * @public @preview\r\n */\r\n public async getMetaData(): Promise<EntityClass | RelationshipClass> {\r\n if (this._metadata) {\r\n return this._metadata;\r\n }\r\n\r\n const ecClass = await this.iModel.schemaContext.getSchemaItem(this.schemaItemKey, ECClass);\r\n if (EntityClass.isEntityClass(ecClass) || RelationshipClass.isRelationshipClass(ecClass)) {\r\n this._metadata = ecClass;\r\n return this._metadata;\r\n } else {\r\n throw new Error(`Cannot get metadata for ${this.classFullName}`);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public getMetaDataSync(): EntityClass | RelationshipClass {\r\n if (this._metadata) {\r\n return this._metadata;\r\n }\r\n\r\n const ecClass = this.iModel.schemaContext.getSchemaItemSync(this.schemaItemKey, ECClass);\r\n if (EntityClass.isEntityClass(ecClass) || RelationshipClass.isRelationshipClass(ecClass)) {\r\n this._metadata = ecClass;\r\n return this._metadata;\r\n } else {\r\n throw new Error(`Cannot get metadata for ${this.classFullName}`);\r\n }\r\n }\r\n \r\n /** @internal */\r\n public static get protectedOperations(): string[] { return []; }\r\n\r\n /** return whether this Entity class is a subclass of another Entity class\r\n * @note the subclass-ness is checked according to JavaScript inheritance, to check the underlying raw EC class's\r\n * inheritance, you can use [ECClass.is]($ecschema-metadata)\r\n * @note this should have a type of `is<T extends typeof Entity>(otherClass: T): this is T` but can't because of\r\n * typescript's restriction on the `this` type in static methods\r\n */\r\n public static is(otherClass: typeof Entity): boolean {\r\n // inline of @itwin/core-bentley's isSubclassOf due to protected constructor.\r\n return this === otherClass || this.prototype instanceof otherClass;\r\n }\r\n\r\n /** whether this JavaScript class was generated for this ECClass because there was no registered custom implementation\r\n * ClassRegistry overrides this when generating a class\r\n * @internal\r\n */\r\n public static get isGeneratedClass() { return false; }\r\n\r\n /** Get the set of this entity's *entity references*, [EntityReferenceSet]($backend). An *entity reference* is any id\r\n * stored on the entity, in its EC properties or json fields.\r\n * This is important for cloning operations but can be useful in other situations as well.\r\n * @see this.collectReferenceIds\r\n * @beta\r\n */\r\n public getReferenceIds(): EntityReferenceSet {\r\n const referenceIds = new EntityReferenceSet();\r\n this.collectReferenceIds(referenceIds);\r\n return referenceIds;\r\n }\r\n\r\n /** Collect the Ids of this entity's *references* at this level of the class hierarchy.\r\n * A *reference* is any entity referenced by this entity's EC Data, including json fields.\r\n * This is important for cloning operations but can be useful in other situations as well.\r\n * @param _referenceIds The Id64Set to populate with reference Ids.\r\n * @note This should be overridden (with `super` called) at each level the class hierarchy that introduces references.\r\n * @see getReferenceIds\r\n * @beta\r\n */\r\n protected collectReferenceIds(_referenceIds: EntityReferenceSet): void {\r\n return; // no references by default\r\n }\r\n}\r\n\r\n/** A callback function to process properties of an Entity\r\n * @public @preview\r\n */\r\nexport type PropertyHandler = (name: string, property: Property) => void;\r\n\r\n/** Parameter type that can accept both abstract constructor types and non-abstract constructor types for `instanceof` to test.\r\n * @public @preview\r\n */\r\nexport type EntityClassType<T> = Function & { prototype: T }; // eslint-disable-line @typescript-eslint/no-unsafe-function-type\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityReferences.js","sourceRoot":"","sources":["../../src/EntityReferences.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAAwH;AACxH,sDAAuD;AAEvD,mCAAgC;AAChC,uCAAoC;AACpC,mDAAgD;AAChD,iDAAiE;AACjE,iCAAiC;AAcjC;;;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D;IAChD,SAAgB,IAAI,CAAC,MAAsB;QACzC,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,WAA4B,CAAC,CAAC;QAChE,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC,EAAE,EAAE,CAAC;IAC/B,CAAC;IAHe,qBAAI,OAGnB,CAAA;IAED,mEAAmE;IACnE,SAAgB,SAAS,CAAC,EAAc,EAAE,WAA0B;QAClE,MAAM,IAAI,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;QACxC,OAAO,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC;IACxB,CAAC;IAHe,0BAAS,YAGxB,CAAA;IAED,4EAA4E;IAC5E,SAAgB,cAAc,CAAC,EAAc,EAAE,IAAyB;QACtE,OAAO,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC;IACxB,CAAC;IAFe,+BAAc,iBAE7B,CAAA;IAED,+FAA+F;IAC/F,SAAgB,aAAa,CAAC,WAA0B;QACtD,IAAI,WAAW,CAAC,EAAE,CAAC,iBAAO,CAAC;YACzB,OAAO,iCAAmB,CAAC,OAAO,CAAC;aAChC,IAAI,WAAW,CAAC,EAAE,CAAC,6BAAa,CAAC;YACpC,OAAO,iCAAmB,CAAC,aAAa,CAAC;aACtC,IAAI,WAAW,CAAC,EAAE,CAAC,aAAK,CAAC;YAC5B,OAAO,iCAAmB,CAAC,KAAK,CAAC;aAC9B,IAAI,WAAW,CAAC,EAAE,CAAC,2BAAY,CAAC;YACnC,OAAO,iCAAmB,CAAC,YAAY,CAAC;;YAExC,MAAM,CAAC,KAAK,EAAE,iEAAiE,CAAC,CAAC;IACrF,CAAC;IAXe,8BAAa,gBAW5B,CAAA;AACH,CAAC,EAlEgB,gBAAgB,gCAAhB,gBAAgB,QAkEhC","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 Schema\n */\n\nimport { ConcreteEntityTypes, ElementAspectProps, ElementProps, EntityReference, ModelProps } from \"@itwin/core-common\";\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\nimport type { Entity } from \"./Entity\";\nimport { Model } from \"./Model\";\nimport { Element } from \"./Element\";\nimport { ElementAspect } from \"./ElementAspect\";\nimport { Relationship, RelationshipProps } from \"./Relationship\";\nimport * as assert from \"assert\";\n\n/** Concrete classes that can be created, with the notable exception of CodeSpecs since it is does not derive from Entity\n * other entity classes. In the future if there is a need\n * to manage them this way, it can be added\n * @alpha\n */\nexport type ConcreteEntity = Element | Model | ElementAspect | Relationship;\n\n/** Props for a [[ConcreteEntity]]\n * @alpha\n */\nexport type ConcreteEntityProps = ElementProps | ModelProps | ElementAspectProps | RelationshipProps;\n\n/**\n * Utilities for the [EntityReference]($common) type which is a kind of strings\n * @alpha\n */\nexport namespace EntityReferences {\n export function isModel(id: EntityReference) {\n return id[0] === ConcreteEntityTypes.Model;\n }\n export function isElement(id: EntityReference) {\n return id[0] === ConcreteEntityTypes.Element;\n }\n export function isElementAspect(id: EntityReference) {\n return id[0] === ConcreteEntityTypes.ElementAspect;\n }\n export function isRelationship(id: EntityReference) {\n return id[0] === ConcreteEntityTypes.Relationship;\n }\n export function toId64(id: EntityReference) {\n return id.slice(1);\n }\n\n /** split a concrete entity id into its type and raw id */\n export function split(id: EntityReference): [ConcreteEntityTypes, Id64String] {\n return [id[0] as ConcreteEntityTypes, id.slice(1)];\n }\n\n /** used by the transformer to figure out where to check for the existence in a db of a concrete element id\n * @internal\n */\n export function isValid(id: EntityReference): boolean {\n return Id64.isValid(toId64(id));\n }\n\n /** create the invalid id for a concrete entity type\n * @internal\n */\n export function makeInvalid(type: ConcreteEntityTypes): EntityReference {\n return `${type}${Id64.invalid}`;\n }\n\n /** create an EntityReference given an entity */\n export function from(entity: ConcreteEntity): EntityReference {\n const type = typeFromClass(entity.constructor as typeof Entity);\n return `${type}${entity.id}`;\n }\n\n /** create an EntityReference given an id and a JavaScript class */\n export function fromClass(id: Id64String, entityClass: typeof Entity): EntityReference {\n const type = typeFromClass(entityClass);\n return `${type}${id}`;\n }\n\n /** Create an EntityReference quickly from an exact reference type and id */\n export function fromEntityType(id: Id64String, type: ConcreteEntityTypes): EntityReference {\n return `${type}${id}`;\n }\n\n /** @internal the argument entityClass be concrete (i.e. not the Entity abstract base class) */\n export function typeFromClass(entityClass: typeof Entity): ConcreteEntityTypes {\n if (entityClass.is(Element))\n return ConcreteEntityTypes.Element;\n else if (entityClass.is(ElementAspect))\n return ConcreteEntityTypes.ElementAspect;\n else if (entityClass.is(Model))\n return ConcreteEntityTypes.Model;\n else if (entityClass.is(Relationship))\n return ConcreteEntityTypes.Relationship;\n else\n assert(false, \"unknown or abstract entity type passed to EntityReferences.from\");\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"EntityReferences.js","sourceRoot":"","sources":["../../src/EntityReferences.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAAwH;AACxH,sDAAuD;AAEvD,mCAAgC;AAChC,uCAAoC;AACpC,mDAAgD;AAChD,iDAAiE;AACjE,iCAAiC;AAcjC;;;GAGG;AACH,IAAiB,gBAAgB,CAkEhC;AAlED,WAAiB,gBAAgB;IAC/B,SAAgB,OAAO,CAAC,EAAmB;QACzC,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,iCAAmB,CAAC,KAAK,CAAC;IAC7C,CAAC;IAFe,wBAAO,UAEtB,CAAA;IACD,SAAgB,SAAS,CAAC,EAAmB;QAC3C,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,iCAAmB,CAAC,OAAO,CAAC;IAC/C,CAAC;IAFe,0BAAS,YAExB,CAAA;IACD,SAAgB,eAAe,CAAC,EAAmB;QACjD,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,iCAAmB,CAAC,aAAa,CAAC;IACrD,CAAC;IAFe,gCAAe,kBAE9B,CAAA;IACD,SAAgB,cAA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E,EAAE,CAAC;IACxB,CAAC;IAFe,+BAAc,iBAE7B,CAAA;IAED,+FAA+F;IAC/F,SAAgB,aAAa,CAAC,WAA0B;QACtD,IAAI,WAAW,CAAC,EAAE,CAAC,iBAAO,CAAC;YACzB,OAAO,iCAAmB,CAAC,OAAO,CAAC;aAChC,IAAI,WAAW,CAAC,EAAE,CAAC,6BAAa,CAAC;YACpC,OAAO,iCAAmB,CAAC,aAAa,CAAC;aACtC,IAAI,WAAW,CAAC,EAAE,CAAC,aAAK,CAAC;YAC5B,OAAO,iCAAmB,CAAC,KAAK,CAAC;aAC9B,IAAI,WAAW,CAAC,EAAE,CAAC,2BAAY,CAAC;YACnC,OAAO,iCAAmB,CAAC,YAAY,CAAC;;YAExC,MAAM,CAAC,KAAK,EAAE,iEAAiE,CAAC,CAAC;IACrF,CAAC;IAXe,8BAAa,gBAW5B,CAAA;AACH,CAAC,EAlEgB,gBAAgB,gCAAhB,gBAAgB,QAkEhC","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 Schema\r\n */\r\n\r\nimport { ConcreteEntityTypes, ElementAspectProps, ElementProps, EntityReference, ModelProps } from \"@itwin/core-common\";\r\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport type { Entity } from \"./Entity\";\r\nimport { Model } from \"./Model\";\r\nimport { Element } from \"./Element\";\r\nimport { ElementAspect } from \"./ElementAspect\";\r\nimport { Relationship, RelationshipProps } from \"./Relationship\";\r\nimport * as assert from \"assert\";\r\n\r\n/** Concrete classes that can be created, with the notable exception of CodeSpecs since it is does not derive from Entity\r\n * other entity classes. In the future if there is a need\r\n * to manage them this way, it can be added\r\n * @alpha\r\n */\r\nexport type ConcreteEntity = Element | Model | ElementAspect | Relationship;\r\n\r\n/** Props for a [[ConcreteEntity]]\r\n * @alpha\r\n */\r\nexport type ConcreteEntityProps = ElementProps | ModelProps | ElementAspectProps | RelationshipProps;\r\n\r\n/**\r\n * Utilities for the [EntityReference]($common) type which is a kind of strings\r\n * @alpha\r\n */\r\nexport namespace EntityReferences {\r\n export function isModel(id: EntityReference) {\r\n return id[0] === ConcreteEntityTypes.Model;\r\n }\r\n export function isElement(id: EntityReference) {\r\n return id[0] === ConcreteEntityTypes.Element;\r\n }\r\n export function isElementAspect(id: EntityReference) {\r\n return id[0] === ConcreteEntityTypes.ElementAspect;\r\n }\r\n export function isRelationship(id: EntityReference) {\r\n return id[0] === ConcreteEntityTypes.Relationship;\r\n }\r\n export function toId64(id: EntityReference) {\r\n return id.slice(1);\r\n }\r\n\r\n /** split a concrete entity id into its type and raw id */\r\n export function split(id: EntityReference): [ConcreteEntityTypes, Id64String] {\r\n return [id[0] as ConcreteEntityTypes, id.slice(1)];\r\n }\r\n\r\n /** used by the transformer to figure out where to check for the existence in a db of a concrete element id\r\n * @internal\r\n */\r\n export function isValid(id: EntityReference): boolean {\r\n return Id64.isValid(toId64(id));\r\n }\r\n\r\n /** create the invalid id for a concrete entity type\r\n * @internal\r\n */\r\n export function makeInvalid(type: ConcreteEntityTypes): EntityReference {\r\n return `${type}${Id64.invalid}`;\r\n }\r\n\r\n /** create an EntityReference given an entity */\r\n export function from(entity: ConcreteEntity): EntityReference {\r\n const type = typeFromClass(entity.constructor as typeof Entity);\r\n return `${type}${entity.id}`;\r\n }\r\n\r\n /** create an EntityReference given an id and a JavaScript class */\r\n export function fromClass(id: Id64String, entityClass: typeof Entity): EntityReference {\r\n const type = typeFromClass(entityClass);\r\n return `${type}${id}`;\r\n }\r\n\r\n /** Create an EntityReference quickly from an exact reference type and id */\r\n export function fromEntityType(id: Id64String, type: ConcreteEntityTypes): EntityReference {\r\n return `${type}${id}`;\r\n }\r\n\r\n /** @internal the argument entityClass be concrete (i.e. not the Entity abstract base class) */\r\n export function typeFromClass(entityClass: typeof Entity): ConcreteEntityTypes {\r\n if (entityClass.is(Element))\r\n return ConcreteEntityTypes.Element;\r\n else if (entityClass.is(ElementAspect))\r\n return ConcreteEntityTypes.ElementAspect;\r\n else if (entityClass.is(Model))\r\n return ConcreteEntityTypes.Model;\r\n else if (entityClass.is(Relationship))\r\n return ConcreteEntityTypes.Relationship;\r\n else\r\n assert(false, \"unknown or abstract entity type passed to EntityReferences.from\");\r\n }\r\n}\r\n"]}
|
|
@@ -49,7 +49,7 @@ export interface ExportGraphicsMesh {
|
|
|
49
49
|
normals: Float32Array;
|
|
50
50
|
/** Parameters (uvs) for this mesh, laid out in the pattern XYXY */
|
|
51
51
|
params: Float32Array;
|
|
52
|
-
/** If true, clients should assume both sides of the mesh are visible and not cull
|
|
52
|
+
/** If true, clients should assume both sides of the mesh are visible and not cull back faces. */
|
|
53
53
|
isTwoSided: boolean;
|
|
54
54
|
}
|
|
55
55
|
/** Info provided to ExportGraphicsFunction about graphics.
|
|
@@ -273,18 +273,19 @@ export declare class ExportGraphicsMeshVisitor extends PolyfaceData implements P
|
|
|
273
273
|
private _nextFacetIndex;
|
|
274
274
|
private _numWrap;
|
|
275
275
|
private _polyface;
|
|
276
|
-
|
|
276
|
+
protected constructor(facets: ExportGraphicsMesh, numWrap: number);
|
|
277
277
|
/** 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
|
|
278
278
|
* Typical wrap counts are:
|
|
279
|
-
* * 0 -- leave the point arrays with "missing final edge"
|
|
279
|
+
* * 0 -- leave the point arrays with "missing final edge" (default)
|
|
280
280
|
* * 1 -- add point 0 as closure point
|
|
281
281
|
* * 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.
|
|
282
282
|
*/
|
|
283
|
-
static create(polyface: ExportGraphicsMesh, numWrap
|
|
284
|
-
/**
|
|
283
|
+
static create(polyface: ExportGraphicsMesh, numWrap?: number): ExportGraphicsMeshVisitor;
|
|
284
|
+
/** Restart the visitor at the first facet. */
|
|
285
285
|
reset(): void;
|
|
286
286
|
/** Select a facet by simple index. */
|
|
287
287
|
moveToReadIndex(facetIndex: number): boolean;
|
|
288
|
+
/** Load data for the next facet. */
|
|
288
289
|
moveToNextFacet(): boolean;
|
|
289
290
|
/** Set the number of vertices to replicate in visitor arrays. */
|
|
290
291
|
setNumWrap(numWrap: number): void;
|
|
@@ -300,12 +301,12 @@ export declare class ExportGraphicsMeshVisitor extends PolyfaceData implements P
|
|
|
300
301
|
* Use the artificial paramIndex, which matches pointIndex.
|
|
301
302
|
*/
|
|
302
303
|
clientNormalIndex(i: number): number;
|
|
303
|
-
/**
|
|
304
|
+
/** Always returns -1 since we never have colors. */
|
|
304
305
|
clientColorIndex(_i: number): number;
|
|
305
|
-
/**
|
|
306
|
+
/** Always returns -1 since we never have auxiliary data. */
|
|
306
307
|
clientAuxIndex(_i: number): number;
|
|
307
308
|
/** return the client polyface */
|
|
308
|
-
clientPolyface(): Polyface;
|
|
309
|
+
clientPolyface(): Polyface | undefined;
|
|
309
310
|
/** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */
|
|
310
311
|
clearArrays(): void;
|
|
311
312
|
/** transfer interpolated data from the other visitor.
|
|
@@ -314,5 +315,50 @@ export declare class ExportGraphicsMeshVisitor extends PolyfaceData implements P
|
|
|
314
315
|
pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void;
|
|
315
316
|
/** transfer data from a specified index of the other visitor as new data in this visitor. */
|
|
316
317
|
pushDataFrom(other: PolyfaceVisitor, index: number): void;
|
|
318
|
+
/** Return the number of facets this visitor is able to visit */
|
|
319
|
+
getVisitableFacetCount(): number;
|
|
320
|
+
/** Create a visitor for a subset of the facets visitable by the instance. */
|
|
321
|
+
createSubsetVisitor(facetIndices: number[], numWrap?: number): ExportGraphicsMeshSubsetVisitor;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* An `ExportGraphicsMeshSubsetVisitor` is an `ExportGraphicsMeshVisitor` which only visits a subset of the facets.
|
|
325
|
+
* * The subset is defined by an array of facet indices provided when this visitor is created.
|
|
326
|
+
* * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.
|
|
327
|
+
* @public
|
|
328
|
+
*/
|
|
329
|
+
export declare class ExportGraphicsMeshSubsetVisitor extends ExportGraphicsMeshVisitor {
|
|
330
|
+
private _facetIndices;
|
|
331
|
+
private _currentSubsetIndex;
|
|
332
|
+
private _nextSubsetIndex;
|
|
333
|
+
private constructor();
|
|
334
|
+
private isValidSubsetIndex;
|
|
335
|
+
/**
|
|
336
|
+
* Create a visitor for iterating a subset of the facets of `polyface`.
|
|
337
|
+
* @param polyface reference to the client polyface, supplying facets
|
|
338
|
+
* @param facetIndices array of indices of facets in the client polyface to visit. This array is cloned.
|
|
339
|
+
* @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.
|
|
340
|
+
*/
|
|
341
|
+
static createSubsetVisitor(polyface: ExportGraphicsMesh, facetIndices: number[], numWrap?: number): ExportGraphicsMeshSubsetVisitor;
|
|
342
|
+
/**
|
|
343
|
+
* Advance the iterator to a particular facet in the subset of client polyface facets.
|
|
344
|
+
* @param subsetIndex index into the subset array, not to be confused with the client facet index.
|
|
345
|
+
* @return whether the iterator was successfully moved.
|
|
346
|
+
*/
|
|
347
|
+
moveToReadIndex(subsetIndex: number): boolean;
|
|
348
|
+
/**
|
|
349
|
+
* Advance the iterator to the next facet in the subset of client polyface facets.
|
|
350
|
+
* @return whether the iterator was successfully moved.
|
|
351
|
+
*/
|
|
352
|
+
moveToNextFacet(): boolean;
|
|
353
|
+
/** Restart the visitor at the first facet. */
|
|
354
|
+
reset(): void;
|
|
355
|
+
/**
|
|
356
|
+
* Return the client polyface facet index (aka "readIndex") for the given subset index.
|
|
357
|
+
* @param subsetIndex index into the subset array. Default is the subset index of the currently visited facet.
|
|
358
|
+
* @return valid client polyface facet index, or `undefined` if invalid subset index.
|
|
359
|
+
*/
|
|
360
|
+
parentFacetIndex(subsetIndex?: number): number | undefined;
|
|
361
|
+
/** Return the number of facets this visitor is able to visit. */
|
|
362
|
+
getVisitableFacetCount(): number;
|
|
317
363
|
}
|
|
318
364
|
//# sourceMappingURL=ExportGraphics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportGraphics.d.ts","sourceRoot":"","sources":["../../src/ExportGraphics.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAElE;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,OAAO,EAAE,UAAU,CAAC;IACpB,+DAA+D;IAC/D,MAAM,EAAE,YAAY,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,SAAS,EAAE,UAAU,CAAC;IACtB,kEAAkE;IAClE,WAAW,EAAE,UAAU,CAAC;IACxB,oDAAoD;IACpD,KAAK,EAAE,aAAa,CAAC;IACrB,uCAAuC;IACvC,aAAa,EAAE,aAAa,CAAC;IAC7B,sCAAsC;IACtC,KAAK,EAAE,mBAAmB,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,OAAO,EAAE,UAAU,CAAC;IACpB,6DAA6D;IAC7D,MAAM,EAAE,YAAY,CAAC;IACrB,4DAA4D;IAC5D,OAAO,EAAE,YAAY,CAAC;IACtB,mEAAmE;IACnE,MAAM,EAAE,YAAY,CAAC;IACrB,
|
|
1
|
+
{"version":3,"file":"ExportG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AAQ,GAAG,SAAS;IAG7C,6GAA6G;IACtG,WAAW,IAAI,IAAI;IAS1B;;OAEG;IACI,wBAAwB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAO/G,6FAA6F;IACtF,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAQhE,gEAAgE;IACzD,sBAAsB,IAAI,MAAM;IAGvC,6EAA6E;IACtE,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,MAAU,GAAG,+BAA+B;CAGzG;AAED;;;;;GAKG;AACH,qBAAa,+BAAgC,SAAQ,yBAAyB;IAC5E,OAAO,CAAC,aAAa,CAAW;IAChC,OAAO,CAAC,mBAAmB,CAAS;IACpC,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAO;IAOP,OAAO,CAAC,kBAAkB;IAG1B;;;;;OAKG;WACW,mBAAmB,CAC/B,QAAQ,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,MAAU,GACxE,+BAA+B;IAGlC;;;;OAIG;IACa,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAQ7D;;;OAGG;IACa,eAAe,IAAI,OAAO;IAM1C,8CAA8C;IAC9B,KAAK,IAAI,IAAI;IAM7B;;;;OAIG;IACI,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAKjE,iEAAiE;IACjD,sBAAsB,IAAI,MAAM;CAGjD"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module ExportGraphics
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.ExportGraphicsMeshVisitor = exports.ExportGraphics = void 0;
|
|
10
|
+
exports.ExportGraphicsMeshSubsetVisitor = exports.ExportGraphicsMeshVisitor = exports.ExportGraphics = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const core_geometry_1 = require("@itwin/core-geometry");
|
|
13
13
|
/** Provides utility functions for working with data generated by [IModelDb.exportGraphics]($core-backend)
|
|
@@ -79,105 +79,122 @@ class ExportGraphicsMeshVisitor extends core_geometry_1.PolyfaceData {
|
|
|
79
79
|
_nextFacetIndex;
|
|
80
80
|
_numWrap;
|
|
81
81
|
_polyface;
|
|
82
|
-
// to be called from static factory method that validates the polyface ...
|
|
83
82
|
constructor(facets, numWrap) {
|
|
84
83
|
super(facets.normals.length > 0, facets.params.length > 0, false, facets.isTwoSided);
|
|
85
84
|
this._polyface = facets;
|
|
86
85
|
this._numWrap = numWrap;
|
|
87
86
|
this._nextFacetIndex = 0;
|
|
88
87
|
this._currentFacetIndex = -1;
|
|
89
|
-
this.twoSided = facets.isTwoSided;
|
|
90
88
|
this.reset();
|
|
91
89
|
}
|
|
92
90
|
/** 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
|
|
93
91
|
* Typical wrap counts are:
|
|
94
|
-
* * 0 -- leave the point arrays with "missing final edge"
|
|
92
|
+
* * 0 -- leave the point arrays with "missing final edge" (default)
|
|
95
93
|
* * 1 -- add point 0 as closure point
|
|
96
94
|
* * 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.
|
|
97
95
|
*/
|
|
98
|
-
static create(polyface, numWrap) {
|
|
96
|
+
static create(polyface, numWrap = 0) {
|
|
99
97
|
return new ExportGraphicsMeshVisitor(polyface, numWrap);
|
|
100
98
|
}
|
|
101
|
-
/**
|
|
99
|
+
/** Restart the visitor at the first facet. */
|
|
102
100
|
reset() {
|
|
103
101
|
this.moveToReadIndex(0);
|
|
104
|
-
this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here
|
|
102
|
+
this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here
|
|
105
103
|
}
|
|
106
104
|
/** Select a facet by simple index. */
|
|
107
105
|
moveToReadIndex(facetIndex) {
|
|
108
106
|
if (facetIndex < 0 || 2 + facetIndex * 3 >= this._polyface.indices.length)
|
|
109
107
|
return false;
|
|
110
|
-
this._currentFacetIndex
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const sourcePoints = this._polyface.points;
|
|
119
|
-
const indices = this._polyface.indices;
|
|
120
|
-
const i0 = 3 * facetIndex;
|
|
121
|
-
for (let i = i0; i < i0 + 3; i++) {
|
|
122
|
-
const k = 3 * indices[i];
|
|
123
|
-
this.pointIndex.push(indices[i]);
|
|
124
|
-
this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);
|
|
125
|
-
this.edgeVisible.push(true);
|
|
126
|
-
}
|
|
127
|
-
for (let i = 0; i < this._numWrap; i++) {
|
|
128
|
-
this.point.pushFromGrowableXYZArray(this.point, i);
|
|
129
|
-
}
|
|
130
|
-
const sourceParams = this._polyface.params;
|
|
131
|
-
if (sourceParams.length > 0 && this.paramIndex && this.param) {
|
|
132
|
-
this.paramIndex.length = 0;
|
|
133
|
-
this.param.length = 0;
|
|
108
|
+
if (this._currentFacetIndex !== facetIndex || 3 + this._numWrap !== this.point.length) {
|
|
109
|
+
this._currentFacetIndex = facetIndex;
|
|
110
|
+
this.point.length = 0;
|
|
111
|
+
this.pointIndex.length = 0;
|
|
112
|
+
this.edgeVisible.length = 0;
|
|
113
|
+
const sourcePoints = this._polyface.points;
|
|
114
|
+
const indices = this._polyface.indices;
|
|
115
|
+
const i0 = 3 * facetIndex;
|
|
134
116
|
for (let i = i0; i < i0 + 3; i++) {
|
|
135
|
-
const k =
|
|
136
|
-
this.
|
|
137
|
-
this.
|
|
117
|
+
const k = 3 * indices[i];
|
|
118
|
+
this.pointIndex.push(indices[i]);
|
|
119
|
+
this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);
|
|
120
|
+
this.edgeVisible.push(true);
|
|
138
121
|
}
|
|
139
122
|
for (let i = 0; i < this._numWrap; i++) {
|
|
140
|
-
this.
|
|
123
|
+
this.point.pushFromGrowableXYZArray(this.point, i);
|
|
141
124
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
125
|
+
const sourceParams = this._polyface.params;
|
|
126
|
+
if (sourceParams.length > 0 && this.paramIndex && this.param) {
|
|
127
|
+
this.paramIndex.length = 0;
|
|
128
|
+
this.param.length = 0;
|
|
129
|
+
for (let i = i0; i < i0 + 3; i++) {
|
|
130
|
+
const k = 2 * indices[i];
|
|
131
|
+
this.paramIndex.push(indices[i]);
|
|
132
|
+
this.param.pushXY(sourceParams[k], sourceParams[k + 1]);
|
|
133
|
+
}
|
|
134
|
+
for (let i = 0; i < this._numWrap; i++) {
|
|
135
|
+
this.param.pushFromGrowableXYArray(this.param, i);
|
|
136
|
+
}
|
|
151
137
|
}
|
|
152
|
-
|
|
153
|
-
|
|
138
|
+
const sourceNormals = this._polyface.normals;
|
|
139
|
+
if (sourceNormals.length > 0 && this.normalIndex && this.normal) {
|
|
140
|
+
this.normalIndex.length = 0;
|
|
141
|
+
this.normal.length = 0;
|
|
142
|
+
for (let i = i0; i < i0 + 3; i++) {
|
|
143
|
+
const k = 3 * indices[i];
|
|
144
|
+
this.normalIndex.push(indices[i]);
|
|
145
|
+
this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);
|
|
146
|
+
}
|
|
147
|
+
for (let i = 0; i < this._numWrap; i++) {
|
|
148
|
+
this.normal.pushFromGrowableXYZArray(this.normal, i);
|
|
149
|
+
}
|
|
154
150
|
}
|
|
155
151
|
}
|
|
152
|
+
this._nextFacetIndex = facetIndex + 1;
|
|
156
153
|
return true;
|
|
157
154
|
}
|
|
155
|
+
/** Load data for the next facet. */
|
|
158
156
|
moveToNextFacet() {
|
|
159
|
-
|
|
157
|
+
if (this._nextFacetIndex !== this._currentFacetIndex)
|
|
158
|
+
return this.moveToReadIndex(this._nextFacetIndex);
|
|
159
|
+
this._nextFacetIndex++;
|
|
160
|
+
return true;
|
|
160
161
|
}
|
|
161
162
|
/** Set the number of vertices to replicate in visitor arrays. */
|
|
162
|
-
setNumWrap(numWrap) {
|
|
163
|
+
setNumWrap(numWrap) {
|
|
164
|
+
this._numWrap = numWrap;
|
|
165
|
+
}
|
|
163
166
|
/** Return the index (in the client polyface) of the current facet */
|
|
164
|
-
currentReadIndex() {
|
|
167
|
+
currentReadIndex() {
|
|
168
|
+
return this._currentFacetIndex;
|
|
169
|
+
}
|
|
165
170
|
/** Return the point index of vertex i within the currently loaded facet */
|
|
166
|
-
clientPointIndex(i) {
|
|
171
|
+
clientPointIndex(i) {
|
|
172
|
+
return this.pointIndex[i];
|
|
173
|
+
}
|
|
167
174
|
/** Return the param index of vertex i within the currently loaded facet.
|
|
168
175
|
* Use the artificial paramIndex, which matches pointIndex.
|
|
169
176
|
*/
|
|
170
|
-
clientParamIndex(i) {
|
|
177
|
+
clientParamIndex(i) {
|
|
178
|
+
return this.paramIndex ? this.paramIndex[i] : -1;
|
|
179
|
+
}
|
|
171
180
|
/** Return the normal index of vertex i within the currently loaded facet.
|
|
172
181
|
* Use the artificial paramIndex, which matches pointIndex.
|
|
173
182
|
*/
|
|
174
|
-
clientNormalIndex(i) {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
|
|
183
|
+
clientNormalIndex(i) {
|
|
184
|
+
return this.normalIndex ? this.normalIndex[i] : -1;
|
|
185
|
+
}
|
|
186
|
+
/** Always returns -1 since we never have colors. */
|
|
187
|
+
clientColorIndex(_i) {
|
|
188
|
+
return -1;
|
|
189
|
+
}
|
|
190
|
+
/** Always returns -1 since we never have auxiliary data. */
|
|
191
|
+
clientAuxIndex(_i) {
|
|
192
|
+
return -1;
|
|
193
|
+
}
|
|
179
194
|
/** return the client polyface */
|
|
180
|
-
clientPolyface() {
|
|
195
|
+
clientPolyface() {
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
181
198
|
/** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */
|
|
182
199
|
clearArrays() {
|
|
183
200
|
if (this.point !== undefined)
|
|
@@ -201,13 +218,95 @@ class ExportGraphicsMeshVisitor extends core_geometry_1.PolyfaceData {
|
|
|
201
218
|
/** transfer data from a specified index of the other visitor as new data in this visitor. */
|
|
202
219
|
pushDataFrom(other, index) {
|
|
203
220
|
this.point.pushFromGrowableXYZArray(other.point, index);
|
|
204
|
-
if (this.color && other.color && index < other.color.length)
|
|
205
|
-
this.color.push(other.color[index]);
|
|
206
221
|
if (this.param && other.param && index < other.param.length)
|
|
207
222
|
this.param.pushFromGrowableXYArray(other.param, index);
|
|
208
223
|
if (this.normal && other.normal && index < other.normal.length)
|
|
209
224
|
this.normal.pushFromGrowableXYZArray(other.normal, index);
|
|
225
|
+
// ignore color and aux -- they never exist.
|
|
226
|
+
}
|
|
227
|
+
/** Return the number of facets this visitor is able to visit */
|
|
228
|
+
getVisitableFacetCount() {
|
|
229
|
+
return Math.floor(this._polyface.indices.length / 3);
|
|
230
|
+
}
|
|
231
|
+
/** Create a visitor for a subset of the facets visitable by the instance. */
|
|
232
|
+
createSubsetVisitor(facetIndices, numWrap = 0) {
|
|
233
|
+
return ExportGraphicsMeshSubsetVisitor.createSubsetVisitor(this._polyface, facetIndices, numWrap);
|
|
210
234
|
}
|
|
211
235
|
}
|
|
212
236
|
exports.ExportGraphicsMeshVisitor = ExportGraphicsMeshVisitor;
|
|
237
|
+
/**
|
|
238
|
+
* An `ExportGraphicsMeshSubsetVisitor` is an `ExportGraphicsMeshVisitor` which only visits a subset of the facets.
|
|
239
|
+
* * The subset is defined by an array of facet indices provided when this visitor is created.
|
|
240
|
+
* * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.
|
|
241
|
+
* @public
|
|
242
|
+
*/
|
|
243
|
+
class ExportGraphicsMeshSubsetVisitor extends ExportGraphicsMeshVisitor {
|
|
244
|
+
_facetIndices;
|
|
245
|
+
_currentSubsetIndex; // index within _facetIndices
|
|
246
|
+
_nextSubsetIndex; // index within _facetIndices
|
|
247
|
+
constructor(polyface, facetIndices, numWrap) {
|
|
248
|
+
super(polyface, numWrap);
|
|
249
|
+
this._facetIndices = facetIndices.slice();
|
|
250
|
+
this._currentSubsetIndex = -1;
|
|
251
|
+
this._nextSubsetIndex = 0;
|
|
252
|
+
this.reset();
|
|
253
|
+
}
|
|
254
|
+
isValidSubsetIndex(index) {
|
|
255
|
+
return index >= 0 && index < this._facetIndices.length;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Create a visitor for iterating a subset of the facets of `polyface`.
|
|
259
|
+
* @param polyface reference to the client polyface, supplying facets
|
|
260
|
+
* @param facetIndices array of indices of facets in the client polyface to visit. This array is cloned.
|
|
261
|
+
* @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.
|
|
262
|
+
*/
|
|
263
|
+
static createSubsetVisitor(polyface, facetIndices, numWrap = 0) {
|
|
264
|
+
return new ExportGraphicsMeshSubsetVisitor(polyface, facetIndices, numWrap);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Advance the iterator to a particular facet in the subset of client polyface facets.
|
|
268
|
+
* @param subsetIndex index into the subset array, not to be confused with the client facet index.
|
|
269
|
+
* @return whether the iterator was successfully moved.
|
|
270
|
+
*/
|
|
271
|
+
moveToReadIndex(subsetIndex) {
|
|
272
|
+
if (this.isValidSubsetIndex(subsetIndex)) {
|
|
273
|
+
this._currentSubsetIndex = subsetIndex;
|
|
274
|
+
this._nextSubsetIndex = subsetIndex + 1;
|
|
275
|
+
return super.moveToReadIndex(this._facetIndices[subsetIndex]);
|
|
276
|
+
}
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Advance the iterator to the next facet in the subset of client polyface facets.
|
|
281
|
+
* @return whether the iterator was successfully moved.
|
|
282
|
+
*/
|
|
283
|
+
moveToNextFacet() {
|
|
284
|
+
if (this._nextSubsetIndex !== this._currentSubsetIndex)
|
|
285
|
+
return this.moveToReadIndex(this._nextSubsetIndex);
|
|
286
|
+
this._nextSubsetIndex++;
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
/** Restart the visitor at the first facet. */
|
|
290
|
+
reset() {
|
|
291
|
+
if (this._facetIndices) { // avoid crash during super ctor when we aren't yet initialized
|
|
292
|
+
this.moveToReadIndex(0);
|
|
293
|
+
this._nextSubsetIndex = 0; // so immediate moveToNextFacet stays here
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Return the client polyface facet index (aka "readIndex") for the given subset index.
|
|
298
|
+
* @param subsetIndex index into the subset array. Default is the subset index of the currently visited facet.
|
|
299
|
+
* @return valid client polyface facet index, or `undefined` if invalid subset index.
|
|
300
|
+
*/
|
|
301
|
+
parentFacetIndex(subsetIndex) {
|
|
302
|
+
if (undefined === subsetIndex)
|
|
303
|
+
subsetIndex = this._currentSubsetIndex;
|
|
304
|
+
return this.isValidSubsetIndex(subsetIndex) ? this._facetIndices[subsetIndex] : undefined;
|
|
305
|
+
}
|
|
306
|
+
/** Return the number of facets this visitor is able to visit. */
|
|
307
|
+
getVisitableFacetCount() {
|
|
308
|
+
return this._facetIndices.length;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
exports.ExportGraphicsMeshSubsetVisitor = ExportGraphicsMeshSubsetVisitor;
|
|
213
312
|
//# sourceMappingURL=ExportGraphics.js.map
|