1 #ifndef DALI_INTERNAL_SCENE_GRAPH_PROPERTY_CONDITION_STEP_FUNCTIONS_H
2 #define DALI_INTERNAL_SCENE_GRAPH_PROPERTY_CONDITION_STEP_FUNCTIONS_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/internal/update/common/scene-graph-property-notification.h>
23 #include <dali/public-api/object/property-value.h>
30 class PropertyNotification;
35 * Step condition class,
36 * Checks if a Property has stepped a certain amount from the reference point
38 * float => value has stepped arg1 amount from arg0.
39 * Vector2 => 2 dimensional length of vector has stepped arg1 amount from arg0.
40 * Vector3 => 3 dimensional length of vector has stepped arg1 amount from arg0.
41 * Vector4 => 4 dimensional length of vector has stepped arg1 amount from arg0.
42 * Quaternion => sum of rotation angle and axis changes has stepped arg1 amount from arg0
43 * Default => return false.
49 * @return function pointer to the correct condition function, based on
50 * the type of value being examined.
52 static ConditionFunction GetFunction(Property::Type valueType);
55 * @return function pointer to the correct condition function, based on
56 * the type of value being examined.
58 * This function pointer is to compare previous and current components for the swapping case.
60 static ConditionFunction GetCompareFunction(Property::Type valueType);
63 static bool Evaluate(const float propertyValue, PropertyNotification::RawArgumentContainer& arg);
66 * Checks if integer is Outside
67 * @param[in] value The value being examined.
68 * @param[in] arg The supplied arguments for the condition.
69 * @return Condition result (true if condition met, false if not)
71 static bool EvalInteger(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
74 * Checks if float is Outside
75 * @param[in] value The value being examined.
76 * @param[in] arg The supplied arguments for the condition.
77 * @return Condition result (true if condition met, false if not)
79 static bool EvalFloat(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
82 * Checks if Vector2.Length() is Outside
83 * @param[in] value The value being examined.
84 * @param[in] arg The supplied arguments for the condition.
85 * @return Condition result (true if condition met, false if not)
87 static bool EvalVector2(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
90 * Checks if Vector3.Length() is Outside
91 * @param[in] value The value being examined.
92 * @param[in] arg The supplied arguments for the condition.
93 * @return Condition result (true if condition met, false if not)
95 static bool EvalVector3(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
98 * Checks if Vector3.Length() is Outside
100 * If previous Vector3.Lenght() and current are same, the raw datas are checked with comparing these values.
102 * @param[in] value The value being examined.
103 * @param[in] arg The supplied arguments for the condition.
104 * @return Condition result (true if condition met, false if not)
106 static bool EvalAndCompareVector3(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
109 * Checks if Vector4.Length() is Outside
110 * @param[in] value The value being examined.
111 * @param[in] arg The supplied arguments for the condition.
112 * @return Condition result (true if condition met, false if not)
114 static bool EvalVector4(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
117 * Checks if Quaternion is Outside
118 * @param[in] value The value being examined.
119 * @param[in] arg The supplied arguments for the condition.
120 * @return Condition result (true if condition met, false if not)
122 static bool EvalQuaternion(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
125 * Default check for other types.
126 * @param[in] value The value being examined.
127 * @param[in] arg The supplied arguments for the condition.
128 * @return Condition result (true if condition met, false if not)
130 static bool EvalDefault(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
133 } // namespace SceneGraph
135 } // namespace Internal
139 #endif // DALI_INTERNAL_SCENE_GRAPH_PROPERTY_CONDITION_STEP_FUNCTIONS_H