Forum archiveIssue archiveOther usage issues

Archived discussion

AIS_InteractiveContext Question

Other usage issuesWed, 04/05/2000 - 11:491 reply

Browse this forum
QuestionAuthor

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

Discussion

1 archived reply

Posts are displayed in their archived order.

01Commenter-1

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, Commenter-1