diff options
author | seungho <sbsh.baek@samsung.com> | 2022-07-14 14:26:01 +0900 |
---|---|---|
committer | seungho <sbsh.baek@samsung.com> | 2022-07-18 10:28:34 +0900 |
commit | af599038d0b1ce8d95ae912133e5ce2b249de74c (patch) | |
tree | e39f7027b1698267c6ecf39d37f7633e2db04b80 /examples | |
parent | 5b365286c4254203bbabf6a36095107bdd53213f (diff) | |
download | dali-demo-af599038d0b1ce8d95ae912133e5ce2b249de74c.tar.gz dali-demo-af599038d0b1ce8d95ae912133e5ce2b249de74c.tar.bz2 dali-demo-af599038d0b1ce8d95ae912133e5ce2b249de74c.zip |
Change dali-scene-loader to dali-scene3d
Change-Id: I71bdf5359b9bec2d42b4befadcb2561bd6019dc7
Signed-off-by: seungho <sbsh.baek@samsung.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/scene3d/main.cpp (renamed from examples/scene-loader/main.cpp) | 4 | ||||
-rw-r--r-- | examples/scene3d/scene3d-example.cpp (renamed from examples/scene-loader/scene-loader-example.cpp) | 60 | ||||
-rw-r--r-- | examples/scene3d/scene3d-example.h (renamed from examples/scene-loader/scene-loader-example.h) | 20 | ||||
-rw-r--r-- | examples/scene3d/scene3d-extension.h (renamed from examples/scene-loader/scene-loader-extension.h) | 16 |
4 files changed, 50 insertions, 50 deletions
diff --git a/examples/scene-loader/main.cpp b/examples/scene3d/main.cpp index 630aa26c..bae3cada 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 index 417ba6bc..2c634c88 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 <dali-toolkit/dali-toolkit.h>
#include <dirent.h>
#include <cstring>
#include <string_view>
-#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::vector<Animation } // namespace
-SceneLoaderExample::SceneLoaderExample(Dali::Application& app)
+Scene3DExample::Scene3DExample(Dali::Application& app)
: mApp(app),
- mSceneLoaderExtension(new SceneLoaderExtension())
+ mScene3DExtension(new Scene3DExtension())
{
if(!std::getenv("DALI_APPLICATION_PACKAGE"))
{
@@ -298,13 +298,13 @@ SceneLoaderExample::SceneLoaderExample(Dali::Application& app) }
}
- app.InitSignal().Connect(this, &SceneLoaderExample::OnInit);
- app.TerminateSignal().Connect(this, &SceneLoaderExample::OnTerminate);
+ app.InitSignal().Connect(this, &Scene3DExample::OnInit);
+ app.TerminateSignal().Connect(this, &Scene3DExample::OnTerminate);
}
-SceneLoaderExample::~SceneLoaderExample() = default;
+Scene3DExample::~Scene3DExample() = default;
-void SceneLoaderExample::OnInit(Application& app)
+void Scene3DExample::OnInit(Application& app)
{
// get scenes
auto resPath = Application::GetResourcePath();
@@ -363,9 +363,9 @@ void SceneLoaderExample::OnInit(Application& app) mItemView = items;
mItemView.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
- KeyboardFocusManager::Get().PreFocusChangeSignal().Connect(this, &SceneLoaderExample::OnKeyboardPreFocusChange);
- KeyboardFocusManager::Get().FocusedActorEnterKeySignal().Connect(this, &SceneLoaderExample::OnKeyboardFocusedActorActivated);
- KeyboardFocusManager::Get().FocusChangedSignal().Connect(this, &SceneLoaderExample::OnKeyboardFocusChanged);
+ KeyboardFocusManager::Get().PreFocusChangeSignal().Connect(this, &Scene3DExample::OnKeyboardPreFocusChange);
+ KeyboardFocusManager::Get().FocusedActorEnterKeySignal().Connect(this, &Scene3DExample::OnKeyboardFocusedActorActivated);
+ KeyboardFocusManager::Get().FocusChangedSignal().Connect(this, &Scene3DExample::OnKeyboardFocusChanged);
SetActorCentered(KeyboardFocusManager::Get().GetFocusIndicatorActor());
@@ -376,18 +376,18 @@ void SceneLoaderExample::OnInit(Application& app) mSceneCamera = camera;
// event handling
- window.KeyEventSignal().Connect(this, &SceneLoaderExample::OnKey);
+ window.KeyEventSignal().Connect(this, &Scene3DExample::OnKey);
- tapDetector.DetectedSignal().Connect(this, &SceneLoaderExample::OnTap);
+ tapDetector.DetectedSignal().Connect(this, &Scene3DExample::OnTap);
mTapDetector = tapDetector;
// activate layout
mItemView.ActivateLayout(0, windowSize, 0.f);
- mSceneLoaderExtension->SetSceneLoader(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 index a516dbe8..eda40d55 100644 --- a/examples/scene-loader/scene-loader-example.h +++ b/examples/scene3d/scene3d-example.h @@ -18,10 +18,10 @@ */
#include <memory>
-#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<Dali::SceneLoader::AnimationDefinition> mSceneAnimations;
+ std::vector<Dali::Scene3D::Loader::AnimationDefinition> mSceneAnimations;
Dali::Animation mCurrentAnimation;
- std::unique_ptr<SceneLoaderExtension> mSceneLoaderExtension;
+ std::unique_ptr<Scene3DExtension> mScene3DExtension;
private: // methods
void OnInit(Dali::Application& app);
diff --git a/examples/scene-loader/scene-loader-extension.h b/examples/scene3d/scene3d-extension.h index e937234e..d4cc6ca5 100644 --- a/examples/scene-loader/scene-loader-extension.h +++ b/examples/scene3d/scene3d-extension.h @@ -19,20 +19,20 @@ #include <dali/dali.h>
#include <cstring>
-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;
};
|