Salome HOME
89fb0237b90da2e6df870adce9476e08f2572154
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_DFLoader.cpp
1 // File:        GeomAlgoAPI_DFLoader.cpp
2 // Created:     23 October 2014
3 // Author:      Sergey Zaritchny
4
5 #include <GeomAlgoAPI_DFLoader.h>
6 #include <TopoDS_Iterator.hxx>
7 #include <TopTools_MapOfShape.hxx>
8 #include <TopExp_Explorer.hxx>
9 #include <TopTools_ListIteratorOfListOfShape.hxx>
10 //=======================================================================
11 //function : refineResult
12 //purpose  :
13 //=======================================================================
14 const TopoDS_Shape GeomAlgoAPI_DFLoader::refineResult(const  TopoDS_Shape& theResult)
15 {
16   TopoDS_Shape aResult;
17   if (theResult.ShapeType() == TopAbs_COMPOUND) {
18     Standard_Integer nbSubResults = 0;
19     TopoDS_Iterator itr(theResult);
20     for (; itr.More(); itr.Next()) nbSubResults++;
21     if (nbSubResults == 1) {
22       itr.Initialize(theResult);
23       if (itr.More()) aResult = itr.Value();
24     }
25   }
26   return aResult;
27 }