Merge "Updated @since tags for APIs added since 1.2.0 that are required for Tizen...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / visuals / primitive-visual-properties.h
1 #ifndef DALI_TOOLKIT_PRIMITIVE_VISUAL_PROPERTIES_H
2 #define DALI_TOOLKIT_PRIMITIVE_VISUAL_PROPERTIES_H
3
4 /*
5  * Copyright (c) 2016 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 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/visuals/visual-properties.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace PrimitiveVisual
31 {
32
33 namespace Property
34 {
35
36 enum
37 {
38   /**
39    * @brief The specific shape to render.
40    * @details Name "shape", type Shape::Type (Property::INTEGER) or Property::STRING.
41    * @SINCE_1_1.45
42    * @note Optional. If not specified, the default is Shape::SPHERE.
43    * @see Shape::Type
44    */
45   SHAPE = VISUAL_PROPERTY_START_INDEX,
46
47   /**
48    * @brief The color of the shape.
49    * @details Name "mixColor", type Property::VECTOR4.
50    * @SINCE_1_2_4
51    * @note Optional. If not specified, the default is Vector4(0.5, 0.5, 0.5, 1.0).
52    * @note Applies to ALL shapes.
53    */
54   MIX_COLOR,
55
56   /**
57    * @brief The number of slices as you go around the shape.
58    * @details Name "slices", type Property::INTEGER.
59    * For spheres and conical frustrums, this determines how many divisions there are as you go around the object.
60    * @SINCE_1_1.45
61    * @note Optional. If not specified, the default is 128.
62    * @note Applies to:
63    *      - Shape::SPHERE
64    *      - Shape::CONICAL_FRUSTRUM
65    *      - Shape::CONE
66    *      - Shape::CYLINDER
67    * @note The range is from 1 to 255.
68    */
69   SLICES,
70
71   /**
72    * @brief The number of stacks as you go down the shape.
73    * @details Name "stacks", type Property::INTEGER.
74    * For spheres, 'stacks' determines how many layers there are as you go down the object.
75    * @SINCE_1_1.45
76    * @note Optional. If not specified, the default is 128.
77    * @note Applies to:
78    *      - Shape::SPHERE
79    * @note The range is from 1 to 255.
80    */
81   STACKS,
82
83   /**
84    * @brief The scale of the radius of the top circle of a conical frustrum.
85    * @details Name "scaleTopRadius", type Property::FLOAT.
86    * @SINCE_1_1.45
87    * @note Optional. If not specified, the default is 1.0f.
88    * @note Applies to:
89    *      - Shape::CONICAL_FRUSTRUM
90    * @note Only values greater than or equal to 0.0f are accepted.
91    */
92   SCALE_TOP_RADIUS,
93
94   /**
95    * @brief The scale of the radius of the bottom circle of a conical frustrum.
96    * @details Name "scaleBottomRadius", type Property::FLOAT.
97    * @SINCE_1_1.45
98    * @note Optional. If not specified, the default is 1.5f.
99    * @note Applies to:
100    *      - Shape::CONICAL_FRUSTRUM
101    *      - Shape::CONE
102    * @note Only values greater than or equal to 0.0f are accepted.
103    */
104   SCALE_BOTTOM_RADIUS,
105
106   /**
107    * @brief The scale of the height of a conic.
108    * @details Name "scaleHeight", type Property::FLOAT.
109    * @SINCE_1_1.45
110    * @note Optional. If not specified, the default is 3.0f.
111    * @note Applies to:
112    *      - Shape::CONICAL_FRUSTRUM
113    *      - Shape::CONE
114    *      - Shape::CYLINDER
115    * @note Only values greater than or equal to 0.0f are accepted.
116    */
117   SCALE_HEIGHT,
118
119   /**
120    * @brief The scale of the radius of a cylinder.
121    * @details Name "scaleRadius", type Property::FLOAT.
122    * @SINCE_1_1.45
123    * @note Optional. If not specified, the default is 1.0f.
124    * @note Applies to:
125    *      - Shape::CYLINDER
126    * @note Only values greater than or equal to 0.0f are accepted.
127    */
128   SCALE_RADIUS,
129
130   /**
131    * @brief The dimensions of a cuboid. Scales in the same fashion as a 9-patch image.
132    * @details Name "scaleDimensions", type Property::VECTOR3.
133    * @SINCE_1_1.45
134    * @note Optional. If not specified, the default is Vector3::ONE.
135    * @note Applies to:
136    *      - Shape::CUBE
137    *      - Shape::OCTAHEDRON
138    *      - Shape::BEVELLED_CUBE
139    * @note Each vector3 parameter should be greater than or equal to 0.0f.
140    */
141   SCALE_DIMENSIONS,
142
143   /**
144    * @brief Determines how bevelled the cuboid should be, based off the smallest dimension.
145    * @details Name "bevelPercentage", type Property::FLOAT.
146    * Bevel percentage ranges from 0.0 to 1.0. It affects the ratio of the outer face widths to the width of the overall cube.
147    * @SINCE_1_1.45
148    * @note Optional. If not specified, the default is 0.0f (no bevel).
149    * @note Applies to:
150    *      - Shape::BEVELLED_CUBE
151    * @note The range is from 0.0f to 1.0f.
152    */
153   BEVEL_PERCENTAGE,
154
155   /**
156    * @brief Defines how smooth the bevelled edges should be.
157    * @details Name "bevelSmoothness", type Property::FLOAT.
158    * @SINCE_1_1.45
159    * @note Optional. If not specified, the default is 0.0f (sharp edges).
160    * @note Applies to:
161    *      - Shape::BEVELLED_CUBE
162    * @note The range is from 0.0f to 1.0f.
163    */
164   BEVEL_SMOOTHNESS,
165
166   /**
167    * @brief The position, in stage space, of the point light that applies lighting to the model.
168    * @details Name "lightPosition", type Property::VECTOR3.
169    * This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
170    * and using all zeroes will place the light at the top left corner.
171    * @SINCE_1_1.45
172    * @note Optional. If not specified, the default is an offset outwards from the center of the screen.
173    * @note Applies to ALL shapes.
174    */
175   LIGHT_POSITION,
176 };
177
178 } // namespace Property
179
180 namespace Shape
181 {
182
183 /**
184  * @brief The primitive shape to render.
185  */
186 enum Type
187 {
188   SPHERE, ///< A perfectly round geometrical object in three-dimensional space. @SINCE_1_1.45
189   CONICAL_FRUSTRUM, ///< The area bound between two circles, i.e. a cone with the tip removed. @SINCE_1_1.45
190   CONE, ///< Equivalent to a conical frustrum with top radius of zero. @SINCE_1_1.45
191   CYLINDER, ///< Equivalent to a conical frustrum with equal radii for the top and bottom circles. @SINCE_1_1.45
192   CUBE, ///< Equivalent to a bevelled cube with a bevel percentage of zero. @SINCE_1_1.45
193   OCTAHEDRON, ///< Equivalent to a bevelled cube with a bevel percentage of one. @SINCE_1_1.45
194   BEVELLED_CUBE, ///< A cube/cuboid with all edges flattened to some degree. @SINCE_1_1.45
195 };
196 }
197
198 } // namespace PrimitiveVisual
199
200 } // namespace Toolkit
201
202 } // namespace Dali
203
204 #endif // DALI_TOOLKIT_PRIMITIVE_VISUAL_PROPERTIES_H