]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Merge from BR_DumpPython_Extension branch (from tag mergeto_BR_V5_Dev_28Jan09)
authorouv <ouv@opencascade.com>
Wed, 28 Jan 2009 16:32:46 +0000 (16:32 +0000)
committerouv <ouv@opencascade.com>
Wed, 28 Jan 2009 16:32:46 +0000 (16:32 +0000)
58 files changed:
doc/salome/gui/SMESH/images/addnode_notebook.png [new file with mode: 0755]
doc/salome/gui/SMESH/input/adding_nodes_and_elements.doc
doc/salome/gui/SMESH/input/index.doc
doc/salome/gui/SMESH/input/using_notebook_smesh_page.doc [new file with mode: 0644]
idl/SMESH_Hypothesis.idl
idl/SMESH_Mesh.idl
idl/SMESH_MeshEditor.idl
src/SMESH/SMESH_Hypothesis.cxx
src/SMESH/SMESH_Hypothesis.hxx
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI.h
src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx
src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h
src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h
src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionDlg.h
src/SMESHGUI/SMESHGUI_Hypotheses.cxx
src/SMESHGUI/SMESHGUI_Hypotheses.h
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.h
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
src/SMESHGUI/SMESHGUI_MeshPatternDlg.h
src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.h
src/SMESHGUI/SMESHGUI_NodesDlg.cxx
src/SMESHGUI/SMESHGUI_NodesDlg.h
src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
src/SMESHGUI/SMESHGUI_RevolutionDlg.h
src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.h
src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
src/SMESHGUI/SMESHGUI_SmoothingDlg.h
src/SMESHGUI/SMESHGUI_SpinBox.cxx
src/SMESHGUI/SMESHGUI_SpinBox.h
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.h
src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
src/SMESHGUI/SMESHGUI_TranslationDlg.h
src/SMESHGUI/SMESH_msg_en.ts
src/SMESH_I/Makefile.am
src/SMESH_I/SMESH_2smeshpy.cxx
src/SMESH_I/SMESH_Gen_i.hxx
src/SMESH_I/SMESH_Gen_i_1.cxx
src/SMESH_I/SMESH_Hypothesis_i.cxx
src/SMESH_I/SMESH_Hypothesis_i.hxx
src/SMESH_I/SMESH_MeshEditor_i.cxx
src/SMESH_I/SMESH_MeshEditor_i.hxx
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_I/SMESH_Mesh_i.hxx
src/SMESH_I/SMESH_NoteBook.cxx [new file with mode: 0644]
src/SMESH_I/SMESH_NoteBook.hxx [new file with mode: 0644]
src/SMESH_SWIG/smeshDC.py
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.h
src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h

diff --git a/doc/salome/gui/SMESH/images/addnode_notebook.png b/doc/salome/gui/SMESH/images/addnode_notebook.png
new file mode 100755 (executable)
index 0000000..4abab33
Binary files /dev/null and b/doc/salome/gui/SMESH/images/addnode_notebook.png differ
index fc727701b3ae3fb4812bbbef907a4477c9391bce..179e7885ab69ba13dff0a32d41ca683237758b1a 100644 (file)
@@ -43,6 +43,11 @@ created:
 
 \image html add_node.png
 
+\note You can also use variables defined in the SALOME \b NoteBook
+to specify coordinates of the node:
+
+\image html addnode_notebook.png
+
 <br>
 \anchor adding_edges_anchor
 <h2>Adding edges</h2>
index cea4b5462743ec26a6d726cfcb2154cc327d05c6..2de722d16115cc472b5c69c44fda05ad969dc302 100644 (file)
@@ -16,6 +16,7 @@ the VTK viewer;</li>
 allowing to highlight important elements:
 <li>\subpage modifying_meshes_page "modifying meshes" with a vast
 array of dedicated operations.</li> 
+<li>\subpage using_notebook_mesh_page.</li>
 </ul>
 
 Almost all mesh module functionalities are accessible via
diff --git a/doc/salome/gui/SMESH/input/using_notebook_smesh_page.doc b/doc/salome/gui/SMESH/input/using_notebook_smesh_page.doc
new file mode 100644 (file)
index 0000000..2968a27
--- /dev/null
@@ -0,0 +1,33 @@
+/*!
+
+\page using_notebook_mesh_page Using SALOME NoteBook
+
+It is possible to use variables defined through <b>SALOME NoteBook</b> for
+creation and modification of objects in the MESH module with the following
+limitations:
+
+<ul>
+<li> \ref radial_prism_algo_page "Distribution of Layers" hypothesis -
+     parametrical values are correctly applied, but they are not restored
+     after "Update study" operation.
+<li> \ref a1d_meshing_hypo_page "Number of Segments" hypothesis, Distribution
+     with Table Density and Distribution with Analytic Density - parametrical
+     values are not applicable.
+<li> \ref translation_page "Translation" dialog box, default mode
+     (translation by two points) - parametrical values are correctly applied,
+     but they are not restored after "Update study" operation.
+<li> \ref merging_nodes_page "Merging nodes" dialog box - parametrical value
+     (tolerance of coincident nodes detection) is correctly applied,
+     but it is not restored after "Update study" operation.
+<li> \ref revolution_page "Revolution" dialog box - it is impossible to
+     use the angle of revolution as "total angle" if it is defined as variable.
+<li> \ref extrusion_along_path_page "Extrusion along a path" dialog box - it is
+     impossible to use "Linear variation of the angles" mode if at least one of
+     those angles is defined as variable.
+<li> \ref pattern_mapping_page "Pattern mapping" dialog box - parametrical
+     values (indices of nodes) are correctly applied, but they are not restored
+     after "Update study" operation.
+<li> \ref clipping_page "Clipping" dialog box.
+<li> <b>Colors / Size</b> dialog box.
+</ul>
+*/
index 8694f49e79fd6f7c3fe8d09bc27d974de24eeb26..56ae48b0cfed28db8767c589560f11ab2949c2ba 100644 (file)
@@ -39,8 +39,11 @@ module SMESH
     DIM_3D
   };
   
+  typedef sequence<string> ListOfParameters;
+
   interface SMESH_Hypothesis : SALOME::GenericObj
   {
+    
     /*!
      * Get the Hypothesis typeName 
      */
@@ -55,7 +58,36 @@ module SMESH
      * Get the internal Id 
      */
     long GetId();
+
+    /*!
+     *  Set list of parameters
+     *  \param theParameters is a string containing the notebook variables separated by ":" symbol,
+     *         used for Hypothesis creation
+     */
+    void SetParameters (in string theParameters);
+
+    /*!
+     *  Return list of notebook variables used for Hypothesis creation separated by ":" symbol
+     */
+    string GetParameters();
+
+    /*!
+     *  Return list of last notebook variables used for Hypothesis creation.
+     */
+    ListOfParameters GetLastParameters();
+
+    /*!
+     *  Set list of parameters
+     *  \param theParameters is a string containing the last notebook variables separated by ":" symbol,
+     *         used for Hypothesis creation
+     */
+    void SetLastParameters(in string theParameters);
     
+    /*!
+     * Clear parameters list
+     */
+    void ClearParameters();
+
     /*!
      * Verify whether hypothesis supports given entity type 
      */
index 9b5b3477e3136090105f0c786c3d0ec7b28036b8..fa5180a24d6f52d690eef70b88f991b70142ef36 100644 (file)
@@ -718,6 +718,22 @@ module SMESH
 
     /*! Gets information about imported MED file */
     SALOME_MED::MedFileInfo GetMEDFileInfo();
+
+    /*!
+     *  Sets list of notebook variables used for Mesh operations separated by ":" symbol
+     *  \param theParameters is a string containing the notebook variables
+     */
+    void SetParameters (in string theParameters);
+
+    /*!
+     *  Returns list of notebook variables used for Mesh operations separated by ":" symbol
+     */
+    string GetParameters();
+
+    /*!
+     *  Returns list of notebook variables used for last Mesh operation
+     */
+    string_array GetLastParameters();
   };
 
   interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource
index bba45665bbf0910073401444422bdcea8afd695c..0a4b5b7cd4e8e464114a8fc22cd669b52f632227 100644 (file)
@@ -281,6 +281,48 @@ module SMESH
                                                in double          AngleInRadians,
                                                in long            NbOfSteps,
                                                in double          Tolerance);
+    /*!
+     * \brief Genarate dim+1 elements by rotation of the object around axis
+     * \param theObject - object containing elements to ratate
+     * \param Axix - rotation axis
+     * \param AngleInRadians - rotation angle
+     * \param NbOfSteps - number of elements to generate from one element
+     */
+    void RotationSweepObject1D(in SMESH_IDSource  theObject,
+                              in AxisStruct      Axix,
+                              in double          AngleInRadians,
+                              in long            NbOfSteps,
+                              in double          Tolerance);
+    /*!
+     * \brief Same as previous but additionally create groups of elements
+     *  generated from elements belonging to preexisting groups
+     */
+    ListOfGroups RotationSweepObject1DMakeGroups(in SMESH_IDSource  theObject,
+                                                in AxisStruct      Axix,
+                                                in double          AngleInRadians,
+                                                in long            NbOfSteps,
+                                                in double          Tolerance);
+    /*!
+     * \brief Genarate dim+1 elements by rotation of the object around axis
+     * \param theObject - object containing elements to ratate
+     * \param Axix - rotation axis
+     * \param AngleInRadians - rotation angle
+     * \param NbOfSteps - number of elements to generate from one element
+     */
+    void RotationSweepObject2D(in SMESH_IDSource  theObject,
+                              in AxisStruct      Axix,
+                              in double          AngleInRadians,
+                              in long            NbOfSteps,
+                              in double          Tolerance);
+    /*!
+     * \brief Same as previous but additionally create groups of elements
+     *  generated from elements belonging to preexisting groups
+     */
+    ListOfGroups RotationSweepObject2DMakeGroups(in SMESH_IDSource  theObject,
+                                                in AxisStruct      Axix,
+                                                in double          AngleInRadians,
+                                                in long            NbOfSteps,
+                                                in double          Tolerance);
     /*!
      * \brief Genarate dim+1 elements by extrusion of elements along vector
      * \param IDsOfElements - elements to sweep
@@ -386,6 +428,42 @@ module SMESH
                                                     in PointStruct       RefPoint,
                                                     out Extrusion_Error  Error);
 
+    Extrusion_Error ExtrusionAlongPathObject1D(in SMESH_IDSource    theObject,
+                                              in SMESH_Mesh        PathMesh,
+                                              in GEOM::GEOM_Object PathShape,
+                                              in long              NodeStart,
+                                              in boolean           HasAngles,
+                                              in double_array      Angles,
+                                              in boolean           HasRefPoint,
+                                              in PointStruct       RefPoint);
+    ListOfGroups ExtrusionAlongPathObject1DMakeGroups(in SMESH_IDSource    theObject,
+                                                     in SMESH_Mesh        PathMesh,
+                                                     in GEOM::GEOM_Object PathShape,
+                                                     in long              NodeStart,
+                                                     in boolean           HasAngles,
+                                                     in double_array      Angles,
+                                                     in boolean           HasRefPoint,
+                                                     in PointStruct       RefPoint,
+                                                     out Extrusion_Error  Error);
+
+    Extrusion_Error ExtrusionAlongPathObject2D(in SMESH_IDSource    theObject,
+                                              in SMESH_Mesh        PathMesh,
+                                              in GEOM::GEOM_Object PathShape,
+                                              in long              NodeStart,
+                                              in boolean           HasAngles,
+                                              in double_array      Angles,
+                                              in boolean           HasRefPoint,
+                                              in PointStruct       RefPoint);
+    ListOfGroups ExtrusionAlongPathObject2DMakeGroups(in SMESH_IDSource    theObject,
+                                                     in SMESH_Mesh        PathMesh,
+                                                     in GEOM::GEOM_Object PathShape,
+                                                     in long              NodeStart,
+                                                     in boolean           HasAngles,
+                                                     in double_array      Angles,
+                                                     in boolean           HasRefPoint,
+                                                     in PointStruct       RefPoint,
+                                                     out Extrusion_Error  Error);
+
    /*!
     * Compute rotation angles for ExtrusionAlongPath as linear variation
     * of given angles along path steps
index 147b0c2bf5fb07ba836e165db253eb83add99e40..4b288a0d90311b7285255ff45bb3537ee7fd1c29 100644 (file)
@@ -50,6 +50,7 @@ SMESH_Hypothesis::SMESH_Hypothesis(int hypId,
   _type = PARAM_ALGO;
   _shapeType = 0; // to be set by algo with TopAbs_Enum
   _param_algo_dim = -1; // to be set by algo parameter
+  _parameters = string();
 }
 
 //=============================================================================
@@ -149,3 +150,59 @@ void SMESH_Hypothesis::SetLibName(const char* theLibName)
 {
   _libName = string(theLibName);
 }
+
+//=============================================================================
+/*!
+ * 
+ */
+//=============================================================================
+void SMESH_Hypothesis::SetParameters(const char *theParameters)
+{
+  string aNewParameters(theParameters);
+  if(aNewParameters.size()==0 && _parameters.size()==0)
+    aNewParameters = " ";
+  if(_parameters.size()>0)
+    _parameters +="|";
+  _parameters +=aNewParameters;
+  SetLastParameters(theParameters);
+}
+
+//=============================================================================
+/*!
+ * 
+ */
+//=============================================================================
+void SMESH_Hypothesis::ClearParameters()
+{
+  _parameters = string();
+}
+
+//=============================================================================
+/*!
+ * 
+ */
+//=============================================================================
+char* SMESH_Hypothesis::GetParameters() const
+{
+  return (char*)_parameters.c_str();
+}
+
+//=============================================================================
+/*!
+ * 
+ */
+//=============================================================================
+char* SMESH_Hypothesis::GetLastParameters() const
+{
+  return (char*)_lastParameters.c_str();
+}
+
+//=============================================================================
+/*!
+ * 
+ */
+//=============================================================================
+void SMESH_Hypothesis::SetLastParameters(const char* theParameters)
+{
+  _lastParameters = string(theParameters);
+}
index d62f22352e91d93af46ea5cfdbc2d5869722bd04..55ed9dd5fb2f84970161c6d1c523350965caa0db 100644 (file)
@@ -77,6 +77,13 @@ public:
   virtual const char* GetLibName() const;
   void  SetLibName(const char* theLibName);
 
+  void  SetParameters(const char *theParameters);
+  char* GetParameters() const;
+
+  void SetLastParameters(const char* theParameters);
+  char* GetLastParameters() const;
+  void ClearParameters();
+  
   /*!
    * \brief Initialize my parameter values by the mesh built on the geometry
    *  \param theMesh - the built mesh
@@ -115,6 +122,8 @@ protected:
 
 private:
   std::string _libName;
+  std::string _parameters;
+  std::string _lastParameters;
 };
 
 #endif
index f13ba84a5d2ef1eb79b39eb30d346c53fe07072a..50f44fb18b8fc5def2e34667645a29a6df991ce4 100644 (file)
@@ -1270,6 +1270,16 @@ SalomeApp_Study* SMESHGUI::activeStudy()
     return NULL;
 }
 
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+char* SMESHGUI::JoinObjectParameters(const QStringList& theParametersList)
+{
+  return theParametersList.join(":").toLatin1().data();
+}
+
 //=============================================================================
 /*!
  *
index d8cb5eb975e65f41b82367b2a647c9ab311e6aa6..230bc3162a7f79c4aa712c76258c64cc71d7dc68 100644 (file)
@@ -70,6 +70,8 @@ public :
   static SUIT_ResourceMgr*        resourceMgr();
   static SUIT_Desktop*            desktop();
   static SalomeApp_Study*         activeStudy();
+  static char*                    JoinObjectParameters(const QStringList& theParametersList);
+  
   bool                            isActiveStudyLocked();
 
   static bool                     automaticUpdate();
index 0e1b3f250518aef07a804254c1495f712841a424..2d6b7435bfb7dbc0b048ddf0f0a4495e9904e29a 100644 (file)
@@ -285,7 +285,13 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
 {
   if (mySMESHGUI->isActiveStudyLocked())
     return false;
+
+  if (!isValid())
+    return false;
+
   if (!myMesh->_is_nil()) {
+    QStringList aParameters;
+    aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
     try        {
       SUIT_OverrideCursor aWaitCursor;
 
@@ -303,6 +309,8 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
                                               CheckBoxMerge->isChecked(), 
                                               SpinBoxTol->GetValue());
      
+      aCompoundMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+
       SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text() );
       mySMESHGUI->updateObjBrowser();
     } catch(...) {
@@ -483,6 +491,30 @@ void SMESHGUI_BuildCompoundDlg::keyPressEvent( QKeyEvent* e )
 //=================================================================================
 void SMESHGUI_BuildCompoundDlg::onSelectMerge(bool toMerge)
 {
+  
   TextLabelTol->setEnabled(toMerge);
   SpinBoxTol->setEnabled(toMerge);
+  if(!toMerge)
+    SpinBoxTol->SetValue(1e-05);
+}
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool SMESHGUI_BuildCompoundDlg::isValid()
+{
+  QString msg;
+  bool ok=true;
+  if(CheckBoxMerge->isChecked())
+    ok = SpinBoxTol->isValid( msg, true );
+
+  if( !ok ) {
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    return false;
+  }
+  return true;
 }
index 2acfe5ea033cc4ee280b65111319839a4b5369db..c1085739d8d5d6ff9cfa444e341714efd464ab7d 100644 (file)
@@ -72,6 +72,8 @@ private:
   void                    hideEvent( QHideEvent* );          /* ESC key */
   void                    keyPressEvent( QKeyEvent* );
 
+  bool                    isValid();
+  
 private:
   SMESHGUI*               mySMESHGUI;     /* Current SMESHGUI object */
   LightApp_SelectionMgr*  mySelectionMgr; /* User shape selection */
index 8044fe73bfd0e56e71f4b47478f983d606be5ff3..a8cffc9e3230a998d426ca7b285f8d7c2799af95 100644 (file)
@@ -487,47 +487,12 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
       !myMeshActor || myPathMesh->_is_nil() || myPathShape->_is_nil())
     return false;
 
-  SMESH::long_array_var anElementsId = new SMESH::long_array;
+  if (!isValid())
+    return false;
 
-  if (MeshCheck->isChecked()) {
-    // If "Select whole mesh, submesh or group" check box is on ->
-    // get all elements of the required type from the object selected
+  SMESH::long_array_var anElementsId = new SMESH::long_array;
 
-    // if MESH object is selected
-    if (!CORBA::is_nil(SMESH::SMESH_Mesh::_narrow(myIDSource))) {
-      // get mesh
-      SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(myIDSource);
-      // get IDs from mesh...
-      if (Elements1dRB->isChecked())
-       // 1d elements
-       anElementsId = aMesh->GetElementsByType(SMESH::EDGE);
-      else if (Elements2dRB->isChecked()) {
-       anElementsId = aMesh->GetElementsByType(SMESH::FACE);
-      }
-    }
-    // SUBMESH is selected
-    if (!CORBA::is_nil(SMESH::SMESH_subMesh::_narrow(myIDSource))) {
-      // get submesh
-      SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(myIDSource);
-      // get IDs from submesh
-      if (Elements1dRB->isChecked())
-       // 1d elements
-       anElementsId = aSubMesh->GetElementsByType(SMESH::EDGE);
-      else if (Elements2dRB->isChecked())
-       // 2d elements
-       anElementsId = aSubMesh->GetElementsByType(SMESH::FACE);
-    }
-    // GROUP is selected
-    if (!CORBA::is_nil(SMESH::SMESH_GroupBase::_narrow(myIDSource))) {
-      // get smesh group
-      SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(myIDSource);
-      // get IDs from group
-      // 1d elements or 2d elements
-      if (Elements1dRB->isChecked() && aGroup->GetType() == SMESH::EDGE ||
-         Elements2dRB->isChecked() && aGroup->GetType() == SMESH::FACE)
-       anElementsId = aGroup->GetListOfID();
-    }
-  } else {
+  if (!MeshCheck->isChecked()) {
     // If "Select whole mesh, submesh or group" check box is off ->
     // use only elements of given type selected by user
 
@@ -552,10 +517,10 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
       }
       anElementsId->length(j);
     }
-  }
 
-  if (anElementsId->length() <= 0) {
-    return false;
+    if (anElementsId->length() <= 0) {
+      return false;
+    }
   }
 
   if (StartPointLineEdit->text().trimmed().isEmpty()) {
@@ -568,16 +533,17 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
     return false;
   }
 
+  QStringList aParameters;
+
   // get angles
   SMESH::double_array_var anAngles = new SMESH::double_array;
   if (AnglesGrp->isChecked()) {
-    anAngles->length(AnglesList->count());
+    anAngles->length(myAnglesList.count());
     int j = 0;
-    bool bOk;
-    for (int i = 0; i < AnglesList->count(); i++) {
-      double angle = AnglesList->item(i)->text().toDouble(&bOk);
-      if  (bOk)
-       anAngles[ j++ ] = angle*PI/180;
+    for (int i = 0; i < myAnglesList.count(); i++) {
+      double angle = myAnglesList[i];
+      anAngles[ j++ ] = angle*PI/180;
+      aParameters << AnglesList->item(i)->text();
     }
     anAngles->length(j);
   }
@@ -590,6 +556,10 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
     aBasePoint.z = ZSpin->GetValue();
   }
 
+  aParameters << XSpin->text();
+  aParameters << YSpin->text();
+  aParameters << ZSpin->text();
+
   try {
     SUIT_OverrideCursor wc;
     SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
@@ -597,17 +567,50 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
       anAngles = aMeshEditor->LinearAnglesVariation( myPathMesh, myPathShape, anAngles );
 
     SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
-    if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
-      SMESH::ListOfGroups_var groups = 
-        aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
-                                                  myPathShape, aNodeStart,
-                                                  AnglesGrp->isChecked(), anAngles,
-                                                  BasePointGrp->isChecked(), aBasePoint, retVal);
-    else
-      retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
-                                               myPathShape, aNodeStart,
-                                               AnglesGrp->isChecked(), anAngles,
-                                               BasePointGrp->isChecked(), aBasePoint);
+    if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
+      if( MeshCheck->isChecked() ) {
+       if( GetConstructorId() == 0 )
+         SMESH::ListOfGroups_var groups = 
+           aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh,
+                                                             myPathShape, aNodeStart,
+                                                             AnglesGrp->isChecked(), anAngles,
+                                                             BasePointGrp->isChecked(), aBasePoint, retVal);
+       else
+         SMESH::ListOfGroups_var groups = 
+           aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh,
+                                                             myPathShape, aNodeStart,
+                                                             AnglesGrp->isChecked(), anAngles,
+                                                             BasePointGrp->isChecked(), aBasePoint, retVal);
+      }
+      else
+       SMESH::ListOfGroups_var groups = 
+         aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
+                                                   myPathShape, aNodeStart,
+                                                   AnglesGrp->isChecked(), anAngles,
+                                                   BasePointGrp->isChecked(), aBasePoint, retVal);
+    }
+    else {
+      if( MeshCheck->isChecked() ) {
+       if( GetConstructorId() == 0 )
+         retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh,
+                                                          myPathShape, aNodeStart,
+                                                          AnglesGrp->isChecked(), anAngles,
+                                                          BasePointGrp->isChecked(), aBasePoint);
+       else
+         retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh,
+                                                          myPathShape, aNodeStart,
+                                                          AnglesGrp->isChecked(), anAngles,
+                                                          BasePointGrp->isChecked(), aBasePoint);
+      }
+      else
+       retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
+                                                myPathShape, aNodeStart,
+                                                AnglesGrp->isChecked(), anAngles,
+                                                BasePointGrp->isChecked(), aBasePoint);
+    }
+
+    if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK )
+      myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
 
     //wc.stop();
     wc.suspend();
@@ -1152,7 +1155,18 @@ int SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId()
 //=======================================================================
 void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded()
 {
-  AnglesList->addItem(QString::number(AngleSpin->GetValue()));
+  QString msg;
+  if( !AngleSpin->isValid( msg, true ) ) {
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    return;
+  }
+  AnglesList->addItem(AngleSpin->text());
+  myAnglesList.append(AngleSpin->GetValue());
+
+  updateLinearAngles();
 }
 
 //=======================================================================
@@ -1163,7 +1177,12 @@ void SMESHGUI_ExtrusionAlongPathDlg::OnAngleRemoved()
 {
   QList<QListWidgetItem*> aList = AnglesList->selectedItems();
   QListWidgetItem* anItem;
-  foreach(anItem, aList) delete anItem;
+  foreach(anItem, aList) {
+    myAnglesList.removeAt(AnglesList->row(anItem));
+    delete anItem;
+  }
+
+  updateLinearAngles();
 }
 
 //=================================================================================
@@ -1233,3 +1252,45 @@ void SMESHGUI_ExtrusionAlongPathDlg::setFilters()
 
   myFilterDlg->show();
 }
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool SMESHGUI_ExtrusionAlongPathDlg::isValid()
+{
+  QString msg;
+  bool ok = true;
+  ok = XSpin->isValid( msg, true ) && ok;
+  ok = YSpin->isValid( msg, true ) && ok;
+  ok = ZSpin->isValid( msg, true ) && ok;
+
+  if( !ok ) {
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    return false;
+  }
+  return true;
+}
+
+//=================================================================================
+// function : updateLinearAngles
+// purpose  :
+//=================================================================================
+void SMESHGUI_ExtrusionAlongPathDlg::updateLinearAngles()
+{
+  bool enableLinear = true;
+  for( int row = 0, nbRows = AnglesList->count(); row < nbRows; row++ ) {
+    if( QListWidgetItem* anItem = AnglesList->item( row ) ) {
+      enableLinear = false;
+      anItem->text().toDouble(&enableLinear);
+      if( !enableLinear )
+       break;
+    }
+  }
+  if( !enableLinear )
+    LinearAnglesCheck->setChecked( false );
+  LinearAnglesCheck->setEnabled( enableLinear );
+}
index 9ca43c0d10fc5af1555c8a566933ec5b1579ae33..4e1cbcb9c05ff4cb4ee2d7642a02299b1f864dda 100644 (file)
@@ -79,6 +79,10 @@ private:
   int                       GetConstructorId();
   void                      SetEditCurrentArgument( QToolButton* );
 
+  bool                      isValid();
+
+  void                      updateLinearAngles();
+  
   SMESHGUI*                 mySMESHGUI;            /* Current SMESHGUI object */
   SMESHGUI_IdValidator*     myIdValidator;
   LightApp_SelectionMgr*    mySelectionMgr;        /* User shape selection */
@@ -95,6 +99,7 @@ private:
   SUIT_SelectionFilter*     myElementsFilter;
   SUIT_SelectionFilter*     myPathMeshFilter;
   int                       myType;
+  QList<double>             myAnglesList;
 
   // widgets
   QGroupBox*                ConstructorsBox;
index a6f1a1ccac33c0d6712625e6345425bd59517e8b..0626e4575c3b4e4e3adf984e833b58f4f9ac0303 100644 (file)
@@ -53,6 +53,8 @@
 #include <SVTK_ViewModel.h>
 #include <SVTK_ViewWindow.h>
 
+#include <SalomeApp_IntSpinBox.h>
+
 // OCCT includes
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_IndexedMapOfInteger.hxx>
@@ -67,7 +69,6 @@
 #include <QPushButton>
 #include <QRadioButton>
 #include <QCheckBox>
-#include <QSpinBox>
 #include <QHBoxLayout>
 #include <QVBoxLayout>
 #include <QGridLayout>
@@ -89,7 +90,8 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-    myFilterDlg( 0 )
+    myFilterDlg( 0 ),
+    mySelectedObject(SMESH::SMESH_IDSource::_nil())
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
@@ -197,7 +199,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
 
   // Controls for nb. steps defining
   TextLabelNbSteps = new QLabel(tr("SMESH_NUMBEROFSTEPS"), GroupArguments);
-  SpinBox_NbSteps = new QSpinBox(GroupArguments);
+  SpinBox_NbSteps = new SalomeApp_IntSpinBox(GroupArguments);
 
   // CheckBox for groups generation
   MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
@@ -404,6 +406,9 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
   if (mySMESHGUI->isActiveStudyLocked())
     return false;
 
+  if (!isValid())
+    return false;
+
   if (myNbOkElements) {
     
     gp_XYZ aNormale(SpinBox_Vx->GetValue(),
@@ -419,15 +424,41 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
 
     long aNbSteps = (long)SpinBox_NbSteps->value();
 
+    QStringList aParameters;
+    aParameters << SpinBox_Dx->text();
+    aParameters << SpinBox_Dy->text();
+    aParameters << SpinBox_Dz->text();
+    aParameters << SpinBox_NbSteps->text();
+
     try {
       SUIT_OverrideCursor aWaitCursor;
       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
 
-      if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
-        SMESH::ListOfGroups_var groups = 
-          aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
-      else
-        aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
+      if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
+        if( CheckBoxMesh->isChecked() ) {
+         if( GetConstructorId() == 0 )
+           SMESH::ListOfGroups_var groups = 
+             aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
+         else
+           SMESH::ListOfGroups_var groups = 
+             aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
+       }
+       else
+         SMESH::ListOfGroups_var groups = 
+           aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
+      }
+      else {
+       if( CheckBoxMesh->isChecked() ) {
+         if( GetConstructorId() == 0 )
+           aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
+         else
+           aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
+       }
+       else
+         aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
+      }
+
+      myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
 
     } catch (...) {
     }
@@ -437,6 +468,7 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
       mySMESHGUI->updateObjBrowser(true); // new groups may appear
     Init(false);
     ConstructorsClicked(GetConstructorId());
+    mySelectedObject = SMESH::SMESH_IDSource::_nil();
     SelectionIntoArgument();
   }
   return true;
@@ -603,41 +635,21 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument()
     }
 
     if (CheckBoxMesh->isChecked()) {
-      SMESH::ElementType neededType = GetConstructorId() ? SMESH::FACE : SMESH::EDGE;
-
       SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
 
-      SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
-
-      if (!mesh->_is_nil()) { //MESH
-        // get elements from mesh
-          myElementsId = mesh->GetElementsByType(neededType);
-          aNbElements = myElementsId->length();
-      } else {
-        SMESH::SMESH_subMesh_var aSubMesh =
-          SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
-        
-        if (!aSubMesh->_is_nil()) { //SUBMESH
-          // get IDs from submesh
-          myElementsId = aSubMesh->GetElementsByType(neededType);
-          aNbElements = myElementsId->length();
-        } else {
-          SMESH::SMESH_GroupBase_var aGroup = 
-            SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
-
-          if (!aGroup->_is_nil() && aGroup->GetType() == neededType) { // GROUP
-            // get IDs from smesh group
-            myElementsId = aGroup->GetListOfID();
-            aNbElements = myElementsId->length();
-          }
-        }
-      }
+      if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
+        mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
+      else
+        return;
     } else {
       // get indices of selcted elements
       TColStd_IndexedMapOfInteger aMapIndex;
       mySelector->GetIndex(IO,aMapIndex);
       aNbElements = aMapIndex.Extent();
 
+      if (aNbElements < 1)
+       return;
+
       myElementsId = new SMESH::long_array;
       myElementsId->length( aNbElements );
       aString = "";
@@ -645,9 +657,6 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument()
         aString += QString(" %1").arg( myElementsId[ i ] = aMapIndex( i+1 ) );
     }
 
-    if (aNbElements < 1)
-      return;
-
     myNbOkElements = true;
 
     myBusy = true;
@@ -856,3 +865,26 @@ void SMESHGUI_ExtrusionDlg::setFilters()
 
   myFilterDlg->show();
 }
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool SMESHGUI_ExtrusionDlg::isValid()
+{
+  QString msg;
+  bool ok = true;
+  ok = SpinBox_Dx->isValid( msg, true ) && ok;
+  ok = SpinBox_Dy->isValid( msg, true ) && ok;
+  ok = SpinBox_Dz->isValid( msg, true ) && ok;
+  ok = SpinBox_NbSteps->isValid( msg, true ) && ok;
+
+  if( !ok ) {
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    return false;
+  }
+  return true;
+}
index ee3ec9cb5926deb8d9b9280dbe24b1e007021003..99468eaa7dba01107f5183921bd5736015cceb2f 100644 (file)
@@ -45,7 +45,6 @@ class QGroupBox;
 class QLabel;
 class QLineEdit;
 class QCheckBox;
-class QSpinBox;
 class QPushButton;
 
 class SMESHGUI;
@@ -56,6 +55,7 @@ class SMESHGUI_FilterDlg;
 class SVTK_Selector;
 class LightApp_SelectionMgr;
 class SUIT_SelectionFilter;
+class SalomeApp_IntSpinBox;
 
 //=================================================================================
 // class    : SMESHGUI_ExtrusionDlg
@@ -75,6 +75,8 @@ private:
   void                             keyPressEvent( QKeyEvent* );
   int                              GetConstructorId();
 
+  bool                             isValid();
+  
   SMESHGUI*                        mySMESHGUI;            /* Current SMESHGUI object */
   SMESHGUI_IdValidator*            myIdValidator;
   LightApp_SelectionMgr*           mySelectionMgr;        /* User shape selection */
@@ -82,6 +84,8 @@ private:
   int                              myNbOkElements;        /* to check when elements are defined */
   SVTK_Selector*                   mySelector;
 
+  SMESH::SMESH_IDSource_var        mySelectedObject;
+
   bool                             myBusy;
   SMESH::SMESH_Mesh_var            myMesh;
   SMESH::long_array_var            myElementsId;
@@ -116,7 +120,7 @@ private:
   QLabel*                          TextLabelVz;
   SMESHGUI_SpinBox*                SpinBox_Vz;
   QLabel*                          TextLabelNbSteps;
-  QSpinBox*                        SpinBox_NbSteps;
+  SalomeApp_IntSpinBox*            SpinBox_NbSteps;
   QCheckBox*                       MakeGroupsCheck;
 
   QGroupBox*                       GroupButtons;
index 4ebd58629060fee2dbdade3741ee1129e4885b3e..8ca61f49fd0876129aa798574a258fe0377360c6 100644 (file)
 #include <utilities.h>
 
 // SALOME GUI includes
-#include <QtxIntSpinBox.h>
 #include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 #include <LightApp_Application.h>
+#include <SalomeApp_IntSpinBox.h>
 
 // Qt includes
 #include <QFrame>
@@ -211,7 +211,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
       {
       case QVariant::Int:
         {
-          QtxIntSpinBox* sb = new QtxIntSpinBox( GroupC1 );
+          SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
          sb->setObjectName( (*anIt).myName );
           attuneStdWidget( sb, i );
           sb->setValue( (*anIt).myValue.toInt() );
@@ -221,7 +221,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
         break;
       case QVariant::Double:
         {
-          QtxDoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
+          SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
          sb->setObjectName( (*anIt).myName );
           attuneStdWidget( sb, i );
           sb->setValue( (*anIt).myValue.toDouble() );
@@ -231,12 +231,34 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
         break;
       case QVariant::String:
         {
-          QLineEdit* le = new QLineEdit( GroupC1 );
-         le->setObjectName( (*anIt).myName );
-          attuneStdWidget( le, i );
-          le->setText( (*anIt).myValue.toString() );
-          connect( le, SIGNAL( textChanged( const QString& ) ), this, SLOT( onValueChanged() ) );
-          w = le;
+          if((*anIt).isVariable) {
+            _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+            QString aVar = (*anIt).myValue.toString();
+            if(aStudy->IsInteger(aVar.toLatin1().constData())){
+              SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
+              sb->setObjectName( (*anIt).myName );
+              attuneStdWidget( sb, i );
+              sb->setText( aVar );
+              connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
+              w = sb;
+            }
+            else if(aStudy->IsReal(aVar.toLatin1().constData())){
+              SalomeApp_DoubleSpinBox* sb = new SalomeApp_DoubleSpinBox( GroupC1 );
+              sb->setObjectName( (*anIt).myName );
+              attuneStdWidget( sb, i );
+              sb->setText( aVar );
+              connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
+              w = sb;
+            }
+          }
+          else {
+            QLineEdit* le = new QLineEdit( GroupC1 );
+            le->setObjectName( (*anIt).myName );
+            attuneStdWidget( le, i );
+            le->setText( (*anIt).myValue.toString() );
+            connect( le, SIGNAL( textChanged( const QString& ) ), this, SLOT( onValueChanged() ) );
+            w = le;
+          }
         }
         break;
       }
@@ -279,16 +301,16 @@ bool SMESHGUI_GenericHypothesisCreator::getStdParamFromDlg( ListOfStdParams& par
   for( ; anIt!=aLast; anIt++ )
   {
     item.myName = (*anIt)->objectName();
-    if( (*anIt)->inherits( "QtxIntSpinBox" ) )
+    if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) )
     {
-      QtxIntSpinBox* sb = ( QtxIntSpinBox* )( *anIt );
+      SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
       item.myValue = sb->value();
       params.append( item );
     }
     
-    else if( (*anIt)->inherits( "QtxDoubleSpinBox" ) )
+    else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
     {
-      QtxDoubleSpinBox* sb = ( QtxDoubleSpinBox* )( *anIt );
+      SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
       item.myValue = sb->value();
       params.append( item );
     }
@@ -311,6 +333,24 @@ bool SMESHGUI_GenericHypothesisCreator::getStdParamFromDlg( ListOfStdParams& par
   return res;
 }
 
+
+QStringList SMESHGUI_GenericHypothesisCreator::getVariablesFromDlg() const
+{
+  QStringList aResult;
+  ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
+  for( ; anIt!=aLast; anIt++ ) {
+    if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) ) {
+      SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
+      aResult.append(sb->text());
+    } 
+    else if( (*anIt)->inherits( "QtxDoubleSpinBox" ) ) {
+      QtxDoubleSpinBox* sb = ( QtxDoubleSpinBox* )( *anIt );
+      aResult.append(sb->text());
+    } 
+  }
+  return aResult;
+}
+
 QString SMESHGUI_GenericHypothesisCreator::stdParamValues( const ListOfStdParams& params)
 {
   QString valueStr = "";
@@ -428,6 +468,26 @@ bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget( StdParam&, QWi
   return false;
 }
 
+bool SMESHGUI_GenericHypothesisCreator::checkParams( QString& msg ) const
+{
+  bool ok = true;
+  ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
+  for( ; anIt!=aLast; anIt++ )
+  {
+    if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) )
+    {
+      SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
+      ok = sb->isValid( msg, true ) && ok;
+    }
+    else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
+    {
+      SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
+      ok = sb->isValid( msg, true ) && ok;
+    }
+  }
+  return ok;
+}
+
 void SMESHGUI_GenericHypothesisCreator::onReject()
 {
 }
@@ -520,8 +580,15 @@ void SMESHGUI_HypothesisDlg::setCustomFrame( QFrame* f )
 
 void SMESHGUI_HypothesisDlg::accept()
 {
-  if ( myCreator && !myCreator->checkParams() )
+  QString msg;
+  if ( myCreator && !myCreator->checkParams( msg ) )
+  {
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
     return;
+  }
   QtxDialog::accept();
 }
 
index 1a1978a41b61d36d35a54a0938ccb9e0d8acd47f..6cf6c524dcd9e78bd7aff30f014367703606ea5a 100644 (file)
@@ -57,7 +57,7 @@ public:
                                     const QString&, QWidget* );
   void                         setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr);
 
-  virtual bool                 checkParams() const = 0;
+  virtual bool                 checkParams( QString& ) const;
   virtual void                 onReject();
   virtual QString              helpPage() const;
 
@@ -66,12 +66,15 @@ public:
   bool                         isCreation() const;
 
 protected:
-  typedef struct
+  struct StdParam
   {
     QString   myName;
     QVariant  myValue;
-
-  } StdParam;
+    bool      isVariable;
+    StdParam(){
+      isVariable = false;
+    }
+  };
 
   typedef QList<StdParam>      ListOfStdParams;
   typedef QList<QWidget*>      ListOfWidgets;
@@ -89,6 +92,7 @@ protected:
   virtual QString              storeParams() const = 0;
   virtual bool                 stdParams( ListOfStdParams& ) const;
   bool                         getStdParamFromDlg( ListOfStdParams& ) const;
+  virtual QStringList          getVariablesFromDlg() const;
   static  QString              stdParamValues( const ListOfStdParams& );
   virtual void                 attuneStdWidget( QWidget*, const int ) const;
   virtual QWidget*             getCustomWidget( const StdParam&, 
index dbbfcef25789c18c4bcda350e321c4365b5ee19e..ac654fdd6bb4e5cf5d1bc76f65ab8bd91a25a9c3 100644 (file)
@@ -372,9 +372,11 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
     return false;
   }
 
-  if ( !isValid() ) { // node id is invalid
-    SUIT_MessageBox::warning( dlg(), tr( "SMESH_WRN_WARNING" ),
-                             tr("INVALID_ID") );
+  QString msg;
+  if ( !isValid( msg ) ) { // node id is invalid
+    if( !msg.isEmpty() )
+      SUIT_MessageBox::warning( dlg(), tr( "SMESH_WRN_WARNING" ),
+                               tr("INVALID_ID") );
     dlg()->show();
     return false;
   }
@@ -408,6 +410,12 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
     }
     if (aResult)
     {
+      QStringList aParameters;
+      aParameters << myDlg->myX->text();
+      aParameters << myDlg->myY->text();
+      aParameters << myDlg->myZ->text();
+      aMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+
       myDlg->myId->setText("");
 
       SALOME_ListIO aList;
@@ -432,10 +440,9 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
  */
 //================================================================================
 
-bool SMESHGUI_MakeNodeAtPointOp::isValid()
+bool SMESHGUI_MakeNodeAtPointOp::isValid( QString& msg )
 {
   bool ok = true;
-
   if ( myMeshActor &&
        myDlg->myMoveRBtn->isDown() &&
        !myDlg->myAutoSearchChkBox->isChecked() )
@@ -445,7 +452,14 @@ bool SMESHGUI_MakeNodeAtPointOp::isValid()
     if ( id > 0 )
       if (SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh())
         ok = aMesh->FindNode( id );
+    if( !ok )
+      msg += tr("INVALID_ID") + "\n";
   }
+
+  ok = myDlg->myX->isValid( msg, !myNoPreview ) && ok;
+  ok = myDlg->myY->isValid( msg, !myNoPreview ) && ok;
+  ok = myDlg->myZ->isValid( msg, !myNoPreview ) && ok;
+
   return ok;
 }
 
@@ -538,7 +552,8 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview()
     const bool preview    = myDlg->myPreviewChkBox->isChecked();
     if ( autoSearch )
       myDlg->myId->setText("");
-    if ( preview && ( autoSearch || isValid() ))
+    QString msg;
+    if ( preview && ( autoSearch || isValid( msg ) ))
     {
       try {
         SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
index b2c977fc50a281a349d591ffe7571eef39bc04ea..6df8ba72239fa2b034386f192c8ca0f41c6e47ff 100644 (file)
@@ -60,7 +60,7 @@ protected:
 
   virtual void                   activateSelection();
 
-  bool                           isValid();
+  bool                           isValid( QString& );
 
 protected slots:
   virtual bool                   onApply();
index 91e7bc2020c6ab66aa28974c7ef10881c0cc6ebd..8456928f772b1cd96094c5d28c172ea1186fbcc9 100755 (executable)
@@ -51,6 +51,7 @@
 #include <LightApp_SelectionMgr.h>
 #include <SalomeApp_Tools.h>
 #include <LightApp_Application.h>
+#include <SalomeApp_IntSpinBox.h>
 
 #include <SALOME_ListIO.hxx>
 
@@ -76,7 +77,6 @@
 #include <QRadioButton>
 #include <QCheckBox>
 #include <QButtonGroup>
-#include <QSpinBox>
 #include <QList>
 #include <QDir>
 #include <QFileDialog>
@@ -246,9 +246,9 @@ QWidget* SMESHGUI_MeshPatternDlg::createMainFrame (QWidget* theParent)
   mySelEdit[ Ids ] = new QLineEdit( myRefineGrp );
 
   QLabel* aNodeLbl = new QLabel( tr( "NODE_1" ), myRefineGrp );
-  myNode1          = new QSpinBox( myRefineGrp );
+  myNode1          = new SalomeApp_IntSpinBox( myRefineGrp );
   myNode2Lbl       = new QLabel( tr( "NODE_2" ), myRefineGrp );
-  myNode2          = new QSpinBox( myRefineGrp );
+  myNode2          = new SalomeApp_IntSpinBox( myRefineGrp );
 
   myRefineGrpLayout->addWidget( mySelLbl[ Ids ],  0, 0 );
   myRefineGrpLayout->addWidget( mySelBtn[ Ids ],  0, 1 );
@@ -411,6 +411,24 @@ void SMESHGUI_MeshPatternDlg::Init()
 //=======================================================================
 bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
 {
+  if (isRefine())
+  {
+    QString msg;
+    bool ok = true;
+    ok = myNode1->isValid( msg, theMess ) && ok;
+    if (myType == Type_3d)
+      ok = myNode2->isValid( msg, theMess ) && ok;
+    if( !ok ) {
+      if( theMess ) {
+       QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+       if ( !msg.isEmpty() )
+         str += "\n" + msg;
+       SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+      }
+      return false;
+    }
+  }
+
   QList<int> ids;
   if ((isRefine() &&
        (myMesh->_is_nil() || !getIds(ids) || getNode(false) < 0 ||
@@ -460,6 +478,12 @@ bool SMESHGUI_MeshPatternDlg::onApply()
        ? myPattern->ApplyToMeshFaces  (myMesh, varIds, getNode(false), myReverseChk->isChecked())
        : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
 
+      QStringList aParameters;
+      aParameters << myNode1->text();
+      if(myType == Type_3d )
+       aParameters << myNode2->text();
+      myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+
     } else { // Applying a pattern to geometrical object
       if (myType == Type_2d)
         myPattern->ApplyToFace(myGeomObj[Object], myGeomObj[Vertex1], myReverseChk->isChecked());
@@ -1375,8 +1399,8 @@ void SMESHGUI_MeshPatternDlg::onTextChanged (const QString& theNewText)
 void SMESHGUI_MeshPatternDlg::onNodeChanged (int value)
 {
   if (myType == Type_3d) {
-    QSpinBox* first = (QSpinBox*)sender();
-    QSpinBox* second = first == myNode1 ? myNode2 : myNode1;
+    SalomeApp_IntSpinBox* first = (SalomeApp_IntSpinBox*)sender();
+    SalomeApp_IntSpinBox* second = first == myNode1 ? myNode2 : myNode1;
     int secondVal = second->value();
     if (secondVal == value) {
       secondVal = value == second->maximum() ? second->minimum() : value + 1;
index 6fba2b11f8c1452f51cc474e87fd92f199533cb6..e3e2d6870b910b1b30b68e3d8391d93d3f2b83a2 100755 (executable)
@@ -44,7 +44,7 @@ class QRadioButton;
 class QCheckBox;
 class QButtonGroup;
 class QLabel;
-class QSpinBox;
+class SalomeApp_IntSpinBox;
 class vtkUnstructuredGrid;
 class SALOME_Actor;
 class SVTK_Selector;
@@ -130,8 +130,8 @@ private:
   QCheckBox*                          myRefine;
 
   QFrame*                             myRefineGrp;
-  QSpinBox*                           myNode1;
-  QSpinBox*                           myNode2;
+  SalomeApp_IntSpinBox*               myNode1;
+  SalomeApp_IntSpinBox*               myNode2;
   QLabel*                             myNode2Lbl;
 
   QFrame*                             myGeomGrp;
index d659ca464f96e5be6401ed0f78f6731bdff69f83..199575293198380fc5a22b6bd78b8a599bf17564 100644 (file)
@@ -281,6 +281,22 @@ bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess)
                                   tr("NODE_ID_IS_NOT_DEFINED"));
     return false;
   }
+
+  QString msg;
+  bool ok = true;
+  ok = myX->isValid( msg, theMess ) && ok;
+  ok = myY->isValid( msg, theMess ) && ok;
+  ok = myZ->isValid( msg, theMess ) && ok;
+  if( !ok ) {
+    if( theMess ) {
+      QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+      if ( !msg.isEmpty() )
+       str += "\n" + msg;
+      SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    }
+    return false;
+  }
+
   return true;
 }
 
@@ -325,6 +341,12 @@ bool SMESHGUI_MoveNodesDlg::onApply()
   bool aResult = false;
   try {
     aResult = aMeshEditor->MoveNode(anId, myX->GetValue(), myY->GetValue(), myZ->GetValue());
+
+    QStringList aParameters;
+    aParameters << myX->text();
+    aParameters << myY->text();
+    aParameters << myZ->text();
+    aMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
   } catch (...) {
   }
 
index 3c57f8f70e92f2931feb2c072eb6bf7bc9e93d42..526c3f3e3ea8c5a492396320e96784aeae6deb7d 100755 (executable)
@@ -298,7 +298,7 @@ QWidget* SMESHGUI_MultiEditDlg::createButtonFrame (QWidget* theParent)
 // name    : SMESHGUI_MultiEditDlg::isValid
 // Purpose : Verify validity of input data
 //=======================================================================
-bool SMESHGUI_MultiEditDlg::isValid (const bool /*theMess*/) const
+bool SMESHGUI_MultiEditDlg::isValid (const bool /*theMess*/)
 {
   return (!myMesh->_is_nil() &&
           (myListBox->count() > 0 || (myToAllChk->isChecked() && myActor)));
@@ -1168,12 +1168,39 @@ SMESHGUI_UnionOfTrianglesDlg::~SMESHGUI_UnionOfTrianglesDlg()
 {
 }
 
+bool SMESHGUI_UnionOfTrianglesDlg::isValid (const bool theMess)
+{
+  bool ok = SMESHGUI_MultiEditDlg::isValid( theMess );
+  if( !ok )
+    return false;
+
+  QString msg;
+  ok = myMaxAngleSpin->isValid( msg, theMess );
+  if( !ok ) {
+    if( theMess ) {
+      QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+      if ( !msg.isEmpty() )
+       str += "\n" + msg;
+      SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    }
+    return false;
+  }
+
+  return ok;
+}
+
 bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
                                             const SMESH::long_array&    theIds)
 {
   SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
   double aMaxAngle = myMaxAngleSpin->GetValue() * PI / 180.0;
-  return theEditor->TriToQuad(theIds, aCriterion, aMaxAngle);
+  bool ok = theEditor->TriToQuad(theIds, aCriterion, aMaxAngle);
+  if( ok ) {
+    QStringList aParameters;
+    aParameters << myMaxAngleSpin->text();
+    myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+  }
+  return ok;
 }
 
 
index ade9cdee85c7d8fa106e224aeef551830d8413c5..0ada531f925b40dda1e7819a44e93affa3af542c 100755 (executable)
@@ -107,7 +107,7 @@ protected:
   void                      keyPressEvent( QKeyEvent* );
   QWidget*                  createButtonFrame( QWidget* );
   QWidget*                  createMainFrame( QWidget*, const bool );
-  bool                      isValid( const bool ) const;
+  virtual bool              isValid( const bool );
   SMESH::long_array_var     getIds();
   void                      updateButtons();
   void                      setSelectionMode();
@@ -190,6 +190,7 @@ public:
   virtual ~SMESHGUI_UnionOfTrianglesDlg();
 
 protected:
+  virtual bool      isValid( const bool );
   virtual bool      process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
 
 private:
index 4718dce509aaa483dc500b0759c72bd6b3fa502a..38869ceddb5f899eff69e34afbf1794f092d6fd9 100644 (file)
 
 namespace SMESH
 {
-  void AddNode( SMESH::SMESH_Mesh_ptr theMesh, float x, float y, float z )
+  void AddNode( SMESH::SMESH_Mesh_ptr theMesh, float x, float y, float z, const QStringList& theParameters )
   {
     SUIT_OverrideCursor wc;
     try {
       _PTR(SObject) aSobj = SMESH::FindSObject( theMesh );
       SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor();
       aMeshEditor->AddNode( x, y, z );
+      theMesh->SetParameters( SMESHGUI::JoinObjectParameters(theParameters) );
       _PTR(Study) aStudy = GetActiveStudyDocument();
       CORBA::Long anId = aStudy->StudyId();
       if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( anId, aSobj->GetID().c_str() ) ) {
@@ -400,12 +401,21 @@ bool SMESHGUI_NodesDlg::ClickOnApply()
     return false;
   }
 
+  if( !isValid() )
+    return false;
+
   /* Recup args and call method */
   double x = SpinBox_X->GetValue();
   double y = SpinBox_Y->GetValue();
   double z = SpinBox_Z->GetValue();
+
+  QStringList aParameters;
+  aParameters << SpinBox_X->text();
+  aParameters << SpinBox_Y->text();
+  aParameters << SpinBox_Z->text();
+
   mySimulation->SetVisibility( false );
-  SMESH::AddNode( myMesh, x, y, z );
+  SMESH::AddNode( myMesh, x, y, z, aParameters );
   SMESH::SetPointRepresentation( true );
 
   // select myMesh
@@ -591,3 +601,25 @@ void SMESHGUI_NodesDlg::keyPressEvent( QKeyEvent* e )
     ClickOnHelp();
   }
 }
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool SMESHGUI_NodesDlg::isValid()
+{
+  QString msg;
+  bool ok = true;
+  ok = SpinBox_X->isValid( msg, true ) && ok;
+  ok = SpinBox_Y->isValid( msg, true ) && ok;
+  ok = SpinBox_Z->isValid( msg, true ) && ok;
+
+  if( !ok ) {
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    return false;
+  }
+  return true;
+}
index 747f5166a4f0b258353eba7ba4162151af4cec1a..8fc28eacca9349099a15787cd6a460b3d6d09174 100644 (file)
@@ -77,6 +77,8 @@ private:
   void                    hideEvent ( QHideEvent* );
   void                    keyPressEvent( QKeyEvent* );
   
+  bool                    isValid();
+  
   QGroupBox*              GroupConstructors;
   QRadioButton*           Constructor1;
   QGroupBox*              GroupCoordinates;
index 15119eca4fff895c1e3e26bb76da3807abbafe21..355e01ec3f5d695d38dabb8b13b1b8325d190a31 100644 (file)
@@ -50,6 +50,7 @@
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 #include <SalomeApp_Application.h>
+#include <SalomeApp_IntSpinBox.h>
 
 #include <SVTK_ViewWindow.h>
 #include <SVTK_Selector.h>
@@ -71,7 +72,6 @@
 #include <QHBoxLayout>
 #include <QVBoxLayout>
 #include <QGridLayout>
-#include <QSpinBox>
 #include <QKeyEvent>
 #include <QMenu>
 
@@ -92,7 +92,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
     myVectorDefinition(NONE_SELECT),
-    myFilterDlg( 0 )
+    myFilterDlg( 0 ),
+    mySelectedObject(SMESH::SMESH_IDSource::_nil())
 {
   mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
 
@@ -214,7 +215,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
   SpinBox_Angle = new SMESHGUI_SpinBox(GroupAngleBox);
 
   TextLabelNbSteps = new QLabel(tr("SMESH_NUMBEROFSTEPS"), GroupAngleBox);
-  SpinBox_NbSteps = new QSpinBox(GroupAngleBox);
+  SpinBox_NbSteps = new SalomeApp_IntSpinBox(GroupAngleBox);
 
   GroupAngleLayout->addWidget(RadioButton3,     0, 0);
   GroupAngleLayout->addWidget(RadioButton4,     0, 1);
@@ -350,6 +351,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
   connect(SpinBox_Tolerance, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
   connect(CheckBoxPreview,   SIGNAL(toggled(bool)),        this, SLOT(onDisplaySimulation(bool)));
 
+  connect(SpinBox_Angle, SIGNAL(textChanged(const QString&)), this, SLOT(onAngleTextChange(const QString&)));
+
   ConstructorsClicked(0);
   SelectionIntoArgument();
 }
@@ -462,10 +465,13 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId)
 // function : ClickOnApply()
 // purpose  :
 //=================================================================================
-void SMESHGUI_RevolutionDlg::ClickOnApply()
+bool SMESHGUI_RevolutionDlg::ClickOnApply()
 {
   if (mySMESHGUI->isActiveStudyLocked())
-    return;
+    return false;
+
+  if (!isValid())
+    return false;
 
   if (myNbOkElements && IsAxisOk()) {
     QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
@@ -492,16 +498,49 @@ void SMESHGUI_RevolutionDlg::ClickOnApply()
     if ( GroupAngle->checkedId() == 1 )
       anAngle = anAngle/aNbSteps;
 
+    QStringList aParameters;
+    aParameters << SpinBox_X->text();
+    aParameters << SpinBox_Y->text();
+    aParameters << SpinBox_Z->text();
+    aParameters << SpinBox_DX->text();
+    aParameters << SpinBox_DY->text();
+    aParameters << SpinBox_DZ->text();
+    aParameters << SpinBox_Angle->text();
+    aParameters << SpinBox_NbSteps->text();
+    aParameters << SpinBox_Tolerance->text();
+
     try {
       SUIT_OverrideCursor aWaitCursor;
       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
       
-      if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
-        SMESH::ListOfGroups_var groups = 
-          aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
-                                               anAngle, aNbSteps, aTolerance);
-      else
-        aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
+      if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
+        if( CheckBoxMesh->isChecked() ) {
+         if( GetConstructorId() == 0 )
+           SMESH::ListOfGroups_var groups = 
+             aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis,
+                                                          anAngle, aNbSteps, aTolerance);
+         else
+           SMESH::ListOfGroups_var groups = 
+             aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis,
+                                                          anAngle, aNbSteps, aTolerance);
+       }
+       else
+         SMESH::ListOfGroups_var groups = 
+           aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
+                                                anAngle, aNbSteps, aTolerance);
+      }
+      else {
+        if( CheckBoxMesh->isChecked() ) {
+         if( GetConstructorId() == 0 )
+           aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
+         else
+           aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
+       }
+       else
+         aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
+      }
+
+      myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
     } catch (...) {
     }
 
@@ -510,8 +549,11 @@ void SMESHGUI_RevolutionDlg::ClickOnApply()
       mySMESHGUI->updateObjBrowser(true); // new groups may appear
     Init(false);
     ConstructorsClicked(GetConstructorId());
+    mySelectedObject = SMESH::SMESH_IDSource::_nil();
     SelectionIntoArgument();
   }
+
+  return true;
 }
 
 //=================================================================================
@@ -520,8 +562,8 @@ void SMESHGUI_RevolutionDlg::ClickOnApply()
 //=================================================================================
 void SMESHGUI_RevolutionDlg::ClickOnOk()
 {
-  ClickOnApply();
-  ClickOnCancel();
+  if( ClickOnApply() )
+    ClickOnCancel();
 }
 
 //=================================================================================
@@ -567,6 +609,19 @@ void SMESHGUI_RevolutionDlg::ClickOnHelp()
   }
 }
 
+//=======================================================================
+// function : onAngleTextChange()
+// purpose  :
+//=======================================================================
+void SMESHGUI_RevolutionDlg::onAngleTextChange (const QString& theNewText)
+{
+  bool isNumber;
+  SpinBox_Angle->text().toDouble( &isNumber );
+  if( !isNumber )
+    RadioButton3->setChecked( true );
+  RadioButton4->setEnabled( isNumber );
+}
+
 //=======================================================================
 // function : onTextChange()
 // purpose  :
@@ -677,77 +732,18 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
     }
 
     if (CheckBoxMesh->isChecked()) {
-      int aConstructorId = GetConstructorId();
-
       SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
 
-      if (!SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO)->_is_nil()) { //MESH
-        // get IDs from mesh
-        SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
-        if (!aSMDSMesh)
-          return;
-
-        if (aConstructorId == 0) {
-          SMDS_EdgeIteratorPtr anIter = aSMDSMesh->edgesIterator();
-
-          while (anIter->more()) {
-            const SMDS_MeshEdge * edge = anIter->next();
-            if (edge) {
-              myElementsId += QString(" %1").arg(edge->GetID());
-              aNbUnits++;
-            }
-          }
-        } else if (aConstructorId == 1) {
-          SMDS_FaceIteratorPtr anIter = aSMDSMesh->facesIterator();
-          while (anIter->more()) {
-            const SMDS_MeshFace * face = anIter->next();
-            if (face) {
-              myElementsId += QString(" %1").arg(face->GetID());
-              aNbUnits++;
-            }
-          }
-        }
-      } else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
-        // get submesh
-        SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
-
-        // get IDs from submesh
-        SMESH::long_array_var anElementsIds = new SMESH::long_array;
-        if (aConstructorId == 0)
-          anElementsIds = aSubMesh->GetElementsByType(SMESH::EDGE);
-        else if (aConstructorId == 1)
-          anElementsIds = aSubMesh->GetElementsByType(SMESH::FACE);
-
-        for (int i = 0; i < anElementsIds->length(); i++)
-          myElementsId += QString(" %1").arg(anElementsIds[i]);
-        aNbUnits = anElementsIds->length();
-      } else { // GROUP
-        // get smesh group
-        SMESH::SMESH_GroupBase_var aGroup =
-          SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
-        if (aGroup->_is_nil())
-          return;
-
-        if ((aConstructorId == 0 && aGroup->GetType()!= SMESH::EDGE) ||
-            (aConstructorId == 1 && aGroup->GetType()!= SMESH::FACE))
-          return;
-
-        // get IDs from smesh group
-        SMESH::long_array_var anElementsIds = new SMESH::long_array;
-        anElementsIds = aGroup->GetListOfID();
-        for (int i = 0; i < anElementsIds->length(); i++) {
-          myElementsId += QString(" %1").arg(anElementsIds[i]);
-        }
-        aNbUnits = anElementsIds->length();
-      }
+      if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
+        mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
+      else
+        return;
     } else {
       aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
       myElementsId = aString;
+      if (aNbUnits < 1)
+       return;
     }
-
-    if (aNbUnits < 1)
-      return;
-
     myNbOkElements = true;
   } else {
 
@@ -1073,11 +1069,20 @@ void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview)
       try {
        SUIT_OverrideCursor aWaitCursor;
        SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
-       aMeshEditor->RotationSweep(anElementsId.inout(), 
-                                  anAxis, 
-                                  anAngle, 
-                                  aNbSteps, 
-                                  aTolerance);
+        if( CheckBoxMesh->isChecked() ) {
+         if( GetConstructorId() == 0 )
+           aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis,
+                                              anAngle, aNbSteps, aTolerance);
+         else
+           aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis,
+                                              anAngle, aNbSteps, aTolerance);
+       }
+       else
+         aMeshEditor->RotationSweep(anElementsId.inout(), 
+                                    anAxis, 
+                                    anAngle, 
+                                    aNbSteps, 
+                                    aTolerance);
        SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
        mySimulation->SetData(aMeshPreviewStruct._retn());
       } catch (...) {}
@@ -1154,3 +1159,31 @@ void SMESHGUI_RevolutionDlg::setFilters()
 
   myFilterDlg->show();
 }
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool SMESHGUI_RevolutionDlg::isValid()
+{
+  QString msg;
+  bool ok = true;
+  ok = SpinBox_X->isValid( msg, true ) && ok;
+  ok = SpinBox_Y->isValid( msg, true ) && ok;
+  ok = SpinBox_Z->isValid( msg, true ) && ok;
+  ok = SpinBox_DX->isValid( msg, true ) && ok;
+  ok = SpinBox_DY->isValid( msg, true ) && ok;
+  ok = SpinBox_DZ->isValid( msg, true ) && ok;
+  ok = SpinBox_Angle->isValid( msg, true ) && ok;
+  ok = SpinBox_NbSteps->isValid( msg, true ) && ok;
+  ok = SpinBox_Tolerance->isValid( msg, true ) && ok;
+
+  if( !ok ) {
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    return false;
+  }
+  return true;
+}
index 3502596f17b8318a14d0fc530bb1a79c2522ffc2..a4c3fc1117d0a357a63948364920b68a9cac2545 100644 (file)
@@ -44,7 +44,7 @@ class QLineEdit;
 class QPushButton;
 class QRadioButton;
 class QCheckBox;
-class QSpinBox;
+class SalomeApp_IntSpinBox;
 class SMESHGUI_IdValidator;
 class SMESHGUI_SpinBox;
 class SMESHGUI;
@@ -81,6 +81,8 @@ private:
   int                       GetConstructorId();
   bool                      IsAxisOk();
   
+  bool                      isValid();
+  
   SMESHGUI*                 mySMESHGUI;              /* Current SMESHGUI object */
   SMESHGUI_IdValidator*     myIdValidator;
   LightApp_SelectionMgr*    mySelectionMgr;          /* User shape selection */
@@ -89,6 +91,8 @@ private:
   QWidget*                  myEditCurrentArgument;   /* Current  argument */
   SVTK_Selector*            mySelector;
   
+  SMESH::SMESH_IDSource_var mySelectedObject;
+
   bool                      myBusy;
   SMESH::SMESH_Mesh_var     myMesh;
   SMESH_Actor*              myActor;
@@ -138,7 +142,7 @@ private:
   QLabel*                   TextLabelAngle;
   SMESHGUI_SpinBox*         SpinBox_Angle;
   QLabel*                   TextLabelNbSteps;
-  QSpinBox*                 SpinBox_NbSteps;
+  SalomeApp_IntSpinBox*     SpinBox_NbSteps;
   QLabel*                   TextLabelTolerance;
   SMESHGUI_SpinBox*         SpinBox_Tolerance;
 
@@ -155,13 +159,14 @@ private slots:
   void                      ConstructorsClicked( int );
   void                      ClickOnOk();
   void                      ClickOnCancel();
-  void                      ClickOnApply();
+  bool                      ClickOnApply();
   void                      ClickOnHelp();
   void                      SetEditCurrentArgument();
   void                      SelectionIntoArgument();
   void                      DeactivateActiveDialog();
   void                      ActivateThisDialog();
   void                      onTextChange( const QString& );
+  void                      onAngleTextChange( const QString& );
   void                      onSelectMesh( bool );
   void                      onVectorChanged();
   void                      toDisplaySimulation();
index a2f5460f5d28e2b75618eb998e4412b489c8d2a7..1e701097474a88072cf1b6ff6fd3557cc6077a25 100644 (file)
@@ -91,7 +91,8 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-    myFilterDlg(0)
+    myFilterDlg(0),
+    mySelectedObject(SMESH::SMESH_IDSource::_nil())
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_MESH_ROTATION")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
@@ -365,10 +366,13 @@ void SMESHGUI_RotationDlg::Init (bool ResetControls)
 // function : ClickOnApply()
 // purpose  :
 //=================================================================================
-void SMESHGUI_RotationDlg::ClickOnApply()
+bool SMESHGUI_RotationDlg::ClickOnApply()
 {
   if (mySMESHGUI->isActiveStudyLocked())
-    return;
+    return false;
+
+  if( !isValid() )
+    return false;
 
   if (myNbOkElements && IsAxisOk()) {
     QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
@@ -389,6 +393,16 @@ void SMESHGUI_RotationDlg::ClickOnApply()
     anAxis.vz = SpinBox_DZ->GetValue();
 
     double anAngle = (SpinBox_Angle->GetValue())*PI/180;
+
+    QStringList aParameters;
+    aParameters << SpinBox_X->text();
+    aParameters << SpinBox_Y->text();
+    aParameters << SpinBox_Z->text();
+    aParameters << SpinBox_DX->text();
+    aParameters << SpinBox_DY->text();
+    aParameters << SpinBox_DZ->text();
+    aParameters << SpinBox_Angle->text();
+
     int actionButton = ActionGroup->checkedId();
     bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
     try {
@@ -396,19 +410,40 @@ void SMESHGUI_RotationDlg::ClickOnApply()
       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
       switch ( actionButton ) {
       case MOVE_ELEMS_BUTTON:
-        aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
+        if(CheckBoxMesh->isChecked())
+          aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, false);
+        else
+            aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
+       if( !myMesh->_is_nil())
+         myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
         break;
       case COPY_ELEMS_BUTTON:
-        if ( makeGroups )
-          SMESH::ListOfGroups_var groups = 
-            aMeshEditor->RotateMakeGroups(anElementsId, anAxis, anAngle);
-        else
-          aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
+        if ( makeGroups ) {
+          SMESH::ListOfGroups_var groups;
+          if(CheckBoxMesh->isChecked())
+            groups = aMeshEditor->RotateObjectMakeGroups(mySelectedObject, anAxis, anAngle);
+          else
+            groups = aMeshEditor->RotateMakeGroups(anElementsId, anAxis, anAngle);
+        }
+        else {
+          if(CheckBoxMesh->isChecked())
+            aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, true);
+          else 
+            aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
+        }
+       if( !myMesh->_is_nil())
+         myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
         break;
       case MAKE_MESH_BUTTON:
-        SMESH::SMESH_Mesh_var mesh = 
-          aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
-                                      LineEditNewMesh->text().toLatin1().data());
+        SMESH::SMESH_Mesh_var mesh;
+        if(CheckBoxMesh->isChecked())
+          mesh = aMeshEditor->RotateObjectMakeMesh(mySelectedObject, anAxis, anAngle, makeGroups,
+                                                   LineEditNewMesh->text().toLatin1().data());
+        else 
+          mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
+                                             LineEditNewMesh->text().toLatin1().data());
+       if( !mesh->_is_nil())
+         mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
       }
     } catch (...) {
     }
@@ -418,8 +453,11 @@ void SMESHGUI_RotationDlg::ClickOnApply()
          actionButton == MAKE_MESH_BUTTON )
       mySMESHGUI->updateObjBrowser(true); // new groups may appear
     Init(false);
+    mySelectedObject = SMESH::SMESH_IDSource::_nil();
     SelectionIntoArgument();
   }
+
+  return true;
 }
 
 //=================================================================================
@@ -428,8 +466,8 @@ void SMESHGUI_RotationDlg::ClickOnApply()
 //=================================================================================
 void SMESHGUI_RotationDlg::ClickOnOk()
 {
-  ClickOnApply();
-  ClickOnCancel();
+  if( ClickOnApply() )
+    ClickOnCancel();
 }
 
 //=================================================================================
@@ -586,13 +624,18 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument()
     if (CheckBoxMesh->isChecked()) {
       SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
 
-      if (!SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO)->_is_nil()) { //MESH
+      if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil()) { //MESH
+        mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
+      }
+      else
+        return;
         // get IDs from mesh
-        SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
-        if (!aSMDSMesh)
+        /*
+          SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
+          if (!aSMDSMesh)
           return;
 
-        for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++) {
+          for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++) {
           const SMDS_MeshElement * e = aSMDSMesh->FindElement(i);
           if (e) {
             myElementsId += QString(" %1").arg(i);
@@ -600,40 +643,41 @@ void SMESHGUI_RotationDlg::SelectionIntoArgument()
           }
         }
       } else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
-        // get submesh
+      // get submesh
         SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
-
+        
         // get IDs from submesh
         SMESH::long_array_var anElementsIds = new SMESH::long_array;
         anElementsIds = aSubMesh->GetElementsId();
         for (int i = 0; i < anElementsIds->length(); i++) {
-          myElementsId += QString(" %1").arg(anElementsIds[i]);
-        }
+        myElementsId += QString(" %1").arg(anElementsIds[i]);
+          }
         aNbUnits = anElementsIds->length();
       } else { // GROUP
         // get smesh group
         SMESH::SMESH_GroupBase_var aGroup =
-          SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
+        SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
         if (aGroup->_is_nil())
-          return;
+        return;
 
-        // get IDs from smesh group
+          // get IDs from smesh group
         SMESH::long_array_var anElementsIds = new SMESH::long_array;
         anElementsIds = aGroup->GetListOfID();
         for (int i = 0; i < anElementsIds->length(); i++) {
-          myElementsId += QString(" %1").arg(anElementsIds[i]);
-        }
+        myElementsId += QString(" %1").arg(anElementsIds[i]);
+          }
         aNbUnits = anElementsIds->length();
-      }
-    } else {
+        }
+        */
+      } else {
       aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
       myElementsId = aString;
-    }
-
-    if (aNbUnits < 1)
-      return;
+      if (aNbUnits < 1)
+        return;
+      }
 
     myNbOkElements = true;
+
   } else {
     aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
     if (aNbUnits != 1)
@@ -719,6 +763,7 @@ void SMESHGUI_RotationDlg::SetEditCurrentArgument()
       }
       break;
     }
+
   }
 
   myEditCurrentArgument->setFocus();
@@ -938,3 +983,30 @@ void SMESHGUI_RotationDlg::setFilters()
 
   myFilterDlg->show();
 }
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool SMESHGUI_RotationDlg::isValid()
+{
+  bool ok = true;
+  QString msg;
+
+  ok = SpinBox_X->isValid( msg, true ) && ok;
+  ok = SpinBox_Y->isValid( msg, true ) && ok;
+  ok = SpinBox_Z->isValid( msg, true ) && ok;
+  ok = SpinBox_DX->isValid( msg, true ) && ok;
+  ok = SpinBox_DY->isValid( msg, true ) && ok;
+  ok = SpinBox_DZ->isValid( msg, true ) && ok;
+  ok = SpinBox_Angle->isValid( msg, true ) && ok;
+
+  if( !ok ) {
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    return false;
+  }
+  return true;
+}
index de192b80b020270ee8c02e059a5188bdded985a6..4dd572f2913a9bb818d220bc1cdc479f866b11da 100644 (file)
@@ -73,6 +73,8 @@ private:
   bool                   IsAxisOk();
   void                   setNewMeshName();
   
+  bool                   isValid();
+
   SMESHGUI*              mySMESHGUI;              /* Current SMESHGUI object */
   SMESHGUI_IdValidator*  myIdValidator;
   LightApp_SelectionMgr* mySelectionMgr;          /* User shape selection */
@@ -86,6 +88,7 @@ private:
   SMESH::SMESH_Mesh_var  myMesh;
   SMESH_Actor*           myActor;
   SMESH_LogicalFilter*   myMeshOrSubMeshOrGroupFilter;
+  SMESH::SMESH_IDSource_var mySelectedObject;
   
   QGroupBox*             GroupConstructors;
   QRadioButton*          RadioButton1;
@@ -133,7 +136,7 @@ private:
 private slots:
   void                   ClickOnOk();
   void                   ClickOnCancel();
-  void                   ClickOnApply();
+  bool                   ClickOnApply();
   void                   ClickOnHelp();
   void                   SetEditCurrentArgument();
   void                   SelectionIntoArgument();
index e38bf7713342e8970dfa3cd1cc851b0bbd24bfa0..c2144b1f4692cbe308d78e0c12aa89792c579e57 100644 (file)
@@ -50,6 +50,8 @@
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 
+#include <SalomeApp_IntSpinBox.h>
+
 #include <SVTK_ViewModel.h>
 #include <SVTK_Selector.h>
 #include <SVTK_ViewWindow.h>
@@ -68,7 +70,6 @@
 #include <QRadioButton>
 #include <QComboBox>
 #include <QCheckBox>
-#include <QSpinBox>
 #include <QHBoxLayout>
 #include <QVBoxLayout>
 #include <QGridLayout>
@@ -91,7 +92,8 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-    myFilterDlg(0)
+    myFilterDlg(0),
+    mySelectedObject(SMESH::SMESH_IDSource::_nil())
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
@@ -160,7 +162,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
   // Controls for iteration limit defining
   TextLabelLimit = new QLabel(tr("ITERATION_LIMIT"), GroupArguments);
 
-  SpinBox_IterationLimit = new QSpinBox(GroupArguments);
+  SpinBox_IterationLimit = new SalomeApp_IntSpinBox(GroupArguments);
 
   // Controls for max. aspect ratio defining
   TextLabelAspectRatio = new QLabel(tr("MAX_ASPECT_RATIO"), GroupArguments);
@@ -318,10 +320,13 @@ void SMESHGUI_SmoothingDlg::Init()
 // function : ClickOnApply()
 // purpose  : Called when user presses <Apply> button
 //=================================================================================
-void SMESHGUI_SmoothingDlg::ClickOnApply()
+bool SMESHGUI_SmoothingDlg::ClickOnApply()
 {
   if (mySMESHGUI->isActiveStudyLocked())
-    return;
+    return false;
+
+  if (!isValid())
+    return false;
 
   if (myNbOkElements && (myNbOkNodes || LineEditNodes->text().trimmed().isEmpty())) {
     QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
@@ -345,6 +350,10 @@ void SMESHGUI_SmoothingDlg::ClickOnApply()
     long anIterationLimit = (long)SpinBox_IterationLimit->value();
     double aMaxAspectRatio = SpinBox_AspectRatio->GetValue();
 
+    QStringList aParameters;
+    aParameters << SpinBox_IterationLimit->text();
+    aParameters << SpinBox_AspectRatio->text();
+
     SMESH::SMESH_MeshEditor::Smooth_Method aMethod = SMESH::SMESH_MeshEditor::LAPLACIAN_SMOOTH;
     if (ComboBoxMethod->currentIndex() > 0)
       aMethod =  SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH;
@@ -354,12 +363,25 @@ void SMESHGUI_SmoothingDlg::ClickOnApply()
       SUIT_OverrideCursor aWaitCursor;
       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
 
-      if ( CheckBoxParametric->isChecked() )
-       aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
-                                               anIterationLimit, aMaxAspectRatio, aMethod);
-      else
-       aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
-                                     anIterationLimit, aMaxAspectRatio, aMethod);
+      if ( CheckBoxParametric->isChecked() ) {
+        if(CheckBoxMesh->isChecked())
+         aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
+                                                       anIterationLimit, aMaxAspectRatio, aMethod);
+       else
+         aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
+                                                 anIterationLimit, aMaxAspectRatio, aMethod);
+      }
+      else {
+        if(CheckBoxMesh->isChecked())
+         aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(),
+                                             anIterationLimit, aMaxAspectRatio, aMethod);
+       else
+         aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
+                                       anIterationLimit, aMaxAspectRatio, aMethod);
+      }
+
+      myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+
     } catch (...) {
     }
 
@@ -371,8 +393,12 @@ void SMESHGUI_SmoothingDlg::ClickOnApply()
       mySelectionMgr->setSelectedObjects(aList, false);
       SMESH::UpdateView();
       Init();
+
+      mySelectedObject = SMESH::SMESH_IDSource::_nil();
     }
   }
+
+  return true;
 }
 
 //=================================================================================
@@ -381,8 +407,8 @@ void SMESHGUI_SmoothingDlg::ClickOnApply()
 //=================================================================================
 void SMESHGUI_SmoothingDlg::ClickOnOk()
 {
-  ClickOnApply();
-  ClickOnCancel();
+  if( ClickOnApply() )
+    ClickOnCancel();
 }
 
 //=================================================================================
@@ -549,48 +575,15 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument()
     if (CheckBoxMesh->isChecked()) {
       SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
 
-      if (!SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO)->_is_nil()) { //MESH
-        // get IDs from mesh
-        SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
-        if (!aSMDSMesh)
-          return;
-
-        for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++ ) {
-          const SMDS_MeshElement * e = aSMDSMesh->FindElement(i);
-          if (e) {
-            myElementsId += QString(" %1").arg(i);
-            aNbUnits++;
-          }
-        }
-      } else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
-        // get submesh
-        SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
-
-        // get IDs from submesh
-        SMESH::long_array_var anElementsIds = new SMESH::long_array;
-        anElementsIds = aSubMesh->GetElementsId();
-        for (int i = 0; i < anElementsIds->length(); i++) {
-          myElementsId += QString(" %1").arg(anElementsIds[i]);
-        }
-        aNbUnits = anElementsIds->length();
-      } else { // GROUP
-        // get smesh group
-        SMESH::SMESH_GroupBase_var aGroup =
-          SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
-        if (aGroup->_is_nil())
-          return;
-
-        // get IDs from smesh group
-        SMESH::long_array_var anElementsIds = new SMESH::long_array;
-        anElementsIds = aGroup->GetListOfID();
-        for (int i = 0; i < anElementsIds->length(); i++) {
-          myElementsId += QString(" %1").arg(anElementsIds[i]);
-        }
-        aNbUnits = anElementsIds->length();
-      }
+      if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
+        mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
+      else
+        return;
     } else {
       aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
       myElementsId = aString;
+      if (aNbUnits < 1)
+        return;
     }
   } else if (myEditCurrentArgument == LineEditNodes && !myMesh->_is_nil() && myActor) {
     myNbOkNodes = 0;
@@ -598,9 +591,6 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument()
   } else {
   }
 
-  if (aNbUnits < 1)
-    return;
-
   myBusy = true;
   myEditCurrentArgument->setText(aString);
   myEditCurrentArgument->repaint();
@@ -822,3 +812,24 @@ void SMESHGUI_SmoothingDlg::setNodeFilters()
 {
   setFilters( false );
 }
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool SMESHGUI_SmoothingDlg::isValid()
+{
+  QString msg;
+  bool ok = true;
+  ok = SpinBox_IterationLimit->isValid( msg, true ) && ok;
+  ok = SpinBox_AspectRatio->isValid( msg, true ) && ok;
+
+  if( !ok ) {
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    return false;
+  }
+  return true;
+}
index c01dfc1c77a6b17867ec7103c8d7952f9cd3344f..40b8170a3cbcbfd9e963bd8b85b0aac6002ef3e4 100644 (file)
@@ -43,8 +43,8 @@ class QPushButton;
 class QRadioButton;
 class QComboBox;
 class QCheckBox;
-class QSpinBox;
 class SMESHGUI;
+class SalomeApp_IntSpinBox;
 class SMESHGUI_IdValidator;
 class SMESHGUI_SpinBox;
 class SMESHGUI_FilterDlg;
@@ -73,6 +73,8 @@ private:
   void                   keyPressEvent( QKeyEvent* );
   void                   setFilters( const bool theIsElem );
 
+  bool                   isValid();
+  
   SMESHGUI*              mySMESHGUI;              /* Current SMESHGUI object */
   SMESHGUI_IdValidator*  myIdValidator;
   LightApp_SelectionMgr* mySelectionMgr;          /* User shape selection */
@@ -83,6 +85,8 @@ private:
   QLineEdit*             myEditCurrentArgument;   /* Current  LineEdit */
   SVTK_Selector*         mySelector;
 
+  SMESH::SMESH_IDSource_var mySelectedObject;
+
   bool                   myBusy;
   SMESH::SMESH_Mesh_var  myMesh;
   SMESH_Actor*           myActor;
@@ -106,7 +110,7 @@ private:
   QLabel*                TextLabelMethod;
   QComboBox*             ComboBoxMethod;
   QLabel*                TextLabelLimit;
-  QSpinBox*              SpinBox_IterationLimit;
+  SalomeApp_IntSpinBox*  SpinBox_IterationLimit;
   QLabel*                TextLabelAspectRatio;
   SMESHGUI_SpinBox*      SpinBox_AspectRatio;
   QCheckBox*             CheckBoxParametric;
@@ -118,7 +122,7 @@ private:
 private slots:
   void                   ClickOnOk();
   void                   ClickOnCancel();
-  void                   ClickOnApply();
+  bool                   ClickOnApply();
   void                   ClickOnHelp();
   void                   SetEditCurrentArgument();
   void                   SelectionIntoArgument();
index f3822e3e7b6d5c99b4c1edf8f06090755589995e..1b30cb08a33e0ede5f9b3e82e26a9a84c0bd187a 100644 (file)
@@ -35,7 +35,7 @@
 // purpose  : constructor of specific widget accepting floats in double precision.
 //=================================================================================
 SMESHGUI_SpinBox::SMESHGUI_SpinBox( QWidget* parent )
-  : QtxDoubleSpinBox( parent )
+  : SalomeApp_DoubleSpinBox( parent )
 {
 }
 
@@ -90,7 +90,7 @@ QString SMESHGUI_SpinBox::GetString() const
 //=================================================================================
 QLineEdit* SMESHGUI_SpinBox::editor() const
 {
-  return QtxDoubleSpinBox::lineEdit();
+  return SalomeApp_DoubleSpinBox::lineEdit();
 } 
 
 //=================================================================================
@@ -116,4 +116,5 @@ void SMESHGUI_SpinBox::RangeStepAndValidator( double min,
   setDecimals(32);
   setRange(min, max);
   setSingleStep( step );
+  setDefaultValue( min );
 }
index 2fa5872ede2656cd528b2e63e0836faf97bcddab..cdca31653eaf8b2cf4f5e24f3b6157ad878e5a98 100644 (file)
@@ -30,7 +30,7 @@
 #include "SMESH_SMESHGUI.hxx"
 
 // SALOME GUI includes
-#include <QtxDoubleSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
 
 #define COORD_MIN -1e+15
 #define COORD_MAX +1e+15
@@ -43,7 +43,7 @@ class QDoubleValidator;
 // class    : SMESHGUI_SpinBox
 // purpose  : Derivated from QtxDoubleSpinBox class 
 //=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_SpinBox : public QtxDoubleSpinBox
+class SMESHGUI_EXPORT SMESHGUI_SpinBox : public SalomeApp_DoubleSpinBox
 {
   Q_OBJECT
 
index 7f0c6d0fe290f8d013f0a482629a5a8c1415fb24..ed49f5217b7e4967dcc6c20a9c58081fa566cece 100644 (file)
@@ -92,7 +92,8 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-    myFilterDlg(0)
+    myFilterDlg(0),
+    mySelectedObject(SMESH::SMESH_IDSource::_nil())
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_POINT")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_AXIS")));
@@ -437,10 +438,13 @@ void SMESHGUI_SymmetryDlg::ConstructorsClicked (int constructorId)
 // function : ClickOnApply()
 // purpose  :
 //=================================================================================
-void SMESHGUI_SymmetryDlg::ClickOnApply()
+bool SMESHGUI_SymmetryDlg::ClickOnApply()
 {
   if (mySMESHGUI->isActiveStudyLocked())
-    return;
+    return false;
+
+  if( !isValid() )
+    return false;
 
   if (myNbOkElements && IsMirrorOk()) {
     QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
@@ -464,6 +468,13 @@ void SMESHGUI_SymmetryDlg::ClickOnApply()
       aMirror.vz = SpinBox_DZ->GetValue();
     }
 
+    QStringList aParameters;
+    aParameters << SpinBox_X->text();
+    aParameters << SpinBox_Y->text();
+    aParameters << SpinBox_Z->text();
+    aParameters << ( GetConstructorId() == 0 ? QString::number(0) : SpinBox_DX->text() );
+    aParameters << ( GetConstructorId() == 0 ? QString::number(0) : SpinBox_DY->text() );
+    aParameters << ( GetConstructorId() == 0 ? QString::number(0) : SpinBox_DZ->text() );
 
     SMESH::SMESH_MeshEditor::MirrorType aMirrorType;
 
@@ -482,32 +493,60 @@ void SMESHGUI_SymmetryDlg::ClickOnApply()
       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
 
       switch ( actionButton ) {
-      case MOVE_ELEMS_BUTTON:
-        aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
+      case MOVE_ELEMS_BUTTON: {
+        if(CheckBoxMesh->isChecked())
+          aMeshEditor->MirrorObject(mySelectedObject, aMirror, aMirrorType, false );
+        else
+          aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
+        
+       if( !myMesh->_is_nil())
+         myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
+        break;
+      }
+      case COPY_ELEMS_BUTTON: {
+        SMESH::ListOfGroups_var groups;
+        if ( makeGroups ) {
+          if(CheckBoxMesh->isChecked())
+            groups = aMeshEditor->MirrorObjectMakeGroups(mySelectedObject, aMirror, aMirrorType);
+          else
+            groups = aMeshEditor->MirrorMakeGroups(anElementsId, aMirror, aMirrorType);
+        }
+        else {
+          if(CheckBoxMesh->isChecked())
+            aMeshEditor->MirrorObject(mySelectedObject, aMirror, aMirrorType, true);
+          else
+            aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
+        }
+       if( !myMesh->_is_nil())
+         myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
         break;
-      case COPY_ELEMS_BUTTON:
-        if ( makeGroups )
-          SMESH::ListOfGroups_var groups = 
-            aMeshEditor->MirrorMakeGroups(anElementsId, aMirror, aMirrorType);
+        }
+      case MAKE_MESH_BUTTON: {
+        SMESH::SMESH_Mesh_var mesh;
+        if(CheckBoxMesh->isChecked())
+          mesh = aMeshEditor->MirrorObjectMakeMesh(mySelectedObject, aMirror, aMirrorType, makeGroups,
+                                                   LineEditNewMesh->text().toLatin1().data());
         else
-          aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
+          mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
+                                             LineEditNewMesh->text().toLatin1().data());
+       if( !mesh->_is_nil())
+         mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
         break;
-      case MAKE_MESH_BUTTON:
-        SMESH::SMESH_Mesh_var mesh = 
-          aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
-                                      LineEditNewMesh->text().toLatin1().data());
+      }
       }
     } catch (...) {
     }
-
+    
     SMESH::UpdateView();
     if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
          actionButton == MAKE_MESH_BUTTON )
       mySMESHGUI->updateObjBrowser(true); // new groups may appear
     Init(false);
     ConstructorsClicked(GetConstructorId());
+    mySelectedObject = SMESH::SMESH_IDSource::_nil();
     SelectionIntoArgument();
   }
+  return true;
 }
 
 //=================================================================================
@@ -516,8 +555,8 @@ void SMESHGUI_SymmetryDlg::ClickOnApply()
 //=================================================================================
 void SMESHGUI_SymmetryDlg::ClickOnOk()
 {
-  ClickOnApply();
-  ClickOnCancel();
+  if( ClickOnApply() )
+    ClickOnCancel();
 }
 
 //=================================================================================
@@ -675,8 +714,13 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument()
     if (CheckBoxMesh->isChecked()) {
       SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
 
-      if (!SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO)->_is_nil()) { //MESH
-        // get IDs from mesh
+      if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil()) { //MESH
+        mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
+      }
+      else
+        return;
+      // get IDs from mesh
+      /*
         SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
         if (!aSMDSMesh)
           return;
@@ -688,17 +732,20 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument()
             aNbUnits++;
           }
         }
+        
       } else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
         // get submesh
         SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
 
         // get IDs from submesh
+        /*
         SMESH::long_array_var anElementsIds = new SMESH::long_array;
         anElementsIds = aSubMesh->GetElementsId();
         for (int i = 0; i < anElementsIds->length(); i++) {
           myElementsId += QString(" %1").arg(anElementsIds[i]);
         }
         aNbUnits = anElementsIds->length();
+        
       } else { // GROUP
         // get smesh group
         SMESH::SMESH_GroupBase_var aGroup =
@@ -714,14 +761,14 @@ void SMESHGUI_SymmetryDlg::SelectionIntoArgument()
         }
         aNbUnits = anElementsIds->length();
       }
+      */
     } else {
       aNbUnits = SMESH::GetNameOfSelectedElements( mySelector, IO, aString);
       myElementsId = aString;
+      if (aNbUnits < 1)
+        return;
     }
-
-    if (aNbUnits < 1)
-      return;
-
+    
     myNbOkElements = true;
   } else {
     aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
@@ -1035,3 +1082,31 @@ void SMESHGUI_SymmetryDlg::setFilters()
 
   myFilterDlg->show();
 }
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool SMESHGUI_SymmetryDlg::isValid()
+{
+  bool ok = true;
+  QString msg;
+
+  ok = SpinBox_X->isValid( msg, true ) && ok;
+  ok = SpinBox_Y->isValid( msg, true ) && ok;
+  ok = SpinBox_Z->isValid( msg, true ) && ok;
+  if (GetConstructorId() != 0) {
+    ok = SpinBox_DX->isValid( msg, true ) && ok;
+    ok = SpinBox_DY->isValid( msg, true ) && ok;
+    ok = SpinBox_DZ->isValid( msg, true ) && ok;
+  }
+
+  if( !ok ) {
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    return false;
+  }
+  return true;
+}
index fc18a65bea7e673f669150c8f96203befa1c0083..c56317d0bcbf7203f4472fcf0a7b00d331899ac7 100644 (file)
@@ -74,6 +74,8 @@ private:
   bool                   IsMirrorOk();
   void                   setNewMeshName();
 
+  bool                   isValid();
+
   SMESHGUI*              mySMESHGUI;              /* Current SMESHGUI object */
   SMESHGUI_IdValidator*  myIdValidator;
   LightApp_SelectionMgr* mySelectionMgr;          /* User shape selection */
@@ -83,6 +85,8 @@ private:
 
   QWidget*               myEditCurrentArgument;   /* Current  LineEdit */
 
+  SMESH::SMESH_IDSource_var mySelectedObject;
+
   bool                   myBusy;
   SMESH::SMESH_Mesh_var  myMesh;
   SMESH_Actor*           myActor;
@@ -135,7 +139,7 @@ private slots:
   void                   ConstructorsClicked( int );
   void                   ClickOnOk();
   void                   ClickOnCancel();
-  void                   ClickOnApply();
+  bool                   ClickOnApply();
   void                   ClickOnHelp();
   void                   SetEditCurrentArgument();
   void                   SelectionIntoArgument();
index b148a53150aa4395f79a22b1a018e81523334552..091446d10f7ebbad02595cdd10a65b52ca52e792 100644 (file)
@@ -109,7 +109,8 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
-    myFilterDlg(0)
+    myFilterDlg(0),
+    mySelectedObject(SMESH::SMESH_IDSource::_nil())
 {
   QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_POINTS")));
   QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_VECTOR")));
@@ -436,10 +437,13 @@ void SMESHGUI_TranslationDlg::ConstructorsClicked (int constructorId)
 // function : ClickOnApply()
 // purpose  :
 //=================================================================================
-void SMESHGUI_TranslationDlg::ClickOnApply()
+bool SMESHGUI_TranslationDlg::ClickOnApply()
 {
   if (mySMESHGUI->isActiveStudyLocked())
-    return;
+    return false;
+
+  if( !isValid() )
+    return false;
 
   if (myNbOkElements) {
     QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
@@ -461,6 +465,17 @@ void SMESHGUI_TranslationDlg::ClickOnApply()
       aVector.PS.z = SpinBox1_3->GetValue();
     }
 
+    QStringList aParameters;
+    aParameters << SpinBox1_1->text();
+    if (GetConstructorId() == 0)
+      aParameters << SpinBox2_1->text();
+    aParameters << SpinBox1_2->text();
+    if (GetConstructorId() == 0)
+      aParameters << SpinBox2_2->text();
+    aParameters << SpinBox1_3->text();
+    if (GetConstructorId() == 0)
+      aParameters << SpinBox2_3->text();
+
     int actionButton = ActionGroup->checkedId();
     bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
     try {
@@ -468,31 +483,55 @@ void SMESHGUI_TranslationDlg::ClickOnApply()
       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
       switch ( actionButton ) {
       case MOVE_ELEMS_BUTTON:
-        aMeshEditor->Translate(anElementsId, aVector, false);
+        if(CheckBoxMesh->isChecked())
+          aMeshEditor->TranslateObject(mySelectedObject, aVector, false);
+        else
+          aMeshEditor->Translate(anElementsId, aVector, false);
+       if( !myMesh->_is_nil())
+         myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
         break;
       case COPY_ELEMS_BUTTON:
-        if ( makeGroups )
-          SMESH::ListOfGroups_var groups = 
-            aMeshEditor->TranslateMakeGroups(anElementsId, aVector);
-        else
-          aMeshEditor->Translate(anElementsId, aVector, true);
+        if ( makeGroups ) {
+          SMESH::ListOfGroups_var groups; 
+          if(CheckBoxMesh->isChecked())
+            groups = aMeshEditor->TranslateObjectMakeGroups(mySelectedObject,aVector);
+          else
+            groups = aMeshEditor->TranslateMakeGroups(anElementsId, aVector);
+        }
+        else {
+          if(CheckBoxMesh->isChecked())
+            aMeshEditor->TranslateObject(mySelectedObject, aVector, true);
+          else
+            aMeshEditor->Translate(anElementsId, aVector, true);
+        }
+       if( !myMesh->_is_nil())
+         myMesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
         break;
       case MAKE_MESH_BUTTON:
-        SMESH::SMESH_Mesh_var mesh = 
-          aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
-                                         LineEditNewMesh->text().toLatin1().data());
+        SMESH::SMESH_Mesh_var mesh; 
+        if(CheckBoxMesh->isChecked())
+          mesh = aMeshEditor->TranslateObjectMakeMesh(mySelectedObject, aVector, makeGroups,
+                                                      LineEditNewMesh->text().toLatin1().data());
+        else
+          mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
+                                                LineEditNewMesh->text().toLatin1().data());
+       if( !mesh->_is_nil())
+         mesh->SetParameters(SMESHGUI::JoinObjectParameters(aParameters));
       }
     } catch (...) {
     }
-
+    
     SMESH::UpdateView();
     if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ||
          actionButton == MAKE_MESH_BUTTON )
       mySMESHGUI->updateObjBrowser(true); // new groups may appear
     Init(false);
     ConstructorsClicked(GetConstructorId());
+    mySelectedObject = SMESH::SMESH_IDSource::_nil();
     SelectionIntoArgument();
   }
+  
+  return true;
 }
 
 //=================================================================================
@@ -501,8 +540,8 @@ void SMESHGUI_TranslationDlg::ClickOnApply()
 //=================================================================================
 void SMESHGUI_TranslationDlg::ClickOnOk()
 {
-  ClickOnApply();
-  ClickOnCancel();
+  if( ClickOnApply() )
+    ClickOnCancel();
 }
 
 //=================================================================================
@@ -657,8 +696,13 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument()
     if (CheckBoxMesh->isChecked()) {
       SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aString );
 
-      if (!SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO)->_is_nil()) { //MESH
+      if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil()) { //MESH, SUBMESH, OR GROUP
+        mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
+      }
+      else
+        return;
         // get IDs from mesh
+        /*
         SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
         if (!aSMDSMesh)
           return;
@@ -696,14 +740,14 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument()
         }
         aNbUnits = anElementsIds->length();
       }
+        */
     } else {
       aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
       myElementsId = aString;
+      if (aNbUnits < 1)
+        return;  
     }
 
-    if (aNbUnits < 1)
-      return;
-
     myNbOkElements = true;
   } else {
     aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
@@ -986,3 +1030,31 @@ void SMESHGUI_TranslationDlg::setFilters()
 
   myFilterDlg->show();
 }
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool SMESHGUI_TranslationDlg::isValid()
+{
+  bool ok = true;
+  QString msg;
+
+  ok = SpinBox1_1->isValid( msg, true ) && ok;
+  ok = SpinBox1_2->isValid( msg, true ) && ok;
+  ok = SpinBox1_3->isValid( msg, true ) && ok;
+  if (GetConstructorId() == 0) {
+    ok = SpinBox2_1->isValid( msg, true ) && ok;
+    ok = SpinBox2_2->isValid( msg, true ) && ok;
+    ok = SpinBox2_3->isValid( msg, true ) && ok;
+  }
+
+  if( !ok ) {
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+    return false;
+  }
+  return true;
+}
index c551faeee143d801b1f947874f14531803e2ba55..279ec596bd9aa53b90c92e407629abf305f5ae81 100644 (file)
@@ -73,6 +73,8 @@ private:
   int                    GetConstructorId();
   void                   setNewMeshName();
 
+  bool                   isValid();
+
   SMESHGUI*              mySMESHGUI;              /* Current SMESHGUI object */
   SMESHGUI_IdValidator*  myIdValidator;
   LightApp_SelectionMgr* mySelectionMgr;          /* User shape selection */
@@ -88,6 +90,8 @@ private:
   SMESH_Actor*           myActor;
   SMESH_LogicalFilter*   myMeshOrSubMeshOrGroupFilter;
 
+  SMESH::SMESH_IDSource_var mySelectedObject;
+
   QGroupBox*             ConstructorsBox;
   QButtonGroup*          GroupConstructors;
   QRadioButton*          RadioButton1;
@@ -132,7 +136,7 @@ private slots:
   void                   ConstructorsClicked( int );
   void                   ClickOnOk();
   void                   ClickOnCancel();
-  void                   ClickOnApply();
+  bool                   ClickOnApply();
   void                   ClickOnHelp();
   void                   SetEditCurrentArgument();
   void                   SelectionIntoArgument();
index 304d976fc469a3579cfbf996c122e74fe8674cdf..a8481122a9ed48c0042d801821e910ec687bde53 100644 (file)
@@ -1280,6 +1280,10 @@ Are you sure want to export to MED 2.1 ?</translation>
             <source>SMESH_ID_NODES</source>
             <translation>Id Nodes</translation>
         </message>
+        <message>
+            <source>SMESH_INCORRECT_INPUT</source>
+            <translation>Incorrect input data!</translation>
+        </message>
         <message>
             <source>SMESH_INFORMATION</source>
             <translation>Information</translation>
index 35200fa1c439b1156a31ab356feca59e99f0fca8..2a15a44df935ab6b5d9607c143783dd28a744204 100644 (file)
@@ -47,6 +47,7 @@ salomeinclude_HEADERS = \
        SMESH_MEDSupport_i.hxx \
        SMESH_Pattern_i.hxx \
        SMESH_2smeshpy.hxx \
+       SMESH_NoteBook.hxx \
        SMESH.hxx
 
 # Scripts to be installed.
@@ -76,7 +77,8 @@ dist_libSMESHEngine_la_SOURCES = \
        SMESH_Filter_i.cxx \
        SMESH_Group_i.cxx \
        SMESH_Pattern_i.cxx \
-       SMESH_2smeshpy.cxx
+       SMESH_2smeshpy.cxx \
+       SMESH_NoteBook.cxx 
 
 # Executables targets
 bin_PROGRAMS = SMESHEngine
index 0a7e57e861248993625b2e58d287f268011cba07..be494755b28c174179b200e69b054300767cd71a 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "utilities.h"
 #include "SMESH_PythonDump.hxx"
+#include "SMESH_NoteBook.hxx"
 #include "Resource_DataMapOfAsciiStringAsciiString.hxx"
 
 #include "SMESH_Gen_i.hxx"
@@ -125,12 +126,31 @@ SMESH_2smeshpy::ConvertScript(const TCollection_AsciiString& theScript,
   theGen = new _pyGen( theEntry2AccessorMethod, theObjectNames );
 
   // split theScript into separate commands
+
+  SMESH_NoteBook * aNoteBook = new SMESH_NoteBook();
+  
   int from = 1, end = theScript.Length(), to;
   while ( from < end && ( to = theScript.Location( "\n", from, end )))
+  {
+    if ( to != from )
+        // cut out and store a command
+        aNoteBook->AddCommand( theScript.SubString( from, to - 1 ));
+      from = to + 1;
+  }
+  
+  aNoteBook->ReplaceVariables();
+
+  TCollection_AsciiString aNoteScript = aNoteBook->GetResultScript();
+  delete aNoteBook;
+  aNoteBook = 0;
+  
+  // split theScript into separate commands
+  from = 1, end = aNoteScript.Length();
+  while ( from < end && ( to = aNoteScript.Location( "\n", from, end )))
   {
     if ( to != from )
       // cut out and store a command
-      theGen->AddCommand( theScript.SubString( from, to - 1 ));
+      theGen->AddCommand( aNoteScript.SubString( from, to - 1 ));
     from = to + 1;
   }
 
@@ -1057,13 +1077,14 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
   if ( sameMethods.empty() ) {
     const char * names[] = {
       "RemoveElements","RemoveNodes","AddNode","AddEdge","AddFace","AddPolygonalFace",
-      "AddVolume","AddPolyhedralVolume","AddPolyhedralVolumeByFaces","MoveNode",
-      "InverseDiag","DeleteDiag","Reorient","ReorientObject","SplitQuad","SplitQuadObject",
+      "AddVolume","AddPolyhedralVolume","AddPolyhedralVolumeByFaces","MoveNode", "MoveClosestNodeToPoint",
+      "InverseDiag","DeleteDiag","Reorient","ReorientObject","TriToQuad","SplitQuad","SplitQuadObject",
       "BestSplit","Smooth","SmoothObject","SmoothParametric","SmoothParametricObject",
       "ConvertToQuadratic","ConvertFromQuadratic","RenumberNodes","RenumberElements",
-      "RotationSweep","RotationSweepObject","ExtrusionSweep","AdvancedExtrusion",
-      "ExtrusionSweepObject","ExtrusionSweepObject1D","ExtrusionSweepObject2D","Mirror",
-      "MirrorObject","Translate","TranslateObject","Rotate","RotateObject",
+      "RotationSweep","RotationSweepObject","RotationSweepObject1D","RotationSweepObject2D",
+      "ExtrusionSweep","AdvancedExtrusion","ExtrusionSweepObject","ExtrusionSweepObject1D","ExtrusionSweepObject2D",
+      "ExtrusionAlongPath","ExtrusionAlongPathObject","ExtrusionAlongPathObject1D","ExtrusionAlongPathObject2D",
+      "Mirror","MirrorObject","Translate","TranslateObject","Rotate","RotateObject",
       "FindCoincidentNodes","FindCoincidentNodesOnPart","MergeNodes","FindEqualElements",
       "MergeElements","MergeEqualElements","SewFreeBorders","SewConformFreeBorders",
       "SewBorderToSide","SewSideElements","ChangeElemNodes","GetLastCreatedNodes",
@@ -1983,14 +2004,21 @@ const TCollection_AsciiString & _pyCommand::GetArg( int index )
     if ( begPos < 1 )
       begPos = myString.Location( "(", 1, Length() ) + 1;
 
-    int i = 0, prevLen = 0;
+    int i = 0, prevLen = 0, nbNestings = 0;
     while ( begPos != EMPTY ) {
       begPos += prevLen;
+      if( myString.Value( begPos ) == '(' )
+       nbNestings++;
       // check if we are looking at the closing parenthesis
       while ( begPos <= Length() && isspace( myString.Value( begPos )))
         ++begPos;
-      if ( begPos > Length() || myString.Value( begPos ) == ')' )
+      if ( begPos > Length() )
         break;
+      if ( myString.Value( begPos ) == ')' ) {
+       nbNestings--;
+       if( nbNestings == 0 )
+         break;
+      }
       myArgs.Append( GetWord( myString, begPos, true, true ));
       SetBegPos( ARG1_IND + i, begPos );
       prevLen = myArgs.Last().Length();
@@ -2144,7 +2172,8 @@ void _pyCommand::SetArg( int index, const TCollection_AsciiString& theArg)
   if ( pos < 1 ) // no index-th arg exist, append inexistent args
   {
     // find a closing parenthesis
-    if ( int lastArgInd = GetNbArgs() ) {
+    if ( GetNbArgs() != 0 && index <= GetNbArgs() ) {
+      int lastArgInd = GetNbArgs();
       pos = GetBegPos( ARG1_IND + lastArgInd  - 1 ) + GetArg( lastArgInd ).Length();
       while ( pos > 0 && pos <= Length() && myString.Value( pos ) != ')' )
         ++pos;
index e06f5db73f1537abe5b549bede0d8f3b15d25260..836e585c70004c0409cf23974689043074ae50d4 100644 (file)
@@ -493,6 +493,11 @@ public:
    * \brief Find SObject for an algo
    */
   SALOMEDS::SObject_ptr GetAlgoSO(const ::SMESH_Algo* algo);
+
+  void UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters);
+  char* GetParameters(CORBA::Object_ptr theObject);
+  char* ParseParameters(const char* theParameters);
+  
  
 private:
   // Create hypothesis of given type
index 02358c7890f4c2ce22c87ef5bbaa70ea6e15d89e..b0701ea596b22275ba4b38fcc0def7b32aea948f 100644 (file)
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
+static int VARIABLE_DEBUG = 0;
 #else
 static int MYDEBUG = 0;
+static int VARIABLE_DEBUG = 0;
 #endif
 
 //=============================================================================
@@ -863,3 +865,100 @@ bool SMESH_Gen_i::RemoveHypothesisFromShape(SALOMEDS::Study_ptr         theStudy
   return true;
 }
 
+//=======================================================================
+//function : UpdateParameters
+//purpose  : 
+//=======================================================================
+void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters)
+{
+
+  if(VARIABLE_DEBUG)
+    cout<<"UpdateParameters : "<<theParameters<<endl;
+  SALOMEDS::Study_ptr aStudy = GetCurrentStudy();
+  if(aStudy->_is_nil() || CORBA::is_nil(theObject)) 
+    return;
+
+  SALOMEDS::SObject_var aSObj =  ObjectToSObject(aStudy,theObject);
+  if(aSObj->_is_nil())  
+    return;
+  
+  SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+  
+  SALOMEDS::GenericAttribute_var aFindAttr;
+  bool hasAttr = aSObj->FindAttribute(aFindAttr, "AttributeString");
+  if(VARIABLE_DEBUG)
+    cout<<"Find Attribute "<<hasAttr<<endl;
+
+  SALOMEDS::GenericAttribute_var anAttr;
+  anAttr = aStudyBuilder->FindOrCreateAttribute( aSObj, "AttributeString");
+  SALOMEDS::AttributeString_var aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
+
+  TCollection_AsciiString aNewParams;
+  TCollection_AsciiString aOldParameters(aStringAttr->Value());
+  TCollection_AsciiString anInputParams(ParseParameters(theParameters));
+  
+  if(!hasAttr)
+    aNewParams = anInputParams;
+  else 
+    aNewParams = aOldParameters+"|"+anInputParams;
+
+  if(VARIABLE_DEBUG)
+    {
+      cout<<"Input Parameters : "<<anInputParams<<endl;
+      cout<<"Old Parameters : "<<aOldParameters<<endl;
+      cout<<"New Parameters : "<<aNewParams<<endl;
+    }
+  
+  
+  aStringAttr->SetValue( aNewParams.ToCString() );
+}
+
+//=======================================================================
+//function : ParseParameters
+//purpose  : 
+//=======================================================================
+char* SMESH_Gen_i::ParseParameters(const char* theParameters)
+{
+  const char* aParameters = CORBA::string_dup(theParameters);
+  TCollection_AsciiString anInputParams;
+  SALOMEDS::Study_ptr aStudy = GetCurrentStudy();
+  if( !aStudy->_is_nil() ) {
+    SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters);
+    for(int j=0;j<aSections->length();j++) {
+      SALOMEDS::ListOfStrings aVars= aSections[j];
+      for(int i=0;i<aVars.length();i++ ) {
+        anInputParams += aStudy->IsVariable(aVars[i].in()) ? 
+          TCollection_AsciiString(aVars[i].in()) : TCollection_AsciiString("");
+        if(i != aVars.length()-1)
+          anInputParams+=":";
+      }
+      if(j!=aSections->length()-1)
+        anInputParams+="|";
+    }
+  }
+  return CORBA::string_dup(anInputParams.ToCString());
+}
+
+//=======================================================================
+//function : GetParameters
+//purpose  : 
+//=======================================================================
+char* SMESH_Gen_i::GetParameters(CORBA::Object_ptr theObject)
+{
+  TCollection_AsciiString aResult;
+
+  SALOMEDS::Study_ptr aStudy = GetCurrentStudy();
+  SALOMEDS::SObject_var aSObj =  ObjectToSObject(aStudy,theObject);
+
+  if(!aStudy->_is_nil() && 
+     !CORBA::is_nil(theObject) && 
+     !aSObj->_is_nil()){
+    
+    SALOMEDS::GenericAttribute_var anAttr;
+    if ( aSObj->FindAttribute(anAttr, "AttributeString")) {
+      aResult = TCollection_AsciiString(SALOMEDS::AttributeString::_narrow(anAttr)->Value());
+    }
+  }
+  
+  return CORBA::string_dup( aResult.ToCString() );
+}
index 95a8c48a204dbe4dd7625f617bea20dc2c5a5305..b677e647b13c6dca7222d71f0206c2be16008342 100644 (file)
@@ -28,6 +28,7 @@
 #include <iostream>
 #include <sstream>
 #include "SMESH_Hypothesis_i.hxx"
+#include "SMESH_Gen_i.hxx"
 #include "utilities.h"
 
 using namespace std;
@@ -120,6 +121,120 @@ CORBA::Long SMESH_Hypothesis_i::GetId()
   return myBaseImpl->GetID();
 }
 
+//=============================================================================
+/*!
+ *  SMESH_Hypothesis_i::IsPublished()
+ *
+ */
+//=============================================================================
+bool SMESH_Hypothesis_i::IsPublished(){
+  bool res = false;
+  SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
+  if(gen){
+    SALOMEDS::SObject_var SO = 
+      SMESH_Gen_i::ObjectToSObject(gen->GetCurrentStudy() , SMESH::SMESH_Hypothesis::_narrow(_this()));
+    res = !SO->_is_nil();
+  }
+  return res;
+}
+
+//=============================================================================
+/*!
+ *  SMESH_Hypothesis_i::SetParameters()
+ *
+ */
+//=============================================================================
+void SMESH_Hypothesis_i::SetParameters(const char* theParameters)
+{
+  SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
+  char * aParameters = CORBA::string_dup(theParameters);
+  if(gen){
+    if(IsPublished()) {
+      SMESH_Gen_i::GetSMESHGen()->UpdateParameters(SMESH::SMESH_Hypothesis::_narrow(_this()),aParameters);
+    }
+    else {
+      myBaseImpl->SetParameters(gen->ParseParameters(aParameters));
+    }
+  }
+}
+
+//=============================================================================
+/*!
+ *  SMESH_Hypothesis_i::GetParameters()
+ *
+ */
+//=============================================================================
+char* SMESH_Hypothesis_i::GetParameters()
+{
+  SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
+  char* aResult;
+  if(IsPublished()) {
+    MESSAGE("SMESH_Hypothesis_i::GetParameters() : Get Parameters from SObject");
+    aResult = gen->GetParameters(SMESH::SMESH_Hypothesis::_narrow(_this()));
+  }
+  else {
+    MESSAGE("SMESH_Hypothesis_i::GetParameters() : Get local parameters");
+    aResult = myBaseImpl->GetParameters(); 
+  }
+  return CORBA::string_dup(aResult);
+}
+
+//=============================================================================
+/*!
+ *  SMESH_Hypothesis_i::GetLastParameters()
+ *
+ */
+//=============================================================================
+SMESH::ListOfParameters* SMESH_Hypothesis_i::GetLastParameters()
+{
+  SMESH::ListOfParameters_var aResult = new SMESH::ListOfParameters();
+  SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
+  if(gen) {
+    char *aParameters;
+    if(IsPublished())
+     aParameters = GetParameters();
+    else
+      aParameters = myBaseImpl->GetLastParameters();
+
+    SALOMEDS::Study_ptr aStudy = gen->GetCurrentStudy();
+    if(!aStudy->_is_nil()) {
+      SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters); 
+      if(aSections->length() > 0) {
+        SALOMEDS::ListOfStrings aVars = aSections[aSections->length()-1];
+        aResult->length(aVars.length());
+        for(int i = 0;i < aVars.length();i++)
+          aResult[i] = CORBA::string_dup( aVars[i]);
+      }
+    }
+  }
+  return aResult._retn();
+}
+
+//=============================================================================
+/*!
+ *  SMESH_Hypothesis_i::SetLastParameters()
+ *
+ */
+//=============================================================================
+void SMESH_Hypothesis_i::SetLastParameters(const char* theParameters)
+{
+  if(!IsPublished()) {
+    myBaseImpl->SetLastParameters(theParameters);
+  }
+}
+//=============================================================================
+/*!
+ *  SMESH_Hypothesis_i::ClearParameters()
+ *
+ */
+//=============================================================================
+void SMESH_Hypothesis_i::ClearParameters()
+{
+  if(!IsPublished()) {
+    myBaseImpl->ClearParameters();
+  }
+}
+
 //=============================================================================
 /*!
  *  SMESH_Hypothesis_i::GetImpl
index 944b1694ca5b9c27da8ddf0e10010434b9bb71f9..13bd7742fd3b07ecdc9faf4447c8a89bc9053762 100644 (file)
@@ -64,6 +64,25 @@ public:
 
   // Get unique id of hypothesis
   CORBA::Long GetId();
+  
+  // Set list of parameters  separated by ":" symbol, used for Hypothesis creation
+  void SetParameters (const char* theParameters);
+  
+  // Return list of notebook variables used for Hypothesis creation separated by ":" symbol
+  char* GetParameters();
+
+  //Return list of last notebook variables used for Hypothesis creation.
+  SMESH::ListOfParameters* GetLastParameters();
+
+  //Set last parameters for not published hypothesis
+  
+  void SetLastParameters(const char* theParameters);
+  
+  // Clear parameters list
+  void ClearParameters();
+
+  //Return true if hypothesis was published in study
+  bool IsPublished();
 
   // Get implementation
   ::SMESH_Hypothesis* GetImpl();
index 9592ab8436f1b01bae86f1a66a893dd0517b1b01..8fb61b896e89eafb46c63975dcc108759f014239 100644 (file)
@@ -1351,12 +1351,13 @@ SMESH_MeshEditor_i::rotationSweep(const SMESH::long_array & theIDsOfElements,
                                   CORBA::Double             theAngleInRadians,
                                   CORBA::Long               theNbOfSteps,
                                   CORBA::Double             theTolerance,
-                                  const bool                theMakeGroups)
+                                  const bool                theMakeGroups,
+                                 const SMDSAbs_ElementType theElementType)
 {
   initData();
 
   TIDSortedElemSet inElements, copyElements;
-  arrayToSet(theIDsOfElements, GetMeshDS(), inElements);
+  arrayToSet(theIDsOfElements, GetMeshDS(), inElements, theElementType);
 
   TIDSortedElemSet* workElements = & inElements;
   TPreviewMesh      tmpMesh( SMDSAbs_Face );
@@ -1399,10 +1400,9 @@ void SMESH_MeshEditor_i::RotationSweep(const SMESH::long_array & theIDsOfElement
                                        CORBA::Double             theTolerance)
 {
   if ( !myPreviewMode ) {
-    TPythonDump() << "axis = " << theAxis;
     TPythonDump() << this << ".RotationSweep( "
-                  << theIDsOfElements
-                  << ", axis, "
+                  << theIDsOfElements << ", "
+                  << theAxis << ", "
                   << theAngleInRadians << ", "
                   << theNbOfSteps << ", "
                   << theTolerance << " )";
@@ -1434,12 +1434,11 @@ SMESH_MeshEditor_i::RotationSweepMakeGroups(const SMESH::long_array& theIDsOfEle
                                                theTolerance,
                                                true);
   if ( !myPreviewMode ) {
-    TPythonDump()<< "axis = " << theAxis;
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump<< this << ".RotationSweepMakeGroups( "
-               << theIDsOfElements
-               << ", axis, "
+               << theIDsOfElements << ", "
+               << theAxis << ", "
                << theAngleInRadians << ", "
                << theNbOfSteps << ", "
                << theTolerance << " )";
@@ -1459,10 +1458,9 @@ void SMESH_MeshEditor_i::RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject
                                             CORBA::Double             theTolerance)
 {
   if ( !myPreviewMode ) {
-    TPythonDump() << "axis = " << theAxis;
     TPythonDump() << this << ".RotationSweepObject( "
-                  << theObject
-                  << ", axis, "
+                  << theObject << ", "
+                  << theAxis << ", "
                   << theAngleInRadians << ", "
                   << theNbOfSteps << ", "
                   << theTolerance << " )";
@@ -1476,6 +1474,64 @@ void SMESH_MeshEditor_i::RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject
                 false);
 }
 
+//=======================================================================
+//function : RotationSweepObject1D
+//purpose  :
+//=======================================================================
+
+void SMESH_MeshEditor_i::RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
+                                              const SMESH::AxisStruct & theAxis,
+                                              CORBA::Double             theAngleInRadians,
+                                              CORBA::Long               theNbOfSteps,
+                                              CORBA::Double             theTolerance)
+{
+  if ( !myPreviewMode ) {
+    TPythonDump() << this << ".RotationSweepObject1D( "
+                  << theObject << ", "
+                  << theAxis << ", "
+                  << theAngleInRadians << ", "
+                  << theNbOfSteps << ", "
+                  << theTolerance << " )";
+  }
+  SMESH::long_array_var anElementsId = theObject->GetIDs();
+  rotationSweep(anElementsId,
+                theAxis,
+                theAngleInRadians,
+                theNbOfSteps,
+                theTolerance,
+                false,
+               SMDSAbs_Edge);
+}
+
+//=======================================================================
+//function : RotationSweepObject2D
+//purpose  :
+//=======================================================================
+
+void SMESH_MeshEditor_i::RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
+                                              const SMESH::AxisStruct & theAxis,
+                                              CORBA::Double             theAngleInRadians,
+                                              CORBA::Long               theNbOfSteps,
+                                              CORBA::Double             theTolerance)
+{
+  if ( !myPreviewMode ) {
+    TPythonDump() << this << ".RotationSweepObject2D( "
+                  << theObject << ", "
+                  << theAxis << ", "
+                  << theAngleInRadians << ", "
+                  << theNbOfSteps << ", "
+                  << theTolerance << " )";
+  }
+  SMESH::long_array_var anElementsId = theObject->GetIDs();
+  rotationSweep(anElementsId,
+                theAxis,
+                theAngleInRadians,
+                theNbOfSteps,
+                theTolerance,
+                false,
+               SMDSAbs_Face);
+}
+
 //=======================================================================
 //function : RotationSweepObjectMakeGroups
 //purpose  : 
@@ -1496,12 +1552,77 @@ SMESH_MeshEditor_i::RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr theO
                                                theTolerance,
                                                true);
   if ( !myPreviewMode ) {
-    TPythonDump() << "axis = " << theAxis;
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump<< this << ".RotationSweepObjectMakeGroups( "
-               << theObject
-               << ", axis, "
+               << theObject << ", "
+              << theAxis << ", "
+               << theAngleInRadians << ", "
+               << theNbOfSteps << ", "
+               << theTolerance << " )";
+  }
+  return aGroups;
+}
+
+//=======================================================================
+//function : RotationSweepObject1DMakeGroups
+//purpose  : 
+//=======================================================================
+
+SMESH::ListOfGroups*
+SMESH_MeshEditor_i::RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
+                                                   const SMESH::AxisStruct&  theAxis,
+                                                   CORBA::Double             theAngleInRadians,
+                                                   CORBA::Long               theNbOfSteps,
+                                                   CORBA::Double             theTolerance)
+{
+  SMESH::long_array_var anElementsId = theObject->GetIDs();
+  SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
+                                               theAxis,
+                                               theAngleInRadians,
+                                               theNbOfSteps,
+                                               theTolerance,
+                                               true,
+                                              SMDSAbs_Edge);
+  if ( !myPreviewMode ) {
+    TPythonDump aPythonDump;
+    DumpGroupsList(aPythonDump,aGroups);
+    aPythonDump<< this << ".RotationSweepObject1DMakeGroups( "
+               << theObject << ", "
+              << theAxis << ", "
+               << theAngleInRadians << ", "
+               << theNbOfSteps << ", "
+               << theTolerance << " )";
+  }
+  return aGroups;
+}
+
+//=======================================================================
+//function : RotationSweepObject2DMakeGroups
+//purpose  : 
+//=======================================================================
+
+SMESH::ListOfGroups*
+SMESH_MeshEditor_i::RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
+                                                   const SMESH::AxisStruct&  theAxis,
+                                                   CORBA::Double             theAngleInRadians,
+                                                   CORBA::Long               theNbOfSteps,
+                                                   CORBA::Double             theTolerance)
+{
+  SMESH::long_array_var anElementsId = theObject->GetIDs();
+  SMESH::ListOfGroups *aGroups = rotationSweep(anElementsId,
+                                               theAxis,
+                                               theAngleInRadians,
+                                               theNbOfSteps,
+                                               theTolerance,
+                                               true,
+                                              SMDSAbs_Face);
+  if ( !myPreviewMode ) {
+    TPythonDump aPythonDump;
+    DumpGroupsList(aPythonDump,aGroups);
+    aPythonDump<< this << ".RotationSweepObject2DMakeGroups( "
+               << theObject << ", "
+              << theAxis << ", "
                << theAngleInRadians << ", "
                << theNbOfSteps << ", "
                << theTolerance << " )";
@@ -1561,9 +1682,8 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen
 {
   extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, false );
   if ( !myPreviewMode ) {
-    TPythonDump() << "stepVector = " << theStepVector;
     TPythonDump() << this << ".ExtrusionSweep( "
-                  << theIDsOfElements << ", stepVector, " << theNbOfSteps << " )";
+                  << theIDsOfElements << ", " << theStepVector <<", " << theNbOfSteps << " )";
   }
 }
 
@@ -1580,9 +1700,8 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObjec
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false );
   if ( !myPreviewMode ) {
-    TPythonDump() << "stepVector = " << theStepVector;
     TPythonDump() << this << ".ExtrusionSweepObject( "
-                  << theObject << ", stepVector, " << theNbOfSteps << " )";
+                  << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
   }
 }
 
@@ -1598,9 +1717,8 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObj
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Edge );
   if ( !myPreviewMode ) {
-    TPythonDump() << "stepVector = " << theStepVector;
     TPythonDump() << this << ".ExtrusionSweepObject1D( "
-                  << theObject << ", stepVector, " << theNbOfSteps << " )";
+                  << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
   }
 }
 
@@ -1616,9 +1734,8 @@ void SMESH_MeshEditor_i::ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObj
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   extrusionSweep (anElementsId, theStepVector, theNbOfSteps, false, SMDSAbs_Face );
   if ( !myPreviewMode ) {
-    TPythonDump() << "stepVector = " << theStepVector;
     TPythonDump() << this << ".ExtrusionSweepObject2D( "
-                  << theObject << ", stepVector, " << theNbOfSteps << " )";
+                  << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
   }
 }
 
@@ -1635,11 +1752,10 @@ SMESH_MeshEditor_i::ExtrusionSweepMakeGroups(const SMESH::long_array& theIDsOfEl
   SMESH::ListOfGroups* aGroups = extrusionSweep (theIDsOfElements, theStepVector, theNbOfSteps, true );
     
   if ( !myPreviewMode ) {
-    TPythonDump() << "stepVector = " << theStepVector;
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump  << this << ".ExtrusionSweepMakeGroups( "
-                 << theIDsOfElements << ", stepVector, " << theNbOfSteps << " )";
+                 << theIDsOfElements << ", " << theStepVector <<", " << theNbOfSteps << " )";
   }
   return aGroups;
 }
@@ -1657,11 +1773,10 @@ SMESH_MeshEditor_i::ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr the
   SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true );
   
   if ( !myPreviewMode ) {
-    TPythonDump() << "stepVector = " << theStepVector;
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump<< this << ".ExtrusionSweepObjectMakeGroups( "
-               << theObject << ", stepVector, " << theNbOfSteps << " )";
+               << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
   }
   return aGroups;
 }
@@ -1679,11 +1794,10 @@ SMESH_MeshEditor_i::ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr t
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Edge );
   if ( !myPreviewMode ) {
-    TPythonDump() << "stepVector = " << theStepVector;
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".ExtrusionSweepObject1DMakeGroups( "
-                << theObject << ", stepVector, " << theNbOfSteps << " )";
+               << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
   }
   return aGroups;
 }
@@ -1701,11 +1815,10 @@ SMESH_MeshEditor_i::ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr t
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups * aGroups = extrusionSweep (anElementsId, theStepVector, theNbOfSteps, true, SMDSAbs_Face );
   if ( !myPreviewMode ) {
-    TPythonDump() << "stepVector = " << theStepVector;
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".ExtrusionSweepObject2DMakeGroups( "
-                << theObject << ", stepVector, " << theNbOfSteps << " )";
+               << theObject << ", " << theStepVector << ", " << theNbOfSteps << " )";
   }
   return aGroups;
 }
@@ -1842,7 +1955,8 @@ SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array &   theIDsOfEleme
                                        CORBA::Boolean              theHasRefPoint,
                                        const SMESH::PointStruct &  theRefPoint,
                                        const bool                  theMakeGroups,
-                                       SMESH::SMESH_MeshEditor::Extrusion_Error & theError)
+                                       SMESH::SMESH_MeshEditor::Extrusion_Error & theError,
+                                      const SMDSAbs_ElementType   theElementType)
 {
   initData();
 
@@ -1867,7 +1981,7 @@ SMESH_MeshEditor_i::extrusionAlongPath(const SMESH::long_array &   theIDsOfEleme
   }
 
   TIDSortedElemSet elements;
-  arrayToSet(theIDsOfElements, GetMeshDS(), elements);
+  arrayToSet(theIDsOfElements, GetMeshDS(), elements, theElementType);
 
   list<double> angles;
   for (int i = 0; i < theAngles.length(); i++) {
@@ -1912,24 +2026,18 @@ SMESH::SMESH_MeshEditor::Extrusion_Error
                                         const SMESH::PointStruct &  theRefPoint)
 {
   if ( !myPreviewMode ) {
-    TPythonDump() << "rotAngles = " << theAngles;
-
-    if ( theHasRefPoint )
-      TPythonDump() << "refPoint = SMESH.PointStruct( "
-                    << theRefPoint.x << ", "
-                    << theRefPoint.y << ", "
-                    << theRefPoint.z << " )";
-    else
-      TPythonDump() << "refPoint = SMESH.PointStruct( 0,0,0 )";
-
     TPythonDump() << "error = " << this << ".ExtrusionAlongPath( "
                   << theIDsOfElements << ", "
                   << thePathMesh      << ", "
                   << thePathShape     << ", "
                   << theNodeStart     << ", "
                   << theHasAngles     << ", "
-                  << "rotAngles"      << ", "
-                  << theHasRefPoint   << ", refPoint )";
+                  << theAngles        << ", "
+                  << theHasRefPoint   << ", "
+                  << "SMESH.PointStruct( "
+                  << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
+                  << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
+                  << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
   }
   SMESH::SMESH_MeshEditor::Extrusion_Error anError;
   extrusionAlongPath( theIDsOfElements,
@@ -1961,24 +2069,18 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObje
                                              const SMESH::PointStruct &  theRefPoint)
 {
   if ( !myPreviewMode ) {
-    TPythonDump() << "rotAngles = " << theAngles;
-
-    if ( theHasRefPoint )
-      TPythonDump() << "refPoint = SMESH.PointStruct( "
-                    << theRefPoint.x << ", "
-                    << theRefPoint.y << ", "
-                    << theRefPoint.z << " )";
-    else
-      TPythonDump() << "refPoint = SMESH.PointStruct( 0,0,0 )";
-
     TPythonDump() << "error = " << this << ".ExtrusionAlongPathObject( "
                   << theObject        << ", "
                   << thePathMesh      << ", "
                   << thePathShape     << ", "
                   << theNodeStart     << ", "
                   << theHasAngles     << ", "
-                  << "rotAngles"      << ", "
-                  << theHasRefPoint   << ", refPoint )";
+                  << theAngles        << ", "
+                  << theHasRefPoint   << ", "
+                  << "SMESH.PointStruct( "
+                  << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
+                  << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
+                  << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
   }
   SMESH::SMESH_MeshEditor::Extrusion_Error anError;
   SMESH::long_array_var anElementsId = theObject->GetIDs();
@@ -1995,6 +2097,96 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObje
   return anError;
 }
 
+//=======================================================================
+//function : ExtrusionAlongPathObject1D
+//purpose  :
+//=======================================================================
+
+SMESH::SMESH_MeshEditor::Extrusion_Error
+SMESH_MeshEditor_i::ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theObject,
+                                              SMESH::SMESH_Mesh_ptr       thePathMesh,
+                                              GEOM::GEOM_Object_ptr       thePathShape,
+                                              CORBA::Long                 theNodeStart,
+                                              CORBA::Boolean              theHasAngles,
+                                              const SMESH::double_array & theAngles,
+                                              CORBA::Boolean              theHasRefPoint,
+                                              const SMESH::PointStruct &  theRefPoint)
+{
+  if ( !myPreviewMode ) {
+    TPythonDump() << "error = " << this << ".ExtrusionAlongPathObject1D( "
+                  << theObject        << ", "
+                  << thePathMesh      << ", "
+                  << thePathShape     << ", "
+                  << theNodeStart     << ", "
+                  << theHasAngles     << ", "
+                  << theAngles        << ", "
+                  << theHasRefPoint   << ", "
+                  << "SMESH.PointStruct( "
+                  << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
+                  << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
+                  << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
+  }
+  SMESH::SMESH_MeshEditor::Extrusion_Error anError;
+  SMESH::long_array_var anElementsId = theObject->GetIDs();
+  extrusionAlongPath( anElementsId,
+                      thePathMesh,
+                      thePathShape,
+                      theNodeStart,
+                      theHasAngles,
+                      theAngles,
+                      theHasRefPoint,
+                      theRefPoint,
+                      false,
+                      anError,
+                     SMDSAbs_Edge);
+  return anError;
+}
+
+//=======================================================================
+//function : ExtrusionAlongPathObject2D
+//purpose  :
+//=======================================================================
+
+SMESH::SMESH_MeshEditor::Extrusion_Error
+SMESH_MeshEditor_i::ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr   theObject,
+                                              SMESH::SMESH_Mesh_ptr       thePathMesh,
+                                              GEOM::GEOM_Object_ptr       thePathShape,
+                                              CORBA::Long                 theNodeStart,
+                                              CORBA::Boolean              theHasAngles,
+                                              const SMESH::double_array & theAngles,
+                                              CORBA::Boolean              theHasRefPoint,
+                                              const SMESH::PointStruct &  theRefPoint)
+{
+  if ( !myPreviewMode ) {
+    TPythonDump() << "error = " << this << ".ExtrusionAlongPathObject2D( "
+                  << theObject        << ", "
+                  << thePathMesh      << ", "
+                  << thePathShape     << ", "
+                  << theNodeStart     << ", "
+                  << theHasAngles     << ", "
+                  << theAngles        << ", "
+                  << theHasRefPoint   << ", "
+                  << "SMESH.PointStruct( "
+                  << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
+                  << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
+                  << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
+  }
+  SMESH::SMESH_MeshEditor::Extrusion_Error anError;
+  SMESH::long_array_var anElementsId = theObject->GetIDs();
+  extrusionAlongPath( anElementsId,
+                      thePathMesh,
+                      thePathShape,
+                      theNodeStart,
+                      theHasAngles,
+                      theAngles,
+                      theHasRefPoint,
+                      theRefPoint,
+                      false,
+                      anError,
+                     SMDSAbs_Face);
+  return anError;
+}
+
 
 //=======================================================================
 //function : ExtrusionAlongPathMakeGroups
@@ -2023,16 +2215,6 @@ SMESH_MeshEditor_i::ExtrusionAlongPathMakeGroups(const SMESH::long_array&   theI
                                                          true,
                                                          Error);
   if ( !myPreviewMode ) {
-    TPythonDump() << "rotAngles = " << theAngles;
-
-    if ( theHasRefPoint )
-      TPythonDump() << "refPoint = SMESH.PointStruct( "
-                    << theRefPoint.x << ", "
-                    << theRefPoint.y << ", "
-                    << theRefPoint.z << " )";
-    else
-      TPythonDump() << "refPoint = SMESH.PointStruct( 0,0,0 )";
-
     bool isDumpGroups = aGroups && aGroups->length() > 0;
     TPythonDump aPythonDump;
     if(isDumpGroups) {
@@ -2049,8 +2231,12 @@ SMESH_MeshEditor_i::ExtrusionAlongPathMakeGroups(const SMESH::long_array&   theI
                << thePathShape     << ", "
                << theNodeStart     << ", "
                << theHasAngles     << ", "
-               << "rotAngles"      << ", "
-               << theHasRefPoint   << ", refPoint )";
+               << theAngles        << ", "
+               << theHasRefPoint   << ", "
+               << "SMESH.PointStruct( "
+               << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
+               << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
+               << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
   }
   return aGroups;
 }
@@ -2084,16 +2270,118 @@ ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
                                                       Error);
   
   if ( !myPreviewMode ) {
-    TPythonDump() << "rotAngles = " << theAngles;
+    bool isDumpGroups = aGroups && aGroups->length() > 0;
+    TPythonDump aPythonDump;
+    if(isDumpGroups) {
+      aPythonDump << "("<<aGroups;
+    }
+    if(isDumpGroups)
+      aPythonDump << ", error)";
+    else
+      aPythonDump <<"error";
+
+    aPythonDump << " = " << this << ".ExtrusionAlongPathObjectMakeGroups( "
+                << theObject << ", "
+                << thePathMesh      << ", "
+                << thePathShape     << ", "
+                << theNodeStart     << ", "
+                << theHasAngles     << ", "
+                << theAngles        << ", "
+               << theHasRefPoint   << ", "
+               << "SMESH.PointStruct( "
+               << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
+               << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
+               << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
+  }
+  return aGroups;
+}
 
-    if ( theHasRefPoint )
-      TPythonDump() << "refPoint = SMESH.PointStruct( "
-                    << theRefPoint.x << ", "
-                    << theRefPoint.y << ", "
-                    << theRefPoint.z << " )";
+//=======================================================================
+//function : ExtrusionAlongPathObject1DMakeGroups
+//purpose  : 
+//=======================================================================
+
+SMESH::ListOfGroups* SMESH_MeshEditor_i::
+ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
+                                    SMESH::SMESH_Mesh_ptr      thePathMesh,
+                                    GEOM::GEOM_Object_ptr      thePathShape,
+                                    CORBA::Long                theNodeStart,
+                                    CORBA::Boolean             theHasAngles,
+                                    const SMESH::double_array& theAngles,
+                                    CORBA::Boolean             theHasRefPoint,
+                                    const SMESH::PointStruct&  theRefPoint,
+                                    SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
+{
+  SMESH::long_array_var anElementsId = theObject->GetIDs();
+  SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
+                                                      thePathMesh,
+                                                      thePathShape,
+                                                      theNodeStart,
+                                                      theHasAngles,
+                                                      theAngles,
+                                                      theHasRefPoint,
+                                                      theRefPoint,
+                                                      true,
+                                                      Error,
+                                                     SMDSAbs_Edge);
+  
+  if ( !myPreviewMode ) {
+    bool isDumpGroups = aGroups && aGroups->length() > 0;
+    TPythonDump aPythonDump;
+    if(isDumpGroups) {
+      aPythonDump << "("<<aGroups;
+    }
+    if(isDumpGroups)
+      aPythonDump << ", error)";
     else
-      TPythonDump() << "refPoint = SMESH.PointStruct( 0,0,0 )";
-    
+      aPythonDump <<"error";
+
+    aPythonDump << " = " << this << ".ExtrusionAlongPathObject1DMakeGroups( "
+                << theObject << ", "
+                << thePathMesh      << ", "
+                << thePathShape     << ", "
+                << theNodeStart     << ", "
+                << theHasAngles     << ", "
+                << theAngles        << ", "
+               << theHasRefPoint   << ", "
+               << "SMESH.PointStruct( "
+               << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
+               << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
+               << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
+  }
+  return aGroups;
+}
+
+//=======================================================================
+//function : ExtrusionAlongPathObject2DMakeGroups
+//purpose  : 
+//=======================================================================
+
+SMESH::ListOfGroups* SMESH_MeshEditor_i::
+ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
+                                    SMESH::SMESH_Mesh_ptr      thePathMesh,
+                                    GEOM::GEOM_Object_ptr      thePathShape,
+                                    CORBA::Long                theNodeStart,
+                                    CORBA::Boolean             theHasAngles,
+                                    const SMESH::double_array& theAngles,
+                                    CORBA::Boolean             theHasRefPoint,
+                                    const SMESH::PointStruct&  theRefPoint,
+                                    SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
+{
+  SMESH::long_array_var anElementsId = theObject->GetIDs();
+  SMESH::ListOfGroups * aGroups = extrusionAlongPath( anElementsId,
+                                                      thePathMesh,
+                                                      thePathShape,
+                                                      theNodeStart,
+                                                      theHasAngles,
+                                                      theAngles,
+                                                      theHasRefPoint,
+                                                      theRefPoint,
+                                                      true,
+                                                      Error,
+                                                     SMDSAbs_Face);
+  
+  if ( !myPreviewMode ) {
     bool isDumpGroups = aGroups && aGroups->length() > 0;
     TPythonDump aPythonDump;
     if(isDumpGroups) {
@@ -2104,14 +2392,18 @@ ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
     else
       aPythonDump <<"error";
 
-    aPythonDump << " = " << this << ".ExtrusionAlongPathObjectMakeGroups( "
+    aPythonDump << " = " << this << ".ExtrusionAlongPathObject2DMakeGroups( "
                 << theObject << ", "
                 << thePathMesh      << ", "
                 << thePathShape     << ", "
                 << theNodeStart     << ", "
                 << theHasAngles     << ", "
-                << "rotAngles"      << ", "
-                << theHasRefPoint   << ", refPoint )";
+                << theAngles        << ", "
+               << theHasRefPoint   << ", "
+               << "SMESH.PointStruct( "
+               << ( theHasRefPoint ? theRefPoint.x : 0 ) << ", "
+               << ( theHasRefPoint ? theRefPoint.y : 0 ) << ", "
+               << ( theHasRefPoint ? theRefPoint.z : 0 ) << " ) )";
   }
   return aGroups;
 }
@@ -2285,12 +2577,11 @@ SMESH_MeshEditor_i::MirrorMakeGroups(const SMESH::long_array&            theIDsO
 {
   SMESH::ListOfGroups * aGroups = mirror(theIDsOfElements, theMirror, theMirrorType, true, true);
   if ( !myPreviewMode ) {
-    TPythonDump()<<"axis = "<<theMirror;
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".MirrorMakeGroups( "
                 << theIDsOfElements << ", "
-                << "axis, "
+                << theMirror << ", "
                 << mirrorTypeName(theMirrorType) << " )";
   }
   return aGroups;
@@ -2309,12 +2600,11 @@ SMESH_MeshEditor_i::MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr           t
   SMESH::long_array_var anElementsId = theObject->GetIDs();
   SMESH::ListOfGroups * aGroups = mirror(anElementsId, theMirror, theMirrorType, true, true);
   if ( !myPreviewMode ) {
-    TPythonDump()<<"axis = "<<theMirror;
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".MirrorObjectMakeGroups( "
                 << theObject << ", "
-                << "axis, "
+                << theMirror << ", "
                 << mirrorTypeName(theMirrorType) << " )";
   }
   return aGroups;
@@ -2450,10 +2740,9 @@ void SMESH_MeshEditor_i::Translate(const SMESH::long_array & theIDsOfElements,
                                    CORBA::Boolean            theCopy)
 {
   if ( !myPreviewMode ) {
-    TPythonDump() << "vector = " << theVector;
     TPythonDump() << this << ".Translate( "
-                  << theIDsOfElements
-                  << ", vector, "
+                  << theIDsOfElements << ", "
+                  << theVector << ", "
                   << theCopy << " )";
   }
   translate(theIDsOfElements,
@@ -2473,8 +2762,8 @@ void SMESH_MeshEditor_i::TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
 {
   if ( !myPreviewMode ) {
     TPythonDump() << this << ".TranslateObject( "
-                  << theObject
-                  << ", vector, "
+                  << theObject << ", "
+                  << theVector << ", "
                   << theCopy << " )";
   }
   SMESH::long_array_var anElementsId = theObject->GetIDs();
@@ -2495,12 +2784,11 @@ SMESH_MeshEditor_i::TranslateMakeGroups(const SMESH::long_array& theIDsOfElement
 {
   SMESH::ListOfGroups * aGroups = translate(theIDsOfElements,theVector,true,true);
   if ( !myPreviewMode ) {
-    TPythonDump() << "vector = " << theVector;
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".TranslateMakeGroups( "
-                << theIDsOfElements
-                << ", vector )";
+                << theIDsOfElements << ", "
+                << theVector << " )";
   }
   return aGroups;
 }
@@ -2519,12 +2807,11 @@ SMESH_MeshEditor_i::TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObjec
   
   if ( !myPreviewMode ) {
 
-    TPythonDump() << "vector = " << theVector;
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".TranslateObjectMakeGroups( "
-                << theObject
-                << ", vector )";
+                << theObject << ", "
+                << theVector << " )";
   }
   return aGroups;
 }
@@ -2660,10 +2947,9 @@ void SMESH_MeshEditor_i::Rotate(const SMESH::long_array & theIDsOfElements,
                                 CORBA::Boolean            theCopy)
 {
   if ( !myPreviewMode ) {
-    TPythonDump() << "axis = " << theAxis;
     TPythonDump() << this << ".Rotate( "
-                  << theIDsOfElements
-                  << ", axis, "
+                  << theIDsOfElements << ", "
+                  << theAxis << ", "
                   << theAngle << ", "
                   << theCopy << " )";
   }
@@ -2685,10 +2971,9 @@ void SMESH_MeshEditor_i::RotateObject(SMESH::SMESH_IDSource_ptr theObject,
                                      CORBA::Boolean            theCopy)
 {
   if ( !myPreviewMode ) {
-    TPythonDump() << "axis = " << theAxis;
     TPythonDump() << this << ".RotateObject( "
-                  << theObject
-                  << ", axis, "
+                  << theObject << ", "
+                  << theAxis << ", "
                   << theAngle << ", "
                   << theCopy << " )";
   }
@@ -2712,12 +2997,11 @@ SMESH_MeshEditor_i::RotateMakeGroups(const SMESH::long_array& theIDsOfElements,
 {
   SMESH::ListOfGroups * aGroups =  rotate(theIDsOfElements,theAxis,theAngle,true,true);
   if ( !myPreviewMode ) {
-    TPythonDump() << "axis = " << theAxis;
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".RotateMakeGroups( "
-                << theIDsOfElements
-                << ", axis, "
+                << theIDsOfElements << ", "
+               << theAxis << ", "
                 << theAngle << " )";
   }
   return aGroups;
@@ -2737,13 +3021,12 @@ SMESH_MeshEditor_i::RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
   SMESH::ListOfGroups * aGroups =  rotate(anElementsId,theAxis,theAngle,true,true);
  
   if ( !myPreviewMode ) {
-    TPythonDump() << "axis = " << theAxis;
     TPythonDump aPythonDump;
     DumpGroupsList(aPythonDump,aGroups);
     aPythonDump << this << ".RotateObjectMakeGroups( "
-                  << theObject
-                  << ", axis, "
-                  << theAngle << " )";
+               << theObject << ", "
+               << theAxis << ", "
+               << theAngle << " )";
   }
   return aGroups;
 }
index eff6e21e41f55415104295b7e4d6bbfb500480d9..b127f2f895ba3de638ae435a89ed95adafbe21fa 100644 (file)
@@ -181,6 +181,16 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                           CORBA::Double             AngleInRadians,
                           CORBA::Long               NbOfSteps,
                           CORBA::Double             Tolerance);
+  void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
+                            const SMESH::AxisStruct & Axis,
+                            CORBA::Double             AngleInRadians,
+                            CORBA::Long               NbOfSteps,
+                            CORBA::Double             Tolerance);
+  void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
+                            const SMESH::AxisStruct & Axis,
+                            CORBA::Double             AngleInRadians,
+                            CORBA::Long               NbOfSteps,
+                            CORBA::Double             Tolerance);
 
   void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
                       const SMESH::DirStruct &  StepVector,
@@ -219,6 +229,24 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                              const SMESH::double_array & Angles,
                              CORBA::Boolean              HasRefPoint,
                              const SMESH::PointStruct &  RefPoint);
+  SMESH::SMESH_MeshEditor::Extrusion_Error
+    ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theObject,
+                              SMESH::SMESH_Mesh_ptr       PathMesh,
+                              GEOM::GEOM_Object_ptr       PathShape,
+                              CORBA::Long                 NodeStart,
+                              CORBA::Boolean              HasAngles,
+                              const SMESH::double_array & Angles,
+                              CORBA::Boolean              HasRefPoint,
+                              const SMESH::PointStruct &  RefPoint);
+  SMESH::SMESH_MeshEditor::Extrusion_Error
+    ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr   theObject,
+                              SMESH::SMESH_Mesh_ptr       PathMesh,
+                              GEOM::GEOM_Object_ptr       PathShape,
+                              CORBA::Long                 NodeStart,
+                              CORBA::Boolean              HasAngles,
+                              const SMESH::double_array & Angles,
+                              CORBA::Boolean              HasRefPoint,
+                              const SMESH::PointStruct &  RefPoint);
 
   SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr       PathMesh,
                                              GEOM::GEOM_Object_ptr       PathShape,
@@ -257,6 +285,16 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                                                      CORBA::Double             AngleInRadians,
                                                      CORBA::Long               NbOfSteps,
                                                      CORBA::Double             Tolerance);
+  SMESH::ListOfGroups* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
+                                                      const SMESH::AxisStruct&  Axix,
+                                                      CORBA::Double             AngleInRadians,
+                                                      CORBA::Long               NbOfSteps,
+                                                      CORBA::Double             Tolerance);
+  SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
+                                                      const SMESH::AxisStruct&  Axix,
+                                                      CORBA::Double             AngleInRadians,
+                                                      CORBA::Long               NbOfSteps,
+                                                      CORBA::Double             Tolerance);
   SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
                                                 const SMESH::DirStruct&  StepVector,
                                                 CORBA::Long              NbOfSteps);
@@ -292,6 +330,24 @@ class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
                                                           CORBA::Boolean             HasRefPoint,
                                                           const SMESH::PointStruct&  RefPoint,
                                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
+  SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
+                                                           SMESH::SMESH_Mesh_ptr      PathMesh,
+                                                           GEOM::GEOM_Object_ptr      PathShape,
+                                                           CORBA::Long                NodeStart,
+                                                           CORBA::Boolean             HasAngles,
+                                                           const SMESH::double_array& Angles,
+                                                           CORBA::Boolean             HasRefPoint,
+                                                           const SMESH::PointStruct&  RefPoint,
+                                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
+  SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
+                                                           SMESH::SMESH_Mesh_ptr      PathMesh,
+                                                           GEOM::GEOM_Object_ptr      PathShape,
+                                                           CORBA::Long                NodeStart,
+                                                           CORBA::Boolean             HasAngles,
+                                                           const SMESH::double_array& Angles,
+                                                           CORBA::Boolean             HasRefPoint,
+                                                           const SMESH::PointStruct&  RefPoint,
+                                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
   SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array&            IDsOfElements,
                                         const SMESH::AxisStruct&            Mirror,
                                         SMESH::SMESH_MeshEditor::MirrorType MirrorType);
@@ -454,7 +510,8 @@ private: //!< private methods
                                      CORBA::Double             AngleInRadians,
                                      CORBA::Long               NbOfSteps,
                                      CORBA::Double             Tolerance,
-                                     const bool                MakeGroups);
+                                     const bool                MakeGroups,
+                                    const SMDSAbs_ElementType ElementType=SMDSAbs_All);
   SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
                                       const SMESH::DirStruct &  StepVector,
                                       CORBA::Long               NbOfSteps,
@@ -475,7 +532,8 @@ private: //!< private methods
                                           CORBA::Boolean              HasRefPoint,
                                           const SMESH::PointStruct &  RefPoint,
                                           const bool                  MakeGroups,
-                                          SMESH::SMESH_MeshEditor::Extrusion_Error & Error);
+                                          SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
+                                         const SMDSAbs_ElementType   ElementType=SMDSAbs_All);
   SMESH::ListOfGroups* mirror(const SMESH::long_array &           IDsOfElements,
                               const SMESH::AxisStruct &           Axis,
                               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
index f38ecd1fc93f346f131fc73ffd0558a9d748ca2e..04697f7d4d133854e6610c4a0e9defcfb9bf82a6 100644 (file)
@@ -3112,3 +3112,50 @@ void SMESH_Mesh_i::checkGroupNames()
       aGrp->SetName( guiName );
   }
 }
+
+//=============================================================================
+/*!
+ * \brief Sets list of notebook variables used for Mesh operations separated by ":" symbol
+ */
+//=============================================================================
+void SMESH_Mesh_i::SetParameters(const char* theParameters)
+{
+  SMESH_Gen_i::GetSMESHGen()->UpdateParameters(SMESH::SMESH_Mesh::_narrow(_this()),
+                                               CORBA::string_dup(theParameters));
+}
+
+//=============================================================================
+/*!
+ * \brief Returns list of notebook variables used for Mesh operations separated by ":" symbol
+ */
+//=============================================================================
+char* SMESH_Mesh_i::GetParameters()
+{
+  SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
+  return CORBA::string_dup(gen->GetParameters(SMESH::SMESH_Mesh::_narrow(_this())));
+}
+
+//=============================================================================
+/*!
+ * \brief Returns list of notebook variables used for last Mesh operation
+ */
+//=============================================================================
+SMESH::string_array* SMESH_Mesh_i::GetLastParameters()
+{
+  SMESH::string_array_var aResult = new SMESH::string_array();
+  SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
+  if(gen) {
+    char *aParameters = GetParameters();
+    SALOMEDS::Study_ptr aStudy = gen->GetCurrentStudy();
+    if(!aStudy->_is_nil()) {
+      SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters); 
+      if(aSections->length() > 0) {
+        SALOMEDS::ListOfStrings aVars = aSections[aSections->length()-1];
+        aResult->length(aVars.length());
+        for(int i = 0;i < aVars.length();i++)
+          aResult[i] = CORBA::string_dup( aVars[i]);
+      }
+    }
+  }
+  return aResult._retn();
+}
index a0cd6a7d974bc592eb2e5ba5879bdaf64aeecf55..32fe2153dbdfeeca1f3d7836b835f05bd04cdd6b 100644 (file)
@@ -468,6 +468,21 @@ public:
    */
   virtual SALOME_MED::MedFileInfo* GetMEDFileInfo();
 
+  /*!
+   * Sets list of notebook variables used for Mesh operations separated by ":" symbol
+   */
+  void SetParameters (const char* theParameters);
+  
+  /*!
+   * Returns list of notebook variables used for Mesh operations separated by ":" symbol
+   */
+  char* GetParameters();
+
+  /*!
+   * Returns list of notebook variables used for last Mesh operation
+   */
+  SMESH::string_array* GetLastParameters();
+  
   std::map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI
   std::map<int, ::SMESH_subMesh*> _mapSubMesh;   //NRI
 
diff --git a/src/SMESH_I/SMESH_NoteBook.cxx b/src/SMESH_I/SMESH_NoteBook.cxx
new file mode 100644 (file)
index 0000000..bd72680
--- /dev/null
@@ -0,0 +1,861 @@
+// Copyright (C) 2008  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File      : SMESH_NoteBook.cxx
+// Author    : Roman NIKOLAEV
+
+#include "SMESH_2smeshpy.hxx"
+#include "SMESH_NoteBook.hxx"
+#include "SMESH_Gen_i.hxx"
+#include "SMESH_PythonDump.hxx"
+
+#include <Resource_DataMapOfAsciiStringAsciiString.hxx>
+#include <TColStd_SequenceOfAsciiString.hxx>
+#include <TColStd_HSequenceOfInteger.hxx>
+
+#include <vector>
+#include <string>
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+using namespace std;
+
+
+void SetVariable(Handle(_pyCommand) theCommand,const ObjectStates* theStates, int position, int theArgNb);
+
+//================================================================================
+/*!
+ * \brief Constructor
+ */
+//================================================================================
+ObjectStates::ObjectStates(TCollection_AsciiString theType)
+{
+  _type = theType;
+  _dumpstate = 0;
+}
+
+//================================================================================
+/*!
+ * \brief Destructor
+ */
+//================================================================================
+ObjectStates::~ObjectStates()
+{
+}
+
+//================================================================================
+/*!
+ * \brief Add new object state 
+ * \param theState - Object state (vector of notebook variable)
+ */
+//================================================================================
+void ObjectStates::AddState(const TState &theState)
+{
+  _states.push_back(theState);
+}
+
+//================================================================================
+/*!
+ * \brief Return current object state
+ * \\retval state - Object state (vector of notebook variable)
+ */
+//================================================================================
+TState ObjectStates::GetCurrectState() const
+{
+  if(_states.size() > _dumpstate)
+    return _states[_dumpstate];
+  TState empty;
+  return empty;
+}
+
+
+//================================================================================
+/*!
+ *
+ */
+//================================================================================
+TAllStates ObjectStates::GetAllStates() const
+{
+  return _states;
+}
+
+//================================================================================
+/*!
+ *
+ */
+//================================================================================
+void ObjectStates::IncrementState()
+{
+  _dumpstate++;
+}
+
+//================================================================================
+/*!
+ *
+ */
+//================================================================================
+TCollection_AsciiString ObjectStates::GetObjectType() const{
+  return _type;
+}
+
+
+//================================================================================
+/*!
+ * \brief Constructor
+ */
+//================================================================================
+LayerDistributionStates::LayerDistributionStates():
+  ObjectStates("LayerDistribution")
+{
+}
+//================================================================================
+/*!
+ * \brief Destructor
+ */
+//================================================================================
+LayerDistributionStates::~LayerDistributionStates()
+{
+}
+
+
+//================================================================================
+/*!
+ * \brief AddDistribution
+ */
+//================================================================================
+void LayerDistributionStates::AddDistribution(const TCollection_AsciiString& theDistribution)
+{
+  _distributions.insert(pair<TCollection_AsciiString,TCollection_AsciiString>(theDistribution,""));
+}
+
+//================================================================================
+/*!
+ * \brief HasDistribution
+ */
+//================================================================================
+bool LayerDistributionStates::HasDistribution(const TCollection_AsciiString& theDistribution) const
+{
+  return _distributions.find(theDistribution) != _distributions.end();
+}
+
+//================================================================================
+/*!
+ * \brief SetDistributionType
+ */
+//================================================================================
+bool LayerDistributionStates::SetDistributionType(const TCollection_AsciiString& theDistribution,
+                                                  const TCollection_AsciiString& theType)
+{
+  TDistributionMap::iterator it = _distributions.find(theDistribution);
+  if(it == _distributions.end())
+    return false;
+  (*it).second = theType;
+  return true;
+}
+
+//================================================================================
+/*!
+ * \brief GetDistributionType
+ */
+//================================================================================
+TCollection_AsciiString LayerDistributionStates::
+GetDistributionType(const TCollection_AsciiString& theDistribution) const
+{
+  TDistributionMap::const_iterator it = _distributions.find(theDistribution);
+  return (it == _distributions.end()) ? TCollection_AsciiString() : (*it).second;
+}
+
+//================================================================================
+/*!
+ * \brief Constructor
+ */
+//================================================================================
+SMESH_NoteBook::SMESH_NoteBook()
+{
+  InitObjectMap();
+}
+
+//================================================================================
+/*!
+ * \brief Destructor
+ */
+//================================================================================
+SMESH_NoteBook::~SMESH_NoteBook()
+{
+  TVariablesMap::const_iterator it = _objectMap.begin();
+  for(;it!=_objectMap.end();it++) {
+    if((*it).second)
+      delete (*it).second;
+  }
+}
+
+//================================================================================
+/*!
+ * \brief Replace parameters of the functions on the Salome NoteBook Variables
+ * \param theString - Input string
+ * \retval TCollection_AsciiString - Convertion result
+ */
+//================================================================================
+void SMESH_NoteBook::ReplaceVariables()
+{
+  for(int i=0;i<_commands.size();i++) {
+    Handle(_pyCommand) aCmd = _commands[i];
+    TCollection_AsciiString aMethod = aCmd->GetMethod();
+    TCollection_AsciiString aObject = aCmd->GetObject();
+    TCollection_AsciiString aResultValue = aCmd->GetResultValue();
+    if(MYDEBUG) {
+      cout<<"Command before : "<< aCmd->GetString()<<endl;
+      cout<<"Method : "<< aMethod<<endl;
+      cout<<"Object : "<< aObject<<endl;
+      cout<<"Result : "<< aResultValue<<endl;
+    }
+    
+    // check if method modifies the object itself
+    TVariablesMap::const_iterator it = _objectMap.find(aObject);
+    if(it == _objectMap.end()) // check if method returns a new object
+      it = _objectMap.find(aResultValue);
+    
+    if(it == _objectMap.end()) { // check if method modifies a mesh using mesh editor
+      TMeshEditorMap::const_iterator meIt = myMeshEditors.find(aObject);
+      if(meIt != myMeshEditors.end()) {
+        TCollection_AsciiString aMesh = (*meIt).second;
+       it = _objectMap.find(aMesh);
+      }
+    }
+    
+    if(it == _objectMap.end()) { // additional check for pattern mapping
+      if(aMethod.IsEqual("ApplyToMeshFaces") ||
+        aMethod.IsEqual("ApplyToHexahedrons"))
+       it = _objectMap.find(aCmd->GetArg(1));
+    }
+    
+    if(it != _objectMap.end()) {
+      if(MYDEBUG)
+       cout << "Found object : " << (*it).first << endl;
+      ObjectStates *aStates = (*it).second;
+      // Case for LocalLength hypothesis
+      if(aStates->GetObjectType().IsEqual("LocalLength") && aStates->GetCurrectState().size() >= 2) {
+        if(aMethod.IsEqual("SetLength")) {
+          if(!aStates->GetCurrectState().at(0).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+          aStates->IncrementState();
+        }
+        else if(aMethod.IsEqual("SetPrecision")) {
+          if(!aStates->GetCurrectState().at(1).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(1));
+          aStates->IncrementState();
+        }
+      }
+      
+      // Case for SegmentLengthAroundVertex hypothesis
+      else if(aStates->GetObjectType().IsEqual("SegmentLengthAroundVertex")
+              && aStates->GetCurrectState().size() >= 1) {
+        if(aMethod == "SetLength") {
+          if(!aStates->GetCurrectState().at(0).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+          aStates->IncrementState();
+        }
+      }
+
+      // Case for Arithmetic1D and StartEndLength hypothesis
+      else if(aStates->GetObjectType().IsEqual("Arithmetic1D") || 
+              aStates->GetObjectType().IsEqual("StartEndLength")) {
+        if(aMethod == "SetLength" &&
+           aStates->GetCurrectState().size() >= 2) {
+          if(aCmd->GetArg(2) == "1" && !aStates->GetCurrectState().at(0).IsEmpty())
+            aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+          else if(!aStates->GetCurrectState().at(1).IsEmpty())
+            aCmd->SetArg(1,aStates->GetCurrectState().at(1));
+          aStates->IncrementState();
+        }
+      }
+      
+      //Case for Deflection1D hypothesis
+      else if(aStates->GetObjectType().IsEqual("Deflection1D")){
+        if(aMethod == "SetDeflection" && aStates->GetCurrectState().size() >= 1) {
+          if(!aStates->GetCurrectState().at(0).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+          aStates->IncrementState();
+        }
+      }
+      
+      // Case for LayerDistribution hypothesis (not finished yet)
+      else if(aStates->GetObjectType() == "LayerDistribution") {
+        if(aMethod == "SetLayerDistribution"){
+          LayerDistributionStates* aLDStates = (LayerDistributionStates*)(aStates);
+          aLDStates->AddDistribution(aCmd->GetArg(1));
+          if(MYDEBUG)
+            cout<<"Add Distribution :"<<aCmd->GetArg(1)<<endl;
+        }
+      }
+      
+      // Case for MaxElementArea hypothesis
+      else if(aStates->GetObjectType().IsEqual("MaxElementArea")){
+        if(aMethod == "SetMaxElementArea" && aStates->GetCurrectState().size() >= 1) {
+          if(!aStates->GetCurrectState().at(0).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+          aStates->IncrementState();
+        }
+      }
+
+      // Case for MaxElementVolume hypothesis
+      else if(aStates->GetObjectType().IsEqual("MaxElementVolume")){
+        if(aMethod == "SetMaxElementVolume" && aStates->GetCurrectState().size() >= 1) {
+          if(!aStates->GetCurrectState().at(0).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+          aStates->IncrementState();
+        }
+      }
+
+      // Case for NETGEN_Parameters_2D or NETGEN_Parameters_2D hypothesis
+      else if(aStates->GetObjectType().IsEqual("NETGEN_Parameters_2D") ||
+              aStates->GetObjectType().IsEqual("NETGEN_Parameters")){
+        if(aMethod == "SetMaxSize" && aStates->GetCurrectState().size() >= 1) {
+          if(!aStates->GetCurrectState().at(0).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+          aStates->IncrementState();
+        }
+        else if(aMethod == "SetGrowthRate" && aStates->GetCurrectState().size() >= 2) {
+          if(!aStates->GetCurrectState().at(1).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(1));
+          aStates->IncrementState();
+        }
+        else if(aMethod == "SetNbSegPerEdge" && aStates->GetCurrectState().size() >= 3) {
+          if(!aStates->GetCurrectState().at(2).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(2));
+          aStates->IncrementState();
+        } 
+        else if(aMethod == "SetNbSegPerRadius" && aStates->GetCurrectState().size() >= 4) {
+          if(!aStates->GetCurrectState().at(3).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(3));
+          aStates->IncrementState();
+        } 
+      }
+
+      // Case for NETGEN_SimpleParameters_3D or NETGEN_SimpleParameters_2D hypothesis
+      else if(aStates->GetObjectType().IsEqual("NETGEN_SimpleParameters_3D") ||
+              aStates->GetObjectType().IsEqual("NETGEN_SimpleParameters_2D")){
+
+        if((aMethod == "SetNumberOfSegments" || aMethod == "SetLocalLength") && 
+           aStates->GetCurrectState().size() >= 1) {
+          if(!aStates->GetCurrectState().at(0).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+          aStates->IncrementState();
+        }
+        else if(aMethod == "SetMaxElementArea" && aStates->GetCurrectState().size() >= 2) {
+          if(!aStates->GetCurrectState().at(1).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(1));
+          aStates->IncrementState();
+        }
+        else if(aMethod == "SetMaxElementVolume" && aStates->GetCurrectState().size() >= 3) {
+          if(!aStates->GetCurrectState().at(2).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(2));
+          aStates->IncrementState();
+        }
+        else if(aMethod == "LengthFromEdges" || aMethod == "LengthFromFaces"){
+          aStates->IncrementState();
+        }
+      }
+      
+      // Case for NumberOfLayers hypothesis
+      else if(aStates->GetObjectType().IsEqual("NumberOfLayers")){
+        if(aMethod == "SetNumberOfLayers" && aStates->GetCurrectState().size() >= 1) {
+          if(!aStates->GetCurrectState().at(0).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+          aStates->IncrementState();
+        }
+      }
+
+      // Case for NumberOfSegments hypothesis
+      else if(aStates->GetObjectType().IsEqual("NumberOfSegments")){
+        if(aMethod == "SetNumberOfSegments" && aStates->GetCurrectState().size() >= 1) {
+          if(!aStates->GetCurrectState().at(0).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(0));
+          if(aStates->GetCurrectState().size()==1)
+            aStates->IncrementState();
+        }
+        else if (aMethod == "SetScaleFactor" && aStates->GetCurrectState().size() >= 2) {
+          if(!aStates->GetCurrectState().at(1).IsEmpty() )
+            aCmd->SetArg(1,aStates->GetCurrectState().at(1));
+          aStates->IncrementState();
+        }
+      }
+      
+      else if(aStates->GetObjectType().IsEqual("Mesh")) {
+       TState aCurrentState = aStates->GetCurrectState();
+        int aCurrentStateSize = aCurrentState.size();
+       if(aMethod.IsEqual("Translate")                  ||
+           aMethod.IsEqual("TranslateMakeGroups")        ||
+           aMethod.IsEqual("TranslateMakeMesh")          ||
+           aMethod.IsEqual("TranslateObject")            ||
+           aMethod.IsEqual("TranslateObjectMakeGroups")  ||
+           aMethod.IsEqual("TranslateObjectMakeMesh")) {
+          bool isVariableFound = false;
+          int anArgIndex = 0;
+          for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
+            if(aCmd->GetArg(i).IsEqual("SMESH.PointStruct")) {
+              anArgIndex = i+1;
+              break;
+            }
+          }
+          if(anArgIndex > 0) {
+           if(aCurrentStateSize == 3) { // translation by dx, dy, dz
+             for(int j = 0; j < aCurrentStateSize; j++) {
+               if(!aCurrentState.at(j).IsEmpty()) {
+                 isVariableFound = true;
+                 aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+               }
+             }
+           }
+           else if(aCurrentStateSize == 6) { // translation by x1, x2, y1, y2, z1, z2
+             // TODO: limitation until operations on the variables will be introduced
+             /*
+             isVariableFound = true;
+             for(int j = 0; j < 3; j++) {
+               TCollection_AsciiString anArg = aCmd->GetArg(anArgIndex+j);
+               TCollection_AsciiString aValue1 = aCurrentState.at(2*j), aValue2 = aCurrentState.at(2*j+1);
+               bool aV1 = !aValue1.IsEmpty();
+               bool aV2 = !aValue2.IsEmpty();
+               double aValue, aCurrentValue = anArg.IsRealValue() ? anArg.RealValue() : 0;
+               if(aV1 && !aV2) {
+                 if(!GetReal(aValue1, aValue))
+                   aValue = 0;
+                 aValue2 = TCollection_AsciiString( aValue + aCurrentValue );
+               }
+               else if(!aV1 && aV2) {
+                 if(!GetReal(aValue2, aValue))
+                   aValue = 0;
+                 aValue1 = TCollection_AsciiString( aValue - aCurrentValue );
+               }
+               else if(!aV1 && !aV2) {
+                 aValue1 = TCollection_AsciiString( 0 );
+                 aValue2 = TCollection_AsciiString( aCurrentValue );
+               }
+               aCmd->SetArg(anArgIndex+j, aValue1 + ", " + aValue2 );
+             }
+             */
+           }
+          }
+          if(isVariableFound) {
+            TCollection_AsciiString aDim;
+           if(aCurrentStateSize == 6)
+             aDim = "6";
+            aCmd->SetArg(anArgIndex - 1, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".PointStructStr"+aDim);
+            aCmd->SetArg(anArgIndex - 2, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".DirStructStr");
+          }
+          aStates->IncrementState();
+        }
+       else if(aMethod.IsEqual("Rotate")                  ||
+               aMethod.IsEqual("RotateMakeGroups")        ||
+               aMethod.IsEqual("RotateMakeMesh")          ||
+                aMethod.IsEqual("RotateObject")            ||
+                aMethod.IsEqual("RotateObjectMakeGroups")  ||
+                aMethod.IsEqual("RotateObjectMakeMesh")    ||
+               aMethod.IsEqual("RotationSweep")           ||
+               aMethod.IsEqual("RotationSweepObject")     ||
+               aMethod.IsEqual("RotationSweepObject1D")   ||
+               aMethod.IsEqual("RotationSweepObject2D")   ||
+               aMethod.IsEqual("RotationSweepMakeGroups") ||
+               aMethod.IsEqual("RotationSweepObjectMakeGroups") ||
+               aMethod.IsEqual("RotationSweepObject1DMakeGroups") ||
+               aMethod.IsEqual("RotationSweepObject2DMakeGroups") ||
+               aMethod.IsEqual("Mirror")                  ||
+               aMethod.IsEqual("MirrorMakeMesh")          ||
+                aMethod.IsEqual("MirrorMakeGroups")        ||
+                aMethod.IsEqual("MirrorObject")            || 
+                aMethod.IsEqual("MirrorObjectMakeMesh")    ||
+                aMethod.IsEqual("MirrorObjectMakeGroups")) {
+         bool isSubstitute = false;
+         int anArgIndex = 0;
+         for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
+           if(aCmd->GetArg(i).IsEqual("SMESH.AxisStruct")) {
+             anArgIndex = i+1;
+             break;
+           }
+         }
+         if(anArgIndex > 0) {
+           for(int j = 0; j < aCurrentStateSize; j++) {
+             if(!aCurrentState.at(j).IsEmpty()) {
+               if(j < 6) // 0-5 - axis struct, 6 - angle (rotation & sweep), 7-8 - nbSteps and tolerance (sweep)
+                 isSubstitute = true;
+               aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+             }
+           }
+         }
+         if(isSubstitute)
+           aCmd->SetArg(anArgIndex - 1, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".AxisStructStr");
+         aStates->IncrementState();
+       }
+       else if(aMethod.IsEqual("AddNode") ||
+               aMethod.IsEqual("MoveClosestNodeToPoint")) {
+         for(int j = 0; j < aCurrentStateSize; j++) {
+           if(!aCurrentState.at(j).IsEmpty())
+             aCmd->SetArg(j+1, aCurrentState.at(j));
+         }
+         aStates->IncrementState();
+       }
+       else if(aMethod.IsEqual("MoveNode")) {
+         for(int j = 0; j < aCurrentStateSize; j++) {
+           if(!aCurrentState.at(j).IsEmpty())
+             aCmd->SetArg(j+2, aCurrentState.at(j));
+         }
+         aStates->IncrementState();
+       }
+       else if(aMethod.IsEqual("ExtrusionSweep") ||
+               aMethod.IsEqual("ExtrusionSweepObject") ||
+               aMethod.IsEqual("ExtrusionSweepObject1D") ||
+               aMethod.IsEqual("ExtrusionSweepObject2D") ||
+               aMethod.IsEqual("ExtrusionSweepMakeGroups") ||
+               aMethod.IsEqual("ExtrusionSweepObjectMakeGroups") ||
+               aMethod.IsEqual("ExtrusionSweepObject1DMakeGroups") ||
+               aMethod.IsEqual("ExtrusionSweepObject2DMakeGroups")) {
+         bool isSubstitute = false;
+         int anArgIndex = 0;
+         for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
+           if(aCmd->GetArg(i).IsEqual("SMESH.PointStruct")) {
+             anArgIndex = i+1;
+             break;
+           }
+         }
+         if(anArgIndex > 0) {
+           for(int j = 0; j < aCurrentStateSize; j++) {
+             if(!aCurrentState.at(j).IsEmpty()) {
+               if(j < 3) // 0-2 - dir struct, 3 - number of steps
+                 isSubstitute = true;
+               aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+             }
+           }
+         }
+         if(isSubstitute) {
+            aCmd->SetArg(anArgIndex - 1, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".PointStructStr");
+            aCmd->SetArg(anArgIndex - 2, TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".DirStructStr");
+         }
+         aStates->IncrementState();
+       }
+       else if(aMethod.IsEqual("ExtrusionAlongPath") ||
+               aMethod.IsEqual("ExtrusionAlongPathObject") ||
+               aMethod.IsEqual("ExtrusionAlongPathObject1D") ||
+               aMethod.IsEqual("ExtrusionAlongPathObject2D") ||
+               aMethod.IsEqual("ExtrusionAlongPathMakeGroups") ||
+               aMethod.IsEqual("ExtrusionAlongPathObjectMakeGroups") ||
+               aMethod.IsEqual("ExtrusionAlongPathObject1DMakeGroups") ||
+               aMethod.IsEqual("ExtrusionAlongPathObject2DMakeGroups") ||
+               /* workaround for a bug in the command parsing algorithm */
+               aCmd->GetString().Search("ExtrusionAlongPathMakeGroups") != -1 ||
+               aCmd->GetString().Search("ExtrusionAlongPathObjectMakeGroups") != -1 ||
+               aCmd->GetString().Search("ExtrusionAlongPathObject1DMakeGroups") != -1 ||
+               aCmd->GetString().Search("ExtrusionAlongPathObject2DMakeGroups") != -1 ) {
+         int aNbAngles = aCurrentStateSize-3; // State looks like "Angle1:...:AngleN:X:Y:Z"
+         bool isSubstitute = false;
+         int anArgIndex = 0;
+         for(int i = 1, n = aCmd->GetNbArgs(); i <= n; i++) {
+           if(aCmd->GetArg(i).IsEqual("SMESH.PointStruct")) {
+             anArgIndex = i-1-aNbAngles;
+             break;
+           }
+         }
+         if(anArgIndex > 0) {
+           int j = 0;
+           for(; j < aNbAngles; j++) {
+             if(!aCurrentState.at(j).IsEmpty()) {
+               aCmd->SetArg(anArgIndex+j-1, aCurrentState.at(j));
+             }
+           }
+           for(; j < aNbAngles+3; j++) {
+             if(!aCurrentState.at(j).IsEmpty()) {
+               isSubstitute = true;
+               aCmd->SetArg(anArgIndex+j+2, aCurrentState.at(j));
+             }
+           }
+         }
+         if(isSubstitute)
+           aCmd->SetArg(anArgIndex + aNbAngles + 1,
+                        TCollection_AsciiString(SMESH_2smeshpy::SmeshpyName())+".PointStructStr");
+         aStates->IncrementState();
+       }
+       else if(aMethod.IsEqual("TriToQuad") ||
+               aMethod.IsEqual("Concatenate") ||
+               aMethod.IsEqual("ConcatenateWithGroups")) {
+         if(aCurrentStateSize && !aCurrentState.at(0).IsEmpty())
+           aCmd->SetArg(aCmd->GetNbArgs(), aCurrentState.at(0));
+         aStates->IncrementState();
+       }
+       else if(aMethod.IsEqual("Smooth") ||
+               aMethod.IsEqual("SmoothObject") ||
+               aMethod.IsEqual("SmoothParametric") ||
+               aMethod.IsEqual("SmoothParametricObject")) {
+         int anArgIndex = aCmd->GetNbArgs() - 2;
+         for(int j = 0; j < aCurrentStateSize; j++) {
+           if(!aCurrentState.at(j).IsEmpty())
+             aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+         }
+         aStates->IncrementState();
+       }
+       else if(aMethod.IsEqual("ApplyToMeshFaces") ||
+               aMethod.IsEqual("ApplyToHexahedrons")) {
+         int anArgIndex = aCmd->GetNbArgs()-1;
+         for(int j = 0; j < aCurrentStateSize; j++)
+           if(!aCurrentState.at(j).IsEmpty())
+             aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+         aStates->IncrementState();
+       }
+      }
+    }
+    else {
+      if(MYDEBUG)
+       cout << "Object not found" << endl;
+    }
+    if(MYDEBUG) {
+      cout<<"Command after: "<< aCmd->GetString()<<endl;
+    }
+  }
+  
+  ProcessLayerDistribution();
+}
+//================================================================================
+/*!
+ * \brief Private method
+ */
+//================================================================================
+void SMESH_NoteBook::InitObjectMap()
+{
+  SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen();
+  if(!aGen)
+    return;
+  
+  SALOMEDS::Study_ptr aStudy = aGen->GetCurrentStudy();
+  if(aStudy->_is_nil())
+    return;
+  
+  SALOMEDS::SObject_var aSO = aStudy->FindComponent(aGen->ComponentDataType());
+  if(CORBA::is_nil(aSO))
+    return;
+  
+  SALOMEDS::ChildIterator_var Itr = aStudy->NewChildIterator(aSO);
+  char* aParameters;
+  for(Itr->InitEx(true); Itr->More(); Itr->Next()) {
+    SALOMEDS::SObject_var aSObject = Itr->Value();
+    SALOMEDS::GenericAttribute_var anAttr;
+    if ( aSObject->FindAttribute(anAttr, "AttributeString")) {
+      aParameters = SALOMEDS::AttributeString::_narrow(anAttr)->Value();
+      SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters);
+      if(MYDEBUG) {
+        cout<<"Entry : "<< aSObject->GetID()<<endl;
+        cout<<"aParameters : "<<aParameters<<endl;
+      }      
+      TCollection_AsciiString anObjType;
+      CORBA::Object_var anObject = SMESH_Gen_i::SObjectToObject(aSObject);
+      SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow(anObject);
+      if(!aHyp->_is_nil()) {
+        anObjType = TCollection_AsciiString(aHyp->GetName());
+      }
+      else if(SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObject)) {
+        anObjType = TCollection_AsciiString("Mesh");
+      }
+      if(MYDEBUG)
+        cout<<"The object Type : "<<anObjType<<endl;
+      ObjectStates *aState = NULL;
+      if(anObjType == "LayerDistribution") {
+        aState = new LayerDistributionStates();
+      }
+      else
+        aState = new  ObjectStates(anObjType);
+      
+      for(int i = 0; i < aSections->length(); i++) {
+        TState aVars;
+        SALOMEDS::ListOfStrings aListOfVars = aSections[i];
+        for(int j = 0;j<aListOfVars.length();j++) {
+          TCollection_AsciiString aVar(aListOfVars[j].in());
+          if(!aVar.IsEmpty() && aStudy->IsVariable(aVar.ToCString())) {
+            aVar.InsertBefore(1,"\"");
+            aVar.InsertAfter(aVar.Length(),"\"");
+          }
+          aVars.push_back(aVar);
+          if(MYDEBUG) {
+            cout<<"Variable: '"<<aVar<<"'"<<endl;
+          }
+        }
+        aState->AddState(aVars);
+      }
+      _objectMap.insert(pair<TCollection_AsciiString,ObjectStates*>(TCollection_AsciiString(aSObject->GetID()),aState));
+    }
+  }
+}
+
+//================================================================================
+/*!
+ * 
+ */
+//================================================================================
+void SMESH_NoteBook::AddCommand(const TCollection_AsciiString& theString)
+{
+  if(MYDEBUG)
+    cout<<theString<<endl;
+  Handle(_pyCommand) aCommand = new _pyCommand( theString, -1);
+  _commands.push_back(aCommand);
+
+  if ( aCommand->GetMethod() == "GetMeshEditor" ) { // MeshEditor creation
+    myMeshEditors.insert( make_pair( aCommand->GetResultValue(),
+                                    aCommand->GetObject() ) );
+  }
+}
+
+//================================================================================
+/*!
+ * 
+ */
+//================================================================================
+void SMESH_NoteBook::ProcessLayerDistribution()
+{
+  // 1) Find all LayerDistribution states
+  vector<LayerDistributionStates*> aLDS;
+  TVariablesMap::const_iterator it = _objectMap.begin();
+  for(;it != _objectMap.end();it++) {
+    LayerDistributionStates* aLDStates = dynamic_cast<LayerDistributionStates*>(((*it).second));
+    if(aLDStates!=NULL) {
+      aLDS.push_back(aLDStates);
+    }
+  }
+  
+  if(!aLDS.size())
+    return;
+  
+  // 2) Initialize all type of 1D Distribution hypothesis
+  for(int i=0;i<_commands.size();i++){
+    for(int j =0;j < aLDS.size();j++){
+      TCollection_AsciiString aResultValue = _commands[i]->GetResultValue();
+      if(_commands[i]->GetMethod() == "CreateHypothesis" &&
+         aLDS[j]->HasDistribution(aResultValue)){
+        TCollection_AsciiString aType = _commands[i]->GetArg(1);
+        aType.RemoveAll('\'');
+        aLDS[j]->SetDistributionType(aResultValue,aType);
+      }
+    }
+  }
+  // 3) ... and replase variables ...
+
+  for(int i=0;i<_commands.size();i++){
+    for(int j =0;j < aLDS.size();j++){
+      TCollection_AsciiString anObject = _commands[i]->GetObject();
+
+      if(aLDS[j]->HasDistribution(anObject)) {
+        TCollection_AsciiString aType = aLDS[j]->GetDistributionType(anObject);
+        TCollection_AsciiString aMethod = _commands[i]->GetMethod();
+        if(aType == "LocalLength") {
+          if(aMethod == "SetLength") {
+            SetVariable(_commands[i], aLDS[j],0,1);
+            aLDS[j]->IncrementState();
+          }
+          else if(aMethod == "SetPrecision") {
+            SetVariable(_commands[i], aLDS[j],1,1);
+            aLDS[j]->IncrementState();
+          }
+        }
+
+        // Case for NumberOfSegments hypothesis
+        else if(aType == "NumberOfSegments"){
+          if(aMethod == "SetNumberOfSegments") {
+            SetVariable(_commands[i], aLDS[j],0,1);
+            if(aLDS[j]->GetCurrectState().size()==1)
+              aLDS[j]->IncrementState();
+          }
+          else if (aMethod == "SetScaleFactor") {
+            SetVariable(_commands[i], aLDS[j],1,1);
+            aLDS[j]->IncrementState();
+          }
+        }
+        
+        else if( aType == "Deflection1D" ){
+          if(aMethod == "SetDeflection"){
+            SetVariable(_commands[i], aLDS[j],0,1);
+            aLDS[j]->IncrementState();
+          }
+        }
+        // Case for Arithmetic1D and StartEndLength hypothesis
+        else if(aType == "Arithmetic1D" || aType == "StartEndLength") {
+          if(aMethod == "SetLength") {
+            int anArgNb = (_commands[i]->GetArg(2) == "1") ? 0 : 1;
+            SetVariable(_commands[i], aLDS[j],anArgNb,1);
+            aLDS[j]->IncrementState();
+          }
+        }
+      }
+    }
+  }
+}
+//================================================================================
+/*!
+ *  \brief Return result script
+ */
+//================================================================================
+TCollection_AsciiString SMESH_NoteBook::GetResultScript() const
+{
+  TCollection_AsciiString aResult;
+  for(int i=0;i<_commands.size();i++)
+    aResult+=_commands[i]->GetString()+"\n";
+  return aResult;
+}
+
+//================================================================================
+/*!
+ *  \brief Return value of the variable
+ */
+//================================================================================
+bool SMESH_NoteBook::GetReal(const TCollection_AsciiString& theVarName, double& theValue)
+{
+  bool ok = false;
+
+  SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen();
+  if(!aGen)
+    return ok;
+
+  SALOMEDS::Study_ptr aStudy = aGen->GetCurrentStudy();
+  if(aStudy->_is_nil())
+    return ok;
+
+  TCollection_AsciiString aVarName = theVarName;
+  aVarName.RemoveAll('\"');
+
+  if(aVarName.IsEmpty())
+    return ok;
+
+  const char* aName = aVarName.ToCString();
+  if(aStudy->IsVariable(aName) && (aStudy->IsReal(aName) || aStudy->IsInteger(aName))) {
+    theValue = aStudy->GetReal(aVarName.ToCString());
+    ok = true;
+  }
+
+  return ok;
+}
+
+
+/*!
+ *  Set variable of the ObjectStates from position to the _pyCommand
+ *  method as nbArg argument
+ */
+void SetVariable(Handle(_pyCommand) theCommand, const ObjectStates* theStates, int position, int theArgNb)
+{
+  if(theStates->GetCurrectState().size() > position)
+    if(!theStates->GetCurrectState().at(position).IsEmpty())
+      theCommand->SetArg(theArgNb,theStates->GetCurrectState().at(position));
+}
diff --git a/src/SMESH_I/SMESH_NoteBook.hxx b/src/SMESH_I/SMESH_NoteBook.hxx
new file mode 100644 (file)
index 0000000..dfeb3b5
--- /dev/null
@@ -0,0 +1,106 @@
+// Copyright (C) 2008  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File      : SMESH_NoteBook.hxx
+// Author    : Roman NIKOLAEV ()
+
+
+#ifndef SMESH_NoteBook_HeaderFile
+#define SMESH_NoteBook_HeaderFile
+
+#include <TCollection_AsciiString.hxx>
+#include <Resource_DataMapOfAsciiStringAsciiString.hxx>
+class _pyCommand;
+
+#include <vector>
+#include <string>
+
+typedef std::vector<TCollection_AsciiString>  TState;
+typedef std::vector<TState>                   TAllStates;
+typedef TCollection_AsciiString _pyID;
+
+class ObjectStates{
+  
+public:
+  
+  ObjectStates(TCollection_AsciiString theType);
+  virtual ~ObjectStates();
+
+  void AddState(const TState &theState);
+
+  TState GetCurrectState() const;
+  TAllStates GetAllStates() const;
+  void IncrementState();
+  TCollection_AsciiString GetObjectType() const;
+
+  
+
+private:
+  TCollection_AsciiString                   _type;
+  TAllStates                                _states;
+  int                                       _dumpstate;
+};
+
+class LayerDistributionStates : public ObjectStates
+{
+public:
+  typedef std::map<TCollection_AsciiString,TCollection_AsciiString> TDistributionMap;
+  LayerDistributionStates();
+  virtual ~LayerDistributionStates();
+
+  void AddDistribution(const TCollection_AsciiString& theDistribution);
+  bool HasDistribution(const TCollection_AsciiString& theDistribution) const;
+
+  bool SetDistributionType(const TCollection_AsciiString& theDistribution,
+                           const TCollection_AsciiString& theType);
+  TCollection_AsciiString GetDistributionType(const TCollection_AsciiString& theDistribution) const;
+  
+private:
+  
+  TDistributionMap _distributions;
+};
+
+
+class SMESH_NoteBook
+{
+public:
+  typedef std::map<TCollection_AsciiString,ObjectStates*> TVariablesMap;
+  typedef std::map<TCollection_AsciiString,TCollection_AsciiString> TMeshEditorMap;
+  SMESH_NoteBook();
+  ~SMESH_NoteBook();
+  void ReplaceVariables();
+  
+  void AddCommand(const TCollection_AsciiString& theString);
+  TCollection_AsciiString GetResultScript() const;
+
+private:
+  void InitObjectMap();
+  void ProcessLayerDistribution();
+
+  bool GetReal(const TCollection_AsciiString& theVarName, double& theValue);
+  
+private:
+  
+  TVariablesMap _objectMap;
+  std::vector<Handle(_pyCommand)> _commands;
+  TMeshEditorMap myMeshEditors;
+};
+
+#endif //SMESH_NoteBook_HeaderFile
index e956e3c433bfcd1fd8c6fcf94f5ae9a1b32433aa..7b81262a0248edb6125b559758e54653ec3bed97 100644 (file)
@@ -158,6 +158,194 @@ DefaultSize, DefaultGeom, Custom = 0,0,1
 
 PrecisionConfusion = 1e-07
 
+## Converts an angle from degrees to radians
+def DegreesToRadians(AngleInDegrees):
+    from math import pi
+    return AngleInDegrees * pi / 180.0
+
+# Salome notebook variable separator
+var_separator = ":"
+
+# Parametrized substitute for PointStruct
+class PointStructStr:
+
+    x = 0
+    y = 0
+    z = 0
+    xStr = ""
+    yStr = ""
+    zStr = ""
+
+    def __init__(self, xStr, yStr, zStr):
+        self.xStr = xStr
+        self.yStr = yStr
+        self.zStr = zStr
+        if isinstance(xStr, str) and notebook.isVariable(xStr):
+            self.x = notebook.get(xStr)
+        else:
+            self.x = xStr
+        if isinstance(yStr, str) and notebook.isVariable(yStr):
+            self.y = notebook.get(yStr)
+        else:
+            self.y = yStr
+        if isinstance(zStr, str) and notebook.isVariable(zStr):
+            self.z = notebook.get(zStr)
+        else:
+            self.z = zStr
+
+# Parametrized substitute for PointStruct (with 6 parameters)
+class PointStructStr6:
+
+    x1 = 0
+    y1 = 0
+    z1 = 0
+    x2 = 0
+    y2 = 0
+    z2 = 0
+    xStr1 = ""
+    yStr1 = ""
+    zStr1 = ""
+    xStr2 = ""
+    yStr2 = ""
+    zStr2 = ""
+
+    def __init__(self, x1Str, x2Str, y1Str, y2Str, z1Str, z2Str):
+        self.x1Str = x1Str
+        self.x2Str = x2Str
+        self.y1Str = y1Str
+        self.y2Str = y2Str
+        self.z1Str = z1Str
+        self.z2Str = z2Str
+        if isinstance(x1Str, str) and notebook.isVariable(x1Str):
+            self.x1 = notebook.get(x1Str)
+        else:
+            self.x1 = x1Str
+        if isinstance(x2Str, str) and notebook.isVariable(x2Str):
+            self.x2 = notebook.get(x2Str)
+        else:
+            self.x2 = x2Str
+        if isinstance(y1Str, str) and notebook.isVariable(y1Str):
+            self.y1 = notebook.get(y1Str)
+        else:
+            self.y1 = y1Str
+        if isinstance(y2Str, str) and notebook.isVariable(y2Str):
+            self.y2 = notebook.get(y2Str)
+        else:
+            self.y2 = y2Str
+        if isinstance(z1Str, str) and notebook.isVariable(z1Str):
+            self.z1 = notebook.get(z1Str)
+        else:
+            self.z1 = z1Str
+        if isinstance(z2Str, str) and notebook.isVariable(z2Str):
+            self.z2 = notebook.get(z2Str)
+        else:
+            self.z2 = z2Str
+
+# Parametrized substitute for AxisStruct
+class AxisStructStr:
+
+    x = 0
+    y = 0
+    z = 0
+    dx = 0
+    dy = 0
+    dz = 0
+    xStr = ""
+    yStr = ""
+    zStr = ""
+    dxStr = ""
+    dyStr = ""
+    dzStr = ""
+
+    def __init__(self, xStr, yStr, zStr, dxStr, dyStr, dzStr):
+        self.xStr = xStr
+        self.yStr = yStr
+        self.zStr = zStr
+        self.dxStr = dxStr
+        self.dyStr = dyStr
+        self.dzStr = dzStr
+        if isinstance(xStr, str) and notebook.isVariable(xStr):
+            self.x = notebook.get(xStr)
+        else:
+            self.x = xStr
+        if isinstance(yStr, str) and notebook.isVariable(yStr):
+            self.y = notebook.get(yStr)
+        else:
+            self.y = yStr
+        if isinstance(zStr, str) and notebook.isVariable(zStr):
+            self.z = notebook.get(zStr)
+        else:
+            self.z = zStr
+        if isinstance(dxStr, str) and notebook.isVariable(dxStr):
+            self.dx = notebook.get(dxStr)
+        else:
+            self.dx = dxStr
+        if isinstance(dyStr, str) and notebook.isVariable(dyStr):
+            self.dy = notebook.get(dyStr)
+        else:
+            self.dy = dyStr
+        if isinstance(dzStr, str) and notebook.isVariable(dzStr):
+            self.dz = notebook.get(dzStr)
+        else:
+            self.dz = dzStr
+
+# Parametrized substitute for DirStruct
+class DirStructStr:
+
+    def __init__(self, pointStruct):
+        self.pointStruct = pointStruct
+
+# Returns list of variable values from salome notebook
+def ParsePointStruct(Point):
+    Parameters = 2*var_separator
+    if isinstance(Point, PointStructStr):
+        Parameters = str(Point.xStr) + var_separator + str(Point.yStr) + var_separator + str(Point.zStr)
+        Point = PointStruct(Point.x, Point.y, Point.z)
+    return Point, Parameters
+
+# Returns list of variable values from salome notebook
+def ParseDirStruct(Dir):
+    Parameters = 2*var_separator
+    if isinstance(Dir, DirStructStr):
+        pntStr = Dir.pointStruct
+        if isinstance(pntStr, PointStructStr6):
+            Parameters = str(pntStr.x1Str) + var_separator + str(pntStr.x2Str) + var_separator
+            Parameters += str(pntStr.y1Str) + var_separator + str(pntStr.y2Str) + var_separator 
+            Parameters += str(pntStr.z1Str) + var_separator + str(pntStr.z2Str)
+            Point = PointStruct(pntStr.x2 - pntStr.x1, pntStr.y2 - pntStr.y1, pntStr.z2 - pntStr.z1)
+        else:
+            Parameters = str(pntStr.xStr) + var_separator + str(pntStr.yStr) + var_separator + str(pntStr.zStr)
+            Point = PointStruct(pntStr.x, pntStr.y, pntStr.z)
+        Dir = DirStruct(Point)
+    return Dir, Parameters
+
+# Returns list of variable values from salome notebook
+def ParseAxisStruct(Axis):
+    Parameters = 5*var_separator
+    if isinstance(Axis, AxisStructStr):
+        Parameters = str(Axis.xStr) + var_separator + str(Axis.yStr) + var_separator + str(Axis.zStr) + var_separator
+        Parameters += str(Axis.dxStr) + var_separator + str(Axis.dyStr) + var_separator + str(Axis.dzStr)
+        Axis = AxisStruct(Axis.x, Axis.y, Axis.z, Axis.dx, Axis.dy, Axis.dz)
+    return Axis, Parameters
+
+## Return list of variable values from salome notebook
+def ParseAngles(list):
+    Result = []
+    Parameters = ""
+    for parameter in list:
+        if isinstance(parameter,str) and notebook.isVariable(parameter):
+            Result.append(DegreesToRadians(notebook.get(parameter)))
+            pass
+        else:
+            Result.append(parameter)
+            pass
+        
+        Parameters = Parameters + str(parameter)
+        Parameters = Parameters + var_separator
+        pass
+    Parameters = Parameters[:len(Parameters)-1]
+    return Result, Parameters
+    
 def IsEqual(val1, val2, tol=PrecisionConfusion):
     if abs(val1 - val2) < tol:
         return True
@@ -214,11 +402,6 @@ def TreatHypoStatus(status, hypName, geomName, isAlgo):
         print hypName, "was not assigned to",geomName,":", reason
         pass
 
-## Converts an angle from degrees to radians
-def DegreesToRadians(AngleInDegrees):
-    from math import pi
-    return AngleInDegrees * pi / 180.0
-
 # end of l1_auxiliary
 ## @}
 
@@ -414,6 +597,25 @@ class smeshDC(SMESH._objref_SMESH_Gen):
     def SetBoundaryBoxSegmentation(self, nbSegments):
         SMESH._objref_SMESH_Gen.SetBoundaryBoxSegmentation(self,nbSegments)
 
+    ## Concatenate the given meshes into one mesh.
+    #  @return an instance of Mesh class
+    #  @param meshes the meshes to combine into one mesh
+    #  @param uniteIdenticalGroups if true, groups with same names are united, else they are renamed
+    #  @param mergeNodesAndElements if true, equal nodes and elements aremerged
+    #  @param mergeTolerance tolerance for merging nodes
+    #  @param allGroups forces creation of groups of all elements
+    def Concatenate( self, meshes, uniteIdenticalGroups,
+                     mergeNodesAndElements = False, mergeTolerance = 1e-5, allGroups = False):
+        mergeTolerance,Parameters = geompyDC.ParseParameters(mergeTolerance)
+        if allGroups:
+            aSmeshMesh = SMESH._objref_SMESH_Gen.ConcatenateWithGroups(
+                self,meshes,uniteIdenticalGroups,mergeNodesAndElements,mergeTolerance)
+        else:
+            aSmeshMesh = SMESH._objref_SMESH_Gen.Concatenate(
+                self,meshes,uniteIdenticalGroups,mergeNodesAndElements,mergeTolerance)
+        aSmeshMesh.SetParameters(Parameters)
+        aMesh = Mesh(self, self.geompyD, aSmeshMesh)
+        return aMesh
 
     # Filtering. Auxiliary functions:
     # ------------------------------
@@ -1740,6 +1942,8 @@ class Mesh:
     #  @return Id of the new node
     #  @ingroup l2_modif_add
     def AddNode(self, x, y, z):
+        x,y,z,Parameters = geompyDC.ParseParameters(x,y,z)
+        self.mesh.SetParameters(Parameters)
         return self.editor.AddNode( x, y, z)
 
     ## Creates a linear or quadratic edge (this is determined
@@ -1895,8 +2099,21 @@ class Mesh:
     #  @return True if succeed else False
     #  @ingroup l2_modif_movenode
     def MoveNode(self, NodeID, x, y, z):
+        x,y,z,Parameters = geompyDC.ParseParameters(x,y,z)
+        self.mesh.SetParameters(Parameters)
         return self.editor.MoveNode(NodeID, x, y, z)
 
+    ## Finds the node closest to a point and moves it to a point location
+    #  @param x  the X coordinate of a point
+    #  @param y  the Y coordinate of a point
+    #  @param z  the Z coordinate of a point
+    #  @return the ID of a node
+    #  @ingroup l2_modif_throughp
+    def MoveClosestNodeToPoint(self, x, y, z, NodeID):
+        x,y,z,Parameters = geompyDC.ParseParameters(x,y,z)
+        self.mesh.SetParameters(Parameters)
+        return self.editor.MoveClosestNodeToPoint(x, y, z, NodeID)
+
     ## Finds the node closest to a point
     #  @param x  the X coordinate of a point
     #  @param y  the Y coordinate of a point
@@ -1957,12 +2174,25 @@ class Mesh:
     #  @param theCriterion  is FT_...; used to choose a neighbour to fuse with.
     #  @param MaxAngle      is the maximum angle between element normals at which the fusion
     #                       is still performed; theMaxAngle is mesured in radians.
+    #                       Also it could be a name of variable which defines angle in degrees.
     #  @return TRUE in case of success, FALSE otherwise.
     #  @ingroup l2_modif_unitetri
     def TriToQuad(self, IDsOfElements, theCriterion, MaxAngle):
+        flag = False
+        if isinstance(MaxAngle,str):
+            flag = True
+        MaxAngle,Parameters = geompyDC.ParseParameters(MaxAngle)
+        if flag:
+            MaxAngle = DegreesToRadians(MaxAngle)
         if IDsOfElements == []:
             IDsOfElements = self.GetElementsId()
-        return self.editor.TriToQuad(IDsOfElements, self.smeshpyD.GetFunctor(theCriterion), MaxAngle)
+        self.mesh.SetParameters(Parameters)
+        Functor = 0
+       if ( isinstance( theCriterion, SMESH._objref_NumericalFunctor ) ):
+            Functor = theCriterion
+        else:
+            Functor = self.smeshpyD.GetFunctor(theCriterion)
+        return self.editor.TriToQuad(IDsOfElements, Functor, MaxAngle)
 
     ## Fuses the neighbouring triangles of the object into quadrangles
     #  @param theObject is mesh, submesh or group
@@ -2180,6 +2410,8 @@ class Mesh:
                MaxNbOfIterations, MaxAspectRatio, Method):
         if IDsOfElements == []:
             IDsOfElements = self.GetElementsId()
+        MaxNbOfIterations,MaxAspectRatio,Parameters = geompyDC.ParseParameters(MaxNbOfIterations,MaxAspectRatio)
+        self.mesh.SetParameters(Parameters)
         return self.editor.Smooth(IDsOfElements, IDsOfFixedNodes,
                                   MaxNbOfIterations, MaxAspectRatio, Method)
 
@@ -2212,6 +2444,8 @@ class Mesh:
                          MaxNbOfIterations, MaxAspectRatio, Method):
         if IDsOfElements == []:
             IDsOfElements = self.GetElementsId()
+        MaxNbOfIterations,MaxAspectRatio,Parameters = geompyDC.ParseParameters(MaxNbOfIterations,MaxAspectRatio)
+        self.mesh.SetParameters(Parameters)
         return self.editor.SmoothParametric(IDsOfElements, IDsOfFixedNodes,
                                             MaxNbOfIterations, MaxAspectRatio, Method)
 
@@ -2258,7 +2492,7 @@ class Mesh:
     ## Generates new elements by rotation of the elements around the axis
     #  @param IDsOfElements the list of ids of elements to sweep
     #  @param Axis the axis of rotation, AxisStruct or line(geom object)
-    #  @param AngleInRadians the angle of Rotation
+    #  @param AngleInRadians the angle of Rotation (in radians) or a name of variable which defines angle in degrees
     #  @param NbOfSteps the number of steps
     #  @param Tolerance tolerance
     #  @param MakeGroups forces the generation of new groups from existing ones
@@ -2268,12 +2502,22 @@ class Mesh:
     #  @ingroup l2_modif_extrurev
     def RotationSweep(self, IDsOfElements, Axis, AngleInRadians, NbOfSteps, Tolerance,
                       MakeGroups=False, TotalAngle=False):
+        flag = False
+        if isinstance(AngleInRadians,str):
+            flag = True
+        AngleInRadians,AngleParameters = geompyDC.ParseParameters(AngleInRadians)
+        if flag:
+            AngleInRadians = DegreesToRadians(AngleInRadians)
         if IDsOfElements == []:
             IDsOfElements = self.GetElementsId()
         if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
             Axis = self.smeshpyD.GetAxisStruct(Axis)
+        Axis,AxisParameters = ParseAxisStruct(Axis)
         if TotalAngle and NbOfSteps:
             AngleInRadians /= NbOfSteps
+        NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
+        Parameters = AxisParameters + var_separator + AngleParameters + var_separator + Parameters
+        self.mesh.SetParameters(Parameters)
         if MakeGroups:
             return self.editor.RotationSweepMakeGroups(IDsOfElements, Axis,
                                                        AngleInRadians, NbOfSteps, Tolerance)
@@ -2293,18 +2537,98 @@ class Mesh:
     #  @ingroup l2_modif_extrurev
     def RotationSweepObject(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
                             MakeGroups=False, TotalAngle=False):
+        flag = False
+        if isinstance(AngleInRadians,str):
+            flag = True
+        AngleInRadians,AngleParameters = geompyDC.ParseParameters(AngleInRadians)
+        if flag:
+            AngleInRadians = DegreesToRadians(AngleInRadians)
         if ( isinstance( theObject, Mesh )):
             theObject = theObject.GetMesh()
         if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
             Axis = self.smeshpyD.GetAxisStruct(Axis)
+        Axis,AxisParameters = ParseAxisStruct(Axis)
         if TotalAngle and NbOfSteps:
             AngleInRadians /= NbOfSteps
+        NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
+        Parameters = AxisParameters + var_separator + AngleParameters + var_separator + Parameters
+        self.mesh.SetParameters(Parameters)
         if MakeGroups:
             return self.editor.RotationSweepObjectMakeGroups(theObject, Axis, AngleInRadians,
                                                              NbOfSteps, Tolerance)
         self.editor.RotationSweepObject(theObject, Axis, AngleInRadians, NbOfSteps, Tolerance)
         return []
 
+    ## Generates new elements by rotation of the elements of object around the axis
+    #  @param theObject object which elements should be sweeped
+    #  @param Axis the axis of rotation, AxisStruct or line(geom object)
+    #  @param AngleInRadians the angle of Rotation
+    #  @param NbOfSteps number of steps
+    #  @param Tolerance tolerance
+    #  @param MakeGroups forces the generation of new groups from existing ones
+    #  @param TotalAngle gives meaning of AngleInRadians: if True then it is an angular size
+    #                    of all steps, else - size of each step
+    #  @return the list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
+    #  @ingroup l2_modif_extrurev
+    def RotationSweepObject1D(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
+                              MakeGroups=False, TotalAngle=False):
+        flag = False
+        if isinstance(AngleInRadians,str):
+            flag = True
+        AngleInRadians,AngleParameters = geompyDC.ParseParameters(AngleInRadians)
+        if flag:
+            AngleInRadians = DegreesToRadians(AngleInRadians)
+        if ( isinstance( theObject, Mesh )):
+            theObject = theObject.GetMesh()
+        if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
+            Axis = self.smeshpyD.GetAxisStruct(Axis)
+        Axis,AxisParameters = ParseAxisStruct(Axis)
+        if TotalAngle and NbOfSteps:
+            AngleInRadians /= NbOfSteps
+        NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
+        Parameters = AxisParameters + var_separator + AngleParameters + var_separator + Parameters
+        self.mesh.SetParameters(Parameters)
+        if MakeGroups:
+            return self.editor.RotationSweepObject1DMakeGroups(theObject, Axis, AngleInRadians,
+                                                               NbOfSteps, Tolerance)
+        self.editor.RotationSweepObject1D(theObject, Axis, AngleInRadians, NbOfSteps, Tolerance)
+        return []
+
+    ## Generates new elements by rotation of the elements of object around the axis
+    #  @param theObject object which elements should be sweeped
+    #  @param Axis the axis of rotation, AxisStruct or line(geom object)
+    #  @param AngleInRadians the angle of Rotation
+    #  @param NbOfSteps number of steps
+    #  @param Tolerance tolerance
+    #  @param MakeGroups forces the generation of new groups from existing ones
+    #  @param TotalAngle gives meaning of AngleInRadians: if True then it is an angular size
+    #                    of all steps, else - size of each step
+    #  @return the list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
+    #  @ingroup l2_modif_extrurev
+    def RotationSweepObject2D(self, theObject, Axis, AngleInRadians, NbOfSteps, Tolerance,
+                              MakeGroups=False, TotalAngle=False):
+        flag = False
+        if isinstance(AngleInRadians,str):
+            flag = True
+        AngleInRadians,AngleParameters = geompyDC.ParseParameters(AngleInRadians)
+        if flag:
+            AngleInRadians = DegreesToRadians(AngleInRadians)
+        if ( isinstance( theObject, Mesh )):
+            theObject = theObject.GetMesh()
+        if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
+            Axis = self.smeshpyD.GetAxisStruct(Axis)
+        Axis,AxisParameters = ParseAxisStruct(Axis)
+        if TotalAngle and NbOfSteps:
+            AngleInRadians /= NbOfSteps
+        NbOfSteps,Tolerance,Parameters = geompyDC.ParseParameters(NbOfSteps,Tolerance)
+        Parameters = AxisParameters + var_separator + AngleParameters + var_separator + Parameters
+        self.mesh.SetParameters(Parameters)
+        if MakeGroups:
+            return self.editor.RotationSweepObject2DMakeGroups(theObject, Axis, AngleInRadians,
+                                                             NbOfSteps, Tolerance)
+        self.editor.RotationSweepObject2D(theObject, Axis, AngleInRadians, NbOfSteps, Tolerance)
+        return []
+
     ## Generates new elements by extrusion of the elements with given ids
     #  @param IDsOfElements the list of elements ids for extrusion
     #  @param StepVector vector, defining the direction and value of extrusion
@@ -2317,6 +2641,10 @@ class Mesh:
             IDsOfElements = self.GetElementsId()
         if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
             StepVector = self.smeshpyD.GetDirStruct(StepVector)
+        StepVector,StepVectorParameters = ParseDirStruct(StepVector)
+        NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
+        Parameters = StepVectorParameters + var_separator + Parameters
+        self.mesh.SetParameters(Parameters)
         if MakeGroups:
             return self.editor.ExtrusionSweepMakeGroups(IDsOfElements, StepVector, NbOfSteps)
         self.editor.ExtrusionSweep(IDsOfElements, StepVector, NbOfSteps)
@@ -2355,6 +2683,10 @@ class Mesh:
             theObject = theObject.GetMesh()
         if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
             StepVector = self.smeshpyD.GetDirStruct(StepVector)
+        StepVector,StepVectorParameters = ParseDirStruct(StepVector)
+        NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
+        Parameters = StepVectorParameters + var_separator + Parameters
+        self.mesh.SetParameters(Parameters)
         if MakeGroups:
             return self.editor.ExtrusionSweepObjectMakeGroups(theObject, StepVector, NbOfSteps)
         self.editor.ExtrusionSweepObject(theObject, StepVector, NbOfSteps)
@@ -2372,6 +2704,10 @@ class Mesh:
             theObject = theObject.GetMesh()
         if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
             StepVector = self.smeshpyD.GetDirStruct(StepVector)
+        StepVector,StepVectorParameters = ParseDirStruct(StepVector)
+        NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
+        Parameters = StepVectorParameters + var_separator + Parameters
+        self.mesh.SetParameters(Parameters)
         if MakeGroups:
             return self.editor.ExtrusionSweepObject1DMakeGroups(theObject, StepVector, NbOfSteps)
         self.editor.ExtrusionSweepObject1D(theObject, StepVector, NbOfSteps)
@@ -2389,6 +2725,10 @@ class Mesh:
             theObject = theObject.GetMesh()
         if ( isinstance( StepVector, geompyDC.GEOM._objref_GEOM_Object)):
             StepVector = self.smeshpyD.GetDirStruct(StepVector)
+        StepVector,StepVectorParameters = ParseDirStruct(StepVector)
+        NbOfSteps,Parameters = geompyDC.ParseParameters(NbOfSteps)
+        Parameters = StepVectorParameters + var_separator + Parameters
+        self.mesh.SetParameters(Parameters)
         if MakeGroups:
             return self.editor.ExtrusionSweepObject2DMakeGroups(theObject, StepVector, NbOfSteps)
         self.editor.ExtrusionSweepObject2D(theObject, StepVector, NbOfSteps)
@@ -2415,6 +2755,8 @@ class Mesh:
     def ExtrusionAlongPath(self, IDsOfElements, PathMesh, PathShape, NodeStart,
                            HasAngles, Angles, HasRefPoint, RefPoint,
                            MakeGroups=False, LinearVariation=False):
+        Angles,AnglesParameters = ParseAngles(Angles)
+        RefPoint,RefPointParameters = ParsePointStruct(RefPoint)
         if IDsOfElements == []:
             IDsOfElements = self.GetElementsId()
         if ( isinstance( RefPoint, geompyDC.GEOM._objref_GEOM_Object)):
@@ -2425,6 +2767,8 @@ class Mesh:
         if HasAngles and Angles and LinearVariation:
             Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
             pass
+        Parameters = AnglesParameters + var_separator + RefPointParameters
+        self.mesh.SetParameters(Parameters)
         if MakeGroups:
             return self.editor.ExtrusionAlongPathMakeGroups(IDsOfElements, PathMesh,
                                                             PathShape, NodeStart, HasAngles,
@@ -2453,6 +2797,8 @@ class Mesh:
     def ExtrusionAlongPathObject(self, theObject, PathMesh, PathShape, NodeStart,
                                  HasAngles, Angles, HasRefPoint, RefPoint,
                                  MakeGroups=False, LinearVariation=False):
+        Angles,AnglesParameters = ParseAngles(Angles)
+        RefPoint,RefPointParameters = ParsePointStruct(RefPoint)
         if ( isinstance( theObject, Mesh )):
             theObject = theObject.GetMesh()
         if ( isinstance( RefPoint, geompyDC.GEOM._objref_GEOM_Object)):
@@ -2462,6 +2808,8 @@ class Mesh:
         if HasAngles and Angles and LinearVariation:
             Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
             pass
+        Parameters = AnglesParameters + var_separator + RefPointParameters
+        self.mesh.SetParameters(Parameters)
         if MakeGroups:
             return self.editor.ExtrusionAlongPathObjectMakeGroups(theObject, PathMesh,
                                                                   PathShape, NodeStart, HasAngles,
@@ -2470,6 +2818,90 @@ class Mesh:
                                                     NodeStart, HasAngles, Angles, HasRefPoint,
                                                     RefPoint)
 
+    ## Generates new elements by extrusion of the elements which belong to the object
+    #  The path of extrusion must be a meshed edge.
+    #  @param theObject the object which elements should be processed
+    #  @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
+    #  @param PathShape shape(edge) defines the sub-mesh for the path
+    #  @param NodeStart the first or the last node on the edge. Defines the direction of extrusion
+    #  @param HasAngles allows the shape to be rotated around the path
+    #                   to get the resulting mesh in a helical fashion
+    #  @param Angles list of angles
+    #  @param HasRefPoint allows using the reference point
+    #  @param RefPoint the point around which the shape is rotated (the mass center of the shape by default).
+    #         The User can specify any point as the Reference Point.
+    #  @param MakeGroups forces the generation of new groups from existing ones
+    #  @param LinearVariation forces the computation of rotation angles as linear
+    #                         variation of the given Angles along path steps
+    #  @return list of created groups (SMESH_GroupBase) and SMESH::Extrusion_Error if MakeGroups=True,
+    #          only SMESH::Extrusion_Error otherwise
+    #  @ingroup l2_modif_extrurev
+    def ExtrusionAlongPathObject1D(self, theObject, PathMesh, PathShape, NodeStart,
+                                   HasAngles, Angles, HasRefPoint, RefPoint,
+                                   MakeGroups=False, LinearVariation=False):
+        Angles,AnglesParameters = ParseAngles(Angles)
+        RefPoint,RefPointParameters = ParsePointStruct(RefPoint)
+        if ( isinstance( theObject, Mesh )):
+            theObject = theObject.GetMesh()
+        if ( isinstance( RefPoint, geompyDC.GEOM._objref_GEOM_Object)):
+            RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
+        if ( isinstance( PathMesh, Mesh )):
+            PathMesh = PathMesh.GetMesh()
+        if HasAngles and Angles and LinearVariation:
+            Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
+            pass
+        Parameters = AnglesParameters + var_separator + RefPointParameters
+        self.mesh.SetParameters(Parameters)
+        if MakeGroups:
+            return self.editor.ExtrusionAlongPathObject1DMakeGroups(theObject, PathMesh,
+                                                                    PathShape, NodeStart, HasAngles,
+                                                                    Angles, HasRefPoint, RefPoint)
+        return self.editor.ExtrusionAlongPathObject1D(theObject, PathMesh, PathShape,
+                                                      NodeStart, HasAngles, Angles, HasRefPoint,
+                                                      RefPoint)
+
+    ## Generates new elements by extrusion of the elements which belong to the object
+    #  The path of extrusion must be a meshed edge.
+    #  @param theObject the object which elements should be processed
+    #  @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
+    #  @param PathShape shape(edge) defines the sub-mesh for the path
+    #  @param NodeStart the first or the last node on the edge. Defines the direction of extrusion
+    #  @param HasAngles allows the shape to be rotated around the path
+    #                   to get the resulting mesh in a helical fashion
+    #  @param Angles list of angles
+    #  @param HasRefPoint allows using the reference point
+    #  @param RefPoint the point around which the shape is rotated (the mass center of the shape by default).
+    #         The User can specify any point as the Reference Point.
+    #  @param MakeGroups forces the generation of new groups from existing ones
+    #  @param LinearVariation forces the computation of rotation angles as linear
+    #                         variation of the given Angles along path steps
+    #  @return list of created groups (SMESH_GroupBase) and SMESH::Extrusion_Error if MakeGroups=True,
+    #          only SMESH::Extrusion_Error otherwise
+    #  @ingroup l2_modif_extrurev
+    def ExtrusionAlongPathObject2D(self, theObject, PathMesh, PathShape, NodeStart,
+                                   HasAngles, Angles, HasRefPoint, RefPoint,
+                                   MakeGroups=False, LinearVariation=False):
+        Angles,AnglesParameters = ParseAngles(Angles)
+        RefPoint,RefPointParameters = ParsePointStruct(RefPoint)
+        if ( isinstance( theObject, Mesh )):
+            theObject = theObject.GetMesh()
+        if ( isinstance( RefPoint, geompyDC.GEOM._objref_GEOM_Object)):
+            RefPoint = self.smeshpyD.GetPointStruct(RefPoint)
+        if ( isinstance( PathMesh, Mesh )):
+            PathMesh = PathMesh.GetMesh()
+        if HasAngles and Angles and LinearVariation:
+            Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
+            pass
+        Parameters = AnglesParameters + var_separator + RefPointParameters
+        self.mesh.SetParameters(Parameters)
+        if MakeGroups:
+            return self.editor.ExtrusionAlongPathObject2DMakeGroups(theObject, PathMesh,
+                                                                    PathShape, NodeStart, HasAngles,
+                                                                    Angles, HasRefPoint, RefPoint)
+        return self.editor.ExtrusionAlongPathObject2D(theObject, PathMesh, PathShape,
+                                                      NodeStart, HasAngles, Angles, HasRefPoint,
+                                                      RefPoint)
+
     ## Creates a symmetrical copy of mesh elements
     #  @param IDsOfElements list of elements ids
     #  @param Mirror is AxisStruct or geom object(point, line, plane)
@@ -2484,6 +2916,8 @@ class Mesh:
             IDsOfElements = self.GetElementsId()
         if ( isinstance( Mirror, geompyDC.GEOM._objref_GEOM_Object)):
             Mirror = self.smeshpyD.GetAxisStruct(Mirror)
+        Mirror,Parameters = ParseAxisStruct(Mirror)
+        self.mesh.SetParameters(Parameters)
         if Copy and MakeGroups:
             return self.editor.MirrorMakeGroups(IDsOfElements, Mirror, theMirrorType)
         self.editor.Mirror(IDsOfElements, Mirror, theMirrorType, Copy)
@@ -2503,8 +2937,10 @@ class Mesh:
             IDsOfElements = self.GetElementsId()
         if ( isinstance( Mirror, geompyDC.GEOM._objref_GEOM_Object)):
             Mirror = self.smeshpyD.GetAxisStruct(Mirror)
+        Mirror,Parameters = ParseAxisStruct(Mirror)
         mesh = self.editor.MirrorMakeMesh(IDsOfElements, Mirror, theMirrorType,
                                           MakeGroups, NewMeshName)
+        mesh.SetParameters(Parameters)
         return Mesh(self.smeshpyD,self.geompyD,mesh)
 
     ## Creates a symmetrical copy of the object
@@ -2521,6 +2957,8 @@ class Mesh:
             theObject = theObject.GetMesh()
         if ( isinstance( Mirror, geompyDC.GEOM._objref_GEOM_Object)):
             Mirror = self.smeshpyD.GetAxisStruct(Mirror)
+        Mirror,Parameters = ParseAxisStruct(Mirror)
+        self.mesh.SetParameters(Parameters)
         if Copy and MakeGroups:
             return self.editor.MirrorObjectMakeGroups(theObject, Mirror, theMirrorType)
         self.editor.MirrorObject(theObject, Mirror, theMirrorType, Copy)
@@ -2540,8 +2978,10 @@ class Mesh:
             theObject = theObject.GetMesh()
         if (isinstance(Mirror, geompyDC.GEOM._objref_GEOM_Object)):
             Mirror = self.smeshpyD.GetAxisStruct(Mirror)
+        Mirror,Parameters = ParseAxisStruct(Mirror)
         mesh = self.editor.MirrorObjectMakeMesh(theObject, Mirror, theMirrorType,
                                                 MakeGroups, NewMeshName)
+        mesh.SetParameters(Parameters)
         return Mesh( self.smeshpyD,self.geompyD,mesh )
 
     ## Translates the elements
@@ -2556,6 +2996,8 @@ class Mesh:
             IDsOfElements = self.GetElementsId()
         if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
             Vector = self.smeshpyD.GetDirStruct(Vector)
+        Vector,Parameters = ParseDirStruct(Vector)
+        self.mesh.SetParameters(Parameters)
         if Copy and MakeGroups:
             return self.editor.TranslateMakeGroups(IDsOfElements, Vector)
         self.editor.Translate(IDsOfElements, Vector, Copy)
@@ -2573,7 +3015,9 @@ class Mesh:
             IDsOfElements = self.GetElementsId()
         if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
             Vector = self.smeshpyD.GetDirStruct(Vector)
+        Vector,Parameters = ParseDirStruct(Vector)
         mesh = self.editor.TranslateMakeMesh(IDsOfElements, Vector, MakeGroups, NewMeshName)
+        mesh.SetParameters(Parameters)
         return Mesh ( self.smeshpyD, self.geompyD, mesh )
 
     ## Translates the object
@@ -2588,6 +3032,8 @@ class Mesh:
             theObject = theObject.GetMesh()
         if ( isinstance( Vector, geompyDC.GEOM._objref_GEOM_Object)):
             Vector = self.smeshpyD.GetDirStruct(Vector)
+        Vector,Parameters = ParseDirStruct(Vector)
+        self.mesh.SetParameters(Parameters)
         if Copy and MakeGroups:
             return self.editor.TranslateObjectMakeGroups(theObject, Vector)
         self.editor.TranslateObject(theObject, Vector, Copy)
@@ -2605,22 +3051,33 @@ class Mesh:
             theObject = theObject.GetMesh()
         if (isinstance(Vector, geompyDC.GEOM._objref_GEOM_Object)):
             Vector = self.smeshpyD.GetDirStruct(Vector)
+        Vector,Parameters = ParseDirStruct(Vector)
         mesh = self.editor.TranslateObjectMakeMesh(theObject, Vector, MakeGroups, NewMeshName)
+        mesh.SetParameters(Parameters)
         return Mesh( self.smeshpyD, self.geompyD, mesh )
 
     ## Rotates the elements
     #  @param IDsOfElements list of elements ids
     #  @param Axis the axis of rotation (AxisStruct or geom line)
-    #  @param AngleInRadians the angle of rotation (in radians)
+    #  @param AngleInRadians the angle of rotation (in radians) or a name of variable which defines angle in degrees
     #  @param Copy allows copying the rotated elements
     #  @param MakeGroups forces the generation of new groups from existing ones (if Copy)
     #  @return list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
     #  @ingroup l2_modif_trsf
     def Rotate (self, IDsOfElements, Axis, AngleInRadians, Copy, MakeGroups=False):
+        flag = False
+        if isinstance(AngleInRadians,str):
+            flag = True
+        AngleInRadians,Parameters = geompyDC.ParseParameters(AngleInRadians)
+        if flag:
+            AngleInRadians = DegreesToRadians(AngleInRadians)
         if IDsOfElements == []:
             IDsOfElements = self.GetElementsId()
         if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
             Axis = self.smeshpyD.GetAxisStruct(Axis)
+        Axis,AxisParameters = ParseAxisStruct(Axis)
+        Parameters = AxisParameters + var_separator + Parameters
+        self.mesh.SetParameters(Parameters)
         if Copy and MakeGroups:
             return self.editor.RotateMakeGroups(IDsOfElements, Axis, AngleInRadians)
         self.editor.Rotate(IDsOfElements, Axis, AngleInRadians, Copy)
@@ -2629,33 +3086,51 @@ class Mesh:
     ## Creates a new mesh of rotated elements
     #  @param IDsOfElements list of element ids
     #  @param Axis the axis of rotation (AxisStruct or geom line)
-    #  @param AngleInRadians the angle of rotation (in radians)
+    #  @param AngleInRadians the angle of rotation (in radians) or a name of variable which defines angle in degrees
     #  @param MakeGroups forces the generation of new groups from existing ones
     #  @param NewMeshName the name of the newly created mesh
     #  @return instance of Mesh class
     #  @ingroup l2_modif_trsf
     def RotateMakeMesh (self, IDsOfElements, Axis, AngleInRadians, MakeGroups=0, NewMeshName=""):
+        flag = False
+        if isinstance(AngleInRadians,str):
+            flag = True
+        AngleInRadians,Parameters = geompyDC.ParseParameters(AngleInRadians)
+        if flag:
+            AngleInRadians = DegreesToRadians(AngleInRadians)
         if IDsOfElements == []:
             IDsOfElements = self.GetElementsId()
         if ( isinstance( Axis, geompyDC.GEOM._objref_GEOM_Object)):
             Axis = self.smeshpyD.GetAxisStruct(Axis)
+        Axis,AxisParameters = ParseAxisStruct(Axis)
+        Parameters = AxisParameters + var_separator + Parameters
         mesh = self.editor.RotateMakeMesh(IDsOfElements, Axis, AngleInRadians,
                                           MakeGroups, NewMeshName)
+        mesh.SetParameters(Parameters)
         return Mesh( self.smeshpyD, self.geompyD, mesh )
 
     ## Rotates the object
     #  @param theObject the object to rotate( mesh, submesh, or group)
     #  @param Axis the axis of rotation (AxisStruct or geom line)
-    #  @param AngleInRadians the angle of rotation (in radians)
+    #  @param AngleInRadians the angle of rotation (in radians) or a name of variable which defines angle in degrees
     #  @param Copy allows copying the rotated elements
     #  @param MakeGroups forces the generation of new groups from existing ones (if Copy)
     #  @return list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise
     #  @ingroup l2_modif_trsf
     def RotateObject (self, theObject, Axis, AngleInRadians, Copy, MakeGroups=False):
+        flag = False
+        if isinstance(AngleInRadians,str):
+            flag = True
+        AngleInRadians,Parameters = geompyDC.ParseParameters(AngleInRadians)
+        if flag:
+            AngleInRadians = DegreesToRadians(AngleInRadians)
         if (isinstance(theObject, Mesh)):
             theObject = theObject.GetMesh()
         if (isinstance(Axis, geompyDC.GEOM._objref_GEOM_Object)):
             Axis = self.smeshpyD.GetAxisStruct(Axis)
+        Axis,AxisParameters = ParseAxisStruct(Axis)
+        Parameters = AxisParameters + ":" + Parameters
+        self.mesh.SetParameters(Parameters)
         if Copy and MakeGroups:
             return self.editor.RotateObjectMakeGroups(theObject, Axis, AngleInRadians)
         self.editor.RotateObject(theObject, Axis, AngleInRadians, Copy)
@@ -2664,18 +3139,27 @@ class Mesh:
     ## Creates a new mesh from the rotated object
     #  @param theObject the object to rotate (mesh, submesh, or group)
     #  @param Axis the axis of rotation (AxisStruct or geom line)
-    #  @param AngleInRadians the angle of rotation (in radians)
+    #  @param AngleInRadians the angle of rotation (in radians)  or a name of variable which defines angle in degrees
     #  @param MakeGroups forces the generation of new groups from existing ones
     #  @param NewMeshName the name of the newly created mesh
     #  @return instance of Mesh class
     #  @ingroup l2_modif_trsf
     def RotateObjectMakeMesh(self, theObject, Axis, AngleInRadians, MakeGroups=0,NewMeshName=""):
+        flag = False
+        if isinstance(AngleInRadians,str):
+            flag = True
+        AngleInRadians,Parameters = geompyDC.ParseParameters(AngleInRadians)
+        if flag:
+            AngleInRadians = DegreesToRadians(AngleInRadians)
         if (isinstance( theObject, Mesh )):
             theObject = theObject.GetMesh()
         if (isinstance(Axis, geompyDC.GEOM._objref_GEOM_Object)):
             Axis = self.smeshpyD.GetAxisStruct(Axis)
+        Axis,AxisParameters = ParseAxisStruct(Axis)
+        Parameters = AxisParameters + ":" + Parameters
         mesh = self.editor.RotateObjectMakeMesh(theObject, Axis, AngleInRadians,
                                                        MakeGroups, NewMeshName)
+        mesh.SetParameters(Parameters)
         return Mesh( self.smeshpyD, self.geompyD, mesh )
 
     ## Finds groups of ajacent nodes within Tolerance.
@@ -4191,3 +4675,324 @@ class Mesh_UseExisting(Mesh_Algorithm):
             self.Create(mesh, geom, "UseExisting_1D")
         else:
             self.Create(mesh, geom, "UseExisting_2D")
+
+
+import salome_notebook
+notebook = salome_notebook.notebook
+
+##Return values of the notebook variables
+def ParseParameters(last, nbParams,nbParam, value):
+    result = None
+    strResult = ""
+    counter = 0
+    listSize = len(last)
+    for n in range(0,nbParams):
+        if n+1 != nbParam:
+            if counter < listSize:
+                strResult = strResult + last[counter]
+            else:
+                strResult = strResult + ""
+        else:
+            if isinstance(value, str):
+                if notebook.isVariable(value):
+                    result = notebook.get(value)
+                    strResult=strResult+value
+                else:
+                    raise RuntimeError, "Variable with name '" + value + "' doesn't exist!!!"
+            else:
+                strResult=strResult+str(value)
+                result = value
+        if nbParams - 1 != counter:
+            strResult=strResult+var_separator #":"
+        counter = counter+1
+    return result, strResult
+
+#Wrapper class for StdMeshers_LocalLength hypothesis
+class LocalLength(StdMeshers._objref_StdMeshers_LocalLength):
+
+    ## Set Length parameter value
+    #  @param length numerical value or name of variable from notebook
+    def SetLength(self, length):
+        length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_LocalLength.GetLastParameters(self),2,1,length)
+        StdMeshers._objref_StdMeshers_LocalLength.SetParameters(self,parameters)
+        StdMeshers._objref_StdMeshers_LocalLength.SetLength(self,length)
+
+   ## Set Precision parameter value
+   #  @param precision numerical value or name of variable from notebook
+    def SetPrecision(self, precision):
+        precision,parameters = ParseParameters(StdMeshers._objref_StdMeshers_LocalLength.GetLastParameters(self),2,2,precision)
+        StdMeshers._objref_StdMeshers_LocalLength.SetParameters(self,parameters)
+        StdMeshers._objref_StdMeshers_LocalLength.SetPrecision(self, precision)
+
+#Registering the new proxy for LocalLength
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_LocalLength._NP_RepositoryId, LocalLength)
+
+
+#Wrapper class for StdMeshers_LayerDistribution hypothesis
+class LayerDistribution(StdMeshers._objref_StdMeshers_LayerDistribution):
+    
+    def SetLayerDistribution(self, hypo):
+        StdMeshers._objref_StdMeshers_LayerDistribution.SetParameters(self,hypo.GetParameters())
+        hypo.ClearParameters();
+        StdMeshers._objref_StdMeshers_LayerDistribution.SetLayerDistribution(self,hypo)
+
+#Registering the new proxy for LayerDistribution
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_LayerDistribution._NP_RepositoryId, LayerDistribution)
+
+#Wrapper class for StdMeshers_SegmentLengthAroundVertex hypothesis
+class SegmentLengthAroundVertex(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex):
+    
+    ## Set Length parameter value
+    #  @param length numerical value or name of variable from notebook    
+    def SetLength(self, length):
+        length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.GetLastParameters(self),1,1,length)
+        StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.SetParameters(self,parameters)
+        StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.SetLength(self,length)
+
+#Registering the new proxy for SegmentLengthAroundVertex
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex._NP_RepositoryId, SegmentLengthAroundVertex)
+
+
+#Wrapper class for StdMeshers_Arithmetic1D hypothesis
+class Arithmetic1D(StdMeshers._objref_StdMeshers_Arithmetic1D):
+    
+    ## Set Length parameter value
+    #  @param length   numerical value or name of variable from notebook
+    #  @param isStart  true is length is Start Length, otherwise false
+    def SetLength(self, length, isStart):
+        nb = 2
+        if isStart:
+            nb = 1
+        length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_Arithmetic1D.GetLastParameters(self),2,nb,length)
+        StdMeshers._objref_StdMeshers_Arithmetic1D.SetParameters(self,parameters)
+        StdMeshers._objref_StdMeshers_Arithmetic1D.SetLength(self,length,isStart)
+        
+#Registering the new proxy for Arithmetic1D
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_Arithmetic1D._NP_RepositoryId, Arithmetic1D)
+
+#Wrapper class for StdMeshers_Deflection1D hypothesis
+class Deflection1D(StdMeshers._objref_StdMeshers_Deflection1D):
+    
+    ## Set Deflection parameter value
+    #  @param deflection numerical value or name of variable from notebook    
+    def SetDeflection(self, deflection):
+        deflection,parameters = ParseParameters(StdMeshers._objref_StdMeshers_Deflection1D.GetLastParameters(self),1,1,deflection)
+        StdMeshers._objref_StdMeshers_Deflection1D.SetParameters(self,parameters)
+        StdMeshers._objref_StdMeshers_Deflection1D.SetDeflection(self,deflection)
+
+#Registering the new proxy for Deflection1D
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_Deflection1D._NP_RepositoryId, Deflection1D)
+
+#Wrapper class for StdMeshers_StartEndLength hypothesis
+class StartEndLength(StdMeshers._objref_StdMeshers_StartEndLength):
+    
+    ## Set Length parameter value
+    #  @param length  numerical value or name of variable from notebook
+    #  @param isStart true is length is Start Length, otherwise false
+    def SetLength(self, length, isStart):
+        nb = 2
+        if isStart:
+            nb = 1
+        length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_StartEndLength.GetLastParameters(self),2,nb,length)
+        StdMeshers._objref_StdMeshers_StartEndLength.SetParameters(self,parameters)
+        StdMeshers._objref_StdMeshers_StartEndLength.SetLength(self,length,isStart)
+        
+#Registering the new proxy for StartEndLength
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_StartEndLength._NP_RepositoryId, StartEndLength)
+
+#Wrapper class for StdMeshers_MaxElementArea hypothesis
+class MaxElementArea(StdMeshers._objref_StdMeshers_MaxElementArea):
+    
+    ## Set Max Element Area parameter value
+    #  @param area  numerical value or name of variable from notebook
+    def SetMaxElementArea(self, area):
+        area ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_MaxElementArea.GetLastParameters(self),1,1,area)
+        StdMeshers._objref_StdMeshers_MaxElementArea.SetParameters(self,parameters)
+        StdMeshers._objref_StdMeshers_MaxElementArea.SetMaxElementArea(self,area)
+        
+#Registering the new proxy for MaxElementArea
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_MaxElementArea._NP_RepositoryId, MaxElementArea)
+
+
+#Wrapper class for StdMeshers_MaxElementVolume hypothesis
+class MaxElementVolume(StdMeshers._objref_StdMeshers_MaxElementVolume):
+    
+    ## Set Max Element Volume parameter value
+    #  @param area  numerical value or name of variable from notebook
+    def SetMaxElementVolume(self, volume):
+        volume ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_MaxElementVolume.GetLastParameters(self),1,1,volume)
+        StdMeshers._objref_StdMeshers_MaxElementVolume.SetParameters(self,parameters)
+        StdMeshers._objref_StdMeshers_MaxElementVolume.SetMaxElementVolume(self,volume)
+        
+#Registering the new proxy for MaxElementVolume
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_MaxElementVolume._NP_RepositoryId, MaxElementVolume)
+
+
+#Wrapper class for StdMeshers_NumberOfLayers hypothesis
+class NumberOfLayers(StdMeshers._objref_StdMeshers_NumberOfLayers):
+    
+    ## Set Number Of Layers parameter value
+    #  @param nbLayers  numerical value or name of variable from notebook
+    def SetNumberOfLayers(self, nbLayers):
+        nbLayers ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_NumberOfLayers.GetLastParameters(self),1,1,nbLayers)
+        StdMeshers._objref_StdMeshers_NumberOfLayers.SetParameters(self,parameters)
+        StdMeshers._objref_StdMeshers_NumberOfLayers.SetNumberOfLayers(self,nbLayers)
+        
+#Registering the new proxy for NumberOfLayers
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_NumberOfLayers._NP_RepositoryId, NumberOfLayers)
+
+#Wrapper class for StdMeshers_NumberOfSegments hypothesis
+class NumberOfSegments(StdMeshers._objref_StdMeshers_NumberOfSegments):
+    
+    ## Set Number Of Segments parameter value
+    #  @param nbSeg numerical value or name of variable from notebook
+    def SetNumberOfSegments(self, nbSeg):
+        lastParameters = StdMeshers._objref_StdMeshers_NumberOfSegments.GetLastParameters(self)
+        nbSeg , parameters = ParseParameters(lastParameters,1,1,nbSeg)
+        StdMeshers._objref_StdMeshers_NumberOfSegments.SetParameters(self,parameters)
+        StdMeshers._objref_StdMeshers_NumberOfSegments.SetNumberOfSegments(self,nbSeg)
+        
+    ## Set Scale Factor parameter value
+    #  @param factor numerical value or name of variable from notebook
+    def SetScaleFactor(self, factor):
+        factor, parameters = ParseParameters(StdMeshers._objref_StdMeshers_NumberOfSegments.GetLastParameters(self),2,2,factor)
+        StdMeshers._objref_StdMeshers_NumberOfSegments.SetParameters(self,parameters)
+        StdMeshers._objref_StdMeshers_NumberOfSegments.SetScaleFactor(self,factor)
+        
+#Registering the new proxy for NumberOfSegments
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_NumberOfSegments._NP_RepositoryId, NumberOfSegments)
+
+
+#Wrapper class for NETGENPlugin_Hypothesis hypothesis
+class NETGENPlugin_Hypothesis(NETGENPlugin._objref_NETGENPlugin_Hypothesis):
+
+    ## Set Max Size parameter value
+    #  @param maxsize numerical value or name of variable from notebook
+    def SetMaxSize(self, maxsize):
+        lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
+        maxsize, parameters = ParseParameters(lastParameters,4,1,maxsize)
+        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetMaxSize(self,maxsize)
+        
+    ## Set Growth Rate parameter value
+    #  @param value  numerical value or name of variable from notebook
+    def SetGrowthRate(self, value):
+        lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
+        value, parameters = ParseParameters(lastParameters,4,2,value)
+        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetGrowthRate(self,value)
+        
+    ## Set Number of Segments per Edge parameter value
+    #  @param value  numerical value or name of variable from notebook
+    def SetNbSegPerEdge(self, value):
+        lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
+        value, parameters = ParseParameters(lastParameters,4,3,value)
+        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetNbSegPerEdge(self,value)
+        
+    ## Set Number of Segments per Radius parameter value
+    #  @param value  numerical value or name of variable from notebook
+    def SetNbSegPerRadius(self, value):
+        lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
+        value, parameters = ParseParameters(lastParameters,4,4,value)
+        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+        NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetNbSegPerRadius(self,value)
+        
+#Registering the new proxy for NETGENPlugin_Hypothesis
+omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_Hypothesis._NP_RepositoryId, NETGENPlugin_Hypothesis)
+
+
+#Wrapper class for NETGENPlugin_Hypothesis_2D hypothesis
+class NETGENPlugin_Hypothesis_2D(NETGENPlugin_Hypothesis,NETGENPlugin._objref_NETGENPlugin_Hypothesis_2D):
+    pass
+
+#Registering the new proxy for NETGENPlugin_Hypothesis_2D
+omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_Hypothesis_2D._NP_RepositoryId, NETGENPlugin_Hypothesis_2D)
+
+#Wrapper class for NETGENPlugin_SimpleHypothesis_2D hypothesis
+class NETGEN_SimpleParameters_2D(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D):
+    
+    ## Set Number of Segments parameter value
+    #  @param nbSeg numerical value or name of variable from notebook
+    def SetNumberOfSegments(self, nbSeg):
+        lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
+        nbSeg, parameters = ParseParameters(lastParameters,2,1,nbSeg)
+        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetNumberOfSegments(self, nbSeg)
+
+    ## Set Local Length parameter value
+    #  @param length numerical value or name of variable from notebook
+    def SetLocalLength(self, length):
+        lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
+        length, parameters = ParseParameters(lastParameters,2,1,length)
+        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetLocalLength(self, length)
+
+    ## Set Max Element Area parameter value
+    #  @param area numerical value or name of variable from notebook    
+    def SetMaxElementArea(self, area):
+        lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
+        area, parameters = ParseParameters(lastParameters,2,2,area)
+        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetMaxElementArea(self, area)
+
+    def LengthFromEdges(self):
+        lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
+        value = 0;
+        value, parameters = ParseParameters(lastParameters,2,2,value)
+        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.LengthFromEdges(self)
+        
+#Registering the new proxy for NETGEN_SimpleParameters_2D
+omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D._NP_RepositoryId, NETGEN_SimpleParameters_2D)
+
+
+#Wrapper class for NETGENPlugin_SimpleHypothesis_3D hypothesis
+class NETGEN_SimpleParameters_3D(NETGEN_SimpleParameters_2D,NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D):
+    ## Set Max Element Volume parameter value
+    #  @param volume numerical value or name of variable from notebook    
+    def SetMaxElementVolume(self, volume):
+        lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetLastParameters(self)
+        volume, parameters = ParseParameters(lastParameters,3,3,volume)
+        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetParameters(self,parameters)
+        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetMaxElementVolume(self, volume)
+
+    def LengthFromFaces(self):
+        lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetLastParameters(self)
+        value = 0;
+        value, parameters = ParseParameters(lastParameters,3,3,value)
+        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetParameters(self,parameters)
+        NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.LengthFromFaces(self)
+        
+#Registering the new proxy for NETGEN_SimpleParameters_3D
+omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D._NP_RepositoryId, NETGEN_SimpleParameters_3D)
+
+class Pattern(SMESH._objref_SMESH_Pattern):
+
+    def ApplyToMeshFaces(self, theMesh, theFacesIDs, theNodeIndexOnKeyPoint1, theReverse):
+        flag = False
+        if isinstance(theNodeIndexOnKeyPoint1,str):
+            flag = True
+        theNodeIndexOnKeyPoint1,Parameters = geompyDC.ParseParameters(theNodeIndexOnKeyPoint1)
+        if flag:
+            theNodeIndexOnKeyPoint1 -= 1
+        theMesh.SetParameters(Parameters)
+        return SMESH._objref_SMESH_Pattern.ApplyToMeshFaces( self, theMesh, theFacesIDs, theNodeIndexOnKeyPoint1, theReverse )
+
+    def ApplyToHexahedrons(self, theMesh, theVolumesIDs, theNode000Index, theNode001Index):
+        flag0 = False
+        flag1 = False
+        if isinstance(theNode000Index,str):
+            flag0 = True
+        if isinstance(theNode001Index,str):
+            flag1 = True
+        theNode000Index,theNode001Index,Parameters = geompyDC.ParseParameters(theNode000Index,theNode001Index)
+        if flag0:
+            theNode000Index -= 1
+        if flag1:
+            theNode001Index -= 1
+        theMesh.SetParameters(Parameters)
+        return SMESH._objref_SMESH_Pattern.ApplyToHexahedrons( self, theMesh, theVolumesIDs, theNode000Index, theNode001Index )
+
+#Registering the new proxy for Pattern
+omniORB.registerObjref(SMESH._objref_SMESH_Pattern._NP_RepositoryId, Pattern)
index 33d2c3be0732f19396a8ffa62d6e9b6fea0df6af..9e8e0bda842b80b5672c123d7dacee87a15723ca 100644 (file)
@@ -27,6 +27,7 @@
 #include "StdMeshersGUI_DistrTable.h"
 #include "StdMeshersGUI_DistrPreview.h"
 
+#include <SMESHGUI.h>
 #include <SMESHGUI_Utils.h>
 #include <SMESHGUI_HypothesesUtils.h>
 #include <SMESHGUI_SpinBox.h>
@@ -36,7 +37,7 @@
 
 // SALOME GUI includes
 #include <SalomeApp_Tools.h>
-#include <QtxIntSpinBox.h>
+#include <SalomeApp_IntSpinBox.h>
 #include <QtxComboBox.h>
 
 // Qt includes
@@ -78,13 +79,17 @@ StdMeshersGUI_NbSegmentsCreator::~StdMeshersGUI_NbSegmentsCreator()
 {
 }
 
-bool StdMeshersGUI_NbSegmentsCreator::checkParams() const
+bool StdMeshersGUI_NbSegmentsCreator::checkParams( QString& msg ) const
 {
+  if( !SMESHGUI_GenericHypothesisCreator::checkParams( msg ) )
+    return false;
   NbSegmentsHypothesisData data_old, data_new;
   readParamsFromHypo( data_old );
   readParamsFromWidgets( data_new );
   bool res = storeParamsToHypo( data_new );
   storeParamsToHypo( data_old );
+  res = myNbSeg->isValid( msg, true ) && res;
+  res = myScale->isValid( msg, true ) && res;
   return res;
 }
 
@@ -122,7 +127,7 @@ QFrame* StdMeshersGUI_NbSegmentsCreator::buildFrame()
 
   // 1)  number of segments
   myGroupLayout->addWidget( new QLabel( tr( "SMESH_NB_SEGMENTS_PARAM" ), GroupC1 ), row, 0 );
-  myNbSeg = new QtxIntSpinBox( GroupC1 );
+  myNbSeg = new SalomeApp_IntSpinBox( GroupC1 );
   myNbSeg->setMinimum( 1 );
   myNbSeg->setMaximum( 9999 );
   myGroupLayout->addWidget( myNbSeg, row, 1 );
@@ -206,9 +211,16 @@ void StdMeshersGUI_NbSegmentsCreator::retrieveParams() const
 
   if( myName )
     myName->setText( data.myName );
-  myNbSeg->setValue( data.myNbSeg );
+  if(data.myNbSegVarName.isEmpty())
+    myNbSeg->setValue( data.myNbSeg );
+  else
+    myNbSeg->setText( data.myNbSegVarName );
+  
   myDistr->setCurrentIndex( data.myDistrType );
-  myScale->setValue( data.myScale );
+  if(data.myScaleVarName.isEmpty())
+    myScale->setValue( data.myScale );
+  else
+    myScale->setText( data.myScaleVarName );
   myConv->button( data.myConv )->setChecked( true );
   myTable->setFuncMinValue(myConv->checkedId()==0 ? -1E20 : 0);
   myTable->setData( data.myTable );
@@ -223,7 +235,7 @@ QString StdMeshersGUI_NbSegmentsCreator::storeParams() const
   NbSegmentsHypothesisData data;
   readParamsFromWidgets( data );
   storeParamsToHypo( data );
-
+    
   QString valStr = QString::number( data.myNbSeg ) += "; ";
 
   enum DistrType
@@ -238,8 +250,8 @@ QString StdMeshersGUI_NbSegmentsCreator::storeParams() const
   case Regular :
     valStr += tr("SMESH_DISTR_REGULAR");
     break;
-  case Scale   :
-    valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale );
+  case Scale   : 
+    valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale );\
     break;
   case TabFunc : {
     //valStr += tr("SMESH_TAB_FUNC");
@@ -275,9 +287,21 @@ bool StdMeshersGUI_NbSegmentsCreator::readParamsFromHypo( NbSegmentsHypothesisDa
   h_data.myName = hypName();
 
   h_data.myNbSeg = (int) h->GetNumberOfSegments();
+  
+  SMESH::ListOfParameters_var aParameters = h->GetLastParameters();
+
+  h_data.myNbSegVarName  = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString("");
+
   int distr = (int) h->GetDistrType();
   h_data.myDistrType = distr;
   h_data.myScale = distr==1 ? h->GetScaleFactor() : 1.0;
+  
+  if(distr==1){
+    h_data.myScaleVarName  = (aParameters->length() > 1) ? QString(aParameters[1].in()) : QString("");
+  }
+  else 
+    h_data.myScaleVarName = QString("");
+
   if( distr==2 )
   {
     SMESH::double_array* a = h->GetTableFunction();
@@ -310,13 +334,17 @@ bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe
     if( isCreation() )
       SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().data() );
 
+    QStringList aVariablesList;
+    aVariablesList.append(h_data.myNbSegVarName);
+
     h->SetNumberOfSegments( h_data.myNbSeg );
     int distr = h_data.myDistrType;
     h->SetDistrType( distr );
-
-    if( distr==1 )
+    
+    if( distr==1 ) {
       h->SetScaleFactor( h_data.myScale );
-
+      aVariablesList.append(h_data.myScaleVarName);
+    }
     if( distr==2 || distr==3 )
       h->SetConversionMode( h_data.myConv );
 
@@ -328,6 +356,8 @@ bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe
     //setting of function must follow after setConversionMode, because otherwise
     //the function will be checked with old conversion mode, so that it may occurs
     //unexpected errors for user
+
+    h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
   }
   catch(const SALOME::SALOME_Exception& ex)
   {
@@ -341,6 +371,8 @@ bool StdMeshersGUI_NbSegmentsCreator::readParamsFromWidgets( NbSegmentsHypothesi
 {
   h_data.myName      = myName ? myName->text() : "";
   h_data.myNbSeg     = myNbSeg->value();
+  h_data.myNbSegVarName =  myNbSeg->text();
+  h_data.myScaleVarName =  myScale->text();
   h_data.myDistrType = myDistr->currentIndex();
   h_data.myConv      = myConv->checkedId();
   h_data.myScale     = myScale->value();
index b64ea664a15f87f763dbc0eaec1d27a4f861a934..ba7c7bff85d840f0b10d33e1d9586a6251d5b530 100644 (file)
@@ -34,7 +34,7 @@
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SMESH_Mesh)
 
-class QtxIntSpinBox;
+class SalomeApp_IntSpinBox;
 class QtxComboBox;
 class SMESHGUI_SpinBox;
 class StdMeshersGUI_DistrTableFrame;
@@ -51,6 +51,7 @@ typedef struct
   double              myScale;
   SMESH::double_array myTable;
   QString             myName, myExpr;
+  QString             myNbSegVarName, myScaleVarName;
 
 } NbSegmentsHypothesisData;
 
@@ -62,7 +63,7 @@ public:
   StdMeshersGUI_NbSegmentsCreator();
   virtual ~StdMeshersGUI_NbSegmentsCreator();
 
-  virtual bool checkParams() const;
+  virtual bool checkParams( QString& ) const;
 
 protected:
   virtual QFrame*  buildFrame();
@@ -78,7 +79,7 @@ private:
   bool storeParamsToHypo( const NbSegmentsHypothesisData& ) const;
 
 private:
-  QtxIntSpinBox*   myNbSeg;
+  SalomeApp_IntSpinBox*   myNbSeg;
   QtxComboBox*     myDistr;
   SMESHGUI_SpinBox*   myScale;
   StdMeshersGUI_DistrTableFrame*  myTable;
index ca8e3a684dd42726ee0d33ba872cc6b7230a7a09..56e31b5a6deae6b463b7a12a4269b2d57110474e 100644 (file)
@@ -33,6 +33,7 @@
 #include <SMESH_NumberFilter.hxx>
 #include <StdMeshersGUI_ObjectReferenceParamWdg.h>
 #include <StdMeshersGUI_LayerDistributionParamWdg.h>
+#include <SALOMEDSClient_Study.hxx>
 
 // SALOME GUI includes
 #include <SUIT_ResourceMgr.h>
@@ -340,8 +341,11 @@ namespace {
  */
 //================================================================================
 
-bool StdMeshersGUI_StdHypothesisCreator::checkParams() const
+bool StdMeshersGUI_StdHypothesisCreator::checkParams( QString& msg ) const
 {
+  if( !SMESHGUI_GenericHypothesisCreator::checkParams( msg ) )
+    return false;
+
   // check if object reference parameter is set, as it has no default value
   bool ok = true;
   if ( hypType().startsWith("ProjectionSource" ))
@@ -399,6 +403,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
   }
 
   QString valueStr = stdParamValues( params );
+  QStringList aVariablesList = getVariablesFromDlg();
 
   if( res && !params.isEmpty() )
   {
@@ -408,7 +413,9 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
        StdMeshers::StdMeshers_LocalLength::_narrow( hypothesis() );
 
       h->SetLength( params[0].myValue.toDouble() );
+      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
       h->SetPrecision( params[1].myValue.toDouble() );
+      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
     }
     else if( hypType()=="MaxLength" )
     {
@@ -429,6 +436,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
        StdMeshers::StdMeshers_SegmentLengthAroundVertex::_narrow( hypothesis() );
 
       h->SetLength( params[0].myValue.toDouble() );
+      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
     }
     else if( hypType()=="Arithmetic1D" )
     {
@@ -436,13 +444,15 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
        StdMeshers::StdMeshers_Arithmetic1D::_narrow( hypothesis() );
 
       h->SetLength( params[0].myValue.toDouble(), true );
+      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
       h->SetLength( params[1].myValue.toDouble(), false );
+      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
     }
     else if( hypType()=="MaxElementArea" )
     {
       StdMeshers::StdMeshers_MaxElementArea_var h =
        StdMeshers::StdMeshers_MaxElementArea::_narrow( hypothesis() );
-
+      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
       h->SetMaxElementArea( params[0].myValue.toDouble() );
     }
     else if( hypType()=="MaxElementVolume" )
@@ -451,6 +461,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
        StdMeshers::StdMeshers_MaxElementVolume::_narrow( hypothesis() );
 
       h->SetMaxElementVolume( params[0].myValue.toDouble() );
+      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
     }
     else if( hypType()=="StartEndLength" )
     {
@@ -458,13 +469,15 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
        StdMeshers::StdMeshers_StartEndLength::_narrow( hypothesis() );
 
       h->SetLength( params[0].myValue.toDouble(), true );
+      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
       h->SetLength( params[1].myValue.toDouble(), false );
+      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
     }
     else if( hypType()=="Deflection1D" )
     {
       StdMeshers::StdMeshers_Deflection1D_var h =
        StdMeshers::StdMeshers_Deflection1D::_narrow( hypothesis() );
-
+      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
       h->SetDeflection( params[0].myValue.toDouble() );
     }
     else if( hypType()=="AutomaticLength" )
@@ -480,6 +493,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
        StdMeshers::StdMeshers_NumberOfLayers::_narrow( hypothesis() );
 
       h->SetNumberOfLayers( params[0].myValue.toInt() );
+      h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
     }
     else if( hypType()=="LayerDistribution" )
     {
@@ -487,8 +501,10 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
        StdMeshers::StdMeshers_LayerDistribution::_narrow( hypothesis() );
       StdMeshersGUI_LayerDistributionParamWdg* w = 
         widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 );
-
+      
       h->SetLayerDistribution( w->GetHypothesis() );
+      h->SetParameters(w->GetHypothesis()->GetParameters());
+      w->GetHypothesis()->ClearParameters();
     }
     else if( hypType()=="ProjectionSource1D" )
     {
@@ -558,20 +574,25 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
     p.append( item );
     customWidgets()->append(0);
   }
-
+  
   SMESH::SMESH_Hypothesis_var hyp = initParamsHypothesis();
+  SMESH::ListOfParameters_var aParameters = hyp->GetLastParameters();
 
   if( hypType()=="LocalLength" )
   {
     StdMeshers::StdMeshers_LocalLength_var h =
       StdMeshers::StdMeshers_LocalLength::_narrow( hyp );
-
+    
     item.myName = tr("SMESH_LOCAL_LENGTH_PARAM");
-    item.myValue = h->GetLength();
-    p.append( item );
+    if(!initVariableName(aParameters,item,0))
+      item.myValue = h->GetLength();
+    p.append( item );     
+    
     item.myName = tr("SMESH_LOCAL_LENGTH_PRECISION");
-    item.myValue = h->GetPrecision();
+    if(!initVariableName(aParameters,item,1))
+      item.myValue = h->GetPrecision(); 
     p.append( item );
+    
   }
   else if( hypType()=="MaxLength" )
   {
@@ -612,7 +633,9 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
       StdMeshers::StdMeshers_SegmentLengthAroundVertex::_narrow( hyp );
 
     item.myName = tr("SMESH_LOCAL_LENGTH_PARAM");
-    item.myValue = h->GetLength();
+    if(!initVariableName(aParameters,item,0))
+      item.myValue = h->GetLength();
+    
     p.append( item );
   }
   else if( hypType()=="Arithmetic1D" )
@@ -621,10 +644,13 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
       StdMeshers::StdMeshers_Arithmetic1D::_narrow( hyp );
 
     item.myName = tr( "SMESH_START_LENGTH_PARAM" );
-    item.myValue = h->GetLength( true );
+    if(!initVariableName(aParameters,item,0))
+      item.myValue = h->GetLength( true );
     p.append( item );
+
     item.myName = tr( "SMESH_END_LENGTH_PARAM" );
-    item.myValue = h->GetLength( false );
+    if(!initVariableName(aParameters,item,1))
+      item.myValue = h->GetLength( false );
     p.append( item );
   }
   else if( hypType()=="MaxElementArea" )
@@ -633,8 +659,10 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
       StdMeshers::StdMeshers_MaxElementArea::_narrow( hyp );
 
     item.myName = tr( "SMESH_MAX_ELEMENT_AREA_PARAM" );
-    item.myValue = h->GetMaxElementArea();
+    if(!initVariableName(aParameters,item,0))
+      item.myValue = h->GetMaxElementArea();
     p.append( item );
+    
   }
   else if( hypType()=="MaxElementVolume" )
   {
@@ -642,7 +670,8 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
       StdMeshers::StdMeshers_MaxElementVolume::_narrow( hyp );
 
     item.myName = tr( "SMESH_MAX_ELEMENT_VOLUME_PARAM" );
-    item.myValue = h->GetMaxElementVolume();
+    if(!initVariableName(aParameters,item,0))
+      item.myValue = h->GetMaxElementVolume();
     p.append( item );
   }
   else if( hypType()=="StartEndLength" )
@@ -651,19 +680,25 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
       StdMeshers::StdMeshers_StartEndLength::_narrow( hyp );
 
     item.myName = tr( "SMESH_START_LENGTH_PARAM" );
-    item.myValue = h->GetLength( true );
+
+    if(!initVariableName(aParameters,item,0)) 
+      item.myValue = h->GetLength( true );
     p.append( item );
+
     item.myName = tr( "SMESH_END_LENGTH_PARAM" );
-    item.myValue = h->GetLength( false );
+    if(!initVariableName(aParameters,item,1)) 
+      item.myValue = h->GetLength( false );
     p.append( item );
+    
   }
   else if( hypType()=="Deflection1D" )
   {
     StdMeshers::StdMeshers_Deflection1D_var h =
       StdMeshers::StdMeshers_Deflection1D::_narrow( hyp );
-
+    
     item.myName = tr( "SMESH_DEFLECTION1D_PARAM" );
-    item.myValue = h->GetDeflection();
+    if(!initVariableName(aParameters,item,0)) 
+      item.myValue = h->GetDeflection();
     p.append( item );
   }
   else if( hypType()=="AutomaticLength" )
@@ -683,15 +718,25 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
       StdMeshers::StdMeshers_NumberOfLayers::_narrow( hyp );
 
     item.myName = tr( "SMESH_NUMBER_OF_LAYERS" );
-    item.myValue = (int) h->GetNumberOfLayers();
+    if(!initVariableName(aParameters,item,0))     
+      item.myValue = (int) h->GetNumberOfLayers();
     p.append( item );
   }
   else if( hypType()=="LayerDistribution" )
-  {
-    StdMeshers::StdMeshers_LayerDistribution_var h =
+    {
+      StdMeshers::StdMeshers_LayerDistribution_var h =
       StdMeshers::StdMeshers_LayerDistribution::_narrow( hyp );
 
     item.myName = tr( "SMESH_LAYERS_DISTRIBUTION" ); p.append( item );
+    
+    //Set into not published hypo last variables
+    QStringList aLastVarsList;
+    for(int i = 0;i<aParameters->length();i++) 
+      aLastVarsList.append(QString(aParameters[i].in()));
+
+    if(!aLastVarsList.isEmpty())
+      h->GetLayerDistribution()->SetLastParameters(SMESHGUI::JoinObjectParameters(aLastVarsList));
+    
     customWidgets()->append
       ( new StdMeshersGUI_LayerDistributionParamWdg( h->GetLayerDistribution(), hypName(), dlg()));
   }
@@ -988,3 +1033,21 @@ void StdMeshersGUI_StdHypothesisCreator::valueChanged( QWidget* paramWidget)
     }
   }
 }
+
+//================================================================================
+/*!
+ *
+ */
+//================================================================================
+
+bool StdMeshersGUI_StdHypothesisCreator::initVariableName(SMESH::ListOfParameters_var theParameters, 
+                                                          StdParam &theParams, 
+                                                          int order) const
+{
+  QString aVaribaleName = (theParameters->length() > order) ? QString(theParameters[order].in()) : QString("");
+  theParams.isVariable = !aVaribaleName.isEmpty();
+  if(theParams.isVariable) 
+    theParams.myValue = aVaribaleName;
+
+  return theParams.isVariable;
+}
index 8d45eb94d7a831a4929d66e3aed8db44e8a734b7..0973c5c03325e349cf6036f3f56acb353ca21d9b 100644 (file)
@@ -27,9 +27,9 @@
 
 // SMESH includes
 #include "SMESH_StdMeshersGUI.hxx"
-
 #include <SMESHGUI_Hypotheses.h>
 
+
 /*!
  * \brief Class for creation of standard hypotheses
 */
@@ -41,7 +41,7 @@ public:
   StdMeshersGUI_StdHypothesisCreator( const QString& );
   virtual ~StdMeshersGUI_StdHypothesisCreator();
 
-  virtual bool checkParams() const;
+  virtual bool checkParams( QString& ) const;
 
 protected:
   virtual QFrame*  buildFrame    ();
@@ -59,6 +59,7 @@ protected:
   virtual QWidget* getWidgetForParam( int paramIndex ) const;
   virtual ListOfWidgets* customWidgets() const;
   virtual void     onReject();
+  virtual bool     initVariableName(SMESH::ListOfParameters_var theParameters, StdParam& theParams, int order) const;
 
   virtual void     valueChanged( QWidget* );