Salome HOME
Speed-up of the access from OB to complicated compsolids in the frames of issue ...
[modules/shaper.git] / src / XGUI / XGUI_DataModel.cpp
index 30cf4e574342ab50ac1d7090115d3cf5c5f71b15..758fb4f2344ad975abc3384bbae9fb8386c26cc8 100644 (file)
@@ -386,12 +386,7 @@ QModelIndex XGUI_DataModel::objectIndex(const ObjectPtr theObject) const
       if (aResult.get()) {
         ResultCompSolidPtr aCompRes = ModelAPI_Tools::compSolidOwner(aResult);
         if (aCompRes.get()) {
-          for (int i = 0; i < aCompRes->numberOfSubs(true); i++) {
-            if (aCompRes->subResult(i, true) == theObject) {
-              aRow = i;
-              break;
-            }
-          }
+          aRow = ModelAPI_Tools::compSolidIndex(aResult);
         }
       }
     }