Skip to content

Commit

Permalink
ecs: merge registry and registry_manager
Browse files Browse the repository at this point in the history
  • Loading branch information
sguionni committed Oct 10, 2024
1 parent b798ecb commit c392443
Show file tree
Hide file tree
Showing 24 changed files with 4 additions and 164 deletions.
138 changes: 0 additions & 138 deletions lib/app/include/app/application/ecs/registry_manager.hpp

This file was deleted.

8 changes: 3 additions & 5 deletions lib/app/include/app/application/system/ecs_system.hpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
#ifndef __VTX_APP_APPLICATION_SYSTEM_ECS_SYSTEM__
#define __VTX_APP_APPLICATION_SYSTEM_ECS_SYSTEM__

#include "app/application/ecs/registry_manager.hpp"
#include "app/core/ecs/registry.hpp"
#include <util/singleton.hpp>

namespace VTX::App::Application::System
{
class ECSSystem
{
public:
Application::ECS::RegistryManager registryManager;
Core::ECS::Registry registry;
};
} // namespace VTX::App::Application::System

namespace VTX::App
{
inline Application::System::ECSSystem & ECS() { return Util::Singleton<Application::System::ECSSystem>::get(); }

// MAIN_REGISTRY give access to the registry to create / get / delete entities and components
inline Application::ECS::RegistryManager & MAIN_REGISTRY() { return ECS().registryManager; }
inline Core::ECS::Registry & MAIN_REGISTRY() { return ECS().registry; }
} // namespace VTX::App

#endif
1 change: 1 addition & 0 deletions lib/app/include/app/core/ecs/registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace VTX::App::Core::ECS
{
E entity = E( std::forward<Args>( p_args )... );
entity._setEntityID( _enttRegistry.create() );
entity.setup();
return entity;
}

Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/application/scene_utility.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/application/scene_utility.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/application/scene.hpp"
#include "app/component/scene/uid_component.hpp"
#include "app/vtx_app.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/application/selection/molecule_data.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/application/selection/molecule_data.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/component/scene/selectable.hpp"
#include "app/component/scene/transform_component.hpp"
#include "app/helper/math.hpp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "app/application/selection/molecule_granularity.hpp"
#include "app/action/selection.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/application/selection/selection_manager.hpp"
#include "app/component/chemistry/atom.hpp"
#include "app/component/chemistry/chain.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/application/selection/selection.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/application/selection/selection.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/vtx_app.hpp"
#include <algorithm>
#include <sstream>
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/application/selection/selection_data.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/application/selection/selection_data.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/component/scene/scene_item_component.hpp"
#include "app/component/scene/selectable.hpp"
#include "app/vtx_app.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/component/chemistry/molecule.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/component/chemistry/molecule.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/component/chemistry/atom.hpp"
#include "app/component/chemistry/bond.hpp"
#include "app/component/chemistry/chain.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/component/chemistry/trajectory.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/component/chemistry/trajectory.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/component/chemistry/molecule.hpp"
#include "app/component/scene/scene_item_component.hpp"
#include "app/vtx_app.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/component/scene/aabb_component.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/component/scene/aabb_component.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/component/scene/transform_component.hpp"
#include "app/core/ecs/base_entity.hpp"
#include "app/helper/math.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/component/scene/scene_item_component.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/component/scene/scene_item_component.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/component/scene/updatable.hpp"
#include "app/core/ecs/base_entity.hpp"
#include "app/vtx_app.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/component/scene/selectable.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/component/scene/selectable.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/application/selection/selection.hpp"
#include "app/application/selection/selection_manager.hpp"
#include "app/vtx_app.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/controller/picker/selection.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "app/controller/picker/selection.hpp"
#include "app/core/input/input_manager.hpp"
#include <app/application/ecs/registry_manager.hpp>
#include <app/application/scene_utility.hpp>
#include <app/application/selection/selection.hpp>
#include <app/application/selection/selection_manager.hpp>
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/entity/application/scene_entity.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/entity/application/scene_entity.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/application/scene.hpp"
#include "app/component/io/scene_file_info.hpp"
#include "app/vtx_app.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/entity/scene/camera_entity.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/entity/scene/camera_entity.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/application/system/ecs_system.hpp"
#include "app/component/render/camera.hpp"
#include "app/component/scene/transform_component.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/entity/scene/molecule_entity.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/entity/scene/molecule_entity.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/application/scene.hpp"
#include "app/application/selection/molecule_data.hpp"
#include "app/application/selection/molecule_granularity.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/entity/scene/viewpoint_entity.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "app/entity/scene/viewpoint_entity.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/application/scene.hpp"
#include "app/component/render/viewpoint.hpp"
#include "app/component/scene/selectable.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/src/app/vtx_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "app/action/animation.hpp"
#include "app/action/application.hpp"
#include "app/action/scene.hpp"
#include "app/application/ecs/registry_manager.hpp"
#include "app/application/scene.hpp"
#include "app/application/selection/selection_manager.hpp"
#include "app/component/io/scene_file_info.hpp"
Expand Down
1 change: 0 additions & 1 deletion lib/app/test/entt.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "util/app.hpp"
// #include <app/ecs/component/molecule_component.hpp>
#include <app/action/scene.hpp>
#include <app/application/ecs/registry_manager.hpp>
#include <app/application/scene.hpp>
#include <app/component/chemistry/molecule.hpp>
#include <app/component/chemistry/residue.hpp>
Expand Down
1 change: 0 additions & 1 deletion lib/app/test/molecule.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "util/app.hpp"
#include <app/application/ecs/registry_manager.hpp>
#include <app/application/scene.hpp>
#include <app/component/chemistry/atom.hpp>
#include <app/component/chemistry/chain.hpp>
Expand Down
1 change: 0 additions & 1 deletion lib/app/test/scene.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "util/app.hpp"
#include <app/application/ecs/registry_manager.hpp>
#include <app/application/scene.hpp>
#include <app/component/chemistry/molecule.hpp>
#include <app/fixture.hpp>
Expand Down
1 change: 0 additions & 1 deletion lib/app/test/selection.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "util/app.hpp"
#include <app/application/ecs/registry_manager.hpp>
#include <app/application/scene.hpp>
#include <app/application/selection/molecule_data.hpp>
#include <app/application/selection/selection_manager.hpp>
Expand Down
1 change: 0 additions & 1 deletion lib/app/test/trajectories.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "util/app.hpp"
#include <app/application/ecs/registry_manager.hpp>
#include <app/application/scene.hpp>
#include <app/component/chemistry/molecule.hpp>
#include <app/component/chemistry/trajectory.hpp>
Expand Down

0 comments on commit c392443

Please sign in to comment.