From af599038d0b1ce8d95ae912133e5ce2b249de74c Mon Sep 17 00:00:00 2001 From: seungho Date: Thu, 14 Jul 2022 14:26:01 +0900 Subject: [PATCH] Change dali-scene-loader to dali-scene3d Change-Id: I71bdf5359b9bec2d42b4befadcb2561bd6019dc7 Signed-off-by: seungho --- build/tizen/CMakeLists.txt | 26 +++++----- build/tizen/examples/CMakeLists.txt | 8 +-- com.samsung.dali-demo.xml | 4 +- demo/dali-demo.cpp | 6 +-- examples/{scene-loader => scene3d}/main.cpp | 4 +- .../scene3d-example.cpp} | 60 +++++++++++----------- .../scene3d-example.h} | 20 ++++---- .../scene3d-extension.h} | 16 +++--- packaging/com.samsung.dali-demo.spec | 2 +- resources/po/en_GB.po | 4 +- resources/po/en_US.po | 4 +- shared/dali-demo-strings.h | 4 +- 12 files changed, 79 insertions(+), 79 deletions(-) rename examples/{scene-loader => scene3d}/main.cpp (88%) rename examples/{scene-loader/scene-loader-example.cpp => scene3d/scene3d-example.cpp} (85%) rename examples/{scene-loader/scene-loader-example.h => scene3d/scene3d-example.h} (80%) rename examples/{scene-loader/scene-loader-extension.h => scene3d/scene3d-extension.h} (90%) diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index 5f20ac9..5198d34 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -215,19 +215,19 @@ IF( ENABLE_PKG_CONFIGURE ) SET(REQUIRED_CFLAGS "${REQUIRED_CFLAGS} ${flag}") ENDFOREACH(flag) - pkg_check_modules(DALI_SCENE_LOADER dali2-scene-loader) - IF( DALI_SCENE_LOADER_FOUND ) - FOREACH(flag ${DALI_SCENE_LOADER_CFLAGS}) + pkg_check_modules(DALI_SCENE3D dali2-scene3d) + IF( DALI_SCENE3D_FOUND ) + FOREACH(flag ${DALI_SCENE3D_CFLAGS}) SET(REQUIRED_CFLAGS "${REQUIRED_CFLAGS} ${flag}") ENDFOREACH(flag) - SET( REQUIRED_CFLAGS "${REQUIRED_CFLAGS} -DDALI_SCENE_LOADER_AVAILABLE" ) + SET( REQUIRED_CFLAGS "${REQUIRED_CFLAGS} -DDALI_SCENE3D_AVAILABLE" ) - FOREACH(flag ${DALI_SCENE_LOADER_LDFLAGS}) + FOREACH(flag ${DALI_SCENE3D_LDFLAGS}) SET(REQUIRED_PKGS_LDFLAGS "${REQUIRED_PKGS_LDFLAGS} ${flag}") ENDFOREACH(flag) - SET( ENABLE_SCENE_LOADER "ON" ) + SET( ENABLE_SCENE3D "ON" ) ENDIF() # if build as tizen platform, use capi-appfw-app-control @@ -277,7 +277,7 @@ IF( WIN32 OR APPLE ) # WIN32 includes x64 as well according to the cmake doc. FIND_PACKAGE( dali2-adaptor REQUIRED ) FIND_PACKAGE( dali2-toolkit REQUIRED ) - FIND_PACKAGE( dali2-scene-loader ) + FIND_PACKAGE( dali2-scene3d ) # Set up the include dir SET( INCLUDE_DIR $ENV{includedir} ) @@ -326,12 +326,12 @@ IF( WIN32 OR APPLE ) # WIN32 includes x64 as well according to the cmake doc. ) ENDIF() - IF (dali2-scene-loader_FOUND) + IF (dali2-scene3d_FOUND) SET(REQUIRED_LIBS ${REQUIRED_LIBS} - dali2-scene-loader::dali2-scene-loader + dali2-scene3d::dali2-scene3d ) - SET( ENABLE_SCENE_LOADER "ON" ) + SET( ENABLE_SCENE3D "ON" ) ENDIF() ELSEIF( UNIX ) SET( REQUIRED_LIBS @@ -357,8 +357,8 @@ IF( ENABLE_TRACE ) SET(DALI_DEMO_CFLAGS "${DALI_DEMO_CFLAGS} -DTRACE_ENABLED") ENDIF() -IF( ENABLE_SCENE_LOADER ) - SET(DALI_DEMO_CFLAGS "${DALI_DEMO_CFLAGS} -DDALI_SCENE_LOADER_AVAILABLE") +IF( ENABLE_SCENE3D ) + SET(DALI_DEMO_CFLAGS "${DALI_DEMO_CFLAGS} -DDALI_SCENE3D_AVAILABLE") ENDIF() IF( UNIX ) @@ -468,4 +468,4 @@ MESSAGE( " Folder DEMO_LOCALE_DIR : [" ${DEMO_LOCALE_DIR} "]" ) MESSAGE( " Folder DEMO_EXAMPLE_BIN : [" ${DEMO_EXAMPLE_BIN} "]" ) MESSAGE( " Folder DEMO_LANG : [" ${DEMO_LANG} "]" ) MESSAGE( " Current Build Platform : [" ${CURRENT_BUILD_PLATFORM} "]" ) -MESSAGE( " Scene Loader Enabled : [" ${ENABLE_SCENE_LOADER} "]" ) +MESSAGE( " Scene3D Enabled : [" ${ENABLE_SCENE3D} "]" ) diff --git a/build/tizen/examples/CMakeLists.txt b/build/tizen/examples/CMakeLists.txt index 1692226..3edebb6 100644 --- a/build/tizen/examples/CMakeLists.txt +++ b/build/tizen/examples/CMakeLists.txt @@ -13,10 +13,10 @@ MACRO(SUBDIRLIST result curdir) ENDMACRO() SUBDIRLIST(SUBDIRS ${EXAMPLES_SRC_DIR}) -SET(SCENE_LOADER_DIR "scene-loader") -IF (NOT "${ENABLE_SCENE_LOADER}" ) - IF ( ${SCENE_LOADER_DIR} IN_LIST SUBDIRS ) - LIST( REMOVE_ITEM SUBDIRS ${SCENE_LOADER_DIR} ) +SET(SCENE3D_DIR "scene3d") +IF (NOT "${ENABLE_SCENE3D}" ) + IF ( ${SCENE3D_DIR} IN_LIST SUBDIRS ) + LIST( REMOVE_ITEM SUBDIRS ${SCENE3D_DIR} ) ENDIF() ENDIF() diff --git a/com.samsung.dali-demo.xml b/com.samsung.dali-demo.xml index 40fb016..fde96a5 100644 --- a/com.samsung.dali-demo.xml +++ b/com.samsung.dali-demo.xml @@ -277,8 +277,8 @@ - - + + diff --git a/demo/dali-demo.cpp b/demo/dali-demo.cpp index b8fea35..0dd09b9 100644 --- a/demo/dali-demo.cpp +++ b/demo/dali-demo.cpp @@ -59,9 +59,9 @@ int DALI_EXPORT_API main(int argc, char** argv) demo.AddExample(Example("rendering-skybox.example", DALI_DEMO_STR_TITLE_SKYBOX)); demo.AddExample(Example("rendering-basic-pbr.example", DALI_DEMO_STR_TITLE_PBR)); demo.AddExample(Example("scene3d-view.example", DALI_DEMO_STR_TITLE_SCENE3D_VIEW)); -#ifdef DALI_SCENE_LOADER_AVAILABLE - demo.AddExample(Example("scene-loader.example", DALI_DEMO_STR_TITLE_SCENE_LOADER)); -#endif //DALI_SCENE_LOADER_AVAILABLE +#ifdef DALI_SCENE3D_AVAILABLE + demo.AddExample(Example("scene3d.example", DALI_DEMO_STR_TITLE_SCENE3D)); +#endif //DALI_SCENE3D_AVAILABLE demo.AddExample(Example("shadows-and-lights.example", DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS)); demo.AddExample(Example("sparkle.example", DALI_DEMO_STR_TITLE_SPARKLE)); demo.AddExample(Example("waves.example", DALI_DEMO_STR_TITLE_WAVES)); diff --git a/examples/scene-loader/main.cpp b/examples/scene3d/main.cpp similarity index 88% rename from examples/scene-loader/main.cpp rename to examples/scene3d/main.cpp index 630aa26..bae3cad 100644 --- a/examples/scene-loader/main.cpp +++ b/examples/scene3d/main.cpp @@ -14,7 +14,7 @@ * limitations under the License. * */ -#include "scene-loader-example.h" +#include "scene3d-example.h" #include "dali/dali.h" @@ -23,7 +23,7 @@ using namespace Dali; int DALI_EXPORT_API main(int argc, char** argv) { auto app = Application::New(&argc, &argv, DEMO_THEME_PATH); - SceneLoaderExample sceneLoader(app); + Scene3DExample scene3D(app); app.MainLoop(); return 0; } diff --git a/examples/scene-loader/scene-loader-example.cpp b/examples/scene3d/scene3d-example.cpp similarity index 85% rename from examples/scene-loader/scene-loader-example.cpp rename to examples/scene3d/scene3d-example.cpp index 417ba6b..2c634c8 100644 --- a/examples/scene-loader/scene-loader-example.cpp +++ b/examples/scene3d/scene3d-example.cpp @@ -14,16 +14,16 @@ * limitations under the License. * */ -#include "scene-loader-example.h" +#include "scene3d-example.h" #include #include #include #include -#include "dali-scene-loader/public-api/dli-loader.h" -#include "dali-scene-loader/public-api/gltf2-loader.h" -#include "dali-scene-loader/public-api/light-parameters.h" -#include "dali-scene-loader/public-api/load-result.h" -#include "dali-scene-loader/public-api/shader-definition-factory.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/shader-definition-factory.h" #include "dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout.h" #include "dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h" #include "dali-toolkit/public-api/controls/text-controls/text-label.h" @@ -33,11 +33,11 @@ #include "dali/public-api/events/key-event.h" #include "dali/public-api/object/property-array.h" #include "dali/public-api/render-tasks/render-task-list.h" -#include "scene-loader-extension.h" +#include "scene3d-extension.h" using namespace Dali; using namespace Dali::Toolkit; -using namespace Dali::SceneLoader; +using namespace Dali::Scene3D::Loader; namespace { @@ -282,9 +282,9 @@ Actor LoadScene(std::string sceneName, CameraActor camera, std::vectorSetSceneLoader(this); + mScene3DExtension->SetSceneLoader(this); } -Actor SceneLoaderExample::OnKeyboardPreFocusChange(Actor current, Actor proposed, Control::KeyboardFocus::Direction direction) +Actor Scene3DExample::OnKeyboardPreFocusChange(Actor current, Actor proposed, Control::KeyboardFocus::Direction direction) { if(!current && !proposed) { @@ -397,7 +397,7 @@ Actor SceneLoaderExample::OnKeyboardPreFocusChange(Actor current, Actor proposed return proposed; } -void SceneLoaderExample::OnKeyboardFocusedActorActivated(Actor activatedActor) +void Scene3DExample::OnKeyboardFocusedActorActivated(Actor activatedActor) { if(activatedActor) { @@ -405,7 +405,7 @@ void SceneLoaderExample::OnKeyboardFocusedActorActivated(Actor activatedActor) } } -void SceneLoaderExample::OnKeyboardFocusChanged(Actor originalFocusedActor, Actor currentFocusedActor) +void Scene3DExample::OnKeyboardFocusChanged(Actor originalFocusedActor, Actor currentFocusedActor) { if(currentFocusedActor) { @@ -414,7 +414,7 @@ void SceneLoaderExample::OnKeyboardFocusChanged(Actor originalFocusedActor, Acto } } -void SceneLoaderExample::OnTerminate(Application& app) +void Scene3DExample::OnTerminate(Application& app) { mTapDetector.Reset(); mPanDetector.Reset(); @@ -430,7 +430,7 @@ void SceneLoaderExample::OnTerminate(Application& app) mItemFactory.reset(); } -void SceneLoaderExample::OnKey(const KeyEvent& e) +void Scene3DExample::OnKey(const KeyEvent& e) { if(e.GetState() == KeyEvent::UP) { @@ -455,12 +455,12 @@ void SceneLoaderExample::OnKey(const KeyEvent& e) } else { - mSceneLoaderExtension->OnKey(e); + mScene3DExtension->OnKey(e); } } } -void SceneLoaderExample::OnPan(Actor actor, const PanGesture& pan) +void Scene3DExample::OnPan(Actor actor, const PanGesture& pan) { auto windowSize = mApp.GetWindow().GetSize(); Vector2 size{float(windowSize.GetWidth()), float(windowSize.GetHeight())}; @@ -476,7 +476,7 @@ void SceneLoaderExample::OnPan(Actor actor, const PanGesture& pan) mScene.SetProperty(Actor::Property::ORIENTATION, q * q0); } -void SceneLoaderExample::OnTap(Dali::Actor actor, const Dali::TapGesture& tap) +void Scene3DExample::OnTap(Dali::Actor actor, const Dali::TapGesture& tap) { mActivatedActor = actor; @@ -499,7 +499,7 @@ void SceneLoaderExample::OnTap(Dali::Actor actor, const Dali::TapGesture& tap) mSceneRender = sceneRender; mPanDetector = PanGestureDetector::New(); - mPanDetector.DetectedSignal().Connect(this, &SceneLoaderExample::OnPan); + mPanDetector.DetectedSignal().Connect(this, &Scene3DExample::OnPan); mPanDetector.Attach(mNavigationView); } catch(const DaliException& e) @@ -509,5 +509,5 @@ void SceneLoaderExample::OnTap(Dali::Actor actor, const Dali::TapGesture& tap) mNavigationView.Push(mScene); - mSceneLoaderExtension->ConnectTouchSignals(); + mScene3DExtension->ConnectTouchSignals(); } diff --git a/examples/scene-loader/scene-loader-example.h b/examples/scene3d/scene3d-example.h similarity index 80% rename from examples/scene-loader/scene-loader-example.h rename to examples/scene3d/scene3d-example.h index a516dbe..eda40d5 100644 --- a/examples/scene-loader/scene-loader-example.h +++ b/examples/scene3d/scene3d-example.h @@ -18,10 +18,10 @@ */ #include -#include "dali-scene-loader/public-api/animation-definition.h" -#include "dali-scene-loader/public-api/camera-parameters.h" -#include "dali-scene-loader/public-api/node-definition.h" -#include "dali-scene-loader/public-api/scene-definition.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/node-definition.h" +#include "dali-scene3d/public-api/loader/scene-definition.h" #include "dali-toolkit/devel-api/controls/navigation-view/navigation-view.h" #include "dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h" #include "dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h" @@ -33,13 +33,13 @@ #include "dali/public-api/render-tasks/render-task.h" #include "dali/public-api/signals/connection-tracker.h" -class SceneLoaderExtension; +class Scene3DExtension; -class SceneLoaderExample : public Dali::ConnectionTracker +class Scene3DExample : public Dali::ConnectionTracker { public: - SceneLoaderExample(Dali::Application& app); - ~SceneLoaderExample(); + Scene3DExample(Dali::Application& app); + ~Scene3DExample(); private: // data Dali::Application& mApp; @@ -65,10 +65,10 @@ private: // data public: Dali::Actor mScene; - std::vector mSceneAnimations; + std::vector mSceneAnimations; Dali::Animation mCurrentAnimation; - std::unique_ptr mSceneLoaderExtension; + std::unique_ptr mScene3DExtension; private: // methods void OnInit(Dali::Application& app); diff --git a/examples/scene-loader/scene-loader-extension.h b/examples/scene3d/scene3d-extension.h similarity index 90% rename from examples/scene-loader/scene-loader-extension.h rename to examples/scene3d/scene3d-extension.h index e937234..d4cc6ca 100644 --- a/examples/scene-loader/scene-loader-extension.h +++ b/examples/scene3d/scene3d-extension.h @@ -19,20 +19,20 @@ #include #include -class SceneLoaderExtension : public Dali::ConnectionTracker +class Scene3DExtension : public Dali::ConnectionTracker { public: - SceneLoaderExtension() + Scene3DExtension() : mSceneLoader(nullptr), mCurrentAnimationIndex(ANIMATION_IDLE) { } - ~SceneLoaderExtension() = default; // Nothing to do in destructor + ~Scene3DExtension() = default; // Nothing to do in destructor - void SetSceneLoader(SceneLoaderExample* sceneLoader) + void SetSceneLoader(Scene3DExample* scene3D) { - mSceneLoader = sceneLoader; + mSceneLoader = scene3D; } void ConnectTouchSignals() @@ -102,7 +102,7 @@ private: { mCurrentAnimationIndex = animationIndex; mSceneLoader->mCurrentAnimation = mSceneLoader->mSceneAnimations[animationIndex].ReAnimate(getActor); - mSceneLoader->mCurrentAnimation.FinishedSignal().Connect(this, &SceneLoaderExtension::OnAnimationFinished); + mSceneLoader->mCurrentAnimation.FinishedSignal().Connect(this, &Scene3DExtension::OnAnimationFinished); mSceneLoader->mCurrentAnimation.Play(); } } @@ -117,7 +117,7 @@ private: auto actor = mSceneLoader->mScene.FindChildByName(actorName); if(actor) { - actor.TouchedSignal().Connect(this, &SceneLoaderExtension::OnTouch); + actor.TouchedSignal().Connect(this, &Scene3DExtension::OnTouch); } } } @@ -216,6 +216,6 @@ private: inline static const std::string ICON_JUMPING_JACK = "JumpingJack"; inline static const std::string ICON_LUNGE = "Lunge"; - SceneLoaderExample* mSceneLoader; + Scene3DExample* mSceneLoader; unsigned int mCurrentAnimationIndex; }; diff --git a/packaging/com.samsung.dali-demo.spec b/packaging/com.samsung.dali-demo.spec index 4a18bf6..d4f10f2 100755 --- a/packaging/com.samsung.dali-demo.spec +++ b/packaging/com.samsung.dali-demo.spec @@ -22,7 +22,7 @@ BuildRequires: gettext-tools BuildRequires: pkgconfig(dali2-core) BuildRequires: pkgconfig(dali2-adaptor) BuildRequires: pkgconfig(dali2-toolkit) -BuildRequires: pkgconfig(dali2-scene-loader) +BuildRequires: pkgconfig(dali2-scene3d) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(gles20) BuildRequires: pkgconfig(glesv2) diff --git a/resources/po/en_GB.po b/resources/po/en_GB.po index 52ea76b..81f75ce 100755 --- a/resources/po/en_GB.po +++ b/resources/po/en_GB.po @@ -205,8 +205,8 @@ msgstr "Reflection" msgid "DALI_DEMO_STR_TITLE_RENDERER_STENCIL" msgstr "Renderer Stencil" -msgid "DALI_DEMO_STR_TITLE_SCENE_LOADER" -msgstr "Scene Loader" +msgid "DALI_DEMO_STR_TITLE_SCENE3D" +msgstr "Scene3D" msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI" msgstr "Script-based UI" diff --git a/resources/po/en_US.po b/resources/po/en_US.po index 9545053..0e4341e 100755 --- a/resources/po/en_US.po +++ b/resources/po/en_US.po @@ -211,8 +211,8 @@ msgstr "Refraction" msgid "DALI_DEMO_STR_TITLE_RENDERER_STENCIL" msgstr "Renderer Stencil" -msgid "DALI_DEMO_STR_TITLE_SCENE_LOADER" -msgstr "Scene Loader" +msgid "DALI_DEMO_STR_TITLE_SCENE3D" +msgstr "Scene3D" msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI" msgstr "Script-based UI" diff --git a/shared/dali-demo-strings.h b/shared/dali-demo-strings.h index d84effd..8639183 100644 --- a/shared/dali-demo-strings.h +++ b/shared/dali-demo-strings.h @@ -116,7 +116,7 @@ extern "C" #define DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING") #define DALI_DEMO_STR_TITLE_RENDERER_STENCIL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERER_STENCIL") #define DALI_DEMO_STR_TITLE_SCENE3D_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCENE3D_VIEW") -#define DALI_DEMO_STR_TITLE_SCENE_LOADER dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCENE_LOADER") +#define DALI_DEMO_STR_TITLE_SCENE3D dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCENE3D") #define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI") #define DALI_DEMO_STR_TITLE_SCROLL_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCROLL_VIEW") #define DALI_DEMO_STR_TITLE_SIMPLE_SCROLL_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SIMPLE_SCROLL_VIEW") @@ -228,7 +228,7 @@ extern "C" #define DALI_DEMO_STR_TITLE_RENDERING_RADIAL_PROGRESS "Radial Progress" #define DALI_DEMO_STR_TITLE_RENDERER_STENCIL "Renderer Stencils" #define DALI_DEMO_STR_TITLE_SCENE3D_VIEW "Scene3D View glTF" -#define DALI_DEMO_STR_TITLE_SCENE_LOADER "Scene Loader" +#define DALI_DEMO_STR_TITLE_SCENE3D "Scene3D" #define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI "Script Based UI" #define DALI_DEMO_STR_TITLE_SCROLL_VIEW "Scroll View" #define DALI_DEMO_STR_TITLE_SIMPLE_SCROLL_VIEW "Simple Scroll View" -- 2.7.4