Updated demos to use DALi clang-format
[platform/core/uifw/dali-demo.git] / examples / rendering-basic-pbr / model-skybox.h
1 #ifndef DALI_DEMO_MODELSKYBOX_H
2 #define DALI_DEMO_MODELSKYBOX_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 // EXTERNAL INCLUDES
22 #include <dali/public-api/actors/actor.h>
23 #include <dali/public-api/rendering/renderer.h>
24
25 using namespace Dali;
26
27 class ModelSkybox
28 {
29 public:
30   /**
31    * @brief Constructor.
32    * Does nothing.
33    */
34   ModelSkybox();
35
36   /**
37    * @brief Destructor
38    * Does nothing.
39    */
40   ~ModelSkybox();
41
42   /**
43    * @brief Initializes an Actor for the Physically Based Rendering.
44    *
45    * @note Call InitTexture() before calling this method.
46    *
47    * It creates a geometry for the renderer.
48    * According to the parameter @p modelType it may create a @e quad, a @e sphere or load a model.
49    * If @p modelType is @e MODEL, the @p modelUrl parameter needs to be set with a valid url pointing a file with a @e obj model.
50    *
51    * A renderer is created with the geometry and the shader and it's set to the an actor that can be retrieved by calling GetActor().
52    * The @p position and @p size is set to the actor.
53    *
54    * @param[in] shader The Physically Based Rendering shader.
55    * @param[in] modelType The type of geometry.
56    * @param[in] modelUrl The url of the model if the paramterer @p modelType is @e MODEL.
57    * @param[in] position The position of the actor.
58    * @param[in] size The size of the actor.
59    */
60   void Init(const Vector3& size);
61
62   /**
63    * @brief Initializes the @p mTextureSet member with the needed textures for Physically Based Rendering.
64    *
65    * @param[in] albedoMetalTexture The albedo metal texture.
66    * @param[in] normalRoughTexture The normal rough texture.
67    * @param[in] diffuseTexture The diffuse texture.
68    * @param[in] specularTexture The specular texture.
69    */
70   void InitTexture(Texture texSkybox);
71
72   /**
73    * @brief Retrieves the actor created by calling the Init() method.
74    *
75    * @return The Actor for the Physically Based Rendering.
76    */
77   Actor& GetActor();
78
79 private:
80   /**
81    * @brief Creates a geometry from a @e obj model.
82    *
83    * @param[in] url A url pointing a file with a @e obj model.
84    *
85    * @return The geometry.
86    */
87   Geometry CreateGeometry();
88
89   Actor      mActor;
90   TextureSet mTextureSet;
91 };
92
93 #endif // DALI_DEMO_MODELSKYBOX_H