[dali_2.1.32] Merge branch 'devel/master' 18/278618/1
authorAdam Bialogonski <adam.b@samsung.com>
Fri, 22 Jul 2022 09:28:14 +0000 (10:28 +0100)
committerAdam Bialogonski <adam.b@samsung.com>
Fri, 22 Jul 2022 09:28:14 +0000 (10:28 +0100)
Change-Id: Ifc3979c1834ac73b40b3b356ec21e9ccd9a26901

166 files changed:
.gitignore
README.md
automated-tests/patch-coverage.pl
automated-tests/resources/animationTest.gltf [new file with mode: 0644]
automated-tests/resources/beer.bin [new file with mode: 0644]
automated-tests/resources/beer_modelViewTest.dli [new file with mode: 0644]
automated-tests/resources/cube.bin [new file with mode: 0644]
automated-tests/resources/cubemap_array_horizontal.png [new file with mode: 0644]
automated-tests/resources/cubemap_array_vertical.png [new file with mode: 0644]
automated-tests/resources/forest_diffuse_cubemap_cross_vertical.png [new file with mode: 0644]
automated-tests/resources/test.bvh [new file with mode: 0644]
automated-tests/src/dali-scene3d-internal/CMakeLists.txt [moved from automated-tests/src/dali-scene-loader-internal/CMakeLists.txt with 97% similarity]
automated-tests/src/dali-scene3d-internal/tct-dali-scene3d-internal-core.cpp [moved from automated-tests/src/dali-scene-loader-internal/tct-dali-scene-loader-internal-core.cpp with 71% similarity]
automated-tests/src/dali-scene3d-internal/utc-Dali-Gltf2Asset.cpp [moved from automated-tests/src/dali-scene-loader-internal/utc-Dali-Gltf2Asset.cpp with 98% similarity]
automated-tests/src/dali-scene3d-internal/utc-Dali-Hash.cpp [moved from automated-tests/src/dali-scene-loader-internal/utc-Dali-Hash.cpp with 94% similarity]
automated-tests/src/dali-scene3d-internal/utc-Dali-JsonReader.cpp [moved from automated-tests/src/dali-scene-loader-internal/utc-Dali-JsonReader.cpp with 97% similarity]
automated-tests/src/dali-scene3d-internal/utc-Dali-JsonUtil.cpp [moved from automated-tests/src/dali-scene-loader-internal/utc-Dali-JsonUtil.cpp with 99% similarity]
automated-tests/src/dali-scene3d/CMakeLists.txt [moved from automated-tests/src/dali-scene-loader/CMakeLists.txt with 95% similarity]
automated-tests/src/dali-scene3d/tct-dali-scene3d-core.cpp [moved from automated-tests/src/dali-scene-loader/tct-dali-scene-loader-core.cpp with 75% similarity]
automated-tests/src/dali-scene3d/utc-Dali-AlphaFunctionHelper.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-AlphaFunctionHelper.cpp with 95% similarity]
automated-tests/src/dali-scene3d/utc-Dali-AnimatedProperty.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-AnimatedProperty.cpp with 93% similarity]
automated-tests/src/dali-scene3d/utc-Dali-AnimationDefinition.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-AnimationDefinition.cpp with 96% similarity]
automated-tests/src/dali-scene3d/utc-Dali-BvhLoader.cpp [new file with mode: 0644]
automated-tests/src/dali-scene3d/utc-Dali-CameraParameters.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-CameraParameters.cpp with 95% similarity]
automated-tests/src/dali-scene3d/utc-Dali-CubeLoader.cpp [new file with mode: 0644]
automated-tests/src/dali-scene3d/utc-Dali-CubeMapLoader.cpp [new file with mode: 0644]
automated-tests/src/dali-scene3d/utc-Dali-DliLoader.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-DliLoader.cpp with 98% similarity]
automated-tests/src/dali-scene3d/utc-Dali-EnvironmentDefinition.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-EnvironmentDefinition.cpp with 97% similarity]
automated-tests/src/dali-scene3d/utc-Dali-FacialAnimation.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-FacialAnimation.cpp with 95% similarity]
automated-tests/src/dali-scene3d/utc-Dali-Gltf2Loader.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-Gltf2Loader.cpp with 97% similarity]
automated-tests/src/dali-scene3d/utc-Dali-KtxLoader.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-KtxLoader.cpp with 84% similarity]
automated-tests/src/dali-scene3d/utc-Dali-MatrixStack.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-MatrixStack.cpp with 94% similarity]
automated-tests/src/dali-scene3d/utc-Dali-MeshDefinition.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-MeshDefinition.cpp with 94% similarity]
automated-tests/src/dali-scene3d/utc-Dali-ModelView.cpp [new file with mode: 0644]
automated-tests/src/dali-scene3d/utc-Dali-NodeDefinition.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-NodeDefinition.cpp with 97% similarity]
automated-tests/src/dali-scene3d/utc-Dali-RendererState.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-RendererState.cpp with 97% similarity]
automated-tests/src/dali-scene3d/utc-Dali-ResourceBundle.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-ResourceBundle.cpp with 93% similarity]
automated-tests/src/dali-scene3d/utc-Dali-SceneDefinition.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-SceneDefinition.cpp with 98% similarity]
automated-tests/src/dali-scene3d/utc-Dali-ShaderDefinition.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-ShaderDefinition.cpp with 93% similarity]
automated-tests/src/dali-scene3d/utc-Dali-ShaderDefinitionFactory.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-ShaderDefinitionFactory.cpp with 97% similarity]
automated-tests/src/dali-scene3d/utc-Dali-StringCallback.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-StringCallback.cpp with 88% similarity]
automated-tests/src/dali-scene3d/utc-Dali-Utils.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-Utils.cpp with 95% similarity]
automated-tests/src/dali-scene3d/utc-Dali-ViewProjection.cpp [moved from automated-tests/src/dali-scene-loader/utc-Dali-ViewProjection.cpp with 95% similarity]
automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Accessible.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Shaping.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-web-engine.cpp
automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-Model3dView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp [changed mode: 0644->0755]
build/tizen/.gitignore
build/tizen/CMakeLists.txt
build/tizen/dali-scene3d/CMakeLists.txt [moved from build/tizen/dali-scene-loader/CMakeLists.txt with 82% similarity]
build/tizen/dali-scene3d/build.sh [moved from build/tizen/dali-scene-loader/build.sh with 100% similarity]
build/tizen/dali-scene3d/dali2-scene3d.pc.in [moved from build/tizen/dali-scene-loader/dali2-scene-loader.pc.in with 51% similarity]
build/tizen/docs-internal/dali-internal.doxy.in
build/tizen/docs/dali.doxy.in
dali-scene-loader/internal/file.list [deleted file]
dali-scene-loader/public-api/file.list [deleted file]
dali-scene3d.manifest [moved from dali-scene-loader.manifest with 100% similarity]
dali-scene3d.manifest-smack [moved from dali-scene-loader.manifest-smack with 100% similarity]
dali-scene3d/README.md [moved from dali-scene-loader/README.md with 99% similarity]
dali-scene3d/internal/controls/model-view/model-view-impl.cpp [new file with mode: 0644]
dali-scene3d/internal/controls/model-view/model-view-impl.h [new file with mode: 0644]
dali-scene3d/internal/file.list [new file with mode: 0644]
dali-scene3d/internal/graphics/shaders/default-physically-based-shader.frag [moved from dali-scene-loader/internal/graphics/shaders/default-physically-based-shader.frag with 98% similarity]
dali-scene3d/internal/graphics/shaders/default-physically-based-shader.vert [moved from dali-scene-loader/internal/graphics/shaders/default-physically-based-shader.vert with 100% similarity]
dali-scene3d/internal/graphics/shaders/scene3d-joint-debug.frag [moved from dali-scene-loader/internal/graphics/shaders/scene-loader-joint-debug.frag with 100% similarity]
dali-scene3d/internal/graphics/shaders/scene3d-joint-debug.vert [moved from dali-scene-loader/internal/graphics/shaders/scene-loader-joint-debug.vert with 100% similarity]
dali-scene3d/internal/loader/gltf2-asset.cpp [moved from dali-scene-loader/internal/gltf2-asset.cpp with 97% similarity]
dali-scene3d/internal/loader/gltf2-asset.h [moved from dali-scene-loader/internal/gltf2-asset.h with 97% similarity]
dali-scene3d/internal/loader/hash.cpp [moved from dali-scene-loader/internal/hash.cpp with 90% similarity]
dali-scene3d/internal/loader/hash.h [moved from dali-scene-loader/internal/hash.h with 91% similarity]
dali-scene3d/internal/loader/json-reader.cpp [moved from dali-scene-loader/internal/json-reader.cpp with 94% similarity]
dali-scene3d/internal/loader/json-reader.h [moved from dali-scene-loader/internal/json-reader.h with 97% similarity]
dali-scene3d/internal/loader/json-util.cpp [moved from dali-scene-loader/internal/json-util.cpp with 98% similarity]
dali-scene3d/internal/loader/json-util.h [moved from dali-scene-loader/internal/json-util.h with 90% similarity]
dali-scene3d/public-api/api.h [moved from dali-scene-loader/public-api/api.h with 61% similarity]
dali-scene3d/public-api/controls/model-view/model-view.cpp [new file with mode: 0644]
dali-scene3d/public-api/controls/model-view/model-view.h [new file with mode: 0644]
dali-scene3d/public-api/file.list [new file with mode: 0644]
dali-scene3d/public-api/loader/alpha-function-helper.cpp [moved from dali-scene-loader/public-api/alpha-function-helper.cpp with 90% similarity]
dali-scene3d/public-api/loader/alpha-function-helper.h [moved from dali-scene-loader/public-api/alpha-function-helper.h with 63% similarity]
dali-scene3d/public-api/loader/animated-property.cpp [moved from dali-scene-loader/public-api/animated-property.cpp with 85% similarity]
dali-scene3d/public-api/loader/animated-property.h [moved from dali-scene-loader/public-api/animated-property.h with 87% similarity]
dali-scene3d/public-api/loader/animation-definition.cpp [moved from dali-scene-loader/public-api/animation-definition.cpp with 92% similarity]
dali-scene3d/public-api/loader/animation-definition.h [moved from dali-scene-loader/public-api/animation-definition.h with 84% similarity]
dali-scene3d/public-api/loader/blend-shape-details.cpp [moved from dali-scene-loader/public-api/blend-shape-details.cpp with 93% similarity]
dali-scene3d/public-api/loader/blend-shape-details.h [moved from dali-scene-loader/public-api/blend-shape-details.h with 85% similarity]
dali-scene3d/public-api/loader/bvh-loader.cpp [new file with mode: 0644]
dali-scene3d/public-api/loader/bvh-loader.h [new file with mode: 0644]
dali-scene3d/public-api/loader/camera-parameters.cpp [moved from dali-scene-loader/public-api/camera-parameters.cpp with 96% similarity]
dali-scene3d/public-api/loader/camera-parameters.h [moved from dali-scene-loader/public-api/camera-parameters.h with 76% similarity]
dali-scene3d/public-api/loader/cube-data.cpp [new file with mode: 0644]
dali-scene3d/public-api/loader/cube-data.h [moved from dali-scene-loader/public-api/ktx-loader.h with 63% similarity]
dali-scene3d/public-api/loader/cube-loader.cpp [new file with mode: 0644]
dali-scene3d/public-api/loader/cube-loader.h [new file with mode: 0644]
dali-scene3d/public-api/loader/cube-map-loader.cpp [new file with mode: 0644]
dali-scene3d/public-api/loader/cube-map-loader.h [new file with mode: 0644]
dali-scene3d/public-api/loader/customization.cpp [moved from dali-scene-loader/public-api/customization.cpp with 92% similarity]
dali-scene3d/public-api/loader/customization.h [moved from dali-scene-loader/public-api/customization.h with 86% similarity]
dali-scene3d/public-api/loader/dli-loader.cpp [moved from dali-scene-loader/public-api/dli-loader.cpp with 89% similarity]
dali-scene3d/public-api/loader/dli-loader.h [moved from dali-scene-loader/public-api/dli-loader.h with 88% similarity]
dali-scene3d/public-api/loader/environment-definition.cpp [moved from dali-scene-loader/public-api/environment-definition.cpp with 91% similarity]
dali-scene3d/public-api/loader/environment-definition.h [moved from dali-scene-loader/public-api/environment-definition.h with 82% similarity]
dali-scene3d/public-api/loader/facial-animation-loader.cpp [moved from dali-scene-loader/public-api/facial-animation-loader.cpp with 93% similarity]
dali-scene3d/public-api/loader/facial-animation-loader.h [moved from dali-scene-loader/public-api/facial-animation-loader.h with 67% similarity]
dali-scene3d/public-api/loader/gltf2-loader.cpp [moved from dali-scene-loader/public-api/gltf2-loader.cpp with 98% similarity]
dali-scene3d/public-api/loader/gltf2-loader.h [moved from dali-scene-loader/public-api/gltf2-loader.h with 69% similarity]
dali-scene3d/public-api/loader/index.h [moved from dali-scene-loader/public-api/index.h with 72% similarity]
dali-scene3d/public-api/loader/ktx-loader.cpp [moved from dali-scene-loader/public-api/ktx-loader.cpp with 88% similarity]
dali-scene3d/public-api/loader/ktx-loader.h [new file with mode: 0644]
dali-scene3d/public-api/loader/light-parameters.h [moved from dali-scene-loader/public-api/light-parameters.h with 71% similarity]
dali-scene3d/public-api/loader/load-result.h [moved from dali-scene-loader/public-api/load-result.h with 74% similarity]
dali-scene3d/public-api/loader/material-definition.cpp [moved from dali-scene-loader/public-api/material-definition.cpp with 98% similarity]
dali-scene3d/public-api/loader/material-definition.h [moved from dali-scene-loader/public-api/material-definition.h with 91% similarity]
dali-scene3d/public-api/loader/matrix-stack.cpp [moved from dali-scene-loader/public-api/matrix-stack.cpp with 82% similarity]
dali-scene3d/public-api/loader/matrix-stack.h [moved from dali-scene-loader/public-api/matrix-stack.h with 77% similarity]
dali-scene3d/public-api/loader/mesh-definition.cpp [moved from dali-scene-loader/public-api/mesh-definition.cpp with 96% similarity]
dali-scene3d/public-api/loader/mesh-definition.h [moved from dali-scene-loader/public-api/mesh-definition.h with 83% similarity]
dali-scene3d/public-api/loader/mesh-geometry.h [moved from dali-scene-loader/public-api/mesh-geometry.h with 77% similarity]
dali-scene3d/public-api/loader/node-definition.cpp [moved from dali-scene-loader/public-api/node-definition.cpp with 76% similarity]
dali-scene3d/public-api/loader/node-definition.h [moved from dali-scene-loader/public-api/node-definition.h with 75% similarity]
dali-scene3d/public-api/loader/parse-renderer-state.cpp [moved from dali-scene-loader/public-api/parse-renderer-state.cpp with 95% similarity]
dali-scene3d/public-api/loader/parse-renderer-state.h [moved from dali-scene-loader/public-api/parse-renderer-state.h with 72% similarity]
dali-scene3d/public-api/loader/renderer-state.cpp [moved from dali-scene-loader/public-api/renderer-state.cpp with 93% similarity]
dali-scene3d/public-api/loader/renderer-state.h [moved from dali-scene-loader/public-api/renderer-state.h with 86% similarity]
dali-scene3d/public-api/loader/resource-bundle.cpp [moved from dali-scene-loader/public-api/resource-bundle.cpp with 95% similarity]
dali-scene3d/public-api/loader/resource-bundle.h [moved from dali-scene-loader/public-api/resource-bundle.h with 81% similarity]
dali-scene3d/public-api/loader/scene-definition.cpp [moved from dali-scene-loader/public-api/scene-definition.cpp with 98% similarity]
dali-scene3d/public-api/loader/scene-definition.h [moved from dali-scene-loader/public-api/scene-definition.h with 95% similarity]
dali-scene3d/public-api/loader/shader-definition-factory.cpp [moved from dali-scene-loader/public-api/shader-definition-factory.cpp with 94% similarity]
dali-scene3d/public-api/loader/shader-definition-factory.h [moved from dali-scene-loader/public-api/shader-definition-factory.h with 76% similarity]
dali-scene3d/public-api/loader/shader-definition.cpp [moved from dali-scene-loader/public-api/shader-definition.cpp with 93% similarity]
dali-scene3d/public-api/loader/shader-definition.h [moved from dali-scene-loader/public-api/shader-definition.h with 86% similarity]
dali-scene3d/public-api/loader/skeleton-definition.h [moved from dali-scene-loader/public-api/skeleton-definition.h with 78% similarity]
dali-scene3d/public-api/loader/skinning-details.cpp [moved from dali-scene-loader/public-api/skinning-details.cpp with 81% similarity]
dali-scene3d/public-api/loader/skinning-details.h [moved from dali-scene-loader/public-api/skinning-details.h with 72% similarity]
dali-scene3d/public-api/loader/string-callback.cpp [moved from dali-scene-loader/public-api/string-callback.cpp with 79% similarity]
dali-scene3d/public-api/loader/string-callback.h [moved from dali-scene-loader/public-api/string-callback.h with 69% similarity]
dali-scene3d/public-api/loader/utils.cpp [moved from dali-scene-loader/public-api/utils.cpp with 95% similarity]
dali-scene3d/public-api/loader/utils.h [moved from dali-scene-loader/public-api/utils.h with 76% similarity]
dali-scene3d/public-api/loader/view-projection.cpp [moved from dali-scene-loader/public-api/view-projection.cpp with 78% similarity]
dali-scene3d/public-api/loader/view-projection.h [moved from dali-scene-loader/public-api/view-projection.h with 82% similarity]
dali-scene3d/third-party/.clang-format [moved from dali-scene-loader/third-party/.clang-format with 100% similarity]
dali-scene3d/third-party/json.h [moved from dali-scene-loader/third-party/json.h with 100% similarity]
dali-toolkit/devel-api/controls/control-accessible.cpp
dali-toolkit/devel-api/controls/control-devel.h
dali-toolkit/devel-api/controls/web-view/web-context.cpp [deleted file]
dali-toolkit/devel-api/controls/web-view/web-context.h [deleted file]
dali-toolkit/devel-api/controls/web-view/web-cookie-manager.cpp [deleted file]
dali-toolkit/devel-api/controls/web-view/web-cookie-manager.h [deleted file]
dali-toolkit/devel-api/controls/web-view/web-view.cpp
dali-toolkit/devel-api/controls/web-view/web-view.h
dali-toolkit/devel-api/file.list
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.h
dali-toolkit/internal/controls/web-view/web-view-impl.cpp
dali-toolkit/internal/controls/web-view/web-view-impl.h
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/text/emoji-helper.cpp
dali-toolkit/internal/text/multi-language-support-impl.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 8fef0e8..e4e5fe8 100644 (file)
@@ -50,5 +50,5 @@ core
 compile_commands.json
 dali-toolkit/internal/graphics/generated/*
 dali-toolkit/internal/graphics/builtin-shader-extern-gen.h
-dali-scene-loader/internal/graphics/generated/*
-dali-scene-loader/internal/graphics/builtin-shader-extern-gen.h
+dali-scene3d/internal/graphics/generated/*
+dali-scene3d/internal/graphics/builtin-shader-extern-gen.h
index e4cfdbc..b744509 100644 (file)
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
          * Build with the Visual Studio project.
          * Build with CMake.
       * [4. Building for MacOS](#4-building-for-macos)
-   * [DALi Scene Loader](#dali-scene-loader)
+   * [DALi Scene3D](#dali-scene3d)
 
 # Build Instructions
 
@@ -131,6 +131,6 @@ To build, run:
 % make install -j8
 ```
 
-# DALi Scene Loader
+# DALi Scene3D
 
-For information about the DALi Scene Loader library, refer to dali-scene-loader/README.md.
+For information about the DALi Scene3D library, refer to dali-scene3d/README.md.
index 1f836a4..2f8bdb4 100755 (executable)
@@ -985,7 +985,7 @@ sub parse_diff
     $files{$file}->{"patch"} = [@checklines];
     $files{$file}->{"b_lines"} = {%b_lines};
 
-    my %filter = map { $_ => $files{$_} } grep {m!^dali(-toolkit|-scene-loader)?/!} (keys(%files));
+    my %filter = map { $_ => $files{$_} } grep {m!^dali(-toolkit|-scene3d)?/!} (keys(%files));
 
     if($pd_debug)
     {
diff --git a/automated-tests/resources/animationTest.gltf b/automated-tests/resources/animationTest.gltf
new file mode 100644 (file)
index 0000000..6c7b12c
--- /dev/null
@@ -0,0 +1,1419 @@
+{
+    "accessors" : [
+        {
+            "bufferView" : 0,
+            "componentType" : 5126,
+            "count" : 24,
+            "max" : [
+                1,
+                1,
+                1
+            ],
+            "min" : [
+                -1,
+                -1,
+                -1
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 1,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 2,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC2"
+        },
+        {
+            "bufferView" : 3,
+            "componentType" : 5121,
+            "count" : 36,
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 4,
+            "componentType" : 5126,
+            "count" : 24,
+            "max" : [
+                1,
+                1,
+                1
+            ],
+            "min" : [
+                -1,
+                -1,
+                -1
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 5,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 6,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC2"
+        },
+        {
+            "bufferView" : 7,
+            "componentType" : 5121,
+            "count" : 36,
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 8,
+            "componentType" : 5126,
+            "count" : 24,
+            "max" : [
+                1,
+                1,
+                1
+            ],
+            "min" : [
+                -1,
+                -1,
+                -1
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 9,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 10,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC2"
+        },
+        {
+            "bufferView" : 11,
+            "componentType" : 5121,
+            "count" : 36,
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 12,
+            "componentType" : 5126,
+            "count" : 24,
+            "max" : [
+                1,
+                1,
+                1
+            ],
+            "min" : [
+                -1,
+                -1,
+                -1
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 13,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 14,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC2"
+        },
+        {
+            "bufferView" : 15,
+            "componentType" : 5121,
+            "count" : 36,
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 16,
+            "componentType" : 5126,
+            "count" : 24,
+            "max" : [
+                1,
+                1,
+                1
+            ],
+            "min" : [
+                -1,
+                -1,
+                -1
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 17,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 18,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC2"
+        },
+        {
+            "bufferView" : 19,
+            "componentType" : 5121,
+            "count" : 36,
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 20,
+            "componentType" : 5126,
+            "count" : 24,
+            "max" : [
+                1,
+                1,
+                1
+            ],
+            "min" : [
+                -1,
+                -1,
+                -1
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 21,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 22,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC2"
+        },
+        {
+            "bufferView" : 23,
+            "componentType" : 5121,
+            "count" : 36,
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 24,
+            "componentType" : 5126,
+            "count" : 24,
+            "max" : [
+                1,
+                1,
+                1
+            ],
+            "min" : [
+                -1,
+                -1,
+                -1
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 25,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 26,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC2"
+        },
+        {
+            "bufferView" : 27,
+            "componentType" : 5121,
+            "count" : 36,
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 28,
+            "componentType" : 5126,
+            "count" : 24,
+            "max" : [
+                1,
+                1,
+                1
+            ],
+            "min" : [
+                -1,
+                -1,
+                -1
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 29,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 30,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC2"
+        },
+        {
+            "bufferView" : 31,
+            "componentType" : 5121,
+            "count" : 36,
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 32,
+            "componentType" : 5126,
+            "count" : 24,
+            "max" : [
+                1,
+                1,
+                1
+            ],
+            "min" : [
+                -1,
+                -1,
+                -1
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 33,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 34,
+            "componentType" : 5126,
+            "count" : 24,
+            "type" : "VEC2"
+        },
+        {
+            "bufferView" : 35,
+            "componentType" : 5121,
+            "count" : 36,
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 36,
+            "componentType" : 5126,
+            "count" : 4,
+            "max" : [
+                1,
+                0,
+                1
+            ],
+            "min" : [
+                -1,
+                0,
+                -1
+            ],
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 37,
+            "componentType" : 5126,
+            "count" : 4,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 38,
+            "componentType" : 5126,
+            "count" : 4,
+            "type" : "VEC2"
+        },
+        {
+            "bufferView" : 39,
+            "componentType" : 5121,
+            "count" : 6,
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 40,
+            "componentType" : 5126,
+            "count" : 5,
+            "max" : [
+                1.6666666666666667
+            ],
+            "min" : [
+                0.041666666666666664
+            ],
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 41,
+            "componentType" : 5126,
+            "count" : 5,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 42,
+            "componentType" : 5126,
+            "count" : 5,
+            "max" : [
+                1.6666666666666667
+            ],
+            "min" : [
+                0.041666666666666664
+            ],
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 43,
+            "componentType" : 5126,
+            "count" : 15,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 44,
+            "componentType" : 5126,
+            "count" : 5,
+            "max" : [
+                1.6666666666666667
+            ],
+            "min" : [
+                0.041666666666666664
+            ],
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 45,
+            "componentType" : 5126,
+            "count" : 15,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 46,
+            "componentType" : 5126,
+            "count" : 5,
+            "max" : [
+                1.7083333333333333
+            ],
+            "min" : [
+                0
+            ],
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 47,
+            "componentType" : 5126,
+            "count" : 5,
+            "type" : "VEC4"
+        },
+        {
+            "bufferView" : 48,
+            "componentType" : 5126,
+            "count" : 5,
+            "max" : [
+                1.7083333333333333
+            ],
+            "min" : [
+                0
+            ],
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 49,
+            "componentType" : 5126,
+            "count" : 15,
+            "type" : "VEC4"
+        },
+        {
+            "bufferView" : 50,
+            "componentType" : 5126,
+            "count" : 5,
+            "max" : [
+                1.7083333333333333
+            ],
+            "min" : [
+                0
+            ],
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 51,
+            "componentType" : 5126,
+            "count" : 5,
+            "type" : "VEC4"
+        },
+        {
+            "bufferView" : 52,
+            "componentType" : 5126,
+            "count" : 5,
+            "max" : [
+                1.7083333333333333
+            ],
+            "min" : [
+                0
+            ],
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 53,
+            "componentType" : 5126,
+            "count" : 5,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 54,
+            "componentType" : 5126,
+            "count" : 5,
+            "max" : [
+                1.6666666666666667
+            ],
+            "min" : [
+                0
+            ],
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 55,
+            "componentType" : 5126,
+            "count" : 15,
+            "type" : "VEC3"
+        },
+        {
+            "bufferView" : 56,
+            "componentType" : 5126,
+            "count" : 5,
+            "max" : [
+                1.6666666666666667
+            ],
+            "min" : [
+                0
+            ],
+            "type" : "SCALAR"
+        },
+        {
+            "bufferView" : 57,
+            "componentType" : 5126,
+            "count" : 5,
+            "type" : "VEC3"
+        }
+    ],
+    "animations" : [
+        {
+            "channels" : [
+                {
+                    "sampler" : 0,
+                    "target" : {
+                        "node" : 0,
+                        "path" : "scale"
+                    }
+                }
+            ],
+            "name" : "Step Scale",
+            "samplers" : [
+                {
+                    "input" : 40,
+                    "interpolation" : "STEP",
+                    "output" : 41
+                }
+            ]
+        },
+        {
+            "channels" : [
+                {
+                    "sampler" : 0,
+                    "target" : {
+                        "node" : 3,
+                        "path" : "scale"
+                    }
+                }
+            ],
+            "name" : "Linear Scale",
+            "samplers" : [
+                {
+                    "input" : 40,
+                    "interpolation" : "LINEAR",
+                    "output" : 41
+                }
+            ]
+        },
+        {
+            "channels" : [
+                {
+                    "sampler" : 0,
+                    "target" : {
+                        "node" : 4,
+                        "path" : "scale"
+                    }
+                }
+            ],
+            "name" : "CubicSpline Scale",
+            "samplers" : [
+                {
+                    "input" : 44,
+                    "interpolation" : "CUBICSPLINE",
+                    "output" : 45
+                }
+            ]
+        },
+        {
+            "channels" : [
+                {
+                    "sampler" : 0,
+                    "target" : {
+                        "node" : 5,
+                        "path" : "rotation"
+                    }
+                }
+            ],
+            "name" : "Step Rotation",
+            "samplers" : [
+                {
+                    "input" : 46,
+                    "interpolation" : "STEP",
+                    "output" : 47
+                }
+            ]
+        },
+        {
+            "channels" : [
+                {
+                    "sampler" : 0,
+                    "target" : {
+                        "node" : 6,
+                        "path" : "rotation"
+                    }
+                }
+            ],
+            "name" : "CubicSpline Rotation",
+            "samplers" : [
+                {
+                    "input" : 48,
+                    "interpolation" : "CUBICSPLINE",
+                    "output" : 49
+                }
+            ]
+        },
+        {
+            "channels" : [
+                {
+                    "sampler" : 0,
+                    "target" : {
+                        "node" : 7,
+                        "path" : "rotation"
+                    }
+                }
+            ],
+            "name" : "Linear Rotation",
+            "samplers" : [
+                {
+                    "input" : 50,
+                    "interpolation" : "LINEAR",
+                    "output" : 51
+                }
+            ]
+        },
+        {
+            "channels" : [
+                {
+                    "sampler" : 0,
+                    "target" : {
+                        "node" : 8,
+                        "path" : "translation"
+                    }
+                }
+            ],
+            "name" : "Step Translation",
+            "samplers" : [
+                {
+                    "input" : 52,
+                    "interpolation" : "STEP",
+                    "output" : 53
+                }
+            ]
+        },
+        {
+            "channels" : [
+                {
+                    "sampler" : 0,
+                    "target" : {
+                        "node" : 9,
+                        "path" : "translation"
+                    }
+                }
+            ],
+            "name" : "CubicSpline Translation",
+            "samplers" : [
+                {
+                    "input" : 54,
+                    "interpolation" : "CUBICSPLINE",
+                    "output" : 55
+                }
+            ]
+        },
+        {
+            "channels" : [
+                {
+                    "sampler" : 0,
+                    "target" : {
+                        "node" : 10,
+                        "path" : "translation"
+                    }
+                }
+            ],
+            "name" : "Linear Translation",
+            "samplers" : [
+                {
+                    "input" : 56,
+                    "interpolation" : "LINEAR",
+                    "output" : 57
+                }
+            ]
+        }
+    ],
+    "asset" : {
+        "generator" : "Khronos Blender glTF 2.0 I/O",
+        "version" : "2.0"
+    },
+    "bufferViews" : [
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 0
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 288
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 192,
+            "byteOffset" : 576
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 36,
+            "byteOffset" : 768
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 804
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 1092
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 192,
+            "byteOffset" : 1380
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 36,
+            "byteOffset" : 1572
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 1608
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 1896
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 192,
+            "byteOffset" : 2184
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 36,
+            "byteOffset" : 2376
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 2412
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 2700
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 192,
+            "byteOffset" : 2988
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 36,
+            "byteOffset" : 3180
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 3216
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 3504
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 192,
+            "byteOffset" : 3792
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 36,
+            "byteOffset" : 3984
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 4020
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 4308
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 192,
+            "byteOffset" : 4596
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 36,
+            "byteOffset" : 4788
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 4824
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 5112
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 192,
+            "byteOffset" : 5400
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 36,
+            "byteOffset" : 5592
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 5628
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 5916
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 192,
+            "byteOffset" : 6204
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 36,
+            "byteOffset" : 6396
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 6432
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 288,
+            "byteOffset" : 6720
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 192,
+            "byteOffset" : 7008
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 36,
+            "byteOffset" : 7200
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 48,
+            "byteOffset" : 7236
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 48,
+            "byteOffset" : 7284
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 32,
+            "byteOffset" : 7332
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 6,
+            "byteOffset" : 7364
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 20,
+            "byteOffset" : 7372
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 60,
+            "byteOffset" : 7392
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 20,
+            "byteOffset" : 7452
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 180,
+            "byteOffset" : 7472
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 20,
+            "byteOffset" : 7652
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 180,
+            "byteOffset" : 7672
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 20,
+            "byteOffset" : 7852
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 80,
+            "byteOffset" : 7872
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 20,
+            "byteOffset" : 7952
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 240,
+            "byteOffset" : 7972
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 20,
+            "byteOffset" : 8212
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 80,
+            "byteOffset" : 8232
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 20,
+            "byteOffset" : 8312
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 60,
+            "byteOffset" : 8332
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 20,
+            "byteOffset" : 8392
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 180,
+            "byteOffset" : 8412
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 20,
+            "byteOffset" : 8592
+        },
+        {
+            "buffer" : 0,
+            "byteLength" : 60,
+            "byteOffset" : 8612
+        }
+    ],
+    "buffers" : [
+        {
+            "byteLength" : 8672,
+            "uri" : "interpolation.bin"
+        }
+    ],
+    "extensions" : {},
+    "images" : [
+        {
+            "mimeType" : "image/jpeg",
+            "name" : "l.jpg",
+            "uri" : "l.jpg"
+        }
+    ],
+    "materials" : [
+        {
+            "name" : "Material",
+            "pbrMetallicRoughness" : {
+                "baseColorFactor" : [
+                    0.800000011920929,
+                    0.800000011920929,
+                    0.800000011920929,
+                    1
+                ],
+                "metallicFactor" : 0,
+                "roughnessFactor" : 0.5
+            }
+        },
+        {
+            "name" : "Material.001",
+            "pbrMetallicRoughness" : {
+                "baseColorFactor" : [
+                    0.800000011920929,
+                    0.800000011920929,
+                    0.800000011920929,
+                    1
+                ],
+                "metallicFactor" : 0,
+                "roughnessFactor" : 0.5
+            }
+        },
+        {
+            "name" : "Material.002",
+            "pbrMetallicRoughness" : {
+                "baseColorFactor" : [
+                    0.800000011920929,
+                    0.800000011920929,
+                    0.800000011920929,
+                    1
+                ],
+                "metallicFactor" : 0,
+                "roughnessFactor" : 0.5
+            }
+        },
+        {
+            "name" : "Material.007",
+            "pbrMetallicRoughness" : {
+                "baseColorFactor" : [
+                    0.800000011920929,
+                    0.800000011920929,
+                    0.800000011920929,
+                    1
+                ],
+                "metallicFactor" : 0,
+                "roughnessFactor" : 0.5
+            }
+        },
+        {
+            "name" : "Material.006",
+            "pbrMetallicRoughness" : {
+                "baseColorFactor" : [
+                    0.800000011920929,
+                    0.800000011920929,
+                    0.800000011920929,
+                    1
+                ],
+                "metallicFactor" : 0,
+                "roughnessFactor" : 0.5
+            }
+        },
+        {
+            "name" : "Material.008",
+            "pbrMetallicRoughness" : {
+                "baseColorFactor" : [
+                    0.800000011920929,
+                    0.800000011920929,
+                    0.800000011920929,
+                    1
+                ],
+                "metallicFactor" : 0,
+                "roughnessFactor" : 0.5
+            }
+        },
+        {
+            "name" : "Material.004",
+            "pbrMetallicRoughness" : {
+                "baseColorFactor" : [
+                    0.800000011920929,
+                    0.800000011920929,
+                    0.800000011920929,
+                    1
+                ],
+                "metallicFactor" : 0,
+                "roughnessFactor" : 0.5
+            }
+        },
+        {
+            "name" : "Material.005",
+            "pbrMetallicRoughness" : {
+                "baseColorFactor" : [
+                    0.800000011920929,
+                    0.800000011920929,
+                    0.800000011920929,
+                    1
+                ],
+                "metallicFactor" : 0,
+                "roughnessFactor" : 0.5
+            }
+        },
+        {
+            "name" : "Material.003",
+            "pbrMetallicRoughness" : {
+                "baseColorFactor" : [
+                    0.800000011920929,
+                    0.800000011920929,
+                    0.800000011920929,
+                    1
+                ],
+                "metallicFactor" : 0,
+                "roughnessFactor" : 0.5
+            }
+        },
+        {
+            "name" : "Material.009",
+            "pbrMetallicRoughness" : {
+                "baseColorTexture" : {
+                    "index" : 0,
+                    "texCoord" : 0
+                },
+                "metallicFactor" : 0,
+                "roughnessFactor" : 0.5
+            }
+        }
+    ],
+    "meshes" : [
+        {
+            "name" : "Cube",
+            "primitives" : [
+                {
+                    "attributes" : {
+                        "NORMAL" : 1,
+                        "POSITION" : 0,
+                        "TEXCOORD_0" : 2
+                    },
+                    "material" : 0
+                }
+            ]
+        },
+        {
+            "name" : "Cube.001",
+            "primitives" : [
+                {
+                    "attributes" : {
+                        "NORMAL" : 5,
+                        "POSITION" : 4,
+                        "TEXCOORD_0" : 6
+                    },
+                    "material" : 1
+                }
+            ]
+        },
+        {
+            "name" : "Cube.002",
+            "primitives" : [
+                {
+                    "attributes" : {
+                        "NORMAL" : 9,
+                        "POSITION" : 8,
+                        "TEXCOORD_0" : 10
+                    },
+                    "material" : 2
+                }
+            ]
+        },
+        {
+            "name" : "Cube.003",
+            "primitives" : [
+                {
+                    "attributes" : {
+                        "NORMAL" : 13,
+                        "POSITION" : 12,
+                        "TEXCOORD_0" : 14
+                    },
+                    "material" : 3
+                }
+            ]
+        },
+        {
+            "name" : "Cube.004",
+            "primitives" : [
+                {
+                    "attributes" : {
+                        "NORMAL" : 17,
+                        "POSITION" : 16,
+                        "TEXCOORD_0" : 18
+                    },
+                    "material" : 4
+                }
+            ]
+        },
+        {
+            "name" : "Cube.005",
+            "primitives" : [
+                {
+                    "attributes" : {
+                        "NORMAL" : 21,
+                        "POSITION" : 20,
+                        "TEXCOORD_0" : 22
+                    },
+                    "material" : 5
+                }
+            ]
+        },
+        {
+            "name" : "Cube.006",
+            "primitives" : [
+                {
+                    "attributes" : {
+                        "NORMAL" : 25,
+                        "POSITION" : 24,
+                        "TEXCOORD_0" : 26
+                    },
+                    "material" : 6
+                }
+            ]
+        },
+        {
+            "name" : "Cube.008",
+            "primitives" : [
+                {
+                    "attributes" : {
+                        "NORMAL" : 29,
+                        "POSITION" : 28,
+                        "TEXCOORD_0" : 30
+                    },
+                    "material" : 7
+                }
+            ]
+        },
+        {
+            "name" : "Cube.009",
+            "primitives" : [
+                {
+                    "attributes" : {
+                        "NORMAL" : 33,
+                        "POSITION" : 32,
+                        "TEXCOORD_0" : 34
+                    },
+                    "material" : 8
+                }
+            ]
+        },
+        {
+            "name" : "Plane.001",
+            "primitives" : [
+                {
+                    "attributes" : {
+                        "NORMAL" : 37,
+                        "POSITION" : 36,
+                        "TEXCOORD_0" : 38
+                    },
+                    "material" : 9
+                }
+            ]
+        }
+    ],
+    "nodes" : [
+        {
+            "name" : "Cube"
+        },
+        {
+            "name" : "Light",
+            "rotation" : [
+                0.16907575726509094,
+                0.7558802962303162,
+                -0.27217137813568115,
+                0.570947527885437
+            ],
+            "scale" : [
+                1,
+                1,
+                0.9999999403953552
+            ],
+            "translation" : [
+                0.18540644645690918,
+                5.903861999511719,
+                8.732584953308105
+            ]
+        },
+        {
+            "name" : "Camera",
+            "rotation" : [
+                0.6819981932640076,
+                0,
+                0,
+                0.7313538193702698
+            ],
+            "scale" : [
+                1,
+                0.39365354180336,
+                1
+            ],
+            "translation" : [
+                0.31374117732048035,
+                4.958309173583984,
+                29.236623764038086
+            ]
+        },
+        {
+            "name" : "Cube.001",
+            "translation" : [
+                -3.2963297367095947,
+                0,
+                6.461143493652344e-05
+            ]
+        },
+        {
+            "name" : "Cube.002",
+            "translation" : [
+                3.3401193618774414,
+                0,
+                0.008944988250732422
+            ]
+        },
+        {
+            "name" : "Cube.003",
+            "translation" : [
+                0,
+                3.356412410736084,
+                0
+            ]
+        },
+        {
+            "name" : "Cube.004",
+            "rotation" : [
+                0,
+                0,
+                -0.006683696992695332,
+                0.9999777674674988
+            ],
+            "translation" : [
+                3.33506178855896,
+                3.356412410736084,
+                0
+            ]
+        },
+        {
+            "name" : "Cube.005",
+            "rotation" : [
+                0,
+                0,
+                -0.03925982117652893,
+                0.9992290735244751
+            ],
+            "scale" : [
+                0.9999999403953552,
+                0.9999999403953552,
+                1
+            ],
+            "translation" : [
+                -3.311399221420288,
+                3.356412410736084,
+                0
+            ]
+        },
+        {
+            "name" : "Cube.006",
+            "translation" : [
+                0,
+                6.665226459503174,
+                0
+            ]
+        },
+        {
+            "name" : "Cube.008",
+            "translation" : [
+                3.3051798343658447,
+                6.734194278717041,
+                0
+            ]
+        },
+        {
+            "name" : "Cube.009",
+            "translation" : [
+                -3.2975807189941406,
+                6.958913326263428,
+                0
+            ]
+        },
+        {
+            "name" : "Plane",
+            "rotation" : [
+                0.7071068286895752,
+                0,
+                0,
+                0.7071068286895752
+            ],
+            "scale" : [
+                4.218648433685303,
+                1,
+                0.3652837574481964
+            ],
+            "translation" : [
+                0,
+                -1.7941787242889404,
+                1.0036747455596924
+            ]
+        }
+    ],
+    "scene" : 0,
+    "scenes" : [
+        {
+            "name" : "Scene",
+            "nodes" : [
+                0,
+                1,
+                2,
+                3,
+                4,
+                5,
+                6,
+                7,
+                8,
+                9,
+                10,
+                11
+            ]
+        }
+    ],
+    "textures" : [
+        {
+            "source" : 0
+        }
+    ]
+}
diff --git a/automated-tests/resources/beer.bin b/automated-tests/resources/beer.bin
new file mode 100644 (file)
index 0000000..08571fd
Binary files /dev/null and b/automated-tests/resources/beer.bin differ
diff --git a/automated-tests/resources/beer_modelViewTest.dli b/automated-tests/resources/beer_modelViewTest.dli
new file mode 100644 (file)
index 0000000..20be585
--- /dev/null
@@ -0,0 +1,181 @@
+{
+  "asset": { "version": "1.0" },
+  "scene": 0,
+  "scenes": [ { "nodes": [ 0 ] } ],
+  "nodes": [
+    {
+      "name": "Scene",
+      "matrix": [ 1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1 ],
+      "children": [ 1, 2 ]
+    },
+    {
+      "name": "Cube",
+      "matrix": [ 2.5, 0, 0, 0, 0, 2.5, 0, 0, 0, 0, 2.5, 0, 0, 0, 0, 1 ],
+      "model": {
+        "mesh": 0,
+        "material": 0,
+        "shader": 0
+      }
+    },
+    {
+      "name": "bottle",
+      "matrix": [ 0.125, 0, 0, 0, 0, -0, 0.125, 0, 0, -0.125, -0, 0, -0, 0, -1.5, 1 ],
+      "children": [ 3, 4, 5, 6 ]
+    },
+    {
+      "name": "bottle-cap",
+      "model": {
+        "mesh": 3,
+        "material": 2,
+        "shader": 1
+      }
+    },
+    {
+      "name": "bottle-alpha-front",
+      "model": {
+        "mesh": 1,
+        "material": 1,
+        "shader": 2
+      }
+    },
+    {
+      "name": "bottle-alpha-back",
+      "model": {
+        "mesh": 1,
+        "material": 1,
+        "shader": 3
+      }
+    },
+    {
+      "name": "bottle-label",
+      "model": {
+        "mesh": 2,
+        "material": 0,
+        "shader": 4
+      }
+    }
+  ],
+  "meshes": [
+    {
+      "uri": "cube.bin",
+      "attributes": 31,
+      "primitive": "TRIANGLES",
+      "indices": { "byteOffset": 0, "byteLength": 72 },
+      "positions": { "byteOffset": 72, "byteLength": 288 },
+      "normals": { "byteOffset": 360, "byteLength": 288 },
+      "textures": { "byteOffset": 648, "byteLength": 192 },
+      "tangents": { "byteOffset": 840, "byteLength": 288 }
+    },
+    {
+      "uri": "beer.bin",
+      "attributes": 31,
+      "primitive": "TRIANGLES",
+      "indices": { "byteOffset": 0, "byteLength": 19920 },
+      "positions": { "byteOffset": 19920, "byteLength": 54792 },
+      "normals": { "byteOffset": 74712, "byteLength": 54792 },
+      "textures": { "byteOffset": 129504, "byteLength": 36528 },
+      "tangents": { "byteOffset": 166032, "byteLength": 54792 }
+    },
+    {
+      "uri": "beer.bin",
+      "attributes": 31,
+      "primitive": "TRIANGLES",
+      "indices": { "byteOffset": 220824, "byteLength": 13200 },
+      "positions": { "byteOffset": 234024, "byteLength": 14628 },
+      "normals": { "byteOffset": 248652, "byteLength": 14628 },
+      "textures": { "byteOffset": 263280, "byteLength": 9752 },
+      "tangents": { "byteOffset": 273032, "byteLength": 14628 }
+    },
+    {
+      "uri": "beer.bin",
+      "attributes": 31,
+      "primitive": "TRIANGLES",
+      "indices": { "byteOffset": 287660, "byteLength": 31440 },
+      "positions": { "byteOffset": 319100, "byteLength": 121032 },
+      "normals": { "byteOffset": 440132, "byteLength": 121032 },
+      "textures": { "byteOffset": 561164, "byteLength": 80688 },
+      "tangents": { "byteOffset": 641852, "byteLength": 121032 }
+    }
+  ],
+  "skeletons": [
+  ],
+  "cameras": [
+    {
+      "fov": 60,
+      "near": 0.1,
+      "far": 100,
+      "matrix": [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 3.5, 1 ]
+    }
+  ],
+  "lights": [
+  ],
+  "materials": [
+    {
+      "color": [ 1.0, 0.95, 0.5 ],
+      "metallic": 0.25,
+      "roughness": 1.0,
+      "environment": 1
+    },
+    {
+      "color": [ 0.1, 0.4, 0.0, 0.6 ],
+      "metallic": 0.4,
+      "roughness": 0.0,
+      "environment": 1
+    },
+    {
+      "color": [ 0.5, 0.5, 0.5 ],
+      "metallic": 1.0,
+      "roughness": 0.0,
+      "environment": 1
+    }
+  ],
+  "environment": [
+    {
+    },
+    {
+      "cubeSpecular": "Studio/Radiance.ktx",
+      "cubeDiffuse": "Studio/Irradiance.ktx",
+      "iblIntensity": 0.75
+    }
+  ],
+  "shaders": [
+    {
+      "vertex": "dli_pbr.vsh",
+      "fragment": "dli_pbr.fsh",
+      "rendererState": "DEPTH_TEST|CULL_FRONT",
+      "uCubeMatrix": [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ],
+      "uMaxLOD": 6
+    },
+    {
+      "vertex": "dli_pbr.vsh",
+      "fragment": "dli_pbr.fsh",
+      "rendererState": "DEPTH_TEST|DEPTH_WRITE",
+      "uCubeMatrix": [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ],
+      "uMaxLOD": 6
+    },
+    {
+      "vertex": "dli_pbr.vsh",
+      "fragment": "dli_pbr.fsh",
+      "defines": [ "THREE_TEX" ],
+      "rendererState": "ALPHA_BLEND|DEPTH_TEST|CULL_FRONT",
+      "uCubeMatrix": [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ],
+      "uMaxLOD": 6
+    },
+    {
+      "vertex": "dli_pbr.vsh",
+      "fragment": "dli_pbr.fsh",
+      "defines": [ "THREE_TEX" ],
+      "rendererState": "ALPHA_BLEND|DEPTH_TEST|CULL_BACK",
+      "uCubeMatrix": [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ],
+      "uMaxLOD": 6
+    },
+    {
+      "vertex": "dli_pbr.vsh",
+      "fragment": "dli_pbr.fsh",
+      "defines": [ "FLIP_V" ],
+      "rendererState": "DEPTH_TEST|DEPTH_WRITE|CULL_BACK",
+      "uCubeMatrix": [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ],
+      "uMaxLOD": 6
+    }
+  ]
+}
diff --git a/automated-tests/resources/cube.bin b/automated-tests/resources/cube.bin
new file mode 100644 (file)
index 0000000..f5bd426
Binary files /dev/null and b/automated-tests/resources/cube.bin differ
diff --git a/automated-tests/resources/cubemap_array_horizontal.png b/automated-tests/resources/cubemap_array_horizontal.png
new file mode 100644 (file)
index 0000000..a935915
Binary files /dev/null and b/automated-tests/resources/cubemap_array_horizontal.png differ
diff --git a/automated-tests/resources/cubemap_array_vertical.png b/automated-tests/resources/cubemap_array_vertical.png
new file mode 100644 (file)
index 0000000..d6bf296
Binary files /dev/null and b/automated-tests/resources/cubemap_array_vertical.png differ
diff --git a/automated-tests/resources/forest_diffuse_cubemap_cross_vertical.png b/automated-tests/resources/forest_diffuse_cubemap_cross_vertical.png
new file mode 100644 (file)
index 0000000..6e6bf0f
Binary files /dev/null and b/automated-tests/resources/forest_diffuse_cubemap_cross_vertical.png differ
diff --git a/automated-tests/resources/test.bvh b/automated-tests/resources/test.bvh
new file mode 100644 (file)
index 0000000..28bd0da
--- /dev/null
@@ -0,0 +1,20 @@
+HIERARCHY
+ROOT root
+{
+  OFFSET 0.0 -0.948831 1.32574
+  CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation
+  JOINT first
+  {
+    OFFSET -0.0 4.130377 -0.008512
+    CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation
+    End Site
+    {
+      OFFSET 0 0 0
+    }
+  }
+}
+MOTION
+Frames:        2
+Frame Time:    0.3
+0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
+0.0 10.0 0.0 0.0 0.0 0.0 10.0 0.0 0.0 90.0 0.0 0.0
\ No newline at end of file
@@ -1,9 +1,9 @@
-SET(PKG_NAME "dali-scene-loader-internal")
+SET(PKG_NAME "dali-scene3d-internal")
 
 SET(EXEC_NAME "tct-${PKG_NAME}-core")
 SET(RPM_NAME "core-${PKG_NAME}-tests")
 
-SET(CAPI_LIB "dali-scene-loader")
+SET(CAPI_LIB "dali-scene3d")
 
 # List of test case sources (Only these get parsed for test cases)
 SET(TC_SOURCES
@@ -63,7 +63,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
   dali2-core
   dali2-adaptor
   dali2-toolkit
-  dali2-scene-loader
+  dali2-scene3d
 )
 
 ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror -DDEBUG_ENABLED)
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/internal/gltf2-asset.h"
+#include "dali-scene3d/internal/loader/gltf2-asset.h"
 #include <dali-test-suite-utils.h>
 #include <string>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliGltf2AssetComponentIsUnsigned(void)
 {
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/internal/hash.h"
+#include "dali-scene3d/internal/loader/hash.h"
 #include <dali-test-suite-utils.h>
 #include <string>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliHash(void)
 {
@@ -18,7 +18,7 @@
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/internal/json-reader.h"
+#include "dali-scene3d/internal/loader/json-reader.h"
 #include <dali-test-suite-utils.h>
 #include <string>
 
@@ -18,7 +18,7 @@
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/internal/json-util.h"
+#include "dali-scene3d/internal/loader/json-util.h"
 #include "dali-toolkit/devel-api/builder/json-parser.h"
 #include <dali-test-suite-utils.h>
 #include <string>
@@ -27,7 +27,7 @@
 
 using namespace Dali;
 using namespace Dali::Toolkit;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 namespace
 {
@@ -1,21 +1,25 @@
-SET(PKG_NAME "dali-scene-loader")
+SET(PKG_NAME "dali-scene3d")
 
 SET(EXEC_NAME "tct-${PKG_NAME}-core")
 SET(RPM_NAME "core-${PKG_NAME}-tests")
 
-SET(CAPI_LIB "dali-scene-loader")
+SET(CAPI_LIB "dali-scene3d")
 
 # List of test case sources (Only these get parsed for test cases)
 SET(TC_SOURCES
   utc-Dali-AlphaFunctionHelper.cpp
   utc-Dali-AnimationDefinition.cpp
   utc-Dali-AnimatedProperty.cpp
+  utc-Dali-BvhLoader.cpp
   utc-Dali-CameraParameters.cpp
+  utc-Dali-CubeLoader.cpp
+  utc-Dali-CubeMapLoader.cpp
   utc-Dali-DliLoader.cpp
   utc-Dali-EnvironmentDefinition.cpp
   utc-Dali-FacialAnimation.cpp
   utc-Dali-Gltf2Loader.cpp
   utc-Dali-KtxLoader.cpp
+  utc-Dali-ModelView.cpp
   utc-Dali-MatrixStack.cpp
   utc-Dali-MeshDefinition.cpp
   utc-Dali-NodeDefinition.cpp
@@ -79,7 +83,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
   dali2-core
   dali2-adaptor
   dali2-toolkit
-  dali2-scene-loader
+  dali2-scene3d
 )
 
 ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror -DDEBUG_ENABLED)
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/alpha-function-helper.h"
+#include "dali-scene3d/public-api/loader/alpha-function-helper.h"
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 #define ALPHA_FN_PAIR(x) { #x, AlphaFunction::x }
 
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/animated-property.h"
+#include "dali-scene3d/public-api/loader/animated-property.h"
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliAnimatedPropertyGetPropertyType(void)
 {
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/animation-definition.h"
+#include "dali-scene3d/public-api/loader/animation-definition.h"
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliAnimationDefinitionStopForModification(void)
 {
diff --git a/automated-tests/src/dali-scene3d/utc-Dali-BvhLoader.cpp b/automated-tests/src/dali-scene3d/utc-Dali-BvhLoader.cpp
new file mode 100644 (file)
index 0000000..91fdb19
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2022 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali-test-suite-utils.h>
+#include <dali-scene3d/public-api/loader/bvh-loader.h>
+
+using namespace Dali;
+using namespace Dali::Scene3D::Loader;
+
+int UtcDaliLoadBvh(void)
+{
+  TestApplication application;
+
+  AnimationDefinition animDef = LoadBvh(TEST_RESOURCE_DIR "/test.bvh", "testBvh");
+
+  DALI_TEST_EQUAL(animDef.mName, "testBvh");
+  DALI_TEST_EQUAL(animDef.mDuration, 0.3f);
+
+  DALI_TEST_EQUAL(animDef.mProperties[0].mNodeName, "root");
+  DALI_TEST_EQUAL(animDef.mProperties[0].mPropertyName, "position");
+  DALI_TEST_EQUAL(animDef.mProperties[0].mKeyFrames.GetType(), Property::Type::VECTOR3);
+  DALI_TEST_EQUAL(animDef.mProperties[0].mTimePeriod.durationSeconds, 0.3f);
+
+  DALI_TEST_EQUAL(animDef.mProperties[1].mNodeName, "root");
+  DALI_TEST_EQUAL(animDef.mProperties[1].mPropertyName, "orientation");
+  DALI_TEST_EQUAL(animDef.mProperties[1].mKeyFrames.GetType(), Property::Type::ROTATION);
+  DALI_TEST_EQUAL(animDef.mProperties[1].mTimePeriod.durationSeconds, 0.3f);
+
+  DALI_TEST_EQUAL(animDef.mProperties[2].mNodeName, "first");
+  DALI_TEST_EQUAL(animDef.mProperties[2].mPropertyName, "position");
+  DALI_TEST_EQUAL(animDef.mProperties[2].mKeyFrames.GetType(), Property::Type::VECTOR3);
+  DALI_TEST_EQUAL(animDef.mProperties[2].mTimePeriod.durationSeconds, 0.3f);
+
+  DALI_TEST_EQUAL(animDef.mProperties[3].mNodeName, "first");
+  DALI_TEST_EQUAL(animDef.mProperties[3].mPropertyName, "orientation");
+  DALI_TEST_EQUAL(animDef.mProperties[3].mKeyFrames.GetType(), Property::Type::ROTATION);
+  DALI_TEST_EQUAL(animDef.mProperties[3].mTimePeriod.durationSeconds, 0.3f);
+
+  Actor root = Actor::New();
+  root.SetProperty(Actor::Property::NAME, "root");
+
+  Actor first = Actor::New();
+  first.SetProperty(Actor::Property::NAME, "first");
+  root.Add(first);
+
+  auto getActor = [&root](const std::string& name) {
+    return root.FindChildByName(name);
+  };
+
+  Animation animation = animDef.ReAnimate(getActor);
+  DALI_TEST_EQUAL(animation.GetDuration(), animDef.mDuration);
+
+  application.GetScene().Add(root);
+
+  application.SendNotification();
+  application.Render(20);
+
+  DALI_TEST_EQUALS(Vector2(0, 0), root.GetProperty<Vector2>(Actor::Property::POSITION), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(0, 0), first.GetProperty<Vector2>(Actor::Property::POSITION), TEST_LOCATION);
+  Vector3 rootWorldPositionBefore = root.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
+  Vector3 firstWorldPositionBefore = first.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
+
+  animation.Play();
+
+  application.SendNotification();
+  application.Render(1000);
+
+  DALI_TEST_EQUALS(Vector2(0, 10), root.GetProperty<Vector2>(Actor::Property::POSITION), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(10, 0), first.GetProperty<Vector2>(Actor::Property::POSITION), TEST_LOCATION);
+
+  Vector3 rootWorldPositionAfter = root.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
+  Vector3 firstWorldPositionAfter = first.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
+
+  DALI_TEST_EQUALS(Vector3(0, 10, 0), rootWorldPositionAfter - rootWorldPositionBefore, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector3(10, 10, 0), firstWorldPositionAfter - firstWorldPositionBefore, TEST_LOCATION);
+
+  END_TEST;
+}
+
+
+
+int UtcDaliLoadBvhFailed(void)
+{
+  TestApplication application;
+
+  AnimationDefinition animDef = LoadBvh("/nothing.bvh", "testBvh");
+  DALI_TEST_EQUALS(0u, animDef.mProperties.size(), TEST_LOCATION);
+  END_TEST;
+}
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/camera-parameters.h"
+#include "dali-scene3d/public-api/loader/camera-parameters.h"
 #include <dali-test-suite-utils.h>
 #include <string_view>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliCameraParameters(void)
 {
diff --git a/automated-tests/src/dali-scene3d/utc-Dali-CubeLoader.cpp b/automated-tests/src/dali-scene3d/utc-Dali-CubeLoader.cpp
new file mode 100644 (file)
index 0000000..57482c3
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2022 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// Enable debug log for test coverage
+#define DEBUG_ENABLED 1
+
+#include "dali-scene3d/public-api/loader/cube-loader.h"
+#include <dali-test-suite-utils.h>
+#include <string_view>
+
+#include <fstream>
+
+using namespace Dali;
+using namespace Dali::Scene3D::Loader;
+
+int UtcDaliCubeLoaderFailNonexistent(void)
+{
+  CubeData data;
+  DALI_TEST_CHECK(!LoadCubeData("non-existent.jpg", data));
+  END_TEST;
+}
+
+int UtcDaliCubeLoaderFailInvalid1(void)
+{
+  CubeData data;
+  DALI_TEST_CHECK(!LoadCubeData(TEST_RESOURCE_DIR "/gallery-small-1.jpg", data)); // Wrong sized image
+  END_TEST;
+}
+
+int UtcDaliCubeLoaderSuccess01(void)
+{
+  CubeData cubeData;
+  auto path = TEST_RESOURCE_DIR "/forest_diffuse_cubemap.png";  // cross horizontal
+  DALI_TEST_CHECK(LoadCubeData(path, cubeData));
+
+  DALI_TEST_EQUAL(6u, cubeData.data.size());
+  for (auto& face: cubeData.data)
+  {
+    uint32_t size = 512;
+    DALI_TEST_EQUAL(size, face[0].GetWidth());
+    DALI_TEST_EQUAL(size, face[0].GetHeight());
+    DALI_TEST_EQUAL(Pixel::Format::RGBA8888, face[0].GetPixelFormat());
+  }
+
+  END_TEST;
+}
+
+int UtcDaliCubeLoaderSuccess02(void)
+{
+  CubeData cubeData;
+  auto path = TEST_RESOURCE_DIR "/forest_diffuse_cubemap_cross_vertical.png"; // cross vertical
+  DALI_TEST_CHECK(LoadCubeData(path, cubeData));
+
+  DALI_TEST_EQUAL(6u, cubeData.data.size());
+  for (auto& face: cubeData.data)
+  {
+    uint32_t size = 256;
+    DALI_TEST_EQUAL(size, face[0].GetWidth());
+    DALI_TEST_EQUAL(size, face[0].GetHeight());
+    DALI_TEST_EQUAL(Pixel::Format::RGBA8888, face[0].GetPixelFormat());
+  }
+
+  END_TEST;
+}
+
+int UtcDaliCubeLoaderSuccess03(void)
+{
+  CubeData cubeData;
+  auto path = TEST_RESOURCE_DIR "/cubemap_array_horizontal.png"; // array horizontal
+  DALI_TEST_CHECK(LoadCubeData(path, cubeData));
+
+  DALI_TEST_EQUAL(6u, cubeData.data.size());
+  for (auto& face: cubeData.data)
+  {
+    uint32_t size = 100;
+    DALI_TEST_EQUAL(size, face[0].GetWidth());
+    DALI_TEST_EQUAL(size, face[0].GetHeight());
+    DALI_TEST_EQUAL(Pixel::Format::RGB888, face[0].GetPixelFormat());
+  }
+
+  END_TEST;
+}
+
+int UtcDaliCubeLoaderSuccess04(void)
+{
+  CubeData cubeData;
+  auto path = TEST_RESOURCE_DIR "/cubemap_array_vertical.png"; // array horizontal
+  DALI_TEST_CHECK(LoadCubeData(path, cubeData));
+
+  DALI_TEST_EQUAL(6u, cubeData.data.size());
+  for (auto& face: cubeData.data)
+  {
+    uint32_t size = 100;
+    DALI_TEST_EQUAL(size, face[0].GetWidth());
+    DALI_TEST_EQUAL(size, face[0].GetHeight());
+    DALI_TEST_EQUAL(Pixel::Format::RGB888, face[0].GetPixelFormat());
+  }
+
+  END_TEST;
+}
+
+int UtcDaliCubeLoaderCubeDataCreateTexture(void)
+{
+  CubeData cubeData;
+  auto path = TEST_RESOURCE_DIR "/forest_diffuse_cubemap.png";
+  DALI_TEST_CHECK(LoadCubeData(path, cubeData));
+
+  TestApplication app;
+  auto texture = cubeData.CreateTexture();
+
+  DALI_TEST_CHECK(texture);
+  DALI_TEST_EQUAL(512u, texture.GetWidth());
+  DALI_TEST_EQUAL(512u, texture.GetHeight());
+
+  END_TEST;
+}
diff --git a/automated-tests/src/dali-scene3d/utc-Dali-CubeMapLoader.cpp b/automated-tests/src/dali-scene3d/utc-Dali-CubeMapLoader.cpp
new file mode 100644 (file)
index 0000000..d00a15b
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2022 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// Enable debug log for test coverage
+#define DEBUG_ENABLED 1
+
+#include "dali-scene3d/public-api/loader/cube-map-loader.h"
+#include <dali-test-suite-utils.h>
+#include <string_view>
+
+#include <fstream>
+
+using namespace Dali;
+using namespace Dali::Scene3D::Loader;
+
+int UtcDaliCubeMapLoaderFailNonexistent(void)
+{
+  CubeData data;
+  DALI_TEST_CHECK(!LoadCubeMapData("non-existent.jpg", data));
+  END_TEST;
+}
+
+int UtcDaliCubeMapLoaderFailInvalid1(void)
+{
+  CubeData data;
+  DALI_TEST_CHECK(!LoadCubeMapData(TEST_RESOURCE_DIR "/gallery-small-1.jpg", data)); // Wrong sized image
+  END_TEST;
+}
+
+int UtcDaliCubeMapLoaderSuccess01(void)
+{
+  CubeData cubeData;
+  auto path = TEST_RESOURCE_DIR "/forest_radiance.ktx";
+  DALI_TEST_CHECK(LoadCubeMapData(path, cubeData));
+
+  DALI_TEST_EQUAL(6u, cubeData.data.size());
+  for (auto& face: cubeData.data)
+  {
+    uint32_t size = 64;
+    for (auto& mipData: face)
+    {
+      DALI_TEST_EQUAL(size, mipData.GetWidth());
+      DALI_TEST_EQUAL(size, mipData.GetHeight());
+      DALI_TEST_EQUAL(Pixel::Format::RGB888, mipData.GetPixelFormat());
+      size /= 2;
+    }
+  }
+
+  END_TEST;
+}
+
+int UtcDaliCubeMapLoaderSuccess02(void)
+{
+  CubeData cubeData;
+  auto path = TEST_RESOURCE_DIR "/forest_diffuse_cubemap.png";  // cross horizontal
+  DALI_TEST_CHECK(LoadCubeMapData(path, cubeData));
+
+  DALI_TEST_EQUAL(6u, cubeData.data.size());
+  for (auto& face: cubeData.data)
+  {
+    uint32_t size = 512;
+    DALI_TEST_EQUAL(size, face[0].GetWidth());
+    DALI_TEST_EQUAL(size, face[0].GetHeight());
+    DALI_TEST_EQUAL(Pixel::Format::RGBA8888, face[0].GetPixelFormat());
+  }
+
+  END_TEST;
+}
+
+int UtcDaliCubeMapLoaderCubeDataCreateTexture01(void)
+{
+  CubeData cubeData;
+  auto path = TEST_RESOURCE_DIR "/forest_radiance.ktx";
+  DALI_TEST_CHECK(LoadCubeMapData(path, cubeData));
+
+  TestApplication app;
+  auto texture = cubeData.CreateTexture();
+
+  DALI_TEST_CHECK(texture);
+  DALI_TEST_EQUAL(64u, texture.GetWidth());
+  DALI_TEST_EQUAL(64u, texture.GetHeight());
+
+  END_TEST;
+}
+
+int UtcDaliCubeMapLoaderCubeDataCreateTexture02(void)
+{
+  CubeData cubeData;
+  auto path = TEST_RESOURCE_DIR "/forest_diffuse_cubemap.png";
+  DALI_TEST_CHECK(LoadCubeMapData(path, cubeData));
+
+  TestApplication app;
+  auto texture = cubeData.CreateTexture();
+
+  DALI_TEST_CHECK(texture);
+  DALI_TEST_EQUAL(512u, texture.GetWidth());
+  DALI_TEST_EQUAL(512u, texture.GetHeight());
+
+  END_TEST;
+}
 
 #include <dali-test-suite-utils.h>
 #include <string_view>
-#include "dali-scene-loader/internal/json-util.h"
-#include "dali-scene-loader/public-api/dli-loader.h"
-#include "dali-scene-loader/public-api/load-result.h"
-#include "dali-scene-loader/public-api/resource-bundle.h"
-#include "dali-scene-loader/public-api/scene-definition.h"
+#include "dali-scene3d/internal/loader/json-util.h"
+#include "dali-scene3d/public-api/loader/dli-loader.h"
+#include "dali-scene3d/public-api/loader/load-result.h"
+#include "dali-scene3d/public-api/loader/resource-bundle.h"
+#include "dali-scene3d/public-api/loader/scene-definition.h"
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 namespace
 {
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/environment-definition.h"
+#include "dali-scene3d/public-api/loader/environment-definition.h"
 #include <dali-test-suite-utils.h>
 #include <string_view>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliEnvironmentDefinitionLoadRawDefault(void)
 {
  */
 
 #include <dali-test-suite-utils.h>
-#include <dali-scene-loader/public-api/animation-definition.h>
-#include <dali-scene-loader/public-api/facial-animation-loader.h>
+#include <dali-scene3d/public-api/loader/animation-definition.h>
+#include <dali-scene3d/public-api/loader/facial-animation-loader.h>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliLoadFacialAnimation(void)
 {
 
 #include <dali-test-suite-utils.h>
 #include <string_view>
-#include "dali-scene-loader/public-api/gltf2-loader.h"
-#include "dali-scene-loader/public-api/load-result.h"
-#include "dali-scene-loader/public-api/resource-bundle.h"
-#include "dali-scene-loader/public-api/scene-definition.h"
-#include "dali-scene-loader/public-api/shader-definition-factory.h"
+#include "dali-scene3d/public-api/loader/gltf2-loader.h"
+#include "dali-scene3d/public-api/loader/load-result.h"
+#include "dali-scene3d/public-api/loader/resource-bundle.h"
+#include "dali-scene3d/public-api/loader/scene-definition.h"
+#include "dali-scene3d/public-api/loader/shader-definition-factory.h"
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 #define DALI_TEST_THROW(expression, exception, predicate) \
   {                                                       \
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/ktx-loader.h"
+#include "dali-scene3d/public-api/loader/ktx-loader.h"
 #include <dali-test-suite-utils.h>
 #include <string_view>
 
 #include <fstream>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliKtxLoaderFailNonexistent(void)
 {
   CubeData data;
-  DALI_TEST_CHECK(!LoadCubeMapData("non-existent.ktx", data));
+  DALI_TEST_CHECK(!LoadKtxData("non-existent.ktx", data));
   END_TEST;
 }
 
 int UtcDaliKtxLoaderFailInvalid1(void)
 {
   CubeData data;
-  DALI_TEST_CHECK(!LoadCubeMapData(TEST_RESOURCE_DIR "/invalid.svg", data)); // file smaller than KTX header
+  DALI_TEST_CHECK(!LoadKtxData(TEST_RESOURCE_DIR "/invalid.svg", data)); // file smaller than KTX header
   END_TEST;
 }
 
 int UtcDaliKtxLoaderFailInvalid2(void)
 {
   CubeData data;
-  DALI_TEST_CHECK(!LoadCubeMapData(TEST_RESOURCE_DIR "/anim.gif", data)); // not a KTX
+  DALI_TEST_CHECK(!LoadKtxData(TEST_RESOURCE_DIR "/anim.gif", data)); // not a KTX
   END_TEST;
 }
 
 int UtcDaliKtxLoaderFailTruncated(void)
 {
   CubeData data;
-  DALI_TEST_CHECK(!LoadCubeMapData(TEST_RESOURCE_DIR "/truncated.ktx", data));
+  DALI_TEST_CHECK(!LoadKtxData(TEST_RESOURCE_DIR "/truncated.ktx", data));
   END_TEST;
 }
 
@@ -59,7 +59,7 @@ int UtcDaliKtxLoaderSuccess(void)
 {
   CubeData cubeData;
   auto path = TEST_RESOURCE_DIR "/forest_radiance.ktx";
-  DALI_TEST_CHECK(LoadCubeMapData(path, cubeData));
+  DALI_TEST_CHECK(LoadKtxData(path, cubeData));
 
   DALI_TEST_EQUAL(6u, cubeData.data.size());
   for (auto& face: cubeData.data)
@@ -103,7 +103,7 @@ int UtcDaliKtxLoaderFormats(void)
   for (auto i : pathFormats)
   {
     CubeData cubeData;
-    DALI_TEST_CHECK(LoadCubeMapData(resPath + i.first + ".ktx", cubeData));
+    DALI_TEST_CHECK(LoadKtxData(resPath + i.first + ".ktx", cubeData));
     DALI_TEST_EQUAL(cubeData.data[0][0].GetPixelFormat(), i.second);
   }
 
@@ -135,7 +135,7 @@ int UtcDaliKtxLoaderCubeDataCreateTexture2(void)
 {
   CubeData cubeData;
   auto path = TEST_RESOURCE_DIR "/forest_radiance.ktx";
-  DALI_TEST_CHECK(LoadCubeMapData(path, cubeData));
+  DALI_TEST_CHECK(LoadKtxData(path, cubeData));
 
   TestApplication app;
   auto texture = cubeData.CreateTexture();
@@ -151,7 +151,7 @@ int UtcDaliKtxLoaderCubeDataCreateTexture3(void)
 {
   CubeData cubeData;
   auto path = TEST_RESOURCE_DIR "/papermill_E_diffuse-64.ktx";
-  DALI_TEST_CHECK(LoadCubeMapData(path, cubeData));
+  DALI_TEST_CHECK(LoadKtxData(path, cubeData));
 
   TestApplication app;
   auto texture = cubeData.CreateTexture();
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/matrix-stack.h"
+#include "dali-scene3d/public-api/loader/matrix-stack.h"
 #include <dali-test-suite-utils.h>
 #include <string_view>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliMatrixStack(void)
 {
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
 
 #include <vector>
 
-#include "dali-scene-loader/public-api/mesh-definition.h"
+#include "dali-scene3d/public-api/loader/mesh-definition.h"
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliMeshDefinitionBlobApplyMinMaxBothMinMaxApplied(void)
 {
diff --git a/automated-tests/src/dali-scene3d/utc-Dali-ModelView.cpp b/automated-tests/src/dali-scene3d/utc-Dali-ModelView.cpp
new file mode 100644 (file)
index 0000000..5424874
--- /dev/null
@@ -0,0 +1,572 @@
+/*
+ * Copyright (c) 2022 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <stdlib.h>
+#include <iostream>
+
+#include <dali-scene3d/public-api/controls/model-view/model-view.h>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+void model_view_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void model_view_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+namespace
+{
+/**
+ * For the AnimatedCube.gltf and its Assets
+ * Donated by Norbert Nopper for glTF testing.
+ * Take from https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/AnimatedCube
+ */
+const char* TEST_GLTF_FILE_NAME                = TEST_RESOURCE_DIR "/AnimatedCube.gltf";
+const char* TEST_GLTF_TRIANGLE_FILE_NAME       = TEST_RESOURCE_DIR "/AnimatedTriangle.gltf";
+const char* TEST_GLTF_ANIMATION_TEST_FILE_NAME = TEST_RESOURCE_DIR "/animationTest.gltf";
+const char* TEST_DLI_FILE_NAME                 = TEST_RESOURCE_DIR "/arc.dli";
+const char* TEST_DLI_BEER_FILE_NAME            = TEST_RESOURCE_DIR "/beer_modelViewTest.dli";
+/**
+ * For the diffuse and specular cube map texture.
+ * These textures are based off version of Wave engine sample
+ * Take from https://github.com/WaveEngine/Samples
+ *
+ * Copyright (c) 2022 Wave Coorporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+const char* TEST_DIFFUSE_TEXTURE  = TEST_RESOURCE_DIR "/forest_irradiance.ktx";
+const char* TEST_SPECULAR_TEXTURE = TEST_RESOURCE_DIR "/forest_radiance.ktx";
+} // namespace
+
+// Negative test case for a method
+int UtcDaliModelViewUninitialized(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliModelViewUninitialized");
+
+  Scene3D::ModelView view;
+
+  try
+  {
+    // New() must be called to create a ModelView or it wont be valid.
+    Actor a = Actor::New();
+    view.Add(a);
+    DALI_TEST_CHECK(false);
+  }
+  catch(Dali::DaliException& e)
+  {
+    // Tests that a negative test of an assertion succeeds
+    DALI_TEST_PRINT_ASSERT(e);
+    DALI_TEST_CHECK(!view);
+  }
+  END_TEST;
+}
+
+// Positive test case for a method
+int UtcDaliModelViewNew(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliModelViewNew");
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+  DALI_TEST_CHECK(view);
+  END_TEST;
+}
+
+// Positive test case for a method
+int UtcDaliModelViewDownCast(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliModelViewDownCast");
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+  BaseHandle         handle(view);
+
+  Scene3D::ModelView modelView = Scene3D::ModelView::DownCast(handle);
+  DALI_TEST_CHECK(view);
+  DALI_TEST_CHECK(modelView);
+  DALI_TEST_CHECK(modelView == view);
+  END_TEST;
+}
+
+int UtcDaliModelViewTypeRegistry(void)
+{
+  ToolkitTestApplication application;
+
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+  DALI_TEST_CHECK(typeRegistry);
+
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo("ModelView");
+  DALI_TEST_CHECK(typeInfo);
+
+  BaseHandle handle = typeInfo.CreateInstance();
+  DALI_TEST_CHECK(handle);
+
+  Scene3D::ModelView modelView = Scene3D::ModelView::DownCast(handle);
+  DALI_TEST_CHECK(modelView);
+
+  END_TEST;
+}
+
+// Positive test case for a method
+int UtcDaliModelViewAddRemove(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliModelViewAddRemove");
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+  DALI_TEST_CHECK(view);
+
+  Actor actor = Actor::New();
+  DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
+
+  view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+  view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
+  view.Add(actor);
+  application.GetScene().Add(view);
+
+  DALI_TEST_CHECK(actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
+
+  view.Remove(actor);
+
+  DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
+  END_TEST;
+}
+
+int UtcDaliModelViewCopyAndAssignment(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+  DALI_TEST_CHECK(view);
+
+  Scene3D::ModelView copy(view);
+  DALI_TEST_CHECK(view == copy);
+
+  Scene3D::ModelView assign;
+  DALI_TEST_CHECK(!assign);
+
+  assign = copy;
+  DALI_TEST_CHECK(assign == view);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewMoveConstructor(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+  DALI_TEST_EQUALS(1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+  view.SetProperty(Actor::Property::SENSITIVE, false);
+  DALI_TEST_CHECK(false == view.GetProperty<bool>(Actor::Property::SENSITIVE));
+
+  Scene3D::ModelView moved = std::move(view);
+  DALI_TEST_CHECK(moved);
+  DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+  DALI_TEST_CHECK(false == moved.GetProperty<bool>(Actor::Property::SENSITIVE));
+  DALI_TEST_CHECK(!view);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewMoveAssignment(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+  DALI_TEST_EQUALS(1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+  view.SetProperty(Actor::Property::SENSITIVE, false);
+  DALI_TEST_CHECK(false == view.GetProperty<bool>(Actor::Property::SENSITIVE));
+
+  Scene3D::ModelView moved;
+  moved = std::move(view);
+  DALI_TEST_CHECK(moved);
+  DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+  DALI_TEST_CHECK(false == moved.GetProperty<bool>(Actor::Property::SENSITIVE));
+  DALI_TEST_CHECK(!view);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewOnScene01(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  uint32_t modelCount = view.GetModelRoot().GetChildCount();
+  DALI_TEST_EQUALS(1, modelCount, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewOnScene02(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_DLI_FILE_NAME);
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  uint32_t modelCount = view.GetModelRoot().GetChildCount();
+  DALI_TEST_EQUALS(1, modelCount, TEST_LOCATION);
+
+  Actor   rootActor = view.GetModelRoot();
+  Vector3 rootSize  = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SIZE);
+  DALI_TEST_EQUALS(Vector3(2, 2, 1), rootSize, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewOnSizeSet(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  Vector2 size(200.0f, 300.0f);
+  view.SetProperty(Actor::Property::SIZE, size);
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(view.GetCurrentProperty<Vector2>(Actor::Property::SIZE), size, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewGetNaturalSize(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+
+  Vector3 naturalSize = view.GetNaturalSize();
+
+  DALI_TEST_EQUALS(Vector3(2, 2, 2), naturalSize, TEST_LOCATION);
+
+  Actor root = view.GetModelRoot();
+  DALI_TEST_CHECK(root);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewSetImageBasedLightSource01(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  Actor meshActor = view.FindChildByName("AnimatedCube");
+  DALI_TEST_CHECK(meshActor);
+
+  Renderer renderer = meshActor.GetRendererAt(0u);
+  DALI_TEST_CHECK(renderer);
+
+  TextureSet textureSet = renderer.GetTextures();
+  DALI_TEST_EQUALS(textureSet.GetTextureCount(), 7u, TEST_LOCATION);
+
+  Texture diffuseTexture  = textureSet.GetTexture(5u);
+  Texture specularTexture = textureSet.GetTexture(6u);
+
+  view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE);
+
+  Texture newDiffuseTexture  = textureSet.GetTexture(5u);
+  Texture newSpecularTexture = textureSet.GetTexture(6u);
+
+  DALI_TEST_NOT_EQUALS(diffuseTexture, newDiffuseTexture, 0.0f, TEST_LOCATION);
+  DALI_TEST_NOT_EQUALS(specularTexture, newSpecularTexture, 0.0f, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewSetImageBasedLightSource02(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  Actor meshActor = view.FindChildByName("AnimatedCube");
+  DALI_TEST_CHECK(meshActor);
+
+  Renderer renderer = meshActor.GetRendererAt(0u);
+  DALI_TEST_CHECK(renderer);
+
+  TextureSet textureSet = renderer.GetTextures();
+  DALI_TEST_EQUALS(textureSet.GetTextureCount(), 7u, TEST_LOCATION);
+
+  Texture diffuseTexture  = textureSet.GetTexture(5u);
+  Texture specularTexture = textureSet.GetTexture(6u);
+
+  view.SetImageBasedLightSource("", "");
+
+  Texture newDiffuseTexture  = textureSet.GetTexture(5u);
+  Texture newSpecularTexture = textureSet.GetTexture(6u);
+
+  DALI_TEST_EQUALS(diffuseTexture, newDiffuseTexture, TEST_LOCATION);
+  DALI_TEST_EQUALS(specularTexture, newSpecularTexture, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewSetImageBasedLightSource03(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  Actor meshActor = view.FindChildByName("AnimatedCube");
+  DALI_TEST_CHECK(meshActor);
+
+  Renderer renderer = meshActor.GetRendererAt(0u);
+  DALI_TEST_CHECK(renderer);
+
+  TextureSet textureSet = renderer.GetTextures();
+  DALI_TEST_EQUALS(textureSet.GetTextureCount(), 7u, TEST_LOCATION);
+
+  Texture diffuseTexture  = textureSet.GetTexture(5u);
+  Texture specularTexture = textureSet.GetTexture(6u);
+
+  view.SetImageBasedLightSource("dummy.ktx", "dummy.ktx");
+
+  Texture newDiffuseTexture  = textureSet.GetTexture(5u);
+  Texture newSpecularTexture = textureSet.GetTexture(6u);
+
+  DALI_TEST_EQUALS(diffuseTexture, newDiffuseTexture, TEST_LOCATION);
+  DALI_TEST_EQUALS(specularTexture, newSpecularTexture, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewFitSize01(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(50, 50));
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  Actor   rootActor = view.GetModelRoot();
+  Vector3 rootSize  = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SIZE);
+  DALI_TEST_EQUALS(Vector3(2, 2, 2), rootSize, TEST_LOCATION);
+
+  Vector3 rootScale = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SCALE);
+  DALI_TEST_EQUALS(Vector3(1, 1, 1), rootScale, TEST_LOCATION);
+
+  view.FitSize(true);
+  rootSize = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SIZE);
+  DALI_TEST_EQUALS(Vector3(2, 2, 2), rootSize, TEST_LOCATION);
+
+  rootScale = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SCALE);
+  DALI_TEST_EQUALS(Vector3(25, 25, 25), rootScale, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewFitSize02(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_DLI_BEER_FILE_NAME);
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(50, 50));
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  Actor   rootActor = view.GetModelRoot();
+  Vector3 rootSize  = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SIZE);
+  DALI_TEST_EQUALS(Vector3(5, 5, 5), rootSize, TEST_LOCATION);
+
+  Vector3 rootScale = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SCALE);
+  DALI_TEST_EQUALS(Vector3(1, 1, 1), rootScale, TEST_LOCATION);
+
+  view.FitSize(true);
+  rootSize = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SIZE);
+  DALI_TEST_EQUALS(Vector3(5, 5, 5), rootSize, TEST_LOCATION);
+
+  rootScale = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SCALE);
+  DALI_TEST_EQUALS(Vector3(10, 10, 10), rootScale, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewFitSize03(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(0, 0));
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  Actor   rootActor = view.GetModelRoot();
+  Vector3 rootSize  = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SIZE);
+  DALI_TEST_EQUALS(Vector3(2, 2, 2), rootSize, TEST_LOCATION);
+
+  Vector3 rootScale = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SCALE);
+  DALI_TEST_EQUALS(Vector3(1, 1, 1), rootScale, TEST_LOCATION);
+
+  view.FitSize(true);
+  rootSize = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SIZE);
+  DALI_TEST_EQUALS(Vector3(2, 2, 2), rootSize, TEST_LOCATION);
+
+  rootScale = rootActor.GetProperty<Vector3>(Dali::Actor::Property::SCALE);
+  DALI_TEST_EQUALS(Vector3(1, 1, 1), rootScale, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewFitCenter(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_TRIANGLE_FILE_NAME);
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(50, 50));
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  Vector3 naturalSize = view.GetNaturalSize();
+  DALI_TEST_EQUALS(Vector3(1, 1, 0), naturalSize, TEST_LOCATION);
+
+  Actor   rootActor   = view.GetModelRoot();
+  Vector3 anchorPoint = rootActor.GetProperty<Vector3>(Dali::Actor::Property::ANCHOR_POINT);
+  DALI_TEST_EQUALS(Vector3(0.5, 0.5, 0.5), anchorPoint, TEST_LOCATION);
+
+  view.FitCenter(true);
+  anchorPoint = rootActor.GetProperty<Vector3>(Dali::Actor::Property::ANCHOR_POINT);
+  DALI_TEST_EQUALS(Vector3(1.0, 1.0, 0.5), anchorPoint, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewAnimation01(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(50, 50));
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  uint32_t animationCount = view.GetAnimationCount();
+  DALI_TEST_EQUALS(1, animationCount, TEST_LOCATION);
+
+  Animation animationByIndex = view.GetAnimation(0u);
+  DALI_TEST_CHECK(animationByIndex);
+
+  Animation animationByName = view.GetAnimation("animation_AnimatedCube");
+  DALI_TEST_CHECK(animationByName);
+  DALI_TEST_EQUALS(animationByIndex, animationByName, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliModelViewAnimation02(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::ModelView view = Scene3D::ModelView::New(TEST_GLTF_ANIMATION_TEST_FILE_NAME);
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(50, 50));
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  uint32_t animationCount = view.GetAnimationCount();
+  DALI_TEST_EQUALS(9, animationCount, TEST_LOCATION);
+
+  Animation animation1 = view.GetAnimation("Step Scale");
+  DALI_TEST_CHECK(animation1);
+  DALI_TEST_EQUALS(1.66667f, animation1.GetDuration(), 0.001f, TEST_LOCATION);
+
+  Animation animation2 = view.GetAnimation("CubicSpline Scale");
+  DALI_TEST_CHECK(animation2);
+  DALI_TEST_EQUALS(1.66667f, animation2.GetDuration(), 0.001f, TEST_LOCATION);
+
+  DALI_TEST_NOT_EQUALS(animation1, animation2, 0.0f, TEST_LOCATION);
+
+  END_TEST;
+}
\ No newline at end of file
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/node-definition.h"
-#include "dali-scene-loader/public-api/view-projection.h"
+#include "dali-scene3d/public-api/loader/node-definition.h"
+#include "dali-scene3d/public-api/loader/view-projection.h"
 #include <toolkit-test-application.h>
 #include <dali-test-suite-utils.h>
 #include <string_view>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 namespace
 {
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/renderer-state.h"
-#include "dali-scene-loader/public-api/parse-renderer-state.h"
-#include "dali-scene-loader/public-api/utils.h"
+#include "dali-scene3d/public-api/loader/renderer-state.h"
+#include "dali-scene3d/public-api/loader/parse-renderer-state.h"
+#include "dali-scene3d/public-api/loader/utils.h"
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
-namespace sl = SceneLoader;
+namespace sl = Dali::Scene3D::Loader;
 namespace rs = RendererState;
 
 int UtcDaliRendererStateFromBlendFactors(void)
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/resource-bundle.h"
-#include "dali-scene-loader/public-api/utils.h"
+#include "dali-scene3d/public-api/loader/resource-bundle.h"
+#include "dali-scene3d/public-api/loader/utils.h"
 #include <dali-test-suite-utils.h>
 #include <string_view>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliResourceRefCounts(void)
 {
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/scene-definition.h"
-#include "dali-scene-loader/public-api/utils.h"
+#include "dali-scene3d/public-api/loader/scene-definition.h"
+#include "dali-scene3d/public-api/loader/utils.h"
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliSceneDefinitionAddNode(void)
 {
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/shader-definition.h"
+#include "dali-scene3d/public-api/loader/shader-definition.h"
 #include <dali-test-suite-utils.h>
 #include <string_view>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 int UtcDaliShaderDefinitionFailedToLoad(void)
 {
 #include <dali-test-suite-utils.h>
 #include <set>
 #include <string_view>
-#include "dali-scene-loader/public-api/gltf2-loader.h"
-#include "dali-scene-loader/public-api/node-definition.h"
-#include "dali-scene-loader/public-api/resource-bundle.h"
-#include "dali-scene-loader/public-api/shader-definition-factory.h"
+#include "dali-scene3d/public-api/loader/gltf2-loader.h"
+#include "dali-scene3d/public-api/loader/node-definition.h"
+#include "dali-scene3d/public-api/loader/resource-bundle.h"
+#include "dali-scene3d/public-api/loader/shader-definition-factory.h"
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 namespace
 {
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/string-callback.h"
+#include "dali-scene3d/public-api/loader/string-callback.h"
 #include <dali-test-suite-utils.h>
 #include <string_view>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 namespace
 {
@@ -41,6 +41,6 @@ int UtcDaliUtilsDefaultStringCallback(void)
 {
   InstallLogFunction(TestLogFunction);
   DefaultErrorCallback("Hello world!");
-  DALI_TEST_EQUAL(std::string(sBuffer), "2: string-callback.cpp: DefaultErrorCallback(26) > Hello world!");
+  DALI_TEST_EQUAL(std::string(sBuffer), "2: string-callback.cpp: DefaultErrorCallback(28) > Hello world!");
   END_TEST;
 }
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/utils.h"
+#include "dali-scene3d/public-api/loader/utils.h"
 #include <dali-test-suite-utils.h>
 #include <string_view>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 namespace
 {
 // Enable debug log for test coverage
 #define DEBUG_ENABLED 1
 
-#include "dali-scene-loader/public-api/view-projection.h"
+#include "dali-scene3d/public-api/loader/view-projection.h"
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
-using namespace Dali::SceneLoader;
+using namespace Dali::Scene3D::Loader;
 
 namespace
 {
index 2bbdcc8..60e1892 100644 (file)
@@ -171,3 +171,38 @@ int utcDaliAccessibilityHidden(void)
 
   END_TEST;
 }
+
+int utcDaliAutomationId(void)
+{
+  ToolkitTestApplication application;
+  Dali::Property::Index  automationIdIndex = Toolkit::DevelControl::Property::AUTOMATION_ID;
+  std::string            automationIdKey   = "automationId";
+  std::string            automationIdValue = "test123";
+
+  auto  control           = Toolkit::Control::New();
+  auto* controlAccessible = Accessibility::Accessible::Get(control);
+
+  // Check that there is no automationId initially
+  DALI_TEST_CHECK(control.GetProperty<std::string>(automationIdIndex).empty());
+  auto attributes = controlAccessible->GetAttributes();
+  DALI_TEST_CHECK(attributes.find(automationIdKey) == attributes.end());
+
+  // Set automationId
+  control.SetProperty(automationIdIndex, automationIdValue);
+
+  // Check that automationId is set
+  DALI_TEST_EQUALS(control.GetProperty<std::string>(automationIdIndex), automationIdValue, TEST_LOCATION);
+  attributes = controlAccessible->GetAttributes();
+  DALI_TEST_CHECK(attributes.find(automationIdKey) != attributes.end());
+  DALI_TEST_EQUALS(attributes[automationIdKey], automationIdValue, TEST_LOCATION);
+
+  // Unset automationId
+  control.SetProperty(automationIdIndex, "");
+
+  // Check that there is no automationId
+  DALI_TEST_CHECK(control.GetProperty<std::string>(automationIdIndex).empty());
+  attributes = controlAccessible->GetAttributes();
+  DALI_TEST_CHECK(attributes.find(automationIdKey) == attributes.end());
+
+  END_TEST;
+}
index 301f191..bc52a6f 100755 (executable)
@@ -973,7 +973,7 @@ int UtcDaliTextShapeEmojiSequences(void)
   struct GlyphInfoData glyphsVS15[] =
     {
       {1u, 3842u, 0.f, 0.f, 0.f, 0.f, 14.0f, 0.f, false, false},
-      {1u, 8203u, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, false, false},
+      {1u, 3u, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, false, false},
     };
   CharacterIndex characterIndicesVS15[]   = {0u, 0u};
   Length         charactersPerGlyphVS15[] = {0u, 2u};
index 075cf2a..0e86810 100755 (executable)
@@ -55,15 +55,16 @@ namespace Adaptor
 
 class WebEngine;
 class MockWebEngineContext;
+class MockWebEngineCookieManager;
 
 namespace
 {
-
 // Generally only one WebEngine instance exists.
 // If > 1, a new web engine has been created by CreateWindowSignal.
-static WebEngine* gInstance = nullptr;
-static int gInstanceCount = 0;
-static MockWebEngineContext* gWebEngineContextInstance = nullptr;
+WebEngine* gInstance = nullptr;
+int gInstanceCount = 0;
+MockWebEngineContext* gWebEngineContextInstance = nullptr;
+MockWebEngineCookieManager* gMockWebEngineCookieManager = nullptr;
 
 bool OnGoBack();
 bool OnGoForward();
@@ -342,6 +343,15 @@ private:
   float                              mockZoomFactor;
 };
 
+Dali::WebEngineContext* GetContext()
+{
+  if (!gWebEngineContextInstance)
+  {
+    gWebEngineContextInstance = new MockWebEngineContext();
+  }
+  return gWebEngineContextInstance;
+}
+
 class MockWebEngineCookieManager : public Dali::WebEngineCookieManager
 {
 public:
@@ -384,6 +394,15 @@ private:
   Dali::WebEngineCookieManager::CookieAcceptPolicy mockCookieAcceptPolicy;
 };
 
+Dali::WebEngineCookieManager* GetCookieManager()
+{
+  if (!gMockWebEngineCookieManager)
+  {
+    gMockWebEngineCookieManager = new MockWebEngineCookieManager();
+  }
+  return gMockWebEngineCookieManager;
+}
+
 class MockWebEngineBackForwardListItem : public Dali::WebEngineBackForwardListItem
 {
 public:
@@ -1211,13 +1230,6 @@ public:
     }
 
     mockWebEngineSettings = new MockWebEngineSettings();
-    MockWebEngineContext* engineContext = new MockWebEngineContext();
-    mockWebEngineContext = engineContext;
-    if ( gInstanceCount == 1 )
-    {
-      gWebEngineContextInstance = engineContext;
-    }
-    mockWebEngineCookieManager = new MockWebEngineCookieManager();
     mockWebEngineBackForwardList = new MockWebEngineBackForwardList();
   }
 
@@ -1226,13 +1238,10 @@ public:
     gInstanceCount--;
     if( !gInstanceCount )
     {
-      gInstance = 0;
-      gWebEngineContextInstance = 0;
+      gInstance = nullptr;
     }
 
     delete mockWebEngineSettings;
-    delete mockWebEngineContext;
-    delete mockWebEngineCookieManager;
     delete mockWebEngineBackForwardList;
   }
 
@@ -1241,16 +1250,6 @@ public:
     return *mockWebEngineSettings;
   }
 
-  Dali::WebEngineContext& GetContext() const
-  {
-    return *mockWebEngineContext;
-  }
-
-  Dali::WebEngineCookieManager& GetCookieManager() const
-  {
-    return *mockWebEngineCookieManager;
-  }
-
   Dali::WebEngineBackForwardList& GetBackForwardList() const
   {
     return *mockWebEngineBackForwardList;
@@ -1604,8 +1603,6 @@ public:
   Dali::Vector2             mScrollSize;
   Dali::Vector2             mContentSize;
   WebEngineBackForwardList* mockWebEngineBackForwardList;
-  WebEngineContext*         mockWebEngineContext;
-  WebEngineCookieManager*   mockWebEngineCookieManager;
   WebEngineSettings*        mockWebEngineSettings;
 
   std::vector<Dali::WebEnginePlugin::JavaScriptMessageHandlerCallback> mResultCallbacks;
@@ -1938,17 +1935,11 @@ bool OnRequestIntercepted()
 
 bool OnChangesWatch()
 {
-  DisconnectFromGlobalSignal( &OnChangesWatch );
-
-  if ( gInstance )
+  DisconnectFromGlobalSignal(&OnChangesWatch);
+  if (gMockWebEngineCookieManager)
   {
-    MockWebEngineCookieManager* temp = (MockWebEngineCookieManager *)(&(gInstance->GetCookieManager()));
-    if ( temp )
-    {
-      temp->mChangesWatchCallback();
-    }
+    gMockWebEngineCookieManager->mChangesWatchCallback();
   }
-
   return false;
 }
 
@@ -2004,6 +1995,16 @@ WebEngine WebEngine::New()
   return WebEngine( baseObject );
 }
 
+Dali::WebEngineContext* WebEngine::GetContext()
+{
+  return Internal::Adaptor::GetContext();
+}
+
+Dali::WebEngineCookieManager* WebEngine::GetCookieManager()
+{
+  return Internal::Adaptor::GetCookieManager();
+}
+
 WebEngine::WebEngine( const WebEngine& WebEngine )
 : BaseHandle( WebEngine )
 {
@@ -2037,16 +2038,6 @@ WebEngineSettings& WebEngine::GetSettings() const
   return Internal::Adaptor::GetImplementation( *this ).GetSettings();
 }
 
-WebEngineContext& WebEngine::GetContext() const
-{
-  return Internal::Adaptor::GetImplementation( *this ).GetContext();
-}
-
-WebEngineCookieManager& WebEngine::GetCookieManager() const
-{
-  return Internal::Adaptor::GetImplementation( *this ).GetCookieManager();
-}
-
 WebEngineBackForwardList& WebEngine::GetBackForwardList() const
 {
   return Internal::Adaptor::GetImplementation( *this ).GetBackForwardList();
index ccab3e0..60e9eea 100644 (file)
@@ -2260,55 +2260,6 @@ int UtcDaliKeyboardFocusManagerWithUserInteractionEnabled(void)
   END_TEST;
 }
 
-
-int UtcDaliKeyboardFocusManagerWithHide(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline(" UtcDaliKeyboardFocusManagerWithHide");
-
-  KeyboardFocusManager manager = KeyboardFocusManager::Get();
-  DALI_TEST_CHECK(manager);
-
-  // Create the first control and add it to the stage
-  Control first = Control::New();
-  first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
-  application.GetScene().Add(first);
-
-  // Create the second control and add it to the first control.
-  Control second = Control::New();
-  second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
-  first.Add(second);
-
-
-  // flush the queue and render once
-  application.SendNotification();
-  application.Render();
-
-  // Check that no actor is being focused yet.
-  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
-
-  // Check that the focus is set on the actor
-  DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
-  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
-
-  // If the currently focused actor becomes VISIBLE false, it loses focus.
-  first.SetProperty(Actor::Property::VISIBLE, false);
-  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
-
-  first.SetProperty(Actor::Property::VISIBLE, true);
-  // Check that the focus is set on the actor
-  DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
-  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
-
-  // If the currently focused actor becomes VISIBLE false, When the parent is hidden, the child also loses focus.
-  first.SetProperty(Actor::Property::VISIBLE, false);
-  DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
-
-
-  END_TEST;
-}
-
 int UtcDaliKeyboardFocusManagerFocusFinderRootActor(void)
 {
   ToolkitTestApplication application;
index acdf9d7..afe7253 100644 (file)
 using namespace Dali;
 using namespace Dali::Toolkit;
 
-void model_view_startup(void)
+void model3d_view_startup(void)
 {
   test_return_value = TET_UNDEF;
 }
 
-void model_view_cleanup(void)
+void model3d_view_cleanup(void)
 {
   test_return_value = TET_PASS;
 }
@@ -42,7 +42,7 @@ const char* TEST_RESOURCE_LOCATION = TEST_RESOURCE_DIR "/";
 } // namespace
 
 // Negative test case for a method
-int UtcDaliModelViewUninitialized(void)
+int UtcDaliModel3dViewUninitialized(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliModel3dViewUninitialized");
@@ -66,7 +66,7 @@ int UtcDaliModelViewUninitialized(void)
 }
 
 // Positive test case for a method
-int UtcDaliModelViewNew(void)
+int UtcDaliModel3dViewNew(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliModel3dViewNew");
@@ -80,7 +80,7 @@ int UtcDaliModelViewNew(void)
 }
 
 // Positive test case for a method
-int UtcDaliModelViewDownCast(void)
+int UtcDaliModel3dViewDownCast(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliModelViewDownCast");
@@ -96,7 +96,7 @@ int UtcDaliModelViewDownCast(void)
 }
 
 // Positive test case for a method
-int UtcDaliModelViewPropertyNames(void)
+int UtcDaliModel3dViewPropertyNames(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliModel3dViewPropertyNames");
@@ -126,7 +126,7 @@ int UtcDaliModelViewPropertyNames(void)
 }
 
 // Positive test case for a method
-int UtcDaliModelViewAddRemove(void)
+int UtcDaliModel3dViewAddRemove(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliModel3dViewAddRemove");
@@ -150,7 +150,7 @@ int UtcDaliModelViewAddRemove(void)
   END_TEST;
 }
 
-int UtcDaliModelCopyAndAssignment(void)
+int UtcDaliModel3dViewCopyAndAssignment(void)
 {
   ToolkitTestApplication application;
 
@@ -169,7 +169,7 @@ int UtcDaliModelCopyAndAssignment(void)
   END_TEST;
 }
 
-int UtcDaliModelMoveConstructor(void)
+int UtcDaliModel3dViewMoveConstructor(void)
 {
   ToolkitTestApplication application;
 
@@ -187,7 +187,7 @@ int UtcDaliModelMoveConstructor(void)
   END_TEST;
 }
 
-int UtcDaliModelMoveAssignment(void)
+int UtcDaliModel3dViewMoveAssignment(void)
 {
   ToolkitTestApplication application;
 
@@ -206,7 +206,7 @@ int UtcDaliModelMoveAssignment(void)
   END_TEST;
 }
 
-int UtcDaliModelTypeRegistry(void)
+int UtcDaliModel3dViewTypeRegistry(void)
 {
   ToolkitTestApplication application;
 
@@ -225,7 +225,7 @@ int UtcDaliModelTypeRegistry(void)
   END_TEST;
 }
 
-int UtcDaliModelOnSizeSet(void)
+int UtcDaliModel3dViewOnSizeSet(void)
 {
   ToolkitTestApplication application;
 
index f24108c..f762e8d 100644 (file)
@@ -2701,14 +2701,14 @@ int utcDaliTextFieldEvent03(void)
   application.Render();
 
   // Tap first to get the focus.
-  TestGenerateTap(application, 3.0f, 25.0f);
+  TestGenerateTap(application, 3.0f, 25.0f, 100);
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
   // Double tap to select a word.
-  TestGenerateTap(application, 3.0f, 25.0f);
+  TestGenerateTap(application, 3.0f, 25.0f, 200);
 
   // Render and notify
   application.SendNotification();
index 2ff4a7d..0ece717 100644 (file)
@@ -1140,27 +1140,33 @@ int UtcDaliToolkitTextLabelEmojisP(void)
 
   // EMOJI Sequences case for coverage.
   std::string emojiSequences =
+    "Glyphs not included in the font &#xf01a;&#xf01b;&#xf01c;&#xf01d;&#xf01e;&#xf01f;\n"   //case for coverage when glyph is not included in the font
     "Text VS15 &#x262a;&#xfe0e;\n"                                                         //text presentation sequence and selector
     "Color VS16 &#x262a;&#xfe0f;\n"                                                        //emoji presentation sequence and selector
     "Default &#x262a; \n"                                                                  //default presentation
     "FamilyManWomanGirlBoy &#x1F468;&#x200D;&#x1F469;&#x200D;&#x1F467;&#x200D;&#x1F466;\n" // emoji multi zwj sequence
     "WomanScientist &#x1f469;&#x200d;&#x1f52c;\n"                                          // emoji zwj sequence
-    "WomanScientistLightSkinTone&#x1F469;&#x1F3FB;&#x200D;&#x1F52C; \n"                    //emoji modifier sequence: skin tone & JWZ
-    "LeftRightArrowText&#x2194;&#xfe0e;\n"                                                 //text presentation sequence and selector
-    "LeftRightArrowEmoji&#x2194;&#xfe0f;\n"                                                //emoji presentation sequence and selector
-    "SouthKoreaFlag&#x1f1f0;&#x1f1f7;\n"                                                   //emoji flag sequence
+    "WomanScientistLightSkinTone&#x1F469;&#x1F3FB;&#x200D;&#x1F52C; \n"                    // emoji modifier sequence: skin tone & JWZ
+    "LeftRightArrowText&#x2194;&#xfe0e;\n"                                                 // text presentation sequence and selector
+    "LeftRightArrowEmoji&#x2194;&#xfe0f;\n"                                                // emoji presentation sequence and selector
+    "SouthKoreaFlag&#x1f1f0;&#x1f1f7;\n"                                                   // emoji flag sequence
     "JordanFlag&#x1f1ef;&#x1f1f4;\n"                                                       // emoji flag sequence
-    "EnglandFlag&#x1F3F4;&#xE0067;&#xE0062;&#xE0065;&#xE006E;&#xE0067;&#xE007F;\n"         //emoji tag sequence like England flag
+    "EnglandFlag&#x1F3F4;&#xE0067;&#xE0062;&#xE0065;&#xE006E;&#xE0067;&#xE007F;\n"         // emoji tag sequence like England flag
     "Runner &#x1f3c3;&#x200d;&#x27a1;&#xfe0f; \n"
-    "VictoryHandMediumLightSkinTone:&#x270C;&#xFE0F;&#x1F3FC;\n"               //emoji modifier sequence: skin tone
-    "RainbowFlag:&#x1F3F3;&#xFE0F;&#x200D;&#x1F308; \n"                        //emoji zwj sequence: Rainbow Flag
-    "keycap# &#x0023;&#xFE0F;&#x20E3; \n"                                      // fully-qualified  emoji keycap sequence
-    "keycap#_text &#x0023;&#x20E3; \n"                                         // unqualified emoji keycap sequence
-    "keycap3 &#x0033;&#xfe0f;&#x20e3; \n"                                      // fully-qualified  emoji keycap sequence
-    "keycap3_text &#x0033;&#x20e3; \n"                                         // unqualified emoji keycap sequence
-    "two adjacent glyphs &#x262a;&#xfe0f;&#xfe0f;&#xfe0f;&#x262a;&#xfe0f;\n"   //This line should be rendered as two adjacent glyphs
-    "Digit 8&#xfe0f; 8&#xfe0e; 8\n"                                            // should be rendered according to selector
-    "Surfing Medium Skin Female:  &#x1f3c4;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;"; // Person Surfing + Medium Skin Tone +? Zero Width Joiner + Female Sign
+    "VictoryHandMediumLightSkinTone:&#x270C;&#xFE0F;&#x1F3FC;\n"                                                                // emoji modifier sequence: skin tone
+    "RainbowFlag:&#x1F3F3;&#xFE0F;&#x200D;&#x1F308; \n"                                                                         // emoji zwj sequence: Rainbow Flag
+    "keycap# &#x0023;&#xFE0F;&#x20E3; \n"                                                                                       // fully-qualified  emoji keycap sequence
+    "keycap#_text &#x0023;&#x20E3; \n"                                                                                          // unqualified emoji keycap sequence
+    "keycap3 &#x0033;&#xfe0f;&#x20e3; \n"                                                                                       // fully-qualified  emoji keycap sequence
+    "keycap3_text &#x0033;&#x20e3; \n"                                                                                          // unqualified emoji keycap sequence
+    "two adjacent glyphs &#x262a;&#xfe0f;&#xfe0f;&#xfe0f;&#x262a;&#xfe0f;\n"                                                    // This line should be rendered as two adjacent glyphs
+    "Digit 8&#xfe0f; 8&#xfe0e; 8\n"                                                                                             // should be rendered according to selector
+    "Surfing Medium Skin Female:  &#x1f3c4;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;\n"                                                 // Person Surfing + Medium Skin Tone +? Zero Width Joiner + Female Sign
+    "SYMBOLS_NSLCL variation selector: &#x1f170;&#xfe0f;&#x1f171;&#xfe0f;&#x1f172;&#xfe0e;&#x1f173;&#xfe0e;&#x1f174;&#xfe0e;\n" // 1F170 ~ 1F174 with variation selector, text vs emoji
+    "SYMBOLS_NSLCL with VS15: &#x1f170;&#xfe0e;&#x1f171;&#xfe0e;&#x1f172;&#xfe0e;&#x1f173;&#xfe0e;&#x1f174;&#xfe0e;\n"          // 1F170 ~ 1F174 with VS15
+    "SYMBOLS_NSLCL with VS16: &#x1f170;&#xfe0f;&#x1f171;&#xfe0f;&#x1f172;&#xfe0f;&#x1f173;&#xfe0f;&#x1f174;&#xfe0f;\n"          // 1F170 ~ 1F174 with VS16
+
+    ;
 
   label.SetProperty(TextLabel::Property::TEXT, emojiSequences);
   label.SetProperty(TextLabel::Property::ENABLE_MARKUP, true);
old mode 100644 (file)
new mode 100755 (executable)
index 442d75d..30693fc
@@ -22,8 +22,6 @@
 #include "dali-toolkit-test-utils/toolkit-timer.h"
 
 #include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h>
-#include <dali-toolkit/devel-api/controls/web-view/web-context.h>
-#include <dali-toolkit/devel-api/controls/web-view/web-cookie-manager.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-settings.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-view.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali.h>
 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-certificate.h>
 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-console-message.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context.h>
 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu-item.h>
 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu.h>
-#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-cookie-manager.h>
 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-form-repost-decision.h>
 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-frame.h>
 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-hit-test.h>
@@ -890,10 +889,7 @@ int UtcDaliWebViewGetWebContext(void)
 {
   ToolkitTestApplication application;
 
-  WebView view = WebView::New();
-  DALI_TEST_CHECK(view);
-
-  Dali::Toolkit::WebContext* context = view.GetContext();
+  Dali::WebEngineContext* context = WebView::GetContext();
   DALI_TEST_CHECK(context != 0);
 
   END_TEST;
@@ -903,10 +899,7 @@ int UtcDaliWebViewGetWebCookieManager(void)
 {
   ToolkitTestApplication application;
 
-  WebView view = WebView::New();
-  DALI_TEST_CHECK(view);
-
-  Dali::Toolkit::WebCookieManager* cookieManager = view.GetCookieManager();
+  Dali::WebEngineCookieManager* cookieManager = WebView::GetCookieManager();
   DALI_TEST_CHECK(cookieManager != 0);
 
   END_TEST;
@@ -1519,14 +1512,11 @@ int UtcDaliWebBackForwardListCheckItem(void)
 
 // test cases for web context.
 
-int UtcDaliWebContextGetSetCacheModel(void)
+int UtcDaliWebContextGetSetCacheModelEtc(void)
 {
   ToolkitTestApplication application;
 
-  WebView view = WebView::New();
-  DALI_TEST_CHECK(view);
-
-  Dali::Toolkit::WebContext* context = view.GetContext();
+  Dali::WebEngineContext* context = WebView::GetContext();
   DALI_TEST_CHECK(context != 0)
 
   std::string kDefaultValue;
@@ -1595,10 +1585,7 @@ int UtcDaliWebContextGetWebDatabaseStorageOrigins(void)
 {
   ToolkitTestApplication application;
 
-  WebView view = WebView::New();
-  DALI_TEST_CHECK(view);
-
-  Dali::Toolkit::WebContext* context = view.GetContext();
+  Dali::WebEngineContext* context = WebView::GetContext();
   DALI_TEST_CHECK(context != 0)
 
   std::string kDefaultValue;
@@ -1665,10 +1652,7 @@ int UtcDaliWebContextHttpRequestInterceptor(void)
 {
   ToolkitTestApplication application;
 
-  WebView view = WebView::New();
-  DALI_TEST_CHECK(view);
-
-  Dali::Toolkit::WebContext* context = view.GetContext();
+  Dali::WebEngineContext* context = WebView::GetContext();
   DALI_TEST_CHECK(context != 0)
 
   // load url.
@@ -1708,10 +1692,7 @@ int UtcDaliWebCookieManagerGetSetCookieAcceptPolicy(void)
 {
   ToolkitTestApplication application;
 
-  WebView view = WebView::New();
-  DALI_TEST_CHECK(view);
-
-  Dali::Toolkit::WebCookieManager* cookieManager = view.GetCookieManager();
+  Dali::WebEngineCookieManager* cookieManager = WebView::GetCookieManager();
   DALI_TEST_CHECK(cookieManager != 0)
 
   const std::string kDefaultValue;
@@ -1736,10 +1717,7 @@ int UtcDaliWebCookieManagerChangesWatch(void)
 {
   ToolkitTestApplication application;
 
-  WebView view = WebView::New();
-  DALI_TEST_CHECK(view);
-
-  Dali::Toolkit::WebCookieManager* cookieManager = view.GetCookieManager();
+  Dali::WebEngineCookieManager* cookieManager = WebView::GetCookieManager();
   DALI_TEST_CHECK(cookieManager != 0)
 
   cookieManager->ChangesWatch(&OnChangesWatch);
index 2d253c9..f09a06e 100644 (file)
@@ -2,5 +2,5 @@ build
 dali.info
 *.dylib
 dali2-*-config.cmake
-libdali2-scene-loader.so*
+libdali2-scene3d.so*
 dali-shader-generator
index 31cfe9f..6609ae5 100644 (file)
@@ -34,7 +34,7 @@ OPTION(ENABLE_LINK_TEST          "Enable the link test" ON)
 OPTION(INSTALL_DOXYGEN_DOC       "Install doxygen doc" ON)
 OPTION(CONFIGURE_AUTOMATED_TESTS "Configure automated tests" ON)
 OPTION(USE_DEFAULT_RESOURCE_DIR  "Whether to use the default resource folders. Otherwise set environment variables for DALI_IMAGE_DIR, DALI_SOUND_DIR, DALI_STYLE_DIR, DALI_STYLE_IMAGE_DIR and DALI_DATA_READ_ONLY_DIR" ON)
-OPTION(BUILD_SCENE_LOADER        "Whether to build dali-scene-loader." ON)
+OPTION(BUILD_SCENE3D        "Whether to build dali-scene3d." ON)
 
 IF( ENABLE_PKG_CONFIGURE )
   FIND_PACKAGE( PkgConfig REQUIRED )
@@ -511,7 +511,7 @@ IF( ENABLE_COVERAGE )
     ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}rename_cov_data ./rename-cov-data )
 
     ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}cov_data ${LCOV_BIN} ${LCOV_OPTS} --base-directory . --directory . -c -o dali.info
-      COMMAND ${LCOV_BIN} ${LCOV_OPTS} --remove dali.info \"*/dali-env/*\" \"/usr/include/*\" \"*/dali-env/*\" \"*solid-color-actor*\" \"*/dali-toolkit/third-party/*\" \"*/dali-scene-loader/third-party/*\" -o dali.info )
+      COMMAND ${LCOV_BIN} ${LCOV_OPTS} --remove dali.info \"*/dali-env/*\" \"/usr/include/*\" \"*/dali-env/*\" \"*solid-color-actor*\" \"*/dali-toolkit/third-party/*\" \"*/dali-scene3d/third-party/*\" -o dali.info )
 
     ADD_CUSTOM_TARGET( ${DALI_TOOLKIT_PREFIX}coverage genhtml -p ${ROOT_SRC_DIR} ${LCOV_OPTS} -o ${COVERAGE_OUTPUT_DIR} dali.info
       DEPENDS cov_data )
@@ -554,8 +554,8 @@ IF( ENABLE_COVERAGE )
   ENDIF( LCOV_BIN )
 ENDIF()
 
-IF ( BUILD_SCENE_LOADER )
-  ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/dali-scene-loader )
+IF ( BUILD_SCENE3D )
+  ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/dali-scene3d )
 ENDIF()
 
 
@@ -572,9 +572,9 @@ IF( DOXYGEN_FOUND )
   CONFIGURE_FILE( ${DOXYGEN_SRC_DIR}/dali.doxy.in ${DOXYGEN_SRC_DIR}/dali.doxy @ONLY )
   CONFIGURE_FILE( ${DOXYGEN_INTERNAL_SRC_DIR}/dali-internal.doxy.in ${DOXYGEN_INTERNAL_SRC_DIR}/dali-internal.doxy @ONLY )
 
-  IF ( BUILD_SCENE_LOADER )
+  IF ( BUILD_SCENE3D )
     ADD_CUSTOM_TARGET( doc_doxygen ALL
-      DEPENDS ${name} dali2-scene-loader
+      DEPENDS ${name} dali2-scene3d
       COMMAND ${DOXYGEN_EXECUTABLE} -u ${DOXYGEN_SRC_DIR}/dali.doxy
       COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_SRC_DIR}/dali.doxy
       COMMAND ${CMAKE_COMMAND} -P ${DOXYGEN_SRC_DIR}/check_for_errors.cmake
@@ -630,7 +630,7 @@ MESSAGE( STATUS "Use pkg configure:             " ${ENABLE_PKG_CONFIGURE} )
 MESSAGE( STATUS "Vector Based Text Rendering:   " ${ENABLE_VECTOR_BASED_TEXT_RENDERING} )
 MESSAGE( STATUS "Enable link test:              " ${ENABLE_LINK_TEST} )
 MESSAGE( STATUS "Configure automated tests:     " ${CONFIGURE_AUTOMATED_TESTS} )
-MESSAGE( STATUS "Build Dali Scene Loader:       " ${BUILD_SCENE_LOADER} )
+MESSAGE( STATUS "Build Dali Scene3D:       " ${BUILD_SCENE3D} )
 MESSAGE( STATUS "CXXFLAGS:                      " ${CMAKE_CXX_FLAGS} )
 MESSAGE( STATUS "LDFLAGS:                       " ${CMAKE_SHARED_LINKER_FLAGS_INIT}${CMAKE_SHARED_LINKER_FLAGS} )
 
similarity index 82%
rename from build/tizen/dali-scene-loader/CMakeLists.txt
rename to build/tizen/dali-scene3d/CMakeLists.txt
index f900b5a..08e646e 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 3.8.2)
-set(name "dali2-scene-loader")
+set(name "dali2-scene3d")
 
 project(${name} CXX)
 
@@ -8,13 +8,13 @@ set(${name}_VERSION_MINOR 0)
 set(${name}_VERSION_PATCH 0)
 set(${name}_VERSION ${${name}_VERSION_MAJOR}.${${name}_VERSION_MINOR}.${${name}_VERSION_PATCH} )
 
-SET(DALI_SCENE_LOADER_VERSION ${${name}_VERSION} )
+SET(DALI_SCENE3D_VERSION ${${name}_VERSION} )
 
 if(CMAKE_BUILD_TYPE MATCHES Debug)
        add_definitions("-DDEBUG_ENABLED")
 endif()
 
-ADD_DEFINITIONS( "-DBUILDING_DALI_SCENE_LOADER" )
+ADD_DEFINITIONS( "-DBUILDING_DALI_SCENE3D" )
 
 foreach(flag ${PKGS_CFLAGS})
        set(extra_flags "${extra_flags} ${flag}")
@@ -34,7 +34,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${extra_flags}")
 set(prefix ${CMAKE_INSTALL_PREFIX})
 
 set(repo_root_dir "${CMAKE_CURRENT_LIST_DIR}/../../../")
-set(scene_loader_dir "${repo_root_dir}/dali-scene-loader")
+set(scene3d_dir "${repo_root_dir}/dali-scene3d")
 
 option(ENABLE_PKG_CONFIGURE "Use pkgconfig" ON)
 option(ENABLE_COVERAGE "Coverage" OFF)
@@ -66,13 +66,13 @@ if (ENABLE_PKG_CONFIGURE)
        set(EXEC_PREFIX ${CMAKE_INSTALL_PREFIX})
        set(DEV_INCLUDE_PATH ${INCLUDE_DIR})
 
-       set(core_pkg_cfg_file dali2-scene-loader.pc)
+       set(core_pkg_cfg_file dali2-scene3d.pc)
        configure_file(${CMAKE_CURRENT_LIST_DIR}/${core_pkg_cfg_file}.in ${core_pkg_cfg_file} @ONLY)
 endif()
 
-set(scene_loader_src_files "")
-include("${scene_loader_dir}/internal/file.list")
-include("${scene_loader_dir}/public-api/file.list")
+set(scene3d_src_files "")
+include("${scene3d_dir}/internal/file.list")
+include("${scene3d_dir}/public-api/file.list")
 
 set(prefix_include_dir "${prefix}/include")
 include_directories(${repo_root_dir}
@@ -80,10 +80,10 @@ include_directories(${repo_root_dir}
 )
 
 # Generate source files for shaders
-SET(SHADER_SOURCE_DIR "${scene_loader_dir}/internal/graphics/shaders/")
-SET(SHADER_GENERATED_DIR "${scene_loader_dir}/internal/graphics/generated")
+SET(SHADER_SOURCE_DIR "${scene3d_dir}/internal/graphics/shaders/")
+SET(SHADER_GENERATED_DIR "${scene3d_dir}/internal/graphics/generated")
 
-SET(GENERATED_SHADER_DIR ${scene_loader_dir}/internal/graphics/)
+SET(GENERATED_SHADER_DIR ${scene3d_dir}/internal/graphics/)
 SET_PROPERTY(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
              "${GENERATED_SHADER_DIR}/generated/"
              "${GENERATED_SHADER_DIR}/builtin-shader-extern-gen.h")
@@ -104,9 +104,9 @@ ADD_CUSTOM_COMMAND(OUTPUT ${BUILT_IN_SHADER_GEN_CPP}
                    DEPENDS ${SHADER_GENERATOR_BINARY}
                    COMMAND ${SHADER_GENERATOR_BINARY} ${SHADER_SOURCE_DIR} ${SHADER_GENERATED_DIR})
 
-SET( scene_loader_src_files ${scene_loader_src_files} ${BUILT_IN_SHADER_GEN_CPP} )
+SET( scene3d_src_files ${scene3d_src_files} ${BUILT_IN_SHADER_GEN_CPP} )
 
-add_library(${name} SHARED ${scene_loader_src_files})
+add_library(${name} SHARED ${scene3d_src_files})
 
 target_link_libraries(${name} ${DALICORE_LDFLAGS} ${DALIADAPTOR_LDFLAGS}
        dali2-toolkit
@@ -119,7 +119,7 @@ endif()
 IF( INSTALL_CMAKE_MODULES )
        SET_TARGET_PROPERTIES( ${name}
                PROPERTIES
-               VERSION ${DALI_SCENE_LOADER_VERSION}
+               VERSION ${DALI_SCENE3D_VERSION}
                SOVERSION ${${name}_VERSION_MAJOR}
                CLEAN_DIRECT_OUPUT 1
        )
@@ -160,9 +160,9 @@ ELSE()
        INSTALL( TARGETS ${name} DESTINATION ${LIB_DIR} )
 ENDIF()
 
-file(GLOB scene_loader_include_files ${scene_loader_public_api_dir})
-install(DIRECTORY ${scene_loader_include_files}
-       DESTINATION "${prefix_include_dir}/dali-scene-loader"
+file(GLOB scene3d_include_files ${scene3d_public_api_dir})
+install(DIRECTORY ${scene3d_include_files}
+       DESTINATION "${prefix_include_dir}/dali-scene3d"
        FILES_MATCHING PATTERN "*.h"
 )
 
@@ -1,12 +1,12 @@
 prefix=@PREFIX@
 exec_prefix=@EXEC_PREFIX@
-apiversion=@DALI_SCENE_LOADER_VERSION@
+apiversion=@DALI_SCENE3D_VERSION@
 libdir=@LIB_DIR@
 includedir=@DEV_INCLUDE_PATH@
 
-Name: Dali 3D Engine Scene Loader
-Description: Dali Scene Loader library
+Name: Dali 3D Engine Scene3D
+Description: Dali Scene3D library
 Version: ${apiversion}
 Requires: dali2-toolkit
-Libs: -L${libdir} -ldali2-scene-loader
+Libs: -L${libdir} -ldali2-scene3d
 Cflags: -I${includedir}
index 7cf973a..1807df0 100644 (file)
@@ -2293,7 +2293,7 @@ INCLUDE_FILE_PATTERNS  =
 PREDEFINED             = DALI_CORE_API \
                          DALI_ADAPTOR_API \
                          DALI_TOOLKIT_API \
-                         DALI_SCENE_LOADER_API \
+                         DALI_SCENE3D_API \
                          DALI_INTERNAL \
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
index 0fefc0e..f60c723 100644 (file)
@@ -999,7 +999,7 @@ INPUT                  = @DOXYGEN_DOCS_DIR@/content \
                          @prefix@/include/dali/devel-api \
                          ../../../dali-toolkit/public-api \
                          ../../../dali-toolkit/devel-api \
-                         ../../../dali-scene-loader/public-api \
+                         ../../../dali-scene3d/public-api \
                          ../../../automated-tests/README.md
 
 # This tag can be used to specify the character encoding of the source files
@@ -2274,7 +2274,7 @@ INCLUDE_FILE_PATTERNS  =
 PREDEFINED             = DALI_CORE_API \
                          DALI_ADAPTOR_API \
                          DALI_TOOLKIT_API \
-                         DALI_SCENE_LOADER_API \
+                         DALI_SCENE3D_API \
                          DALI_INTERNAL \
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
diff --git a/dali-scene-loader/internal/file.list b/dali-scene-loader/internal/file.list
deleted file mode 100644 (file)
index 70d94f3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-set(scene_loader_internal_dir "${scene_loader_dir}/internal")
-
-set(scene_loader_src_files ${scene_loader_src_files}
-       ${scene_loader_internal_dir}/gltf2-asset.cpp
-       ${scene_loader_internal_dir}/hash.cpp
-       ${scene_loader_internal_dir}/json-reader.cpp
-       ${scene_loader_internal_dir}/json-util.cpp
-)
diff --git a/dali-scene-loader/public-api/file.list b/dali-scene-loader/public-api/file.list
deleted file mode 100644 (file)
index 488ed7b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-set(scene_loader_public_api_dir "${scene_loader_dir}/public-api")
-
-set(scene_loader_src_files ${scene_loader_src_files}
-       ${scene_loader_public_api_dir}/alpha-function-helper.cpp
-       ${scene_loader_public_api_dir}/animated-property.cpp
-       ${scene_loader_public_api_dir}/animation-definition.cpp
-       ${scene_loader_public_api_dir}/blend-shape-details.cpp
-       ${scene_loader_public_api_dir}/camera-parameters.cpp
-       ${scene_loader_public_api_dir}/customization.cpp
-       ${scene_loader_public_api_dir}/dli-loader.cpp
-       ${scene_loader_public_api_dir}/environment-definition.cpp
-       ${scene_loader_public_api_dir}/facial-animation-loader.cpp
-       ${scene_loader_public_api_dir}/gltf2-loader.cpp
-       ${scene_loader_public_api_dir}/ktx-loader.cpp
-       ${scene_loader_public_api_dir}/material-definition.cpp
-       ${scene_loader_public_api_dir}/matrix-stack.cpp
-       ${scene_loader_public_api_dir}/mesh-definition.cpp
-       ${scene_loader_public_api_dir}/node-definition.cpp
-       ${scene_loader_public_api_dir}/parse-renderer-state.cpp
-       ${scene_loader_public_api_dir}/renderer-state.cpp
-       ${scene_loader_public_api_dir}/resource-bundle.cpp
-       ${scene_loader_public_api_dir}/scene-definition.cpp
-       ${scene_loader_public_api_dir}/shader-definition.cpp
-       ${scene_loader_public_api_dir}/shader-definition-factory.cpp
-       ${scene_loader_public_api_dir}/skinning-details.cpp
-       ${scene_loader_public_api_dir}/string-callback.cpp
-       ${scene_loader_public_api_dir}/utils.cpp
-       ${scene_loader_public_api_dir}/view-projection.cpp
-)
similarity index 99%
rename from dali-scene-loader/README.md
rename to dali-scene3d/README.md
index b29c463..4174487 100644 (file)
@@ -213,7 +213,7 @@ DLI supports meshes that allow deformation by skeletal animation. These must def
    * `joints0` and `weights0` attributes, as above.
    * A [`skeleton`](#skeletons) ID, to specify which (joint) nodes' transformations affect the mesh.
 
-:warning: The maximum number of bones supported by DALi Scene Loader is `64`.
+:warning: The maximum number of bones supported by DALi Scene3D is `64`.
 
 ## Blend shapes
 Blend shapes provide alternate configurations of vertex `positions`, `normals` and/or `tangents` that may be blended with the same attributes of the base mesh, controlled by an animatable `weight`.
@@ -241,7 +241,7 @@ Blend shapes provide alternate configurations of vertex `positions`, `normals` a
 ```
 A `blendShapesHeader`, if present, must define:
    * the `version` of the blend shapes; supported values are `1.0` and `2.0`. The difference between the versions is that v1.0 requires a per-blend shape definition of an un-normalization factor.
-   * the `byteOffset` and `byteLength` of a buffer in the binary which defines the width (2 bytes) and height (2 bytes) of the texture that dali-scene-loader creates for blend shape data.
+   * the `byteOffset` and `byteLength` of a buffer in the binary which defines the width (2 bytes) and height (2 bytes) of the texture that dali-scene3d creates for blend shape data.
 
 The `blendShapes` array then defines the shapes that are available to blend between, comprising of:
    * An initial `weight` numerical, the default is 0;
diff --git a/dali-scene3d/internal/controls/model-view/model-view-impl.cpp b/dali-scene3d/internal/controls/model-view/model-view-impl.cpp
new file mode 100644 (file)
index 0000000..568b899
--- /dev/null
@@ -0,0 +1,552 @@
+/*
+ * Copyright (c) 2022 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include "model-view-impl.h"
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
+#include <dali/integration-api/debug.h>
+#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/object/type-registry.h>
+#include <filesystem>
+
+// INTERNAL INCLUDES
+#include <dali-scene3d/public-api/controls/model-view/model-view.h>
+#include <dali-scene3d/public-api/loader/animation-definition.h>
+#include <dali-scene3d/public-api/loader/camera-parameters.h>
+#include <dali-scene3d/public-api/loader/cube-data.h>
+#include <dali-scene3d/public-api/loader/cube-map-loader.h>
+#include <dali-scene3d/public-api/loader/dli-loader.h>
+#include <dali-scene3d/public-api/loader/gltf2-loader.h>
+#include <dali-scene3d/public-api/loader/light-parameters.h>
+#include <dali-scene3d/public-api/loader/load-result.h>
+#include <dali-scene3d/public-api/loader/node-definition.h>
+#include <dali-scene3d/public-api/loader/scene-definition.h>
+#include <dali-scene3d/public-api/loader/shader-definition-factory.h>
+
+using namespace Dali;
+
+namespace Dali
+{
+namespace Scene3D
+{
+namespace Internal
+{
+namespace
+{
+BaseHandle Create()
+{
+  return Scene3D::ModelView::New(std::string());
+}
+
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN(Scene3D::ModelView, Toolkit::Control, Create);
+DALI_TYPE_REGISTRATION_END()
+
+static constexpr uint32_t OFFSET_FOR_DIFFUSE_CUBE_TEXTURE  = 2u;
+static constexpr uint32_t OFFSET_FOR_SPECULAR_CUBE_TEXTURE = 1u;
+
+static constexpr Vector3 Y_DIRECTION(1.0f, -1.0f, 1.0f);
+
+static constexpr std::string_view KTX_EXTENSION  = ".ktx";
+static constexpr std::string_view OBJ_EXTENSION  = ".obj";
+static constexpr std::string_view GLTF_EXTENSION = ".gltf";
+static constexpr std::string_view DLI_EXTENSION  = ".dli";
+
+struct BoundingVolume
+{
+  void Init()
+  {
+    pointMin = Vector3(std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
+    pointMax = Vector3(std::numeric_limits<float>::min(), std::numeric_limits<float>::min(), std::numeric_limits<float>::min());
+  }
+
+  void ConsiderNewPointInVolume(const Vector3& position)
+  {
+    pointMin.x = std::min(position.x, pointMin.x);
+    pointMin.y = std::min(position.y, pointMin.y);
+    pointMin.z = std::min(position.z, pointMin.z);
+
+    pointMax.x = std::max(position.x, pointMax.x);
+    pointMax.y = std::max(position.y, pointMax.y);
+    pointMax.z = std::max(position.z, pointMax.z);
+  }
+
+  Vector3 CalculateSize()
+  {
+    return pointMax - pointMin;
+  }
+
+  Vector3 CalculatePivot()
+  {
+    Vector3 pivot = pointMin / (pointMin - pointMax);
+    for(uint32_t i = 0; i < 3; ++i)
+    {
+      // To avoid divid by zero
+      if(pointMin[i] == pointMax[i])
+      {
+        pivot[i] = 0.5f;
+      }
+    }
+    return pivot;
+  }
+
+  Vector3 pointMin;
+  Vector3 pointMax;
+};
+
+Texture LoadCubeMap(const std::string& cubeMapPath)
+{
+  Texture                         cubeTexture;
+  Dali::Scene3D::Loader::CubeData cubeData;
+  if(Dali::Scene3D::Loader::LoadCubeMapData(cubeMapPath, cubeData))
+  {
+    cubeTexture = cubeData.CreateTexture();
+  }
+  else
+  {
+    DALI_LOG_ERROR("Fail to load cube map, %s\n", cubeMapPath.c_str());
+  }
+
+  return cubeTexture;
+}
+
+void ConfigureBlendShapeShaders(
+  Dali::Scene3D::Loader::ResourceBundle& resources, const Dali::Scene3D::Loader::SceneDefinition& scene, Actor root, std::vector<Dali::Scene3D::Loader::BlendshapeShaderConfigurationRequest>&& requests)
+{
+  std::vector<std::string> errors;
+  auto                     onError = [&errors](const std::string& msg) { errors.push_back(msg); };
+  if(!scene.ConfigureBlendshapeShaders(resources, root, std::move(requests), onError))
+  {
+    Dali::Scene3D::Loader::ExceptionFlinger flinger(ASSERT_LOCATION);
+    for(auto& msg : errors)
+    {
+      flinger << msg << '\n';
+    }
+  }
+}
+
+void AddModelTreeToAABB(BoundingVolume& AABB, const Dali::Scene3D::Loader::SceneDefinition& scene, const Dali::Scene3D::Loader::Customization::Choices& choices, Dali::Scene3D::Loader::Index iNode, Dali::Scene3D::Loader::NodeDefinition::CreateParams& nodeParams, Matrix parentMatrix)
+{
+  static constexpr uint32_t BOX_POINT_COUNT             = 8;
+  static uint32_t           BBIndex[BOX_POINT_COUNT][3] = {{0, 0, 0}, {0, 1, 0}, {1, 0, 0}, {1, 1, 0}, {0, 0, 1}, {0, 1, 1}, {1, 0, 1}, {1, 1, 1}};
+
+  Matrix                                       nodeMatrix;
+  const Dali::Scene3D::Loader::NodeDefinition* node        = scene.GetNode(iNode);
+  Matrix                                       localMatrix = node->GetLocalSpace();
+  Matrix::Multiply(nodeMatrix, localMatrix, parentMatrix);
+
+  Vector3 volume[2];
+  if(node->GetExtents(nodeParams.mResources, volume[0], volume[1]))
+  {
+    for(uint32_t i = 0; i < BOX_POINT_COUNT; ++i)
+    {
+      Vector4 position       = Vector4(volume[BBIndex[i][0]].x, volume[BBIndex[i][1]].y, volume[BBIndex[i][2]].z, 1.0f);
+      Vector4 objectPosition = nodeMatrix * position;
+      objectPosition /= objectPosition.w;
+
+      AABB.ConsiderNewPointInVolume(Vector3(objectPosition));
+    }
+  }
+
+  if(node->mCustomization)
+  {
+    if(!node->mChildren.empty())
+    {
+      auto                         choice = choices.Get(node->mCustomization->mTag);
+      Dali::Scene3D::Loader::Index i      = std::min(choice != Dali::Scene3D::Loader::Customization::NONE ? choice : 0, static_cast<Dali::Scene3D::Loader::Index>(node->mChildren.size() - 1));
+
+      AddModelTreeToAABB(AABB, scene, choices, node->mChildren[i], nodeParams, nodeMatrix);
+    }
+  }
+  else
+  {
+    for(auto i : node->mChildren)
+    {
+      AddModelTreeToAABB(AABB, scene, choices, i, nodeParams, nodeMatrix);
+    }
+  }
+}
+
+} // anonymous namespace
+
+ModelView::ModelView(const std::string& modelPath, const std::string& resourcePath)
+: Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT)),
+  mModelPath(modelPath),
+  mResourcePath(resourcePath),
+  mModelLayer(),
+  mModelRoot(),
+  mNaturalSize(Vector3::ZERO),
+  mModelPivot(AnchorPoint::CENTER),
+  mIblScaleFactor(1.0f),
+  mFitSize(false),
+  mFitCenter(false)
+{
+}
+
+ModelView::~ModelView()
+{
+}
+
+Dali::Scene3D::ModelView ModelView::New(const std::string& modelPath, const std::string& resourcePath)
+{
+  ModelView* impl = new ModelView(modelPath, resourcePath);
+
+  Dali::Scene3D::ModelView handle = Dali::Scene3D::ModelView(*impl);
+
+  // Second-phase init of the implementation
+  // This can only be done after the CustomActor connection has been made...
+  impl->Initialize();
+
+  return handle;
+}
+
+const Actor ModelView::GetModelRoot()
+{
+  return mModelRoot;
+}
+
+void ModelView::FitSize(bool fit)
+{
+  mFitSize = fit;
+  ScaleModel();
+}
+
+void ModelView::FitCenter(bool fit)
+{
+  mFitCenter = fit;
+  FitModelPosition();
+}
+
+void ModelView::SetImageBasedLightSource(const std::string& diffuse, const std::string& specular, float scaleFactor)
+{
+  Texture diffuseTexture = LoadCubeMap(diffuse);
+  if(diffuseTexture)
+  {
+    Texture specularTexture = LoadCubeMap(specular);
+    if(specularTexture)
+    {
+      mDiffuseTexture  = diffuseTexture;
+      mSpecularTexture = specularTexture;
+      mIblScaleFactor  = scaleFactor;
+
+      SetImageBasedLight(mModelRoot);
+    }
+  }
+}
+
+uint32_t ModelView::GetAnimationCount()
+{
+  return mAnimations.size();
+}
+
+Dali::Animation ModelView::GetAnimation(uint32_t index)
+{
+  Dali::Animation animation;
+  if(mAnimations.size() > index)
+  {
+    animation = mAnimations[index].second;
+  }
+  return animation;
+}
+
+Dali::Animation ModelView::GetAnimation(const std::string& name)
+{
+  Dali::Animation animation;
+  if(!name.empty())
+  {
+    for(auto&& animationData : mAnimations)
+    {
+      if(animationData.first == name)
+      {
+        animation = animationData.second;
+        break;
+      }
+    }
+  }
+  return animation;
+}
+
+///////////////////////////////////////////////////////////
+//
+// Private methods
+//
+
+void ModelView::OnSceneConnection(int depth)
+{
+  if(!mModelRoot)
+  {
+    LoadModel();
+  }
+
+  Control::OnSceneConnection(depth);
+}
+
+void ModelView::OnInitialize()
+{
+  Actor self  = Self();
+  mModelLayer = Layer::New();
+  mModelLayer.SetProperty(Layer::Property::BEHAVIOR, Layer::LAYER_3D);
+  mModelLayer.SetProperty(Layer::Property::DEPTH_TEST, true);
+  mModelLayer.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+  mModelLayer.SetProperty(Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+  mModelLayer.SetResizePolicy(ResizePolicy::FILL_TO_PARENT,
+                              Dimension::ALL_DIMENSIONS);
+
+  // Models in glTF and dli are defined as right hand coordinate system.
+  // DALi uses left hand coordinate system. Scaling negative is for change winding order.
+  mModelLayer.SetProperty(Dali::Actor::Property::SCALE_Y, -1.0f);
+  self.Add(mModelLayer);
+}
+
+Vector3 ModelView::GetNaturalSize()
+{
+  if(!mModelRoot)
+  {
+    LoadModel();
+  }
+
+  return mNaturalSize;
+}
+
+float ModelView::GetHeightForWidth(float width)
+{
+  Extents padding;
+  padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
+  return Control::GetHeightForWidth(width) + padding.top + padding.bottom;
+}
+
+float ModelView::GetWidthForHeight(float height)
+{
+  Extents padding;
+  padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
+  return Control::GetWidthForHeight(height) + padding.start + padding.end;
+}
+
+void ModelView::OnRelayout(const Vector2& size, RelayoutContainer& container)
+{
+  Control::OnRelayout(size, container);
+  ScaleModel();
+}
+
+void ModelView::LoadModel()
+{
+  std::filesystem::path modelPath(mModelPath);
+  if(mResourcePath.empty())
+  {
+    mResourcePath = std::string(modelPath.parent_path()) + "/";
+  }
+  std::string extension = modelPath.extension();
+  std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
+
+  Dali::Scene3D::Loader::ResourceBundle::PathProvider pathProvider = [&](Dali::Scene3D::Loader::ResourceType::Value type) {
+    return mResourcePath;
+  };
+
+  Dali::Scene3D::Loader::ResourceBundle                        resources;
+  Dali::Scene3D::Loader::SceneDefinition                       scene;
+  std::vector<Dali::Scene3D::Loader::AnimationGroupDefinition> animGroups;
+  std::vector<Dali::Scene3D::Loader::CameraParameters>         cameraParameters;
+  std::vector<Dali::Scene3D::Loader::LightParameters>          lights;
+
+  std::vector<Dali::Scene3D::Loader::AnimationDefinition> animations;
+  animations.clear();
+
+  Dali::Scene3D::Loader::LoadResult output{resources, scene, animations, animGroups, cameraParameters, lights};
+
+  if(extension == DLI_EXTENSION)
+  {
+    Dali::Scene3D::Loader::DliLoader              loader;
+    Dali::Scene3D::Loader::DliLoader::InputParams input{
+      pathProvider(Dali::Scene3D::Loader::ResourceType::Mesh),
+      nullptr,
+      {},
+      {},
+      nullptr,
+      {}};
+    Dali::Scene3D::Loader::DliLoader::LoadParams loadParams{input, output};
+    if(!loader.LoadScene(mModelPath, loadParams))
+    {
+      Dali::Scene3D::Loader::ExceptionFlinger(ASSERT_LOCATION) << "Failed to load scene from '" << mModelPath << "': " << loader.GetParseError();
+    }
+  }
+  else if(extension == GLTF_EXTENSION)
+  {
+    Dali::Scene3D::Loader::ShaderDefinitionFactory sdf;
+    sdf.SetResources(resources);
+    Dali::Scene3D::Loader::LoadGltfScene(mModelPath, sdf, output);
+
+    resources.mEnvironmentMaps.push_back({});
+  }
+  else
+  {
+    DALI_LOG_ERROR("Unsupported model type.\n");
+  }
+
+  Dali::Scene3D::Loader::Transforms                   xforms{Dali::Scene3D::Loader::MatrixStack{}, Dali::Scene3D::Loader::ViewProjection{}};
+  Dali::Scene3D::Loader::NodeDefinition::CreateParams nodeParams{resources, xforms, {}, {}, {}};
+  Dali::Scene3D::Loader::Customization::Choices       choices;
+
+  mModelRoot = Actor::New();
+
+  BoundingVolume AABB;
+  for(auto iRoot : scene.GetRoots())
+  {
+    auto resourceRefs = resources.CreateRefCounter();
+    scene.CountResourceRefs(iRoot, choices, resourceRefs);
+    resources.CountEnvironmentReferences(resourceRefs);
+
+    resources.LoadResources(resourceRefs, pathProvider);
+
+    // glTF Mesh is defined in right hand coordinate system, with positive Y for Up direction.
+    // Because DALi uses left hand system, Y direciton will be flipped for environment map sampling.
+    for(auto&& env : resources.mEnvironmentMaps)
+    {
+      env.first.mYDirection = Y_DIRECTION;
+    }
+
+    if(auto actor = scene.CreateNodes(iRoot, choices, nodeParams))
+    {
+      scene.ConfigureSkeletonJoints(iRoot, resources.mSkeletons, actor);
+      scene.ConfigureSkinningShaders(resources, actor, std::move(nodeParams.mSkinnables));
+      ConfigureBlendShapeShaders(resources, scene, actor, std::move(nodeParams.mBlendshapeRequests));
+
+      scene.ApplyConstraints(actor, std::move(nodeParams.mConstrainables));
+
+      mModelRoot.Add(actor);
+    }
+
+    AddModelTreeToAABB(AABB, scene, choices, iRoot, nodeParams, Matrix::IDENTITY);
+  }
+
+  if(!animations.empty())
+  {
+    auto getActor = [&](const std::string& name) {
+      return mModelRoot.FindChildByName(name);
+    };
+
+    mAnimations.clear();
+    for(auto&& animation : animations)
+    {
+      Dali::Animation anim = animation.ReAnimate(getActor);
+
+      mAnimations.push_back({animation.mName, anim});
+    }
+  }
+
+  SetImageBasedLight(mModelRoot);
+
+  mNaturalSize = AABB.CalculateSize();
+  mModelPivot  = AABB.CalculatePivot();
+  mModelRoot.SetProperty(Dali::Actor::Property::SIZE, mNaturalSize);
+
+  FitModelPosition();
+  ScaleModel();
+
+  mModelLayer.Add(mModelRoot);
+}
+
+void ModelView::ScaleModel()
+{
+  if(mModelRoot)
+  {
+    if(mFitSize)
+    {
+      Vector3 size = Self().GetProperty<Vector3>(Dali::Actor::Property::SIZE);
+      if(size.x > 0.0f && size.y > 0.0f)
+      {
+        float scaleFactor = MAXFLOAT;
+        scaleFactor       = std::min(size.x / mNaturalSize.x, scaleFactor);
+        scaleFactor       = std::min(size.y / mNaturalSize.y, scaleFactor);
+        mModelRoot.SetProperty(Dali::Actor::Property::SCALE, scaleFactor);
+      }
+      else
+      {
+        DALI_LOG_ERROR("ModelView size is wrong.");
+      }
+    }
+    else
+    {
+      mModelRoot.SetProperty(Dali::Actor::Property::SCALE, 1.0f);
+    }
+  }
+}
+
+void ModelView::FitModelPosition()
+{
+  if(mModelRoot)
+  {
+    if(mFitCenter)
+    {
+      // Loaded model pivot is not the model center.
+      mModelRoot.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+      mModelRoot.SetProperty(Dali::Actor::Property::ANCHOR_POINT, Vector3::ONE - mModelPivot);
+    }
+    else
+    {
+      mModelRoot.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+      mModelRoot.SetProperty(Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+    }
+  }
+}
+
+void ModelView::SetImageBasedLight(Actor node)
+{
+  if(!mDiffuseTexture || !mSpecularTexture || !node)
+  {
+    return;
+  }
+
+  uint32_t rendererCount = node.GetRendererCount();
+  if(rendererCount)
+  {
+    node.RegisterProperty(Dali::Scene3D::Loader::NodeDefinition::GetIblScaleFactorUniformName().data(), mIblScaleFactor);
+  }
+
+  for(uint32_t i = 0; i < rendererCount; ++i)
+  {
+    Dali::Renderer renderer = node.GetRendererAt(i);
+    if(renderer)
+    {
+      Dali::TextureSet textures = renderer.GetTextures();
+      if(textures)
+      {
+        uint32_t textureCount = textures.GetTextureCount();
+        // EnvMap requires at least 2 texture, diffuse and specular
+        if(textureCount > 2u)
+        {
+          textures.SetTexture(textureCount - OFFSET_FOR_DIFFUSE_CUBE_TEXTURE, mDiffuseTexture);
+          textures.SetTexture(textureCount - OFFSET_FOR_SPECULAR_CUBE_TEXTURE, mSpecularTexture);
+        }
+      }
+    }
+  }
+
+  uint32_t childrenCount = node.GetChildCount();
+  for(uint32_t i = 0; i < childrenCount; ++i)
+  {
+    SetImageBasedLight(node.GetChildAt(i));
+  }
+}
+
+} // namespace Internal
+} // namespace Scene3D
+} // namespace Dali
diff --git a/dali-scene3d/internal/controls/model-view/model-view-impl.h b/dali-scene3d/internal/controls/model-view/model-view-impl.h
new file mode 100644 (file)
index 0000000..14b31f9
--- /dev/null
@@ -0,0 +1,187 @@
+#ifndef DALI_SCENE3D_INTERNAL_MODEL_VIEW_H
+#define DALI_SCENE3D_INTERNAL_MODEL_VIEW_H
+
+/*
+ * Copyright (c) 2022 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/animation/animation.h>
+#include <dali/public-api/rendering/texture.h>
+
+// INTERNAL INCLUDES
+#include <dali-scene3d/public-api/controls/model-view/model-view.h>
+
+namespace Dali
+{
+namespace Scene3D
+{
+class ModelView;
+
+namespace Internal
+{
+/**
+ * @brief Impl class for ModelView.
+ */
+class ModelView : public Dali::Toolkit::Internal::Control
+{
+public:
+  using AnimationData = std::pair<std::string, Dali::Animation>;
+
+  /**
+   * @brief Creates a new ModelView.
+   *
+   * @return A public handle to the newly allocated ModelView.
+   */
+  static Dali::Scene3D::ModelView New(const std::string& modelPath, const std::string& resourcePath);
+
+  /**
+   * @copydoc ModelView::GetModelRoot()
+   */
+  const Actor GetModelRoot();
+
+  /**
+   * @copydoc ModelView::FitModel()
+   */
+  void FitSize(bool fit);
+
+  /**
+   * @copydoc ModelView::FitCenter()
+   */
+  void FitCenter(bool fit);
+
+  /**
+   * @copydoc ModelView::SetImageBasedLightSource()
+   */
+  void SetImageBasedLightSource(const std::string& diffuse, const std::string& specular, float scaleFactor);
+
+  /**
+   * @copydoc ModelView::GetAnimationCount()
+   */
+  uint32_t GetAnimationCount();
+
+  /**
+   * @copydoc ModelView::GetAnimation()
+   */
+  Dali::Animation GetAnimation(uint32_t index);
+
+  /**
+   * @copydoc ModelView::GetAnimation()
+   */
+  Dali::Animation GetAnimation(const std::string& name);
+
+protected:
+  /**
+   * @brief Constructs a new ModelView.
+   */
+  ModelView(const std::string& modelPath, const std::string& resourcePath);
+
+  /**
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~ModelView();
+
+private:
+  /**
+   * @copydoc CustomActorImpl::OnSceneConnection()
+   */
+  void OnSceneConnection(int depth) override;
+
+  /**
+   * @copydoc Toolkit::Control::OnInitialize()
+   */
+  void OnInitialize() override;
+
+  /**
+   * @copydoc Toolkit::Control::GetNaturalSize
+   */
+  Vector3 GetNaturalSize() override;
+
+  /**
+   * @copydoc Toolkit::Control::GetHeightForWidth()
+   */
+  float GetHeightForWidth(float width) override;
+
+  /**
+   * @copydoc Toolkit::Control::GetWidthForHeight()
+   */
+  float GetWidthForHeight(float height) override;
+
+  /**
+   * @copydoc Toolkit::Control::OnRelayout()
+   */
+  void OnRelayout(const Vector2& size, RelayoutContainer& container) override;
+
+  /**
+   * @brief Loads a model from file
+   */
+  void LoadModel();
+
+  /**
+   * @brief Scales the model to fit the control or to return to original size.
+   */
+  void ScaleModel();
+
+  /**
+   * @brief Changes model anchor point to set the model at center or returns to the original model pivot.
+   */
+  void FitModelPosition();
+
+  /**
+   * @brief Changes IBL information of the input node.
+   */
+  void SetImageBasedLight(Actor node);
+
+private:
+  std::string                mModelPath;
+  std::string                mResourcePath;
+  Dali::Layer                mModelLayer;
+  Dali::Actor                mModelRoot;
+  std::vector<AnimationData> mAnimations;
+
+  Dali::Texture mSpecularTexture;
+  Dali::Texture mDiffuseTexture;
+  Vector3       mNaturalSize;
+  Vector3       mModelPivot;
+  float         mIblScaleFactor;
+  bool          mFitSize;
+  bool          mFitCenter;
+};
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+inline Dali::Scene3D::Internal::ModelView& GetImpl(Dali::Scene3D::ModelView& obj)
+{
+  DALI_ASSERT_ALWAYS(obj);
+  Dali::RefObject& handle = obj.GetImplementation();
+  return static_cast<Dali::Scene3D::Internal::ModelView&>(handle);
+}
+
+inline const Dali::Scene3D::Internal::ModelView& GetImpl(const Dali::Scene3D::ModelView& obj)
+{
+  DALI_ASSERT_ALWAYS(obj);
+  const Dali::RefObject& handle = obj.GetImplementation();
+  return static_cast<const Dali::Scene3D::Internal::ModelView&>(handle);
+}
+
+} // namespace Scene3D
+
+} // namespace Dali
+
+#endif // DALI_SCENE3D_INTERNAL_MODEL_VIEW_H
diff --git a/dali-scene3d/internal/file.list b/dali-scene3d/internal/file.list
new file mode 100644 (file)
index 0000000..b236f3c
--- /dev/null
@@ -0,0 +1,9 @@
+set(scene3d_internal_dir "${scene3d_dir}/internal")
+
+set(scene3d_src_files ${scene3d_src_files}
+       ${scene3d_internal_dir}/loader/gltf2-asset.cpp
+       ${scene3d_internal_dir}/loader/hash.cpp
+       ${scene3d_internal_dir}/loader/json-reader.cpp
+       ${scene3d_internal_dir}/loader/json-util.cpp
+       ${scene3d_internal_dir}/controls/model-view/model-view-impl.cpp
+)
@@ -64,10 +64,11 @@ uniform vec3 uEmissiveFactor;
 #endif
 
 //// For IBL
+uniform sampler2D sbrdfLUT;
 uniform samplerCube sDiffuseEnvSampler;
 uniform samplerCube sSpecularEnvSampler;
-uniform sampler2D sbrdfLUT;
 uniform float uIblIntensity;
+uniform vec3 uYDirection;
 
 // For Alpha Mode.
 uniform lowp float uOpaque;
@@ -201,8 +202,8 @@ void main()
   mediump vec3 reflection = -normalize(reflect(v, n));
 
   lowp vec3 color = vec3(0.0);
-  lowp vec3 diffuseLight = linear(texture(sDiffuseEnvSampler, n).rgb);
-  lowp vec3 specularLight = linear(texture(sSpecularEnvSampler, reflection).rgb);
+  lowp vec3 diffuseLight = linear(texture(sDiffuseEnvSampler, n * uYDirection).rgb);
+  lowp vec3 specularLight = linear(texture(sSpecularEnvSampler, reflection * uYDirection).rgb);
   // retrieve a scale and bias to F0. See [1], Figure 3
   lowp vec3 brdf = linear(texture(sbrdfLUT, vec2(NdotV, 1.0 - perceptualRoughness)).rgb);
 
similarity index 97%
rename from dali-scene-loader/internal/gltf2-asset.cpp
rename to dali-scene3d/internal/loader/gltf2-asset.cpp
index d0e183a..8297045 100644 (file)
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2021 Samsung Electronics Co., Ltd.
+* Copyright (c) 2022 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,7 @@
 * limitations under the License.
 *
 */
-#include "dali-scene-loader/internal/gltf2-asset.h"
+#include "dali-scene3d/internal/loader/gltf2-asset.h"
 #include <algorithm>
 #include <map>
 #include "dali/public-api/math/matrix.h"
similarity index 97%
rename from dali-scene-loader/internal/gltf2-asset.h
rename to dali-scene3d/internal/loader/gltf2-asset.h
index e074c28..7769751 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef DALI_SCENE_LOADER_GLTF2_ASSET_H_
-#define DALI_SCENE_LOADER_GLTF2_ASSET_H_
+#ifndef DALI_SCENE3D_LOADER_GLTF2_ASSET_H_
+#define DALI_SCENE3D_LOADER_GLTF2_ASSET_H_
 /*
  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
@@ -18,8 +18,8 @@
  */
 
 // INTERNAL INCLUDES
-#include "dali-scene-loader/internal/json-reader.h"
-#include "dali-scene-loader/public-api/index.h"
+#include "dali-scene3d/internal/loader/json-reader.h"
+#include "dali-scene3d/public-api/loader/index.h"
 
 // EXTERNAL INCLUDES
 #include <cstdint>
@@ -31,7 +31,7 @@
 
 namespace gltf2
 {
-using Index = Dali::SceneLoader::Index;
+using Index = Dali::Scene3D::Loader::Index;
 
 template<typename T>
 class Ref
@@ -88,7 +88,7 @@ public:
 
 private:
   std::vector<T>* mVector = nullptr;
-  Index           mIndex  = Dali::SceneLoader::INVALID_INDEX;
+  Index           mIndex  = Dali::Scene3D::Loader::INVALID_INDEX;
 };
 
 struct Asset
@@ -595,4 +595,4 @@ Dali::Quaternion ReadQuaternion(const json_value_s& j);
 
 } // namespace gltf2
 
-#endif //DALI_SCENE_LOADER_GLTF2_ASSET_H_
+#endif //DALI_SCENE3D_LOADER_GLTF2_ASSET_H_
similarity index 90%
rename from dali-scene-loader/internal/hash.cpp
rename to dali-scene3d/internal/loader/hash.cpp
index 43d410f..d1ea70f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
  * limitations under the License.
  *
  */
-#include "dali-scene-loader/internal/hash.h"
+#include "dali-scene3d/internal/loader/hash.h"
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 Hash::Hash(uint64_t initial)
 : mValue(initial)
@@ -91,5 +93,6 @@ uint64_t Hash::Concatenate(uint64_t value)
   return mValue * 31 + value;
 }
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
similarity index 91%
rename from dali-scene-loader/internal/hash.h
rename to dali-scene3d/internal/loader/hash.h
index 22b770e..a5bba8e 100644 (file)
@@ -1,7 +1,7 @@
-#ifndef DALI_SCENE_LOADER_HASH_H_
-#define DALI_SCENE_LOADER_HASH_H_
+#ifndef DALI_SCENE3D_LOADER_HASH_H_
+#define DALI_SCENE3D_LOADER_HASH_H_
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,7 +23,9 @@
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 /**
  * @brief Rudimentary hash generator that follows a builder pattern.
@@ -117,7 +119,8 @@ Hash& Hash::AddObjectBytes(const T& value)
   return *this;
 }
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
 
-#endif // DALI_SCENE_LOADER_HASH_H_
+#endif // DALI_SCENE3D_LOADER_HASH_H_
similarity index 94%
rename from dali-scene-loader/internal/json-reader.cpp
rename to dali-scene3d/internal/loader/json-reader.cpp
index 0353817..ead6269 100644 (file)
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2021 Samsung Electronics Co., Ltd.
+* Copyright (c) 2022 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,7 @@
 * limitations under the License.
 *
 */
-#include "dali-scene-loader/internal/json-reader.h"
+#include "dali-scene3d/internal/loader/json-reader.h"
 #include <algorithm>
 #include <cstring>
 
similarity index 97%
rename from dali-scene-loader/internal/json-reader.h
rename to dali-scene3d/internal/loader/json-reader.h
index 4fb6f7a..c0a8abd 100644 (file)
@@ -1,7 +1,7 @@
-#ifndef DALI_SCENE_LOADER_JSON_READER_H_
-#define DALI_SCENE_LOADER_JSON_READER_H_
+#ifndef DALI_SCENE3D_LOADER_JSON_READER_H_
+#define DALI_SCENE3D_LOADER_JSON_READER_H_
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,7 +18,7 @@
  */
 
 // INTERNAL INCLUDES
-#include "dali-scene-loader/third-party/json.h"
+#include "dali-scene3d/third-party/json.h"
 
 // EXTERNAL INCLUDES
 #include <algorithm>
@@ -447,4 +447,4 @@ void SetObjectReader(const Reader<T>& r)
 
 } // namespace json
 
-#endif //DALI_SCENE_LOADER_JSON_READER_H_
+#endif //DALI_SCENE3D_LOADER_JSON_READER_H_
similarity index 98%
rename from dali-scene-loader/internal/json-util.cpp
rename to dali-scene3d/internal/loader/json-util.cpp
index 765568d..fcb91ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,7 @@
  * limitations under the License.
  *
  */
-#include "dali-scene-loader/internal/json-util.h"
+#include "dali-scene3d/internal/loader/json-util.h"
 
 // EXTERNAL INCLUDES
 #include <array>
@@ -32,7 +32,9 @@ namespace Dali
 {
 using namespace Toolkit;
 
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 namespace
 {
@@ -525,5 +527,6 @@ Property::Value ReadPropertyValue(const Toolkit::TreeNode& tn)
   return propValue;
 }
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
similarity index 90%
rename from dali-scene-loader/internal/json-util.h
rename to dali-scene3d/internal/loader/json-util.h
index 9121bcd..1d2b983 100644 (file)
@@ -1,7 +1,7 @@
-#ifndef DALI_SCENE_LOADER_JSON_UTIL_H_
-#define DALI_SCENE_LOADER_JSON_UTIL_H_
+#ifndef DALI_SCENE3D_LOADER_JSON_UTIL_H_
+#define DALI_SCENE3D_LOADER_JSON_UTIL_H_
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,7 +18,7 @@
  */
 
 // INTERNAL INCLUDES
-#include "dali-scene-loader/public-api/index.h"
+#include "dali-scene3d/public-api/loader/index.h"
 
 // EXTERNAL INCLUDES
 #include "dali-toolkit/devel-api/builder/tree-node.h"
@@ -29,7 +29,9 @@
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 bool ReadBool(const Toolkit::TreeNode* node, bool& num);
 
@@ -88,7 +90,8 @@ Property::Value ReadPropertyValue(const Property::Type& propType, const Toolkit:
  */
 Property::Value ReadPropertyValue(const Toolkit::TreeNode& tn);
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
 
-#endif //DALI_SCENE_LOADER_JSON_UTIL_H_
+#endif //DALI_SCENE3D_LOADER_JSON_UTIL_H_
similarity index 61%
rename from dali-scene-loader/public-api/api.h
rename to dali-scene3d/public-api/api.h
index 45f4a1c..47ee583 100644 (file)
@@ -1,7 +1,7 @@
-#ifndef DALI_SCENE_LOADER_API_H
-#define DALI_SCENE_LOADER_API_H
+#ifndef DALI_SCENE3D_API_H
+#define DALI_SCENE3D_API_H
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
  */
 
 #if __GNUC__ >= 4
-#define DALI_SCENE_LOADER_API __attribute__((visibility("default")))
+#define DALI_SCENE3D_API __attribute__((visibility("default")))
 
 #elif defined(WIN32)
-#ifdef BUILDING_DALI_SCENE_LOADER
-#define DALI_SCENE_LOADER_API __declspec(dllexport)
+#ifdef BUILDING_DALI_SCENE3D
+#define DALI_SCENE3D_API __declspec(dllexport)
 #else
-#define DALI_SCENE_LOADER_API __declspec(dllimport)
-#endif // BUILDING_DALI_SCENE_LOADER
+#define DALI_SCENE3D_API __declspec(dllimport)
+#endif // BUILDING_DALI_SCENE3D
 
 #endif
 
-#endif //DALI_SCENE_LOADER_API_H
+#endif //DALI_SCENE3D_API_H
diff --git a/dali-scene3d/public-api/controls/model-view/model-view.cpp b/dali-scene3d/public-api/controls/model-view/model-view.cpp
new file mode 100644 (file)
index 0000000..b21726e
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2022 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-scene3d/public-api/controls/model-view/model-view.h>
+
+// INTERNAL INCLUDES
+#include <dali-scene3d/internal/controls/model-view/model-view-impl.h>
+
+namespace Dali
+{
+namespace Scene3D
+{
+ModelView::ModelView()
+{
+}
+
+ModelView::ModelView(const ModelView& modelView) = default;
+
+ModelView::ModelView(ModelView&& rhs) = default;
+
+ModelView& ModelView::operator=(const ModelView& modelView) = default;
+
+ModelView& ModelView::operator=(ModelView&& rhs) = default;
+
+ModelView::~ModelView()
+{
+}
+
+ModelView ModelView::New(const std::string& modelPath, const std::string& resourcePath)
+{
+  return Internal::ModelView::New(modelPath, resourcePath);
+}
+
+ModelView ModelView::DownCast(BaseHandle handle)
+{
+  return Control::DownCast<ModelView, Internal::ModelView>(handle);
+}
+
+ModelView::ModelView(Internal::ModelView& implementation)
+: Control(implementation)
+{
+}
+
+ModelView::ModelView(Dali::Internal::CustomActor* internal)
+: Control(internal)
+{
+  VerifyCustomActorPointer<Internal::ModelView>(internal);
+}
+
+const Actor ModelView::GetModelRoot()
+{
+  return GetImpl(*this).GetModelRoot();
+}
+
+void ModelView::FitSize(bool fit)
+{
+  GetImpl(*this).FitSize(fit);
+}
+
+void ModelView::FitCenter(bool fit)
+{
+  GetImpl(*this).FitCenter(fit);
+}
+
+void ModelView::SetImageBasedLightSource(const std::string& diffuse, const std::string& specular, float scaleFactor)
+{
+  GetImpl(*this).SetImageBasedLightSource(diffuse, specular, scaleFactor);
+}
+
+uint32_t ModelView::GetAnimationCount()
+{
+  return GetImpl(*this).GetAnimationCount();
+}
+
+Dali::Animation ModelView::GetAnimation(uint32_t index)
+{
+  return GetImpl(*this).GetAnimation(index);
+}
+
+Dali::Animation ModelView::GetAnimation(const std::string& name)
+{
+  return GetImpl(*this).GetAnimation(name);
+}
+
+} // namespace Scene3D
+
+} // namespace Dali
diff --git a/dali-scene3d/public-api/controls/model-view/model-view.h b/dali-scene3d/public-api/controls/model-view/model-view.h
new file mode 100644 (file)
index 0000000..4c27f1a
--- /dev/null
@@ -0,0 +1,214 @@
+#ifndef DALI_SCENE3D_MODEL_VIEW_H
+#define DALI_SCENE3D_MODEL_VIEW_H
+
+/*
+ * Copyright (c) 2022 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-scene3d/public-api/api.h>
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/control.h>
+#include <dali/public-api/common/dali-common.h>
+
+namespace Dali
+{
+namespace Scene3D
+{
+namespace Internal DALI_INTERNAL
+{
+class ModelView;
+}
+
+/**
+ * @addtogroup dali_toolkit_controls_model_view
+ * @{
+ */
+
+/**
+ * @brief ModelView is a control to show 3D model objects.
+ * ModelView supports to load glTF 2.0 and DLI models for the input format
+ * and also supports Physically Based Rendering with Image Based Lighting.
+ *
+ * The Animations defined in the glTF or DLI models are also loaded and can be retrieved by using GetAnimation() method.
+ * The number of animation is also retrieved by GetAnimationCount() method.
+ *
+ * By default, The loaded model has it's own position and size which are defined in vertex buffer regardless of the Control size.
+ * The model can be resized and repositioned to fit to the ModelView Control with FitSize() and FitCenter() methods.
+ *
+ * @code
+ *
+ * ModelView modelView = ModelView::New(modelUrl);
+ * modelView.SetProperty(Dali::Actor::Property::SIZE, Vector2(width, height));
+ * modelView.SetProperty(Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ * modelView.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ * modelView.SetImageBasedLightSource(diffuseUrl, specularUrl, scaleFactor);
+ * modelView.FitSize(true);
+ * modelView.FitCenter(true);
+ * window.Add(modelView);
+ * uint32_t animationCount = modelView.GetAnimationCount();
+ * Dali::Animation animation = modelView.GetAnimation(0);
+ * animation.Play();
+ *
+ * @endcode
+ */
+class DALI_SCENE3D_API ModelView : public Dali::Toolkit::Control
+{
+public:
+  /**
+   * @brief Create an initialized ModelView.
+   * @param[in] modelPath model file path.(e.g., glTF, and DLI).
+   * @param[in] resourcePath resource file path that includes binary, image etc.
+   * @note If resourcePath is empty, the parent directory path of modelPath is used for resource path.
+   * @return A handle to a newly allocated Dali resource
+   */
+  static ModelView New(const std::string& modelPath, const std::string& resourcePath = std::string());
+
+  /**
+   * @brief Creates an uninitialized ModelView.
+   *
+   * Only derived versions can be instantiated. Calling member
+   * functions with an uninitialized Dali::Object is not allowed.
+   */
+  ModelView();
+
+  /**
+   * @brief Destructor.
+   *
+   * This is non-virtual since derived Handle types must not contain data or virtual methods.
+   */
+  ~ModelView();
+
+  /**
+   * @brief Copy constructor.
+   * @param[in] modelView Handle to an object
+   */
+  ModelView(const ModelView& modelView);
+
+  /**
+   * @brief Move constructor
+   *
+   * @param[in] rhs A reference to the moved handle
+   */
+  ModelView(ModelView&& rhs);
+
+  /**
+   * @brief Assignment operator.
+   * @param[in] modelView Handle to an object
+   * @return reference to this
+   */
+  ModelView& operator=(const ModelView& modelView);
+
+  /**
+   * @brief Move assignment
+   *
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this
+   */
+  ModelView& operator=(ModelView&& rhs);
+
+  /**
+   * @brief Downcasts an Object handle to ModelView.
+   *
+   * If handle points to a ModelView, the downcast produces valid handle.
+   * If not, the returned handle is left uninitialized.
+   *
+   * @param[in] handle Handle to an object
+   * @return Handle to a ModelView or an uninitialized handle
+   */
+  static ModelView DownCast(BaseHandle handle);
+
+  /**
+   * @brief Retrieves model root Actor.
+   * @return Root Actor of the model.
+   */
+  const Actor GetModelRoot();
+
+  /**
+   * @brief Fits the model to the Control size.
+   * @param[in] fit true to fit model size to control.
+   * @note This method makes model fit to the Control size by keeping original model ratio.
+   * It means If model size is (2, 2, 2) and ModelView size is (10, 8), then the model become looks (8, 8, 8).
+   * If ModelView Size x or y is 0, this method don't work anything.
+   * If ModelView Size z is 0, this method considers only x and y values of ModelView Size.
+   */
+  void FitSize(bool fit);
+
+  /**
+   * @brief Moves the model to the center of control.
+   * @param[in] fit true to fit model to center of control.
+   * @note This method doesn't changes size of model.
+   */
+  void FitCenter(bool fit);
+
+  /**
+   * @brief Changes Image Based Light as the input textures.
+   * @param[in] diffuse cube map that can be used as a diffuse IBL source.
+   * @param[in] specular cube map that can be used as a specular IBL source.
+   * @param[in] scaleFactor scale factor that controls light source intensity in [0.0f, 1.0f]. Default value is 1.0f.
+   */
+  void SetImageBasedLightSource(const std::string& diffuse, const std::string& specular, float scaleFactor = 1.0f);
+
+  /**
+   * @brief Gets number of animations those loaded from model file.
+   * @return The number of loaded animations.
+   * @note This method should be called after Model load finished.
+   */
+  uint32_t GetAnimationCount();
+
+  /**
+   * @brief Gets animation at the index.
+   * @param[in] index Index of animation to be retrieved.
+   * @return Animation at the index.
+   * @note This method should be called after Model load finished.
+   */
+  Dali::Animation GetAnimation(uint32_t index);
+
+  /**
+   * @brief Retrieves animation with the given name.
+   * @param[in] name string name of animation to be retrieved.
+   * @return Animation that has the given name.
+   * @note This method should be called after Model load finished.
+   */
+  Dali::Animation GetAnimation(const std::string& name);
+
+public: // Not intended for application developers
+  /// @cond internal
+  /**
+   * @brief Creates a handle using the Toolkit::Internal implementation.
+   *
+   * @param[in] implementation The Control implementation
+   */
+  DALI_INTERNAL ModelView(Internal::ModelView& implementation);
+
+  /**
+   * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
+   *
+   * @param[in] internal A pointer to the internal CustomActor
+   */
+  DALI_INTERNAL ModelView(Dali::Internal::CustomActor* internal);
+  /// @endcond
+};
+
+/**
+ * @}
+ */
+} // namespace Scene3D
+
+} // namespace Dali
+
+#endif // DALI_SCENE3D_MODEL_VIEW_H
diff --git a/dali-scene3d/public-api/file.list b/dali-scene3d/public-api/file.list
new file mode 100644 (file)
index 0000000..23d4702
--- /dev/null
@@ -0,0 +1,34 @@
+set(scene3d_public_api_dir "${scene3d_dir}/public-api")
+
+set(scene3d_src_files ${scene3d_src_files}
+       ${scene3d_public_api_dir}/controls/model-view/model-view.cpp
+       ${scene3d_public_api_dir}/loader/alpha-function-helper.cpp
+       ${scene3d_public_api_dir}/loader/animated-property.cpp
+       ${scene3d_public_api_dir}/loader/animation-definition.cpp
+       ${scene3d_public_api_dir}/loader/blend-shape-details.cpp
+       ${scene3d_public_api_dir}/loader/bvh-loader.cpp
+       ${scene3d_public_api_dir}/loader/camera-parameters.cpp
+       ${scene3d_public_api_dir}/loader/cube-data.cpp
+       ${scene3d_public_api_dir}/loader/cube-loader.cpp
+       ${scene3d_public_api_dir}/loader/cube-map-loader.cpp
+       ${scene3d_public_api_dir}/loader/customization.cpp
+       ${scene3d_public_api_dir}/loader/dli-loader.cpp
+       ${scene3d_public_api_dir}/loader/environment-definition.cpp
+       ${scene3d_public_api_dir}/loader/facial-animation-loader.cpp
+       ${scene3d_public_api_dir}/loader/gltf2-loader.cpp
+       ${scene3d_public_api_dir}/loader/ktx-loader.cpp
+       ${scene3d_public_api_dir}/loader/material-definition.cpp
+       ${scene3d_public_api_dir}/loader/matrix-stack.cpp
+       ${scene3d_public_api_dir}/loader/mesh-definition.cpp
+       ${scene3d_public_api_dir}/loader/node-definition.cpp
+       ${scene3d_public_api_dir}/loader/parse-renderer-state.cpp
+       ${scene3d_public_api_dir}/loader/renderer-state.cpp
+       ${scene3d_public_api_dir}/loader/resource-bundle.cpp
+       ${scene3d_public_api_dir}/loader/scene-definition.cpp
+       ${scene3d_public_api_dir}/loader/shader-definition.cpp
+       ${scene3d_public_api_dir}/loader/shader-definition-factory.cpp
+       ${scene3d_public_api_dir}/loader/skinning-details.cpp
+       ${scene3d_public_api_dir}/loader/string-callback.cpp
+       ${scene3d_public_api_dir}/loader/utils.cpp
+       ${scene3d_public_api_dir}/loader/view-projection.cpp
+)
\ No newline at end of file
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
  * limitations under the License.
  *
  */
-#include "dali-scene-loader/public-api/alpha-function-helper.h"
+#include "dali-scene3d/public-api/loader/alpha-function-helper.h"
 #include <unordered_map>
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 namespace
 {
@@ -65,5 +67,6 @@ void RegisterAlphaFunction(const std::string& name, AlphaFunction alphaFn)
                      "Function with given key already exists.");
 }
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
@@ -1,7 +1,7 @@
-#ifndef DALI_SCENE_LOADER_ALPHA_FUNCTION_HELPER_H_
-#define DALI_SCENE_LOADER_ALPHA_FUNCTION_HELPER_H_
+#ifndef DALI_SCENE3D_LOADER_ALPHA_FUNCTION_HELPER_H_
+#define DALI_SCENE3D_LOADER_ALPHA_FUNCTION_HELPER_H_
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
  *
  */
 
-#include "dali-scene-loader/public-api/api.h"
+#include "dali-scene3d/public-api/api.h"
 
 #include <string>
 #include "dali/public-api/animation/alpha-function.h"
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 /**
  * @return Given a name, provide a AlphaFunction; if the name was not
  *  recognised, get the default one.
  */
-AlphaFunction DALI_SCENE_LOADER_API GetAlphaFunction(const std::string& name, bool* found = nullptr);
+AlphaFunction DALI_SCENE3D_API GetAlphaFunction(const std::string& name, bool* found = nullptr);
 
 /**
  * @brief Registers an alpha function only if one with the same @a name has
  *  not yet been registered. Throws Exception the name isn't unique.
  */
-void DALI_SCENE_LOADER_API RegisterAlphaFunction(const std::string& name, AlphaFunction alphaFn) noexcept(false);
+void DALI_SCENE3D_API RegisterAlphaFunction(const std::string& name, AlphaFunction alphaFn) noexcept(false);
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
 
-#endif //DALI_SCENE_LOADER_ALPHA_FUNCTION_HELPER_H_
+#endif //DALI_SCENE3D_LOADER_ALPHA_FUNCTION_HELPER_H_
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
  * limitations under the License.
  *
  */
-#include "dali-scene-loader/public-api/animated-property.h"
+#include "dali-scene3d/public-api/loader/animated-property.h"
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 void AnimatedProperty::Animate(Animation& anim, GetActor getActor)
 {
@@ -43,5 +45,6 @@ void AnimatedProperty::Animate(Animation& anim, GetActor getActor)
   }
 }
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
@@ -1,7 +1,7 @@
-#ifndef DALI_SCENE_LOADER_ANIMATED_PROPERTY_H
-#define DALI_SCENE_LOADER_ANIMATED_PROPERTY_H
+#ifndef DALI_SCENE3D_LOADER_ANIMATED_PROPERTY_H
+#define DALI_SCENE3D_LOADER_ANIMATED_PROPERTY_H
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,7 +18,7 @@
  */
 
 // INTERNAL INCLUDES
-#include "dali-scene-loader/public-api/api.h"
+#include "dali-scene3d/public-api/api.h"
 
 // EXTERNAL INCLUDES
 #include <functional>
@@ -29,7 +29,9 @@
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 /**
  * @brief Intermediate representation for a property that's given to
@@ -38,7 +40,7 @@ namespace SceneLoader
  *  changing properties (e.g. from the SDK) requires the whole Animation
  *  object to be recreated with all of its properties (incl. modifications).
  */
-struct DALI_SCENE_LOADER_API AnimatedProperty
+struct DALI_SCENE3D_API AnimatedProperty
 {
 public: // METHODS
   /**
@@ -90,7 +92,8 @@ public: // DATA
   TimePeriod    mTimePeriod    = TimePeriod(0.f);
 };
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
 
-#endif //DALI_SCENE_LOADER_ANIMATED_PROPERTY_H
+#endif //DALI_SCENE3D_LOADER_ANIMATED_PROPERTY_H
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
  * limitations under the License.
  *
  */
-#include "dali-scene-loader/public-api/animation-definition.h"
+#include "dali-scene3d/public-api/loader/animation-definition.h"
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 const float AnimationDefinition::DEFAULT_DURATION_SECONDS = 1.f;
 const float AnimationDefinition::MIN_DURATION_SECONDS     = 1e-2f;
@@ -83,5 +85,6 @@ AnimationDefinition& AnimationDefinition::operator=(AnimationDefinition&& other)
   return *this;
 }
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
@@ -1,7 +1,7 @@
-#ifndef DALI_SCENE_LOADER_ANIMATION_DEFINITION_H
-#define DALI_SCENE_LOADER_ANIMATION_DEFINITION_H
+#ifndef DALI_SCENE3D_LOADER_ANIMATION_DEFINITION_H
+#define DALI_SCENE3D_LOADER_ANIMATION_DEFINITION_H
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
  *
  */
 
-#include "dali-scene-loader/public-api/animated-property.h"
-#include "dali-scene-loader/public-api/api.h"
+#include "dali-scene3d/public-api/api.h"
+#include "dali-scene3d/public-api/loader/animated-property.h"
 #include "dali/public-api/common/vector-wrapper.h"
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 /**
  * @brief Animation handle + name + definition of properties.
  */
-class DALI_SCENE_LOADER_API AnimationDefinition
+class DALI_SCENE3D_API AnimationDefinition
 {
 public: // STATIC
   // For Animations created in the SDK.
@@ -81,7 +83,8 @@ struct AnimationGroupDefinition
   std::vector<std::string> mAnimations;
 };
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
 
-#endif //DALI_SCENE_LOADER_ANIMATION_DEFINITION_H
+#endif //DALI_SCENE3D_LOADER_ANIMATION_DEFINITION_H
 */
 
 // FILE HEADER
-#include <dali-scene-loader/public-api/blend-shape-details.h>
+#include <dali-scene3d/public-api/loader/blend-shape-details.h>
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/object/property.h>
 
 // INTERNAL INCLUDES
-#include <dali-scene-loader/public-api/resource-bundle.h>
+#include <dali-scene3d/public-api/loader/resource-bundle.h>
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 const std::string BlendShapes::NUMBER_OF_BLEND_SHAPES("uNumberOfBlendShapes");
 const std::string BlendShapes::UNNORMALIZE_FACTOR("uBlendShapeUnnormalizeFactor");
@@ -83,5 +85,6 @@ void BlendShapes::ConfigureProperties(const std::pair<MeshDefinition, MeshGeomet
   }
 }
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
@@ -1,7 +1,7 @@
-#ifndef DALI_SCENE_LOADER_BLEND_SHAPE_DETAILS_H
-#define DALI_SCENE_LOADER_BLEND_SHAPE_DETAILS_H
+#ifndef DALI_SCENE3D_LOADER_BLEND_SHAPE_DETAILS_H
+#define DALI_SCENE3D_LOADER_BLEND_SHAPE_DETAILS_H
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,7 +18,7 @@
  */
 
 // INTERNAL INCLUDES
-#include "dali-scene-loader/public-api/api.h"
+#include "dali-scene3d/public-api/api.h"
 
 // EXTERNAL INCLUDES
 #include <string>
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 struct MeshDefinition;
 struct MeshGeometry;
 
-struct DALI_SCENE_LOADER_API BlendShapes
+struct DALI_SCENE3D_API BlendShapes
 {
   enum class Version
   {
@@ -71,7 +73,8 @@ struct DALI_SCENE_LOADER_API BlendShapes
   BlendShapes() = delete;
 };
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
 
-#endif // DALI_SCENE_LOADER_BLEND_SHAPE_DETAILS_H
+#endif // DALI_SCENE3D_LOADER_BLEND_SHAPE_DETAILS_H
diff --git a/dali-scene3d/public-api/loader/bvh-loader.cpp b/dali-scene3d/public-api/loader/bvh-loader.cpp
new file mode 100644 (file)
index 0000000..fc6815d
--- /dev/null
@@ -0,0 +1,345 @@
+/*
+ * Copyright (c) 2022 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// FILE HEADER
+#include <dali-scene3d/public-api/loader/bvh-loader.h>
+
+// EXTERNAL INCLUDES
+#include <fstream>
+#include <iostream>
+#include <memory>
+#include <sstream>
+#include <string_view>
+
+namespace Dali
+{
+namespace Scene3D
+{
+namespace Loader
+{
+namespace
+{
+static constexpr std::string_view TOKEN_OFFSET              = "OFFSET";
+static constexpr std::string_view TOKEN_CHANNELS            = "CHANNELS";
+static constexpr std::string_view TOKEN_XPOSITION           = "Xposition";
+static constexpr std::string_view TOKEN_YPOSITION           = "Yposition";
+static constexpr std::string_view TOKEN_ZPOSITION           = "Zposition";
+static constexpr std::string_view TOKEN_XROTATION           = "Xrotation";
+static constexpr std::string_view TOKEN_YROTATION           = "Yrotation";
+static constexpr std::string_view TOKEN_ZROTATION           = "Zrotation";
+static constexpr std::string_view TOKEN_JOINT               = "JOINT";
+static constexpr std::string_view TOKEN_END_SITE            = "End Site";
+static constexpr std::string_view TOKEN_FRAMES              = "Frames";
+static constexpr std::string_view TOKEN_FRAME_TIME          = "Frame Time";
+static constexpr std::string_view TOKEN_HIERARCHY           = "HIERARCHY";
+static constexpr std::string_view TOKEN_ROOT                = "ROOT";
+static constexpr std::string_view TOKEN_MOTION              = "MOTION";
+static constexpr std::string_view PROPERTY_NAME_POSITION    = "position";
+static constexpr std::string_view PROPERTY_NAME_ORIENTATION = "orientation";
+static constexpr std::string_view TOKEN_CLOSING_BRACE       = "}";
+
+enum class Channel
+{
+  XPOSITION = 0,
+  YPOSITION,
+  ZPOSITION,
+  XROTATION,
+  YROTATION,
+  ZROTATION
+};
+
+struct Frame
+{
+  std::vector<float> values;
+};
+
+struct Joint
+{
+  std::string                         name;
+  Vector3                             offset;
+  std::vector<Vector3>                translations;
+  std::vector<Quaternion>             rotations;
+  std::vector<Channel>                channels;
+  std::vector<std::shared_ptr<Joint>> children;
+};
+
+void trim(std::string& s)
+{
+  s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int ch) {
+            return !std::isspace(ch);
+          }));
+  s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) {
+            return !std::isspace(ch);
+          }).base(),
+          s.end());
+}
+
+void ParseHierarchy(std::ifstream& file, std::shared_ptr<Joint>& joint)
+{
+  std::string line;
+  while(std::getline(file, line))
+  {
+    trim(line);
+    std::istringstream stream(line);
+    std::string        token;
+    std::getline(stream, token, ' ');
+
+    if(token == TOKEN_OFFSET.data())
+    {
+      stream >> joint->offset.x >> joint->offset.y >> joint->offset.z;
+    }
+    else if(token == TOKEN_CHANNELS.data())
+    {
+      uint32_t channelCount = 0;
+      std::getline(stream, token, ' ');
+      channelCount = static_cast<uint32_t>(std::atoi(token.c_str()));
+      for(uint32_t i = 0; i < channelCount; ++i)
+      {
+        std::getline(stream, token, ' ');
+        trim(token);
+        if(token == TOKEN_XPOSITION.data())
+        {
+          joint->channels.push_back(Channel::XPOSITION);
+        }
+        else if(token == TOKEN_YPOSITION.data())
+        {
+          joint->channels.push_back(Channel::YPOSITION);
+        }
+        else if(token == TOKEN_ZPOSITION.data())
+        {
+          joint->channels.push_back(Channel::ZPOSITION);
+        }
+        else if(token == TOKEN_XROTATION.data())
+        {
+          joint->channels.push_back(Channel::XROTATION);
+        }
+        else if(token == TOKEN_YROTATION.data())
+        {
+          joint->channels.push_back(Channel::YROTATION);
+        }
+        else if(token == TOKEN_ZROTATION.data())
+        {
+          joint->channels.push_back(Channel::ZROTATION);
+        }
+      }
+    }
+    else if(token == TOKEN_JOINT.data())
+    {
+      std::shared_ptr<Joint> child(new Joint);
+      joint->children.push_back(child);
+      std::getline(stream, token, ' ');
+      child->name = token;
+      ParseHierarchy(file, child);
+    }
+    else if(line == TOKEN_END_SITE.data())
+    {
+      while(std::getline(file, line))
+      {
+        trim(line);
+        if(line == TOKEN_CLOSING_BRACE.data())
+        {
+          break;
+        }
+      }
+    }
+    else if(token == TOKEN_CLOSING_BRACE.data())
+    {
+      break;
+    }
+  }
+}
+
+void MakeList(std::shared_ptr<Joint>& joint, std::vector<std::shared_ptr<Joint>>& jointList)
+{
+  jointList.push_back(joint);
+  for(uint32_t i = 0; i < joint->children.size(); ++i)
+  {
+    MakeList(joint->children[i], jointList);
+  }
+}
+
+void ParseMotion(std::ifstream& file, std::shared_ptr<Joint>& hierarchy, uint32_t& frameCount, float& frameTime)
+{
+  std::vector<std::shared_ptr<Joint>> jointList;
+  MakeList(hierarchy, jointList);
+
+  bool        frameCountLoaded = false;
+  bool        frameTimeLoaded  = false;
+  std::string line;
+  while((!frameCountLoaded || !frameTimeLoaded) && std::getline(file, line))
+  {
+    trim(line);
+    std::istringstream stream(line);
+    std::string        token;
+    std::getline(stream, token, ':');
+    trim(token);
+    if(token == TOKEN_FRAMES.data())
+    {
+      stream >> frameCount;
+      frameCountLoaded = true;
+    }
+    else if(token == TOKEN_FRAME_TIME.data())
+    {
+      stream >> frameTime;
+      frameTimeLoaded = true;
+    }
+  }
+
+  while(getline(file, line))
+  {
+    trim(line);
+    std::istringstream stream(line);
+    for(auto&& joint : jointList)
+    {
+      Vector3    translation;
+      Quaternion rotation[3];
+      for(uint32_t i = 0; i < joint->channels.size(); ++i)
+      {
+        if(joint->channels[i] == Channel::XPOSITION)
+        {
+          stream >> translation.x;
+        }
+        else if(joint->channels[i] == Channel::YPOSITION)
+        {
+          stream >> translation.y;
+        }
+        else if(joint->channels[i] == Channel::ZPOSITION)
+        {
+          stream >> translation.z;
+        }
+        else if(joint->channels[i] == Channel::XROTATION)
+        {
+          float radian;
+          stream >> radian;
+          rotation[0] = Quaternion(Radian(Degree(radian)), Vector3::XAXIS);
+        }
+        else if(joint->channels[i] == Channel::YROTATION)
+        {
+          float radian;
+          stream >> radian;
+          rotation[1] = Quaternion(Radian(Degree(radian)), Vector3::YAXIS);
+        }
+        else if(joint->channels[i] == Channel::ZROTATION)
+        {
+          float radian;
+          stream >> radian;
+          rotation[2] = Quaternion(Radian(Degree(radian)), Vector3::ZAXIS);
+        }
+      }
+      joint->translations.push_back(translation);
+      joint->rotations.push_back(rotation[2] * rotation[0] * rotation[1]);
+    }
+  }
+}
+
+bool ParseBvh(const std::string& path, uint32_t& frameCount, float& frameTime, std::shared_ptr<Joint>& rootJoint)
+{
+  std::ifstream file(path.data());
+  if(!file.is_open())
+  {
+    return false;
+  }
+
+  std::string line;
+  while(getline(file, line))
+  {
+    trim(line);
+    std::istringstream stream(line);
+    std::string        token;
+    std::getline(stream, token, ' ');
+    if(token == TOKEN_HIERARCHY.data())
+    {
+      std::string line;
+      while(getline(file, line))
+      {
+        trim(line);
+        std::istringstream stream(line);
+        std::string        token;
+        std::getline(stream, token, ' ');
+        if(token == TOKEN_ROOT.data())
+        {
+          std::getline(stream, token, ' ');
+          rootJoint->name = token;
+          ParseHierarchy(file, rootJoint);
+          break;
+        }
+      }
+    }
+    if(token == TOKEN_MOTION.data())
+    {
+      ParseMotion(file, rootJoint, frameCount, frameTime);
+    }
+  }
+  return true;
+}
+
+AnimationDefinition GenerateAnimation(const std::string& animationName, std::shared_ptr<Joint>& hierarchy, uint32_t frameCount, float frameTime, const Vector3& scale)
+{
+  AnimationDefinition animationDefinition;
+
+  animationDefinition.mName     = animationName;
+  animationDefinition.mDuration = frameTime * (frameCount - 1);
+  float keyFrameInterval        = (frameCount > 1u) ? 1.0f / static_cast<float>(frameCount - 1u) : Dali::Math::MACHINE_EPSILON_10;
+
+  std::vector<std::shared_ptr<Joint>> jointList;
+  MakeList(hierarchy, jointList);
+
+  if(!jointList.empty())
+  {
+    animationDefinition.mProperties.resize(jointList.size() * 2u); // translation and rotation
+    for(uint32_t i = 0; i < jointList.size(); ++i)
+    {
+      AnimatedProperty& translationProperty = animationDefinition.mProperties[i * 2u];
+      translationProperty.mTimePeriod       = Dali::TimePeriod(animationDefinition.mDuration);
+      translationProperty.mNodeName         = jointList[i]->name;
+      translationProperty.mPropertyName     = PROPERTY_NAME_POSITION.data();
+
+      AnimatedProperty& rotationProperty = animationDefinition.mProperties[i * 2u + 1];
+      rotationProperty.mTimePeriod       = Dali::TimePeriod(animationDefinition.mDuration);
+      rotationProperty.mNodeName         = jointList[i]->name;
+      rotationProperty.mPropertyName     = PROPERTY_NAME_ORIENTATION.data();
+
+      translationProperty.mKeyFrames = Dali::KeyFrames::New();
+      rotationProperty.mKeyFrames    = Dali::KeyFrames::New();
+      for(uint32_t j = 0; j < frameCount; ++j)
+      {
+        translationProperty.mKeyFrames.Add(static_cast<float>(j) * keyFrameInterval, (jointList[i]->translations[j] / scale));
+        rotationProperty.mKeyFrames.Add(static_cast<float>(j) * keyFrameInterval, jointList[i]->rotations[j]);
+      }
+    }
+  }
+
+  return animationDefinition;
+}
+} // namespace
+
+AnimationDefinition LoadBvh(const std::string& path, const std::string& animationName, const Vector3& scale)
+{
+  uint32_t               frameCount = 0;
+  float                  frameTime  = 0.0f;
+  std::shared_ptr<Joint> rootJoint(new Joint);
+  if(!ParseBvh(path, frameCount, frameTime, rootJoint))
+  {
+    AnimationDefinition animationDefinition;
+    return animationDefinition;
+  }
+
+  return GenerateAnimation(animationName, rootJoint, frameCount, frameTime, scale);
+}
+} // namespace Loader
+} // namespace Scene3D
+} // namespace Dali
\ 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
new file mode 100644 (file)
index 0000000..2c3dbc7
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef DALI_SCENE3D_LOADER_BVH_LOADER_H
+#define DALI_SCENE3D_LOADER_BVH_LOADER_H
+
+/*
+ * Copyright (c) 2022 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-scene3d/public-api/loader/animation-definition.h>
+
+namespace Dali
+{
+namespace Scene3D
+{
+namespace Loader
+{
+
+/**
+ * @brief Loads motion capture data from bvh file format.
+ *
+ * @param[in] path The file path.
+ * @param[in] animationName Name of the motion capture animation
+ * @param[in] scale The scale factor to set on the position property manually.
+ * @return AnimationDefinition that includes joint animation information.
+ */
+DALI_SCENE3D_API AnimationDefinition LoadBvh(const std::string& path, const std::string& animationName, const Vector3& scale = Vector3::ONE);
+
+} // namespace Loader
+} // namespace Scene3D
+} // namespace Dali
+
+#endif // DALI_SCENE3D_LOADER_BVH_LOADER_H
\ No newline at end of file
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
  * limitations under the License.
  *
  */
-#include "dali-scene-loader/public-api/camera-parameters.h"
-#include "dali-scene-loader/public-api/utils.h"
+#include "dali-scene3d/public-api/loader/camera-parameters.h"
+#include "dali-scene3d/public-api/loader/utils.h"
 #include "dali/integration-api/debug.h"
 #include "dali/public-api/actors/camera-actor.h"
 #include "dali/public-api/math/quaternion.h"
 
 namespace Dali
 {
-namespace SceneLoader
+namespace Scene3D
+{
+namespace Loader
 {
 namespace
 {
@@ -222,5 +224,6 @@ void CameraParameters::ConfigureCamera(CameraActor& camera) const
   camera.SetProperty(Actor::Property::SCALE, camScale);
 }
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
@@ -1,7 +1,7 @@
-#ifndef DALI_SCENE_LOADER_CAMERA_PARAMETERS_H
-#define DALI_SCENE_LOADER_CAMERA_PARAMETERS_H
+#ifndef DALI_SCENE3D_LOADER_CAMERA_PARAMETERS_H
+#define DALI_SCENE3D_LOADER_CAMERA_PARAMETERS_H
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,8 +18,8 @@
  */
 
 // INTERNAL INCLUDES
-#include "dali-scene-loader/public-api/api.h"
-#include "dali-scene-loader/public-api/view-projection.h"
+#include "dali-scene3d/public-api/api.h"
+#include "dali-scene3d/public-api/loader/view-projection.h"
 
 // EXTERNAL INCLUDES
 #include "dali/public-api/math/matrix.h"
@@ -29,9 +29,11 @@ namespace Dali
 {
 class CameraActor;
 
-namespace SceneLoader
+namespace Scene3D
 {
-struct DALI_SCENE_LOADER_API CameraParameters
+namespace Loader
+{
+struct DALI_SCENE3D_API CameraParameters
 {
   Matrix  matrix           = Matrix::IDENTITY;
   Vector4 orthographicSize = Vector4{-1.f, 1.f, 1.f, -1.f};
@@ -53,13 +55,14 @@ struct DALI_SCENE_LOADER_API CameraParameters
 
   /**
    * @brief Configures the camera in the way that it is supposed to be used with
-   *        scene-loader scenes. This means inverted Y and a rotation of 180 degrees
+   *        scene3d scenes. This means inverted Y and a rotation of 180 degrees
    *        along the Y axis, plus whatever the parameters define.
    */
   void ConfigureCamera(CameraActor& camera) const;
 };
 
-} // namespace SceneLoader
+} // namespace Loader
+} // namespace Scene3D
 } // namespace Dali
 
-#endif // DALI_SCENE_LOADER_CAMERA_PARAMETERS_H
+#endif // DALI_SCENE3D_LOADER_CAMERA_PARAMETERS_H
diff --git a/dali-scene3d/public-api/loader/cube-data.cpp b/dali-scene3d/public-api/loader/cube-data.cpp
new file mode 100644 (file)
index 0000000..2714cc8
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2022 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// FILE HEADER
+#include "dali-scene3d/public-api/loader/cube-data.h"
+
+// EXTERNAL INCLUDES
+#include "dali/public-api/rendering/texture.h"
+
+namespace Dali
+{
+namespace Scene3D
+{
+namespace Loader
+{
+Texture CubeData::CreateTexture() const
+{
+  Texture texture = Texture::New(TextureType::TEXTURE_CUBE, data[0][0].GetPixelFormat(), data[0][0].GetWidth(), data[0][0].GetHeight());
+  for(size_t iSide = 0u, iEndSize = data.size(); iSide < iEndSize; ++iSide)
+  {
+    auto& side = data[iSide];
+    for(size_t iMipLevel = 0u, iEndMipLevel = data[0].size(); iMipLevel < iEndMipLevel; ++iMipLevel)
+    {
+      texture.Upload(side[iMipLevel], CubeMapLayer::POSITIVE_X + iSide, iMipLevel, 0u, 0u, side[iMipLevel].GetWidth(), side[iMipLevel].GetHeight());
+    }
+  }
+
+  // If mipmap is not defined explicitly, use GenerateMipmaps.
+  // TODO: Maybe we can use better way to know it already has mipmap or not.
+  if(data.size() > 0u && data[0].size() == 1u)
+  {
+    texture.GenerateMipmaps();
+  }
+
+  return texture;
+}
+
+} // namespace Loader
+} // namespace Scene3D
+} // namespace Dali