1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0030669: Visualization - AIS_Manipulator ignores parent transformation

AIS_Manipulator::Transform() now considers object parent transformation.

Added new command vchild for easier testing of low-level connections between presentations.
This commit is contained in:
kgv
2019-04-24 18:50:29 +03:00
committed by bugmaster
parent 2b88626548
commit 245cbf9441
3 changed files with 122 additions and 2 deletions

View File

@@ -702,7 +702,20 @@ void AIS_Manipulator::Transform (const gp_Trsf& theTrsf)
NCollection_Sequence<gp_Trsf>::Iterator aTrsfIter (myStartTrsfs);
for (; anObjIter.More(); anObjIter.Next(), aTrsfIter.Next())
{
anObjIter.ChangeValue()->SetLocalTransformation (theTrsf * aTrsfIter.Value());
const Handle(AIS_InteractiveObject)& anObj = anObjIter.ChangeValue();
const gp_Trsf& anOldTrsf = aTrsfIter.Value();
const Handle(Geom_Transformation)& aParentTrsf = anObj->CombinedParentTransformation();
if (!aParentTrsf.IsNull()
&& aParentTrsf->Form() != gp_Identity)
{
// recompute local transformation relative to parent transformation
const gp_Trsf aNewLocalTrsf = aParentTrsf->Trsf().Inverted() * theTrsf * aParentTrsf->Trsf() * anOldTrsf;
anObj->SetLocalTransformation (aNewLocalTrsf);
}
else
{
anObj->SetLocalTransformation (theTrsf * anOldTrsf);
}
}
}