Skip to content

Commit

Permalink
removed frameState in applyStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
janeyx99 committed Aug 13, 2018
1 parent 4c7b175 commit cfb77a4
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 38 deletions.
4 changes: 2 additions & 2 deletions Source/Scene/Batched3DModel3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ define([
}
};

Batched3DModel3DTileContent.prototype.applyStyle = function(frameState, style) {
this._batchTable.applyStyle(frameState, style);
Batched3DModel3DTileContent.prototype.applyStyle = function(style) {
this._batchTable.applyStyle(style);
};

Batched3DModel3DTileContent.prototype.update = function(tileset, frameState) {
Expand Down
2 changes: 1 addition & 1 deletion Source/Scene/Cesium3DTileBatchTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ define([

var scratchColor = new Color();

Cesium3DTileBatchTable.prototype.applyStyle = function(frameState, style) {
Cesium3DTileBatchTable.prototype.applyStyle = function(style) {
if (!defined(style)) {
this.setAllColor(DEFAULT_COLOR_VALUE);
this.setAllShow(true);
Expand Down
3 changes: 1 addition & 2 deletions Source/Scene/Cesium3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,11 @@ define([
* not part of the public Cesium API.
* </p>
*
* @param {FrameState} frameState The frame state.
* @param {Cesium3DTileStyle} style The style.
*
* @private
*/
Cesium3DTileContent.prototype.applyStyle = function(frameState, style) {
Cesium3DTileContent.prototype.applyStyle = function(style) {
DeveloperError.throwInstantiationError();
};

Expand Down
2 changes: 1 addition & 1 deletion Source/Scene/Cesium3DTileStyleEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ define([
// 2) this tile is now visible, but it wasn't visible when the style was first assigned
var content = tile.content;
tile.lastStyleTime = lastStyleTime;
content.applyStyle(frameState, this._style);
content.applyStyle(this._style);
statistics.numberOfFeaturesStyled += content.featuresLength;
++statistics.numberOfTilesStyled;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/Composite3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ define([
}
};

Composite3DTileContent.prototype.applyStyle = function(frameState, style) {
Composite3DTileContent.prototype.applyStyle = function(style) {
var contents = this._contents;
var length = contents.length;
for (var i = 0; i < length; ++i) {
contents[i].applyStyle(frameState, style);
contents[i].applyStyle(style);
}
};

Expand Down
2 changes: 1 addition & 1 deletion Source/Scene/Empty3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ define([
Empty3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
};

Empty3DTileContent.prototype.applyStyle = function(frameState, style) {
Empty3DTileContent.prototype.applyStyle = function(style) {
};

Empty3DTileContent.prototype.update = function(tileset, frameState) {
Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/Geometry3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,10 @@ define([
}
};

Geometry3DTileContent.prototype.applyStyle = function(frameState, style) {
Geometry3DTileContent.prototype.applyStyle = function(style) {
createFeatures(this);
if (defined(this._geometries)) {
this._geometries.applyStyle(frameState, style, this._features);
this._geometries.applyStyle(style, this._features);
}
};

Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/Instanced3DModel3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@ define([
this._batchTable.setAllColor(color);
};

Instanced3DModel3DTileContent.prototype.applyStyle = function(frameState, style) {
this._batchTable.applyStyle(frameState, style);
Instanced3DModel3DTileContent.prototype.applyStyle = function(style) {
this._batchTable.applyStyle(style);
};

Instanced3DModel3DTileContent.prototype.update = function(tileset, frameState) {
Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/PointCloud3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ define([
this._pointCloud.color = enabled ? color : Color.WHITE;
};

PointCloud3DTileContent.prototype.applyStyle = function(frameState, style) {
PointCloud3DTileContent.prototype.applyStyle = function(style) {
if (defined(this._batchTable)) {
this._batchTable.applyStyle(frameState, style);
this._batchTable.applyStyle(style);
} else {
this._styleDirty = true;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Scene/Tileset3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ define([
Tileset3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
};

Tileset3DTileContent.prototype.applyStyle = function(frameState, style) {
Tileset3DTileContent.prototype.applyStyle = function(style) {
};

Tileset3DTileContent.prototype.update = function(tileset, frameState) {
Expand Down
8 changes: 4 additions & 4 deletions Source/Scene/Vector3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,16 +494,16 @@ define([
}
};

Vector3DTileContent.prototype.applyStyle = function(frameState, style) {
Vector3DTileContent.prototype.applyStyle = function(style) {
createFeatures(this);
if (defined(this._polygons)) {
this._polygons.applyStyle(frameState, style, this._features);
this._polygons.applyStyle(style, this._features);
}
if (defined(this._polylines)) {
this._polylines.applyStyle(frameState, style, this._features);
this._polylines.applyStyle(style, this._features);
}
if (defined(this._points)) {
this._points.applyStyle(frameState, style, this._features);
this._points.applyStyle(style, this._features);
}
};

Expand Down
5 changes: 2 additions & 3 deletions Source/Scene/Vector3DTileGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,11 @@ define([
/**
* Apply a style to the content.
*
* @param {FrameState} frameState The frame state.
* @param {Cesium3DTileStyle} style The style.
* @param {Cesium3DTileFeature[]} features The array of features.
*/
Vector3DTileGeometry.prototype.applyStyle = function(frameState, style, features) {
this._primitive.applyStyle(frameState, style, features);
Vector3DTileGeometry.prototype.applyStyle = function(style, features) {
this._primitive.applyStyle(style, features);
};

/**
Expand Down
3 changes: 1 addition & 2 deletions Source/Scene/Vector3DTilePoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,10 @@ define([
/**
* Apply a style to the content.
*
* @param {FrameState} frameState The frame state.
* @param {Cesium3DTileStyle} style The style.
* @param {Cesium3DTileFeature[]} features The array of features.
*/
Vector3DTilePoints.prototype.applyStyle = function(frameState, style, features) {
Vector3DTilePoints.prototype.applyStyle = function(style, features) {
if (!defined(style)) {
clearStyle(this, features);
return;
Expand Down
5 changes: 2 additions & 3 deletions Source/Scene/Vector3DTilePolygons.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,11 @@ define([
/**
* Apply a style to the content.
*
* @param {FrameState} frameState The frame state.
* @param {Cesium3DTileStyle} style The style.
* @param {Cesium3DTileFeature[]} features The array of features.
*/
Vector3DTilePolygons.prototype.applyStyle = function(frameState, style, features) {
this._primitive.applyStyle(frameState, style, features);
Vector3DTilePolygons.prototype.applyStyle = function(style, features) {
this._primitive.applyStyle(style, features);
};

/**
Expand Down
3 changes: 1 addition & 2 deletions Source/Scene/Vector3DTilePolylines.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,10 @@ define([
/**
* Apply a style to the content.
*
* @param {FrameState} frameState The frame state.
* @param {Cesium3DTileStyle} style The style.
* @param {Cesium3DTileFeature[]} features The array of features.
*/
Vector3DTilePolylines.prototype.applyStyle = function(frameState, style, features) {
Vector3DTilePolylines.prototype.applyStyle = function(style, features) {
if (!defined(style)) {
clearStyle(this, features);
return;
Expand Down
3 changes: 1 addition & 2 deletions Source/Scene/Vector3DTilePrimitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -929,11 +929,10 @@ define([
/**
* Apply a style to the content.
*
* @param {FrameState} frameState The frame state.
* @param {Cesium3DTileStyle} style The style.
* @param {Cesium3DTileFeature[]} features The array of features.
*/
Vector3DTilePrimitive.prototype.applyStyle = function(frameState, style, features) {
Vector3DTilePrimitive.prototype.applyStyle = function(style, features) {
if (!defined(style)) {
clearStyle(this, features);
return;
Expand Down
12 changes: 6 additions & 6 deletions Specs/Scene/Vector3DTilePointsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ defineSuite([
return loadPoints(points).then(function() {
var features = [];
points.createFeatures(mockTileset, features);
points.applyStyle(scene.frameState, undefined, features);
points.applyStyle(undefined, features);

scene.camera.lookAt(Cartesian3.fromDegrees(0.0, 0.0, 10.0), new Cartesian3(0.0, 0.0, 50.0));
expect(scene).toRender([255, 255, 255, 255]);
Expand Down Expand Up @@ -188,7 +188,7 @@ defineSuite([
return loadPoints(points).then(function() {
var features = [];
points.createFeatures(mockTileset, features);
points.applyStyle(scene.frameState, style, features);
points.applyStyle(style, features);

for (var i = 0; i < cartoPositions.length; ++i) {
var position = ellipsoid.cartographicToCartesian(cartoPositions[i]);
Expand Down Expand Up @@ -224,7 +224,7 @@ defineSuite([

var features = [];
points.createFeatures(mockTileset, features);
points.applyStyle(scene.frameState, undefined, features);
points.applyStyle(undefined, features);

var getFeature = mockTileset.getFeature;
mockTileset.getFeature = function(index) {
Expand Down Expand Up @@ -297,7 +297,7 @@ defineSuite([
return loadPoints(points).then(function() {
var features = [];
points.createFeatures(mockTileset, features);
points.applyStyle(scene.frameState, style, features);
points.applyStyle(style, features);

var i;
for (i = 0; i < features.length; ++i) {
Expand Down Expand Up @@ -367,7 +367,7 @@ defineSuite([
return loadPoints(points).then(function() {
var features = [];
points.createFeatures(mockTileset, features);
points.applyStyle(scene.frameState, style, features);
points.applyStyle(style, features);

var collection = points._billboardCollection;
expect(collection.length).toEqual(1);
Expand Down Expand Up @@ -413,7 +413,7 @@ defineSuite([
return loadPoints(points).then(function() {
var features = [];
points.createFeatures(mockTileset, features);
points.applyStyle(scene.frameState, style, features);
points.applyStyle(style, features);
points.applyDebugSettings(true, Color.YELLOW);

var i;
Expand Down

0 comments on commit cfb77a4

Please sign in to comment.