How to make a AIS_InteractiveObject object display and hide in my control?

Hello,

I have define a new class which inherit from class AIS_InteractiveObject, and of course I override the Compute and ComputeSelection methods. Now I get a object of my new class.

The problem is : I want to display the object when the mouse detect the bounding box of the object, and hide the object when the mouse is out of the bounding box of the object. Can I use the followed code in my new class directly?

GetContext()->Display(this); //Display
GetContext()->Erase(this); //Hide

Paul Jimenez's picture

Have an extra mode for Compute that draws nothing. Display the object in that mode by default. When the mouse detects its bounding box, switch the display mode of that object to one where it is drawn (shaded, wireframe, ...). When the mouse no longer detects it, switch to the 'invisible' mode again.

zhangzhigang824's picture

Hi,

That's a good idea, thank you!
I have solved this problem.

Thanks again!