1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_Tools.cpp
4 // Created: 19 Mar 2017
5 // Author: Natalia ERMOLAEVA
7 #include <GeomAPI_Shape.h>
9 #include "ModelGeomAlgo_Shape.h"
11 #include <ModelAPI_Feature.h>
12 #include <ModelAPI_Result.h>
16 #pragma warning(disable : 4996) // for sprintf
19 namespace ModelGeomAlgo_Shape
21 void shapesOfType(const FeaturePtr& theFeature,
22 const GeomAPI_Shape::ShapeType& theType,
23 std::set<ResultPtr>& theShapeResults)
25 theShapeResults.clear();
26 std::list<ResultPtr> aResults = theFeature->results();
27 std::list<ResultPtr>::const_iterator aRIter = aResults.cbegin();
28 for (; aRIter != aResults.cend(); aRIter++) {
29 ResultPtr aResult = *aRIter;
30 GeomShapePtr aShape = aResult->shape();
31 if (aShape.get() && aShape->shapeType() == theType)
32 theShapeResults.insert(aResult);
35 } // namespace ModelGeomAlgo_Shape