Salome HOME
Documentation fixes.
authorspo <sergey.pokhodenko@opencascade.com>
Fri, 18 Sep 2015 09:55:11 +0000 (12:55 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 18 Sep 2015 09:56:25 +0000 (12:56 +0300)
15 files changed:
src/Config/Config_DataModelReader.h
src/Config/Config_XMLReader.h
src/ExchangePlugin/ExchangePlugin_ExportFeature.h
src/ExchangePlugin/ExchangePlugin_ImportFeature.h
src/ExchangePlugin/ExchangePlugin_Plugin.h
src/ExchangePlugin/ExchangePlugin_Tools.h
src/ExchangePlugin/ExchangePlugin_Validators.h
src/ParametersPlugin/ParametersPlugin_EvalListener.cpp
src/ParametersPlugin/ParametersPlugin_EvalListener.h
src/ParametersPlugin/ParametersPlugin_Parameter.h
src/ParametersPlugin/ParametersPlugin_Plugin.h
src/ParametersPlugin/ParametersPlugin_PyInterp.cpp
src/ParametersPlugin/ParametersPlugin_PyInterp.h
src/ParametersPlugin/ParametersPlugin_Validators.cpp
src/ParametersPlugin/ParametersPlugin_Validators.h

index d17f54eaeef01d6dc12b30890fc57c9af9e38015..7af52946e9c3ea99168e7e9ef078fd52df3290fe 100644 (file)
@@ -27,7 +27,6 @@ class Config_DataModelReader : public Config_XMLReader
  public:
   /*!
    * Constructor
-   * \param theXmlFile - full path to the xml file which will be processed by the reader
    */
   CONFIG_EXPORT Config_DataModelReader();
   CONFIG_EXPORT virtual ~Config_DataModelReader();
@@ -118,4 +117,4 @@ private:
 };
 
 
-#endif
\ No newline at end of file
+#endif
index 6cfefc62d854f96122b361d48e47a42b9a048212..258af0cd50535545cfa88b58afc51400464109dd 100644 (file)
@@ -92,7 +92,9 @@ class Config_XMLReader
   std::string restoreAttribute(xmlNodePtr theNode, const char* theNodeAttribute);
   /// Restores an attribute from internal map.
   std::string restoreAttribute(const char* theNodeName, const char* theNodeAttribute);
+  /// Cleanups attribute from cache
   bool cleanupAttribute(xmlNodePtr theNode, const char* theNodeAttribute);
+  /// Cleanups attribute from cache
   bool cleanupAttribute(const char* theNodeName, const char* theNodeAttribute);
 
  protected:
index c653861f329d4aebe273a172bed57f71c0e6e6df..f5c27d0daa574d4af7a0200d25cd5748fcd614d6 100644 (file)
@@ -13,7 +13,8 @@
 
 #include <map>
 
-/**\class ExchangePlugin_ExportFeature
+/**
+ * \class ExchangePlugin_ExportFeature
  * \ingroup Plugins
  * \brief Feature for export shapes to the external files in CAD formats.
  *
@@ -22,6 +23,7 @@
 class ExchangePlugin_ExportFeature : public ModelAPI_Feature
 {
 public:
+  /// Feature kind
   inline static const std::string& ID()
   {
     static const std::string MY_EXPORT_ID("Export");
index 62a7c84b81173465fd8032649b58dc1f3b853967..afb436b19e2d34951b9a3c0f39c4b8d54e020f8a 100644 (file)
@@ -13,7 +13,8 @@
 
 #include <map>
 
-  /**\class ExchangePlugin_ImportFeature
+/**
+ * \class ExchangePlugin_ImportFeature
  * \ingroup Plugins
  * \brief Feature for import shapes from the external files in CAD formats.
  *
@@ -22,7 +23,7 @@
 class ExchangePlugin_ImportFeature : public ModelAPI_Feature
 {
  public:
-  /// Extrusion kind
+  /// Feature kind
   inline static const std::string& ID()
   {
     static const std::string MY_IMPORT_ID("Import");
index 02a536c46cdf3d55a12afb9ab622c5fcef84d768..6f8aa0200c0955d6585d0ae748a48a9f3b79f282 100644 (file)
@@ -11,7 +11,8 @@
 #include <ModelAPI_Plugin.h>
 #include <ModelAPI_Feature.h>
 
-/**\class ExchangePlugin_Plugin
+/**
+ * \class ExchangePlugin_Plugin
  * \ingroup Plugins
  * \brief The main class for management the import and export operations as plugin.
  */
index bc3494229c29fb9fb6d89863f033a135cfbcc749..dc82532665653eaadd80b804bf82b5aaf23b798c 100644 (file)
@@ -12,7 +12,8 @@
 #include <list>
 #include <string>
 
-/**\class ExchangePlugin_Tools
+/**
+ * \class ExchangePlugin_Tools
  * \ingroup Plugins
  * \brief Internal tools for the plugin.
  */
index cf7851e7a7690b624b7f2e9da04d95eacfbf521f..b4b6a437eea922e443293ca1072dbc7336ea4524 100644 (file)
@@ -10,7 +10,8 @@
 #include "ExchangePlugin.h"
 #include <ModelAPI_AttributeValidator.h>
 
-/**\class ExchangePlugin_ImportFormatValidator
+/**
+ * \class ExchangePlugin_FormatValidator
  * \ingroup Validators
  * \brief Validator for the imported formats checking
  *
index 183a027f4962a42e35fc2031ed3da1e4079a978f..3d5212bfb25db258485de23eddf5231d1ebecd68 100644 (file)
@@ -279,7 +279,7 @@ void ParametersPlugin_EvalListener::renameInAttribute(
   }
 }
 
-void ParametersPlugin_EvalListener::renameInDependants(std::shared_ptr<ModelAPI_ResultParameter> theResultParameter,
+void ParametersPlugin_EvalListener::renameInDependents(std::shared_ptr<ModelAPI_ResultParameter> theResultParameter,
                                                        const std::string& theOldName,
                                                        const std::string& theNewName)
 {
@@ -358,7 +358,7 @@ void ParametersPlugin_EvalListener::processObjectRenamedEvent(
     return;
   }
 
-  renameInDependants(aResultParameter, aMessage->oldName(), aMessage->newName());
+  renameInDependents(aResultParameter, aMessage->oldName(), aMessage->newName());
 }
 
 void ParametersPlugin_EvalListener::processReplaceParameterEvent(
@@ -383,5 +383,5 @@ void ParametersPlugin_EvalListener::processReplaceParameterEvent(
   double aRealValue = aResultParameter->data()->real(ModelAPI_ResultParameter::VALUE())->value();
   std::string aValue = toStdString(aRealValue);
 
-  renameInDependants(aResultParameter, aResultParameter->data()->name(), aValue);
+  renameInDependents(aResultParameter, aResultParameter->data()->name(), aValue);
 }
index c24831780ebf1b2cf53dfa7eb8b101867681a94e..96181169a88382d1112348ab5c66fcc975bf59b0 100644 (file)
@@ -17,32 +17,46 @@ class ModelAPI_ResultParameter;
 class ParametersPlugin_Parameter;
 class ParametersPlugin_PyInterp;
 
+/**
+ * \class ParametersPlugin_EvalListener
+ * \ingroup Plugins
+ * \brief Class which process the events from the event loop.
+ */
 class ParametersPlugin_EvalListener : public Events_Listener
 {
  public:
   PARAMETERSPLUGIN_EXPORT ParametersPlugin_EvalListener();
   PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_EvalListener();
 
+  /// Reimplemented from Events_Listener::processEvent().
   PARAMETERSPLUGIN_EXPORT virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
 
  protected:
+  /// Evaluates theExpression and returns its value.
   double evaluate(const std::string& theExpression, std::string& theError, 
                   const std::shared_ptr<ModelAPI_Document>& theDocument);
 
+  /// Processes Evaluation event.
   void processEvaluationEvent(const std::shared_ptr<Events_Message>& theMessage);
+  /// Processes ObjectRenamed event.
   void processObjectRenamedEvent(const std::shared_ptr<Events_Message>& theMessage);
+  /// Processes ReplaceParameter event.
   void processReplaceParameterEvent(const std::shared_ptr<Events_Message>& theMessage);
 
+  /// Renames theOldName in theExpression by theNewName.
   std::string renameInPythonExpression(const std::string& theExpression,
                                        const std::string& theOldName,
                                        const std::string& theNewName);
+  /// Renames theOldName in the expression attribute of theParameter by theNewName.
   void renameInParameter(std::shared_ptr<ParametersPlugin_Parameter> theParameter,
                          const std::string& theOldName,
                          const std::string& theNewName);
+  /// Renames theOldName in the text fields of theAttribute by theNewName.
   void renameInAttribute(std::shared_ptr<ModelAPI_Attribute> theAttribute,
                          const std::string& theOldName,
                          const std::string& theNewName);
-  void renameInDependants(std::shared_ptr<ModelAPI_ResultParameter> theResultParameter,
+  /// Renames theOldName in all dependents of theResultParameter by theNewName.
+  void renameInDependents(std::shared_ptr<ModelAPI_ResultParameter> theResultParameter,
                           const std::string& theOldName,
                           const std::string& theNewName);
 
index 9b029a1564b69e4c874ea63201ff1bdbf6b58cc4..2eef33febd518e7d58328f4c2b106a98f8220beb 100644 (file)
 
 class ParametersPlugin_PyInterp;
 
+/**
+ * \class ParametersPlugin_Parameter
+ * \ingroup Plugins
+ * \brief Feature for parameter.
+ */
 class ParametersPlugin_Parameter : public ModelAPI_Feature
 {
  public:
   virtual ~ParametersPlugin_Parameter();
 
-  /// Extrusion kind
+  /// Feature kind
   inline static const std::string& ID()
   {
     static const std::string MY_PARAMETER_ID("Parameter");
     return MY_PARAMETER_ID;
   }
-  /// attribute name of references sketch entities list, it should contain a sketch result or
-  /// a pair a sketch result to sketch face
+  /// attribute of parameter name
   inline static const std::string& VARIABLE_ID()
   {
     static const std::string MY_VARIABLE_ID("variable");
     return MY_VARIABLE_ID;
   }
-
-  /// attribute name of extrusion size
+  /// attribute of parameter expression
   inline static const std::string& EXPRESSION_ID()
   {
     static const std::string MY_EXPRESSION_ID("expression");
     return MY_EXPRESSION_ID;
   }
-
-  /// attribute name of extrusion size
+  /// attribute of parameter expression error
   inline static const std::string& EXPRESSION_ERROR_ID()
   {
     static const std::string MY_EXPRESSION_ERROR_ID("ExpressionError");
     return MY_EXPRESSION_ERROR_ID;
   }
-
   /// list of references to the arguments of this expression
   inline static const std::string& ARGUMENTS_ID()
   {
@@ -78,8 +79,11 @@ class ParametersPlugin_Parameter : public ModelAPI_Feature
   ParametersPlugin_Parameter();
 
  protected:
+  /// Evaluates theExpression and returns its value.
   double evaluate(const std::string& theExpression, std::string& theError);
+  /// Update name of the parameter
   void updateName();
+  /// Update expression of the parameter
   void updateExpression();
 
  private:
index 280f00903ee9f38e2e46974f3a4f72abd53e73f9..8a14b613de79284b7145ebeeec9d403d99d7a11c 100644 (file)
@@ -9,8 +9,10 @@
 #include <ModelAPI_Plugin.h>
 #include <ModelAPI_Feature.h>
 
-/**\class ParametersPlugin_Plugin
- * TODO: Add documentation
+/**
+ * \class ParametersPlugin_Plugin
+ * \ingroup Plugins
+ * \brief The main class for management of parameter evaluation operations as plugin.
  */
 class ParametersPlugin_Plugin : public ModelAPI_Plugin
 {
@@ -21,6 +23,7 @@ class ParametersPlugin_Plugin : public ModelAPI_Plugin
  public:
   ParametersPlugin_Plugin();
 
+ private:
   std::shared_ptr<ParametersPlugin_EvalListener> myEvalListener;
 };
 
index 021f285527d64c30a06933c345433a28eeff2c68..cc5ff327e587db3775f4abda9b996fc579dfad02 100644 (file)
@@ -93,7 +93,7 @@ std::list<std::string> ParametersPlugin_PyInterp::compile(const std::string& the
   // co_names should be tuple, but can be changed in modern versions of python (>2.7.3)
   if(!PyTuple_Check(aCodeObj->co_names))
     return aResult;
-  
+
   int params_size = PyTuple_Size(aCodeObj->co_names);
   if (params_size > 0) {
     for (int i = 0; i < params_size; i++) {
index 32b5c6d31a7fc19de72e355af8290405a7ad7722..4d019556e65281796c01ac3e359886fd9edf176d 100644 (file)
 #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();
 
+  /// Returns a list of positions for theName in theExpression.
   std::list<std::pair<int, int> > positions(const std::string& theExpression,
                                             const std::string& theName);
-  std::list<std::string> compile(const std::string&);
-  void extendLocalContext(const std::list<std::string>&);
+  /// Compiles theExpression and returns a list of parameters from theExpression.
+  std::list<std::string> compile(const std::string& theExpression);
+  /// Extends local context with the list of parameters with values.
+  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();
 };
 
index 82bd9d8d4d4d97304f65b4408f86bf19602cd1cd..f2a9573846e25afb7472b5b0ca918708a00e1cfb 100644 (file)
@@ -54,7 +54,7 @@ bool ParametersPlugin_VariableValidator::isVariable(const std::string& theString
   return true;
 }
 
-bool ParametersPlugin_VariableValidator::isUnique(const AttributePtr& theAttribute, 
+bool ParametersPlugin_VariableValidator::isUnique(const AttributePtr& theAttribute,
                                                   const std::string& theString) const
 {
   DocumentPtr aDocument = theAttribute->owner()->document();
index b81b1c92c1a5b0c00628c692159ca8af4d79843f..a0551de61f8301321dbc62f086ee349eceaea5b4 100644 (file)
 
 #include <memory>
 
+/**
+ * \class ParametersPlugin_VariableValidator
+ * \ingroup Validators
+ * \brief Validator for the variable name of parameter.
+ */
 class ParametersPlugin_VariableValidator : public ModelAPI_AttributeValidator
 {
  public:
@@ -24,16 +29,24 @@ class ParametersPlugin_VariableValidator : public ModelAPI_AttributeValidator
   //! returns true if attribute is valid
   //! \param theAttribute the checked attribute
   //! \param theArguments arguments of the attribute
+  //! \param theError the error string message if validation fails
   PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
                                                const std::list<std::string>& theArguments,
                                                std::string& theError) const;
 
  protected:
+  /// Returns true if theString is a variable name.
   PARAMETERSPLUGIN_EXPORT bool isVariable(const std::string& theString) const;
-  PARAMETERSPLUGIN_EXPORT bool isUnique(const AttributePtr& theAttribute, 
+  /// Returns true if theString is unique parameter name for theAttribute context.
+  PARAMETERSPLUGIN_EXPORT bool isUnique(const AttributePtr& theAttribute,
                                         const std::string& theString) const;
 };
 
+/**
+ * \class ParametersPlugin_ExpressionValidator
+ * \ingroup Validators
+ * \brief Validator for the expression of parameter.
+ */
 class ParametersPlugin_ExpressionValidator: public ModelAPI_AttributeValidator
 {
  public:
@@ -43,6 +56,7 @@ class ParametersPlugin_ExpressionValidator: public ModelAPI_AttributeValidator
   //! returns true if attribute is valid
   //! \param theAttribute the checked attribute
   //! \param theArguments arguments of the attribute
+  //! \param theError the error string message if validation fails
   PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
                                                const std::list<std::string>& theArguments,
                                                std::string& theError) const;