refactor: improve Geant4 solid synchronization and update documentation for VTK integration

This commit is contained in:
AndreaRigoni
2026-04-16 06:51:16 +00:00
parent 24ec326715
commit 865282aefc
6 changed files with 68 additions and 25 deletions

View File

@@ -40,13 +40,15 @@ BoxSolid::~BoxSolid() {
void BoxSolid::Update() {
ConnectionBlock blocker(m_UpdateConnection);
this->UpdateGeometry();
// Ensure base Prop3D properties (color, opacity, etc) and transform are applied
// Ensure base GeantSolid logic (G4Polyhedron and Transform) runs
this->GeantSolid::Update();
// Ensure base Prop3D properties (color, opacity, etc) are applied
this->Prop3D::Update();
}
void BoxSolid::SyncFromVtk() {
this->Prop3D::SyncFromVtk();
if (auto* proxy = vtkProp3D::SafeDownCast(this->GetProxyProp())) {
if (vtkMatrix4x4* mat = proxy->GetUserMatrix()) {
m_BoxContent->SetTransform(VtkToMatrix4f(mat));
@@ -54,16 +56,6 @@ void BoxSolid::SyncFromVtk() {
}
}
void BoxSolid::UpdateGeometry() {
// Sync geometry from G4VSolid provided by GeantSolid (tessellation)
GeantSolid::UpdateGeometry();
}
void BoxSolid::UpdateTransform() {
// Take transform from Prop3D base (which uses GetContent() -> ContainerBox TRS)
this->Prop3D::Update();
}
void BoxSolid::serialize_display(uLib::Archive::display_properties_archive &ar,
const unsigned int version) {
// Expose Geant solid properties and underlying Box/TRS properties

View File

@@ -49,8 +49,6 @@ public:
virtual ~BoxSolid();
virtual void Update() override;
virtual void UpdateGeometry() override;
virtual void UpdateTransform() override;
virtual void SyncFromVtk() override;
virtual uLib::Object *GetContent() const override {