add vtk solids

This commit is contained in:
AndreaRigoni
2026-03-25 21:03:13 +00:00
parent e4a8499104
commit 422113a0e9
17 changed files with 353 additions and 16 deletions

View File

@@ -45,7 +45,6 @@ namespace Vtk {
vtkGeantSolid::vtkGeantSolid(Content *content)
: m_SolidActor(vtkActor::New()), m_Content(content) {
this->InstallPipe();
this->Update();
}
vtkGeantSolid::~vtkGeantSolid() {
@@ -59,6 +58,11 @@ vtkPolyData *vtkGeantSolid::GetPolyData() const {
}
void vtkGeantSolid::Update() {
this->UpdateGeometry();
this->UpdateTransform();
}
void vtkGeantSolid::UpdateGeometry() {
if (!m_Content)
return;
@@ -103,6 +107,11 @@ void vtkGeantSolid::Update() {
polyData->SetPolys(polys);
polyData->Modified();
}
}
void vtkGeantSolid::UpdateTransform() {
if (!m_Content || !m_SolidActor)
return;
// Apply the Geant4 transform (position/rotation) if placed
if (m_Content->GetPhysical()) {