@itwin/core-common 4.0.0-dev.46 → 4.0.0-dev.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/FeatureTable.d.ts +117 -10
- package/lib/cjs/FeatureTable.d.ts.map +1 -1
- package/lib/cjs/FeatureTable.js +216 -24
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.d.ts +4 -2
- package/lib/cjs/tile/IModelTileIO.d.ts.map +1 -1
- package/lib/cjs/tile/IModelTileIO.js +4 -2
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/FeatureTable.d.ts +117 -10
- package/lib/esm/FeatureTable.d.ts.map +1 -1
- package/lib/esm/FeatureTable.js +213 -23
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.d.ts +4 -2
- package/lib/esm/tile/IModelTileIO.d.ts.map +1 -1
- package/lib/esm/tile/IModelTileIO.js +4 -2
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/package.json +6 -6
|
@@ -13,8 +13,8 @@ import { GeometryClass } from "./GeometryParams";
|
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
15
|
export declare class Feature {
|
|
16
|
-
readonly elementId:
|
|
17
|
-
readonly subCategoryId:
|
|
16
|
+
readonly elementId: Id64String;
|
|
17
|
+
readonly subCategoryId: Id64String;
|
|
18
18
|
readonly geometryClass: GeometryClass;
|
|
19
19
|
constructor(elementId?: Id64String, subCategoryId?: Id64String, geometryClass?: GeometryClass);
|
|
20
20
|
get isDefined(): boolean;
|
|
@@ -27,13 +27,41 @@ export declare class Feature {
|
|
|
27
27
|
*/
|
|
28
28
|
compare(rhs: Feature): number;
|
|
29
29
|
}
|
|
30
|
+
/** A [[Feature]] with a modelId identifying the model containing the feature.
|
|
31
|
+
* Typically produced from a PackedFeature.
|
|
32
|
+
* Prior to the introduction of MultiModelPackedFeatureTable, every (Packed)FeatureTable was associated with exactly one model.
|
|
33
|
+
* Now, each feature in a table may be associated with a different model.
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export interface ModelFeature {
|
|
37
|
+
modelId: Id64String;
|
|
38
|
+
elementId: Id64String;
|
|
39
|
+
subCategoryId: Id64String;
|
|
40
|
+
geometryClass: GeometryClass;
|
|
41
|
+
}
|
|
42
|
+
/** @internal */
|
|
43
|
+
export declare namespace ModelFeature {
|
|
44
|
+
function create(): ModelFeature;
|
|
45
|
+
function isDefined(feature: ModelFeature): boolean;
|
|
46
|
+
function unpack(packed: PackedFeature, result: ModelFeature, unpackedModelId?: Id64String): ModelFeature;
|
|
47
|
+
}
|
|
30
48
|
/** @internal */
|
|
31
49
|
export interface PackedFeature {
|
|
50
|
+
modelId: Id64.Uint32Pair;
|
|
32
51
|
elementId: Id64.Uint32Pair;
|
|
33
52
|
subCategoryId: Id64.Uint32Pair;
|
|
34
53
|
geometryClass: GeometryClass;
|
|
35
54
|
animationNodeId: number;
|
|
36
55
|
}
|
|
56
|
+
/** @internal */
|
|
57
|
+
export interface PackedFeatureWithIndex extends PackedFeature {
|
|
58
|
+
index: number;
|
|
59
|
+
}
|
|
60
|
+
/** @internal */
|
|
61
|
+
export declare namespace PackedFeature {
|
|
62
|
+
function create(): PackedFeature;
|
|
63
|
+
function createWithIndex(): PackedFeatureWithIndex;
|
|
64
|
+
}
|
|
37
65
|
/** Describes the type of a 'batch' of graphics representing multiple [[Feature]]s.
|
|
38
66
|
* The most commonly-encountered batches are Tiles, which can be of either Primary or
|
|
39
67
|
* Classifier type.
|
|
@@ -90,15 +118,44 @@ export declare class FeatureTable extends IndexMap<Feature> {
|
|
|
90
118
|
}
|
|
91
119
|
/** @alpha */
|
|
92
120
|
export declare type ComputeNodeId = (elementId: Id64.Uint32Pair, featureIndex: number) => number;
|
|
121
|
+
/** Interface common to PackedFeatureTable and MultiModelPackedFeatureTable.
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
export interface RenderFeatureTable {
|
|
125
|
+
/** The "model Id" of the tile tree containing the tile from which this feature table originated.
|
|
126
|
+
* It may be a transient Id if, for example, the tile tree represents a reality model or represents the geometry of multiple
|
|
127
|
+
* persistent models batched together.
|
|
128
|
+
*/
|
|
129
|
+
readonly batchModelId: Id64String;
|
|
130
|
+
/** Split representation of batchModelId, so we're not constantly having to parse the string. */
|
|
131
|
+
readonly batchModelIdPair: Id64.Uint32Pair;
|
|
132
|
+
/** The number of features in the table; equivalently, one more than the largest feature index. */
|
|
133
|
+
readonly numFeatures: number;
|
|
134
|
+
/** Strictly for reporting memory usage. */
|
|
135
|
+
readonly byteLength: number;
|
|
136
|
+
readonly type: BatchType;
|
|
137
|
+
/** Get the feature at the specified index. Caller is responsible for validating featureIndex less than numFeatures. */
|
|
138
|
+
getFeature(featureIndex: number, result: ModelFeature): ModelFeature;
|
|
139
|
+
/** Find the specified feature. Returns undefined if featureIndex >= numFeatures. */
|
|
140
|
+
findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined;
|
|
141
|
+
/** Find the Id of the element of the specified feature. */
|
|
142
|
+
findElementId(featureIndex: number): Id64String | undefined;
|
|
143
|
+
/** Get the Id of the element of the specified feature as a pair of 32-bit integers, asserting that feature index < numFeatures. */
|
|
144
|
+
getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair;
|
|
145
|
+
/** Get the feature at the specified index. Caller is responsible for validating featureIndex less than numFeatures. */
|
|
146
|
+
getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature;
|
|
147
|
+
/** Get an object that provides iteration over all features, in order. `output` is reused as the current value on each iteration. */
|
|
148
|
+
iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex>;
|
|
149
|
+
}
|
|
93
150
|
/**
|
|
94
151
|
* An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values,
|
|
95
152
|
* wherein each feature occupies 3 32-bit integers.
|
|
96
153
|
* @internal
|
|
97
154
|
*/
|
|
98
|
-
export declare class PackedFeatureTable {
|
|
155
|
+
export declare class PackedFeatureTable implements RenderFeatureTable {
|
|
99
156
|
private readonly _data;
|
|
100
|
-
readonly
|
|
101
|
-
readonly
|
|
157
|
+
readonly batchModelId: Id64String;
|
|
158
|
+
readonly batchModelIdPair: Id64.Uint32Pair;
|
|
102
159
|
readonly numFeatures: number;
|
|
103
160
|
readonly anyDefined: boolean;
|
|
104
161
|
readonly type: BatchType;
|
|
@@ -109,13 +166,13 @@ export declare class PackedFeatureTable {
|
|
|
109
166
|
* This is used internally when deserializing Tiles in iMdl format.
|
|
110
167
|
* @internal
|
|
111
168
|
*/
|
|
112
|
-
constructor(data: Uint32Array, modelId: Id64String, numFeatures: number,
|
|
169
|
+
constructor(data: Uint32Array, modelId: Id64String, numFeatures: number, type: BatchType, animationNodeIds?: Uint8Array | Uint16Array | Uint32Array);
|
|
113
170
|
/** Create a packed feature table from a [[FeatureTable]]. */
|
|
114
171
|
static pack(featureTable: FeatureTable): PackedFeatureTable;
|
|
115
172
|
/** Retrieve the Feature associated with the specified index. */
|
|
116
|
-
getFeature(featureIndex: number):
|
|
173
|
+
getFeature(featureIndex: number, result: ModelFeature): ModelFeature;
|
|
117
174
|
/** Returns the Feature associated with the specified index, or undefined if the index is out of range. */
|
|
118
|
-
findFeature(featureIndex: number):
|
|
175
|
+
findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined;
|
|
119
176
|
/** @internal */
|
|
120
177
|
getElementIdPair(featureIndex: number, out?: Id64.Uint32Pair): Id64.Uint32Pair;
|
|
121
178
|
/** @internal */
|
|
@@ -123,20 +180,70 @@ export declare class PackedFeatureTable {
|
|
|
123
180
|
/** @internal */
|
|
124
181
|
getAnimationNodeId(featureIndex: number): number;
|
|
125
182
|
/** @internal */
|
|
126
|
-
getPackedFeature(featureIndex: number): PackedFeature;
|
|
183
|
+
getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature;
|
|
127
184
|
/** Returns the element ID of the Feature associated with the specified index, or undefined if the index is out of range. */
|
|
128
185
|
findElementId(featureIndex: number): Id64String | undefined;
|
|
129
186
|
/** Return true if this table contains exactly 1 feature. */
|
|
130
187
|
get isUniform(): boolean;
|
|
131
188
|
/** If this table contains exactly 1 feature, return it. */
|
|
132
|
-
|
|
189
|
+
getUniform(result: ModelFeature): ModelFeature | undefined;
|
|
133
190
|
get isVolumeClassifier(): boolean;
|
|
134
191
|
get isPlanarClassifier(): boolean;
|
|
135
192
|
get isClassifier(): boolean;
|
|
136
193
|
/** Unpack the features into a [[FeatureTable]]. */
|
|
137
194
|
unpack(): FeatureTable;
|
|
138
195
|
populateAnimationNodeIds(computeNodeId: ComputeNodeId, maxNodeId: number): void;
|
|
196
|
+
iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex>;
|
|
197
|
+
iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex>;
|
|
139
198
|
private get _subCategoriesOffset();
|
|
140
199
|
private readId;
|
|
141
200
|
}
|
|
201
|
+
interface PackedFeatureModelEntry {
|
|
202
|
+
lastFeatureIndex: number;
|
|
203
|
+
idLower: number;
|
|
204
|
+
idUpper: number;
|
|
205
|
+
}
|
|
206
|
+
/** A table of model Ids associated with a [[MultiModelPackedFeatureTable]].
|
|
207
|
+
* The feature indices in the packed feature table are grouped together by model, such that the first N features belong to model 1, the next M features to model 2, and so on.
|
|
208
|
+
* The model table itself consists of one entry per model, where each entry looks like:
|
|
209
|
+
* indexOfLastFeatureInModel: u32
|
|
210
|
+
* modelId: u64
|
|
211
|
+
* The modelId associated with a feature can therefore be derived by finding the entry in the model table with the highest indexOfLastFeatureInModel no greater than the feature index.
|
|
212
|
+
* This lookup can be optimized using binary search.
|
|
213
|
+
* Moreover, while iterating the feature table in sequence, the model table can be iterated in parallel so that no per-feature lookup of model Id is required.
|
|
214
|
+
* @internal
|
|
215
|
+
*/
|
|
216
|
+
export declare class PackedFeatureModelTable {
|
|
217
|
+
private readonly _data;
|
|
218
|
+
constructor(data: Uint32Array);
|
|
219
|
+
/** The number of models in the table. */
|
|
220
|
+
get length(): number;
|
|
221
|
+
get byteLength(): number;
|
|
222
|
+
private getLastFeatureIndex;
|
|
223
|
+
getEntry(modelIndex: number, result: PackedFeatureModelEntry): PackedFeatureModelEntry;
|
|
224
|
+
/** Get the Id of the model associated with the specified feature, or an invalid Id if the feature is not associated with any model. */
|
|
225
|
+
getModelIdPair(featureIndex: number, result?: Id64.Uint32Pair): Id64.Uint32Pair;
|
|
226
|
+
}
|
|
227
|
+
/** A PackedFeatureTable with a PackedFeatureModelTable appended to it, capable of storing features belonging to more than one model.
|
|
228
|
+
* @internal
|
|
229
|
+
*/
|
|
230
|
+
export declare class MultiModelPackedFeatureTable implements RenderFeatureTable {
|
|
231
|
+
private readonly _features;
|
|
232
|
+
private readonly _models;
|
|
233
|
+
constructor(features: PackedFeatureTable, models: PackedFeatureModelTable);
|
|
234
|
+
static create(data: Uint32Array, batchModelId: Id64String, numFeatures: number, type: BatchType, numSubCategories: number): MultiModelPackedFeatureTable;
|
|
235
|
+
get batchModelId(): string;
|
|
236
|
+
get batchModelIdPair(): Id64.Uint32Pair;
|
|
237
|
+
get numFeatures(): number;
|
|
238
|
+
get type(): BatchType;
|
|
239
|
+
get byteLength(): number;
|
|
240
|
+
getPackedFeature(featureIndex: number, result: PackedFeature): PackedFeature;
|
|
241
|
+
getFeature(featureIndex: number, result: ModelFeature): ModelFeature;
|
|
242
|
+
findFeature(featureIndex: number, result: ModelFeature): ModelFeature | undefined;
|
|
243
|
+
getElementIdPair(featureIndex: number, out: Id64.Uint32Pair): Id64.Uint32Pair;
|
|
244
|
+
findElementId(featureIndex: number): Id64String | undefined;
|
|
245
|
+
iterator(output: PackedFeatureWithIndex): Iterator<PackedFeatureWithIndex>;
|
|
246
|
+
iterable(output: PackedFeatureWithIndex): Iterable<PackedFeatureWithIndex>;
|
|
247
|
+
}
|
|
248
|
+
export {};
|
|
142
249
|
//# sourceMappingURL=FeatureTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureTable.d.ts","sourceRoot":"","sources":["../../src/FeatureTable.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA0C,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;;GAQG;AACH,qBAAa,OAAO;IAClB,SAAgB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"FeatureTable.d.ts","sourceRoot":"","sources":["../../src/FeatureTable.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA0C,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;;GAQG;AACH,qBAAa,OAAO;IAClB,SAAgB,SAAS,EAAE,UAAU,CAAC;IACtC,SAAgB,aAAa,EAAE,UAAU,CAAC;IAC1C,SAAgB,aAAa,EAAE,aAAa,CAAC;gBAE1B,SAAS,GAAE,UAAyB,EAAE,aAAa,GAAE,UAAyB,EAAE,aAAa,GAAE,aAAqC;IAMvJ,IAAW,SAAS,IAAI,OAAO,CAAmI;IAClK,IAAW,WAAW,IAAI,OAAO,CAA4B;IAE7D,0EAA0E;IACnE,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAEtC;;;OAGG;IACI,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;CAcrC;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,UAAU,CAAC;IACpB,SAAS,EAAE,UAAU,CAAC;IACtB,aAAa,EAAE,UAAU,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,gBAAgB;AAChB,yBAAiB,YAAY,CAAC;IAC5B,SAA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able.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module Rendering
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.PackedFeatureTable = exports.FeatureTable = exports.BatchType = exports.Feature = void 0;
|
|
10
|
+
exports.MultiModelPackedFeatureTable = exports.PackedFeatureModelTable = exports.PackedFeatureTable = exports.FeatureTable = exports.BatchType = exports.PackedFeature = exports.ModelFeature = exports.Feature = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const GeometryParams_1 = require("./GeometryParams");
|
|
13
13
|
/** Describes a discrete entity within a batched [RenderGraphic]($frontend) that can be
|
|
@@ -47,6 +47,52 @@ class Feature {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
exports.Feature = Feature;
|
|
50
|
+
/** @internal */
|
|
51
|
+
var ModelFeature;
|
|
52
|
+
(function (ModelFeature) {
|
|
53
|
+
function create() {
|
|
54
|
+
return {
|
|
55
|
+
modelId: core_bentley_1.Id64.invalid,
|
|
56
|
+
elementId: core_bentley_1.Id64.invalid,
|
|
57
|
+
subCategoryId: core_bentley_1.Id64.invalid,
|
|
58
|
+
geometryClass: GeometryParams_1.GeometryClass.Primary,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
ModelFeature.create = create;
|
|
62
|
+
function isDefined(feature) {
|
|
63
|
+
return !core_bentley_1.Id64.isInvalid(feature.modelId) || !core_bentley_1.Id64.isInvalid(feature.elementId) || !core_bentley_1.Id64.isInvalid(feature.subCategoryId) || feature.geometryClass !== GeometryParams_1.GeometryClass.Primary;
|
|
64
|
+
}
|
|
65
|
+
ModelFeature.isDefined = isDefined;
|
|
66
|
+
function unpack(packed, result, unpackedModelId) {
|
|
67
|
+
result.modelId = unpackedModelId ?? core_bentley_1.Id64.fromUint32PairObject(packed.modelId);
|
|
68
|
+
result.elementId = core_bentley_1.Id64.fromUint32PairObject(packed.elementId);
|
|
69
|
+
result.subCategoryId = core_bentley_1.Id64.fromUint32PairObject(packed.subCategoryId);
|
|
70
|
+
result.geometryClass = packed.geometryClass;
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
ModelFeature.unpack = unpack;
|
|
74
|
+
})(ModelFeature = exports.ModelFeature || (exports.ModelFeature = {}));
|
|
75
|
+
/** @internal */
|
|
76
|
+
var PackedFeature;
|
|
77
|
+
(function (PackedFeature) {
|
|
78
|
+
function create() {
|
|
79
|
+
const pair = { upper: 0, lower: 0 };
|
|
80
|
+
return {
|
|
81
|
+
modelId: { ...pair },
|
|
82
|
+
elementId: { ...pair },
|
|
83
|
+
subCategoryId: { ...pair },
|
|
84
|
+
geometryClass: GeometryParams_1.GeometryClass.Primary,
|
|
85
|
+
animationNodeId: 0,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
PackedFeature.create = create;
|
|
89
|
+
function createWithIndex() {
|
|
90
|
+
const result = create();
|
|
91
|
+
result.index = 0;
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
PackedFeature.createWithIndex = createWithIndex;
|
|
95
|
+
})(PackedFeature = exports.PackedFeature || (exports.PackedFeature = {}));
|
|
50
96
|
/** Describes the type of a 'batch' of graphics representing multiple [[Feature]]s.
|
|
51
97
|
* The most commonly-encountered batches are Tiles, which can be of either Primary or
|
|
52
98
|
* Classifier type.
|
|
@@ -116,6 +162,7 @@ class FeatureTable extends core_bentley_1.IndexMap {
|
|
|
116
162
|
getArray() { return this._array; }
|
|
117
163
|
}
|
|
118
164
|
exports.FeatureTable = FeatureTable;
|
|
165
|
+
const scratchPackedFeature = PackedFeature.create();
|
|
119
166
|
/**
|
|
120
167
|
* An immutable, packed representation of a [[FeatureTable]]. The features are packed into a single array of 32-bit integer values,
|
|
121
168
|
* wherein each feature occupies 3 32-bit integers.
|
|
@@ -126,10 +173,10 @@ class PackedFeatureTable {
|
|
|
126
173
|
* This is used internally when deserializing Tiles in iMdl format.
|
|
127
174
|
* @internal
|
|
128
175
|
*/
|
|
129
|
-
constructor(data, modelId, numFeatures,
|
|
176
|
+
constructor(data, modelId, numFeatures, type, animationNodeIds) {
|
|
130
177
|
this._data = data;
|
|
131
|
-
this.
|
|
132
|
-
this.
|
|
178
|
+
this.batchModelId = modelId;
|
|
179
|
+
this.batchModelIdPair = core_bentley_1.Id64.getUint32Pair(modelId);
|
|
133
180
|
this.numFeatures = numFeatures;
|
|
134
181
|
this.type = type;
|
|
135
182
|
this._animationNodeIds = animationNodeIds;
|
|
@@ -138,14 +185,13 @@ class PackedFeatureTable {
|
|
|
138
185
|
this.anyDefined = false;
|
|
139
186
|
break;
|
|
140
187
|
case 1:
|
|
141
|
-
this.anyDefined = this.getFeature(0)
|
|
188
|
+
this.anyDefined = ModelFeature.isDefined(this.getFeature(0, ModelFeature.create()));
|
|
142
189
|
break;
|
|
143
190
|
default:
|
|
144
191
|
this.anyDefined = true;
|
|
145
192
|
break;
|
|
146
193
|
}
|
|
147
194
|
(0, core_bentley_1.assert)(this._data.length >= this._subCategoriesOffset);
|
|
148
|
-
(0, core_bentley_1.assert)(this.maxFeatures >= this.numFeatures);
|
|
149
195
|
(0, core_bentley_1.assert)(undefined === this._animationNodeIds || this._animationNodeIds.length === this.numFeatures);
|
|
150
196
|
}
|
|
151
197
|
get byteLength() { return this._data.byteLength; }
|
|
@@ -181,18 +227,16 @@ class PackedFeatureTable {
|
|
|
181
227
|
uint32s[index32 + 0] = core_bentley_1.Id64.getLowerUint32(id);
|
|
182
228
|
uint32s[index32 + 1] = core_bentley_1.Id64.getUpperUint32(id);
|
|
183
229
|
});
|
|
184
|
-
return new PackedFeatureTable(uint32s, featureTable.modelId, featureTable.length, featureTable.
|
|
230
|
+
return new PackedFeatureTable(uint32s, featureTable.modelId, featureTable.length, featureTable.type);
|
|
185
231
|
}
|
|
186
232
|
/** Retrieve the Feature associated with the specified index. */
|
|
187
|
-
getFeature(featureIndex) {
|
|
188
|
-
const packed = this.getPackedFeature(featureIndex);
|
|
189
|
-
|
|
190
|
-
const subcatId = core_bentley_1.Id64.fromUint32Pair(packed.subCategoryId.lower, packed.subCategoryId.upper);
|
|
191
|
-
return new Feature(elemId, subcatId, packed.geometryClass);
|
|
233
|
+
getFeature(featureIndex, result) {
|
|
234
|
+
const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);
|
|
235
|
+
return ModelFeature.unpack(packed, result, this.batchModelId);
|
|
192
236
|
}
|
|
193
237
|
/** Returns the Feature associated with the specified index, or undefined if the index is out of range. */
|
|
194
|
-
findFeature(featureIndex) {
|
|
195
|
-
return featureIndex < this.numFeatures ? this.getFeature(featureIndex) : undefined;
|
|
238
|
+
findFeature(featureIndex, result) {
|
|
239
|
+
return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;
|
|
196
240
|
}
|
|
197
241
|
/** @internal */
|
|
198
242
|
getElementIdPair(featureIndex, out) {
|
|
@@ -216,17 +260,21 @@ class PackedFeatureTable {
|
|
|
216
260
|
return undefined !== this._animationNodeIds && featureIndex < this.numFeatures ? this._animationNodeIds[featureIndex] : 0;
|
|
217
261
|
}
|
|
218
262
|
/** @internal */
|
|
219
|
-
getPackedFeature(featureIndex) {
|
|
263
|
+
getPackedFeature(featureIndex, result) {
|
|
220
264
|
(0, core_bentley_1.assert)(featureIndex < this.numFeatures);
|
|
221
265
|
const index32 = 3 * featureIndex;
|
|
222
|
-
|
|
266
|
+
result.elementId.lower = this._data[index32];
|
|
267
|
+
result.elementId.upper = this._data[index32 + 1];
|
|
223
268
|
const subCatIndexAndClass = this._data[index32 + 2];
|
|
224
|
-
|
|
269
|
+
result.geometryClass = (subCatIndexAndClass >>> 24) & 0xff;
|
|
225
270
|
let subCatIndex = (subCatIndexAndClass & 0x00ffffff) >>> 0;
|
|
226
271
|
subCatIndex = subCatIndex * 2 + this._subCategoriesOffset;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
272
|
+
result.subCategoryId.lower = this._data[subCatIndex];
|
|
273
|
+
result.subCategoryId.upper = this._data[subCatIndex + 1];
|
|
274
|
+
result.animationNodeId = this.getAnimationNodeId(featureIndex);
|
|
275
|
+
result.modelId.lower = this.batchModelIdPair.lower;
|
|
276
|
+
result.modelId.upper = this.batchModelIdPair.upper;
|
|
277
|
+
return result;
|
|
230
278
|
}
|
|
231
279
|
/** Returns the element ID of the Feature associated with the specified index, or undefined if the index is out of range. */
|
|
232
280
|
findElementId(featureIndex) {
|
|
@@ -238,16 +286,19 @@ class PackedFeatureTable {
|
|
|
238
286
|
/** Return true if this table contains exactly 1 feature. */
|
|
239
287
|
get isUniform() { return 1 === this.numFeatures; }
|
|
240
288
|
/** If this table contains exactly 1 feature, return it. */
|
|
241
|
-
|
|
289
|
+
getUniform(result) {
|
|
290
|
+
return this.isUniform ? this.getFeature(0, result) : undefined;
|
|
291
|
+
}
|
|
242
292
|
get isVolumeClassifier() { return BatchType.VolumeClassifier === this.type; }
|
|
243
293
|
get isPlanarClassifier() { return BatchType.VolumeClassifier === this.type; }
|
|
244
294
|
get isClassifier() { return this.isVolumeClassifier || this.isPlanarClassifier; }
|
|
245
295
|
/** Unpack the features into a [[FeatureTable]]. */
|
|
246
296
|
unpack() {
|
|
247
|
-
const table = new FeatureTable(this.
|
|
297
|
+
const table = new FeatureTable(this.numFeatures, this.batchModelId);
|
|
298
|
+
const feature = ModelFeature.create();
|
|
248
299
|
for (let i = 0; i < this.numFeatures; i++) {
|
|
249
|
-
|
|
250
|
-
table.insertWithIndex(feature, i);
|
|
300
|
+
this.getFeature(i, feature);
|
|
301
|
+
table.insertWithIndex(new Feature(feature.elementId, feature.subCategoryId, feature.geometryClass), i);
|
|
251
302
|
}
|
|
252
303
|
return table;
|
|
253
304
|
}
|
|
@@ -270,10 +321,151 @@ class PackedFeatureTable {
|
|
|
270
321
|
if (haveNodes)
|
|
271
322
|
this._animationNodeIds = nodeIds;
|
|
272
323
|
}
|
|
324
|
+
*iterator(output) {
|
|
325
|
+
for (let i = 0; i < this.numFeatures; i++) {
|
|
326
|
+
this.getPackedFeature(i, output);
|
|
327
|
+
output.index = i;
|
|
328
|
+
yield output;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
iterable(output) {
|
|
332
|
+
return {
|
|
333
|
+
[Symbol.iterator]: () => this.iterator(output),
|
|
334
|
+
};
|
|
335
|
+
}
|
|
273
336
|
get _subCategoriesOffset() { return this.numFeatures * 3; }
|
|
274
337
|
readId(offset32) {
|
|
275
338
|
return core_bentley_1.Id64.fromUint32Pair(this._data[offset32], this._data[offset32 + 1]);
|
|
276
339
|
}
|
|
277
340
|
}
|
|
278
341
|
exports.PackedFeatureTable = PackedFeatureTable;
|
|
342
|
+
const scratchPackedFeatureModelEntry = { lastFeatureIndex: -1, idLower: -1, idUpper: -1 };
|
|
343
|
+
/** A table of model Ids associated with a [[MultiModelPackedFeatureTable]].
|
|
344
|
+
* The feature indices in the packed feature table are grouped together by model, such that the first N features belong to model 1, the next M features to model 2, and so on.
|
|
345
|
+
* The model table itself consists of one entry per model, where each entry looks like:
|
|
346
|
+
* indexOfLastFeatureInModel: u32
|
|
347
|
+
* modelId: u64
|
|
348
|
+
* The modelId associated with a feature can therefore be derived by finding the entry in the model table with the highest indexOfLastFeatureInModel no greater than the feature index.
|
|
349
|
+
* This lookup can be optimized using binary search.
|
|
350
|
+
* Moreover, while iterating the feature table in sequence, the model table can be iterated in parallel so that no per-feature lookup of model Id is required.
|
|
351
|
+
* @internal
|
|
352
|
+
*/
|
|
353
|
+
class PackedFeatureModelTable {
|
|
354
|
+
constructor(data) {
|
|
355
|
+
this._data = data;
|
|
356
|
+
(0, core_bentley_1.assert)(this._data.length % 3 === 0);
|
|
357
|
+
}
|
|
358
|
+
/** The number of models in the table. */
|
|
359
|
+
get length() {
|
|
360
|
+
return this._data.length / 3;
|
|
361
|
+
}
|
|
362
|
+
get byteLength() {
|
|
363
|
+
return this._data.byteLength;
|
|
364
|
+
}
|
|
365
|
+
getLastFeatureIndex(modelIndex) {
|
|
366
|
+
return this._data[modelIndex * 3];
|
|
367
|
+
}
|
|
368
|
+
getEntry(modelIndex, result) {
|
|
369
|
+
if (modelIndex >= this.length) {
|
|
370
|
+
result.idLower = result.idUpper = 0;
|
|
371
|
+
result.lastFeatureIndex = Number.MAX_SAFE_INTEGER;
|
|
372
|
+
return result;
|
|
373
|
+
}
|
|
374
|
+
const index = modelIndex * 3;
|
|
375
|
+
result.lastFeatureIndex = this._data[index + 0];
|
|
376
|
+
result.idLower = this._data[index + 1];
|
|
377
|
+
result.idUpper = this._data[index + 2];
|
|
378
|
+
return result;
|
|
379
|
+
}
|
|
380
|
+
/** Get the Id of the model associated with the specified feature, or an invalid Id if the feature is not associated with any model. */
|
|
381
|
+
getModelIdPair(featureIndex, result) {
|
|
382
|
+
if (!result)
|
|
383
|
+
result = { lower: 0, upper: 0 };
|
|
384
|
+
else
|
|
385
|
+
result.lower = result.upper = 0;
|
|
386
|
+
let first = 0;
|
|
387
|
+
const last = this.length;
|
|
388
|
+
let count = last;
|
|
389
|
+
while (count > 0) {
|
|
390
|
+
const step = Math.floor(count / 2);
|
|
391
|
+
const mid = first + step;
|
|
392
|
+
const lastFeatureIndex = this.getLastFeatureIndex(mid);
|
|
393
|
+
if (featureIndex > lastFeatureIndex) {
|
|
394
|
+
first = mid + 1;
|
|
395
|
+
count -= step + 1;
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
count = step;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
if (first < last) {
|
|
402
|
+
result.lower = this._data[first * 3 + 1];
|
|
403
|
+
result.upper = this._data[first * 3 + 2];
|
|
404
|
+
}
|
|
405
|
+
return result;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
exports.PackedFeatureModelTable = PackedFeatureModelTable;
|
|
409
|
+
/** A PackedFeatureTable with a PackedFeatureModelTable appended to it, capable of storing features belonging to more than one model.
|
|
410
|
+
* @internal
|
|
411
|
+
*/
|
|
412
|
+
class MultiModelPackedFeatureTable {
|
|
413
|
+
constructor(features, models) {
|
|
414
|
+
this._features = features;
|
|
415
|
+
this._models = models;
|
|
416
|
+
}
|
|
417
|
+
static create(data, batchModelId, numFeatures, type, numSubCategories) {
|
|
418
|
+
const modelTableOffset = 3 * numFeatures + 2 * numSubCategories;
|
|
419
|
+
const featureData = data.subarray(0, modelTableOffset);
|
|
420
|
+
const features = new PackedFeatureTable(featureData, batchModelId, numFeatures, type);
|
|
421
|
+
const modelData = data.subarray(modelTableOffset);
|
|
422
|
+
const models = new PackedFeatureModelTable(modelData);
|
|
423
|
+
return new MultiModelPackedFeatureTable(features, models);
|
|
424
|
+
}
|
|
425
|
+
get batchModelId() { return this._features.batchModelId; }
|
|
426
|
+
get batchModelIdPair() { return this._features.batchModelIdPair; }
|
|
427
|
+
get numFeatures() { return this._features.numFeatures; }
|
|
428
|
+
get type() { return this._features.type; }
|
|
429
|
+
get byteLength() {
|
|
430
|
+
return this._features.byteLength + this._models.byteLength;
|
|
431
|
+
}
|
|
432
|
+
getPackedFeature(featureIndex, result) {
|
|
433
|
+
this._features.getPackedFeature(featureIndex, result);
|
|
434
|
+
this._models.getModelIdPair(featureIndex, result.modelId);
|
|
435
|
+
return result;
|
|
436
|
+
}
|
|
437
|
+
getFeature(featureIndex, result) {
|
|
438
|
+
const packed = this.getPackedFeature(featureIndex, scratchPackedFeature);
|
|
439
|
+
return ModelFeature.unpack(packed, result);
|
|
440
|
+
}
|
|
441
|
+
findFeature(featureIndex, result) {
|
|
442
|
+
return featureIndex < this.numFeatures ? this.getFeature(featureIndex, result) : undefined;
|
|
443
|
+
}
|
|
444
|
+
getElementIdPair(featureIndex, out) {
|
|
445
|
+
return this._features.getElementIdPair(featureIndex, out);
|
|
446
|
+
}
|
|
447
|
+
findElementId(featureIndex) {
|
|
448
|
+
return this._features.findElementId(featureIndex);
|
|
449
|
+
}
|
|
450
|
+
*iterator(output) {
|
|
451
|
+
// Rather than perform a binary search on the model table to find each feature's model Id, traverse the model table in parallel with the feature table.
|
|
452
|
+
let modelIndex = 0;
|
|
453
|
+
const modelEntry = this._models.getEntry(modelIndex, scratchPackedFeatureModelEntry);
|
|
454
|
+
for (let featureIndex = 0; featureIndex < this.numFeatures; featureIndex++) {
|
|
455
|
+
if (featureIndex > modelEntry.lastFeatureIndex)
|
|
456
|
+
this._models.getEntry(++modelIndex, modelEntry);
|
|
457
|
+
this._features.getPackedFeature(featureIndex, output);
|
|
458
|
+
output.modelId.lower = modelEntry.idLower;
|
|
459
|
+
output.modelId.upper = modelEntry.idUpper;
|
|
460
|
+
output.index = featureIndex;
|
|
461
|
+
yield output;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
iterable(output) {
|
|
465
|
+
return {
|
|
466
|
+
[Symbol.iterator]: () => this.iterator(output),
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
exports.MultiModelPackedFeatureTable = MultiModelPackedFeatureTable;
|
|
279
471
|
//# sourceMappingURL=FeatureTable.js.map
|