+ if (aSelList.Extent() == 1) {
+ Handle(SALOME_InteractiveObject) anIO = aSelList.First();
+ aSelMgr->GetIndexes(anIO, aMap);
+ }
+
+ if (aMap.IsEmpty() && aSelList.Extent() > 0) { // try to detect selected published sub-shape
+ TColStd_MapOfInteger anIds;
+
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(myGeomGUI->getApp()->activeStudy());
+ if (!appStudy) return;
+ _PTR(Study) aStudy = appStudy->studyDS();
+
+ TopTools_IndexedMapOfShape aMainMap;
+ TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myObject);
+ TopExp::MapShapes(aMainShape, aMainMap);
+
+ SALOME_ListIO aSelListToShow;
+ SALOME_ListIteratorOfListIO anIter (aSelList);
+ for (int i = 0; anIter.More(); anIter.Next(), i++) {
+ Handle(SALOME_InteractiveObject) anIO = anIter.Value();
+ QString anEntry = anIO->getEntry();
+
+ _PTR(SObject) aSObj (aStudy->FindObjectID(anEntry.toUtf8().constData()));
+ if ( ! GeometryGUI::IsInGeomComponent( aSObj )) continue;
+ GEOM::GEOM_Object_var aGeomObj =
+ GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aSObj));
+ TopoDS_Shape aShape;
+ if (GEOMBase::GetShape(aGeomObj, aShape)) {
+ if (aGeomObj->GetType() == GEOM_GROUP || aShape.ShapeType() == TopAbs_FACE) {
+ TopExp_Explorer anExp (aShape, TopAbs_FACE);
+ bool isInside = false;
+ for (; anExp.More(); anExp.Next()) {
+ TopoDS_Shape aSubShape = anExp.Current();
+ int anIndex = aMainMap.FindIndex(aSubShape);
+ if (anIndex > 0) {
+ aMap.Add(anIndex);
+ anIds.Add(anIndex);
+ isInside = true;
+ aSelListToShow.Append(anIO);
+ }
+ }
+ if (!isInside)
+ {
+ disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+ aSelMgr->AddOrRemoveIndex(anIO, anIds, false);
+ connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+ this, SLOT(SelectionIntoArgument()));
+ }
+ }
+ }
+ }
+
+ if (!aMap.IsEmpty()) {
+ // highlight local faces, correspondent to OB selection
+ disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+
+ aSelMgr->clearSelected();
+
+ QString objIOR = GEOMBase::GetIORFromObject(myObject);
+ Handle(GEOM_AISShape) aSh = GEOMBase::ConvertIORinGEOMAISShape( objIOR, true );
+ if ( aSh.IsNull() )
+ return;
+
+ aSelMgr->AddOrRemoveIndex(aSh->getIO(), anIds, false);
+
+ SALOME_ListIteratorOfListIO anIter(aSelListToShow);
+ for (; anIter.More(); anIter.Next()) {
+ aSelMgr->AddOrRemoveIndex(anIter.Value(), anIds, false);
+ }
+
+ connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+ this, SLOT(SelectionIntoArgument()));
+ }
+ }
+
+ const int n = aMap.Extent();
+ myFacesInd->length(n);
+ for (int i = 1; i <= n; i++)
+ myFacesInd[i-1] = aMap(i);
+ if (n)
+ myEditCurrentArgument->setText(QString::number(n) + "_" + tr("GEOM_FACE") + tr("_S_"));
+ }