Moving an object in AIS

My apologies for the naive question, but simply put : How may I move a selected object within AIS? Specifically, what is the best method for implementing a "click and drag" function to allow simple interactive movement of objects on the user's screen?

A snippet of code that I have currently been trying is:

V3d_Coordinate x0,y0,z0,x1,y1,z1;
gp_Trsf trsf;


trsf.SetTranslation(gp_Pnt(x0,y0,z0), gp_Pnt(x1,y1,z1));
Handle(AIS_Shape) m_hSelected=new AIS_Shape(CurrentIC->SelectedShape());
BRepBuilderAPI_Transform myTrsf(m_hSelected->Shape(),trsf,Standard_False);
TopoDS_Shape aShape= myTrsf.Shape();

But this merely creates replicas of the moving object, rather than moving the original object.

Thanks for the help.


Patrik Mueller's picture


look here:

Best regards,
Patrik Müller