Skip to content

Commit

Permalink
Merge pull request #4514 from erikmaarten/remove-deprecated-parameter…
Browse files Browse the repository at this point in the history
…-handling

Remove handling of deprecated scene parameter in constructor
  • Loading branch information
mramato authored Oct 26, 2016
2 parents 97e40b2 + b4939ea commit 567f1a4
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 49 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Change Log
* Deprecated
*
* Breaking changes
*
* The `scene` parameter for creating `BillboardVisualizer`, `LabelVisualizer`, and `PointVisualizer` has been removed. Instead, pass an instance of `EntityCluster`.
* Fixed a crash that would occur when using dynamic `distanceDisplayCondition` properties. [#4403](https://github.com/AnalyticalGraphicsInc/cesium/pull/4403)
* Fixed several bugs that lead to billboards and labels being improperly clamped to terrain. [#4396](https://github.com/AnalyticalGraphicsInc/cesium/issues/4396), [#4062](https://github.com/AnalyticalGraphicsInc/cesium/issues/4062)
* Fixed a bug affected models with multiple meshes without indices. [#4237](https://github.com/AnalyticalGraphicsInc/cesium/issues/4237)
Expand Down
9 changes: 0 additions & 9 deletions Source/DataSources/BillboardVisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ define([
'../Core/Color',
'../Core/defaultValue',
'../Core/defined',
'../Core/deprecationWarning',
'../Core/destroyObject',
'../Core/DeveloperError',
'../Core/DistanceDisplayCondition',
Expand All @@ -26,7 +25,6 @@ define([
Color,
defaultValue,
defined,
deprecationWarning,
destroyObject,
DeveloperError,
DistanceDisplayCondition,
Expand Down Expand Up @@ -84,13 +82,6 @@ define([
}
//>>includeEnd('debug');

if (!defined(entityCluster.minimumClusterSize)) {
deprecationWarning('BillboardVisualizer scene constructor parameter', 'The scene is no longer a parameter the BillboardVisualizer. An EntityCluster is required.');
entityCluster = new EntityCluster({
enabled : false
});
}

entityCollection.collectionChanged.addEventListener(BillboardVisualizer.prototype._onCollectionChanged, this);

this._cluster = entityCluster;
Expand Down
19 changes: 1 addition & 18 deletions Source/DataSources/DataSourceDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,19 +366,7 @@ define([

scene.primitives.add(entityCluster);

var visualizers = this._visualizersCallback(scene, entityCluster, dataSource);
dataSource._visualizers = visualizers;

var length = visualizers.length;
for (var i = 0; i < length; ++i) {
var visualizer = visualizers[i];
var cluster = visualizer._cluster;

if (defined(cluster) && !defined(cluster._scene)) {
cluster._initialize(scene);
scene.primitives.add(cluster);
}
}
dataSource._visualizers = this._visualizersCallback(scene, entityCluster, dataSource);
};

DataSourceDisplay.prototype._onDataSourceRemoved = function(dataSourceCollection, dataSource) {
Expand All @@ -389,11 +377,6 @@ define([
var visualizers = dataSource._visualizers;
var length = visualizers.length;
for (var i = 0; i < length; i++) {
var cluster = visualizers[i]._cluster;
if (cluster !== entityCluster) {
scene.primitives.remove(cluster);
}

visualizers[i].destroy();
}

Expand Down
9 changes: 0 additions & 9 deletions Source/DataSources/LabelVisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ define([
'../Core/Color',
'../Core/defaultValue',
'../Core/defined',
'../Core/deprecationWarning',
'../Core/destroyObject',
'../Core/DeveloperError',
'../Core/DistanceDisplayCondition',
Expand All @@ -25,7 +24,6 @@ define([
Color,
defaultValue,
defined,
deprecationWarning,
destroyObject,
DeveloperError,
DistanceDisplayCondition,
Expand Down Expand Up @@ -85,13 +83,6 @@ define([
}
//>>includeEnd('debug');

if (!defined(entityCluster.minimumClusterSize)) {
deprecationWarning('BillboardVisualizer scene constructor parameter', 'The scene is no longer a parameter the BillboardVisualizer. An EntityCluster is required.');
entityCluster = new EntityCluster({
enabled : false
});
}

entityCollection.collectionChanged.addEventListener(LabelVisualizer.prototype._onCollectionChanged, this);

this._cluster = entityCluster;
Expand Down
9 changes: 0 additions & 9 deletions Source/DataSources/PointVisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ define([
'../Core/Color',
'../Core/defaultValue',
'../Core/defined',
'../Core/deprecationWarning',
'../Core/destroyObject',
'../Core/DeveloperError',
'../Core/DistanceDisplayCondition',
Expand All @@ -20,7 +19,6 @@ define([
Color,
defaultValue,
defined,
deprecationWarning,
destroyObject,
DeveloperError,
DistanceDisplayCondition,
Expand Down Expand Up @@ -71,13 +69,6 @@ define([
}
//>>includeEnd('debug');

if (!defined(entityCluster.minimumClusterSize)) {
deprecationWarning('BillboardVisualizer scene constructor parameter', 'The scene is no longer a parameter the BillboardVisualizer. An EntityCluster is required.');
entityCluster = new EntityCluster({
enabled : false
});
}

entityCollection.collectionChanged.addEventListener(PointVisualizer.prototype._onCollectionChanged, this);

this._cluster = entityCluster;
Expand Down
5 changes: 2 additions & 3 deletions Specs/DataSources/DataSourceDisplaySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,15 @@ defineSuite([
}
});

function MockVisualizer(scene, entityCollection) {
this.scene = scene;
this.entityCollection = entityCollection;
function MockVisualizer() {
this.updatesCalled = 0;
this.lastUpdateTime = undefined;
this.destroyed = false;

this.getBoundingSphereResult = undefined;
this.getBoundingSphereState = undefined;
}

MockVisualizer.prototype.update = function(time) {
this.lastUpdateTime = time;
this.updatesCalled++;
Expand Down

0 comments on commit 567f1a4

Please sign in to comment.