-QList<int> StdMeshersGUI_SubShapeSelectorWdg::GetCorrectedListOfIDs( bool fromSubshapeToMainshape )
-{
- if ( ( myMainShape.IsNull() || myGeomShape.IsNull() ) && fromSubshapeToMainshape )
- return myListOfIDs;
- else if ( ( myMainShape.IsNull() || myGeomShape.IsNull() ) && !fromSubshapeToMainshape )
- return mySelectedIDs;
-
- QList<int> aList;
- TopTools_IndexedMapOfShape aGeomMap;
- TopTools_IndexedMapOfShape aMainMap;
- TopExp::MapShapes(myGeomShape, aGeomMap);
- TopExp::MapShapes(myMainShape, aMainMap);
-
- if ( fromSubshapeToMainshape ) { // convert indexes from sub-shape to mainshape
- int size = myListOfIDs.size();
- for (int i = 0; i < size; i++) {
- TopoDS_Shape aSubShape = aGeomMap.FindKey( myListOfIDs.at(i) );
- int index = aMainMap.FindIndex( aSubShape );
- aList.append( index );
- }
- myIsNotCorrected = false;
- } else { // convert indexes from main shape to sub-shape
- int size = mySelectedIDs.size();
- for (int i = 0; i < size; i++) {
- TopoDS_Shape aSubShape = aMainMap.FindKey( mySelectedIDs.at(i) );
- int index = aGeomMap.FindIndex( aSubShape );
- aList.append( index );
- }
- }
-
- return aList;
-}
+// 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;
+// }