I tried to apply the SetHilightedMode() to a Shape

But i couldn't get it work. here are the lines : Handle(AIS_Shape) Shape Shape->SetHilightedMode();

Is there something i missed ? best regards

Msaaf Omar's picture

I want to be able to change dimensions of selected shapes. I know that it takes knowing the corresponding Topological creating element. The problem is that i don't know how to select the shapes, and make link to the topology. Could you help me please ? Thanxs.. Omar Msaaf...

Michael Gandyra's picture

If you used AIS_InteractiveContext then you can make use of the MoveTo(x,y) method to highlight a shape under the cursor (assume at x,y). If not, then it is a very little bit more complicated ........

Regards, Michael

Msaaf Omar's picture

I ask for help. All i ask is the big lines to follow in order to get my goal. What i aws thinking was the following : Create a class belonging to the Topology, thta has a member = Interactive Object. Then when you click on the Interactive Object you know who is its father and then you can change its dimensions. Am i on the right way ?? Regards, Omar Msaaf

Michael Gandyra's picture

No Problem !

If you have to recognize a special Object through a Mouseclick - or Mousemove then create an Interactive Object inheriting from AIS_InteractiveObject. In it you have to redefine the Compute and Computeselection method. In the ComputeSelection method you have to provide an entityowner to the interactive object, like

Handle_SelectMgr_EntityOwner lOwner = new SelectMgr_EntityOwner(this, 10);

Then you have to provide a sensitivebox. If you are inside (with mouse) then -> object is highlighted. You don't have to calculate on your own. Just use the existing methods, like for a segment:

Handle_Select3D_SensitiveSegment arrowLine = new Select3D_SensitiveSegment(lOwner, myPnt1, myPnt2);

Then add it to the selection (argument from ComputeSelection method)

aSelection->Add(arrowLine);

Thats all. If you now use the MoveTo method from AIS_InteractiveContext then you can query your object with HasDetected and get it with DetectedInteractive. DownCast it to your inherited class. If its not null, then you got it. If you implemented some nice Methods on your own inheritance, then you can query your object like you want, also for parents, as you intend.

If its still not what you intend, then please be more precise in what you want to do. And please RTFM.

Regards, Michael