refactor: migrate vtk classes to use ObjectWrapper for model management and update registration logic

This commit is contained in:
AndreaRigoni
2026-04-09 10:38:45 +00:00
parent 64a87e97e3
commit db76513e79
27 changed files with 479 additions and 349 deletions

View File

@@ -26,6 +26,7 @@
#ifndef U_VTKCYLINDER_H
#define U_VTKCYLINDER_H
#include "Core/ObjectFactory.h"
#include "Math/Cylinder.h"
#include "Vtk/uLibVtkInterface.h"
#include <vtkActor.h>
@@ -41,7 +42,7 @@ namespace Vtk {
* mathematical state of a Cylinder object. It manages the alignment
* between VTK's Y-centered cylinder and uLib's Z-based coordinate system.
*/
class Cylinder : public Prop3D {
class Cylinder : public Prop3D, public uLib::ObjectWrapper<uLib::Cylinder> {
typedef uLib::Cylinder Content;
public:
@@ -54,7 +55,9 @@ public:
/** Synchronizes the uLib model matrix with the VTK actor specifically for gizmo interactions */
virtual void SyncFromVtk() override;
virtual uLib::Object* GetContent() const override { return (uLib::Object*)m_Content; }
virtual uLib::Object *GetContent() const override {
return (uLib::Object *)m_model.get();
}
protected:
/** Sets up the VTK visualization pipeline */
@@ -62,7 +65,6 @@ protected:
vtkActor *m_Actor;
::vtkAssembly *m_VtkAsm;
Content *m_Content;
uLib::Connection m_UpdateSignal;
};