Skip to content

Commit

Permalink
more removal of frameState
Browse files Browse the repository at this point in the history
  • Loading branch information
janeyx99 committed Aug 13, 2018
1 parent a8345ca commit 9f49a45
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/3D Tiles Interactivity.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
}

// Evaluate feature description
console.log('Description : ' + tileset.style.meta.description.evaluate(scene.frameState, feature));
console.log('Description : ' + tileset.style.meta.description.evaluate(feature));
}

function zoom(movement, feature) {
Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/Cesium3DTileBatchTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,8 @@ define([
var length = this.featuresLength;
for (var i = 0; i < length; ++i) {
var feature = content.getFeature(i);
var color = defined(style.color) ? style.color.evaluateColor(frameState, feature, scratchColor) : DEFAULT_COLOR_VALUE;
var show = defined(style.show) ? style.show.evaluate(frameState, feature) : DEFAULT_SHOW_VALUE;
var color = defined(style.color) ? style.color.evaluateColor(feature, scratchColor) : DEFAULT_COLOR_VALUE;
var show = defined(style.show) ? style.show.evaluate(feature) : DEFAULT_SHOW_VALUE;
this.setColor(i, color);
this.setShow(i, show);
}
Expand Down
52 changes: 26 additions & 26 deletions Source/Scene/Vector3DTilePoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,65 +326,65 @@ define([
var feature = features[batchId];

if (defined(style.show)) {
feature.show = style.show.evaluate(frameState, feature);
feature.show = style.show.evaluate(feature);
}

if (defined(style.pointSize)) {
feature.pointSize = style.pointSize.evaluate(frameState, feature);
feature.pointSize = style.pointSize.evaluate(feature);
}

if (defined(style.color)) {
feature.color = style.color.evaluateColor(frameState, feature, scratchColor);
feature.color = style.color.evaluateColor(feature, scratchColor);
}

if (defined(style.pointOutlineColor)) {
feature.pointOutlineColor = style.pointOutlineColor.evaluateColor(frameState, feature, scratchColor2);
feature.pointOutlineColor = style.pointOutlineColor.evaluateColor(feature, scratchColor2);
}

if (defined(style.pointOutlineWidth)) {
feature.pointOutlineWidth = style.pointOutlineWidth.evaluate(frameState, feature);
feature.pointOutlineWidth = style.pointOutlineWidth.evaluate(feature);
}

if (defined(style.labelColor)) {
feature.labelColor = style.labelColor.evaluateColor(frameState, feature, scratchColor3);
feature.labelColor = style.labelColor.evaluateColor(feature, scratchColor3);
}

if (defined(style.labelOutlineColor)) {
feature.labelOutlineColor = style.labelOutlineColor.evaluateColor(frameState, feature, scratchColor4);
feature.labelOutlineColor = style.labelOutlineColor.evaluateColor(feature, scratchColor4);
}

if (defined(style.labelOutlineWidth)) {
feature.labelOutlineWidth = style.labelOutlineWidth.evaluate(frameState, feature);
feature.labelOutlineWidth = style.labelOutlineWidth.evaluate(feature);
}

if (defined(style.font)) {
feature.font = style.font.evaluate(frameState, feature);
feature.font = style.font.evaluate(feature);
}

if (defined(style.labelStyle)) {
feature.labelStyle = style.labelStyle.evaluate(frameState, feature);
feature.labelStyle = style.labelStyle.evaluate(feature);
}

if (defined(style.labelText)) {
feature.labelText = style.labelText.evaluate(frameState, feature);
feature.labelText = style.labelText.evaluate(feature);
} else {
feature.labelText = undefined;
}

if (defined(style.backgroundColor)) {
feature.backgroundColor = style.backgroundColor.evaluateColor(frameState, feature, scratchColor5);
feature.backgroundColor = style.backgroundColor.evaluateColor(feature, scratchColor5);
}

if (defined(style.backgroundPadding)) {
feature.backgroundPadding = style.backgroundPadding.evaluate(frameState, feature);
feature.backgroundPadding = style.backgroundPadding.evaluate(feature);
}

if (defined(style.backgroundEnabled)) {
feature.backgroundEnabled = style.backgroundEnabled.evaluate(frameState, feature);
feature.backgroundEnabled = style.backgroundEnabled.evaluate(feature);
}

if (defined(style.scaleByDistance)) {
var scaleByDistanceCart4 = style.scaleByDistance.evaluate(frameState, feature);
var scaleByDistanceCart4 = style.scaleByDistance.evaluate(feature);
scratchScaleByDistance.near = scaleByDistanceCart4.x;
scratchScaleByDistance.nearValue = scaleByDistanceCart4.y;
scratchScaleByDistance.far = scaleByDistanceCart4.z;
Expand All @@ -395,7 +395,7 @@ define([
}

if (defined(style.translucencyByDistance)) {
var translucencyByDistanceCart4 = style.translucencyByDistance.evaluate(frameState, feature);
var translucencyByDistanceCart4 = style.translucencyByDistance.evaluate(feature);
scratchTranslucencyByDistance.near = translucencyByDistanceCart4.x;
scratchTranslucencyByDistance.nearValue = translucencyByDistanceCart4.y;
scratchTranslucencyByDistance.far = translucencyByDistanceCart4.z;
Expand All @@ -406,7 +406,7 @@ define([
}

if (defined(style.distanceDisplayCondition)) {
var distanceDisplayConditionCart2 = style.distanceDisplayCondition.evaluate(frameState, feature);
var distanceDisplayConditionCart2 = style.distanceDisplayCondition.evaluate(feature);
scratchDistanceDisplayCondition.near = distanceDisplayConditionCart2.x;
scratchDistanceDisplayCondition.far = distanceDisplayConditionCart2.y;
feature.distanceDisplayCondition = scratchDistanceDisplayCondition;
Expand All @@ -415,41 +415,41 @@ define([
}

if (defined(style.heightOffset)) {
feature.heightOffset = style.heightOffset.evaluate(frameState, feature);
feature.heightOffset = style.heightOffset.evaluate(feature);
}

if (defined(style.anchorLineEnabled)) {
feature.anchorLineEnabled = style.anchorLineEnabled.evaluate(frameState, feature);
feature.anchorLineEnabled = style.anchorLineEnabled.evaluate(feature);
}

if (defined(style.anchorLineColor)) {
feature.anchorLineColor = style.anchorLineColor.evaluateColor(frameState, feature, scratchColor6);
feature.anchorLineColor = style.anchorLineColor.evaluateColor(feature, scratchColor6);
}

if (defined(style.image)) {
feature.image = style.image.evaluate(frameState, feature);
feature.image = style.image.evaluate(feature);
} else {
feature.image = undefined;
}

if (defined(style.disableDepthTestDistance)) {
feature.disableDepthTestDistance = style.disableDepthTestDistance.evaluate(frameState, feature);
feature.disableDepthTestDistance = style.disableDepthTestDistance.evaluate(feature);
}

if (defined(style.horizontalOrigin)) {
feature.horizontalOrigin = style.horizontalOrigin.evaluate(frameState, feature);
feature.horizontalOrigin = style.horizontalOrigin.evaluate(feature);
}

if (defined(style.verticalOrigin)) {
feature.verticalOrigin = style.verticalOrigin.evaluate(frameState, feature);
feature.verticalOrigin = style.verticalOrigin.evaluate(feature);
}

if (defined(style.labelHorizontalOrigin)) {
feature.labelHorizontalOrigin = style.labelHorizontalOrigin.evaluate(frameState, feature);
feature.labelHorizontalOrigin = style.labelHorizontalOrigin.evaluate(feature);
}

if (defined(style.labelVerticalOrigin)) {
feature.labelVerticalOrigin = style.labelVerticalOrigin.evaluate(frameState, feature);
feature.labelVerticalOrigin = style.labelVerticalOrigin.evaluate(feature);
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/Vector3DTilePolylines.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ define([
var batchId = batchIds[i];
var feature = features[batchId];

feature.color = defined(style.color) ? style.color.evaluateColor(frameState, feature, scratchColor) : DEFAULT_COLOR_VALUE;
feature.show = defined(style.show) ? style.show.evaluate(frameState, feature) : DEFAULT_SHOW_VALUE;
feature.color = defined(style.color) ? style.color.evaluateColor(feature, scratchColor) : DEFAULT_COLOR_VALUE;
feature.show = defined(style.show) ? style.show.evaluate(feature) : DEFAULT_SHOW_VALUE;
}
};

Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/Vector3DTilePrimitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,8 @@ define([
var batchId = batchIds[i];
var feature = features[batchId];

feature.color = defined(style.color) ? style.color.evaluateColor(frameState, feature, scratchColor) : DEFAULT_COLOR_VALUE;
feature.show = defined(style.show) ? style.show.evaluate(frameState, feature) : DEFAULT_SHOW_VALUE;
feature.color = defined(style.color) ? style.color.evaluateColor(feature, scratchColor) : DEFAULT_COLOR_VALUE;
feature.show = defined(style.show) ? style.show.evaluate(feature) : DEFAULT_SHOW_VALUE;
}

if (isSimpleStyle) {
Expand Down
4 changes: 2 additions & 2 deletions Specs/Scene/Cesium3DTilesetSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2016,13 +2016,13 @@ defineSuite([
it('applies custom style to a tileset', function() {
var style = new Cesium3DTileStyle();
style.show = {
evaluate : function(frameState, feature) {
evaluate : function(feature) {
return this._value;
},
_value : false
};
style.color = {
evaluateColor : function(frameState, feature, result) {
evaluateColor : function(feature, result) {
return Color.clone(Color.WHITE, result);
}
};
Expand Down

0 comments on commit 9f49a45

Please sign in to comment.