refactor: update transformation system, improve template readability, and reorganize VTK assembly management

This commit is contained in:
AndreaRigoni
2026-03-31 16:04:03 +00:00
parent 22d0041942
commit d4fd2d3914
30 changed files with 568 additions and 501 deletions

View File

@@ -547,16 +547,14 @@ void vtkHandlerWidget::OnMouseMove() {
total->Concatenate(op);
if (this->Prop3D) {
double p[3], r[3], s[3];
total->GetPosition(p);
total->GetOrientation(r);
total->GetScale(s);
this->Prop3D->SetPosition(p);
// VTK GetOrientation already returned degrees, so r is in degrees.
// We apply it directly back to VTK.
this->Prop3D->SetOrientation(r);
this->Prop3D->SetScale(s);
this->Prop3D->SetUserMatrix(nullptr);
vtkNew<vtkMatrix4x4> result;
total->GetMatrix(result);
this->Prop3D->SetUserMatrix(result);
// Reset individual TRS components so UserMatrix is the single source of truth
this->Prop3D->SetPosition(0, 0, 0);
this->Prop3D->SetOrientation(0, 0, 0);
this->Prop3D->SetScale(1, 1, 1);
}
this->Prop3D->Modified();