Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev-sge
Browse files Browse the repository at this point in the history
  • Loading branch information
sguionni committed Mar 29, 2024
2 parents 07b5f5e + 5ef3b96 commit 2f3dc54
Show file tree
Hide file tree
Showing 28 changed files with 216 additions and 273 deletions.
1 change: 1 addition & 0 deletions lib/ui/include/ui/core/animation/animation_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace VTX::UI::Core::Animation

void play();
void stop();
bool isPlaying() const;

void update( const float p_deltaTime );

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#ifndef __VTX_UI_QT_CONTROLLER_FREEFLY__
#define __VTX_UI_QT_CONTROLLER_FREEFLY__
#ifndef __VTX_UI_INTERNAL_CONTROLLER_CAMERA_FREEFLY__
#define __VTX_UI_INTERNAL_CONTROLLER_CAMERA_FREEFLY__

#include "ui/core/input/key_mapping.hpp"
#include "ui/internal/all_settings.hpp"
#include "ui/qt/controller/base_camera_controller.hpp"
#include "ui/qt/controller/controller_manager.hpp"
#include <util/hashing.hpp>

namespace VTX::UI::QT::Controller
namespace VTX::UI::Internal::Controller::Camera
{
using namespace VTX::UI::QT;
using namespace VTX::UI::QT::Controller;

class Freefly : public BaseCameraController
{
public:
Expand Down Expand Up @@ -52,7 +55,7 @@ namespace VTX::UI::QT::Controller
void _updateInputs( const float & p_deltaTime ) override;

private:
Core::Input::KeyMapping _mapping;
UI::Core::Input::KeyMapping _mapping;
};
} // namespace VTX::UI::QT::Controller
} // namespace VTX::UI::Internal::Controller::Camera
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef __VTX_UI_QT_CONTROLLER_TRACKBALL__
#define __VTX_UI_QT_CONTROLLER_TRACKBALL__
#ifndef __VTX_UI_INTERNAL_CONTROLLER_CAMERA_TRACKBALL__
#define __VTX_UI_INTERNAL_CONTROLLER_CAMERA_TRACKBALL__

#include "ui/core/input/key_mapping.hpp"
#include "ui/internal/all_settings.hpp"
Expand All @@ -9,8 +9,11 @@
#include <util/hashing.hpp>
#include <util/types.hpp>

namespace VTX::UI::QT::Controller
namespace VTX::UI::Internal::Controller::Camera
{
using namespace VTX::UI::QT;
using namespace VTX::UI::QT::Controller;

class Trackball : public BaseCameraController
{
public:
Expand Down Expand Up @@ -68,5 +71,5 @@ namespace VTX::UI::QT::Controller

bool _needUpdate = false;
};
} // namespace VTX::UI::QT::Controller
} // namespace VTX::UI::Internal::Controller::Camera
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// TODO Move this controller in dedicated tool

// #ifndef __VTX_UI_QT_CONTROLLER_MEASUREMENT_PICKER__
// #define __VTX_UI_QT_CONTROLLER_MEASUREMENT_PICKER__
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#ifndef __VTX_UI_QT_CONTROLLER_SELECTION_PICKER__
#define __VTX_UI_QT_CONTROLLER_SELECTION_PICKER__
#ifndef __VTX_UI_INTERNAL_CONTROLLER_PICKER_SELECTION_PICKER__
#define __VTX_UI_INTERNAL_CONTROLLER_PICKER_SELECTION_PICKER__

#include "ui/qt/controller/base_picker_controller.hpp"
#include "ui/qt/controller/controller_manager.hpp"
#include <app/application/selection/picking_info.hpp>
#include <util/hashing.hpp>
#include <util/types.hpp>

namespace VTX::UI::QT::Controller
namespace VTX::UI::Internal::Controller::Picker
{
class SelectionPicker : public BasePickerController
using namespace VTX::UI::QT;
using namespace VTX::UI::QT::Controller;

class Selection : public BasePickerController
{
public:
using PickingInfo = App::Application::Selection::PickingInfo;
Expand All @@ -18,17 +21,17 @@ namespace VTX::UI::QT::Controller
inline static const VTX::Util::Hashing::Hash HASHED_COLLECTION_ID = VTX::Util::Hashing::hash( COLLECTION_ID );

private:
inline static const ControllerCollection::Registration<SelectionPicker> _reg { COLLECTION_ID };
inline static const ControllerCollection::Registration<Selection> _reg { COLLECTION_ID };

public:
SelectionPicker() = default;
SelectionPicker( const SelectionPicker & p_source ) = default;
~SelectionPicker() = default;
Selection() = default;
Selection( const Selection & p_source ) = default;
~Selection() = default;

void init() override;

inline VTX::Util::Hashing::Hash getHashedCollectionID() const override { return HASHED_COLLECTION_ID; };
std::unique_ptr<BaseController> clone() const { return std::make_unique<SelectionPicker>( *this ); };
std::unique_ptr<BaseController> clone() const { return std::make_unique<Selection>( *this ); };

protected:
void _onMouseLeftClick( const Vec2i & p_mousePos );
Expand All @@ -41,6 +44,6 @@ namespace VTX::UI::QT::Controller
private:
PickingInfo _lastPickingInfo = PickingInfo();
};
} // namespace VTX::UI::QT::Controller
} // namespace VTX::UI::Internal::Controller::Picker

#endif
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
#ifndef __VTX_UI_QT_CONTROLLER_DEBUG_SHORTCUT__
#define __VTX_UI_QT_CONTROLLER_DEBUG_SHORTCUT__
#ifndef __VTX_UI_INTERNAL_CONTROLLER_DEBUG_SHORTCUT__
#define __VTX_UI_INTERNAL_CONTROLLER_DEBUG_SHORTCUT__

#include "ui/core/input/keys.hpp"
#include "ui/qt/controller/base_shortcut_controller.hpp"
#include "ui/qt/controller/controller_manager.hpp"
#include <memory>
#include <util/hashing.hpp>

namespace VTX::UI::QT::Controller
namespace VTX::UI::Internal::Controller::Shortcut
{
class DebugShortcut final : public BaseShortcutController
using namespace VTX::UI::QT;
using namespace VTX::UI::QT::Controller;

class Debug final : public BaseShortcutController
{
public:
inline static const App::Core::CollectionKey COLLECTION_ID = "CONTROLLER_SHORTCUT_DEBUG";
inline static const VTX::Util::Hashing::Hash HASHED_COLLECTION_ID = VTX::Util::Hashing::hash( COLLECTION_ID );

private:
inline static const ControllerCollection::Registration<DebugShortcut> _reg { COLLECTION_ID };
inline static const ControllerCollection::Registration<Debug> _reg { COLLECTION_ID };

public:
DebugShortcut() = default;
DebugShortcut( const DebugShortcut & p_source ) = default;
~DebugShortcut() = default;
Debug() = default;
Debug( const Debug & p_source ) = default;
~Debug() = default;

void init() override;

inline VTX::Util::Hashing::Hash getHashedCollectionID() const override { return HASHED_COLLECTION_ID; };
std::unique_ptr<BaseController> clone() const { return std::make_unique<DebugShortcut>( *this ); };
std::unique_ptr<BaseController> clone() const { return std::make_unique<Debug>( *this ); };
};
} // namespace VTX::UI::QT::Controller
} // namespace VTX::UI::Internal::Controller::Shortcut
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef __VTX_UI_QT_CONTROLLER_GLOBAL_SHORTCUT__
#define __VTX_UI_QT_CONTROLLER_GLOBAL_SHORTCUT__
#ifndef __VTX_UI_INTERNAL_CONTROLLER_GLOBAL_SHORTCUT__
#define __VTX_UI_INTERNAL_CONTROLLER_GLOBAL_SHORTCUT__

#include "ui/core/input/keys.hpp"
#include "ui/qt/controller/base_controller.hpp"
Expand All @@ -8,26 +8,29 @@
#include <memory>
#include <util/hashing.hpp>

namespace VTX::UI::QT::Controller
namespace VTX::UI::Internal::Controller::Shortcut
{
class GlobalShortcut final : public BaseShortcutController
using namespace VTX::UI::QT;
using namespace VTX::UI::QT::Controller;

class Global final : public BaseShortcutController
{
public:
inline static const App::Core::CollectionKey COLLECTION_ID = "CONTROLLER_SHORTCUT_GLOBAL";
inline static const VTX::Util::Hashing::Hash HASHED_COLLECTION_ID = VTX::Util::Hashing::hash( COLLECTION_ID );

private:
inline static const ControllerCollection::Registration<GlobalShortcut> _reg { COLLECTION_ID };
inline static const ControllerCollection::Registration<Global> _reg { COLLECTION_ID };

public:
GlobalShortcut() = default;
GlobalShortcut( const GlobalShortcut & p_source ) = default;
~GlobalShortcut() = default;
Global() = default;
Global( const Global & p_source ) = default;
~Global() = default;

void init() override;

inline VTX::Util::Hashing::Hash getHashedCollectionID() const override { return HASHED_COLLECTION_ID; };
std::unique_ptr<BaseController> clone() const { return std::make_unique<GlobalShortcut>( *this ); };
std::unique_ptr<BaseController> clone() const { return std::make_unique<Global>( *this ); };
};
} // namespace VTX::UI::QT::Controller
} // namespace VTX::UI::Internal::Controller::Shortcut
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef __VTX_UI_QT_CONTROLLER_VISUALIZATION_SHORTCUT__
#define __VTX_UI_QT_CONTROLLER_VISUALIZATION_SHORTCUT__
#ifndef __VTX_UI_INTERNAL_CONTROLLER_VISUALIZATION_SHORTCUT__
#define __VTX_UI_INTERNAL_CONTROLLER_VISUALIZATION_SHORTCUT__

#include "ui/core/input/keys.hpp"
#include "ui/qt/controller/base_controller.hpp"
Expand All @@ -8,30 +8,33 @@
#include <memory>
#include <util/hashing.hpp>

namespace VTX::UI::QT::Controller
namespace VTX::UI::Internal::Controller::Shortcut
{
class VisualizationShortcut final : public BaseShortcutController
using namespace VTX::UI::QT;
using namespace VTX::UI::QT::Controller;

class Visualization final : public BaseShortcutController
{
public:
inline static const App::Core::CollectionKey COLLECTION_ID = "CONTROLLER_SHORTCUT_VISUALIZATION";
inline static const VTX::Util::Hashing::Hash HASHED_COLLECTION_ID = VTX::Util::Hashing::hash( COLLECTION_ID );

private:
inline static const ControllerCollection::Registration<VisualizationShortcut> _reg { COLLECTION_ID };
inline static const ControllerCollection::Registration<Visualization> _reg { COLLECTION_ID };

public:
VisualizationShortcut() = default;
VisualizationShortcut( const VisualizationShortcut & p_source ) = default;
~VisualizationShortcut() = default;
Visualization() = default;
Visualization( const Visualization & p_source ) = default;
~Visualization() = default;

void init() override;

inline VTX::Util::Hashing::Hash getHashedCollectionID() const override { return HASHED_COLLECTION_ID; };
std::unique_ptr<BaseController> clone() const { return std::make_unique<VisualizationShortcut>( *this ); };
std::unique_ptr<BaseController> clone() const { return std::make_unique<Visualization>( *this ); };

private:
void _callOrientOnScene() const;
void _callOrientOnSelection() const;
};
} // namespace VTX::UI::QT::Controller
} // namespace VTX::UI::Internal::Controller::Shortcut
#endif
11 changes: 11 additions & 0 deletions lib/ui/include/ui/internal/init_visualization_mode.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef __VTX_UI_INTERNAL_INIT_VISUALIZATION_MODE__
#define __VTX_UI_INTERNAL_INIT_VISUALIZATION_MODE__

#include "ui/qt/mode/visualization.hpp"

namespace VTX::UI::Internal
{
void init( QT::Mode::Visualization & p_visualization );
} // namespace VTX::UI::Internal

#endif
1 change: 1 addition & 0 deletions lib/ui/include/ui/qt/controller/_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace VTX::UI::QT::Controller
class BaseController;
class BaseCameraController;
class BasePickerController;
class BaseShortcutController;

class ControllerManager;
} // namespace VTX::UI::QT::Controller
34 changes: 0 additions & 34 deletions lib/ui/include/ui/qt/controller/camera_animation_controller.hpp

This file was deleted.

58 changes: 0 additions & 58 deletions lib/ui/include/ui/qt/controller/camera_animator.hpp

This file was deleted.

1 change: 0 additions & 1 deletion lib/ui/include/ui/qt/mode/visualization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ namespace VTX::UI::QT::Mode
void setCameraController( const App::Core::CollectionKey & p_controllerKey );
void setPickerController( const Util::Hashing::Hash & p_controllerHash );
void setPickerController( const App::Core::CollectionKey & p_controllerKey );
void resetCameraController();

const std::set<std::unique_ptr<Controller::BaseController>> & getCameraControllers() const
{
Expand Down
Loading

0 comments on commit 2f3dc54

Please sign in to comment.