Salome HOME
Preparations for Split operation. It includes:
[modules/shaper.git] / src / ModelAPI / ModelAPI_Tools.cpp
index 7a7bbecb7f9ada529aadb71326638d8593217f46..74a33d36641923cb211dbfe1bb116a83d0768daf 100755 (executable)
@@ -89,6 +89,20 @@ std::shared_ptr<GeomAPI_Shape> shape(const ResultPtr& theResult)
   return theResult->shape();
 }
 
+void shapesOfType(const FeaturePtr& theFeature,
+                  const GeomAPI_Shape::ShapeType& theType,
+                  std::set<GeomShapePtr>& theShapes)
+{
+  std::list<ResultPtr> aResults = theFeature->results();
+  std::list<ResultPtr>::const_iterator aRIter = aResults.cbegin();
+  for (; aRIter != aResults.cend(); aRIter++) {
+    ResultPtr aResult = *aRIter;
+    GeomShapePtr aShape = aResult->shape();
+    if (aShape.get() && aShape->shapeType() == theType)
+      theShapes.insert(aShape);
+  }
+}
+
 const char* toString(ModelAPI_ExecState theExecState) 
 {
 #define TO_STRING(__NAME__) case __NAME__: return #__NAME__;