Salome HOME
52846: It is impossible to select edge in OB as reversed edge for hypothesis
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_SubShapeSelectorWdg.cxx
index 808abf83f08156e25098964adfd7db39a05e8c75..66da7722e2d71ca00fd84f78368e5d70b5420925 100644 (file)
@@ -288,7 +288,9 @@ void StdMeshersGUI_SubShapeSelectorWdg::selectionIntoArgument()
                 }
               }
             }
-          } else if ( aGeomObj->GetType() == 28 /*GEOM_SUBSHAPE*/  ) {
+          } else if ( aGeomObj->GetType() == 28 /*GEOM_SUBSHAPE*/ ||
+                      myEntry == IO->getEntry() )
+          {
             GEOMBase::GetShape(aGeomObj, shape); 
             if ( !shape.IsNull() && shape.ShapeType() == mySubShType ) {
               int index = myPreviewActor->GetIndexByShape( shape );
@@ -530,9 +532,6 @@ SMESH::long_array_var StdMeshersGUI_SubShapeSelectorWdg::GetListOfIDs()
 {
   SMESH::long_array_var anArray = new SMESH::long_array;
 
-  // if ( myMainEntry != "" && myIsNotCorrected )
-  //   myListOfIDs = GetCorrectedListOfIDs( true );
-
   int size = myListOfIDs.size();
   anArray->length( size );
   for (int i = 0; i < size; i++)
@@ -575,17 +574,6 @@ bool StdMeshersGUI_SubShapeSelectorWdg::SetListOfIDs( SMESH::long_array_var theI
   return isOk;
 }
 
-//=================================================================================
-// function : SetMainShapeEntry
-// purpose  : Called to set the Entry of main shape of the mesh
-//=================================================================================
-// void StdMeshersGUI_SubShapeSelectorWdg::SetMainShapeEntry( const QString& theEntry )
-// {
-//   myMainEntry = theEntry;
-//   myMainShape = GetTopoDSByEntry( theEntry );
-//   myIsNotCorrected = true;
-// }
-
 //=================================================================================
 // function : GetMainShapeEntry
 // purpose  : Called to get the Main Object Entry
@@ -596,82 +584,6 @@ const char* StdMeshersGUI_SubShapeSelectorWdg::GetMainShapeEntry()
   return myMainEntry.c_str();
 }
 
-//=================================================================================
-// function : GetCorrectedListOfIds
-// purpose  : Called to convert the list of IDs from sub-shape IDs to main shape IDs
-//=================================================================================
-// QList<int>
-// StdMeshersGUI_SubShapeSelectorWdg::GetCorrectedListOfIDs( bool fromSubshapeToMainshape,
-//                                                           bool* isOK )
-// {
-//   if (( myMainShape.IsNull() || myGeomShape.IsNull() ) &&  fromSubshapeToMainshape )
-//     return myListOfIDs;
-//   else if (( myMainShape.IsNull() /*||*/&& myGeomShape.IsNull() ) &&  !fromSubshapeToMainshape )
-//     return mySelectedIDs;
-
-//   if ( !fromSubshapeToMainshape ) // called from SetListOfIDs
-//   {
-//     if ( myMainShape.IsNull() )
-//       std::swap( myMainShape, myGeomShape );
-//   }
-
-//   QList<int> aList;
-//   TopTools_IndexedMapOfShape aGeomMap, aMainMap;
-//   TopExp::MapShapes(myMainShape, aMainMap);
-//   if ( !myGeomShape.IsNull() )
-//     TopExp::MapShapes(myGeomShape, aGeomMap);
-
-//   bool ok = true;
-//   if ( fromSubshapeToMainshape ) // convert indexes from sub-shape to mainshape
-//   {
-//     int size = myListOfIDs.size();
-//     for (int i = 0; i < size; i++) {
-//       int index = myListOfIDs.at(i);
-//       if ( aGeomMap.Extent() < index )
-//       {
-//         ok = false;
-//       }
-//       else
-//       {
-//         TopoDS_Shape aSubShape = aGeomMap.FindKey( index );
-//         if ( mySubShType != aSubShape.ShapeType() )
-//           ok = false;
-//         if ( !aMainMap.Contains( aSubShape ))
-//           ok = false;
-//         else
-//           index = aMainMap.FindIndex( aSubShape );
-//       }
-//       aList.append( index );
-//     }
-//     myIsNotCorrected = false;
-//   }
-//   else // convert indexes from main shape to sub-shape, or just check indices
-//   {
-//     int size = mySelectedIDs.size();
-//     for (int i = 0; i < size; i++) {
-//       int index = mySelectedIDs.at(i);
-//       if ( aMainMap.Extent() < index )
-//       {
-//         ok = false;
-//       }
-//       else
-//       {
-//         TopoDS_Shape aSubShape = aMainMap.FindKey( index );
-//         if ( mySubShType != aSubShape.ShapeType() )
-//           ok = false;
-//         if ( !aGeomMap.Contains( aSubShape ) && !aGeomMap.IsEmpty() )
-//           ok = false;
-//         else
-//           index = aGeomMap.FindIndex( aSubShape );
-//       }
-//       aList.append( index );
-//     }
-//   }
-//   if ( isOK ) *isOK = ok;
-
-//   return aList;
-// }
-
 void StdMeshersGUI_SubShapeSelectorWdg::updateButtons()
 {
   if ( myPreviewActor ) {