X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_DFLoader.cpp;h=289db4f28cc077d32dbccd8a57c54e82dc00905b;hb=1323194ddeebb9ad9db362dc762cfff0f62db70d;hp=89fb0237b90da2e6df870adce9476e08f2572154;hpb=db3da60baa0e8cb3dec62db38063d3b9a951a4cd;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_DFLoader.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_DFLoader.cpp index 89fb0237b..289db4f28 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_DFLoader.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_DFLoader.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: GeomAlgoAPI_DFLoader.cpp // Created: 23 October 2014 // Author: Sergey Zaritchny @@ -11,17 +13,23 @@ //function : refineResult //purpose : //======================================================================= -const TopoDS_Shape GeomAlgoAPI_DFLoader::refineResult(const TopoDS_Shape& theResult) +const TopoDS_Shape GeomAlgoAPI_DFLoader::refineResult(const TopoDS_Shape& theResult) { - TopoDS_Shape aResult; - if (theResult.ShapeType() == TopAbs_COMPOUND) { - Standard_Integer nbSubResults = 0; - TopoDS_Iterator itr(theResult); - for (; itr.More(); itr.Next()) nbSubResults++; - if (nbSubResults == 1) { - itr.Initialize(theResult); - if (itr.More()) aResult = itr.Value(); + TopoDS_Shape aResult = theResult; + const TopAbs_ShapeEnum aShType = theResult.ShapeType(); + if(aShType == TopAbs_COMPOUND || aShType == TopAbs_SHELL || aShType == TopAbs_WIRE) { + Standard_Integer aSubResultsNb = 0; + TopoDS_Iterator anIt(theResult); + for(; anIt.More(); anIt.Next()) { + ++aSubResultsNb; + } + if(aSubResultsNb == 1) { + anIt.Initialize(theResult); + if(anIt.More()) { + aResult = anIt.Value(); + } } } + return aResult; }