From f13bf919b3cb3103a0301f29c8b096f5c9b6c9bf Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Wed, 8 Mar 2023 01:17:01 +0900 Subject: [PATCH] Clean up Scene3D namespace and header definition Change-Id: I28f91a4fb9af661ff61a12f00c1f6fd900cbdeec Signed-off-by: Eunki, Hong --- .../internal/algorithm/navigation-mesh-impl.cpp | 20 ++-- .../internal/algorithm/navigation-mesh-impl.h | 27 ++--- .../internal/algorithm/path-finder-djikstra.cpp | 32 +++--- .../algorithm/path-finder-spfa-double-way.cpp | 10 +- .../internal/algorithm/path-finder-spfa.cpp | 10 +- .../internal/algorithm/path-finder-waypoint-data.h | 6 +- dali-scene3d/internal/loader/dli-loader-impl.cpp | 27 ++--- dali-scene3d/internal/loader/dli-loader-impl.h | 19 +--- dali-scene3d/internal/loader/glb-loader-impl.cpp | 15 +-- dali-scene3d/internal/loader/glb-loader-impl.h | 23 +--- dali-scene3d/internal/loader/gltf2-asset.h | 8 +- dali-scene3d/internal/loader/gltf2-loader-impl.cpp | 14 +-- dali-scene3d/internal/loader/gltf2-loader-impl.h | 23 +--- dali-scene3d/internal/loader/gltf2-util.cpp | 124 ++++++++++----------- dali-scene3d/internal/loader/gltf2-util.h | 26 ++--- dali-scene3d/internal/loader/hash.cpp | 16 +-- dali-scene3d/internal/loader/hash.h | 13 +-- dali-scene3d/internal/loader/json-reader.cpp | 8 +- dali-scene3d/internal/loader/json-reader.h | 10 +- dali-scene3d/internal/loader/json-util.cpp | 24 ++-- dali-scene3d/internal/loader/json-util.h | 28 ++--- .../public-api/algorithm/navigation-mesh.h | 26 ++--- .../public-api/algorithm/path-finder-waypoint.cpp | 13 +-- .../public-api/algorithm/path-finder-waypoint.h | 12 +- dali-scene3d/public-api/algorithm/path-finder.cpp | 1 + dali-scene3d/public-api/controls/model/model.h | 6 +- .../public-api/controls/scene-view/scene-view.h | 8 +- .../public-api/loader/alpha-function-helper.cpp | 18 ++- .../public-api/loader/alpha-function-helper.h | 20 ++-- .../public-api/loader/animated-property.cpp | 16 +-- dali-scene3d/public-api/loader/animated-property.h | 27 ++--- .../public-api/loader/animation-definition.cpp | 16 +-- .../public-api/loader/animation-definition.h | 21 ++-- .../public-api/loader/blend-shape-details.cpp | 12 +- .../public-api/loader/blend-shape-details.h | 22 ++-- .../public-api/loader/buffer-definition.cpp | 12 +- dali-scene3d/public-api/loader/buffer-definition.h | 22 ++-- dali-scene3d/public-api/loader/bvh-loader.cpp | 12 +- dali-scene3d/public-api/loader/bvh-loader.h | 13 +-- .../public-api/loader/camera-parameters.cpp | 10 +- dali-scene3d/public-api/loader/customization.cpp | 20 ++-- dali-scene3d/public-api/loader/customization.h | 20 ++-- .../public-api/loader/dli-input-parameter.h | 17 +-- .../public-api/loader/environment-definition.cpp | 18 ++- .../public-api/loader/environment-definition.h | 26 ++--- .../public-api/loader/environment-map-data.cpp | 10 +- .../public-api/loader/environment-map-data.h | 20 ++-- .../public-api/loader/environment-map-loader.cpp | 31 +++--- .../public-api/loader/environment-map-loader.h | 13 +-- dali-scene3d/public-api/loader/index.h | 18 +-- dali-scene3d/public-api/loader/ktx-loader.h | 10 +- dali-scene3d/public-api/loader/light-parameters.h | 22 ++-- dali-scene3d/public-api/loader/load-result.h | 12 +- .../public-api/loader/material-definition.cpp | 2 +- .../public-api/loader/material-definition.h | 28 ++--- dali-scene3d/public-api/loader/matrix-stack.cpp | 20 ++-- dali-scene3d/public-api/loader/matrix-stack.h | 22 ++-- dali-scene3d/public-api/loader/mesh-definition.cpp | 14 +-- dali-scene3d/public-api/loader/mesh-definition.h | 32 +++--- dali-scene3d/public-api/loader/mesh-geometry.h | 22 ++-- dali-scene3d/public-api/loader/model-loader.cpp | 12 +- dali-scene3d/public-api/loader/model-loader.h | 10 +- .../public-api/loader/navigation-mesh-factory.cpp | 15 ++- .../public-api/loader/navigation-mesh-factory.h | 21 ++-- dali-scene3d/public-api/loader/node-definition.cpp | 12 +- dali-scene3d/public-api/loader/node-definition.h | 20 ++-- .../public-api/loader/parse-renderer-state.cpp | 19 ++-- .../public-api/loader/parse-renderer-state.h | 17 +-- dali-scene3d/public-api/loader/renderer-state.cpp | 20 ++-- dali-scene3d/public-api/loader/renderer-state.h | 20 ++-- dali-scene3d/public-api/loader/resource-bundle.cpp | 6 +- dali-scene3d/public-api/loader/resource-bundle.h | 26 ++--- .../public-api/loader/scene-definition.cpp | 30 +++-- dali-scene3d/public-api/loader/scene-definition.h | 32 +++--- .../loader/shader-definition-factory.cpp | 28 ++--- .../public-api/loader/shader-definition-factory.h | 22 ++-- .../public-api/loader/shader-definition.cpp | 18 ++- dali-scene3d/public-api/loader/shader-definition.h | 24 ++-- .../public-api/loader/skeleton-definition.h | 18 +-- .../public-api/loader/skinning-details.cpp | 24 ++-- dali-scene3d/public-api/loader/skinning-details.h | 20 ++-- dali-scene3d/public-api/loader/string-callback.cpp | 20 ++-- dali-scene3d/public-api/loader/string-callback.h | 18 +-- dali-scene3d/public-api/loader/utils.cpp | 22 ++-- dali-scene3d/public-api/loader/utils.h | 24 ++-- dali-scene3d/public-api/loader/view-projection.cpp | 20 ++-- dali-scene3d/public-api/loader/view-projection.h | 20 ++-- 87 files changed, 656 insertions(+), 1029 deletions(-) diff --git a/dali-scene3d/internal/algorithm/navigation-mesh-impl.cpp b/dali-scene3d/internal/algorithm/navigation-mesh-impl.cpp index 7e78094..e3b72d2 100644 --- a/dali-scene3d/internal/algorithm/navigation-mesh-impl.cpp +++ b/dali-scene3d/internal/algorithm/navigation-mesh-impl.cpp @@ -14,31 +14,30 @@ * limitations under the License. */ -// INTERNAL INCLUDES +// CLASS HEADER #include // EXTERNAL INCLUDES #include -#include #include #include #include #include +#include using Dali::Vector3; namespace Dali::Scene3D::Internal::Algorithm { - -using Poly = Dali::Scene3D::Algorithm::NavigationMesh::Face; -using Edge = Dali::Scene3D::Algorithm::NavigationMesh::Edge; +using Poly = Dali::Scene3D::Algorithm::NavigationMesh::Face; +using Edge = Dali::Scene3D::Algorithm::NavigationMesh::Edge; using Vertex = Dali::Scene3D::Algorithm::NavigationMesh::Vertex; // Internal Navigation ray structure struct NavigationRay { - Dali::Vector3 origin; // Origin of ray + Dali::Vector3 origin; // Origin of ray Dali::Vector3 direction; // Direction of ray }; @@ -96,7 +95,7 @@ NavigationMesh::NavigationMesh(const std::vector& buffer) std::copy(buffer.begin(), buffer.end(), mBuffer.begin()); // Setup header from the buffer - mHeader = *reinterpret_cast(mBuffer.data()); + mHeader = *reinterpret_cast(mBuffer.data()); mCurrentFace = Scene3D::Algorithm::NavigationMesh::NULL_FACE; } @@ -225,8 +224,7 @@ bool NavigationMesh::FindFloor(const Dali::Vector3& position, Dali::Vector3& out return false; } - std::sort(results.begin(), results.end(), [](const IntersectResult& lhs, const IntersectResult& rhs) - { return lhs.distance < rhs.distance; }); + std::sort(results.begin(), results.end(), [](const IntersectResult& lhs, const IntersectResult& rhs) { return lhs.distance < rhs.distance; }); outPosition = PointLocalToScene(results.front().point); faceIndex = results.front().faceIndex; @@ -291,7 +289,7 @@ Dali::Vector3 NavigationMesh::PointLocalToScene(const Dali::Vector3& point) Dali::Vector3 NavigationMesh::GetGravityVector() const { - return Dali::Vector3( mHeader.gravityVector ); + return Dali::Vector3(mHeader.gravityVector); } -} \ No newline at end of file +} // namespace Dali::Scene3D::Internal::Algorithm \ No newline at end of file diff --git a/dali-scene3d/internal/algorithm/navigation-mesh-impl.h b/dali-scene3d/internal/algorithm/navigation-mesh-impl.h index 2ba1b6d..f61a922 100644 --- a/dali-scene3d/internal/algorithm/navigation-mesh-impl.h +++ b/dali-scene3d/internal/algorithm/navigation-mesh-impl.h @@ -17,12 +17,9 @@ * limitations under the License. */ -// INTERNAL INCLUDES -#include -#include - -// INTERNAL EXTERNAL +// EXTERNAL EXTERNAL #include +#include #include #include #include @@ -30,8 +27,11 @@ #include #include #include -#include -#include "navigation-mesh-header.h" + +// INTERNAL INCLUDES +#include +#include +#include namespace Dali::Scene3D::Loader { @@ -40,7 +40,6 @@ class NavigationMeshFactory; namespace Dali::Scene3D::Internal::Algorithm { - class NavigationRay; /** @@ -54,7 +53,6 @@ public: using Vertex = Dali::Scene3D::Algorithm::NavigationMesh::Vertex; private: - friend class Scene3D::Loader::NavigationMeshFactory; /** @@ -63,7 +61,6 @@ private: NavigationMesh(const std::vector& buffer); public: - /** * Destructor */ @@ -157,11 +154,11 @@ public: [[nodiscard]] Dali::Vector3 GetGravityVector() const; private: - std::vector mBuffer; //< Data buffer - NavigationMeshHeader_V10 mHeader; //< Navigation mesh header - uint16_t mCurrentFace; //< Current face (last floor position) - Dali::Matrix mTransform; //< Transform matrix - Dali::Matrix mTransformInverse; //< Inverse of the transform matrix + std::vector mBuffer; //< Data buffer + NavigationMeshHeader_V10 mHeader; //< Navigation mesh header + uint16_t mCurrentFace; //< Current face (last floor position) + Dali::Matrix mTransform; //< Transform matrix + Dali::Matrix mTransformInverse; //< Inverse of the transform matrix }; inline Internal::Algorithm::NavigationMesh& GetImplementation(Dali::Scene3D::Algorithm::NavigationMesh& navigationMesh) diff --git a/dali-scene3d/internal/algorithm/path-finder-djikstra.cpp b/dali-scene3d/internal/algorithm/path-finder-djikstra.cpp index 0da6568..7c751ad 100644 --- a/dali-scene3d/internal/algorithm/path-finder-djikstra.cpp +++ b/dali-scene3d/internal/algorithm/path-finder-djikstra.cpp @@ -14,20 +14,21 @@ * limitations under the License. */ -// INTERNAL INCLUDES -#include +// CLASS HEADER #include -#include // EXTERNAL INCLUDES +#include #include -#include + +// INTERNAL INCLUDES +#include +#include using WayPointList = Dali::Scene3D::Algorithm::WayPointList; namespace Dali::Scene3D::Internal::Algorithm { - PathFinderAlgorithmDjikstra::PathFinderAlgorithmDjikstra(Dali::Scene3D::Algorithm::NavigationMesh& navMesh) : mNavigationMesh(&GetImplementation(navMesh)) { @@ -40,7 +41,7 @@ Scene3D::Algorithm::WayPointList PathFinderAlgorithmDjikstra::FindPath(const Dal { Dali::Vector3 outPosFrom; uint32_t polyIndexFrom; - auto result = mNavigationMesh->FindFloor(positionFrom, outPosFrom, polyIndexFrom); + auto result = mNavigationMesh->FindFloor(positionFrom, outPosFrom, polyIndexFrom); Scene3D::Algorithm::WayPointList waypoints; @@ -57,7 +58,7 @@ Scene3D::Algorithm::WayPointList PathFinderAlgorithmDjikstra::FindPath(const Dal // replace first and last waypoint auto& wpFrom = static_cast(waypoints[0]); - auto& wpTo = static_cast(waypoints.back()); + auto& wpTo = static_cast(waypoints.back()); Vector2 fromCenter(wpFrom.point3d.x, wpFrom.point3d.y); wpFrom.point3d = outPosFrom; @@ -100,8 +101,7 @@ Scene3D::Algorithm::WayPointList PathFinderAlgorithmDjikstra::FindPath(uint32_t dist[sourcePolyIndex] = 0.0f; // TO OPTIMIZE WITH PRIORITY QUEUE - auto FindMinDistance = [&nodeQueue](decltype(dist)& dist) - { + auto FindMinDistance = [&nodeQueue](decltype(dist)& dist) { float w = std::numeric_limits::max(); int index = -1; for(auto i = 0u; i < dist.size(); ++i) @@ -215,7 +215,7 @@ void PathFinderAlgorithmDjikstra::PrepareData() auto p2 = edge->face[1]; // One of faces is current face so ignore it - auto p = ((p1 != i) ? p1 : p2); + auto p = ((p1 != i) ? p1 : p2); node.faces[edgeIndex] = p; if(p != ::Dali::Scene3D::Algorithm::NavigationMesh::NULL_FACE) { @@ -248,7 +248,7 @@ Scene3D::Algorithm::WayPointList PathFinderAlgorithmDjikstra::OptimizeWaypoints( bool finished = false; for(auto j = 0; !finished; ++j) { - auto& startWaypoint = optimizedWaypoints.back(); + auto& startWaypoint = optimizedWaypoints.back(); const auto& startWaypointData = static_cast(startWaypoint); // add new-last waypoint which will be overriden as long as intersection takes place @@ -277,8 +277,8 @@ Scene3D::Algorithm::WayPointList PathFinderAlgorithmDjikstra::OptimizeWaypoints( { continue; } - auto Pb0 = mNavigationMesh->GetVertex(wp.edge->vertex[0]); - auto Pb1 = mNavigationMesh->GetVertex(wp.edge->vertex[1]); + auto Pb0 = mNavigationMesh->GetVertex(wp.edge->vertex[0]); + auto Pb1 = mNavigationMesh->GetVertex(wp.edge->vertex[1]); auto vPb0 = Dali::Vector2(Pb0->x, Pb0->y); auto vPb1 = Dali::Vector2(Pb1->x, Pb1->y); @@ -292,7 +292,7 @@ Scene3D::Algorithm::WayPointList PathFinderAlgorithmDjikstra::OptimizeWaypoints( if(!doesIntersect) { optimizedWaypoints.back() = waypoints[wpIndex - 1]; - startIndex = wpIndex - 1; + startIndex = wpIndex - 1; break; } } @@ -300,11 +300,11 @@ Scene3D::Algorithm::WayPointList PathFinderAlgorithmDjikstra::OptimizeWaypoints( for(auto& wp : optimizedWaypoints) { - auto& wpData = static_cast(wp); + auto& wpData = static_cast(wp); wpData.point3d = mNavigationMesh->PointLocalToScene(Dali::Vector3(wpData.face->center)); wpData.point2d = Vector2::ZERO; } return optimizedWaypoints; } -} +} // namespace Dali::Scene3D::Internal::Algorithm diff --git a/dali-scene3d/internal/algorithm/path-finder-spfa-double-way.cpp b/dali-scene3d/internal/algorithm/path-finder-spfa-double-way.cpp index d29a6f2..3b5f844 100644 --- a/dali-scene3d/internal/algorithm/path-finder-spfa-double-way.cpp +++ b/dali-scene3d/internal/algorithm/path-finder-spfa-double-way.cpp @@ -14,15 +14,17 @@ * limitations under the License. */ -// INTERNAL INCLUDES +// CLASS HEADER #include -#include -#include // EXTERNAL INCLUDES +#include #include #include -#include + +// INTERNAL INCLUDES +#include +#include using WayPointList = Dali::Scene3D::Algorithm::WayPointList; diff --git a/dali-scene3d/internal/algorithm/path-finder-spfa.cpp b/dali-scene3d/internal/algorithm/path-finder-spfa.cpp index 977eb90..aa8b3bd 100644 --- a/dali-scene3d/internal/algorithm/path-finder-spfa.cpp +++ b/dali-scene3d/internal/algorithm/path-finder-spfa.cpp @@ -14,14 +14,16 @@ * limitations under the License. */ -// INTERNAL INCLUDES +// CLASS HEADER #include -#include -#include // EXTERNAL INCLUDES +#include #include -#include + +// INTERNAL INCLUDES +#include +#include using WayPointList = Dali::Scene3D::Algorithm::WayPointList; diff --git a/dali-scene3d/internal/algorithm/path-finder-waypoint-data.h b/dali-scene3d/internal/algorithm/path-finder-waypoint-data.h index 53df123..ab5c3b0 100644 --- a/dali-scene3d/internal/algorithm/path-finder-waypoint-data.h +++ b/dali-scene3d/internal/algorithm/path-finder-waypoint-data.h @@ -17,11 +17,9 @@ * limitations under the License. */ -// CLASS HEADER -#include - // INTERNAL INCLUDES #include +#include // EXTERNAL INCLUDES #include @@ -51,6 +49,6 @@ struct WayPointData // internal data needed for processing const NavigationMesh::Edge* edge; ///< Edge between this face and next face }; -} +} // namespace Dali::Scene3D::Internal::Algorithm #endif // DALI_SCENE3D_INTERNAL_PATH_FINDER_WAYPOINT_DATA_H diff --git a/dali-scene3d/internal/loader/dli-loader-impl.cpp b/dali-scene3d/internal/loader/dli-loader-impl.cpp index 90c5e1d..2285940 100644 --- a/dali-scene3d/internal/loader/dli-loader-impl.cpp +++ b/dali-scene3d/internal/loader/dli-loader-impl.cpp @@ -19,16 +19,17 @@ #include // EXTERNAL INCLUDES +#include +#include +#include +#include + #include #include #include #include #include #include -#include "dali-toolkit/devel-api/builder/json-parser.h" -#include "dali/devel-api/common/map-wrapper.h" -#include "dali/integration-api/debug.h" -#include "dali/public-api/object/property-array.h" // INTERNAL INCLUDES #include @@ -501,8 +502,7 @@ void DliLoaderImpl::Impl::ParseScene(LoadParams& params) void DliLoaderImpl::Impl::ParseSceneInternal(Index iScene, const Toolkit::TreeNode* tnScenes, const Toolkit::TreeNode* tnNodes, LoadParams& params) { - auto getSceneRootIdx = [tnScenes, tnNodes](Index iScene) - { + auto getSceneRootIdx = [tnScenes, tnNodes](Index iScene) { auto tn = GetNthChild(tnScenes, iScene); // now a "scene" object if(!tn) { @@ -585,8 +585,7 @@ void DliLoaderImpl::Impl::ParseSkeletons(const TreeNode* skeletons, Dali::Scene3 uint32_t jointCount = 0; std::function visitFn; auto& ibms = mInverseBindMatrices; - visitFn = [&](Index id) - { + visitFn = [&](Index id) { auto node = scene.GetNode(id); jointCount += ibms.find(id) != ibms.end(); @@ -605,8 +604,7 @@ void DliLoaderImpl::Impl::ParseSkeletons(const TreeNode* skeletons, Dali::Scene3 skeleton.mJoints.reserve(jointCount); - visitFn = [&](Index id) - { + visitFn = [&](Index id) { auto iFind = ibms.find(id); if(iFind != ibms.end() && skeleton.mJoints.size() < Skinning::MAX_JOINTS) { @@ -1097,8 +1095,7 @@ void DliLoaderImpl::Impl::ParseNodes(const TreeNode* const nodes, Index index, L virtual unsigned int Resolve(Index iDli) override { - auto iFind = std::lower_bound(mIndices.begin(), mIndices.end(), iDli, [](const Entry& idx, Index iDli) - { return idx.iDli < iDli; }); + auto iFind = std::lower_bound(mIndices.begin(), mIndices.end(), iDli, [](const Entry& idx, Index iDli) { return idx.iDli < iDli; }); DALI_ASSERT_ALWAYS(iFind != mIndices.end()); return iFind->iScene; } @@ -1445,8 +1442,7 @@ void DliLoaderImpl::Impl::ParseAnimations(const TreeNode* tnAnimations, LoadPara AnimationDefinition animDef; ReadString(tnAnim.GetChild(NAME), animDef.mName); - auto iFind = std::lower_bound(definitions.begin(), definitions.end(), animDef, [](const AnimationDefinition& ad0, const AnimationDefinition& ad1) - { return ad0.mName < ad1.mName; }); + auto iFind = std::lower_bound(definitions.begin(), definitions.end(), animDef, [](const AnimationDefinition& ad0, const AnimationDefinition& ad1) { return ad0.mName < ad1.mName; }); const bool overwrite = iFind != definitions.end() && iFind->mName == animDef.mName; if(overwrite) { @@ -1712,8 +1708,7 @@ void DliLoaderImpl::Impl::ParseAnimationGroups(const Toolkit::TreeNode* tnAnimat continue; } - auto iFind = std::lower_bound(animGroups.begin(), animGroups.end(), groupName, [](const AnimationGroupDefinition& group, const std::string& name) - { return group.mName < name; }); + auto iFind = std::lower_bound(animGroups.begin(), animGroups.end(), groupName, [](const AnimationGroupDefinition& group, const std::string& name) { return group.mName < name; }); if(iFind != animGroups.end() && iFind->mName == groupName) { mOnError(FormatString("Animation group with name '%s' already exists; new entries will be merged.", groupName.c_str())); diff --git a/dali-scene3d/internal/loader/dli-loader-impl.h b/dali-scene3d/internal/loader/dli-loader-impl.h index ed0af39..ba6b117 100644 --- a/dali-scene3d/internal/loader/dli-loader-impl.h +++ b/dali-scene3d/internal/loader/dli-loader-impl.h @@ -17,6 +17,9 @@ * */ +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include #include @@ -27,16 +30,7 @@ #include #include -// EXTERNAL INCLUDES -#include - -namespace Dali -{ -namespace Scene3D -{ -namespace Loader -{ -namespace Internal +namespace Dali::Scene3D::Loader::Internal { typedef std::pair Metadata; @@ -76,9 +70,6 @@ private: const std::unique_ptr mImpl; }; -} // namespace Internal -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader::Internal #endif // DALI_SCENE3D_LOADER_DLI_LOADER_IMPL_H diff --git a/dali-scene3d/internal/loader/glb-loader-impl.cpp b/dali-scene3d/internal/loader/glb-loader-impl.cpp index 0bfae86..4ab9f70 100644 --- a/dali-scene3d/internal/loader/glb-loader-impl.cpp +++ b/dali-scene3d/internal/loader/glb-loader-impl.cpp @@ -30,13 +30,7 @@ namespace gt = gltf2; namespace js = json; -namespace Dali -{ -namespace Scene3D -{ -namespace Loader -{ -namespace Internal +namespace Dali::Scene3D::Loader::Internal { namespace { @@ -138,12 +132,9 @@ bool GlbLoaderImpl::LoadModel(const std::string& url, Dali::Scene3D::Loader::Loa outBuffers.emplace_back(std::move(dataBuffer)); } - Gltf2Util::ConvertGltfToContext(document, context,isMRendererModel); + Gltf2Util::ConvertGltfToContext(document, context, isMRendererModel); return true; } -} // namespace Internal -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader::Internal diff --git a/dali-scene3d/internal/loader/glb-loader-impl.h b/dali-scene3d/internal/loader/glb-loader-impl.h index 4e9607b..05c9d9c 100644 --- a/dali-scene3d/internal/loader/glb-loader-impl.h +++ b/dali-scene3d/internal/loader/glb-loader-impl.h @@ -17,36 +17,25 @@ * */ -// INTERNAL INCLUDES -#include -#include - // EXTERNAL INCLUDES #include #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader -{ -namespace Internal -{ +// INTERNAL INCLUDES +#include +#include +namespace Dali::Scene3D::Loader::Internal +{ class GlbLoaderImpl : public ModelLoaderImpl { public: - /** * @copydoc Dali::Scene3D::Loader::Internal::ModelLoaderImpl::LoadMode() */ bool LoadModel(const std::string& url, Dali::Scene3D::Loader::LoadResult& result) override; }; -} // namespace Internal -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader::Internal #endif // DALI_SCENE3D_LOADER_GLB_LOADER_IMPL_H diff --git a/dali-scene3d/internal/loader/gltf2-asset.h b/dali-scene3d/internal/loader/gltf2-asset.h index 6576803..7a8af2b 100644 --- a/dali-scene3d/internal/loader/gltf2-asset.h +++ b/dali-scene3d/internal/loader/gltf2-asset.h @@ -17,10 +17,6 @@ * */ -// INTERNAL INCLUDES -#include -#include - // EXTERNAL INCLUDES #include #include @@ -29,6 +25,10 @@ #include #include +// INTERNAL INCLUDES +#include +#include + #define ENUM_STRING_MAPPING(t, x) \ { \ #x, t::x \ diff --git a/dali-scene3d/internal/loader/gltf2-loader-impl.cpp b/dali-scene3d/internal/loader/gltf2-loader-impl.cpp index ae08709..d4e0614 100644 --- a/dali-scene3d/internal/loader/gltf2-loader-impl.cpp +++ b/dali-scene3d/internal/loader/gltf2-loader-impl.cpp @@ -29,15 +29,8 @@ namespace gt = gltf2; namespace js = json; -namespace Dali +namespace Dali::Scene3D::Loader::Internal { -namespace Scene3D -{ -namespace Loader -{ -namespace Internal -{ - bool Gltf2LoaderImpl::LoadModel(const std::string& url, Dali::Scene3D::Loader::LoadResult& result) { bool failed = false; @@ -71,7 +64,4 @@ bool Gltf2LoaderImpl::LoadModel(const std::string& url, Dali::Scene3D::Loader::L return true; } -} // namespace Internal -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader::Internal diff --git a/dali-scene3d/internal/loader/gltf2-loader-impl.h b/dali-scene3d/internal/loader/gltf2-loader-impl.h index 319d91c..a4dfc6e 100644 --- a/dali-scene3d/internal/loader/gltf2-loader-impl.h +++ b/dali-scene3d/internal/loader/gltf2-loader-impl.h @@ -17,36 +17,25 @@ * */ -// INTERNAL INCLUDES -#include -#include - // EXTERNAL INCLUDES #include #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader -{ -namespace Internal -{ +// INTERNAL INCLUDES +#include +#include +namespace Dali::Scene3D::Loader::Internal +{ class Gltf2LoaderImpl : public ModelLoaderImpl { public: - /** * @copydoc Dali::Scene3D::Loader::Internal::ModelLoaderImpl::LoadMode() */ bool LoadModel(const std::string& url, Dali::Scene3D::Loader::LoadResult& result) override; }; -} // namespace Internal -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader::Internal #endif // DALI_SCENE3D_LOADER_GLTF2_LOADER_IMPL_H diff --git a/dali-scene3d/internal/loader/gltf2-util.cpp b/dali-scene3d/internal/loader/gltf2-util.cpp index 15361b7..96925cc 100644 --- a/dali-scene3d/internal/loader/gltf2-util.cpp +++ b/dali-scene3d/internal/loader/gltf2-util.cpp @@ -18,15 +18,12 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES +#include + using namespace Dali::Scene3D::Loader; -namespace Dali -{ -namespace Scene3D -{ -namespace Loader -{ -namespace Internal +namespace Dali::Scene3D::Loader::Internal { namespace Gltf2Util { @@ -49,7 +46,7 @@ static const Geometry::Type GLTF2_TO_DALI_PRIMITIVES[]{ static struct AttributeMapping { - gltf2::Attribute::Type mType; + gltf2::Attribute::Type mType; MeshDefinition::Accessor MeshDefinition::*mAccessor; uint16_t mElementSizeRequired; } ATTRIBUTE_MAPPINGS[]{ @@ -110,14 +107,14 @@ const auto ACCESSOR_SPARSE_READER = std::move(json::Reader() .Register(*new json::Property>("bufferView", - gltf2::RefReader::Read, - &gltf2::Accessor::mBufferView)) + gltf2::RefReader::Read, + &gltf2::Accessor::mBufferView)) .Register(*new json::Property("byteOffset", - json::Read::Number, - &gltf2::Accessor::mByteOffset)) + json::Read::Number, + &gltf2::Accessor::mByteOffset)) .Register(*new json::Property("componentType", - json::Read::Enum, - &gltf2::Accessor::mComponentType)) + json::Read::Enum, + &gltf2::Accessor::mComponentType)) .Register(*new json::Property("name", json::Read::StringView, &gltf2::Accessor::mName)) .Register(*json::MakeProperty("count", json::Read::Number, &gltf2::Accessor::mCount)) .Register(*json::MakeProperty("normalized", json::Read::Boolean, &gltf2::Accessor::mNormalized)) @@ -182,22 +179,22 @@ const auto MATERIAL_READER = std::move(json::Reader() std::map> ReadMeshPrimitiveAttributes(const json_value_s& j) { - auto& jo = json::Cast(j); + auto& jo = json::Cast(j); std::map> result; auto i = jo.start; while(i) { - auto jstr = *i->name; + auto jstr = *i->name; result[gltf2::Attribute::FromString(jstr.string, jstr.string_size)] = gltf2::RefReader::Read(*i->value); - i = i->next; + i = i->next; } return result; } std::vector>> ReadMeshPrimitiveTargets(const json_value_s& j) { - auto& jo = json::Cast(j); + auto& jo = json::Cast(j); std::vector>> result; result.reserve(jo.length); @@ -222,21 +219,21 @@ const auto MESH_PRIMITIVE_READER = std::move(json::Reader() .Register(*new json::Property("name", json::Read::StringView, &gltf2::Mesh::mName)) .Register(*json::MakeProperty("primitives", - json::Read::Array::Read>, - &gltf2::Mesh::mPrimitives)) + json::Read::Array::Read>, + &gltf2::Mesh::mPrimitives)) .Register(*json::MakeProperty("weights", json::Read::Array, &gltf2::Mesh::mWeights))); const auto SKIN_READER = std::move(json::Reader() .Register(*new json::Property("name", json::Read::StringView, &gltf2::Skin::mName)) .Register(*json::MakeProperty("inverseBindMatrices", - gltf2::RefReader::Read, - &gltf2::Skin::mInverseBindMatrices)) + gltf2::RefReader::Read, + &gltf2::Skin::mInverseBindMatrices)) .Register(*json::MakeProperty("skeleton", - gltf2::RefReader::Read, - &gltf2::Skin::mSkeleton)) + gltf2::RefReader::Read, + &gltf2::Skin::mSkeleton)) .Register(*json::MakeProperty("joints", - json::Read::Array, gltf2::RefReader::Read>, - &gltf2::Skin::mJoints))); + json::Read::Array, gltf2::RefReader::Read>, + &gltf2::Skin::mJoints))); const auto CAMERA_PERSPECTIVE_READER = std::move(json::Reader() .Register(*json::MakeProperty("aspectRatio", json::Read::Number, &gltf2::Camera::Perspective::mAspectRatio)) @@ -283,58 +280,58 @@ const auto ANIMATION_CHANNEL_READER = std::move(json::Reader() .Register(*new json::Property("name", json::Read::StringView, &gltf2::Animation::mName)) .Register(*json::MakeProperty("samplers", - json::Read::Array::Read>, - &gltf2::Animation::mSamplers)) + json::Read::Array::Read>, + &gltf2::Animation::mSamplers)) .Register(*json::MakeProperty("channels", - json::Read::Array::Read>, - &gltf2::Animation::mChannels))); + json::Read::Array::Read>, + &gltf2::Animation::mChannels))); const auto SCENE_READER = std::move(json::Reader() .Register(*new json::Property("name", json::Read::StringView, &gltf2::Scene::mName)) .Register(*json::MakeProperty("nodes", - json::Read::Array, gltf2::RefReader::Read>, - &gltf2::Scene::mNodes))); + json::Read::Array, gltf2::RefReader::Read>, + &gltf2::Scene::mNodes))); const auto DOCUMENT_READER = std::move(json::Reader() .Register(*json::MakeProperty("buffers", - json::Read::Array::Read>, - &gltf2::Document::mBuffers)) + json::Read::Array::Read>, + &gltf2::Document::mBuffers)) .Register(*json::MakeProperty("bufferViews", - json::Read::Array::Read>, - &gltf2::Document::mBufferViews)) + json::Read::Array::Read>, + &gltf2::Document::mBufferViews)) .Register(*json::MakeProperty("accessors", - json::Read::Array::Read>, - &gltf2::Document::mAccessors)) + json::Read::Array::Read>, + &gltf2::Document::mAccessors)) .Register(*json::MakeProperty("images", - json::Read::Array::Read>, - &gltf2::Document::mImages)) + json::Read::Array::Read>, + &gltf2::Document::mImages)) .Register(*json::MakeProperty("samplers", - json::Read::Array::Read>, - &gltf2::Document::mSamplers)) + json::Read::Array::Read>, + &gltf2::Document::mSamplers)) .Register(*json::MakeProperty("textures", - json::Read::Array::Read>, - &gltf2::Document::mTextures)) + json::Read::Array::Read>, + &gltf2::Document::mTextures)) .Register(*json::MakeProperty("materials", - json::Read::Array::Read>, - &gltf2::Document::mMaterials)) + json::Read::Array::Read>, + &gltf2::Document::mMaterials)) .Register(*json::MakeProperty("meshes", - json::Read::Array::Read>, - &gltf2::Document::mMeshes)) + json::Read::Array::Read>, + &gltf2::Document::mMeshes)) .Register(*json::MakeProperty("skins", - json::Read::Array::Read>, - &gltf2::Document::mSkins)) + json::Read::Array::Read>, + &gltf2::Document::mSkins)) .Register(*json::MakeProperty("cameras", - json::Read::Array::Read>, - &gltf2::Document::mCameras)) + json::Read::Array::Read>, + &gltf2::Document::mCameras)) .Register(*json::MakeProperty("nodes", - json::Read::Array::Read>, - &gltf2::Document::mNodes)) + json::Read::Array::Read>, + &gltf2::Document::mNodes)) .Register(*json::MakeProperty("animations", - ReadAnimationArray, - &gltf2::Document::mAnimations)) + ReadAnimationArray, + &gltf2::Document::mAnimations)) .Register(*json::MakeProperty("scenes", - json::Read::Array::Read>, - &gltf2::Document::mScenes)) + json::Read::Array::Read>, + &gltf2::Document::mScenes)) .Register(*json::MakeProperty("scene", gltf2::RefReader::Read, &gltf2::Document::mScene))); void ConvertBuffer(const gltf2::Buffer& buffer, decltype(ResourceBundle::mBuffers)& outBuffers, const std::string& resourcePath) @@ -425,8 +422,7 @@ TextureDefinition ConvertTextureInfo(const gltf2::TextureInfo& mm, ConversionCon void ConvertMaterial(const gltf2::Material& material, const std::unordered_map& imageMetaData, decltype(ResourceBundle::mMaterials)& outMaterials, ConversionContext& context) { - auto getTextureMetaData = [](const std::unordered_map& metaData, const gltf2::TextureInfo& info) - { + auto getTextureMetaData = [](const std::unordered_map& metaData, const gltf2::TextureInfo& info) { if(!info.mTexture->mSource->mUri.empty()) { if(auto search = metaData.find(info.mTexture->mSource->mUri.data()); search != metaData.end()) @@ -784,8 +780,7 @@ void ConvertNode(gltf2::Node const& node, const Index gltfIdx, Index parentIdx, auto& resources = output.mResources; const auto idx = scene.GetNodeCount(); - auto weakNode = scene.AddNode([&]() - { + auto weakNode = scene.AddNode([&]() { std::unique_ptr nodeDef{new NodeDefinition()}; nodeDef->mParentIdx = parentIdx; @@ -1323,7 +1318,4 @@ void ConvertGltfToContext(gt::Document& document, Gltf2Util::ConversionContext& } // namespace Gltf2Util -} // namespace Internal -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader::Internal \ No newline at end of file diff --git a/dali-scene3d/internal/loader/gltf2-util.h b/dali-scene3d/internal/loader/gltf2-util.h index d84ce05..909ae59 100644 --- a/dali-scene3d/internal/loader/gltf2-util.h +++ b/dali-scene3d/internal/loader/gltf2-util.h @@ -17,6 +17,10 @@ * */ +// EXTERNAL INCLUDES +#include +#include + // INTERNAL INCLUDES #include #include @@ -24,24 +28,13 @@ #include #include -// EXTERNAL INCLUDES -#include -#include - namespace gt = gltf2; namespace js = json; -namespace Dali -{ -namespace Scene3D -{ -namespace Loader -{ -namespace Internal +namespace Dali::Scene3D::Loader::Internal { namespace Gltf2Util { - struct NodeMapping { Index gltfIdx; @@ -56,8 +49,8 @@ struct NodeMapping class NodeIndexMapper { public: - NodeIndexMapper() = default; - NodeIndexMapper(const NodeIndexMapper&) = delete; + NodeIndexMapper() = default; + NodeIndexMapper(const NodeIndexMapper&) = delete; NodeIndexMapper& operator=(const NodeIndexMapper&) = delete; ///@brief Registers a mapping of the @a gltfIdx of a node to its @a runtimeIdx . @@ -127,9 +120,6 @@ void ConvertGltfToContext(gt::Document& document, Gltf2Util::ConversionContext& } // namespace Gltf2Util -} // namespace Internal -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader::Internal #endif // DALI_SCENE3D_LOADER_GLTF2_UTIL_H diff --git a/dali-scene3d/internal/loader/hash.cpp b/dali-scene3d/internal/loader/hash.cpp index d1ea70f..7abb277 100644 --- a/dali-scene3d/internal/loader/hash.cpp +++ b/dali-scene3d/internal/loader/hash.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -14,13 +14,11 @@ * limitations under the License. * */ -#include "dali-scene3d/internal/loader/hash.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// CLASS HEADER +#include + +namespace Dali::Scene3D::Loader { Hash::Hash(uint64_t initial) : mValue(initial) @@ -93,6 +91,4 @@ uint64_t Hash::Concatenate(uint64_t value) return mValue * 31 + value; } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/internal/loader/hash.h b/dali-scene3d/internal/loader/hash.h index a5bba8e..0f63c94 100644 --- a/dali-scene3d/internal/loader/hash.h +++ b/dali-scene3d/internal/loader/hash.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_HASH_H_ #define DALI_SCENE3D_LOADER_HASH_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,15 +17,12 @@ * */ +// EXTERNAL INCLUDES #include #include #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { /** * @brief Rudimentary hash generator that follows a builder pattern. @@ -119,8 +116,6 @@ Hash& Hash::AddObjectBytes(const T& value) return *this; } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_HASH_H_ diff --git a/dali-scene3d/internal/loader/json-reader.cpp b/dali-scene3d/internal/loader/json-reader.cpp index ead6269..2ea2925 100644 --- a/dali-scene3d/internal/loader/json-reader.cpp +++ b/dali-scene3d/internal/loader/json-reader.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Samsung Electronics Co., Ltd. +* Copyright (c) 2023 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. @@ -14,7 +14,11 @@ * limitations under the License. * */ -#include "dali-scene3d/internal/loader/json-reader.h" + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES #include #include diff --git a/dali-scene3d/internal/loader/json-reader.h b/dali-scene3d/internal/loader/json-reader.h index c0a8abd..100472a 100644 --- a/dali-scene3d/internal/loader/json-reader.h +++ b/dali-scene3d/internal/loader/json-reader.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_JSON_READER_H_ #define DALI_SCENE3D_LOADER_JSON_READER_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,17 +17,17 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/third-party/json.h" - // EXTERNAL INCLUDES +#include #include #include #include #include #include #include -#include "dali/public-api/common/vector-wrapper.h" + +// INTERNAL INCLUDES +#include // TODO : Since license issue, We shoud replace this thing as namespace json { diff --git a/dali-scene3d/internal/loader/json-util.cpp b/dali-scene3d/internal/loader/json-util.cpp index fcb91ad..ec6e95f 100644 --- a/dali-scene3d/internal/loader/json-util.cpp +++ b/dali-scene3d/internal/loader/json-util.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -14,19 +14,21 @@ * limitations under the License. * */ -#include "dali-scene3d/internal/loader/json-util.h" + +// CLASS HEADER +#include // EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include "dali/devel-api/common/map-wrapper.h" -#include "dali/public-api/common/extents.h" -#include "dali/public-api/math/matrix.h" -#include "dali/public-api/math/matrix3.h" -#include "dali/public-api/math/quaternion.h" -#include "dali/public-api/math/radian.h" -#include "dali/public-api/math/vector2.h" -#include "dali/public-api/math/vector3.h" -#include "dali/public-api/object/property-value.h" namespace Dali { diff --git a/dali-scene3d/internal/loader/json-util.h b/dali-scene3d/internal/loader/json-util.h index 1d2b983..e7c222d 100644 --- a/dali-scene3d/internal/loader/json-util.h +++ b/dali-scene3d/internal/loader/json-util.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_JSON_UTIL_H_ #define DALI_SCENE3D_LOADER_JSON_UTIL_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,21 +17,17 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/loader/index.h" - // EXTERNAL INCLUDES -#include "dali-toolkit/devel-api/builder/tree-node.h" -#include "dali/public-api/animation/time-period.h" -#include "dali/public-api/common/vector-wrapper.h" -#include "dali/public-api/math/vector4.h" -#include "dali/public-api/object/property.h" +#include +#include +#include +#include +#include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { bool ReadBool(const Toolkit::TreeNode* node, bool& num); @@ -90,8 +86,6 @@ Property::Value ReadPropertyValue(const Property::Type& propType, const Toolkit: */ Property::Value ReadPropertyValue(const Toolkit::TreeNode& tn); -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_JSON_UTIL_H_ diff --git a/dali-scene3d/public-api/algorithm/navigation-mesh.h b/dali-scene3d/public-api/algorithm/navigation-mesh.h index 12f3387..b2a0fd9 100644 --- a/dali-scene3d/public-api/algorithm/navigation-mesh.h +++ b/dali-scene3d/public-api/algorithm/navigation-mesh.h @@ -17,19 +17,19 @@ * limitations under the License. */ -// INTERNAL INCLUDES -#include - // EXTERNAL INCLUDES +#include #include #include #include #include #include -#include #include +// INTERNAL INCLUDES +#include + namespace Dali::Scene3D::Internal::Algorithm { class NavigationMesh; @@ -41,9 +41,9 @@ class NavigationMeshFactory; } constexpr auto NAVIGATION_MESH_MAX_VERTICES_PER_FACE = 3u; -constexpr auto NAVIGATION_MESH_MAX_EDGES_PER_FACE = 3u; -constexpr auto NAVIGATION_MESH_MAX_COMPONENTS_3D = 3u; -constexpr auto NAVIGATION_MESH_MAX_COMPONENTS_2D = 2u; +constexpr auto NAVIGATION_MESH_MAX_EDGES_PER_FACE = 3u; +constexpr auto NAVIGATION_MESH_MAX_COMPONENTS_3D = 3u; +constexpr auto NAVIGATION_MESH_MAX_COMPONENTS_2D = 2u; namespace Dali::Scene3D::Algorithm { @@ -72,7 +72,6 @@ using NavigationMeshImpl = Dali::Scene3D::Internal::Algorithm::NavigationMesh; class DALI_SCENE3D_API NavigationMesh { public: - /** * @struct Face * @@ -81,9 +80,9 @@ public: struct Face { uint16_t vertex[NAVIGATION_MESH_MAX_VERTICES_PER_FACE]; ///< Vertices per face - uint16_t edge[NAVIGATION_MESH_MAX_EDGES_PER_FACE]; ///< Edges per face - float normal[NAVIGATION_MESH_MAX_COMPONENTS_3D]; ///< Normal vector - float center[NAVIGATION_MESH_MAX_COMPONENTS_3D]; ///< Barycentric coordinates + uint16_t edge[NAVIGATION_MESH_MAX_EDGES_PER_FACE]; ///< Edges per face + float normal[NAVIGATION_MESH_MAX_COMPONENTS_3D]; ///< Normal vector + float center[NAVIGATION_MESH_MAX_COMPONENTS_3D]; ///< Barycentric coordinates }; /** @@ -118,7 +117,6 @@ public: NavigationMesh() = delete; public: - /** * @brief Destructor */ @@ -171,7 +169,6 @@ public: */ bool FindFloorForFace(const Dali::Vector3& position, uint32_t faceIndex, bool dontCheckNeighbours, Dali::Vector3& outPosition); - /** * @brief Returns pointer to Face structure * @param[in] index Index of face to retrieve @@ -253,8 +250,7 @@ public: static constexpr uint16_t NULL_EDGE{0xffff}; ///< represents null edge public: - - DALI_INTERNAL explicit NavigationMesh( NavigationMeshImpl* impl ); + DALI_INTERNAL explicit NavigationMesh(NavigationMeshImpl* impl); std::unique_ptr mImpl; }; diff --git a/dali-scene3d/public-api/algorithm/path-finder-waypoint.cpp b/dali-scene3d/public-api/algorithm/path-finder-waypoint.cpp index 9254e04..edaf1e1 100644 --- a/dali-scene3d/public-api/algorithm/path-finder-waypoint.cpp +++ b/dali-scene3d/public-api/algorithm/path-finder-waypoint.cpp @@ -17,16 +17,15 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include #include -// EXTERNAL INCLUDES -#include - namespace Dali::Scene3D::Algorithm { - WayPoint::WayPoint() { mImpl = std::make_unique(); @@ -51,13 +50,13 @@ Dali::Vector3 WayPoint::GetScenePosition() const WayPoint::WayPoint(const WayPoint& wp) { - mImpl = std::make_unique(); + mImpl = std::make_unique(); *mImpl = *wp.mImpl; } WayPoint& WayPoint::operator=(const WayPoint& wp) { - mImpl = std::make_unique(); + mImpl = std::make_unique(); *mImpl = *wp.mImpl; return *this; } @@ -67,4 +66,4 @@ WayPoint::operator Internal::Algorithm::WayPointData&() return *mImpl; } -} +} // namespace Dali::Scene3D::Algorithm diff --git a/dali-scene3d/public-api/algorithm/path-finder-waypoint.h b/dali-scene3d/public-api/algorithm/path-finder-waypoint.h index 201783c..ec07a5e 100644 --- a/dali-scene3d/public-api/algorithm/path-finder-waypoint.h +++ b/dali-scene3d/public-api/algorithm/path-finder-waypoint.h @@ -17,9 +17,6 @@ * limitations under the License. */ -// INTERNAL INCLUDES -#include - // EXTERNAL INCLUDES #include #include @@ -27,6 +24,9 @@ #include #include +// INTERNAL INCLUDES +#include + namespace Dali::Scene3D::Internal::Algorithm { class WayPointData; @@ -42,7 +42,6 @@ namespace Dali::Scene3D::Algorithm class DALI_SCENE3D_API WayPoint { public: - /** * @brief Constructor */ @@ -101,14 +100,11 @@ public: WayPoint& operator=(const WayPoint&); private: - std::unique_ptr mImpl; public: - DALI_INTERNAL operator Internal::Algorithm::WayPointData&(); - }; -} +} // namespace Dali::Scene3D::Algorithm #endif // DALI_SCENE3D_PATH_FINDER_WAYPOINT_H diff --git a/dali-scene3d/public-api/algorithm/path-finder.cpp b/dali-scene3d/public-api/algorithm/path-finder.cpp index f48ffb3..6f29448 100644 --- a/dali-scene3d/public-api/algorithm/path-finder.cpp +++ b/dali-scene3d/public-api/algorithm/path-finder.cpp @@ -17,6 +17,7 @@ // CLASS HEADER #include +// INTERNAL INCLUDES // default algorithm #include #include diff --git a/dali-scene3d/public-api/controls/model/model.h b/dali-scene3d/public-api/controls/model/model.h index ce723ea..da3f7a6 100644 --- a/dali-scene3d/public-api/controls/model/model.h +++ b/dali-scene3d/public-api/controls/model/model.h @@ -18,15 +18,15 @@ * */ -// INTERNAL INCLUDES -#include - // EXTERNAL INCLUDES #include #include #include #include +// INTERNAL INCLUDES +#include + namespace Dali { namespace Scene3D diff --git a/dali-scene3d/public-api/controls/scene-view/scene-view.h b/dali-scene3d/public-api/controls/scene-view/scene-view.h index 1a3407f..f64715d 100644 --- a/dali-scene3d/public-api/controls/scene-view/scene-view.h +++ b/dali-scene3d/public-api/controls/scene-view/scene-view.h @@ -18,15 +18,15 @@ * */ -// INTERNAL INCLUDES -#include -#include - // EXTERNAL INCLUDES #include #include #include +// INTERNAL INCLUDES +#include +#include + namespace Dali { namespace Scene3D diff --git a/dali-scene3d/public-api/loader/alpha-function-helper.cpp b/dali-scene3d/public-api/loader/alpha-function-helper.cpp index 1ac61ee..2aecc50 100644 --- a/dali-scene3d/public-api/loader/alpha-function-helper.cpp +++ b/dali-scene3d/public-api/loader/alpha-function-helper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -14,14 +14,14 @@ * limitations under the License. * */ -#include "dali-scene3d/public-api/loader/alpha-function-helper.h" + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace { @@ -67,6 +67,4 @@ void RegisterAlphaFunction(const std::string& name, AlphaFunction alphaFn) "Function with given key already exists."); } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/alpha-function-helper.h b/dali-scene3d/public-api/loader/alpha-function-helper.h index d421a3e..3fdb4ed 100644 --- a/dali-scene3d/public-api/loader/alpha-function-helper.h +++ b/dali-scene3d/public-api/loader/alpha-function-helper.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_ALPHA_FUNCTION_HELPER_H_ #define DALI_SCENE3D_LOADER_ALPHA_FUNCTION_HELPER_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,16 +17,14 @@ * */ -#include "dali-scene3d/public-api/api.h" - +// EXTERNAL INCLUDES +#include #include -#include "dali/public-api/animation/alpha-function.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { /** * @return Given a name, provide a AlphaFunction; if the name was not @@ -40,8 +38,6 @@ AlphaFunction DALI_SCENE3D_API GetAlphaFunction(const std::string& name, bool* f */ void DALI_SCENE3D_API RegisterAlphaFunction(const std::string& name, AlphaFunction alphaFn) noexcept(false); -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_ALPHA_FUNCTION_HELPER_H_ diff --git a/dali-scene3d/public-api/loader/animated-property.cpp b/dali-scene3d/public-api/loader/animated-property.cpp index 83ae2df..a3969ff 100644 --- a/dali-scene3d/public-api/loader/animated-property.cpp +++ b/dali-scene3d/public-api/loader/animated-property.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -14,13 +14,11 @@ * limitations under the License. * */ -#include "dali-scene3d/public-api/loader/animated-property.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// CLASS HEADER +#include + +namespace Dali::Scene3D::Loader { void AnimatedProperty::Animate(Animation& anim, GetActor getActor) { @@ -45,6 +43,4 @@ void AnimatedProperty::Animate(Animation& anim, GetActor getActor) } } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader \ No newline at end of file diff --git a/dali-scene3d/public-api/loader/animated-property.h b/dali-scene3d/public-api/loader/animated-property.h index 87fe87a..07b251f 100644 --- a/dali-scene3d/public-api/loader/animated-property.h +++ b/dali-scene3d/public-api/loader/animated-property.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_ANIMATED_PROPERTY_H #define DALI_SCENE3D_LOADER_ANIMATED_PROPERTY_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,23 +17,18 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" -#include "dali-scene3d/public-api/loader/index.h" - - // EXTERNAL INCLUDES +#include +#include +#include #include #include -#include "dali/public-api/actors/actor.h" -#include "dali/public-api/animation/animation.h" -#include "dali/public-api/object/property.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include +#include + +namespace Dali::Scene3D::Loader { /** * @brief Intermediate representation for a property that's given to @@ -95,8 +90,6 @@ public: // DATA TimePeriod mTimePeriod = TimePeriod(0.f); }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_ANIMATED_PROPERTY_H diff --git a/dali-scene3d/public-api/loader/animation-definition.cpp b/dali-scene3d/public-api/loader/animation-definition.cpp index c201314..31c5ed1 100644 --- a/dali-scene3d/public-api/loader/animation-definition.cpp +++ b/dali-scene3d/public-api/loader/animation-definition.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -14,13 +14,11 @@ * limitations under the License. * */ -#include "dali-scene3d/public-api/loader/animation-definition.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// CLASS HEADER +#include + +namespace Dali::Scene3D::Loader { const float AnimationDefinition::DEFAULT_DURATION_SECONDS = 1.f; const float AnimationDefinition::MIN_DURATION_SECONDS = 1e-2f; @@ -85,6 +83,4 @@ AnimationDefinition& AnimationDefinition::operator=(AnimationDefinition&& other) return *this; } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/animation-definition.h b/dali-scene3d/public-api/loader/animation-definition.h index cb8e5db..27fe2ac 100644 --- a/dali-scene3d/public-api/loader/animation-definition.h +++ b/dali-scene3d/public-api/loader/animation-definition.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_ANIMATION_DEFINITION_H #define DALI_SCENE3D_LOADER_ANIMATION_DEFINITION_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,15 +17,14 @@ * */ -#include "dali-scene3d/public-api/api.h" -#include "dali-scene3d/public-api/loader/animated-property.h" -#include "dali/public-api/common/vector-wrapper.h" +// EXTERNAL INCLUDES +#include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include +#include + +namespace Dali::Scene3D::Loader { /** * @brief Animation handle + name + definition of properties. @@ -83,8 +82,6 @@ struct AnimationGroupDefinition std::vector mAnimations; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_ANIMATION_DEFINITION_H diff --git a/dali-scene3d/public-api/loader/blend-shape-details.cpp b/dali-scene3d/public-api/loader/blend-shape-details.cpp index 8e0353c..3ef97b2 100644 --- a/dali-scene3d/public-api/loader/blend-shape-details.cpp +++ b/dali-scene3d/public-api/loader/blend-shape-details.cpp @@ -1,6 +1,6 @@ /* -* Copyright (c) 2022 Samsung Electronics Co., Ltd. +* Copyright (c) 2023 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. @@ -26,11 +26,7 @@ // INTERNAL INCLUDES #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { const char* BlendShapes::NUMBER_OF_BLEND_SHAPES("uNumberOfBlendShapes"); const char* BlendShapes::UNNORMALIZE_FACTOR("uBlendShapeUnnormalizeFactor"); @@ -85,6 +81,4 @@ void BlendShapes::ConfigureProperties(const std::pair +#include #include -#include "dali/public-api/actors/actor.h" -#include "dali/public-api/rendering/shader.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { struct MeshDefinition; struct MeshGeometry; @@ -73,8 +69,6 @@ struct DALI_SCENE3D_API BlendShapes BlendShapes() = delete; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_BLEND_SHAPE_DETAILS_H diff --git a/dali-scene3d/public-api/loader/buffer-definition.cpp b/dali-scene3d/public-api/loader/buffer-definition.cpp index 2b85631..8f2bc57 100644 --- a/dali-scene3d/public-api/loader/buffer-definition.cpp +++ b/dali-scene3d/public-api/loader/buffer-definition.cpp @@ -15,7 +15,7 @@ * */ -// INTERNAL INCLUDES +// CLASS HEADER #include // EXTERNAL INCLUDES @@ -23,11 +23,7 @@ #include #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace { @@ -111,6 +107,4 @@ void BufferDefinition::LoadBuffer() } } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/buffer-definition.h b/dali-scene3d/public-api/loader/buffer-definition.h index 808d5a0..533aa04 100644 --- a/dali-scene3d/public-api/loader/buffer-definition.h +++ b/dali-scene3d/public-api/loader/buffer-definition.h @@ -17,20 +17,16 @@ * */ -// INTERNAL INCLUDES -#include - // EXTERNAL INCLUDES +#include +#include #include #include -#include -#include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { /** * @brief Defines a buffer that is loaded from input uri. @@ -45,7 +41,7 @@ struct DALI_SCENE3D_API BufferDefinition ~BufferDefinition(); - BufferDefinition(const BufferDefinition& other) = default; + BufferDefinition(const BufferDefinition& other) = default; BufferDefinition& operator=(const BufferDefinition& other) = default; BufferDefinition(BufferDefinition&& other); @@ -89,8 +85,6 @@ private: bool mIsEmbedded{false}; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_BUFFER_DEFINITION_H diff --git a/dali-scene3d/public-api/loader/bvh-loader.cpp b/dali-scene3d/public-api/loader/bvh-loader.cpp index 7d3b775..93a826d 100644 --- a/dali-scene3d/public-api/loader/bvh-loader.cpp +++ b/dali-scene3d/public-api/loader/bvh-loader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -25,11 +25,7 @@ #include #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace { @@ -340,6 +336,4 @@ AnimationDefinition LoadBvh(const std::string& path, const std::string& animatio return GenerateAnimation(animationName, rootJoint, frameCount, frameTime, scale); } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali \ No newline at end of file +} // namespace Dali::Scene3D::Loader \ No newline at end of file diff --git a/dali-scene3d/public-api/loader/bvh-loader.h b/dali-scene3d/public-api/loader/bvh-loader.h index 2c3dbc7..9830031 100644 --- a/dali-scene3d/public-api/loader/bvh-loader.h +++ b/dali-scene3d/public-api/loader/bvh-loader.h @@ -2,7 +2,7 @@ #define DALI_SCENE3D_LOADER_BVH_LOADER_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -21,13 +21,8 @@ // INTERNAL INCLUDES #include -namespace Dali +namespace Dali::Scene3D::Loader { -namespace Scene3D -{ -namespace Loader -{ - /** * @brief Loads motion capture data from bvh file format. * @@ -38,8 +33,6 @@ namespace Loader */ DALI_SCENE3D_API AnimationDefinition LoadBvh(const std::string& path, const std::string& animationName, const Vector3& scale = Vector3::ONE); -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_BVH_LOADER_H \ No newline at end of file diff --git a/dali-scene3d/public-api/loader/camera-parameters.cpp b/dali-scene3d/public-api/loader/camera-parameters.cpp index cc9a351..05bcef1 100644 --- a/dali-scene3d/public-api/loader/camera-parameters.cpp +++ b/dali-scene3d/public-api/loader/camera-parameters.cpp @@ -28,11 +28,7 @@ #include // for gltf2::UNDEFINED_FLOAT_VALUE #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace { @@ -270,6 +266,4 @@ bool CameraParameters::ConfigureCamera(CameraActor& camera, bool invertY) const return true; } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader \ No newline at end of file diff --git a/dali-scene3d/public-api/loader/customization.cpp b/dali-scene3d/public-api/loader/customization.cpp index f48c191..7922400 100644 --- a/dali-scene3d/public-api/loader/customization.cpp +++ b/dali-scene3d/public-api/loader/customization.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -14,14 +14,14 @@ * limitations under the License. * */ -#include "dali-scene3d/public-api/loader/customization.h" -#include "dali/devel-api/common/map-wrapper.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { struct Customization::Map::Impl { @@ -111,6 +111,4 @@ void Customization::Choices::Clear() mImpl->mOptions.clear(); } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader \ No newline at end of file diff --git a/dali-scene3d/public-api/loader/customization.h b/dali-scene3d/public-api/loader/customization.h index 667cada..90a42bf 100644 --- a/dali-scene3d/public-api/loader/customization.h +++ b/dali-scene3d/public-api/loader/customization.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_CUSTOMIZATION_STATE_H_ #define DALI_SCENE3D_LOADER_CUSTOMIZATION_STATE_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,19 +17,15 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" - // EXTERNAL INCLUDES +#include #include #include -#include "dali/public-api/common/vector-wrapper.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { /** * @brief Offers a description of an aspect of the scene that can be customized: @@ -119,8 +115,6 @@ struct DALI_SCENE3D_API Customization std::vector nodes; // to apply option to. }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_CUSTOMIZATION_STATE_H_ diff --git a/dali-scene3d/public-api/loader/dli-input-parameter.h b/dali-scene3d/public-api/loader/dli-input-parameter.h index a81ba0c..1db4844 100644 --- a/dali-scene3d/public-api/loader/dli-input-parameter.h +++ b/dali-scene3d/public-api/loader/dli-input-parameter.h @@ -17,20 +17,15 @@ * */ +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include #include -// EXTERNAL INCLUDES -#include - -namespace Dali -{ -namespace Scene3D +namespace Dali::Scene3D::Loader { -namespace Loader -{ - class DliInputParameter : public ModelLoader::InputParameter { public: @@ -88,8 +83,6 @@ public: AnimationProcessor mAnimationPropertyProcessor; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_DLI_INPUT_PARAMETER_H diff --git a/dali-scene3d/public-api/loader/environment-definition.cpp b/dali-scene3d/public-api/loader/environment-definition.cpp index 3dea7c9..16ec2df 100644 --- a/dali-scene3d/public-api/loader/environment-definition.cpp +++ b/dali-scene3d/public-api/loader/environment-definition.cpp @@ -15,14 +15,16 @@ * */ +// CLASS HEADER +#include + // EXTERNAL INCLUDES #include #include // INTERNAL INCLUDES -#include "dali-scene3d/public-api/loader/environment-map-loader.h" -#include "dali-scene3d/public-api/loader/environment-definition.h" -#include "dali-scene3d/public-api/loader/utils.h" +#include +#include namespace { @@ -35,11 +37,7 @@ std::string GetDaliImagePath() static constexpr float DEFAULT_INTENSITY = 1.0f; } // unnamed namespace -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace { @@ -109,6 +107,4 @@ float EnvironmentDefinition::GetDefaultIntensity() return DEFAULT_INTENSITY; } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader \ No newline at end of file diff --git a/dali-scene3d/public-api/loader/environment-definition.h b/dali-scene3d/public-api/loader/environment-definition.h index 8f1525d..3c4ceee 100644 --- a/dali-scene3d/public-api/loader/environment-definition.h +++ b/dali-scene3d/public-api/loader/environment-definition.h @@ -17,20 +17,16 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" -#include "dali-scene3d/public-api/loader/environment-map-data.h" - // EXTERNAL INCLUDES +#include +#include #include -#include "dali/public-api/math/quaternion.h" -#include "dali/public-api/rendering/texture.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include +#include + +namespace Dali::Scene3D::Loader { /** * @brief Defines an environment map with either or both of radiance @@ -62,10 +58,10 @@ struct DALI_SCENE3D_API EnvironmentDefinition EnvironmentDefinition() = default; - EnvironmentDefinition(const EnvironmentDefinition&) = delete; + EnvironmentDefinition(const EnvironmentDefinition&) = delete; EnvironmentDefinition& operator=(const EnvironmentDefinition&) = delete; - EnvironmentDefinition(EnvironmentDefinition&&) = default; + EnvironmentDefinition(EnvironmentDefinition&&) = default; EnvironmentDefinition& operator=(EnvironmentDefinition&&) = default; /** @@ -97,8 +93,6 @@ public: // DATA bool mUseBrdfTexture = false; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_ENVIRONMENT_DEFINITION_H diff --git a/dali-scene3d/public-api/loader/environment-map-data.cpp b/dali-scene3d/public-api/loader/environment-map-data.cpp index fdbd159..cca2952 100644 --- a/dali-scene3d/public-api/loader/environment-map-data.cpp +++ b/dali-scene3d/public-api/loader/environment-map-data.cpp @@ -24,11 +24,7 @@ // INTERNAL INCLUDES #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { Texture EnvironmentMapData::GetTexture() { @@ -67,6 +63,4 @@ Texture EnvironmentMapData::GetTexture() return mEnvironmentMapTexture; } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/environment-map-data.h b/dali-scene3d/public-api/loader/environment-map-data.h index 7f3ee8c..2feac5b 100644 --- a/dali-scene3d/public-api/loader/environment-map-data.h +++ b/dali-scene3d/public-api/loader/environment-map-data.h @@ -17,21 +17,17 @@ * */ -// INTERNAL INCLUDES -#include -#include - // EXTERNAL INCLUDES #include #include -#include #include +#include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include +#include + +namespace Dali::Scene3D::Loader { /** * @brief Stores the pixel data objects for environment map texture. @@ -78,8 +74,6 @@ private: Dali::Scene3D::EnvironmentMapType mEnvironmentMapType{Dali::Scene3D::EnvironmentMapType::AUTO}; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_ENVIRONMENT_MAP_DATA_H diff --git a/dali-scene3d/public-api/loader/environment-map-loader.cpp b/dali-scene3d/public-api/loader/environment-map-loader.cpp index 175c19a..7abff75 100644 --- a/dali-scene3d/public-api/loader/environment-map-loader.cpp +++ b/dali-scene3d/public-api/loader/environment-map-loader.cpp @@ -18,14 +18,14 @@ // FILE HEADER #include -// INTERNAL INCLUDES -#include - // EXTERNAL INCLUDES #include #include #include +// INTERNAL INCLUDES +#include + namespace Dali { namespace @@ -45,21 +45,19 @@ static constexpr uint32_t CUBEMAP_INDEX_X[NUMBER_OF_CUBE_MAP_TYPE][6] = {{2, 0, static constexpr uint32_t CUBEMAP_INDEX_Y[NUMBER_OF_CUBE_MAP_TYPE][6] = {{1, 1, 0, 2, 1, 1}, {0, 0, 0, 0, 0, 0}, {1, 3, 0, 2, 1, 1}, {0, 1, 2, 3, 4, 5}}; static constexpr Vector2 NUMBER_OF_CUBE_FACE[NUMBER_OF_CUBE_MAP_TYPE] = -{ - Vector2(4, 3), - Vector2(6, 1), - Vector2(3, 4), - Vector2(1, 6) -}; + { + Vector2(4, 3), + Vector2(6, 1), + Vector2(3, 4), + Vector2(1, 6)}; static constexpr float expectedAspectRatios[NUMBER_OF_ENVIRONMENT_MAP_TYPE] = -{ - 4.0f / 3.0f, - 6.0f / 1.0f, - 3.0f / 4.0f, - 1.0f / 6.0f, - 2.0f / 1.0f -}; + { + 4.0f / 3.0f, + 6.0f / 1.0f, + 3.0f / 4.0f, + 1.0f / 6.0f, + 2.0f / 1.0f}; enum CubeType { @@ -189,7 +187,6 @@ namespace Scene3D { namespace Loader { - bool LoadEnvironmentMap(const std::string& environmentMapUrl, EnvironmentMapData& environmentMapData) { std::filesystem::path modelPath(environmentMapUrl); diff --git a/dali-scene3d/public-api/loader/environment-map-loader.h b/dali-scene3d/public-api/loader/environment-map-loader.h index 57047ea..f07f28c 100644 --- a/dali-scene3d/public-api/loader/environment-map-loader.h +++ b/dali-scene3d/public-api/loader/environment-map-loader.h @@ -19,16 +19,11 @@ // INTERNAL INCLUDES #include -#include #include +#include -namespace Dali -{ -namespace Scene3D +namespace Dali::Scene3D::Loader { -namespace Loader -{ - /** * @brief Loads environment map data from a environment map file. * @@ -38,8 +33,6 @@ namespace Loader */ bool DALI_SCENE3D_API LoadEnvironmentMap(const std::string& environmentMapUrl, EnvironmentMapData& environmentMapData); -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_ENVIRONMENT_MAP_LOADER_H diff --git a/dali-scene3d/public-api/loader/index.h b/dali-scene3d/public-api/loader/index.h index 3048def..cbf09a2 100644 --- a/dali-scene3d/public-api/loader/index.h +++ b/dali-scene3d/public-api/loader/index.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_INDEX_H_ #define DALI_SCENE3D_LOADER_INDEX_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,24 +17,18 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" - // EXTERNAL INCLUDES #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { using Index = uint32_t; constexpr Index INVALID_INDEX = static_cast(-1); -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_INDEX_H_ diff --git a/dali-scene3d/public-api/loader/ktx-loader.h b/dali-scene3d/public-api/loader/ktx-loader.h index fcb3b7d..d495ee0 100644 --- a/dali-scene3d/public-api/loader/ktx-loader.h +++ b/dali-scene3d/public-api/loader/ktx-loader.h @@ -21,11 +21,7 @@ #include #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { /** * @brief Loads cube map data texture from a ktx file. @@ -36,8 +32,6 @@ namespace Loader */ bool LoadKtxData(const std::string& path, EnvironmentMapData& environmentMapData); -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_KTX_LOADER_H diff --git a/dali-scene3d/public-api/loader/light-parameters.h b/dali-scene3d/public-api/loader/light-parameters.h index 2fde52e..e148413 100644 --- a/dali-scene3d/public-api/loader/light-parameters.h +++ b/dali-scene3d/public-api/loader/light-parameters.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_LIGHT_PARAMETERS_H #define DALI_SCENE3D_LOADER_LIGHT_PARAMETERS_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,19 +17,15 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" - // EXTERNAL INCLUDES +#include +#include #include -#include "dali/public-api/math/matrix.h" -#include "dali/public-api/math/vector3.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { struct DALI_SCENE3D_API LightParameters { @@ -42,8 +38,6 @@ struct DALI_SCENE3D_API LightParameters float orthographicSize; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_LIGHT_PARAMETERS_H diff --git a/dali-scene3d/public-api/loader/load-result.h b/dali-scene3d/public-api/loader/load-result.h index bd7e486..da05a36 100644 --- a/dali-scene3d/public-api/loader/load-result.h +++ b/dali-scene3d/public-api/loader/load-result.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_OUTPUT_H #define DALI_SCENE3D_LOADER_OUTPUT_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -24,11 +24,7 @@ #include #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { class ResourceBundle; class SceneDefinition; @@ -74,8 +70,6 @@ struct DALI_SCENE3D_API LoadResult std::vector& mLightParameters; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_OUTPUT_H diff --git a/dali-scene3d/public-api/loader/material-definition.cpp b/dali-scene3d/public-api/loader/material-definition.cpp index 58ab65d..ac6b73a 100644 --- a/dali-scene3d/public-api/loader/material-definition.cpp +++ b/dali-scene3d/public-api/loader/material-definition.cpp @@ -15,7 +15,7 @@ * */ -// INTERNAL INCLUDES +// CLASS HEADER #include // EXTERNAL INCLUDES diff --git a/dali-scene3d/public-api/loader/material-definition.h b/dali-scene3d/public-api/loader/material-definition.h index ca63129..b40a746 100644 --- a/dali-scene3d/public-api/loader/material-definition.h +++ b/dali-scene3d/public-api/loader/material-definition.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_MATERIAL_DEFINITION_H #define DALI_SCENE3D_LOADER_MATERIAL_DEFINITION_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,23 +17,19 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" -#include "dali-scene3d/public-api/loader/environment-definition.h" -#include "dali-scene3d/public-api/loader/index.h" -#include "dali-scene3d/public-api/loader/utils.h" - // EXTERNAL INCLUDES +#include #include +#include #include -#include "dali/public-api/common/vector-wrapper.h" -#include "dali/public-api/math/vector4.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include +#include +#include +#include + +namespace Dali::Scene3D::Loader { /** * @brief Helper enum for encoding and decoding sampler states. @@ -254,8 +250,6 @@ public: // DATA std::vector mTextureStages; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_MATERIAL_DEFINITION_H diff --git a/dali-scene3d/public-api/loader/matrix-stack.cpp b/dali-scene3d/public-api/loader/matrix-stack.cpp index a7b8870..146e4ed 100644 --- a/dali-scene3d/public-api/loader/matrix-stack.cpp +++ b/dali-scene3d/public-api/loader/matrix-stack.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Samsung Electronics Co., Ltd. +* Copyright (c) 2023 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. @@ -14,14 +14,14 @@ * limitations under the License. * */ -#include "dali-scene3d/public-api/loader/matrix-stack.h" -#include "dali-scene3d/public-api/loader/utils.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// CLASS HEADER +#include + +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { MatrixStack::MatrixStack() { @@ -63,6 +63,4 @@ void MatrixStack::PopAll() mStack.clear(); } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/matrix-stack.h b/dali-scene3d/public-api/loader/matrix-stack.h index 63bbc90..f34614b 100644 --- a/dali-scene3d/public-api/loader/matrix-stack.h +++ b/dali-scene3d/public-api/loader/matrix-stack.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADERER_MATRIX_STACK_H_ #define DALI_SCENE3D_LOADERER_MATRIX_STACK_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,18 +17,14 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" - // EXTERNAL INCLUDES -#include "dali/public-api/common/vector-wrapper.h" -#include "dali/public-api/math/matrix.h" +#include +#include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { /** * @brief A stack of matrices whereby each newly pushed matrix is stored @@ -50,8 +46,6 @@ private: std::vector mStack; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADERER_MATRIX_STACK_H_ diff --git a/dali-scene3d/public-api/loader/mesh-definition.cpp b/dali-scene3d/public-api/loader/mesh-definition.cpp index 18093a5..3d5f6eb 100644 --- a/dali-scene3d/public-api/loader/mesh-definition.cpp +++ b/dali-scene3d/public-api/loader/mesh-definition.cpp @@ -15,8 +15,8 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/loader/mesh-definition.h" +// CLASS HEADER +#include // EXTERNAL INCLUDES #include @@ -27,11 +27,7 @@ #include #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace { @@ -1075,6 +1071,4 @@ MeshGeometry MeshDefinition::Load(RawData&& raw) const return meshGeometry; } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/mesh-definition.h b/dali-scene3d/public-api/loader/mesh-definition.h index bb4d716..7289b40 100644 --- a/dali-scene3d/public-api/loader/mesh-definition.h +++ b/dali-scene3d/public-api/loader/mesh-definition.h @@ -17,23 +17,19 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" -#include "dali-scene3d/public-api/loader/blend-shape-details.h" -#include "dali-scene3d/public-api/loader/index.h" -#include "dali-scene3d/public-api/loader/mesh-geometry.h" -#include "dali-scene3d/public-api/loader/utils.h" -#include - // EXTERNAL INCLUDES +#include #include -#include "dali/public-api/common/vector-wrapper.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include +#include +#include +#include +#include +#include + +namespace Dali::Scene3D::Loader { /** * @brief Defines a mesh with its attributes, the primitive type to render it as, @@ -177,10 +173,10 @@ struct DALI_SCENE3D_API MeshDefinition Accessor(const MeshDefinition::Blob& blob, const MeshDefinition::SparseBlob& sparse, - Index bufferIndex = INVALID_INDEX); + Index bufferIndex = INVALID_INDEX); Accessor(MeshDefinition::Blob&& blob, MeshDefinition::SparseBlob&& sparse, - Index bufferIndex = INVALID_INDEX); + Index bufferIndex = INVALID_INDEX); bool IsDefined() const { @@ -295,8 +291,6 @@ public: // DATA Index mSkeletonIdx = INVALID_INDEX; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_MESH_DEFINITION_H diff --git a/dali-scene3d/public-api/loader/mesh-geometry.h b/dali-scene3d/public-api/loader/mesh-geometry.h index 331acf7..1ce30a7 100644 --- a/dali-scene3d/public-api/loader/mesh-geometry.h +++ b/dali-scene3d/public-api/loader/mesh-geometry.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADERER_MESH_GEOMETRY_H #define DALI_SCENE3D_LOADERER_MESH_GEOMETRY_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,18 +17,14 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" - // EXTERNAL INCLUDES -#include "dali/public-api/rendering/geometry.h" -#include "dali/public-api/rendering/texture.h" +#include +#include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { struct DALI_SCENE3D_API MeshGeometry { @@ -38,8 +34,6 @@ struct DALI_SCENE3D_API MeshGeometry unsigned int blendShapeBufferOffset{0}; ///< Offset used to calculate the start of each blend shape. }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADERER_MESH_GEOMETRY_H diff --git a/dali-scene3d/public-api/loader/model-loader.cpp b/dali-scene3d/public-api/loader/model-loader.cpp index 219f0a9..2f5c34e 100644 --- a/dali-scene3d/public-api/loader/model-loader.cpp +++ b/dali-scene3d/public-api/loader/model-loader.cpp @@ -25,15 +25,11 @@ // INTERNAL INCLUDES #include -#include #include +#include #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace { @@ -156,6 +152,4 @@ void ModelLoader::LoadResource(Dali::Scene3D::Loader::ResourceBundle::PathProvid } } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/model-loader.h b/dali-scene3d/public-api/loader/model-loader.h index 7cec995..702b308 100644 --- a/dali-scene3d/public-api/loader/model-loader.h +++ b/dali-scene3d/public-api/loader/model-loader.h @@ -25,11 +25,7 @@ // EXTERNAL INCLUDES #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace Internal { @@ -119,8 +115,6 @@ private: std::shared_ptr mImpl; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_MODEL_LOADER_H diff --git a/dali-scene3d/public-api/loader/navigation-mesh-factory.cpp b/dali-scene3d/public-api/loader/navigation-mesh-factory.cpp index 9d03f0d..5f66539 100644 --- a/dali-scene3d/public-api/loader/navigation-mesh-factory.cpp +++ b/dali-scene3d/public-api/loader/navigation-mesh-factory.cpp @@ -17,19 +17,18 @@ // CLASS HEADER #include -// INTERNAL INCLUDES -#include - // EXTERNAL INCLUDES #include +// INTERNAL INCLUDES +#include + namespace Dali::Scene3D::Loader { - std::unique_ptr NavigationMeshFactory::CreateFromFile(std::string filename) { std::vector buffer; - auto fin = fopen(filename.c_str(), "rb"); + auto fin = fopen(filename.c_str(), "rb"); if(!fin) { DALI_LOG_ERROR("NavigationMesh: Can't open %s for reading: %s", filename.c_str(), strerror(errno)); @@ -50,14 +49,14 @@ std::unique_ptr NavigationMeshFactory::CreateFromFile } fclose(fin); - return CreateFromBuffer( buffer ); + return CreateFromBuffer(buffer); } } std::unique_ptr NavigationMeshFactory::CreateFromBuffer(const std::vector& buffer) { auto impl = new Scene3D::Internal::Algorithm::NavigationMesh(buffer); - return std::unique_ptr( new Algorithm::NavigationMesh(impl)); + return std::unique_ptr(new Algorithm::NavigationMesh(impl)); } -} \ No newline at end of file +} // namespace Dali::Scene3D::Loader \ No newline at end of file diff --git a/dali-scene3d/public-api/loader/navigation-mesh-factory.h b/dali-scene3d/public-api/loader/navigation-mesh-factory.h index 0bbe8a9..bbe5f00 100644 --- a/dali-scene3d/public-api/loader/navigation-mesh-factory.h +++ b/dali-scene3d/public-api/loader/navigation-mesh-factory.h @@ -17,19 +17,15 @@ * limitations under the License. */ +// EXTERNAL INCLUDES +#include +#include + // INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" #include +#include -// EXTERNAL INCLUDES -#include "dali/public-api/rendering/geometry.h" -#include "dali/public-api/rendering/texture.h" - -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { struct DALI_SCENE3D_API NavigationMeshFactory { @@ -49,10 +45,7 @@ public: * @return Valid NavigationMesh or nullptr */ static std::unique_ptr CreateFromBuffer(const std::vector& buffer); - }; -} -} -} +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_INTERNAL_LOADER_NAVIGATION_MESH_FACTORY_H diff --git a/dali-scene3d/public-api/loader/node-definition.cpp b/dali-scene3d/public-api/loader/node-definition.cpp index 98405d7..f110150 100644 --- a/dali-scene3d/public-api/loader/node-definition.cpp +++ b/dali-scene3d/public-api/loader/node-definition.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -15,10 +15,12 @@ * */ -// INTERNAL -#include "dali-scene3d/public-api/loader/node-definition.h" -#include "dali-scene3d/public-api/loader/renderer-state.h" -#include "dali-scene3d/public-api/loader/utils.h" +// CLASS HEADER +#include + +// INTERNAL INCLUDES +#include +#include namespace Dali { diff --git a/dali-scene3d/public-api/loader/node-definition.h b/dali-scene3d/public-api/loader/node-definition.h index 0e9a5d7..7474a5f 100644 --- a/dali-scene3d/public-api/loader/node-definition.h +++ b/dali-scene3d/public-api/loader/node-definition.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_NODE_DEFINITION_H_ #define DALI_SCENE3D_LOADER_NODE_DEFINITION_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,19 +17,19 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/loader/customization.h" -#include "dali-scene3d/public-api/loader/matrix-stack.h" -#include "dali-scene3d/public-api/loader/resource-bundle.h" - // EXTERNAL INCLUDES +#include +#include +#include +#include #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" + +// INTERNAL INCLUDES +#include +#include +#include namespace Dali { diff --git a/dali-scene3d/public-api/loader/parse-renderer-state.cpp b/dali-scene3d/public-api/loader/parse-renderer-state.cpp index 3c01701..30b4d44 100644 --- a/dali-scene3d/public-api/loader/parse-renderer-state.cpp +++ b/dali-scene3d/public-api/loader/parse-renderer-state.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -15,15 +15,14 @@ * */ -#include "dali-scene3d/public-api/loader/parse-renderer-state.h" +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include #include -#include "dali/devel-api/common/map-wrapper.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace RendererState { @@ -168,6 +167,4 @@ Type Parse(const char* string, size_t length, StringCallback onError) } } // namespace RendererState -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/parse-renderer-state.h b/dali-scene3d/public-api/loader/parse-renderer-state.h index 43ca5b3..65a6269 100644 --- a/dali-scene3d/public-api/loader/parse-renderer-state.h +++ b/dali-scene3d/public-api/loader/parse-renderer-state.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADERERER_INTERPRET_RENDERER_STATE_H #define DALI_SCENE3D_LOADERERER_INTERPRET_RENDERER_STATE_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,14 +17,11 @@ * */ -#include "dali-scene3d/public-api/loader/renderer-state.h" -#include "dali-scene3d/public-api/loader/string-callback.h" +// INTERNAL INCLUDES +#include +#include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace RendererState { @@ -44,8 +41,6 @@ namespace RendererState DALI_SCENE3D_API Type Parse(const char* string, size_t length = 0, StringCallback onError = DefaultErrorCallback); } // namespace RendererState -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADERERER_INTERPRET_RENDERER_STATE_H diff --git a/dali-scene3d/public-api/loader/renderer-state.cpp b/dali-scene3d/public-api/loader/renderer-state.cpp index cc2837b..c14d8a6 100644 --- a/dali-scene3d/public-api/loader/renderer-state.cpp +++ b/dali-scene3d/public-api/loader/renderer-state.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -14,14 +14,14 @@ * limitations under the License. * */ -#include "dali-scene3d/public-api/loader/renderer-state.h" -#include "dali-scene3d/public-api/loader/utils.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// CLASS HEADER +#include + +// INTENRAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { namespace { @@ -97,6 +97,4 @@ void Apply(Type rendererState, Renderer& renderer) } // namespace RendererState -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/renderer-state.h b/dali-scene3d/public-api/loader/renderer-state.h index 0dc3c52..240a343 100644 --- a/dali-scene3d/public-api/loader/renderer-state.h +++ b/dali-scene3d/public-api/loader/renderer-state.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_RENDERER_STATE_H #define DALI_SCENE3D_LOADER_RENDERER_STATE_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,17 +17,13 @@ * */ -// INTERAL INCLUDES -#include "dali-scene3d/public-api/api.h" - // EXTERNAL INCLUDES -#include "dali/public-api/rendering/renderer.h" +#include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { /* * @brief Contains values for comparison functions used in depth and stencil testing. @@ -158,8 +154,6 @@ DALI_SCENE3D_API void Apply(Type rendererState, Renderer& renderer); } // namespace RendererState -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_RENDERER_STATE_H diff --git a/dali-scene3d/public-api/loader/resource-bundle.cpp b/dali-scene3d/public-api/loader/resource-bundle.cpp index c414c1f..6b4dde6 100644 --- a/dali-scene3d/public-api/loader/resource-bundle.cpp +++ b/dali-scene3d/public-api/loader/resource-bundle.cpp @@ -18,7 +18,7 @@ // FILE HEADER #include -// EXTERNAL +// EXTERNAL INCLUDES #include #include #include @@ -53,9 +53,7 @@ ResourceBundle::ResourceBundle() : mRawResourcesLoading(false), mResourcesGenerating(false), mRawResourcesLoaded(false), - mResourcesGenerated(false) -{ -}; + mResourcesGenerated(false){}; ResourceRefCounts ResourceBundle::CreateRefCounter() const { diff --git a/dali-scene3d/public-api/loader/resource-bundle.h b/dali-scene3d/public-api/loader/resource-bundle.h index ee56e70..fe386ca 100644 --- a/dali-scene3d/public-api/loader/resource-bundle.h +++ b/dali-scene3d/public-api/loader/resource-bundle.h @@ -17,7 +17,14 @@ * */ -// INTERNAL +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include + +// INTERNAL INCLUDES #include #include #include @@ -25,18 +32,7 @@ #include #include -// EXTERNAL -#include -#include -#include -#include -#include - -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { /* * @brief The types of resources that .dli may define. @@ -160,8 +156,6 @@ public: // DATA bool mResourcesGenerated; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADERERERERER_RESOURCE_BUNDLE_H_ diff --git a/dali-scene3d/public-api/loader/scene-definition.cpp b/dali-scene3d/public-api/loader/scene-definition.cpp index f41422e..f8377c3 100644 --- a/dali-scene3d/public-api/loader/scene-definition.cpp +++ b/dali-scene3d/public-api/loader/scene-definition.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -15,16 +15,18 @@ * */ -// EXTERNAL -#include "dali/devel-api/common/map-wrapper.h" -#include "dali/public-api/animation/constraints.h" +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include +#include // INTERNAL -#include "dali-scene3d/internal/graphics/builtin-shader-extern-gen.h" -#include "dali-scene3d/public-api/loader/blend-shape-details.h" -#include "dali-scene3d/public-api/loader/scene-definition.h" -#include "dali-scene3d/public-api/loader/skinning-details.h" -#include "dali-scene3d/public-api/loader/utils.h" +#include +#include +#include +#include //#define DEBUG_SCENE_DEFINITION //#define DEBUG_JOINTS @@ -37,11 +39,7 @@ #define LOGD(x) DEBUG_ONLY(printf x; printf("\n"); fflush(stdout)) -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace { @@ -1195,6 +1193,4 @@ bool SceneDefinition::FindNode(const std::string& name, std::unique_ptr +#include +#include +#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" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include +#include +#include +#include + +namespace Dali::Scene3D::Loader { class MatrixStack; @@ -274,8 +270,6 @@ private: // DATA std::vector mRootNodeIds; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADERER_SCENE_DEFINITION_H_ diff --git a/dali-scene3d/public-api/loader/shader-definition-factory.cpp b/dali-scene3d/public-api/loader/shader-definition-factory.cpp index b5566e0..5db7ab0 100644 --- a/dali-scene3d/public-api/loader/shader-definition-factory.cpp +++ b/dali-scene3d/public-api/loader/shader-definition-factory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -14,18 +14,20 @@ * limitations under the License. * */ -#include "dali-scene3d/public-api/loader/shader-definition-factory.h" + +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include #include -#include "dali-scene3d/internal/loader/hash.h" -#include "dali-scene3d/public-api/loader/blend-shape-details.h" -#include "dali-scene3d/public-api/loader/node-definition.h" -#include "dali/devel-api/common/map-wrapper.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include +#include +#include + +namespace Dali::Scene3D::Loader { namespace { @@ -375,6 +377,4 @@ Index ShaderDefinitionFactory::ProduceShader(NodeDefinition::Renderable& rendera return renderable.mShaderIdx; } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/shader-definition-factory.h b/dali-scene3d/public-api/loader/shader-definition-factory.h index b7e9195..273ac8f 100644 --- a/dali-scene3d/public-api/loader/shader-definition-factory.h +++ b/dali-scene3d/public-api/loader/shader-definition-factory.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_SHADER_DEFINITION_FACTORY_H_ #define DALI_SCENE3D_LOADER_SHADER_DEFINITION_FACTORY_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,19 +17,15 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" -#include "dali-scene3d/public-api/loader/index.h" -#include - // EXTERNAL INCLUDER #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include +#include +#include + +namespace Dali::Scene3D::Loader { struct NodeDefinition; class ResourceBundle; @@ -59,8 +55,6 @@ private: const std::unique_ptr mImpl; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_SHADER_DEFINITION_FACTORY_H_ diff --git a/dali-scene3d/public-api/loader/shader-definition.cpp b/dali-scene3d/public-api/loader/shader-definition.cpp index a753155..2796340 100644 --- a/dali-scene3d/public-api/loader/shader-definition.cpp +++ b/dali-scene3d/public-api/loader/shader-definition.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -15,16 +15,14 @@ * */ +// CLASS HEADER +#include + // INTERNAL INCLUDES -#include "dali-scene3d/public-api/loader/shader-definition.h" #include -#include "dali-scene3d/public-api/loader/utils.h" +#include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace { @@ -144,6 +142,4 @@ Shader ShaderDefinition::Load(RawData&& raw) const return shader; } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/shader-definition.h b/dali-scene3d/public-api/loader/shader-definition.h index 3d3236b..27bb051 100644 --- a/dali-scene3d/public-api/loader/shader-definition.h +++ b/dali-scene3d/public-api/loader/shader-definition.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_SHADER_DEFINITION_H #define DALI_SCENE3D_LOADER_SHADER_DEFINITION_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,19 +17,15 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/loader/renderer-state.h" - // EXTERNAL INCLUDES +#include +#include #include -#include "dali/public-api/common/vector-wrapper.h" -#include "dali/public-api/rendering/shader.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { /* * @brief Defines a shader with paths to the files which define its @@ -56,7 +52,7 @@ struct DALI_SCENE3D_API ShaderDefinition ShaderDefinition(const ShaderDefinition& other); ShaderDefinition& operator=(const ShaderDefinition& other); - ShaderDefinition(ShaderDefinition&&) = default; + ShaderDefinition(ShaderDefinition&&) = default; ShaderDefinition& operator=(ShaderDefinition&&) = default; /* @@ -86,8 +82,6 @@ public: // DATA bool mUseBuiltInShader{false}; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_SHADER_DEFINITION_H diff --git a/dali-scene3d/public-api/loader/skeleton-definition.h b/dali-scene3d/public-api/loader/skeleton-definition.h index b2d61a8..7161a34 100644 --- a/dali-scene3d/public-api/loader/skeleton-definition.h +++ b/dali-scene3d/public-api/loader/skeleton-definition.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADERER_SKELETON_H #define DALI_SCENE3D_LOADERER_SKELETON_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -18,17 +18,13 @@ */ // INTERNAL INCLUDES -#include "dali-scene3d/public-api/loader/index.h" +#include // EXTERNAL INCLUDES -#include "dali/public-api/common/vector-wrapper.h" -#include "dali/public-api/math/matrix.h" +#include +#include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { /* * @brief A set of joints (stored as node indices), and an optional root node index. @@ -50,8 +46,6 @@ struct DALI_SCENE3D_API SkeletonDefinition std::vector mJoints; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADERER_SKELETON_H diff --git a/dali-scene3d/public-api/loader/skinning-details.cpp b/dali-scene3d/public-api/loader/skinning-details.cpp index e100151..0e5e499 100644 --- a/dali-scene3d/public-api/loader/skinning-details.cpp +++ b/dali-scene3d/public-api/loader/skinning-details.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -14,20 +14,18 @@ * limitations under the License. * */ -#include "dali-scene3d/public-api/loader/skinning-details.h" -#include "dali/public-api/animation/constraints.h" -#include "dali/public-api/object/property.h" -#include "dali/public-api/rendering/shader.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include +#include +#include + +namespace Dali::Scene3D::Loader { const unsigned int Skinning::MAX_JOINTS = 64; const char* Skinning::BONE_UNIFORM_NAME = "uBone"; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/skinning-details.h b/dali-scene3d/public-api/loader/skinning-details.h index d754f0c..41a9790 100644 --- a/dali-scene3d/public-api/loader/skinning-details.h +++ b/dali-scene3d/public-api/loader/skinning-details.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_SKINNING_DETAILS_H_ #define DALI_SCENE3D_LOADER_SKINNING_DETAILS_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,18 +17,14 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" - // EXTERNAL INCLUDES +#include #include -#include "dali/public-api/rendering/shader.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { struct DALI_SCENE3D_API Skinning { @@ -45,8 +41,6 @@ struct DALI_SCENE3D_API Skinning Skinning() = delete; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif // DALI_SCENE3D_LOADER_SKINNING_DETAILS_H_ diff --git a/dali-scene3d/public-api/loader/string-callback.cpp b/dali-scene3d/public-api/loader/string-callback.cpp index 5d46cb7..eb85bad 100644 --- a/dali-scene3d/public-api/loader/string-callback.cpp +++ b/dali-scene3d/public-api/loader/string-callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -14,20 +14,18 @@ * limitations under the License. * */ -#include "dali-scene3d/public-api/loader/string-callback.h" -#include "dali/integration-api/debug.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// CLASS HEADER +#include + +// EXTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { void DefaultErrorCallback(const std::string& message) { DALI_LOG_ERROR("%s", message.c_str()); } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/string-callback.h b/dali-scene3d/public-api/loader/string-callback.h index 4f00a10..7a3564d 100644 --- a/dali-scene3d/public-api/loader/string-callback.h +++ b/dali-scene3d/public-api/loader/string-callback.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_STRING_CALLBACK_H #define DALI_SCENE3D_LOADER_STRING_CALLBACK_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,18 +17,14 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" - // EXTERNAL INCLUDES #include #include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { /* * @brief A callback to post strings to. @@ -40,8 +36,6 @@ using StringCallback = std::function; */ DALI_SCENE3D_API void DefaultErrorCallback(const std::string& message); -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_STRING_CALLBACK_H diff --git a/dali-scene3d/public-api/loader/utils.cpp b/dali-scene3d/public-api/loader/utils.cpp index 14b4150..9120b65 100644 --- a/dali-scene3d/public-api/loader/utils.cpp +++ b/dali-scene3d/public-api/loader/utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -15,22 +15,18 @@ * */ -// INTERNAL -#include "dali-scene3d/public-api/loader/utils.h" +// CLASS HEADER +#include -// EXTERNAL +// EXTERNAL INCLUDES +#include +#include #include #include #include #include -#include "dali/public-api/animation/constraints.h" -#include "dali/public-api/common/vector-wrapper.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +namespace Dali::Scene3D::Loader { namespace { @@ -152,6 +148,4 @@ void ToUnixFileSeparators(std::string& path) std::replace(path.begin(), path.end(), '\\', '/'); } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/utils.h b/dali-scene3d/public-api/loader/utils.h index 3a84f09..17d4261 100644 --- a/dali-scene3d/public-api/loader/utils.h +++ b/dali-scene3d/public-api/loader/utils.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_UTILS_H_ #define DALI_SCENE3D_LOADER_UTILS_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,21 +17,17 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" - // EXTERNAL INCLUDES +#include +#include +#include #include #include -#include "dali/public-api/actors/actor.h" -#include "dali/public-api/common/dali-common.h" -#include "dali/public-api/rendering/renderer.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { /* * @brief Fixed size backing buffer to use with std::ostreams where control over @@ -199,8 +195,6 @@ DALI_SCENE3D_API Geometry MakeTexturedQuadGeometry(TexturedQuadOptions::Type opt */ DALI_SCENE3D_API void ToUnixFileSeparators(std::string& path); -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif /* DALI_SCENE3D_LOADER_UTILS_H_ */ diff --git a/dali-scene3d/public-api/loader/view-projection.cpp b/dali-scene3d/public-api/loader/view-projection.cpp index ac970ca..259892f 100644 --- a/dali-scene3d/public-api/loader/view-projection.cpp +++ b/dali-scene3d/public-api/loader/view-projection.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -14,14 +14,14 @@ * limitations under the License. * */ -#include "dali-scene3d/public-api/loader/view-projection.h" -#include "dali-scene3d/public-api/loader/utils.h" -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// CLASS HEADER +#include + +// INTERNAL INCLDUES +#include + +namespace Dali::Scene3D::Loader { void ViewProjection::Update() { @@ -34,6 +34,4 @@ void ViewProjection::Update() } } -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader diff --git a/dali-scene3d/public-api/loader/view-projection.h b/dali-scene3d/public-api/loader/view-projection.h index db7be74..c1e5532 100644 --- a/dali-scene3d/public-api/loader/view-projection.h +++ b/dali-scene3d/public-api/loader/view-projection.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_VIEW_PROJECTION_H_ #define DALI_SCENE3D_LOADER_VIEW_PROJECTION_H_ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -17,17 +17,13 @@ * */ -// INTERNAL INCLUDES -#include "dali-scene3d/public-api/api.h" - // EXTERNAL INCLUDES -#include "dali/public-api/math/matrix.h" +#include -namespace Dali -{ -namespace Scene3D -{ -namespace Loader +// INTERNAL INCLUDES +#include + +namespace Dali::Scene3D::Loader { /** * @brief Contains view and projection matrices, also caching the view-projection @@ -74,8 +70,6 @@ private: Matrix mViewProjection; }; -} // namespace Loader -} // namespace Scene3D -} // namespace Dali +} // namespace Dali::Scene3D::Loader #endif //DALI_SCENE3D_LOADER_VIEW_PROJECTION_H_ -- 2.7.4