Dali 3D User Interface Engine
constants.h
Go to the documentation of this file.
1 #ifndef __DALI_CONSTANTS_H__
2 #define __DALI_CONSTANTS_H__
3 
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20 
21 // EXTERNAL INCLUDES
22 #include <math.h> // M_PI
23 
24 // INTERNAL INCLUDES
27 
28 namespace Dali
29 {
41 namespace ParentOrigin
42 {
43 extern const Vector3 DEFAULT;
44 static const float TOP = 0.0f;
45 static const float BOTTOM = 1.0f;
46 static const float LEFT = 0.0f;
47 static const float RIGHT = 1.0f;
48 static const float MIDDLE = 0.5f;
49 
50 DALI_IMPORT_API extern const Vector3 TOP_LEFT;
51 DALI_IMPORT_API extern const Vector3 TOP_CENTER;
52 DALI_IMPORT_API extern const Vector3 TOP_RIGHT;
53 DALI_IMPORT_API extern const Vector3 CENTER_LEFT;
54 DALI_IMPORT_API extern const Vector3 CENTER;
56 DALI_IMPORT_API extern const Vector3 BOTTOM_LEFT;
59 
60 }
61 
68 namespace AnchorPoint
69 {
70 static const float TOP = 0.0f;
71 static const float BOTTOM = 1.0f;
72 static const float LEFT = 0.0f;
73 static const float RIGHT = 1.0f;
74 static const float MIDDLE = 0.5f;
75 
76 extern const Vector3 DEFAULT;
77 DALI_IMPORT_API extern const Vector3 TOP_LEFT;
78 DALI_IMPORT_API extern const Vector3 TOP_CENTER;
79 DALI_IMPORT_API extern const Vector3 TOP_RIGHT;
80 DALI_IMPORT_API extern const Vector3 CENTER_LEFT;
81 DALI_IMPORT_API extern const Vector3 CENTER;
83 DALI_IMPORT_API extern const Vector3 BOTTOM_LEFT;
86 
87 }
88 
89 
96 namespace Color
97 {
98 DALI_IMPORT_API extern const Vector4 BLACK;
99 DALI_IMPORT_API extern const Vector4 WHITE;
100 
101 DALI_IMPORT_API extern const Vector4 RED;
102 DALI_IMPORT_API extern const Vector4 GREEN;
103 DALI_IMPORT_API extern const Vector4 BLUE;
104 
105 DALI_IMPORT_API extern const Vector4 YELLOW;
106 DALI_IMPORT_API extern const Vector4 MAGENTA;
107 DALI_IMPORT_API extern const Vector4 CYAN;
108 
109 DALI_IMPORT_API extern const Vector4 TRANSPARENT;
110 
111 } // namespace Color
112 
117 namespace Math
118 {
119 DALI_IMPORT_API extern const float MACHINE_EPSILON_0;
120 DALI_IMPORT_API extern const float MACHINE_EPSILON_1;
121 DALI_IMPORT_API extern const float MACHINE_EPSILON_10;
122 DALI_IMPORT_API extern const float MACHINE_EPSILON_100;
123 DALI_IMPORT_API extern const float MACHINE_EPSILON_1000;
124 DALI_IMPORT_API extern const float MACHINE_EPSILON_10000;
125 
126 // float is preferred to double for performance on ARM targets
127 static const float PI = static_cast<float>(M_PI);
128 static const float PI_2 = static_cast<float>(M_PI_2);
129 static const float PI_4 = static_cast<float>(M_PI_4);
130 static const float PI_OVER_180 = Dali::Math::PI/180.0f;
131 static const float ONE80_OVER_PI = 180.0f/Dali::Math::PI;
132 
133 } // namespace Math
134 
138 } // namespace Dali
139 
140 #endif // __DALI_CONSTANTS_H__
Dali Docs Home
Read more about Dali