refactor: update Geant scene visualization to use PhysicalVolumes instead of raw Solids for improved placement and context handling.
This commit is contained in:
@@ -24,8 +24,15 @@
|
||||
namespace uLib {
|
||||
namespace Vtk {
|
||||
|
||||
BoxSolid::BoxSolid(Geant::BoxSolid *content)
|
||||
: GeantSolid(content), m_BoxContent(content) {
|
||||
BoxSolid::BoxSolid(Geant::PhysicalVolume *content)
|
||||
: GeantSolid(content), m_BoxSolid(nullptr) {
|
||||
if (content && content->GetLogical()) {
|
||||
m_BoxSolid = dynamic_cast<Geant::BoxSolid *>(content->GetLogical()->GetSolid());
|
||||
}
|
||||
}
|
||||
|
||||
BoxSolid::BoxSolid(Geant::BoxSolid *solid)
|
||||
: GeantSolid(solid), m_BoxSolid(solid) {
|
||||
}
|
||||
|
||||
BoxSolid::~BoxSolid() {
|
||||
@@ -35,10 +42,10 @@ void BoxSolid::serialize_display(uLib::Archive::display_properties_archive &ar,
|
||||
const unsigned int version) {
|
||||
// Expose Geant solid properties and underlying Box/TRS properties
|
||||
this->Prop3D::serialize_display(ar, version);
|
||||
if (m_BoxContent) {
|
||||
ar & NVP("Box", *m_BoxContent);
|
||||
if (m_BoxContent->GetObject()) {
|
||||
ar & NVP("Container", *m_BoxContent->GetObject());
|
||||
if (m_BoxSolid) {
|
||||
ar & NVP("Box", *m_BoxSolid);
|
||||
if (m_BoxSolid->GetObject()) {
|
||||
ar & NVP("Container", *m_BoxSolid->GetObject());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user