Merge "Add deprecated tag and missed doxygen" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / model3d-view / model3d-view.h
1 #ifndef __DALI_TOOLKIT_MODEL3D_VIEW_H__
2 #define __DALI_TOOLKIT_MODEL3D_VIEW_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 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/control.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace Internal DALI_INTERNAL
31 {
32 class Model3dView;
33 }
34 /**
35  * @brief Model3dView is a control for displaying 3d geometry.
36  *
37  * All the geometry loaded with the control is automatically centered and scaled to fit
38  * the size of all the other controls. So the max is (0.5,0.5) and the min is (-0.5,-0.5)
39  *
40  * @SINCE_1_1.4
41  */
42 class DALI_IMPORT_API Model3dView : public Control
43 {
44 public:
45
46   /**
47    * @brief The start and end property ranges for this control.
48    * @SINCE_1_1.4
49    */
50   enum PropertyRange
51   {
52     PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,  ///< @SINCE_1_1.4
53     PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000,              ///< Reserve property indices @SINCE_1_1.4
54
55     ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,                    ///< @SINCE_1_1.4
56     ANIMATABLE_PROPERTY_END_INDEX =   ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000              ///< Reserve animatable property indices @SINCE_1_1.4
57   };
58
59   /**
60    * @brief An enumeration of properties belonging to the TextLabel class.
61    * @SINCE_1_1.4
62    */
63   struct Property
64   {
65     /**
66      * @brief An enumeration of properties belonging to the TextLabel class.
67      * @SINCE_1_1.4
68      */
69     enum
70     {
71       GEOMETRY_URL = PROPERTY_START_INDEX,  ///< name "geometryUrl",       The path to the geometry file,    type STRING @SINCE_1_1.4
72       MATERIAL_URL,                         ///< name "materialUrl",       The path to the material file,    type STRING @SINCE_1_1.4
73       IMAGES_URL,                           ///< name "imagesUrl",         The path to the images directory, type STRING @SINCE_1_1.4
74       ILLUMINATION_TYPE,                    ///< name "illuminationType",  The type of illumination,         type INTEGER @SINCE_1_1.4
75       TEXTURE0_URL,                         ///< name "texture0Url",       The path to first texture,        type STRING @SINCE_1_1.4
76       TEXTURE1_URL,                         ///< name "texture1Url",       The path to second texture,       type STRING @SINCE_1_1.4
77       TEXTURE2_URL,                         ///< name "texture2Url",       The path to third texture,        type STRING @SINCE_1_1.4
78
79       LIGHT_POSITION = ANIMATABLE_PROPERTY_START_INDEX    ///< name "lightPosition",     The coordinates of the light,     type Vector3 @SINCE_1_1.4
80     };
81   };
82
83   enum IlluminationType
84   {
85     DIFFUSE,
86     DIFFUSE_WITH_TEXTURE,
87     DIFFUSE_WITH_NORMAL_MAP
88   };
89
90   /**
91    * @brief Create a new instance of a Model3dView control.
92    *
93    * @SINCE_1_1.4
94    * @return A handle to the new Model3dView control.
95    */
96   static Model3dView New();
97
98   /**
99    * @brief Create a new instance of a Model3dView control.
100    *
101    * @SINCE_1_1.4
102    * @param[in] objUrl The path to the geometry file
103    * @param[in] mtlUrl The path to the material file
104    * @param[in] imagesUrl The path to the images directory
105    * @return A handle to the new Model3dView control.
106    */
107   static Model3dView New( const std::string& objUrl, const std::string& mtlUrl, const std::string& imagesUrl );
108
109
110   /**
111    * @brief Create an uninitialized Model3dView
112    *
113    * Only derived versions can be instantiated.  Calling member
114    * functions with an uninitialized Dali::Object is not allowed.
115    * @SINCE_1_1.4
116    */
117   Model3dView();
118
119   /**
120    * @brief Destructor
121    *
122    * This is non-virtual since derived Handle types must not contain data or virtual methods.
123    * @SINCE_1_1.4
124    */
125   ~Model3dView();
126
127   /**
128    * @brief Copy constructor.
129    * @SINCE_1_1.4
130    * @param[in] model3dView Handle to an object
131    */
132   Model3dView( const Model3dView& model3dView );
133
134   /**
135    * @brief Assignment operator.
136    * @SINCE_1_1.4
137    * @param[in] model3dView Handle to an object
138    * @return reference to this
139    */
140   Model3dView& operator=( const Model3dView& model3dView );
141
142   /**
143    * @brief Downcast an Object handle to Model3dView.
144    *
145    * If handle points to a Model3dView the downcast produces valid
146    * handle. If not the returned handle is left uninitialized.
147    *
148    * @SINCE_1_1.4
149    * @param[in] handle Handle to an object
150    * @return handle to a Model3dView or an uninitialized handle
151    */
152   static Model3dView DownCast( BaseHandle handle );
153
154 public: // Not intended for application developers
155
156   /// @cond internal
157   /**
158    * @brief Creates a handle using the Toolkit::Internal implementation.
159    *
160    * @SINCE_1_1.4
161    * @param[in]  implementation  The Control implementation.
162    */
163   DALI_INTERNAL Model3dView( Internal::Model3dView& implementation );
164
165   /**
166    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
167    *
168    * @SINCE_1_1.4
169    * @param[in]  internal  A pointer to the internal CustomActor.
170    */
171   DALI_INTERNAL Model3dView( Dali::Internal::CustomActor* internal );
172   /// @endcond
173
174 };
175
176 } // namespace Toolkit
177
178 } // namespace Dali
179
180 #endif // __DALI_TOOLKIT_MODEL3D_VIEW_H__