refactor: update Geant scene visualization to use PhysicalVolumes instead of raw Solids for improved placement and context handling.
This commit is contained in:
@@ -18,9 +18,11 @@
|
||||
namespace uLib {
|
||||
namespace Vtk {
|
||||
|
||||
TessellatedSolid::TessellatedSolid(Geant::TessellatedSolid *content)
|
||||
: GeantSolid(content), m_TessContent(content) {
|
||||
this->Update();
|
||||
TessellatedSolid::TessellatedSolid(Geant::PhysicalVolume *content)
|
||||
: GeantSolid(content), m_TessSolid(nullptr) {
|
||||
if (content && content->GetLogical()) {
|
||||
m_TessSolid = dynamic_cast<Geant::TessellatedSolid *>(content->GetLogical()->GetSolid());
|
||||
}
|
||||
}
|
||||
|
||||
TessellatedSolid::~TessellatedSolid() {}
|
||||
@@ -31,13 +33,13 @@ void TessellatedSolid::Update() {
|
||||
}
|
||||
|
||||
void TessellatedSolid::UpdateGeometry() {
|
||||
if (!m_TessContent || m_TessContent->GetMesh().Points().empty()) {
|
||||
if (!m_TessSolid || !m_TessSolid->GetMesh() || m_TessSolid->GetMesh()->Points().empty()) {
|
||||
// Fallback to base tessellation if no model mesh
|
||||
GeantSolid::UpdateGeometry();
|
||||
return;
|
||||
}
|
||||
|
||||
const TriangleMesh &mesh = m_TessContent->GetMesh();
|
||||
const TriangleMesh &mesh = *m_TessSolid->GetMesh();
|
||||
|
||||
vtkNew<vtkPoints> points;
|
||||
for (const auto& pt : mesh.Points()) {
|
||||
|
||||
Reference in New Issue
Block a user