+static GeomShapePtr runAlgo(GeomAlgoAPI_MakeShape& theAlgo) throw (GeomAlgoAPI_Exception)
+{
+ if (!theAlgo.check())
+ throw GeomAlgoAPI_Exception(theAlgo.getError());
+
+ theAlgo.build();
+
+ if (!theAlgo.isDone())
+ throw GeomAlgoAPI_Exception(theAlgo.getError());
+
+ return theAlgo.shape();
+}
+
+static GeomShapePtr runAlgoAndCheckShape(GeomAlgoAPI_MakeShape& theAlgo, const std::string& theMsg)
+throw (GeomAlgoAPI_Exception)
+{
+ if (!theAlgo.check())
+ throw GeomAlgoAPI_Exception(theAlgo.getError());
+
+ theAlgo.build();
+
+ if (!theAlgo.isDone() || !theAlgo.checkValid(theMsg))
+ throw GeomAlgoAPI_Exception(theAlgo.getError());
+
+ return theAlgo.shape();
+}
+