1 #ifndef __DALI_DEGREE_H__
2 #define __DALI_DEGREE_H__
5 * Copyright (c) 2014 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/public-api/common/dali-common.h>
24 namespace Dali DALI_IMPORT_API
30 * @brief An angle in degrees.
32 * This reduces ambiguity when using methods which accept angles in degrees or radians.
34 struct DALI_IMPORT_API Degree
37 * @brief Create an angle in degrees.
39 * @param[in] value The initial value in degrees.
41 explicit Degree( float value );
44 * @brief Create an angle in degrees from an angle in radians.
46 * @param[in] value The initial value in radians.
48 Degree( const Radian& value );
51 * @brief Compare equality between two degrees.
53 * @param[in] rhs Degree to compare to
54 * @return true if the value is identical
56 bool operator==( const Degree& rhs ) const;
59 * @brief Compare inequality between two degrees.
61 * @param[in] rhs Degree to compare to
62 * @return true if the value is not identical
64 bool operator!=( const Degree& rhs ) const;
67 * @brief Compare two degrees.
69 * @param[in] rhs Degree to compare to
70 * @return true if this is less than the value
72 bool operator<( const Degree& rhs ) const;
75 * @brief Assign an angle from a float value.
77 * @param[in] value Float value in degrees
78 * @return a reference to this
80 Degree& operator=( const float value );
83 * @brief Assign an angle in radians to a Degree.
85 * @param[in] rhs Radian to get the value from
86 * @return a reference to this
88 Degree& operator=( const Radian& rhs );
91 * @brief Cast operator to const float reference
93 operator const float&() const;
96 * @brief Cast operator to float reference.
102 float mValue; ///< The value in degrees
105 * @brief Disable the default constructor.
112 #endif // __DALI_DEGREE_H__