1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_DFLoader.cpp
4 // Created: 23 October 2014
5 // Author: Sergey Zaritchny
7 #include <GeomAlgoAPI_DFLoader.h>
8 #include <TopoDS_Iterator.hxx>
9 #include <TopTools_MapOfShape.hxx>
10 #include <TopExp_Explorer.hxx>
11 #include <TopTools_ListIteratorOfListOfShape.hxx>
12 //=======================================================================
13 //function : refineResult
15 //=======================================================================
16 const TopoDS_Shape GeomAlgoAPI_DFLoader::refineResult(const TopoDS_Shape& theResult)
19 if (theResult.ShapeType() == TopAbs_COMPOUND) {
20 Standard_Integer nbSubResults = 0;
21 TopoDS_Iterator itr(theResult);
22 for (; itr.More(); itr.Next()) nbSubResults++;
23 if (nbSubResults == 1) {
24 itr.Initialize(theResult);
25 if (itr.More()) aResult = itr.Value();
27 /// MPV: store compound anyway: it may be Boolean operation that produces two solids from one