refactor: Simplify vtkDetectorChamber by removing redundant transform management and improve vtkHandlerWidget rotation calculation using ray-plane intersection.

This commit is contained in:
AndreaRigoni
2026-03-18 23:08:22 +00:00
parent a9b66a4e12
commit 3b02bb26ac
7 changed files with 142 additions and 184 deletions

View File

@@ -74,9 +74,19 @@ void vtkStructuredGrid::Update() {
if (!vmat) return;
Matrix4f transform = VtkToMatrix4f(vmat);
m_Content->SetMatrix(transform);
// Update uLib model's affine transform
if (m_Content->GetParent()) {
Matrix4f localT = m_Content->GetParent()->GetWorldMatrix().inverse() * transform;
m_Content->SetMatrix(localT);
} else {
m_Content->SetMatrix(transform);
}
m_Content->Updated(); // Notify others (like raytracer)
// Debug output
std::cout << "vtkStructuredGrid::Update matrix:\n" << transform << std::endl;
}
void vtkStructuredGrid::InstallPipe() {