@itwin/core-backend 3.0.0-dev.100
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 +1525 -0
- package/LICENSE.md +9 -0
- package/README.md +11 -0
- package/lib/cjs/AliCloudStorageService.d.ts +12 -0
- package/lib/cjs/AliCloudStorageService.d.ts.map +1 -0
- package/lib/cjs/AliCloudStorageService.js +70 -0
- package/lib/cjs/AliCloudStorageService.js.map +1 -0
- package/lib/cjs/BackendHubAccess.d.ts +208 -0
- package/lib/cjs/BackendHubAccess.d.ts.map +1 -0
- package/lib/cjs/BackendHubAccess.js +42 -0
- package/lib/cjs/BackendHubAccess.js.map +1 -0
- package/lib/cjs/BackendLoggerCategory.d.ts +83 -0
- package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -0
- package/lib/cjs/BackendLoggerCategory.js +91 -0
- package/lib/cjs/BackendLoggerCategory.js.map +1 -0
- package/lib/cjs/BisCoreSchema.d.ts +22 -0
- package/lib/cjs/BisCoreSchema.d.ts.map +1 -0
- package/lib/cjs/BisCoreSchema.js +61 -0
- package/lib/cjs/BisCoreSchema.js.map +1 -0
- package/lib/cjs/BriefcaseManager.d.ts +167 -0
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -0
- package/lib/cjs/BriefcaseManager.js +406 -0
- package/lib/cjs/BriefcaseManager.js.map +1 -0
- package/lib/cjs/Category.d.ts +154 -0
- package/lib/cjs/Category.d.ts.map +1 -0
- package/lib/cjs/Category.js +244 -0
- package/lib/cjs/Category.js.map +1 -0
- package/lib/cjs/ChangeSummaryManager.d.ts +188 -0
- package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -0
- package/lib/cjs/ChangeSummaryManager.js +444 -0
- package/lib/cjs/ChangeSummaryManager.js.map +1 -0
- package/lib/cjs/ChangedElementsDb.d.ts +97 -0
- package/lib/cjs/ChangedElementsDb.d.ts.map +1 -0
- package/lib/cjs/ChangedElementsDb.js +166 -0
- package/lib/cjs/ChangedElementsDb.js.map +1 -0
- package/lib/cjs/ChangedElementsManager.d.ts +40 -0
- package/lib/cjs/ChangedElementsManager.d.ts.map +1 -0
- package/lib/cjs/ChangedElementsManager.js +89 -0
- package/lib/cjs/ChangedElementsManager.js.map +1 -0
- package/lib/cjs/CheckpointManager.d.ts +101 -0
- package/lib/cjs/CheckpointManager.d.ts.map +1 -0
- package/lib/cjs/CheckpointManager.js +257 -0
- package/lib/cjs/CheckpointManager.js.map +1 -0
- package/lib/cjs/ClassRegistry.d.ts +72 -0
- package/lib/cjs/ClassRegistry.d.ts.map +1 -0
- package/lib/cjs/ClassRegistry.js +154 -0
- package/lib/cjs/ClassRegistry.js.map +1 -0
- package/lib/cjs/CloudStorageBackend.d.ts +46 -0
- package/lib/cjs/CloudStorageBackend.d.ts.map +1 -0
- package/lib/cjs/CloudStorageBackend.js +157 -0
- package/lib/cjs/CloudStorageBackend.js.map +1 -0
- package/lib/cjs/CodeSpecs.d.ts +51 -0
- package/lib/cjs/CodeSpecs.d.ts.map +1 -0
- package/lib/cjs/CodeSpecs.js +113 -0
- package/lib/cjs/CodeSpecs.js.map +1 -0
- package/lib/cjs/ConcurrentQuery.d.ts +12 -0
- package/lib/cjs/ConcurrentQuery.d.ts.map +1 -0
- package/lib/cjs/ConcurrentQuery.js +24 -0
- package/lib/cjs/ConcurrentQuery.js.map +1 -0
- package/lib/cjs/DevTools.d.ts +72 -0
- package/lib/cjs/DevTools.d.ts.map +1 -0
- package/lib/cjs/DevTools.js +155 -0
- package/lib/cjs/DevTools.js.map +1 -0
- package/lib/cjs/DisplayStyle.d.ts +107 -0
- package/lib/cjs/DisplayStyle.d.ts.map +1 -0
- package/lib/cjs/DisplayStyle.js +292 -0
- package/lib/cjs/DisplayStyle.js.map +1 -0
- package/lib/cjs/ECDb.d.ts +196 -0
- package/lib/cjs/ECDb.d.ts.map +1 -0
- package/lib/cjs/ECDb.js +354 -0
- package/lib/cjs/ECDb.js.map +1 -0
- package/lib/cjs/ECSchemaXmlContext.d.ts +18 -0
- package/lib/cjs/ECSchemaXmlContext.d.ts.map +1 -0
- package/lib/cjs/ECSchemaXmlContext.js +36 -0
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -0
- package/lib/cjs/ECSqlStatement.d.ts +467 -0
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -0
- package/lib/cjs/ECSqlStatement.js +783 -0
- package/lib/cjs/ECSqlStatement.js.map +1 -0
- package/lib/cjs/Element.d.ts +1082 -0
- package/lib/cjs/Element.d.ts.map +1 -0
- package/lib/cjs/Element.js +1392 -0
- package/lib/cjs/Element.js.map +1 -0
- package/lib/cjs/ElementAspect.d.ts +157 -0
- package/lib/cjs/ElementAspect.d.ts.map +1 -0
- package/lib/cjs/ElementAspect.js +179 -0
- package/lib/cjs/ElementAspect.js.map +1 -0
- package/lib/cjs/ElementGraphics.d.ts +10 -0
- package/lib/cjs/ElementGraphics.d.ts.map +1 -0
- package/lib/cjs/ElementGraphics.js +42 -0
- package/lib/cjs/ElementGraphics.js.map +1 -0
- package/lib/cjs/Entity.d.ts +57 -0
- package/lib/cjs/Entity.d.ts.map +1 -0
- package/lib/cjs/Entity.js +63 -0
- package/lib/cjs/Entity.js.map +1 -0
- package/lib/cjs/ExportGraphics.d.ts +302 -0
- package/lib/cjs/ExportGraphics.d.ts.map +1 -0
- package/lib/cjs/ExportGraphics.js +206 -0
- package/lib/cjs/ExportGraphics.js.map +1 -0
- package/lib/cjs/ExternalSource.d.ts +95 -0
- package/lib/cjs/ExternalSource.d.ts.map +1 -0
- package/lib/cjs/ExternalSource.js +126 -0
- package/lib/cjs/ExternalSource.js.map +1 -0
- package/lib/cjs/GeometrySummary.d.ts +5 -0
- package/lib/cjs/GeometrySummary.d.ts.map +1 -0
- package/lib/cjs/GeometrySummary.js +378 -0
- package/lib/cjs/GeometrySummary.js.map +1 -0
- package/lib/cjs/IModelCloneContext.d.ts +74 -0
- package/lib/cjs/IModelCloneContext.d.ts.map +1 -0
- package/lib/cjs/IModelCloneContext.js +130 -0
- package/lib/cjs/IModelCloneContext.js.map +1 -0
- package/lib/cjs/IModelDb.d.ts +1107 -0
- package/lib/cjs/IModelDb.d.ts.map +1 -0
- package/lib/cjs/IModelDb.js +2161 -0
- package/lib/cjs/IModelDb.js.map +1 -0
- package/lib/cjs/IModelHost.d.ts +284 -0
- package/lib/cjs/IModelHost.d.ts.map +1 -0
- package/lib/cjs/IModelHost.js +411 -0
- package/lib/cjs/IModelHost.js.map +1 -0
- package/lib/cjs/IModelJsFs.d.ts +63 -0
- package/lib/cjs/IModelJsFs.d.ts.map +1 -0
- package/lib/cjs/IModelJsFs.js +141 -0
- package/lib/cjs/IModelJsFs.js.map +1 -0
- package/lib/cjs/IModelSchemaLoader.d.ts +26 -0
- package/lib/cjs/IModelSchemaLoader.d.ts.map +1 -0
- package/lib/cjs/IModelSchemaLoader.js +95 -0
- package/lib/cjs/IModelSchemaLoader.js.map +1 -0
- package/lib/cjs/IpcHost.d.ts +99 -0
- package/lib/cjs/IpcHost.d.ts.map +1 -0
- package/lib/cjs/IpcHost.js +234 -0
- package/lib/cjs/IpcHost.js.map +1 -0
- package/lib/cjs/LineStyle.d.ts +312 -0
- package/lib/cjs/LineStyle.d.ts.map +1 -0
- package/lib/cjs/LineStyle.js +296 -0
- package/lib/cjs/LineStyle.js.map +1 -0
- package/lib/cjs/LocalhostIpcHost.d.ts +19 -0
- package/lib/cjs/LocalhostIpcHost.d.ts.map +1 -0
- package/lib/cjs/LocalhostIpcHost.js +52 -0
- package/lib/cjs/LocalhostIpcHost.js.map +1 -0
- package/lib/cjs/Material.d.ts +102 -0
- package/lib/cjs/Material.d.ts.map +1 -0
- package/lib/cjs/Material.js +146 -0
- package/lib/cjs/Material.js.map +1 -0
- package/lib/cjs/Model.d.ts +387 -0
- package/lib/cjs/Model.d.ts.map +1 -0
- package/lib/cjs/Model.js +469 -0
- package/lib/cjs/Model.js.map +1 -0
- package/lib/cjs/NativeAppStorage.d.ts +52 -0
- package/lib/cjs/NativeAppStorage.d.ts.map +1 -0
- package/lib/cjs/NativeAppStorage.js +203 -0
- package/lib/cjs/NativeAppStorage.js.map +1 -0
- package/lib/cjs/NativeHost.d.ts +71 -0
- package/lib/cjs/NativeHost.d.ts.map +1 -0
- package/lib/cjs/NativeHost.js +221 -0
- package/lib/cjs/NativeHost.js.map +1 -0
- package/lib/cjs/NavigationRelationship.d.ts +157 -0
- package/lib/cjs/NavigationRelationship.d.ts.map +1 -0
- package/lib/cjs/NavigationRelationship.js +226 -0
- package/lib/cjs/NavigationRelationship.js.map +1 -0
- package/lib/cjs/PromiseMemoizer.d.ts +52 -0
- package/lib/cjs/PromiseMemoizer.d.ts.map +1 -0
- package/lib/cjs/PromiseMemoizer.js +93 -0
- package/lib/cjs/PromiseMemoizer.js.map +1 -0
- package/lib/cjs/Relationship.d.ts +400 -0
- package/lib/cjs/Relationship.d.ts.map +1 -0
- package/lib/cjs/Relationship.js +460 -0
- package/lib/cjs/Relationship.js.map +1 -0
- package/lib/cjs/RpcBackend.d.ts +23 -0
- package/lib/cjs/RpcBackend.d.ts.map +1 -0
- package/lib/cjs/RpcBackend.js +94 -0
- package/lib/cjs/RpcBackend.js.map +1 -0
- package/lib/cjs/SQLiteDb.d.ts +66 -0
- package/lib/cjs/SQLiteDb.d.ts.map +1 -0
- package/lib/cjs/SQLiteDb.js +140 -0
- package/lib/cjs/SQLiteDb.js.map +1 -0
- package/lib/cjs/Schema.d.ts +56 -0
- package/lib/cjs/Schema.d.ts.map +1 -0
- package/lib/cjs/Schema.js +84 -0
- package/lib/cjs/Schema.js.map +1 -0
- package/lib/cjs/ServerBasedLocks.d.ts +64 -0
- package/lib/cjs/ServerBasedLocks.d.ts.map +1 -0
- package/lib/cjs/ServerBasedLocks.js +177 -0
- package/lib/cjs/ServerBasedLocks.js.map +1 -0
- package/lib/cjs/SqliteStatement.d.ts +264 -0
- package/lib/cjs/SqliteStatement.d.ts.map +1 -0
- package/lib/cjs/SqliteStatement.js +417 -0
- package/lib/cjs/SqliteStatement.js.map +1 -0
- package/lib/cjs/Texture.d.ts +59 -0
- package/lib/cjs/Texture.d.ts.map +1 -0
- package/lib/cjs/Texture.js +83 -0
- package/lib/cjs/Texture.js.map +1 -0
- package/lib/cjs/TxnManager.d.ts +203 -0
- package/lib/cjs/TxnManager.d.ts.map +1 -0
- package/lib/cjs/TxnManager.js +354 -0
- package/lib/cjs/TxnManager.js.map +1 -0
- package/lib/cjs/ViewDefinition.d.ts +432 -0
- package/lib/cjs/ViewDefinition.d.ts.map +1 -0
- package/lib/cjs/ViewDefinition.js +623 -0
- package/lib/cjs/ViewDefinition.js.map +1 -0
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -0
- package/lib/cjs/core-backend.d.ts +162 -0
- package/lib/cjs/core-backend.d.ts.map +1 -0
- package/lib/cjs/core-backend.js +181 -0
- package/lib/cjs/core-backend.js.map +1 -0
- package/lib/cjs/domains/FunctionalElements.d.ts +102 -0
- package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -0
- package/lib/cjs/domains/FunctionalElements.js +146 -0
- package/lib/cjs/domains/FunctionalElements.js.map +1 -0
- package/lib/cjs/domains/FunctionalSchema.d.ts +14 -0
- package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -0
- package/lib/cjs/domains/FunctionalSchema.js +41 -0
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -0
- package/lib/cjs/domains/GenericElements.d.ts +178 -0
- package/lib/cjs/domains/GenericElements.d.ts.map +1 -0
- package/lib/cjs/domains/GenericElements.js +264 -0
- package/lib/cjs/domains/GenericElements.js.map +1 -0
- package/lib/cjs/domains/GenericSchema.d.ts +11 -0
- package/lib/cjs/domains/GenericSchema.d.ts.map +1 -0
- package/lib/cjs/domains/GenericSchema.js +29 -0
- package/lib/cjs/domains/GenericSchema.js.map +1 -0
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +16 -0
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts.map +1 -0
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +33 -0
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -0
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +40 -0
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -0
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +207 -0
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -0
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +21 -0
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -0
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +193 -0
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -0
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +37 -0
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -0
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +162 -0
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -0
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +17 -0
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts.map +1 -0
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +44 -0
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -0
- package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +16 -0
- package/lib/cjs/rpc-impl/WipRpcImpl.d.ts.map +1 -0
- package/lib/cjs/rpc-impl/WipRpcImpl.js +35 -0
- package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -0
- package/package.json +101 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module iModels
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ExportGraphicsMeshVisitor = exports.ExportGraphics = void 0;
|
|
11
|
+
const core_geometry_1 = require("@itwin/core-geometry");
|
|
12
|
+
/** Provides utility functions for working with data generated by [IModelDb.exportGraphics]($core-backend)
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
var ExportGraphics;
|
|
16
|
+
(function (ExportGraphics) {
|
|
17
|
+
/** Test if ExportPartDisplayInfos have exactly the same values.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
function arePartDisplayInfosEqual(lhs, rhs) {
|
|
21
|
+
if (lhs.categoryId !== rhs.categoryId)
|
|
22
|
+
return false;
|
|
23
|
+
if (lhs.subCategoryId !== rhs.subCategoryId)
|
|
24
|
+
return false;
|
|
25
|
+
if (lhs.materialId !== rhs.materialId)
|
|
26
|
+
return false;
|
|
27
|
+
if (lhs.elmTransparency !== rhs.elmTransparency)
|
|
28
|
+
return false;
|
|
29
|
+
if (lhs.lineColor !== rhs.lineColor)
|
|
30
|
+
return false;
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
ExportGraphics.arePartDisplayInfosEqual = arePartDisplayInfosEqual;
|
|
34
|
+
/**
|
|
35
|
+
* Convert an ExportGraphicsMesh to an IndexedPolyface usable by the geometry API.
|
|
36
|
+
* @note The resulting IndexedPolyface may have duplicate points, normals and params. If problematic, call [PolyfaceData.compress]($core-geometry)
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
function convertToIndexedPolyface(mesh) {
|
|
40
|
+
const polyface = core_geometry_1.IndexedPolyface.create(true, true, false, mesh.isTwoSided);
|
|
41
|
+
const p = mesh.points;
|
|
42
|
+
for (let i = 0; i < p.length; i += 3)
|
|
43
|
+
polyface.data.point.pushXYZ(p[i], p[i + 1], p[i + 2]);
|
|
44
|
+
const n = mesh.normals;
|
|
45
|
+
for (let i = 0; i < n.length; i += 3)
|
|
46
|
+
polyface.data.normal.pushXYZ(n[i], n[i + 1], n[i + 2]);
|
|
47
|
+
const uv = mesh.params;
|
|
48
|
+
for (let i = 0; i < uv.length; i += 2)
|
|
49
|
+
polyface.data.param.pushXY(uv[i], uv[i + 1]);
|
|
50
|
+
const indices = mesh.indices;
|
|
51
|
+
const addIndex = (idx) => {
|
|
52
|
+
polyface.addPointIndex(idx, true);
|
|
53
|
+
polyface.addNormalIndex(idx);
|
|
54
|
+
polyface.addParamIndex(idx);
|
|
55
|
+
};
|
|
56
|
+
for (let i = 0; i < indices.length; i += 3) {
|
|
57
|
+
addIndex(indices[i]);
|
|
58
|
+
addIndex(indices[i + 1]);
|
|
59
|
+
addIndex(indices[i + 2]);
|
|
60
|
+
polyface.terminateFacet(false);
|
|
61
|
+
}
|
|
62
|
+
return polyface;
|
|
63
|
+
}
|
|
64
|
+
ExportGraphics.convertToIndexedPolyface = convertToIndexedPolyface;
|
|
65
|
+
})(ExportGraphics = exports.ExportGraphics || (exports.ExportGraphics = {}));
|
|
66
|
+
/**
|
|
67
|
+
* * Iterator to walk the facets of an ExportGraphicsMesh and present them to the world as if visiting a Polyface.
|
|
68
|
+
* * Because the ExportGraphicsMesh has limited data:
|
|
69
|
+
* * There is no auxData in this visitor.
|
|
70
|
+
* * There is no color in this visitor.
|
|
71
|
+
* * All edgeVisible are true.
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
class ExportGraphicsMeshVisitor extends core_geometry_1.PolyfaceData {
|
|
75
|
+
// to be called from static factory method that validates the polyface ...
|
|
76
|
+
constructor(facets, numWrap) {
|
|
77
|
+
super(facets.normals.length > 0, facets.params.length > 0, false, facets.isTwoSided);
|
|
78
|
+
this._polyface = facets;
|
|
79
|
+
this._numWrap = numWrap;
|
|
80
|
+
this._nextFacetIndex = 0;
|
|
81
|
+
this._currentFacetIndex = -1;
|
|
82
|
+
this.twoSided = facets.isTwoSided;
|
|
83
|
+
this.reset();
|
|
84
|
+
}
|
|
85
|
+
/** 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
|
|
86
|
+
* Typical wrap counts are:
|
|
87
|
+
* * 0 -- leave the point arrays with "missing final edge"
|
|
88
|
+
* * 1 -- add point 0 as closure point
|
|
89
|
+
* * 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.
|
|
90
|
+
*/
|
|
91
|
+
static create(polyface, numWrap) {
|
|
92
|
+
return new ExportGraphicsMeshVisitor(polyface, numWrap);
|
|
93
|
+
}
|
|
94
|
+
/** Reset the iterator to start at the first facet of the polyface. */
|
|
95
|
+
reset() {
|
|
96
|
+
this.moveToReadIndex(0);
|
|
97
|
+
this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.
|
|
98
|
+
}
|
|
99
|
+
/** Select a facet by simple index. */
|
|
100
|
+
moveToReadIndex(facetIndex) {
|
|
101
|
+
if (facetIndex < 0 || 2 + facetIndex * 3 >= this._polyface.indices.length)
|
|
102
|
+
return false;
|
|
103
|
+
this._currentFacetIndex = facetIndex;
|
|
104
|
+
this._nextFacetIndex = facetIndex + 1;
|
|
105
|
+
this.point.length = 0;
|
|
106
|
+
const points = this.point;
|
|
107
|
+
points.length = 0;
|
|
108
|
+
this.pointIndex.length = 0;
|
|
109
|
+
this.point.length = 0;
|
|
110
|
+
this.edgeVisible.length = 0;
|
|
111
|
+
const sourcePoints = this._polyface.points;
|
|
112
|
+
const indices = this._polyface.indices;
|
|
113
|
+
const i0 = 3 * facetIndex;
|
|
114
|
+
for (let i = i0; i < i0 + 3; i++) {
|
|
115
|
+
const k = 3 * indices[i];
|
|
116
|
+
this.pointIndex.push(indices[i]);
|
|
117
|
+
this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);
|
|
118
|
+
this.edgeVisible.push(true);
|
|
119
|
+
}
|
|
120
|
+
for (let i = 0; i < this._numWrap; i++) {
|
|
121
|
+
this.point.pushFromGrowableXYZArray(this.point, i);
|
|
122
|
+
}
|
|
123
|
+
const sourceParams = this._polyface.params;
|
|
124
|
+
if (sourceParams.length > 0 && this.paramIndex && this.param) {
|
|
125
|
+
this.paramIndex.length = 0;
|
|
126
|
+
this.param.length = 0;
|
|
127
|
+
for (let i = i0; i < i0 + 3; i++) {
|
|
128
|
+
const k = 2 * indices[i];
|
|
129
|
+
this.paramIndex.push(indices[i]);
|
|
130
|
+
this.param.pushXY(sourceParams[k], sourceParams[k + 1]);
|
|
131
|
+
}
|
|
132
|
+
for (let i = 0; i < this._numWrap; i++) {
|
|
133
|
+
this.param.pushFromGrowableXYArray(this.param, i);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const sourceNormals = this._polyface.normals;
|
|
137
|
+
if (sourceNormals.length > 0 && this.normalIndex && this.normal) {
|
|
138
|
+
this.normalIndex.length = 0;
|
|
139
|
+
this.normal.length = 0;
|
|
140
|
+
for (let i = i0; i < i0 + 3; i++) {
|
|
141
|
+
const k = 3 * indices[i];
|
|
142
|
+
this.normalIndex.push(indices[i]);
|
|
143
|
+
this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);
|
|
144
|
+
}
|
|
145
|
+
for (let i = 0; i < this._numWrap; i++) {
|
|
146
|
+
this.normal.pushFromGrowableXYZArray(this.normal, i);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
moveToNextFacet() {
|
|
152
|
+
return this.moveToReadIndex(this._nextFacetIndex);
|
|
153
|
+
}
|
|
154
|
+
/** Set the number of vertices to replicate in visitor arrays. */
|
|
155
|
+
setNumWrap(numWrap) { this._numWrap = numWrap; }
|
|
156
|
+
/** Return the index (in the client polyface) of the current facet */
|
|
157
|
+
currentReadIndex() { return this._currentFacetIndex; }
|
|
158
|
+
/** Return the point index of vertex i within the currently loaded facet */
|
|
159
|
+
clientPointIndex(i) { return this.pointIndex[i]; }
|
|
160
|
+
/** Return the param index of vertex i within the currently loaded facet.
|
|
161
|
+
* Use the artificial paramIndex, which matches pointIndex.
|
|
162
|
+
*/
|
|
163
|
+
clientParamIndex(i) { return this.paramIndex ? this.paramIndex[i] : -1; }
|
|
164
|
+
/** Return the normal index of vertex i within the currently loaded facet.
|
|
165
|
+
* Use the artificial paramIndex, which matches pointIndex.
|
|
166
|
+
*/
|
|
167
|
+
clientNormalIndex(i) { return this.normalIndex ? this.normalIndex[i] : -1; }
|
|
168
|
+
/** Return the color index of vertex i within the currently loaded facet */
|
|
169
|
+
clientColorIndex(_i) { return 1; }
|
|
170
|
+
/** Return the aux data index of vertex i within the currently loaded facet */
|
|
171
|
+
clientAuxIndex(_i) { return -1; }
|
|
172
|
+
/** return the client polyface */
|
|
173
|
+
clientPolyface() { return undefined; }
|
|
174
|
+
/** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */
|
|
175
|
+
clearArrays() {
|
|
176
|
+
if (this.point !== undefined)
|
|
177
|
+
this.point.length = 0;
|
|
178
|
+
if (this.param !== undefined)
|
|
179
|
+
this.param.length = 0;
|
|
180
|
+
if (this.normal !== undefined)
|
|
181
|
+
this.normal.length = 0;
|
|
182
|
+
// ignore color and aux -- they never exist.
|
|
183
|
+
}
|
|
184
|
+
/** transfer interpolated data from the other visitor.
|
|
185
|
+
* * all data values are interpolated at `fraction` between `other` values at index0 and index1.
|
|
186
|
+
*/
|
|
187
|
+
pushInterpolatedDataFrom(other, index0, fraction, index1) {
|
|
188
|
+
this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);
|
|
189
|
+
if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)
|
|
190
|
+
this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);
|
|
191
|
+
if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)
|
|
192
|
+
this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);
|
|
193
|
+
}
|
|
194
|
+
/** transfer data from a specified index of the other visitor as new data in this visitor. */
|
|
195
|
+
pushDataFrom(other, index) {
|
|
196
|
+
this.point.pushFromGrowableXYZArray(other.point, index);
|
|
197
|
+
if (this.color && other.color && index < other.color.length)
|
|
198
|
+
this.color.push(other.color[index]);
|
|
199
|
+
if (this.param && other.param && index < other.param.length)
|
|
200
|
+
this.param.pushFromGrowableXYArray(other.param, index);
|
|
201
|
+
if (this.normal && other.normal && index < other.normal.length)
|
|
202
|
+
this.normal.pushFromGrowableXYZArray(other.normal, index);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
exports.ExportGraphicsMeshVisitor = ExportGraphicsMeshVisitor;
|
|
206
|
+
//# sourceMappingURL=ExportGraphics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportGraphics.js","sourceRoot":"","sources":["../../src/ExportGraphics.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAAgG;AAkPhG;;GAEG;AACH,IAAiB,cAAc,CAgD9B;AAhDD,WAAiB,cAAc;IAC7B;;OAEG;IACH,SAAgB,wBAAwB,CAAC,GAA0B,EAAE,GAA0B;QAC7F,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU;YAAE,OAAO,KAAK,CAAC;QACpD,IAAI,GAAG,CAAC,aAAa,KAAK,GAAG,CAAC,aAAa;YAAE,OAAO,KAAK,CAAC;QAC1D,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,UAAU;YAAE,OAAO,KAAK,CAAC;QACpD,IAAI,GAAG,CAAC,eAAe,KAAK,GAAG,CAAC,eAAe;YAAE,OAAO,KAAK,CAAC;QAC9D,IAAI,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS;YAAE,OAAO,KAAK,CAAC;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAPe,uCAAwB,2BAOvC,CAAA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AC,MAAM,IAAI,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM;YACzF,IAAI,CAAC,KAAK,CAAC,mCAAmC,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACxF,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM;YAC7F,IAAI,CAAC,MAAM,CAAC,oCAAoC,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7F,CAAC;IACD,6FAA6F;IACtF,YAAY,CAAC,KAAsB,EAAE,KAAa;QACvD,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACxD,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM;YACzD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM;YACzD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACzD,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM;YAC5D,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC;CAEF;AA5ID,8DA4IC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport { IndexedPolyface, Polyface, PolyfaceData, PolyfaceVisitor } from \"@itwin/core-geometry\";\r\nimport { GeometryClass } from \"@itwin/core-common\";\r\n\r\n/** A collection of line segments, suitable for direct use with graphics APIs.\r\n * The structure of this data matches GL_LINES in OpenGL.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsLines {\r\n /** Zero-based vertex indices, every two indices represent a line segment */\r\n indices: Int32Array;\r\n /** Vertices for these lines, laid out in the pattern XYZXYZ */\r\n points: Float64Array;\r\n}\r\n\r\n/** Info provided to ExportLinesFunction about linework graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportLinesInfo {\r\n /** The element ID for the element the graphics originated from */\r\n elementId: Id64String;\r\n /** ID for the [SubCategory]($core-backend) for these graphics */\r\n subCategory: Id64String;\r\n /** The color and transparency for these graphics, laid out in TBGR format, see [ColorDef]($core-common) */\r\n color: number;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** The linework for these graphics */\r\n lines: ExportGraphicsLines;\r\n}\r\n\r\n/** A callback function that receives generated line graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportLinesFunction = (info: ExportLinesInfo) => void;\r\n\r\n/** A triangulated mesh with unified indices, suitable for direct use with graphics APIs.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsMesh {\r\n /** Zero-based vertex indices, every three indices represent a triangle */\r\n indices: Int32Array;\r\n /** Vertices for this mesh, laid out in the pattern XYZXYZ */\r\n points: Float64Array;\r\n /** Normals for this mesh, laid out in the pattern XYZXYZ */\r\n normals: Float32Array;\r\n /** Parameters (uvs) for this mesh, laid out in the pattern XYXY */\r\n params: Float32Array;\r\n /** If true, clients should assume both sides of the mesh are visible and not cull backfaces. */\r\n isTwoSided: boolean;\r\n}\r\n\r\n/** Info provided to ExportGraphicsFunction about graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsInfo {\r\n /** The element ID for the element the graphics originated from */\r\n elementId: Id64String;\r\n /** ID for the [SubCategory]($core-backend) for these graphics */\r\n subCategory: Id64String;\r\n /** The color and transparency for these graphics, laid out in TBGR format, see [ColorDef]($core-common) */\r\n color: number;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\r\n materialId?: Id64String;\r\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\r\n textureId?: Id64String;\r\n /** The mesh for these graphics */\r\n mesh: ExportGraphicsMesh;\r\n}\r\n\r\n/** Information about the base display properties when a [GeometryPart]($core-backend) was\r\n * referenced. This is intended to be used with [IModelDb.exportPartGraphics]($core-backend).\r\n * * If two ExportPartInstanceInfo have the same ExportPartDisplayInfos, they will result in the\r\n * same graphics (with a different transform).\r\n * * If two ExportPartInstanceInfo have different ExportPartDisplayInfos, they may result in different\r\n * graphics.\r\n * @public\r\n */\r\nexport interface ExportPartDisplayInfo {\r\n categoryId: Id64String;\r\n subCategoryId: Id64String;\r\n geometryClass: GeometryClass;\r\n materialId: Id64String;\r\n elmTransparency: number;\r\n lineColor: number;\r\n}\r\n\r\n/** Information about references to [GeometryPart]($core-backend) elements found during\r\n * a call to [IModelDb.exportGraphics]($core-backend).\r\n * See [IModelDb.exportPartGraphics]($core-backend) for the intended use case.\r\n * @public\r\n */\r\nexport interface ExportPartInstanceInfo {\r\n /** ID for the [GeometryPart]($core-backend) */\r\n partId: Id64String;\r\n /** ID for the element that contained the reference to the [GeometryPart]($core-backend) */\r\n partInstanceId: Id64String;\r\n /** The base display properties when the [GeometryPart]($core-backend) was referenced. */\r\n displayProps: ExportPartDisplayInfo;\r\n /** A row-major storage 4x3 transform for this instance.\r\n * See export-gltf under test-apps in the iModel.js monorepo for a working reference.\r\n */\r\n transform?: Float64Array;\r\n}\r\n\r\n/** A callback function that receives generated graphics.\r\n * See [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportGraphicsFunction = (info: ExportGraphicsInfo) => void;\r\n\r\n/** Parameters for [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportGraphicsOptions {\r\n /** The source elements for the exported graphics */\r\n elementIdArray: Id64Array;\r\n /** A function to call for each unique element ID, color and texture combination */\r\n onGraphics: ExportGraphicsFunction;\r\n /** An optional function to call if line graphics are desired. */\r\n onLineGraphics?: ExportLinesFunction;\r\n /** If supplied, any references to [GeometryPart]($core-backend) elements found will be\r\n * recorded in this array. In this case, graphics that would result from the GeometryPart\r\n * will not be supplied via onGraphics. See [IModelDb.exportPartGraphics]($core-backend)\r\n */\r\n partInstanceArray?: ExportPartInstanceInfo[];\r\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry) */\r\n chordTol?: number;\r\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry) */\r\n angleTol?: number;\r\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry) */\r\n maxEdgeLength?: number;\r\n /** The longest dimension of a line style's largest component must be at least this size in order for\r\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\r\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\r\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\r\n * line strings.\r\n */\r\n minLineStyleComponentSize?: number;\r\n /** Max distance between mesh vertices for them to be collapsed.\r\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\r\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\r\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\r\n * anomalies so it is important to choose an appropriate setting for your use case.\r\n */\r\n decimationTol?: number;\r\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\r\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\r\n * like screws and screw holes.\r\n */\r\n minBRepFeatureSize?: number;\r\n}\r\n\r\n/** Info provided to ExportPartFunction about graphics.\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportPartInfo {\r\n /** The color and transparency for these graphics, laid out in TBGR format, see [ColorDef]($core-common) */\r\n color: number;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** If defined, ID for the [RenderMaterialElement]($core-backend) for these graphics */\r\n materialId?: Id64String;\r\n /** If defined, ID for the [Texture]($core-backend) for these graphics */\r\n textureId?: Id64String;\r\n /** The mesh for these graphics */\r\n mesh: ExportGraphicsMesh;\r\n}\r\n\r\n/** A callback function that receives generated graphics for a [GeometryPart]($core-backend).\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportPartFunction = (info: ExportPartInfo) => void;\r\n\r\n/** Info provided to ExportPartFunction about line graphics.\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportPartLinesInfo {\r\n /** The color and transparency for these graphics, laid out in TBGR format, see [ColorDef]($core-common) */\r\n color: number;\r\n /** GeometryClass for these graphics */\r\n geometryClass: GeometryClass;\r\n /** The linework for these graphics */\r\n lines: ExportGraphicsLines;\r\n}\r\n\r\n/** A callback function that receives generated line graphics for a [GeometryPart]($core-backend).\r\n * See [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport type ExportPartLinesFunction = (info: ExportPartLinesInfo) => void;\r\n\r\n/** Parameters for [IModelDb.exportPartGraphics]($core-backend)\r\n * @public\r\n */\r\nexport interface ExportPartGraphicsOptions {\r\n /** The ID for the source [GeometryPart]($core-backend) */\r\n elementId: Id64String;\r\n /** The base display properties to use for generating the graphics. This should come from an\r\n * ExportPartInstanceProps generated by [IModelDb.exportGraphics]($core-backend)\r\n */\r\n displayProps: ExportPartDisplayInfo;\r\n /** A function to call for each unique color and texture combination. */\r\n onPartGraphics: ExportPartFunction;\r\n /** An optional function to call if line graphics are desired. */\r\n onPartLineGraphics?: ExportPartLinesFunction;\r\n /** Max distance from a face to the original geometry, see [StrokeOptions]($core-geometry) */\r\n chordTol?: number;\r\n /** Max angle difference in radians for approximated face, see [StrokeOptions]($core-geometry) */\r\n angleTol?: number;\r\n /** Max length of any edge in generated faces, see [StrokeOptions]($core-geometry) */\r\n maxEdgeLength?: number;\r\n /** The longest dimension of a line style's largest component must be at least this size in order for\r\n * exportGraphics to evaluate and generate its graphics. If undefined, this defaults to 0.1.\r\n * Line styles can evaluate to 3D geometry that clients expect to receive from exportGraphics, but they\r\n * can also generate gigabytes of mesh data when line styles with small components are applied to long\r\n * line strings.\r\n */\r\n minLineStyleComponentSize?: number;\r\n /** Max distance between mesh vertices for them to be collapsed.\r\n * Meshes stored in GeometryStreams are unaffected by StrokeOptions settings. If decimationTol is undefined,\r\n * they are output from exportGraphics without any reduction in quality and can be too detailed for\r\n * some uses. However, decimation is a destructive operation that can introduce gaps and other visual\r\n * anomalies so it is important to choose an appropriate setting for your use case.\r\n */\r\n decimationTol?: number;\r\n /** BRep features with bounding boxes smaller than this size will not generate graphics.\r\n * This option can be used to ignore expensive details from [BRepEntity.DataProps]($core-common)\r\n * like screws and screw holes.\r\n */\r\n minBRepFeatureSize?: number;\r\n}\r\n\r\n/** Provides utility functions for working with data generated by [IModelDb.exportGraphics]($core-backend)\r\n * @public\r\n */\r\nexport namespace ExportGraphics {\r\n /** Test if ExportPartDisplayInfos have exactly the same values.\r\n * @public\r\n */\r\n export function arePartDisplayInfosEqual(lhs: ExportPartDisplayInfo, rhs: ExportPartDisplayInfo): boolean {\r\n if (lhs.categoryId !== rhs.categoryId) return false;\r\n if (lhs.subCategoryId !== rhs.subCategoryId) return false;\r\n if (lhs.materialId !== rhs.materialId) return false;\r\n if (lhs.elmTransparency !== rhs.elmTransparency) return false;\r\n if (lhs.lineColor !== rhs.lineColor) return false;\r\n return true;\r\n }\r\n\r\n /**\r\n * Convert an ExportGraphicsMesh to an IndexedPolyface usable by the geometry API.\r\n * @note The resulting IndexedPolyface may have duplicate points, normals and params. If problematic, call [PolyfaceData.compress]($core-geometry)\r\n * @public\r\n */\r\n export function convertToIndexedPolyface(mesh: ExportGraphicsMesh): IndexedPolyface {\r\n const polyface = IndexedPolyface.create(true, true, false, mesh.isTwoSided);\r\n\r\n const p: Float64Array = mesh.points;\r\n for (let i = 0; i < p.length; i += 3)\r\n polyface.data.point.pushXYZ(p[i], p[i + 1], p[i + 2]);\r\n\r\n const n: Float32Array = mesh.normals;\r\n for (let i = 0; i < n.length; i += 3)\r\n polyface.data.normal!.pushXYZ(n[i], n[i + 1], n[i + 2]);\r\n\r\n const uv: Float32Array = mesh.params;\r\n for (let i = 0; i < uv.length; i += 2)\r\n polyface.data.param!.pushXY(uv[i], uv[i + 1]);\r\n\r\n const indices = mesh.indices;\r\n const addIndex = (idx: number) => {\r\n polyface.addPointIndex(idx, true);\r\n polyface.addNormalIndex(idx);\r\n polyface.addParamIndex(idx);\r\n };\r\n for (let i = 0; i < indices.length; i += 3) {\r\n addIndex(indices[i]);\r\n addIndex(indices[i + 1]);\r\n addIndex(indices[i + 2]);\r\n polyface.terminateFacet(false);\r\n }\r\n\r\n return polyface;\r\n }\r\n}\r\n/**\r\n * * Iterator to walk the facets of an ExportGraphicsMesh and present them to the world as if visiting a Polyface.\r\n * * Because the ExportGraphicsMesh has limited data:\r\n * * There is no auxData in this visitor.\r\n * * There is no color in this visitor.\r\n * * All edgeVisible are true.\r\n * @public\r\n */\r\nexport class ExportGraphicsMeshVisitor extends PolyfaceData implements PolyfaceVisitor {\r\n private _currentFacetIndex: number;\r\n private _nextFacetIndex: number;\r\n private _numWrap: number;\r\n private _polyface: ExportGraphicsMesh;\r\n // to be called from static factory method that validates the polyface ...\r\n private constructor(facets: ExportGraphicsMesh, numWrap: number) {\r\n super(facets.normals.length > 0, facets.params.length > 0, false, facets.isTwoSided);\r\n this._polyface = facets;\r\n this._numWrap = numWrap;\r\n\r\n this._nextFacetIndex = 0;\r\n this._currentFacetIndex = -1;\r\n this.twoSided = facets.isTwoSided;\r\n this.reset();\r\n }\r\n /** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays\r\n * Typical wrap counts are:\r\n * * 0 -- leave the point arrays with \"missing final edge\"\r\n * * 1 -- add point 0 as closure point\r\n * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.\r\n */\r\n public static create(polyface: ExportGraphicsMesh, numWrap: number): ExportGraphicsMeshVisitor {\r\n return new ExportGraphicsMeshVisitor(polyface, numWrap);\r\n }\r\n /** Reset the iterator to start at the first facet of the polyface. */\r\n public reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.\r\n }\r\n /** Select a facet by simple index. */\r\n public moveToReadIndex(facetIndex: number): boolean {\r\n if (facetIndex < 0 || 2 + facetIndex * 3 >= this._polyface.indices.length)\r\n return false;\r\n this._currentFacetIndex = facetIndex;\r\n this._nextFacetIndex = facetIndex + 1;\r\n this.point.length = 0;\r\n const points = this.point;\r\n points.length = 0;\r\n this.pointIndex.length = 0;\r\n this.point.length = 0;\r\n this.edgeVisible.length = 0;\r\n const sourcePoints = this._polyface.points;\r\n const indices = this._polyface.indices;\r\n const i0 = 3 * facetIndex;\r\n for (let i = i0; i < i0 + 3; i++) {\r\n const k = 3 * indices[i];\r\n this.pointIndex.push(indices[i]);\r\n this.point.pushXYZ(sourcePoints[k], sourcePoints[k + 1], sourcePoints[k + 2]);\r\n this.edgeVisible.push(true);\r\n }\r\n for (let i = 0; i < this._numWrap; i++) {\r\n this.point.pushFromGrowableXYZArray(this.point, i);\r\n }\r\n\r\n const sourceParams = this._polyface.params;\r\n if (sourceParams.length > 0 && this.paramIndex && this.param) {\r\n this.paramIndex.length = 0;\r\n this.param.length = 0;\r\n for (let i = i0; i < i0 + 3; i++) {\r\n const k = 2 * indices[i];\r\n this.paramIndex.push(indices[i]);\r\n this.param.pushXY(sourceParams[k], sourceParams[k + 1]);\r\n }\r\n for (let i = 0; i < this._numWrap; i++) {\r\n this.param.pushFromGrowableXYArray(this.param, i);\r\n }\r\n }\r\n\r\n const sourceNormals = this._polyface.normals;\r\n if (sourceNormals.length > 0 && this.normalIndex && this.normal) {\r\n this.normalIndex.length = 0;\r\n this.normal.length = 0;\r\n for (let i = i0; i < i0 + 3; i++) {\r\n const k = 3 * indices[i];\r\n this.normalIndex.push(indices[i]);\r\n this.normal.pushXYZ(sourceNormals[k], sourceNormals[k + 1], sourceNormals[k + 2]);\r\n }\r\n for (let i = 0; i < this._numWrap; i++) {\r\n this.normal.pushFromGrowableXYZArray(this.normal, i);\r\n }\r\n }\r\n return true;\r\n }\r\n public moveToNextFacet(): boolean {\r\n return this.moveToReadIndex(this._nextFacetIndex);\r\n }\r\n /** Set the number of vertices to replicate in visitor arrays. */\r\n public setNumWrap(numWrap: number): void { this._numWrap = numWrap; }\r\n\r\n /** Return the index (in the client polyface) of the current facet */\r\n public currentReadIndex(): number { return this._currentFacetIndex; }\r\n /** Return the point index of vertex i within the currently loaded facet */\r\n public clientPointIndex(i: number): number { return this.pointIndex[i]; }\r\n /** Return the param index of vertex i within the currently loaded facet.\r\n * Use the artificial paramIndex, which matches pointIndex.\r\n */\r\n public clientParamIndex(i: number): number { return this.paramIndex ? this.paramIndex[i] : -1; }\r\n /** Return the normal index of vertex i within the currently loaded facet.\r\n * Use the artificial paramIndex, which matches pointIndex.\r\n */\r\n public clientNormalIndex(i: number): number { return this.normalIndex ? this.normalIndex[i] : -1; }\r\n /** Return the color index of vertex i within the currently loaded facet */\r\n public clientColorIndex(_i: number): number { return 1; }\r\n /** Return the aux data index of vertex i within the currently loaded facet */\r\n public clientAuxIndex(_i: number): number { return -1; }\r\n\r\n /** return the client polyface */\r\n public clientPolyface(): Polyface { return (undefined as unknown) as Polyface; }\r\n /** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */\r\n public clearArrays(): void {\r\n if (this.point !== undefined)\r\n this.point.length = 0;\r\n if (this.param !== undefined)\r\n this.param.length = 0;\r\n if (this.normal !== undefined)\r\n this.normal.length = 0;\r\n // ignore color and aux -- they never exist.\r\n }\r\n /** transfer interpolated data from the other visitor.\r\n * * all data values are interpolated at `fraction` between `other` values at index0 and index1.\r\n */\r\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\r\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\r\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\r\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\r\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\r\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\r\n }\r\n /** transfer data from a specified index of the other visitor as new data in this visitor. */\r\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\r\n this.point.pushFromGrowableXYZArray(other.point, index);\r\n if (this.color && other.color && index < other.color.length)\r\n this.color.push(other.color[index]);\r\n if (this.param && other.param && index < other.param.length)\r\n this.param.pushFromGrowableXYArray(other.param, index);\r\n if (this.normal && other.normal && index < other.normal.length)\r\n this.normal.pushFromGrowableXYZArray(other.normal, index);\r\n }\r\n\r\n}\r\n"]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Elements
|
|
3
|
+
*/
|
|
4
|
+
import { Id64String } from "@itwin/core-bentley";
|
|
5
|
+
import { Point3d } from "@itwin/core-geometry";
|
|
6
|
+
import { Code, ExternalSourceAttachmentProps, ExternalSourceAttachmentRole, ExternalSourceProps, SynchronizationConfigLinkProps } from "@itwin/core-common";
|
|
7
|
+
import { InformationReferenceElement, UrlLink } from "./Element";
|
|
8
|
+
import { IModelDb } from "./IModelDb";
|
|
9
|
+
import { ExternalSourceAttachmentAttachesSource, ExternalSourceIsInRepository } from "./NavigationRelationship";
|
|
10
|
+
/** An ExternalSource refers to an 'information container' found in a repository. In some cases, the container is the entire repository.
|
|
11
|
+
* @note The associated ECClass was added to the BisCore schema in version 1.0.13
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
export declare class ExternalSource extends InformationReferenceElement {
|
|
15
|
+
/** The repository that contains this ExternalSource. */
|
|
16
|
+
repository?: ExternalSourceIsInRepository;
|
|
17
|
+
/** The name of the iModel Connecter that processed this ExternalSource. */
|
|
18
|
+
connectorName?: string;
|
|
19
|
+
/** The version of the iModel Connecter that processed this ExternalSource. */
|
|
20
|
+
connectorVersion?: string;
|
|
21
|
+
/** @internal */
|
|
22
|
+
static get className(): string;
|
|
23
|
+
/** @internal */
|
|
24
|
+
constructor(props: ExternalSourceProps, iModel: IModelDb);
|
|
25
|
+
/** @internal */
|
|
26
|
+
toJSON(): ExternalSourceProps;
|
|
27
|
+
/** The [[CodeSpec]] for ExternalSource elements is not automatically created, so this method ensures that it exists. */
|
|
28
|
+
static ensureCodeSpec(iModelDb: IModelDb): Id64String;
|
|
29
|
+
/** Create a Code for an ExternalSource element given a name that is meant to be unique within the scope of the iModel.
|
|
30
|
+
* @param iModelDb The IModelDb
|
|
31
|
+
* @param codeValue The ExternalSource name
|
|
32
|
+
* @see [[ensureCodeSpec]]
|
|
33
|
+
*/
|
|
34
|
+
static createCode(iModelDb: IModelDb, codeValue: string): Code;
|
|
35
|
+
}
|
|
36
|
+
/** Attachment of an ExternalSource
|
|
37
|
+
* @note The associated ECClass was added to the BisCore schema in version 1.0.13
|
|
38
|
+
* @beta
|
|
39
|
+
*/
|
|
40
|
+
export declare class ExternalSourceAttachment extends InformationReferenceElement {
|
|
41
|
+
/** The [[ExternalSource]] that is attached by this ExternalSourceAttachment. */
|
|
42
|
+
attaches?: ExternalSourceAttachmentAttachesSource;
|
|
43
|
+
/** Specifies whether the attached [[ExternalSource]] provides context or models a part of the whole. */
|
|
44
|
+
role?: ExternalSourceAttachmentRole;
|
|
45
|
+
/** The translation or offset in global coordinates of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */
|
|
46
|
+
translation?: Point3d;
|
|
47
|
+
/** The Yaw angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */
|
|
48
|
+
yaw?: number;
|
|
49
|
+
/** The Pitch angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */
|
|
50
|
+
pitch?: number;
|
|
51
|
+
/** The Roll angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */
|
|
52
|
+
roll?: number;
|
|
53
|
+
/** The scale of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */
|
|
54
|
+
scale?: Point3d;
|
|
55
|
+
/** @internal */
|
|
56
|
+
static get className(): string;
|
|
57
|
+
/** @internal */
|
|
58
|
+
constructor(props: ExternalSourceAttachmentProps, iModel: IModelDb);
|
|
59
|
+
/** @internal */
|
|
60
|
+
toJSON(): ExternalSourceAttachmentProps;
|
|
61
|
+
/** The [[CodeSpec]] for ExternalSourceAttachment elements is not automatically created, so this method ensures that it exists. */
|
|
62
|
+
static ensureCodeSpec(iModelDb: IModelDb): Id64String;
|
|
63
|
+
/** Create a Code for an ExternalSourceAttachment element given a name that is meant to be unique within the scope of its parent [[ExternalSource]].
|
|
64
|
+
* @param iModelDb The IModelDb
|
|
65
|
+
* @param scopeElementId The parent ExternalSource
|
|
66
|
+
* @param codeValue The ExternalSourceAttachment name
|
|
67
|
+
* @see [[ensureCodeSpec]]
|
|
68
|
+
*/
|
|
69
|
+
static createCode(iModelDb: IModelDb, scopeElementId: Id64String, codeValue: string): Code;
|
|
70
|
+
}
|
|
71
|
+
/** A group of ExternalSources that are collectively a source of information for one or more elements.
|
|
72
|
+
* @note The associated ECClass was added to the BisCore schema in version 1.0.13
|
|
73
|
+
* @beta
|
|
74
|
+
*/
|
|
75
|
+
export declare class ExternalSourceGroup extends ExternalSource {
|
|
76
|
+
/** @internal */
|
|
77
|
+
static get className(): string;
|
|
78
|
+
/** @internal */
|
|
79
|
+
constructor(props: ExternalSourceProps, iModel: IModelDb);
|
|
80
|
+
}
|
|
81
|
+
/** Link to the Configuration for an iModel Synchronization Job
|
|
82
|
+
* @note The associated ECClass was added to the BisCore schema in version 1.0.13
|
|
83
|
+
* @beta
|
|
84
|
+
*/
|
|
85
|
+
export declare class SynchronizationConfigLink extends UrlLink {
|
|
86
|
+
/** Date/Time of last successful run of this synchronization configuration */
|
|
87
|
+
lastSuccessfulRun?: string;
|
|
88
|
+
/** @internal */
|
|
89
|
+
static get className(): string;
|
|
90
|
+
/** @internal */
|
|
91
|
+
constructor(props: SynchronizationConfigLinkProps, iModel: IModelDb);
|
|
92
|
+
/** @internal */
|
|
93
|
+
toJSON(): SynchronizationConfigLinkProps;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=ExternalSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalSource.d.ts","sourceRoot":"","sources":["../../src/ExternalSource.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EACQ,IAAI,EAAiB,6BAA6B,EAAE,4BAA4B,EAAE,mBAAmB,EAClH,8BAA8B,EAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,sCAAsC,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAEhH;;;GAGG;AACH,qBAAa,cAAe,SAAQ,2BAA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M,GAAG,IAAI;CAIlG;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,CAAkC;IAChF,gBAAgB;gBACG,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ;CAGhE;AAED;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,OAAO;IACpD,6EAA6E;IACtE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,CAAwC;IACtF,gBAAgB;gBACG,KAAK,EAAE,8BAA8B,EAAE,MAAM,EAAE,QAAQ;IAG1E,gBAAgB;IACA,MAAM,IAAI,8BAA8B;CAGzD"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Elements
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SynchronizationConfigLink = exports.ExternalSourceGroup = exports.ExternalSourceAttachment = exports.ExternalSource = void 0;
|
|
11
|
+
const core_geometry_1 = require("@itwin/core-geometry");
|
|
12
|
+
const core_common_1 = require("@itwin/core-common");
|
|
13
|
+
const Element_1 = require("./Element");
|
|
14
|
+
const NavigationRelationship_1 = require("./NavigationRelationship");
|
|
15
|
+
/** An ExternalSource refers to an 'information container' found in a repository. In some cases, the container is the entire repository.
|
|
16
|
+
* @note The associated ECClass was added to the BisCore schema in version 1.0.13
|
|
17
|
+
* @beta
|
|
18
|
+
*/
|
|
19
|
+
class ExternalSource extends Element_1.InformationReferenceElement {
|
|
20
|
+
/** @internal */
|
|
21
|
+
constructor(props, iModel) {
|
|
22
|
+
super(props, iModel);
|
|
23
|
+
if (props.repository)
|
|
24
|
+
this.repository = new NavigationRelationship_1.ExternalSourceIsInRepository(core_common_1.RelatedElement.idFromJson(props.repository));
|
|
25
|
+
}
|
|
26
|
+
/** @internal */
|
|
27
|
+
static get className() { return "ExternalSource"; }
|
|
28
|
+
/** @internal */
|
|
29
|
+
toJSON() {
|
|
30
|
+
return super.toJSON(); // Entity.toJSON takes care of auto-handled properties
|
|
31
|
+
}
|
|
32
|
+
/** The [[CodeSpec]] for ExternalSource elements is not automatically created, so this method ensures that it exists. */
|
|
33
|
+
static ensureCodeSpec(iModelDb) {
|
|
34
|
+
try {
|
|
35
|
+
const codeSpec = iModelDb.codeSpecs.getByName(core_common_1.BisCodeSpec.externalSource);
|
|
36
|
+
return codeSpec.id;
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
return iModelDb.codeSpecs.insert(core_common_1.BisCodeSpec.externalSource, core_common_1.CodeScopeSpec.Type.Repository);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** Create a Code for an ExternalSource element given a name that is meant to be unique within the scope of the iModel.
|
|
43
|
+
* @param iModelDb The IModelDb
|
|
44
|
+
* @param codeValue The ExternalSource name
|
|
45
|
+
* @see [[ensureCodeSpec]]
|
|
46
|
+
*/
|
|
47
|
+
static createCode(iModelDb, codeValue) {
|
|
48
|
+
const codeSpec = iModelDb.codeSpecs.getByName(core_common_1.BisCodeSpec.externalSource);
|
|
49
|
+
return new core_common_1.Code({ spec: codeSpec.id, scope: core_common_1.IModel.rootSubjectId, value: codeValue });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.ExternalSource = ExternalSource;
|
|
53
|
+
/** Attachment of an ExternalSource
|
|
54
|
+
* @note The associated ECClass was added to the BisCore schema in version 1.0.13
|
|
55
|
+
* @beta
|
|
56
|
+
*/
|
|
57
|
+
class ExternalSourceAttachment extends Element_1.InformationReferenceElement {
|
|
58
|
+
/** @internal */
|
|
59
|
+
constructor(props, iModel) {
|
|
60
|
+
super(props, iModel);
|
|
61
|
+
if (props.attaches)
|
|
62
|
+
this.attaches = new NavigationRelationship_1.ExternalSourceAttachmentAttachesSource(core_common_1.RelatedElement.idFromJson(props.attaches));
|
|
63
|
+
if (props.translation)
|
|
64
|
+
this.translation = core_geometry_1.Point3d.fromJSON(props.translation);
|
|
65
|
+
if (props.scale)
|
|
66
|
+
this.scale = core_geometry_1.Point3d.fromJSON(props.scale);
|
|
67
|
+
}
|
|
68
|
+
/** @internal */
|
|
69
|
+
static get className() { return "ExternalSourceAttachment"; }
|
|
70
|
+
/** @internal */
|
|
71
|
+
toJSON() {
|
|
72
|
+
return super.toJSON(); // Entity.toJSON takes care of auto-handled properties
|
|
73
|
+
}
|
|
74
|
+
/** The [[CodeSpec]] for ExternalSourceAttachment elements is not automatically created, so this method ensures that it exists. */
|
|
75
|
+
static ensureCodeSpec(iModelDb) {
|
|
76
|
+
try {
|
|
77
|
+
const codeSpec = iModelDb.codeSpecs.getByName(core_common_1.BisCodeSpec.externalSourceAttachment);
|
|
78
|
+
return codeSpec.id;
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
return iModelDb.codeSpecs.insert(core_common_1.BisCodeSpec.externalSourceAttachment, core_common_1.CodeScopeSpec.Type.ParentElement);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** Create a Code for an ExternalSourceAttachment element given a name that is meant to be unique within the scope of its parent [[ExternalSource]].
|
|
85
|
+
* @param iModelDb The IModelDb
|
|
86
|
+
* @param scopeElementId The parent ExternalSource
|
|
87
|
+
* @param codeValue The ExternalSourceAttachment name
|
|
88
|
+
* @see [[ensureCodeSpec]]
|
|
89
|
+
*/
|
|
90
|
+
static createCode(iModelDb, scopeElementId, codeValue) {
|
|
91
|
+
const codeSpec = iModelDb.codeSpecs.getByName(core_common_1.BisCodeSpec.externalSourceAttachment);
|
|
92
|
+
return new core_common_1.Code({ spec: codeSpec.id, scope: scopeElementId, value: codeValue });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.ExternalSourceAttachment = ExternalSourceAttachment;
|
|
96
|
+
/** A group of ExternalSources that are collectively a source of information for one or more elements.
|
|
97
|
+
* @note The associated ECClass was added to the BisCore schema in version 1.0.13
|
|
98
|
+
* @beta
|
|
99
|
+
*/
|
|
100
|
+
class ExternalSourceGroup extends ExternalSource {
|
|
101
|
+
/** @internal */
|
|
102
|
+
static get className() { return "ExternalSourceGroup"; }
|
|
103
|
+
/** @internal */
|
|
104
|
+
constructor(props, iModel) {
|
|
105
|
+
super(props, iModel);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.ExternalSourceGroup = ExternalSourceGroup;
|
|
109
|
+
/** Link to the Configuration for an iModel Synchronization Job
|
|
110
|
+
* @note The associated ECClass was added to the BisCore schema in version 1.0.13
|
|
111
|
+
* @beta
|
|
112
|
+
*/
|
|
113
|
+
class SynchronizationConfigLink extends Element_1.UrlLink {
|
|
114
|
+
/** @internal */
|
|
115
|
+
constructor(props, iModel) {
|
|
116
|
+
super(props, iModel);
|
|
117
|
+
}
|
|
118
|
+
/** @internal */
|
|
119
|
+
static get className() { return "SynchronizationConfigLink"; }
|
|
120
|
+
/** @internal */
|
|
121
|
+
toJSON() {
|
|
122
|
+
return super.toJSON(); // Entity.toJSON takes care of auto-handled properties
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.SynchronizationConfigLink = SynchronizationConfigLink;
|
|
126
|
+
//# sourceMappingURL=ExternalSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalSource.js","sourceRoot":"","sources":["../../src/ExternalSource.ts"],"names":[],"mappings":";AACA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA+C;AAC/C,oDAG4B;AAC5B,uCAAiE;AAEjE,qEAAgH;AAEhH;;;GAGG;AACH,MAAa,cAAe,SAAQ,qCAA2B;IAS7D,gBAAgB;IA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E,SAAS,EAAE,CAAC,CAAC;IAClF,CAAC;CACF;AA/CD,4DA+CC;AAED;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,cAAc;IACrD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,qBAAqB,CAAC,CAAC,CAAC;IAChF,gBAAgB;IAChB,YAAmB,KAA0B,EAAE,MAAgB;QAC7D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAPD,kDAOC;AAED;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,iBAAO;IAKpD,gBAAgB;IAChB,YAAmB,KAAqC,EAAE,MAAgB;QACxE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;IALD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,2BAA2B,CAAC,CAAC,CAAC;IAKtF,gBAAgB;IACA,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAoC,CAAC,CAAC,sDAAsD;IACjH,CAAC;CACF;AAbD,8DAaC","sourcesContent":["\r\n/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Elements\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\nimport {\r\n BisCodeSpec, Code, CodeScopeSpec, ExternalSourceAttachmentProps, ExternalSourceAttachmentRole, ExternalSourceProps, IModel, RelatedElement,\r\n SynchronizationConfigLinkProps,\r\n} from \"@itwin/core-common\";\r\nimport { InformationReferenceElement, UrlLink } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { ExternalSourceAttachmentAttachesSource, ExternalSourceIsInRepository } from \"./NavigationRelationship\";\r\n\r\n/** An ExternalSource refers to an 'information container' found in a repository. In some cases, the container is the entire repository.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSource extends InformationReferenceElement {\r\n /** The repository that contains this ExternalSource. */\r\n public repository?: ExternalSourceIsInRepository;\r\n /** The name of the iModel Connecter that processed this ExternalSource. */\r\n public connectorName?: string;\r\n /** The version of the iModel Connecter that processed this ExternalSource. */\r\n public connectorVersion?: string;\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSource\"; }\r\n /** @internal */\r\n public constructor(props: ExternalSourceProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.repository) this.repository = new ExternalSourceIsInRepository(RelatedElement.idFromJson(props.repository));\r\n }\r\n /** @internal */\r\n public override toJSON(): ExternalSourceProps { // This override only specializes the return type\r\n return super.toJSON() as ExternalSourceProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n /** The [[CodeSpec]] for ExternalSource elements is not automatically created, so this method ensures that it exists. */\r\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String {\r\n try {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\r\n return codeSpec.id;\r\n } catch (e) {\r\n return iModelDb.codeSpecs.insert(BisCodeSpec.externalSource, CodeScopeSpec.Type.Repository);\r\n }\r\n }\r\n /** Create a Code for an ExternalSource element given a name that is meant to be unique within the scope of the iModel.\r\n * @param iModelDb The IModelDb\r\n * @param codeValue The ExternalSource name\r\n * @see [[ensureCodeSpec]]\r\n */\r\n public static createCode(iModelDb: IModelDb, codeValue: string): Code {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\r\n return new Code({ spec: codeSpec.id, scope: IModel.rootSubjectId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Attachment of an ExternalSource\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceAttachment extends InformationReferenceElement {\r\n /** The [[ExternalSource]] that is attached by this ExternalSourceAttachment. */\r\n public attaches?: ExternalSourceAttachmentAttachesSource;\r\n /** Specifies whether the attached [[ExternalSource]] provides context or models a part of the whole. */\r\n public role?: ExternalSourceAttachmentRole;\r\n /** The translation or offset in global coordinates of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public translation?: Point3d;\r\n /** The Yaw angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public yaw?: number;\r\n /** The Pitch angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public pitch?: number;\r\n /** The Roll angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public roll?: number;\r\n /** The scale of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public scale?: Point3d;\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceAttachment\"; }\r\n /** @internal */\r\n public constructor(props: ExternalSourceAttachmentProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.attaches) this.attaches = new ExternalSourceAttachmentAttachesSource(RelatedElement.idFromJson(props.attaches));\r\n if (props.translation) this.translation = Point3d.fromJSON(props.translation);\r\n if (props.scale) this.scale = Point3d.fromJSON(props.scale);\r\n }\r\n /** @internal */\r\n public override toJSON(): ExternalSourceAttachmentProps { // This override only specializes the return type\r\n return super.toJSON() as ExternalSourceAttachmentProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n /** The [[CodeSpec]] for ExternalSourceAttachment elements is not automatically created, so this method ensures that it exists. */\r\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String {\r\n try {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\r\n return codeSpec.id;\r\n } catch (e) {\r\n return iModelDb.codeSpecs.insert(BisCodeSpec.externalSourceAttachment, CodeScopeSpec.Type.ParentElement);\r\n }\r\n }\r\n /** Create a Code for an ExternalSourceAttachment element given a name that is meant to be unique within the scope of its parent [[ExternalSource]].\r\n * @param iModelDb The IModelDb\r\n * @param scopeElementId The parent ExternalSource\r\n * @param codeValue The ExternalSourceAttachment name\r\n * @see [[ensureCodeSpec]]\r\n */\r\n public static createCode(iModelDb: IModelDb, scopeElementId: Id64String, codeValue: string): Code {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\r\n return new Code({ spec: codeSpec.id, scope: scopeElementId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A group of ExternalSources that are collectively a source of information for one or more elements.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceGroup extends ExternalSource {\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceGroup\"; }\r\n /** @internal */\r\n public constructor(props: ExternalSourceProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** Link to the Configuration for an iModel Synchronization Job\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class SynchronizationConfigLink extends UrlLink {\r\n /** Date/Time of last successful run of this synchronization configuration */\r\n public lastSuccessfulRun?: string;\r\n /** @internal */\r\n public static override get className(): string { return \"SynchronizationConfigLink\"; }\r\n /** @internal */\r\n public constructor(props: SynchronizationConfigLinkProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n /** @internal */\r\n public override toJSON(): SynchronizationConfigLinkProps { // This override only specializes the return type\r\n return super.toJSON() as SynchronizationConfigLinkProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n}\r\n\r\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GeometrySummaryRequestProps } from "@itwin/core-common";
|
|
2
|
+
import { IModelDb } from "./IModelDb";
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare function generateGeometrySummaries(request: GeometrySummaryRequestProps, iModel: IModelDb): string;
|
|
5
|
+
//# sourceMappingURL=GeometrySummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeometrySummary.d.ts","sourceRoot":"","sources":["../../src/GeometrySummary.ts"],"names":[],"mappings":"AAYA,OAAO,EACwE,2BAA2B,EAEzG,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAqZtC,gBAAgB;AAChB,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,2BAA2B,EAAE,MAAM,EAAE,QAAQ,GAAG,MAAM,CAGxG"}
|