forked from CesiumGS/cesium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCesium3DTileContent.js
346 lines (324 loc) · 10.8 KB
/
Cesium3DTileContent.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
define([
'../Core/defineProperties',
'../Core/DeveloperError'
], function(
defineProperties,
DeveloperError) {
'use strict';
/**
* The content of a tile in a {@link Cesium3DTileset}.
* <p>
* Derived classes of this interface provide access to individual features in the tile.
* Access derived objects through {@link Cesium3DTile#content}.
* </p>
* <p>
* This type describes an interface and is not intended to be instantiated directly.
* </p>
*
* @alias Cesium3DTileContent
* @constructor
*/
function Cesium3DTileContent(tileset, tile, url, arrayBuffer, byteOffset) {
/**
* Gets or sets if any feature's property changed. Used to
* optimized applying a style when a feature's property changed.
* <p>
* This is used to implement the <code>Cesium3DTileContent</code> interface, but is
* not part of the public Cesium API.
* </p>
*
* @type {Boolean}
*
* @private
*/
this.featurePropertiesDirty = false;
}
defineProperties(Cesium3DTileContent.prototype, {
/**
* Gets the number of features in the tile.
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Number}
* @readonly
*/
featuresLength : {
get : function() {
DeveloperError.throwInstantiationError();
}
},
/**
* Gets the number of points in the tile.
* <p>
* Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which
* equals the number of groups of points as distinguished by the <code>BATCH_ID</code> feature table semantic.
* </p>
*
* @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/PointCloud#batched-points}
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Number}
* @readonly
*/
pointsLength : {
get : function() {
DeveloperError.throwInstantiationError();
}
},
/**
* Gets the number of triangles in the tile.
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Number}
* @readonly
*/
trianglesLength : {
get : function() {
DeveloperError.throwInstantiationError();
}
},
/**
* Gets the tile's geometry memory in bytes.
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Number}
* @readonly
*/
geometryByteLength : {
get : function() {
DeveloperError.throwInstantiationError();
}
},
/**
* Gets the tile's texture memory in bytes.
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Number}
* @readonly
*/
texturesByteLength : {
get : function() {
DeveloperError.throwInstantiationError();
}
},
/**
* Gets the amount of memory used by the batch table textures, in bytes.
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Number}
* @readonly
*/
batchTableByteLength : {
get : function() {
DeveloperError.throwInstantiationError();
}
},
/**
* Gets the array of {@link Cesium3DTileContent} objects that represent the
* content a composite's inner tiles, which can also be composites.
*
* @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/Composite}
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Array}
* @readonly
*/
innerContents : {
get : function() {
DeveloperError.throwInstantiationError();
}
},
/**
* Gets the promise that will be resolved when the tile's content is ready to render.
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Promise.<Cesium3DTileContent>}
* @readonly
*/
readyPromise : {
get : function() {
DeveloperError.throwInstantiationError();
}
},
/**
* Gets the tileset for this tile.
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Cesium3DTileset}
* @readonly
*/
tileset : {
get : function() {
DeveloperError.throwInstantiationError();
}
},
/**
* Gets the tile containing this content.
*
* @memberof Cesium3DTileContent.prototype
*
* @type {Cesium3DTile}
* @readonly
*/
tile : {
get : function() {
DeveloperError.throwInstantiationError();
}
},
/**
* Gets the url of the tile's content.
* @memberof Cesium3DTileContent.prototype
*
* @type {String}
* @readonly
*/
url : {
get : function() {
DeveloperError.throwInstantiationError();
}
},
/**
* Gets the batch table for this content.
* <p>
* This is used to implement the <code>Cesium3DTileContent</code> interface, but is
* not part of the public Cesium API.
* </p>
*
* @type {Cesium3DTileBatchTable}
* @readonly
*
* @private
*/
batchTable : {
get : function() {
DeveloperError.throwInstantiationError();
}
}
});
/**
* Determines if the tile's batch table has a property. If it does, each feature in
* the tile will have the property.
*
* @param {Number} batchId The batchId for the feature.
* @param {String} name The case-sensitive name of the property.
* @returns {Boolean} <code>true</code> if the property exists; otherwise, <code>false</code>.
*/
Cesium3DTileContent.prototype.hasProperty = function(batchId, name) {
DeveloperError.throwInstantiationError();
};
/**
* Returns the {@link Cesium3DTileFeature} object for the feature with the
* given <code>batchId</code>. This object is used to get and modify the
* feature's properties.
* <p>
* Features in a tile are ordered by <code>batchId</code>, an index used to retrieve their metadata from the batch table.
* </p>
*
* @see {@link https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/BatchTable}.
*
* @param {Number} batchId The batchId for the feature.
* @returns {Cesium3DTileFeature} The corresponding {@link Cesium3DTileFeature} object.
*
* @exception {DeveloperError} batchId must be between zero and {@link Cesium3DTileContent#featuresLength} - 1.
*/
Cesium3DTileContent.prototype.getFeature = function(batchId) {
DeveloperError.throwInstantiationError();
};
/**
* Called when {@link Cesium3DTileset#debugColorizeTiles} changes.
* <p>
* This is used to implement the <code>Cesium3DTileContent</code> interface, but is
* not part of the public Cesium API.
* </p>
*
* @param {Boolean} enabled Whether to enable or disable debug settings.
* @returns {Cesium3DTileFeature} The corresponding {@link Cesium3DTileFeature} object.
* @private
*/
Cesium3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
DeveloperError.throwInstantiationError();
};
/**
* Apply a style to the content
* <p>
* This is used to implement the <code>Cesium3DTileContent</code> interface, but is
* not part of the public Cesium API.
* </p>
*
* @param {Cesium3DTileStyle} style The style.
*
* @private
*/
Cesium3DTileContent.prototype.applyStyle = function(style) {
DeveloperError.throwInstantiationError();
};
/**
* Called by the tile during tileset traversal to get the draw commands needed to render this content.
* When the tile's content is in the PROCESSING state, this creates WebGL resources to ultimately
* move to the READY state.
* <p>
* This is used to implement the <code>Cesium3DTileContent</code> interface, but is
* not part of the public Cesium API.
* </p>
*
* @param {Cesium3DTileset} tileset The tileset containing this tile.
* @param {FrameState} frameState The frame state.
*
* @private
*/
Cesium3DTileContent.prototype.update = function(tileset, frameState) {
DeveloperError.throwInstantiationError();
};
/**
* Returns true if this object was destroyed; otherwise, false.
* <br /><br />
* If this object was destroyed, it should not be used; calling any function other than
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
* <p>
* This is used to implement the <code>Cesium3DTileContent</code> interface, but is
* not part of the public Cesium API.
* </p>
*
* @returns {Boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
*
* @see Cesium3DTileContent#destroy
*
* @private
*/
Cesium3DTileContent.prototype.isDestroyed = function() {
DeveloperError.throwInstantiationError();
};
/**
* Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
* release of WebGL resources, instead of relying on the garbage collector to destroy this object.
* <br /><br />
* Once an object is destroyed, it should not be used; calling any function other than
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (<code>undefined</code>) to the object as done in the example.
* <p>
* This is used to implement the <code>Cesium3DTileContent</code> interface, but is
* not part of the public Cesium API.
* </p>
*
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
* @example
* content = content && content.destroy();
*
* @see Cesium3DTileContent#isDestroyed
*
* @private
*/
Cesium3DTileContent.prototype.destroy = function() {
DeveloperError.throwInstantiationError();
};
return Cesium3DTileContent;
});