Salome HOME
PLaneGCSSolver: It is not necessary to adjust Angle constraint (issue #1536)
[modules/shaper.git] / src / ParametersPlugin / ParametersPlugin_PyInterp.h
index 0a631f6e22f42ce3e30251ad9869bc29efd3f12a..6764db13a2112c211243269215043921aee352ba 100644 (file)
 
 #include <list>
 #include <string>
+#include <utility>
 
+/**
+ * \class ParametersPlugin_PyInterp
+ * \ingroup Plugins
+ * \brief Helper class for using Python interpreter.
+ */
 class PARAMETERSPLUGIN_EXPORT ParametersPlugin_PyInterp : public PyInterp_Interp
 {
  public:
   ParametersPlugin_PyInterp();
   virtual ~ParametersPlugin_PyInterp();
 
-  std::list<std::string> compile(const std::string&);
-  void extendLocalContext(const std::list<std::string>&);
+  /// Returns a list of positions for theName in theExpression.
+  std::list<std::pair<int, int> > positions(const std::string& theExpression,
+                                            const std::string& theName);
+  /// Compiles theExpression and returns a list of parameters used in theExpression.
+  std::list<std::string> compile(const std::string& theExpression);
+  /// Extends local context with the list of parameters.
+  void extendLocalContext(const std::list<std::string>& theParameters);
+  /// Clears local context.
   void clearLocalContext();
-  double evaluate(const std::string&, std::string&);
+  /// Evaluates theExpression and returns its value.
+  double evaluate(const std::string& theExpression, std::string& theError);
 
  protected:
+  /// Returns error message.
   std::string errorMessage();
-  // Overrides PyInterp_Interp
+  /// Overrides PyInterp_Interp.
   virtual bool initContext();
+  /// Reimplemented from PyInterp_Interp::closeContext().
   virtual void closeContext();
 };