+ Handle(AIS_InteractiveContext) aContext = AISContext();
+ // Open local context if there is no one
+ if (!aContext->HasOpenedContext()) {
+ aContext->ClearCurrents(false);
+ aContext->OpenLocalContext(false/*use displayed objects*/, /*true*/false/*use displayed objects*/,
+ true/*allow shape decomposition*/);
+ }
+ // display or redisplay presentation
+ Handle(AIS_Shape) anAIS;
+ if (IsVisible(theFeature)) {
+ anAIS = Handle(AIS_Shape)::DownCast(myFeature2AISObjectMap[theFeature]);
+ if (!anAIS.IsNull()) {
+ anAIS->Set(theShape);
+ anAIS->Redisplay();
+ }
+ }
+ else {
+ anAIS = new AIS_Shape(theShape);
+ myFeature2AISObjectMap[theFeature] = anAIS;
+ aContext->Display(anAIS, false);
+ }
+ // Activate selection of objects from prs
+ if (!anAIS.IsNull()) {
+ aContext->Load(anAIS, -1, true/*allow decomposition*/);
+ std::list<int>::const_iterator anIt = theModes.begin(), aLast = theModes.end();
+ for (; anIt != aLast; anIt++)
+ {
+ aContext->Activate(anAIS, AIS_Shape::SelectionMode((TopAbs_ShapeEnum)*anIt));
+ }
+ }