SetSelectionmode occ700

We are porting from occ 6.9.0 to occ700

I discovered that AIS_InteractiveObject​::SetSelectionMode is not there anymore.

How can we set the selection mode for an AIS_Object ?

thanks, Guido

 

 

 

 

Guido van Hilst not specified's picture

I have read in release notes:

AIS_InteractiveObject::mySelectionMode has been removed –

now each selectable object can define its own selection mode for “global” selection of the whole object. The whole object selection mode is 0 by default for all standard interactive objects;

That means we now have to derive a custom AIS_InteractiveObject and keep selectionmode?

We have lots of AIS_Shape object that uses the SetSelectionMode?

Forum supervisor's picture

Dear Guido,

Removed AIS_InteractiveObject::SetSelectionMode (const Standard_Integer aMode) method simply stored the passed integer value in the class field.

Since it is possible to activate several selection modes for a given interactive object instance at the same time, this method contradicted with other AIS package API.

Applications that used this method can implement selection mode caching if it is necessary.

We are pleased to see that you are using OCCT during many years and porting your applications. 

Please do not hesitate to communicate via our Contact Form for providing more information about our expertise, support and solutions that could be successfully used in your projects.
 

--

Best Regards,

Forum supervisor

Guido van Hilst not specified's picture

Thank you very much for your kind reply.

Yes in occ690 the default selection-mode could be get and set. (basically a property)

If I understand correct:  the only way in occ700 to change the default selection mode is to use virtual mechanism?

What about users who are using occ-bindings ,  java/c# wrappers?

Can I inherit in java/c# from AIS_Shape?

Can I activate multiple selection modes without inheritance?

Forum supervisor's picture

"Default Selection" does not sound very useful for standard presentations.
If you need all AIS_Shape are to be activated with specific selection mode - why you don't do it within extended AIS_InteractiveContext::Display() syntax?

Concerting external bindings - overloading of virtual methods is actually possible.
It has been used at least with C# wrapper (advanced OCC sample) for writing custom AIS_InteractiveObject presentations overriding ::Compute() and ::ComputeSelection() methods.

Regards, FSR

Guido van Hilst not specified's picture

Ah yes,i understand, thank you,

We where actually setting the display-mode before the AIS_Shape was in the AIS_InteractiveContext.

Thus now we pass the "default-selection-mode" in the AIS_InteractiveContext.Display(...)

Its great that your c# wrappers support inheritance :)