Distinguish between AIS entities

How can I distinguish between a selected Topological shape and others like the AIS_Line and AIS_Circle? Suppose I have created two objects, one box and one circle. I have used AIS_Shape for box and AIS_Circle for the circle. Now I have a menu for translation. I have to use the appropriate transformation methods for the box using BRep transformation and some different method for transforming the circle. The problem is that how do I differentiate what is selected and use the appropriate transformation for both.

Please Help
Sharjith N.

François Lauzon's picture

Hi Sharjith,
you could use the following to test if a AIS_InteractiveObject is a AIS_Circle for example:
Handle_AIS_InteractiveObject anAISObj=...;
// it's a circle
if (anAISObj->IsKind(STANDARD_TYPE(AIS_Circle))) {
Handle_AIS_Circle aCircle=Handle_AIS_Circle::DownCast(anAISObj);
// do the circle transformation
// it's a shape
else if (anAISObj->IsKind(STANDARD_TYPE(AIS_Shape))) {
// do a shape transformation

and so on...

Good Luck.

Sharjith Naramparambath's picture

Thanks a lot