#define DALI_TOOLKIT_INTERNAL_SCENE3D_VIEW_H\r
\r
/*\r
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
*/\r
\r
// EXTERNAL INCLUDES\r
-#include <cstring>\r
+#include <dali/devel-api/adaptor-framework/file-loader.h>\r
+#include <dali/devel-api/adaptor-framework/image-loading.h>\r
#include <dali/public-api/object/base-object.h>\r
#include <dali/public-api/rendering/shader.h>\r
-#include <dali/devel-api/adaptor-framework/image-loading.h>\r
-#include <dali/devel-api/adaptor-framework/file-loader.h>\r
+#include <cstring>\r
\r
// INTERNAL INCLUDES\r
-#include <dali-toolkit/public-api/controls/control-impl.h>\r
#include <dali-toolkit/devel-api/controls/scene3d-view/scene3d-view.h>\r
#include <dali-toolkit/internal/controls/scene3d-view/gltf-loader.h>\r
+#include <dali-toolkit/public-api/controls/control-impl.h>\r
\r
namespace Dali\r
{\r
-\r
namespace Toolkit\r
{\r
-\r
class Scene3dView;\r
\r
namespace Internal\r
{\r
-\r
namespace Gltf\r
{\r
-\r
class Loader;\r
\r
}\r
class Scene3dView : public Control\r
{\r
public:\r
-\r
enum CubeType\r
{\r
- CROSS_HORIZONTAL = 0, // Cross horizontal style cube map\r
- ARRAY_HORIZONTAL, // array horizontal style cube map\r
+ CROSS_HORIZONTAL = 0, // Cross horizontal style cube map\r
+ ARRAY_HORIZONTAL, // array horizontal style cube map\r
NONE\r
};\r
\r
-\r
/**\r
* @copydoc Dali::Toolkit::Scene3dView::Scene3dView\r
*/\r
/**\r
* @copydoc Dali::Toolkit::Scene3dView::New( const std::string& filePath )\r
*/\r
- static Dali::Toolkit::Scene3dView New( const std::string& filePath );\r
+ static Dali::Toolkit::Scene3dView New(const std::string& filePath);\r
\r
/**\r
* @copydoc Dali::Toolkit::Scene3dView::New( const std::string& filePath, const std::string& diffuseTexturePath, const std::string& specularTexturePath, Vector4 scaleFactor )\r
*/\r
- static Dali::Toolkit::Scene3dView New( const std::string& filePath, const std::string& diffuseTexturePath, const std::string& specularTexturePath, Vector4 scaleFactor );\r
+ static Dali::Toolkit::Scene3dView New(const std::string& filePath, const std::string& diffuseTexturePath, const std::string& specularTexturePath, Vector4 scaleFactor);\r
\r
/**\r
* @copydoc Dali::Toolkit::Scene3dView::CreateScene()\r
/**\r
* @copydoc Dali::Toolkit::Scene3dView::PlayAnimation()\r
*/\r
- bool PlayAnimation( uint32_t index );\r
+ bool PlayAnimation(uint32_t index);\r
\r
/**\r
* @copydoc Dali::Toolkit::Scene3dView::PlayAnimations()\r
/**\r
* @copydoc Dali::Toolkit::Scene3dView::SetLight( Toolkit::Scene3dView::LightType type, Vector3 lightVector, Vector3 lightColor )\r
*/\r
- bool SetLight( Toolkit::Scene3dView::LightType type, Vector3 lightVector, Vector3 lightColor );\r
+ bool SetLight(Toolkit::Scene3dView::LightType type, Vector3 lightVector, Vector3 lightColor);\r
\r
/**\r
* @brief Set default CameraActor specified in the each scene format specification.\r
* near clipping plane = 0.1,\r
* and camera position = Vector3( 0.0, 0.0, 0.0 ).\r
*/\r
- bool SetDefaultCamera( const Dali::Camera::Type type = Dali::Camera::LOOK_AT_TARGET, const float nearPlane = 0.1, const Vector3 cameraPosition = Vector3( 0.0, 0.0, 0.0 ) );\r
+ bool SetDefaultCamera(const Dali::Camera::Type type = Dali::Camera::LOOK_AT_TARGET, const float nearPlane = 0.1, const Vector3 cameraPosition = Vector3(0.0, 0.0, 0.0));\r
\r
/**\r
* @brief Add CameraActor loaded from scene format file.\r
*/\r
- void AddCamera( CameraActor cameraActor );\r
+ void AddCamera(CameraActor cameraActor);\r
\r
/**\r
* @brief Add Animation loaded from scene format file.\r
*/\r
- void AddAnimation( Animation animation );\r
+ void AddAnimation(Animation animation);\r
\r
/**\r
* @brief Add new Shader.\r
* Actors can share same Shader if they use same properties.\r
* If a property changes in a shader, then the property of all actors that use the shader change.\r
*/\r
- void AddShader( Shader shader );\r
+ void AddShader(Shader shader);\r
\r
/**\r
* @brief Get Root Actor.\r
/**\r
* @copydoc Dali::Toolkit::Scene3dView::GetCamera( uint32_t cameraIndex )\r
*/\r
- CameraActor GetCamera( uint32_t cameraIndex );\r
+ CameraActor GetCamera(uint32_t cameraIndex);\r
\r
/**\r
* @brief Get light type.\r
* @brief Get Cropped image buffer.\r
* For each direction, Offset + faceSize must be width or height or less then them.\r
*/\r
- uint8_t* GetCroppedBuffer( uint8_t* sourceBuffer, uint32_t bytesPerPixel, uint32_t width, uint32_t height, uint32_t xOffset, uint32_t yOffset, uint32_t xFaceSize, uint32_t yFaceSize );\r
+ uint8_t* GetCroppedBuffer(uint8_t* sourceBuffer, uint32_t bytesPerPixel, uint32_t width, uint32_t height, uint32_t xOffset, uint32_t yOffset, uint32_t xFaceSize, uint32_t yFaceSize);\r
\r
/**\r
* @brief Upload cube map texture.\r
*/\r
- void UploadTextureFace( Texture& texture, Devel::PixelBuffer pixelBuffer, uint32_t faceIndex );\r
+ void UploadTextureFace(Texture& texture, Devel::PixelBuffer pixelBuffer, uint32_t faceIndex);\r
\r
/**\r
* @brief Set diffuse and specular cube map textures.\r
*/\r
- void SetCubeMap( const std::string& diffuseTexturePath, const std::string& specularTexturePath, Vector4 scaleFactor = Vector4( 1.0, 1.0, 1.0, 1.0 ) );\r
+ void SetCubeMap(const std::string& diffuseTexturePath, const std::string& specularTexturePath, Vector4 scaleFactor = Vector4(1.0, 1.0, 1.0, 1.0));\r
\r
virtual void OnInitialize();\r
\r
-\r
/**\r
* @brief Load 2D texture.\r
* @param[in] imageUrl Image URL of the texture.\r
* @param[in] generateMipmaps If generateMipmaps is true, then generate mipmap of this texture.\r
* @return Texture loaded from imageUrl.\r
*/\r
- Texture LoadTexture( const char *imageUrl, bool generateMipmaps );\r
+ Texture LoadTexture(const char* imageUrl, bool generateMipmaps);\r
\r
private:\r
- Actor mRoot; // Root actor that contains scene graph\r
+ Actor mRoot; // Root actor that contains scene graph\r
std::string mFilePath; // Full file path of scene file\r
\r
std::vector<Shader> mShaderArray; // Shader Array to change properties of scene such as lighting.\r
\r
std::vector<CameraActor> mCameraActorArray; // CameraActer array loaded from scene format file.\r
- CameraActor mDefaultCamera; // Default CameraActor for the empty mCameraActorArray.\r
+ CameraActor mDefaultCamera; // Default CameraActor for the empty mCameraActorArray.\r
\r
std::vector<Animation> mAnimationArray; // Animation array loaded from scene format file.\r
\r
- Toolkit::Scene3dView::LightType mLightType; // Light type\r
- Vector3 mLightVector; // Light position when mLightType is LightType::POINT_LIGHT\r
- // Light direction when mLightType is LightType::DIRECTIONAL_LIGHT\r
- Vector3 mLightColor; // Light color\r
+ Toolkit::Scene3dView::LightType mLightType; // Light type\r
+ Vector3 mLightVector; // Light position when mLightType is LightType::POINT_LIGHT\r
+ // Light direction when mLightType is LightType::DIRECTIONAL_LIGHT\r
+ Vector3 mLightColor; // Light color\r
\r
- Vector4 mIBLScaleFactor; // IBL scaling factor for the IBL rendering\r
- Texture mBRDFTexture; // BRDF texture for the PBR rendering\r
+ Vector4 mIBLScaleFactor; // IBL scaling factor for the IBL rendering\r
+ Texture mBRDFTexture; // BRDF texture for the PBR rendering\r
Texture mSpecularTexture; // Specular cube map texture\r
- Texture mDiffuseTexture; // Diffuse cube map texture\r
+ Texture mDiffuseTexture; // Diffuse cube map texture\r
\r
private:\r
-\r
// Undefined copy constructor.\r
- Scene3dView( const Scene3dView& );\r
+ Scene3dView(const Scene3dView&);\r
\r
// Undefined assignment operator.\r
- Scene3dView& operator=( const Scene3dView& );\r
+ Scene3dView& operator=(const Scene3dView&);\r
};\r
\r
} // namespace Internal\r
\r
- // Helpers for public-api forwarding methods\r
-inline const Internal::Scene3dView& GetImpl( const Toolkit::Scene3dView& scene3dView )\r
+// Helpers for public-api forwarding methods\r
+inline const Internal::Scene3dView& GetImpl(const Toolkit::Scene3dView& scene3dView)\r
{\r
- DALI_ASSERT_ALWAYS( scene3dView && "Scene3dView handle is empty" );\r
+ DALI_ASSERT_ALWAYS(scene3dView && "Scene3dView handle is empty");\r
const Dali::RefObject& handle = scene3dView.GetImplementation();\r
\r
- return static_cast<const Toolkit::Internal::Scene3dView&>( handle );\r
+ return static_cast<const Toolkit::Internal::Scene3dView&>(handle);\r
}\r
\r
-inline Internal::Scene3dView& GetImpl( Toolkit::Scene3dView& scene3dView )\r
+inline Internal::Scene3dView& GetImpl(Toolkit::Scene3dView& scene3dView)\r
{\r
- DALI_ASSERT_ALWAYS( scene3dView && "Scene3dView handle is empty" );\r
+ DALI_ASSERT_ALWAYS(scene3dView && "Scene3dView handle is empty");\r
\r
Dali::RefObject& handle = scene3dView.GetImplementation();\r
\r
- return static_cast<Toolkit::Internal::Scene3dView&>( handle );\r
+ return static_cast<Toolkit::Internal::Scene3dView&>(handle);\r
}\r
\r
-}//namespace Toolkit\r
+} //namespace Toolkit\r
\r
-}//namespace Dali\r
+} //namespace Dali\r
\r
#endif // DALI_TOOLKIT_INTERNAL_SCENE3D_VIEW_H\r