@itwin/core-common 3.2.0-dev.70 → 3.2.0-dev.74
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/ConcurrentQuery.d.ts.map +1 -1
- package/lib/cjs/ConcurrentQuery.js +2 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/HiddenLine.d.ts +12 -17
- package/lib/cjs/HiddenLine.d.ts.map +1 -1
- package/lib/cjs/HiddenLine.js +6 -2
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.d.ts.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js +3 -2
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js +3 -2
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.d.ts +1 -0
- package/lib/cjs/rpc/web/RpcMultipart.d.ts.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js +2 -1
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js +2 -2
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.d.ts +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js +8 -8
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.d.ts +1 -0
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js +4 -3
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/ElementGraphics.d.ts +8 -2
- package/lib/cjs/tile/ElementGraphics.d.ts.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.d.ts +18 -13
- package/lib/cjs/tile/TileMetadata.d.ts.map +1 -1
- package/lib/cjs/tile/TileMetadata.js +164 -134
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
- package/lib/esm/ConcurrentQuery.js +1 -0
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/HiddenLine.d.ts +12 -17
- package/lib/esm/HiddenLine.d.ts.map +1 -1
- package/lib/esm/HiddenLine.js +6 -2
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.d.ts.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js +1 -0
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js +1 -0
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.d.ts +1 -0
- package/lib/esm/rpc/web/RpcMultipart.d.ts.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.js +1 -0
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js +2 -2
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.d.ts +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.d.ts.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js +5 -5
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.d.ts +1 -0
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js +1 -0
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/ElementGraphics.d.ts +8 -2
- package/lib/esm/tile/ElementGraphics.d.ts.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/TileMetadata.d.ts +18 -13
- package/lib/esm/tile/TileMetadata.d.ts.map +1 -1
- package/lib/esm/tile/TileMetadata.js +163 -133
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/package.json +8 -8
|
@@ -43,6 +43,7 @@ export interface TileOptions {
|
|
|
43
43
|
readonly disableMagnification: boolean;
|
|
44
44
|
readonly alwaysSubdivideIncompleteTiles: boolean;
|
|
45
45
|
readonly enableIndexedEdges: boolean;
|
|
46
|
+
readonly generateAllPolyfaceEdges: boolean;
|
|
46
47
|
}
|
|
47
48
|
/** @internal */
|
|
48
49
|
export declare namespace TileOptions {
|
|
@@ -54,13 +55,17 @@ export declare namespace TileOptions {
|
|
|
54
55
|
*/
|
|
55
56
|
function fromTreeIdAndContentId(treeId: string, contentId: string): TileOptions;
|
|
56
57
|
}
|
|
57
|
-
/**
|
|
58
|
-
|
|
58
|
+
/** The result of [[parseTileTreeIdAndContentId]].
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
export interface ParsedTileTreeIdAndContentId {
|
|
59
62
|
modelId: Id64String;
|
|
60
63
|
treeId: IModelTileTreeId;
|
|
61
64
|
contentId: ContentIdSpec;
|
|
62
65
|
options: TileOptions;
|
|
63
|
-
}
|
|
66
|
+
}
|
|
67
|
+
/** @internal */
|
|
68
|
+
export declare function parseTileTreeIdAndContentId(treeId: string, contentId: string): ParsedTileTreeIdAndContentId;
|
|
64
69
|
/** @internal */
|
|
65
70
|
export declare const defaultTileOptions: TileOptions;
|
|
66
71
|
/** @internal */
|
|
@@ -75,16 +80,16 @@ export declare enum TreeFlags {
|
|
|
75
80
|
OptimizeBRepProcessing = 4,
|
|
76
81
|
UseLargerTiles = 8
|
|
77
82
|
}
|
|
78
|
-
/** Describes
|
|
79
|
-
* @
|
|
83
|
+
/** Describes how edges should be produced for tiles in a tile tree.
|
|
84
|
+
* @internal
|
|
80
85
|
*/
|
|
81
|
-
export
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
|
|
86
|
+
export interface EdgeOptions {
|
|
87
|
+
/** Generate indexed edges. These use less memory and draw more efficiently than non-indexed edges, but require WebGL 2.
|
|
88
|
+
* Generally the display system will determine which to use based on the device's capabilities and application configuration.
|
|
89
|
+
*/
|
|
90
|
+
indexed: boolean;
|
|
91
|
+
/** For polyfaces that lack edge visibility information, generate edges for all faces; otherwise, infer edges from mesh topology. */
|
|
92
|
+
smooth: boolean;
|
|
88
93
|
}
|
|
89
94
|
/** Describes a tile tree used to draw the contents of a model, possibly with embedded animation.
|
|
90
95
|
* @internal
|
|
@@ -93,7 +98,7 @@ export interface PrimaryTileTreeId {
|
|
|
93
98
|
/** Describes the type of tile tree. */
|
|
94
99
|
type: BatchType.Primary;
|
|
95
100
|
/** The type of edges to include in tile content. */
|
|
96
|
-
edges:
|
|
101
|
+
edges: EdgeOptions | false;
|
|
97
102
|
/** Id of the [DisplayStyle]($backend) or [RenderTimeline]($backend) element holding the [[RenderSchedule]] script to be applied to the tiles. */
|
|
98
103
|
animationId?: Id64String;
|
|
99
104
|
/** If true, meshes within the tiles will be grouped into nodes based on the display priority associated with their subcategories,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileMetadata.d.ts","sourceRoot":"","sources":["../../../src/tile/TileMetadata.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACG,UAAU,
|
|
1
|
+
{"version":3,"file":"TileMetadata.d.ts","sourceRoot":"","sources":["../../../src/tile/TileMetadata.ts"],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MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,OAAO,GAAG,sBAAsB,CAqD3L;AAID;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAS3G;AAED;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAChC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAU;IAC9C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;gBAEpB,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW;IAMvE;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,GAAG,YAAY;CAWhE"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module Tile
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.TileMetadataReader = exports.computeTileChordTolerance = exports.readTileContentDescription = exports.computeChildTileProps = exports.computeChildTileRanges = exports.bisectTileRange2d = exports.bisectTileRange3d = exports.ContentIdProvider = exports.ContentFlags = exports.compareIModelTileTreeIds = exports.iModelTileTreeIdToString = exports.
|
|
10
|
+
exports.TileMetadataReader = exports.computeTileChordTolerance = exports.readTileContentDescription = exports.computeChildTileProps = exports.computeChildTileRanges = exports.bisectTileRange2d = exports.bisectTileRange3d = exports.ContentIdProvider = exports.ContentFlags = exports.compareIModelTileTreeIds = exports.iModelTileTreeIdToString = exports.TreeFlags = exports.getMaximumMajorTileFormatVersion = exports.defaultTileOptions = exports.parseTileTreeIdAndContentId = exports.TileOptions = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const core_geometry_1 = require("@itwin/core-geometry");
|
|
13
13
|
const FeatureTable_1 = require("../FeatureTable");
|
|
@@ -31,6 +31,7 @@ var TileOptions;
|
|
|
31
31
|
function fromTreeIdAndContentId(treeId, contentId) {
|
|
32
32
|
const tree = treeFlagsAndFormatVersionFromId(treeId);
|
|
33
33
|
const contentFlags = contentFlagsFromId(contentId);
|
|
34
|
+
const edgeOptions = edgeOptionsFromTreeId(treeId);
|
|
34
35
|
return {
|
|
35
36
|
maximumMajorTileFormatVersion: tree.version,
|
|
36
37
|
enableInstancing: 0 !== (contentFlags & ContentFlags.AllowInstancing),
|
|
@@ -42,140 +43,146 @@ var TileOptions;
|
|
|
42
43
|
useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),
|
|
43
44
|
disableMagnification: false,
|
|
44
45
|
alwaysSubdivideIncompleteTiles: false,
|
|
45
|
-
enableIndexedEdges:
|
|
46
|
+
enableIndexedEdges: edgeOptions && edgeOptions.indexed,
|
|
47
|
+
generateAllPolyfaceEdges: edgeOptions && edgeOptions.smooth,
|
|
46
48
|
};
|
|
47
49
|
}
|
|
48
50
|
TileOptions.fromTreeIdAndContentId = fromTreeIdAndContentId;
|
|
49
51
|
})(TileOptions = exports.TileOptions || (exports.TileOptions = {}));
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return {
|
|
89
|
-
contentId: parsedContentId,
|
|
90
|
-
modelId,
|
|
91
|
-
options,
|
|
92
|
-
treeId: parsedTreeId,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
exports.parseTileTreeIdAndContentId = parseTileTreeIdAndContentId;
|
|
96
|
-
function getTreeId(type, edges, sectionCut, animationId, expansion, enforceDisplayPriority) {
|
|
97
|
-
if (type === FeatureTable_1.BatchType.Primary)
|
|
98
|
-
return {
|
|
99
|
-
type,
|
|
100
|
-
edges,
|
|
101
|
-
sectionCut,
|
|
102
|
-
animationId,
|
|
103
|
-
enforceDisplayPriority,
|
|
104
|
-
};
|
|
105
|
-
else
|
|
52
|
+
class Parser {
|
|
53
|
+
constructor(input) {
|
|
54
|
+
this.curPos = 0;
|
|
55
|
+
this.input = input;
|
|
56
|
+
}
|
|
57
|
+
parse(contentId) {
|
|
58
|
+
this.require(this.input.length > 0);
|
|
59
|
+
// Skip version and flags, they're handled by TileOptions.fromTreeIdAndContentId
|
|
60
|
+
while (this.curPos < this.input.length && this.cur() !== "-")
|
|
61
|
+
this.advance();
|
|
62
|
+
this.eat("-");
|
|
63
|
+
this.require(this.curPos < this.input.length);
|
|
64
|
+
const classifier = this.cur() === "C" ? this.parseClassifier() : undefined;
|
|
65
|
+
const animationId = this.parseAnimation();
|
|
66
|
+
const primary = classifier ? undefined : this.parsePrimary();
|
|
67
|
+
this.require((undefined === classifier) !== (undefined === primary));
|
|
68
|
+
const modelId = this.input.substr(this.curPos);
|
|
69
|
+
this.require(core_bentley_1.Id64.isId64(modelId));
|
|
70
|
+
const { flags: treeFlags } = treeFlagsAndFormatVersionFromId(this.input);
|
|
71
|
+
const options = TileOptions.fromTreeIdAndContentId(this.input, contentId);
|
|
72
|
+
let parsedContentId;
|
|
73
|
+
try {
|
|
74
|
+
parsedContentId = ContentIdProvider.create(true, options).specFromId(contentId);
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
this.reject("Invalid content Id");
|
|
78
|
+
}
|
|
79
|
+
if (Object.keys(parsedContentId).some((key) => parsedContentId.hasOwnProperty(key) && typeof parsedContentId[key] === "number" && !Number.isFinite(parsedContentId[key])))
|
|
80
|
+
throw new Error("Invalid content Id");
|
|
81
|
+
let treeId;
|
|
82
|
+
if (classifier) {
|
|
83
|
+
treeId = { ...classifier, animationId };
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
(0, core_bentley_1.assert)(undefined !== primary);
|
|
87
|
+
const enforceDisplayPriority = (treeFlags & TreeFlags.EnforceDisplayPriority) !== 0 ? true : undefined;
|
|
88
|
+
treeId = { ...primary, animationId, type: FeatureTable_1.BatchType.Primary, enforceDisplayPriority };
|
|
89
|
+
}
|
|
106
90
|
return {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
91
|
+
contentId: parsedContentId,
|
|
92
|
+
modelId,
|
|
93
|
+
options,
|
|
94
|
+
treeId,
|
|
110
95
|
};
|
|
111
|
-
}
|
|
112
|
-
function parsePrimary(idx, treeId, edges = EdgeType.None, sectionCut) {
|
|
113
|
-
// Edges
|
|
114
|
-
edges = EdgeType.NonIndexed;
|
|
115
|
-
if (idx < treeId.length) {
|
|
116
|
-
const noEdgesStr = "E:0_";
|
|
117
|
-
if (treeId.startsWith(noEdgesStr, idx))
|
|
118
|
-
edges = EdgeType.None;
|
|
119
|
-
else if (treeId.startsWith("E:2_", idx))
|
|
120
|
-
edges = EdgeType.Indexed;
|
|
121
|
-
if (EdgeType.NonIndexed !== edges)
|
|
122
|
-
idx += noEdgesStr.length;
|
|
123
|
-
}
|
|
124
|
-
// Section cut
|
|
125
|
-
if (idx + 1 < treeId.length && treeId[idx] === "S") {
|
|
126
|
-
idx++; // S
|
|
127
|
-
sectionCut = "";
|
|
128
|
-
while (idx < treeId.length && treeId[idx] !== "s") {
|
|
129
|
-
sectionCut += treeId[idx++];
|
|
130
|
-
}
|
|
131
|
-
if (idx === treeId.length)
|
|
132
|
-
throw new Error("Invalid tree Id");
|
|
133
|
-
idx++; // s
|
|
134
96
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
let type;
|
|
139
|
-
idx++; // C
|
|
140
|
-
if (idx + 1 < treeId.length && treeId[idx] === "P" && treeId[idx + 1] === ":") {
|
|
141
|
-
type = FeatureTable_1.BatchType.PlanarClassifier;
|
|
142
|
-
idx += 2; // P:
|
|
97
|
+
cur() {
|
|
98
|
+
this.require(this.curPos < this.input.length);
|
|
99
|
+
return this.input[this.curPos];
|
|
143
100
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
101
|
+
advance() {
|
|
102
|
+
this.require(this.curPos < this.input.length);
|
|
103
|
+
++this.curPos;
|
|
147
104
|
}
|
|
148
|
-
|
|
149
|
-
|
|
105
|
+
eat(expectedChar) {
|
|
106
|
+
this.require(this.cur() === expectedChar);
|
|
107
|
+
this.advance();
|
|
150
108
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
while (idx < treeId.length && (treeId[idx] >= "0" && treeId[idx] <= "9" || treeId[idx] === ".")) {
|
|
154
|
-
expansionStr += treeId[idx++];
|
|
109
|
+
reject(message = "Invalid tree Id") {
|
|
110
|
+
throw new Error(message);
|
|
155
111
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
idx += 2;
|
|
167
|
-
// Parse animation id
|
|
168
|
-
animationId = "";
|
|
169
|
-
while (idx < treeId.length && treeId[idx] !== "_") {
|
|
170
|
-
animationId += treeId[idx++];
|
|
112
|
+
require(condition, message = "Invalid tree Id") {
|
|
113
|
+
if (!condition)
|
|
114
|
+
this.reject(message);
|
|
115
|
+
}
|
|
116
|
+
parseClassifier() {
|
|
117
|
+
this.eat("C");
|
|
118
|
+
let type = FeatureTable_1.BatchType.VolumeClassifier;
|
|
119
|
+
if (this.cur() === "P") {
|
|
120
|
+
type = FeatureTable_1.BatchType.PlanarClassifier;
|
|
121
|
+
this.advance();
|
|
171
122
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
123
|
+
this.eat(":");
|
|
124
|
+
// C: or CP: is always folowed by expansion then an underscore.
|
|
125
|
+
let expansionStr = "";
|
|
126
|
+
while (this.curPos < this.input.length && (this.cur() >= "0" && this.cur() <= "9" || this.cur() === ".")) {
|
|
127
|
+
expansionStr += this.cur();
|
|
128
|
+
this.advance();
|
|
129
|
+
}
|
|
130
|
+
this.eat("_");
|
|
131
|
+
const expansion = Number.parseFloat(expansionStr);
|
|
132
|
+
this.require(!Number.isNaN(expansion));
|
|
133
|
+
return { type, expansion };
|
|
134
|
+
}
|
|
135
|
+
parseAnimation() {
|
|
136
|
+
if (this.cur() !== "A")
|
|
137
|
+
return undefined;
|
|
138
|
+
this.eat("A");
|
|
139
|
+
this.eat(":");
|
|
140
|
+
const termPos = this.input.indexOf("_", this.curPos);
|
|
141
|
+
this.require(termPos > this.curPos);
|
|
142
|
+
const animationId = this.input.substring(this.curPos, termPos);
|
|
143
|
+
this.require(core_bentley_1.Id64.isId64(animationId));
|
|
144
|
+
this.curPos = termPos + 1; // Skip "_"
|
|
145
|
+
return animationId;
|
|
146
|
+
}
|
|
147
|
+
parsePrimary() {
|
|
148
|
+
const edges = this.parseEdges();
|
|
149
|
+
const sectionCut = this.parseSectionCut();
|
|
150
|
+
return { edges, sectionCut };
|
|
151
|
+
}
|
|
152
|
+
parseEdges() {
|
|
153
|
+
if ("E" !== this.cur())
|
|
154
|
+
return { indexed: false, smooth: false };
|
|
155
|
+
this.eat("E");
|
|
156
|
+
this.eat(":");
|
|
157
|
+
const typeStr = this.cur();
|
|
158
|
+
this.eat(typeStr);
|
|
159
|
+
this.eat("_");
|
|
160
|
+
switch (typeStr) {
|
|
161
|
+
case "0": return false;
|
|
162
|
+
case "2": return { indexed: true, smooth: false };
|
|
163
|
+
case "3": return { indexed: false, smooth: true };
|
|
164
|
+
case "4": return { indexed: true, smooth: true };
|
|
165
|
+
default: this.reject();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
parseSectionCut() {
|
|
169
|
+
if ("S" !== this.cur())
|
|
170
|
+
return undefined;
|
|
171
|
+
this.eat("S");
|
|
172
|
+
const termPos = this.input.indexOf("s", this.curPos);
|
|
173
|
+
this.require(termPos > this.curPos);
|
|
174
|
+
const sectionCut = this.input.substring(this.curPos, termPos);
|
|
175
|
+
this.curPos = termPos + 1; // Skip "_";
|
|
176
|
+
return sectionCut;
|
|
175
177
|
}
|
|
176
|
-
return { idx, animationId };
|
|
177
178
|
}
|
|
178
179
|
/** @internal */
|
|
180
|
+
function parseTileTreeIdAndContentId(treeId, contentId) {
|
|
181
|
+
const parser = new Parser(treeId);
|
|
182
|
+
return parser.parse(contentId);
|
|
183
|
+
}
|
|
184
|
+
exports.parseTileTreeIdAndContentId = parseTileTreeIdAndContentId;
|
|
185
|
+
/** @internal */
|
|
179
186
|
exports.defaultTileOptions = Object.freeze({
|
|
180
187
|
maximumMajorTileFormatVersion: IModelTileIO_1.CurrentImdlVersion.Major,
|
|
181
188
|
enableInstancing: true,
|
|
@@ -188,6 +195,7 @@ exports.defaultTileOptions = Object.freeze({
|
|
|
188
195
|
disableMagnification: false,
|
|
189
196
|
alwaysSubdivideIncompleteTiles: false,
|
|
190
197
|
enableIndexedEdges: true,
|
|
198
|
+
generateAllPolyfaceEdges: true,
|
|
191
199
|
});
|
|
192
200
|
function contentFlagsFromId(id) {
|
|
193
201
|
if (0 === id.length || "-" !== id[0])
|
|
@@ -216,6 +224,18 @@ function treeFlagsAndFormatVersionFromId(id) {
|
|
|
216
224
|
}
|
|
217
225
|
throw new Error("Invalid tree Id");
|
|
218
226
|
}
|
|
227
|
+
function edgeOptionsFromTreeId(id) {
|
|
228
|
+
const pos = id.indexOf("E:");
|
|
229
|
+
if (pos <= 0)
|
|
230
|
+
return { indexed: false, smooth: false };
|
|
231
|
+
switch (id[pos + 2]) {
|
|
232
|
+
case "0": return { indexed: exports.defaultTileOptions.enableIndexedEdges, smooth: exports.defaultTileOptions.generateAllPolyfaceEdges };
|
|
233
|
+
case "2": return { indexed: true, smooth: false };
|
|
234
|
+
case "3": return { indexed: false, smooth: true };
|
|
235
|
+
case "4": return { indexed: true, smooth: true };
|
|
236
|
+
}
|
|
237
|
+
throw new Error("Invalid tree Id");
|
|
238
|
+
}
|
|
219
239
|
/** @internal */
|
|
220
240
|
function getMaximumMajorTileFormatVersion(maxMajorVersion, formatVersion) {
|
|
221
241
|
// The `formatVersion` input is from the backend, telling us precisely the maximum major+minor version it can produce.
|
|
@@ -243,18 +263,19 @@ var TreeFlags;
|
|
|
243
263
|
TreeFlags[TreeFlags["OptimizeBRepProcessing"] = 4] = "OptimizeBRepProcessing";
|
|
244
264
|
TreeFlags[TreeFlags["UseLargerTiles"] = 8] = "UseLargerTiles";
|
|
245
265
|
})(TreeFlags = exports.TreeFlags || (exports.TreeFlags = {}));
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
266
|
+
function compareEdgeOptions(a, b) {
|
|
267
|
+
if (typeof a !== typeof b)
|
|
268
|
+
return a ? 1 : -1;
|
|
269
|
+
if (typeof a === "boolean") {
|
|
270
|
+
(0, core_bentley_1.assert)(typeof b === "boolean");
|
|
271
|
+
return (0, core_bentley_1.compareBooleans)(a, b);
|
|
272
|
+
}
|
|
273
|
+
(0, core_bentley_1.assert)(typeof b === "object");
|
|
274
|
+
let cmp = (0, core_bentley_1.compareBooleans)(a.indexed, b.indexed);
|
|
275
|
+
if (0 === cmp)
|
|
276
|
+
cmp = (0, core_bentley_1.compareBooleans)(a.smooth, b.smooth);
|
|
277
|
+
return cmp;
|
|
278
|
+
}
|
|
258
279
|
function animationIdToString(animationId) {
|
|
259
280
|
return `A:${animationId}_`;
|
|
260
281
|
}
|
|
@@ -273,7 +294,16 @@ function iModelTileTreeIdToString(modelId, treeId, options) {
|
|
|
273
294
|
idStr = `${idStr}${animationIdToString(treeId.animationId)}`;
|
|
274
295
|
else if (treeId.enforceDisplayPriority) // animation and priority are currently mutually exclusive
|
|
275
296
|
flags |= TreeFlags.EnforceDisplayPriority;
|
|
276
|
-
|
|
297
|
+
let edges;
|
|
298
|
+
if (!treeId.edges) {
|
|
299
|
+
edges = "E:0_";
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
if (!treeId.edges.smooth)
|
|
303
|
+
edges = treeId.edges.indexed ? "E:2_" : "";
|
|
304
|
+
else
|
|
305
|
+
edges = treeId.edges.indexed ? "E:4_" : "E:3_";
|
|
306
|
+
}
|
|
277
307
|
const sectionCut = treeId.sectionCut ? `S${treeId.sectionCut}s` : "";
|
|
278
308
|
idStr = `${idStr}${edges}${sectionCut}`;
|
|
279
309
|
}
|
|
@@ -305,7 +335,7 @@ function compareIModelTileTreeIds(lhs, rhs) {
|
|
|
305
335
|
// NB: The redundant checks on BatchType below are to satisfy compiler.
|
|
306
336
|
(0, core_bentley_1.assert)(lhs.type === rhs.type);
|
|
307
337
|
if (FeatureTable_1.BatchType.Primary === lhs.type && FeatureTable_1.BatchType.Primary === rhs.type) {
|
|
308
|
-
cmp = (
|
|
338
|
+
cmp = compareEdgeOptions(lhs.edges, rhs.edges);
|
|
309
339
|
if (0 === cmp) {
|
|
310
340
|
cmp = (0, core_bentley_1.compareBooleansOrUndefined)(lhs.enforceDisplayPriority, rhs.enforceDisplayPriority);
|
|
311
341
|
if (0 === cmp)
|