From 9f49a45af25b8f71dd95ec5a0ac449e6a1878c48 Mon Sep 17 00:00:00 2001 From: janeyx99 Date: Fri, 3 Aug 2018 15:59:23 -0400 Subject: [PATCH] more removal of frameState --- .../gallery/3D Tiles Interactivity.html | 2 +- Source/Scene/Cesium3DTileBatchTable.js | 4 +- Source/Scene/Vector3DTilePoints.js | 52 +++++++++---------- Source/Scene/Vector3DTilePolylines.js | 4 +- Source/Scene/Vector3DTilePrimitive.js | 4 +- Specs/Scene/Cesium3DTilesetSpec.js | 4 +- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Apps/Sandcastle/gallery/3D Tiles Interactivity.html b/Apps/Sandcastle/gallery/3D Tiles Interactivity.html index 90277d6b5669..901dc56a001f 100644 --- a/Apps/Sandcastle/gallery/3D Tiles Interactivity.html +++ b/Apps/Sandcastle/gallery/3D Tiles Interactivity.html @@ -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) { diff --git a/Source/Scene/Cesium3DTileBatchTable.js b/Source/Scene/Cesium3DTileBatchTable.js index 9750aaada61d..e97679988df1 100644 --- a/Source/Scene/Cesium3DTileBatchTable.js +++ b/Source/Scene/Cesium3DTileBatchTable.js @@ -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); } diff --git a/Source/Scene/Vector3DTilePoints.js b/Source/Scene/Vector3DTilePoints.js index 9a3e2938ad57..a6677ac97faa 100644 --- a/Source/Scene/Vector3DTilePoints.js +++ b/Source/Scene/Vector3DTilePoints.js @@ -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; @@ -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; @@ -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; @@ -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); } } }; diff --git a/Source/Scene/Vector3DTilePolylines.js b/Source/Scene/Vector3DTilePolylines.js index cd4f4f72a36b..88d416aaae72 100644 --- a/Source/Scene/Vector3DTilePolylines.js +++ b/Source/Scene/Vector3DTilePolylines.js @@ -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; } }; diff --git a/Source/Scene/Vector3DTilePrimitive.js b/Source/Scene/Vector3DTilePrimitive.js index 7ee1aa55150b..d79b6b1fd788 100644 --- a/Source/Scene/Vector3DTilePrimitive.js +++ b/Source/Scene/Vector3DTilePrimitive.js @@ -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) { diff --git a/Specs/Scene/Cesium3DTilesetSpec.js b/Specs/Scene/Cesium3DTilesetSpec.js index 6965e41a5301..b3b212c829d5 100644 --- a/Specs/Scene/Cesium3DTilesetSpec.js +++ b/Specs/Scene/Cesium3DTilesetSpec.js @@ -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); } };