-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(3dtiles): add support for binary batch table #1834
Conversation
00157c4
to
06661a3
Compare
Hello Vincent, |
Yes it is 🙂 |
06661a3
to
99fb432
Compare
Hello @gchoqueux |
I am currently busy |
a8e9f99
to
fcc83ac
Compare
fcc83ac
to
00f67a6
Compare
src/Core/3DTiles/C3DTBatchTable.js
Outdated
constructor(buffer, jsonLength, binaryLength, batchLength, registeredExtensions) { | ||
this.type = C3DTilesTypes.batchtable; | ||
this.batchLength = batchLength; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constructor signature change is a breaking change. I think we could add a depreciation warning like so :
if (jsonLength + binaryLength !== buffer.byteLength) {
// The constructor was called with its deprecated signature
console.warn('some deprecation error message');
registeredExtensions = batchLength;
batchLength = binaryLength;
binaryLength = jsonLength;
jsonLength = buffer.byteLength - binaryLength;
}
WDYT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a good idea to add this test to check if the provided arguments seem correct but not to check if the constructor was called with the former signature since the test can pass if the constructor is called with the former signature and if the batch length equals the binary length.
However, since there is no optional argument in this function, we can test if the number of arguments is correc and add a deprecation warning and compute the values as suggested if not. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I didn't think of simply counting the number of arguments but it is a safer test 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some more thinking, I think we should not add a deprecation test based on arguments length either since it may happen for other reasons than because the previous constructor was used. In addition, batch tables are not meant to be constructed directly by users of itowns but by our 3D tiles parsers so there is little chance that a user calls this constructor anyway. Therefore, I think we should keep it this way and only add BREAKING CHANGE in the commit title (and therefore in the release). WDYT ?
c879321
to
3fab1e5
Compare
BREAKING CHANGE: `C3DTBatchTable` constructor signature has changed from C3DTBatchTable(buffer, binaryLength, batchLength, registeredExtensions) to C3DTBatchTable(buffer, jsonLength, binaryLength, batchLength, registeredExtensions)
3fab1e5
to
bdf67f9
Compare
I added the deprecation warning, added the breaking change message in the commit and rebased. |
Description
Motivation and Context
Note:
BinaryPropertyAccessor.js
may also be used for parsing the binary content of the 3D Tiles feature table (not supported by itowns yet).