For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

AIS_InteractiveContext Question

Christof Krug's picture
Forums: 

Hi all,

I want to iterate through all shape objects in an AIS_InteractiveContext.

I have tried the following:

for (m_hContext->InitCurrent(); m_hContext->MoreCurrent(); m_hContext->NextCurrent()) {

ToposDS_Shape Shape = Handle(AIS_Shape)::DownCast(m_hContext->Current())->Shape(); }

This way I obviously get all selected shapes, but how do I get all shapes?

Thanx Christof

Michael Gandyra's picture

Like this:

AIS_ListOfInteractive Obj_List;

myAISContext->DisplayedObjects(Obj_List);

AIS_ListIteratorOfListOfInteractive it;

for (it.Initialize(Obj_List); it.More(); it.Next())

{

// Do what you want with the InteractiveObjects

// i.e. test if the current InteractiveObject has a Shape

}

with regards, Michael