Skip to content

Commit

Permalink
Removed frameState parameter in evaluate and evaluateColor in all files
Browse files Browse the repository at this point in the history
  • Loading branch information
janeyx99 committed Aug 6, 2018
1 parent 1cddb6f commit a8345ca
Show file tree
Hide file tree
Showing 10 changed files with 816 additions and 831 deletions.
2 changes: 1 addition & 1 deletion Source/Scene/Cesium3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ define([
* not part of the public Cesium API.
* </p>
*
* @param {FrameSate} frameState The frame state.
* @param {FrameState} frameState The frame state.
* @param {Cesium3DTileStyle} style The style.
*
* @private
Expand Down
56 changes: 28 additions & 28 deletions Source/Scene/Cesium3DTileStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ define([
* var style = new Cesium3DTileStyle({
* show : '(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)'
* });
* style.show.evaluate(frameState, feature); // returns true or false depending on the feature's properties
* style.show.evaluate(feature); // returns true or false depending on the feature's properties
*
* @example
* var style = new Cesium.Cesium3DTileStyle();
* // Override show expression with a custom function
* style.show = {
* evaluate : function(frameState, feature) {
* evaluate : function(feature) {
* return true;
* }
* };
Expand Down Expand Up @@ -319,13 +319,13 @@ define([
* var style = new Cesium3DTileStyle({
* color : '(${Temperature} > 90) ? color("red") : color("white")'
* });
* style.color.evaluateColor(frameState, feature, result); // returns a Cesium.Color object
* style.color.evaluateColor(feature, result); // returns a Cesium.Color object
*
* @example
* var style = new Cesium.Cesium3DTileStyle();
* // Override color expression with a custom function
* style.color = {
* evaluateColor : function(frameState, feature, result) {
* evaluateColor : function(feature, result) {
* return Cesium.Color.clone(Cesium.Color.WHITE, result);
* }
* };
Expand Down Expand Up @@ -381,13 +381,13 @@ define([
* var style = new Cesium3DTileStyle({
* pointSize : '(${Temperature} > 90) ? 2.0 : 1.0'
* });
* style.pointSize.evaluate(frameState, feature); // returns a Number
* style.pointSize.evaluate(feature); // returns a Number
*
* @example
* var style = new Cesium.Cesium3DTileStyle();
* // Override pointSize expression with a custom function
* style.pointSize = {
* evaluate : function(frameState, feature) {
* evaluate : function(feature) {
* return 1.0;
* }
* };
Expand Down Expand Up @@ -690,13 +690,13 @@ define([
* var style = new Cesium3DTileStyle({
* font : '(${Temperature} > 90) ? "30px Helvetica" : "24px Helvetica"'
* });
* style.font.evaluate(frameState, feature); // returns a String
* style.font.evaluate(feature); // returns a String
*
* @example
* var style = new Cesium.Cesium3DTileStyle();
* // Override font expression with a custom function
* style.font = {
* evaluate : function(frameState, feature) {
* evaluate : function(feature) {
* return '24px Helvetica';
* }
* };
Expand Down Expand Up @@ -738,13 +738,13 @@ define([
* var style = new Cesium3DTileStyle({
* labelStyle : '(${Temperature} > 90) ? ' + LabelStyle.FILL_AND_OUTLINE + ' : ' + LabelStyle.FILL
* });
* style.labelStyle.evaluate(frameState, feature); // returns a LabelStyle
* style.labelStyle.evaluate(feature); // returns a LabelStyle
*
* @example
* var style = new Cesium.Cesium3DTileStyle();
* // Override labelStyle expression with a custom function
* style.labelStyle = {
* evaluate : function(frameState, feature) {
* evaluate : function(feature) {
* return LabelStyle.FILL;
* }
* };
Expand Down Expand Up @@ -786,13 +786,13 @@ define([
* var style = new Cesium3DTileStyle({
* labelText : '(${Temperature} > 90) ? ">90" : "<=90"'
* });
* style.labelText.evaluate(frameState, feature); // returns a String
* style.labelText.evaluate(feature); // returns a String
*
* @example
* var style = new Cesium.Cesium3DTileStyle();
* // Override labelText expression with a custom function
* style.labelText = {
* evaluate : function(frameState, feature) {
* evaluate : function(feature) {
* return 'Example label text';
* }
* };
Expand Down Expand Up @@ -882,7 +882,7 @@ define([
* var style = new Cesium.Cesium3DTileStyle();
* // Override backgroundPadding expression with a string
* style.backgroundPadding = 'vec2(5.0, 7.0)';
* style.backgroundPadding.evaluate(frameState, feature); // returns a Cartesian2
* style.backgroundPadding.evaluate(feature); // returns a Cartesian2
*/
backgroundPadding : {
get : function() {
Expand Down Expand Up @@ -969,7 +969,7 @@ define([
* var style = new Cesium.Cesium3DTileStyle();
* // Override scaleByDistance expression with a string
* style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)';
* style.scaleByDistance.evaluate(frameState, feature); // returns a Cartesian4
* style.scaleByDistance.evaluate(feature); // returns a Cartesian4
*/
scaleByDistance : {
get : function() {
Expand Down Expand Up @@ -1008,7 +1008,7 @@ define([
* var style = new Cesium.Cesium3DTileStyle();
* // Override translucencyByDistance expression with a string
* style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)';
* style.translucencyByDistance.evaluate(frameState, feature); // returns a Cartesian4
* style.translucencyByDistance.evaluate(feature); // returns a Cartesian4
*/
translucencyByDistance : {
get : function() {
Expand Down Expand Up @@ -1047,7 +1047,7 @@ define([
* var style = new Cesium.Cesium3DTileStyle();
* // Override distanceDisplayCondition expression with a string
* style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)';
* style.distanceDisplayCondition.evaluate(frameState, feature); // returns a Cartesian2
* style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2
*/
distanceDisplayCondition : {
get : function() {
Expand Down Expand Up @@ -1230,13 +1230,13 @@ define([
* var style = new Cesium3DTileStyle({
* image : '(${Temperature} > 90) ? "/url/to/image1" : "/url/to/image2"'
* });
* style.image.evaluate(frameState, feature); // returns a String
* style.image.evaluate(feature); // returns a String
*
* @example
* var style = new Cesium.Cesium3DTileStyle();
* // Override image expression with a custom function
* style.image = {
* evaluate : function(frameState, feature) {
* evaluate : function(feature) {
* return '/url/to/image';
* }
* };
Expand Down Expand Up @@ -1278,7 +1278,7 @@ define([
* var style = new Cesium.Cesium3DTileStyle();
* // Override disableDepthTestDistance expression with a string
* style.disableDepthTestDistance = '1000.0';
* style.disableDepthTestDistance.evaluate(frameState, feature); // returns a Number
* style.disableDepthTestDistance.evaluate(feature); // returns a Number
*/
disableDepthTestDistance : {
get : function() {
Expand Down Expand Up @@ -1317,13 +1317,13 @@ define([
* var style = new Cesium3DTileStyle({
* horizontalOrigin : HorizontalOrigin.LEFT
* });
* style.horizontalOrigin.evaluate(frameState, feature); // returns a HorizontalOrigin
* style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
*
* @example
* var style = new Cesium.Cesium3DTileStyle();
* // Override horizontalOrigin expression with a custom function
* style.horizontalOrigin = {
* evaluate : function(frameState, feature) {
* evaluate : function(feature) {
* return HorizontalOrigin.CENTER;
* }
* };
Expand Down Expand Up @@ -1365,13 +1365,13 @@ define([
* var style = new Cesium3DTileStyle({
* verticalOrigin : VerticalOrigin.TOP
* });
* style.verticalOrigin.evaluate(frameState, feature); // returns a VerticalOrigin
* style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin
*
* @example
* var style = new Cesium.Cesium3DTileStyle();
* // Override verticalOrigin expression with a custom function
* style.verticalOrigin = {
* evaluate : function(frameState, feature) {
* evaluate : function(feature) {
* return VerticalOrigin.CENTER;
* }
* };
Expand Down Expand Up @@ -1413,13 +1413,13 @@ define([
* var style = new Cesium3DTileStyle({
* labelHorizontalOrigin : HorizontalOrigin.LEFT
* });
* style.labelHorizontalOrigin.evaluate(frameState, feature); // returns a HorizontalOrigin
* style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
*
* @example
* var style = new Cesium.Cesium3DTileStyle();
* // Override labelHorizontalOrigin expression with a custom function
* style.labelHorizontalOrigin = {
* evaluate : function(frameState, feature) {
* evaluate : function(feature) {
* return HorizontalOrigin.CENTER;
* }
* };
Expand Down Expand Up @@ -1461,13 +1461,13 @@ define([
* var style = new Cesium3DTileStyle({
* labelVerticalOrigin : VerticalOrigin.TOP
* });
* style.labelVerticalOrigin.evaluate(frameState, feature); // returns a VerticalOrigin
* style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin
*
* @example
* var style = new Cesium.Cesium3DTileStyle();
* // Override labelVerticalOrigin expression with a custom function
* style.labelVerticalOrigin = {
* evaluate : function(frameState, feature) {
* evaluate : function(feature) {
* return VerticalOrigin.CENTER;
* }
* };
Expand Down Expand Up @@ -1503,7 +1503,7 @@ define([
* description : '"Building id ${id} has height ${Height}."'
* }
* });
* style.meta.description.evaluate(frameState, feature); // returns a String with the substituted variables
* style.meta.description.evaluate(feature); // returns a String with the substituted variables
*/
meta : {
get : function() {
Expand Down
16 changes: 7 additions & 9 deletions Source/Scene/ConditionsExpression.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ define([
* ['true', 'color("#FFFFFF")']
* ]
* });
* expression.evaluateColor(frameState, feature, result); // returns a Cesium.Color object
* expression.evaluateColor(feature, result); // returns a Cesium.Color object
*/
function ConditionsExpression(conditionsExpression, defines) {
this._conditionsExpression = clone(conditionsExpression, true);
Expand Down Expand Up @@ -96,21 +96,20 @@ define([
* a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
* a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
*
* @param {FrameState} frameState The frame state.
* @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.
* @param {Object} [result] The object onto which to store the result.
* @returns {Boolean|Number|String|RegExp|Cartesian2|Cartesian3|Cartesian4|Color} The result of evaluating the expression.
*/
ConditionsExpression.prototype.evaluate = function(frameState, feature, result) {
ConditionsExpression.prototype.evaluate = function(feature, result) {
var conditions = this._runtimeConditions;
if (!defined(conditions)) {
return undefined;
}
var length = conditions.length;
for (var i = 0; i < length; ++i) {
var statement = conditions[i];
if (statement.condition.evaluate(frameState, feature)) {
return statement.expression.evaluate(frameState, feature, result);
if (statement.condition.evaluate(feature)) {
return statement.expression.evaluate(feature, result);
}
}
};
Expand All @@ -120,21 +119,20 @@ define([
* <p>
* This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object.
* </p>
* @param {FrameState} frameState The frame state.
* @param {Cesium3DTileFeature} feature The feature whose properties may be used as variables in the expression.
* @param {Color} [result] The object in which to store the result
* @returns {Color} The modified result parameter or a new Color instance if one was not provided.
*/
ConditionsExpression.prototype.evaluateColor = function(frameState, feature, result) {
ConditionsExpression.prototype.evaluateColor = function(feature, result) {
var conditions = this._runtimeConditions;
if (!defined(conditions)) {
return undefined;
}
var length = conditions.length;
for (var i = 0; i < length; ++i) {
var statement = conditions[i];
if (statement.condition.evaluate(frameState, feature)) {
return statement.expression.evaluateColor(frameState, feature, result);
if (statement.condition.evaluate(feature)) {
return statement.expression.evaluateColor(feature, result);
}
}
};
Expand Down
Loading

0 comments on commit a8345ca

Please sign in to comment.