Skip to content
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

Move batch table hierarchy to extension #6780

Merged
merged 6 commits into from
Jul 13, 2018
Merged

Conversation

ggetz
Copy link
Contributor

@ggetz ggetz commented Jul 6, 2018

Part of #6697

To reflect updates to the 3D Tiles spec, deprecated support for the 3D Tiles pre-version 1.0 Batch Table Hierarchy in favor of the 3DTILES_batch_table_hierarchy extension.

TODO:

@ggetz ggetz requested a review from lilleyse July 6, 2018 14:37
@cesium-concierge
Copy link

cesium-concierge commented Jul 6, 2018

Thanks for the pull request @ggetz!

  • ✔️ Signed CLA found.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@lilleyse lilleyse mentioned this pull request Jul 10, 2018
13 tasks
Copy link
Contributor

@lilleyse lilleyse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! The batch table hierarchy demo works with all of the updated tilesets and prints the deprecation warning appropriately for the legacy version.

}
this._extensions = defaultValue(extensions, {});
this._extras = defined(batchTableJson) ? batchTableJson.extras : undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extras can removed since it isn't used

* @private
*/
this.batchTableJson = batchTableJson;

/**
* @private
*/
this.batchTableBinary = batchTableBinary;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like in master as well as here this property isn't used, so it should be fine to remove.


var legacyHierarchy = jsonHeader.HIERARCHY;
if (defined(legacyHierarchy)) {
Cesium3DTileBatchTable._deprecationWarning('batchTableHierarchyExtension', 'The batch table HIERARCHY property has been moved to an extension. Use extension.3DTILES_batch_table_hierarchy instead.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change Use extension.3DTILES_batch_table_hierarchy to Use extensions.3DTILES_batch_table_hierarchy

* @returns {Object|undefined} The contents of the batch table extension, or <code>undefined</code>
* if the extension is not present.
*/
Cesium3DTileBatchTable.prototype.getExtension = function(extensionName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function isn't used outside this class. Should it be a local function, or are there plans to use it externally?

var extensions = this._extensions;
if (!defined(extensions)) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check isn't required since _extensions defaults to an empty object.

function getBinaryProperties(featuresLength, properties, binaryBody) {
if (!defined(properties)) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check isn't needed. properties defaults to an empty object.

}
}
var propertyNames = Object.keys(this._properties);
results.push.apply(results, propertyNames);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for the more verbose form before was to avoid allocating an array (like Object.keys would) if results is supplied. In practice I'm not sure if it really matters for this specific function though, so the change is ok.

@@ -1915,6 +1917,20 @@ define([
}
};

/**
* <code>true</code> if this the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this the tileset JSON file - small typo. Same below.

@@ -0,0 +1,53 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace BatchTableHierarchyExtension with BatchTableHierarchy after the name change in 3d-tiles-tools.

@@ -54,6 +54,9 @@ defineSuite([

beforeAll(function() {
scene = createScene();

// Keep the error from logging to the console when running tests
Batched3DModel3DTileContent._deprecationWarning = function() {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead can this be a spy?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment below.

@ggetz
Copy link
Contributor Author

ggetz commented Jul 13, 2018

Thanks @lilleyse , updated!

@lilleyse
Copy link
Contributor

Thanks. Just made some small edits in ab89ce1, but otherwise looks solid.

@lilleyse
Copy link
Contributor

Just waiting for CI since it looks like it failed for some other reason on the previous commit.

@lilleyse lilleyse merged commit b712ad3 into master Jul 13, 2018
@lilleyse lilleyse deleted the batch-table-hierarchy-ext branch July 13, 2018 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants