AIS object Selection problem using SetLocation

Hello,

When I change the position of AIS_InteractiveObjects with Ais_InteractiveContext->SetLocation() I get the object hilighted in the original position.

I create some object in this way :
...
pObject=new AIS_Shape();
...
myAISContext->Display(pObject,Standard_False);
myAISContext->ResetLocation(pObject);
myAISContext->SetLocation(pObject, TopLoc_Location(ActTrsf) );
myAISContext->Activate(pObject);

I have tried to chane the location of the AIS_InteractiveObject before display it, but the result is the same.

How can I update the selection of the objects displayed ?

Marco Balen's picture

Hello,

I have solved the problem calling two times the SetLocation() method.
It seem that the first call sets correctly the location for visualization but do somethink wrong for the selection.
Calling twice the SetLocation() method all seems works well.
My object are displyed without local context.
The final code is:
myAISContext->Display(pObject,Standard_False);
myAISContext->Activate(pObject);
myAISContext->ResetLocation(pObject);
myAISContext->SetLocation(pObject, TopLoc_Location(ActTrsf) );
myAISContext->SetLocation(pObject, TopLoc_Location(ActTrsf) );

Have anyone any other suggestion ?

jelle's picture

Hi Marco,

Thanks a lot for this find, that helped me.
Looks like the issue will be fixed in 6.8.0...

Thanks again,

-jelle

andreaf76's picture

Using 6.3.1 I was not able to fix the problem until I found that after a call to the function myAISContex​->UpdateCurrentViewer(); must be called again myAISContext->SetLocation(pObject, TopLoc_Location(ActTrsf) );

I hope this can help.

-Andrea