Select all in import export project

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

Pawel's picture

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

olekba's picture

This is it and it is working :)

THNX very much
Olekba

olekba's picture

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.