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