
Fri, 01/23/2009 - 12:38
Forums:
Hi All,
I'm new here, so for begin hello everyone :)
I try make a modyfiactions at ImportExport project for understend a OpenCascade philosophy. And I found one problem, what I don't know how to support:
I want to make a function what will automaticly select all elements from a current, open model model. How to do it ?
Thnx for any help
OlekBa
Fri, 01/23/2009 - 13:43
Hi Olek,
I'm not sure if I got you right. If you want to select the objects in the viewer like you would do with the mouse try:
if(!myAISContext.IsNull())
{
if(myAISContext->HasOpenedContext())
myAISContext->CloseLocalContext();
AIS_ListOfInteractive aList;
myAISContext->DisplayedObjects(aList);
AIS_ListIteratorOfListOfInteractive aListIterator;
if(aList.Extent() > 0)
{
for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next())
{
if(aListIterator.Value().IsNull() == Standard_False)
{
myAISContext->AddOrRemoveCurrentObject (aListIterator.Value());
}
}
}
}
Good luck
Pawel
Fri, 01/23/2009 - 15:25
This is it and it is working :)
THNX very much
Olekba
Fri, 01/23/2009 - 15:40
If somenone will need this topic. Little modyfication at this source:
if (myAISContext->IsCurrent(aListIterator.Value())==Standard_False)
myAISContext->AddOrRemoveCurrentObject (aListIterator.Value());
To be sure that all elements will be select. In another case selection will be reverse.