I tried to move a sphere which is an AIS_SHAPE but I didn't get it. I think maybe jooo can help me.
Thanks
Hugues (not verified) Wed, 05/25/2005 - 09:52
You can move an AIS_Shape or more generally an AIS_InteractiveObjet with the procedure AIS_InteractiveContext::SetLocation.
It takes the interactive object to move, and the move as a transformation.
Transformations are gp_Trsf objects.
To translate an item to P(x, y, z) do :
gp_Trsf move;
move.SetValues (1, 0, 0, x,
0, 1, 0, y,
0, 0, 1, z,
angular_tol, confusion_tol);
ais_context->SetLocation (ais_shape, move);
Wed, 05/25/2005 - 09:52
You can move an AIS_Shape or more generally an AIS_InteractiveObjet with the procedure AIS_InteractiveContext::SetLocation.
It takes the interactive object to move, and the move as a transformation.
Transformations are gp_Trsf objects.
To translate an item to P(x, y, z) do :
gp_Trsf move;
move.SetValues (1, 0, 0, x,
0, 1, 0, y,
0, 0, 1, z,
angular_tol, confusion_tol);
ais_context->SetLocation (ais_shape, move);
Thu, 05/26/2005 - 17:34
Hi Hugues
Thank you very much, It worked.
Thu, 03/15/2018 - 13:04
its not working for me,Here is the procedure that i followed
BRepPrimAPI_MakeSphere mkSphere2(5.0);
TopoDS_Shape Sphere2=mkSphere2.Shape();
Handle(AIS_Shape) AISsphere2=new AIS_Shape(Sphere2);
gp_Trsf move;
move.SetValues(10, 0, 0, 500,
0, 10, 0, 100,
0, 0, 1, 0);
AISContext->SetLocation (AISsphere2, move);
AISContext->SetDisplayMode (AIS_Shaded);
AISContext->Display(AISsphere2);
Irrespective of x,y,z values the sphere location is intact.Please help.
Thu, 03/15/2018 - 14:09
Your code produces expected result within current OCCT (although for certain you are using some obsolete version), so I don't see your problem.