Tue, 04/12/2016 - 17:57
Forums:
Hello,
after porting to OCCT 7.0.0 I came upon the following problem. The method 'UnsetSelectionMode' in my old code:
Handle(AIS_Trihedron) aTrihedron = new AIS_Trihedron(aTrihedronAxis);
aTrihedron->UnsetSelectionMode();
myAISContext->Display(aTrihedron);
is invalid and had to be removed.
The problem is 'SelectMgr_SelectableObject::setGlobalSelMode' is declared as protected and 'AIS_InteractiveContext::SetAutoActivateSelection' seems to influence all displayed AIS_InteractiveObjects. Displaying objects always uses the global value and I'm not sure how to cope with that.
So how can I make some objects selectable and others not?
Thanks!
Pawel
Tue, 04/12/2016 - 18:12
OK, I got one workaround:
Handle(AIS_Trihedron) aTrihedron = new AIS_Trihedron(aTrihedronAxis);
myAISContext->Display(aTrihedron);
myAISContext->SelectionManager()->Remove((const Handle(SelectMgr_SelectableObject)&)aTrihedron);
The problem is that the selection is computed first and then removed... so I would probably have to do this the other way round:
AIS_InteractiveContext::SetAutoActivateSelection(Standard_False)
Add selector.
Does that sound reasonable?
Tue, 04/12/2016 - 20:17
I'm not quite understand your question - if you don't like the object to be selectable you should either disable auto-enabling selection by mentioned method AIS_InteractiveContext::SetAutoActivateSelection() or by passing invalid selection mode in extended version of AIS_InteractiveContext::Display().
Wed, 04/13/2016 - 14:12
Yes, thanks!
Using an overloaded version of AIS_InteractiveContext::Display() solves the problem.