refactor: rename Puppet class to Prop3D across the codebase

This commit is contained in:
AndreaRigoni
2026-04-08 15:47:33 +00:00
parent 77f00a2b8a
commit f7ba4b1a17
63 changed files with 412 additions and 413 deletions

View File

@@ -33,19 +33,19 @@ namespace uLib {
namespace Vtk {
GeantScene::GeantScene(Geant::Scene *scene)
: m_Scene(scene), m_WorldPuppet(nullptr) {
: m_Scene(scene), m_WorldProp3D(nullptr) {
if (!m_Scene)
return;
// 1. Create the world box wireframe puppet
// 1. Create the world box wireframe prop3d
uLib::ContainerBox *worldBox = m_Scene->GetWorldBox();
if (worldBox) {
m_WorldPuppet = new ContainerBox(worldBox);
m_WorldPuppet->SetRepresentation(Puppet::Wireframe);
m_WorldPuppet->ShowScaleMeasures(true);
m_WorldProp3D = new ContainerBox(worldBox);
m_WorldProp3D->SetRepresentation(Prop3D::Wireframe);
m_WorldProp3D->ShowScaleMeasures(true);
}
// 2. Create puppets for each non-world solid
// 2. Create prop3ds for each non-world solid
const Geant::Solid *world = m_Scene->GetWorld();
const Vector<Geant::Solid *> &solids = m_Scene->GetSolids();
@@ -54,7 +54,7 @@ GeantScene::GeantScene(Geant::Scene *scene)
if (solid == world)
continue;
// Only create a puppet if the solid has a valid G4VSolid
// Only create a prop3d if the solid has a valid G4VSolid
if (solid->GetG4Solid()) {
GeantSolid *vtkSolid = nullptr;
if (auto *box = dynamic_cast<Geant::BoxSolid *>(solid)) {
@@ -67,34 +67,34 @@ GeantScene::GeantScene(Geant::Scene *scene)
}
if (vtkSolid) {
m_SolidPuppets.push_back(vtkSolid);
m_SolidProp3Ds.push_back(vtkSolid);
}
}
}
}
GeantScene::~GeantScene() {
delete m_WorldPuppet;
for (auto *p : m_SolidPuppets) {
delete m_WorldProp3D;
for (auto *p : m_SolidProp3Ds) {
delete p;
}
}
void GeantScene::AddToViewer(Viewport &viewer) {
if (m_WorldPuppet) {
viewer.AddPuppet(*m_WorldPuppet);
if (m_WorldProp3D) {
viewer.AddProp3D(*m_WorldProp3D);
}
for (auto *p : m_SolidPuppets) {
viewer.AddPuppet(*p);
for (auto *p : m_SolidProp3Ds) {
viewer.AddProp3D(*p);
}
}
void GeantScene::RemoveFromViewer(Viewport &viewer) {
if (m_WorldPuppet) {
viewer.RemovePuppet(*m_WorldPuppet);
if (m_WorldProp3D) {
viewer.RemoveProp3D(*m_WorldProp3D);
}
for (auto *p : m_SolidPuppets) {
viewer.RemovePuppet(*p);
for (auto *p : m_SolidProp3Ds) {
viewer.RemoveProp3D(*p);
}
}