X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-scene-loader%2Fpublic-api%2Fnode-definition.h;h=b496cf71fd749665d5418d285483ebab5b903b35;hb=b8da2e53925b9abb9fa362560069e8ca4aa62f81;hp=994ec18508264a5aeb26084e305f06c22988ce6b;hpb=7a315fe9869206bf6ad3195931f27d88fe9c128e;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-scene-loader/public-api/node-definition.h b/dali-scene-loader/public-api/node-definition.h index 994ec18..b496cf7 100644 --- a/dali-scene-loader/public-api/node-definition.h +++ b/dali-scene-loader/public-api/node-definition.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE_LOADER_NODE_DEFINITION_H_ #define DALI_SCENE_LOADER_NODE_DEFINITION_H_ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,19 +23,18 @@ #include "dali-scene-loader/public-api/resource-bundle.h" // EXTERNAL INCLUDES -#include "dali/public-api/math/quaternion.h" +#include +#include +#include +#include "dali/public-api/actors/actor.h" #include "dali/public-api/math/matrix.h" +#include "dali/public-api/math/quaternion.h" #include "dali/public-api/math/vector4.h" -#include "dali/public-api/actors/actor.h" -#include -#include -#include namespace Dali { namespace SceneLoader { - class ViewProjection; /** @@ -44,8 +43,7 @@ class ViewProjection; class DALI_SCENE_LOADER_API IResourceReceiver { public: - virtual ~IResourceReceiver() - {} + virtual ~IResourceReceiver() = default; virtual void Register(ResourceType::Value type, Index id) = 0; }; @@ -58,8 +56,7 @@ public: class DALI_SCENE_LOADER_API IResourceReflector { public: - virtual ~IResourceReflector() - {} + virtual ~IResourceReflector() = default; virtual void Reflect(ResourceType::Value type, Index& id) = 0; }; @@ -72,7 +69,7 @@ public: struct DALI_SCENE_LOADER_API ConstraintDefinition { std::string mProperty; ///< name of the property to constrain. - Index mSourceIdx; ///< index of the node to serve as the source of the constraint. + Index mSourceIdx; ///< index of the node to serve as the source of the constraint. bool operator<(const ConstraintDefinition& other) const { @@ -92,7 +89,7 @@ struct DALI_SCENE_LOADER_API ConstraintDefinition struct DALI_SCENE_LOADER_API Transforms { - MatrixStack modelStack; + MatrixStack modelStack; const ViewProjection& viewProjection; }; @@ -102,7 +99,7 @@ struct DALI_SCENE_LOADER_API Transforms */ struct DALI_SCENE_LOADER_API SkinningShaderConfigurationRequest { - Index mSkeletonIdx; + Index mSkeletonIdx; Shader mShader; bool operator<(const SkinningShaderConfigurationRequest& other) const @@ -117,8 +114,8 @@ struct DALI_SCENE_LOADER_API SkinningShaderConfigurationRequest struct DALI_SCENE_LOADER_API BlendshapeShaderConfigurationRequest { std::string mNodeName; - Index mMeshIdx; - Shader mShader; + Index mMeshIdx; + Shader mShader; bool operator<(const BlendshapeShaderConfigurationRequest& other) const { @@ -131,8 +128,8 @@ struct DALI_SCENE_LOADER_API BlendshapeShaderConfigurationRequest */ struct DALI_SCENE_LOADER_API ConstraintRequest { - const ConstraintDefinition* const mConstraint; ///< Definition of the constraint to create. - Actor mTarget; ///< Target of the constraint. + const ConstraintDefinition* const mConstraint; ///< Definition of the constraint to create. + Actor mTarget; ///< Target of the constraint. }; /** @@ -142,18 +139,18 @@ struct DALI_SCENE_LOADER_API ConstraintRequest */ struct DALI_SCENE_LOADER_API NodeDefinition { -public: // TYPES +public: // TYPES using Vector = std::vector; struct CreateParams { public: // input const ResourceBundle& mResources; - Transforms& mXforms; + Transforms& mXforms; public: // output - std::vector mConstrainables; - std::vector mSkinnables; + std::vector mConstrainables; + std::vector mSkinnables; std::vector mBlendshapeRequests; }; @@ -163,7 +160,7 @@ public: // TYPES Index mShaderIdx = INVALID_INDEX; public: // METHODS - virtual ~Renderable() {} + virtual ~Renderable() = default; virtual void RegisterResources(IResourceReceiver& receiver) const; virtual void ReflectResources(IResourceReflector& reflector); @@ -178,33 +175,33 @@ public: // TYPES { auto choice = choices.Get(mTag); return std::min(choice != Customization::NONE ? choice : 0, - static_cast(node.mChildren.size() - 1)); + static_cast(node.mChildren.size() - 1)); } }; class IVisitor { public: - virtual void Start(NodeDefinition& n) = 0; + virtual void Start(NodeDefinition& n) = 0; virtual void Finish(NodeDefinition& n) = 0; protected: - ~IVisitor() {} + ~IVisitor() = default; // deliberately non-virtual these are transient objects and we don't want to pay for the vtable. }; class IConstVisitor { public: - virtual void Start(const NodeDefinition& n) = 0; + virtual void Start(const NodeDefinition& n) = 0; virtual void Finish(const NodeDefinition& n) = 0; protected: - ~IConstVisitor() {} + ~IConstVisitor() = default; // deliberately non-virtual these are transient objects and we don't want to pay for the vtable. }; struct Extra { - std::string mKey; + std::string mKey; Property::Value mValue; bool operator<(const Extra& other) const @@ -213,7 +210,7 @@ public: // TYPES } }; -public: // METHODS +public: // METHODS /** * @brief Creates a DALi Actor from this definition only. * @note Not recursive. @@ -227,28 +224,28 @@ public: // DATA std::string mName; - Vector3 mPosition = Vector3::ZERO; + Vector3 mPosition = Vector3::ZERO; Quaternion mOrientation = Quaternion::IDENTITY; - Vector3 mScale = Vector3::ONE; - Vector3 mSize = Vector3::ONE; + Vector3 mScale = Vector3::ONE; + Vector3 mSize = Vector3::ONE; bool mIsVisible = true; - std::unique_ptr mRenderable; + std::unique_ptr mRenderable; std::unique_ptr mCustomization; - std::vector mExtras; - std::vector mConstraints; + std::vector mExtras; + std::vector mConstraints; std::vector mChildren; - Index mParentIdx = INVALID_INDEX; + Index mParentIdx = INVALID_INDEX; }; class DALI_SCENE_LOADER_API ModelNode : public NodeDefinition::Renderable { public: // DATA - Vector4 mColor = Color::WHITE; - Index mMeshIdx = INVALID_INDEX; - Index mMaterialIdx = INVALID_INDEX; + Vector4 mColor = Color::WHITE; + Index mMeshIdx = INVALID_INDEX; + Index mMaterialIdx = INVALID_INDEX; public: // METHODS void RegisterResources(IResourceReceiver& receiver) const override; @@ -262,11 +259,11 @@ public: // METHODS class DALI_SCENE_LOADER_API ArcNode : public ModelNode { public: // DATA - bool mAntiAliasing = true; - int mArcCaps = 0; + bool mAntiAliasing = true; + int mArcCaps = 0; float mStartAngleDegrees = .0f; - float mEndAngleDegrees = .0f; - float mRadius = .0f; + float mEndAngleDegrees = .0f; + float mRadius = .0f; public: // METHODS static void GetEndVectorWithDiffAngle(float startAngle, float endAngle, Vector2& endVector); @@ -274,7 +271,7 @@ public: // METHODS void OnCreate(const NodeDefinition& node, NodeDefinition::CreateParams& params, Actor& actor) const override; }; -} -} +} // namespace SceneLoader +} // namespace Dali #endif //DALI_SCENE_LOADER_NODE_DEFINITION_H_