Salome HOME
0021308: Remove hard-coded dependency of the external mesh plugins from the SMESH...
authoreap <eap@opencascade.com>
Wed, 7 Mar 2012 15:07:13 +0000 (15:07 +0000)
committereap <eap@opencascade.com>
Wed, 7 Mar 2012 15:07:13 +0000 (15:07 +0000)
   Use TVar structure to dump arguments that can be defined via notebook variables

29 files changed:
src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx
src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx
src/StdMeshers_I/StdMeshers_CartesianParameters3D_i.cxx
src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx
src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx
src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx
src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.hxx
src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx
src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx
src/StdMeshers_I/StdMeshers_LocalLength_i.cxx
src/StdMeshers_I/StdMeshers_LocalLength_i.hxx
src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx
src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx
src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx
src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx
src/StdMeshers_I/StdMeshers_MaxLength_i.cxx
src/StdMeshers_I/StdMeshers_MaxLength_i.hxx
src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx
src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.hxx
src/StdMeshers_I/StdMeshers_NumberOfLayers_i.cxx
src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx
src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx
src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx
src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.cxx
src/StdMeshers_I/StdMeshers_SegmentLengthAroundVertex_i.hxx
src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx
src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx
src/StdMeshers_I/StdMeshers_ViscousLayers_i.cxx
src/StdMeshers_I/StdMeshers_ViscousLayers_i.hxx

index 290e62f743697b09a1166e61077f4bb57ab8e90c..2485217e60a19e346d2dd7e86a616fb072ac2d57 100644 (file)
@@ -24,7 +24,6 @@
 //  File   : StdMeshers_Arithmetic1D_i.cxx
 //  Author : Damien COQUERET, OCC
 //  Module : SMESH
-//  $Header$
 //
 #include "StdMeshers_Arithmetic1D_i.hxx"
 #include "SMESH_Gen_i.hxx"
@@ -95,7 +94,8 @@ void StdMeshers_Arithmetic1D_i::SetLength(CORBA::Double theLength,
 
   // Update Python script
   SMESH::TPythonDump()
-    << _this() << ( theIsStart ? ".SetStartLength( " : ".SetEndLength( " ) << theLength << " )";
+    << _this() << ( theIsStart ? ".SetStartLength( " : ".SetEndLength( " )
+    << SMESH::TVar(theLength) << " )";
 }
 
 //=============================================================================
@@ -259,3 +259,14 @@ CORBA::Boolean StdMeshers_Arithmetic1D_i::IsDimSupported( SMESH::Dimension type
   return type == SMESH::DIM_1D;
 }
 
+//================================================================================
+/*!
+ * \brief Return method name corresponding to index of variable parameter
+ */
+//================================================================================
+
+std::string StdMeshers_Arithmetic1D_i::getMethodOfParameter(const int paramIndex,
+                                                            int       nbVars) const
+{
+  return paramIndex == 0 ? "SetStartLength" : "SetEndLength";
+}
index c789ffd7a3f8a2fd040106a72a64429277400208..45928d79ce97171c2215459067a50aaac8da9d37 100644 (file)
@@ -82,6 +82,9 @@ public:
 
   // Verify whether hypothesis supports given entity type 
   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+
+ protected:
+  virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
 };
 
 #endif
index 06ebe87d431a4182f5cf5d5cf6a9f9120c3c8871..fbba9a17f51f3f16b7088764adb7ce05f557bdf0 100644 (file)
@@ -151,7 +151,7 @@ void StdMeshers_CartesianParameters3D_i::SetSizeThreshold(CORBA::Double threshol
   }
 
   // Update Python script
-  SMESH::TPythonDump() << _this() << ".SetSizeThreshold( " << threshold << " )";
+  SMESH::TPythonDump() << _this() << ".SetSizeThreshold( " << SMESH::TVar(threshold) << " )";
 }
 
 //=============================================================================
index 91cb7a651eb980d52f0e1ef90ff9de62d06b26ba..f01f2a1678eb836b0ef4b641f8e57043168dd041 100644 (file)
@@ -93,7 +93,7 @@ void StdMeshers_Deflection1D_i::SetDeflection( CORBA::Double theValue )
   }
 
   // Update Python script
-  SMESH::TPythonDump() << _this() << ".SetDeflection( " << theValue << " )";
+  SMESH::TPythonDump() << _this() << ".SetDeflection( " << SMESH::TVar(theValue) << " )";
 }
 
 //=============================================================================
@@ -139,3 +139,14 @@ CORBA::Boolean StdMeshers_Deflection1D_i::IsDimSupported( SMESH::Dimension type
   return type == SMESH::DIM_1D;
 }
 
+//================================================================================
+/*!
+ * \brief Return method name corresponding to index of variable parameter
+ */
+//================================================================================
+
+std::string StdMeshers_Deflection1D_i::getMethodOfParameter(const int paramIndex,
+                                                            int       /*nbVars*/) const
+{
+  return "SetDeflection";
+}
index b1a18511854cea4c3d8f17c1c74d06d5b0597bd2..ad45de2a68aae9d7396b8b19e315f7fe8286634c 100644 (file)
@@ -25,7 +25,6 @@
 //           Moved here from SMESH_LocalLength_i.hxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//  $Header$
 //
 #ifndef _SMESH_Deflection1D_I_HXX_
 #define _SMESH_Deflection1D_I_HXX_
@@ -66,7 +65,9 @@ public:
   
   // Verify whether hypothesis supports given entity type 
   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+
+ protected:
+  virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
 };
 
 #endif
-
index db93c33a2f2a429303e500c10dd34bee06763d1d..2541fe94db853ecf47145254cbcd9c0837dda4ed 100644 (file)
 //  File   : StdMeshers_LayerDistribution2D_i.cxx
 //  Author : Edward AGAPOV
 //  Module : SMESH
-//  $Header$
 //
 #include "StdMeshers_LayerDistribution2D_i.hxx"
 
 #include "utilities.h"
 
-//using namespace std;
-
 //=============================================================================
 /*!
  *  StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i
index 16f4d6c000398833e0b2b05086299b06856e750e..fc5c571e6df07c0fe7bc6edad34dbde06feee3f2 100644 (file)
@@ -21,7 +21,6 @@
 //  File   : StdMeshers_LayerDistribution2D_i.hxx
 //  Author : Edward AGAPOV
 //  Module : SMESH
-//  $Header$
 //
 #ifndef _SMESH_LayerDistribution2D_I_HXX_
 #define _SMESH_LayerDistribution2D_I_HXX_
index b30358a604d6da6344aeb765a3ddbfa3717d6e49..618575fe94eac842bc42dfd9fd3d32b3c240d16b 100644 (file)
@@ -24,7 +24,6 @@
 //  File   : StdMeshers_LayerDistribution_i.cxx
 //  Author : Edward AGAPOV
 //  Module : SMESH
-//  $Header$
 //
 #include "StdMeshers_LayerDistribution_i.hxx"
 #include "SMESH_Gen_i.hxx"
@@ -169,9 +168,9 @@ char* StdMeshers_LayerDistribution_i::SaveTo()
   else {
     os << hyp1D->GetName() << " "
        << hyp1D->GetLibName() << " "
-       << hyp1D_i->SaveTo();
+       << hyp1D_i->SaveTo() << " ";
   }
-  //myBaseImpl->SaveTo( os );
+  os << SMESH_Hypothesis_i::SaveTo();  // to have a mark of storage version ("VARS...")
 
   return CORBA::string_dup( os.str().c_str() );
 }
@@ -201,11 +200,14 @@ void StdMeshers_LayerDistribution_i::LoadFrom( const char* theStream )
         gen->CreateHypothesis( typeName.c_str(), libName.c_str() );
       SMESH_Hypothesis_i* hyp1D_i = SMESH::DownCast< SMESH_Hypothesis_i*>( hyp1D );
       if ( hyp1D_i ) {
-        hyp1D_i->LoadFrom( & theStream[ is.tellg() ]);
+        hyp1D_i->LoadFrom( & theStream[ (streamoff) is.tellg()+1 ]);
         this->GetImpl()->SetLayerDistribution( hyp1D_i->GetImpl() );
         myHyp = hyp1D;
         // as hyp1D is not published, its ID changes
         //SMESH::TPythonDump() << _this() << ".SetLayerDistribution( " << hyp1D << " )";
+
+        // restore a mark of storage version ("VARS...")
+        SMESH_Hypothesis_i::LoadFrom( & theStream[ (streamoff)is.tellg()+1 ]);
       }
     }
     catch (...) {
@@ -214,3 +216,14 @@ void StdMeshers_LayerDistribution_i::LoadFrom( const char* theStream )
   }
 }
 
+//================================================================================
+/*!
+ * \brief Restore myMethod2VarParams by parameters stored in an old study
+ */
+//================================================================================
+
+void StdMeshers_LayerDistribution_i::setOldParameters (const char* theParameters)
+{
+  if ( SMESH_Hypothesis_i* hyp1D_i = SMESH::DownCast< SMESH_Hypothesis_i*>( myHyp ))
+    hyp1D_i->setOldParameters( theParameters );
+}
index f930c1e666beb7669a10fd1dd41b4555e4197224..7f1b91603127c6faab0b1cbf62ee1a8f99ef485e 100644 (file)
@@ -24,7 +24,6 @@
 //  File   : StdMeshers_LayerDistribution_i.hxx
 //  Author : Edward AGAPOV
 //  Module : SMESH
-//  $Header$
 //
 #ifndef _SMESH_LayerDistribution_I_HXX_
 #define _SMESH_LayerDistribution_I_HXX_
@@ -80,9 +79,12 @@ public:
   virtual char* SaveTo();
   virtual void  LoadFrom( const char* theStream );
 
+protected:
+  // restore myMethod2VarParams by parameters stored in an old study
+  virtual void setOldParameters (const char* theParameters);
+  
 private:
   SMESH::SMESH_Hypothesis_var myHyp;
 };
 
 #endif
-
index 00feb20bd3179e15d9e8c3e02cefa503c896064b..a5fb518f4334c7c5a8b377a547c7a7aabdd4f146 100644 (file)
@@ -25,7 +25,6 @@
 //           Moved here from SMESH_LocalLength_i.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//  $Header$
 //
 #include "StdMeshers_LocalLength_i.hxx"
 #include "SMESH_Gen_i.hxx"
@@ -93,7 +92,7 @@ void StdMeshers_LocalLength_i::SetLength( CORBA::Double theLength )
   }
 
   // Update Python script
-  SMESH::TPythonDump() << _this() << ".SetLength( " << theLength << " )";
+  SMESH::TPythonDump() << _this() << ".SetLength( " << SMESH::TVar(theLength) << " )";
 }
 
 //=============================================================================
@@ -117,7 +116,7 @@ void StdMeshers_LocalLength_i::SetPrecision( CORBA::Double thePrecision )
   }
 
   // Update Python script
-  SMESH::TPythonDump() << _this() << ".SetPrecision( " << thePrecision << " )";
+  SMESH::TPythonDump() << _this() << ".SetPrecision( " << SMESH::TVar(thePrecision) << " )";
 }
 
 //=============================================================================
@@ -174,3 +173,9 @@ CORBA::Boolean StdMeshers_LocalLength_i::IsDimSupported( SMESH::Dimension type )
 {
   return type == SMESH::DIM_1D;
 }
+
+std::string StdMeshers_LocalLength_i::getMethodOfParameter(const int paramIndex,
+                                                           int       /*nbVars*/) const
+{
+  return paramIndex == 0 ? "SetLength" : "SetPrecision";
+}
index 92c218ac1ce7600d68f488605ba87cc52245e9da..00e565c3181802fbe92216a2e7ff458e6bfa3b03 100644 (file)
@@ -25,7 +25,6 @@
 //           Moved here from SMESH_LocalLength_i.hxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//  $Header$
 //
 #ifndef _SMESH_LOCALLENGTH_I_HXX_
 #define _SMESH_LOCALLENGTH_I_HXX_
@@ -72,6 +71,9 @@ public:
   
   // Verify whether hypothesis supports given entity type 
   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+
+ protected:
+  virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
 };
 
 #endif
index b81a4b40871e4cb6f64194df80a938bf238698f4..26f44c5cc1201cd83aa3d69be4f486910805adf2 100644 (file)
@@ -25,7 +25,6 @@
 //           Moved here from SMESH_MaxElementArea_i.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//  $Header$
 //
 #include "StdMeshers_MaxElementArea_i.hxx"
 #include "SMESH_Gen_i.hxx"
@@ -94,7 +93,7 @@ void StdMeshers_MaxElementArea_i::SetMaxElementArea( CORBA::Double theArea )
   }
 
   // Update Python script
-  SMESH::TPythonDump() << _this() << ".SetMaxElementArea( " << theArea << " )";
+  SMESH::TPythonDump() << _this() << ".SetMaxElementArea( " << SMESH::TVar(theArea) << " )";
 }
 
 //=============================================================================
@@ -140,3 +139,14 @@ CORBA::Boolean StdMeshers_MaxElementArea_i::IsDimSupported( SMESH::Dimension typ
   return type == SMESH::DIM_2D;
 }
 
+//================================================================================
+/*!
+ * \brief Return method name corresponding to index of variable parameter
+ */
+//================================================================================
+
+std::string StdMeshers_MaxElementArea_i::getMethodOfParameter(const int paramIndex,
+                                                              int       /*nbVars*/) const
+{
+  return "SetMaxElementArea";
+}
index 5eeb9bbd595a330c290ce7644c89cbba4d4a0c36..071888494a46ed559e9ab7e6e08fc62cbccd7dde 100644 (file)
@@ -25,7 +25,6 @@
 //           Moved here from SMESH_MaxElementArea_i.hxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//  $Header$
 //
 #ifndef _SMESH_MAXELEMENTAREA_I_HXX_
 #define _SMESH_MAXELEMENTAREA_I_HXX_
@@ -64,6 +63,9 @@ public:
   
   // Verify whether hypothesis supports given entity type 
   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+
+ protected:
+  virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
 };
 
 #endif
index fff72761f7da93b0cf5800dc9d87d13c2862b6fd..5d447a355b91c238e43755c76fa4eefdd77a2dd5 100644 (file)
@@ -25,7 +25,6 @@
 //           Moved here from SMESH_MaxElementVolume_i.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//  $Header$
 //
 #include "StdMeshers_MaxElementVolume_i.hxx"
 #include "SMESH_Gen_i.hxx"
@@ -94,7 +93,7 @@ void StdMeshers_MaxElementVolume_i::SetMaxElementVolume( CORBA::Double theVolume
   }
 
   // Update Python script
-  SMESH::TPythonDump() << _this() << ".SetMaxElementVolume( " << theVolume << " )";
+  SMESH::TPythonDump() << _this() << ".SetMaxElementVolume( " << SMESH::TVar(theVolume) << " )";
 }
 
 //=============================================================================
@@ -140,3 +139,13 @@ CORBA::Boolean StdMeshers_MaxElementVolume_i::IsDimSupported( SMESH::Dimension t
   return type == SMESH::DIM_3D;
 }
 
+//================================================================================
+/*!
+ * \brief Return method name corresponding to index of variable parameter
+ */
+//================================================================================
+
+std::string StdMeshers_MaxElementVolume_i::getMethodOfParameter(const int, int) const
+{
+  return "SetMaxElementVolume";
+}
index ffec42a8f820421401bd6b804d1efb264b577a78..f4896a779e5202519a7d7303ecb47a6cad3d9a50 100644 (file)
@@ -25,7 +25,6 @@
 //           Moved here from SMESH_MaxElementVolume_i.hxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//  $Header$
 //
 #ifndef _SMESH_MAXELEMENTVOLUME_I_HXX_
 #define _SMESH_MAXELEMENTVOLUME_I_HXX_
@@ -64,6 +63,9 @@ public:
   
   // Verify whether hypothesis supports given entity type 
   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+
+ protected:
+  virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
 };
 
 #endif
index 1f1eee84f26c7f6c9c93523d683bca7d36c11771..f11df4fe4b0bf069b1a6c4f346b48a65186145f2 100644 (file)
@@ -84,7 +84,7 @@ void StdMeshers_MaxLength_i::SetLength( CORBA::Double theLength )
   }
 
   // Update Python script
-  SMESH::TPythonDump() << _this() << ".SetLength( " << theLength << " )";
+  SMESH::TPythonDump() << _this() << ".SetLength( " << SMESH::TVar(theLength) << " )";
 }
 
 //=============================================================================
@@ -201,3 +201,14 @@ CORBA::Boolean StdMeshers_MaxLength_i::IsDimSupported( SMESH::Dimension type )
 {
   return type == SMESH::DIM_1D;
 }
+
+//================================================================================
+/*!
+ * \brief Return method name corresponding to index of variable parameter
+ */
+//================================================================================
+
+std::string StdMeshers_MaxLength_i::getMethodOfParameter(const int, int) const
+{
+  return "SetLength";
+}
index a046aeb281e17630e526c4de6facc76286bc2d91..cbc99b51ab72ca624a385fa13f4891da7a527847 100644 (file)
@@ -77,6 +77,9 @@ public:
   
   // Verify whether hypothesis supports given entity type 
   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+
+ protected:
+  virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
 };
 
 #endif
index e33f6972a164d46193b96472680d0cf05ea906a8..fa7f8d566bde842c351cb8c278ee6d734dc79fce 100644 (file)
 //  File   : StdMeshers_NumberOfLayers2D_i.cxx
 //  Author : Edward AGAPOV
 //  Module : SMESH
-//  $Header$
 //
 #include "StdMeshers_NumberOfLayers2D_i.hxx"
 
 #include "utilities.h"
 
-//using namespace std;
-
 //=============================================================================
 /*!
  *  StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i
@@ -89,4 +86,3 @@ CORBA::Boolean StdMeshers_NumberOfLayers2D_i::IsDimSupported( SMESH::Dimension t
 {
   return type == SMESH::DIM_2D;
 }
-
index 39e6bc944062f497458bd9c1512f5c695bc15d10..759f7cf65ab847ee0d49266576788eae40523934 100644 (file)
@@ -21,7 +21,6 @@
 //  File   : StdMeshers_NumberOfLayers2D_i.hxx
 //  Author : Edward AGAPOV
 //  Module : SMESH
-//  $Header$
 //
 #ifndef _SMESH_NumberOfLayers2D_I_HXX_
 #define _SMESH_NumberOfLayers2D_I_HXX_
@@ -57,4 +56,3 @@ public:
 };
 
 #endif
-
index 8409af9e5b361566fb0a44fcb9d51daacfaebe09..ecc6ffb3c366d725a0d2be47f2297777abc721f0 100644 (file)
@@ -24,7 +24,6 @@
 //  File   : StdMeshers_NumberOfLayers_i.cxx
 //  Author : Edward AGAPOV
 //  Module : SMESH
-//  $Header$
 //
 #include "StdMeshers_NumberOfLayers_i.hxx"
 #include "SMESH_Gen_i.hxx"
@@ -90,7 +89,7 @@ void StdMeshers_NumberOfLayers_i::SetNumberOfLayers(CORBA::Long numberOfLayers)
     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
   }
   // Update Python script
-  SMESH::TPythonDump() << _this() << ".SetNumberOfLayers( " << numberOfLayers << " )";
+  SMESH::TPythonDump() << _this() << ".SetNumberOfLayers( " << SMESH::TVar(numberOfLayers) << " )";
 }
 
 //=============================================================================
@@ -134,3 +133,13 @@ CORBA::Boolean StdMeshers_NumberOfLayers_i::IsDimSupported( SMESH::Dimension typ
   return type == SMESH::DIM_3D;
 }
 
+//================================================================================
+/*!
+ * \brief Return method name corresponding to index of variable parameter
+ */
+//================================================================================
+
+std::string StdMeshers_NumberOfLayers_i::getMethodOfParameter(const int, int) const
+{
+  return "SetNumberOfLayers";
+}
index 0178b9bc8ee4e4982e58dad6df605cbfc8d52f26..c301a916adf52c13af1a4c987b3b8da9e9f8967d 100644 (file)
@@ -24,7 +24,6 @@
 //  File   : StdMeshers_NumberOfLayers_i.hxx
 //  Author : Edward AGAPOV
 //  Module : SMESH
-//  $Header$
 //
 #ifndef _SMESH_NumberOfLayers_I_HXX_
 #define _SMESH_NumberOfLayers_I_HXX_
@@ -69,7 +68,9 @@ public:
   
   // Verify whether hypothesis supports given entity type 
   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+
+ protected:
+  virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
 };
 
 #endif
-
index 1dd31e46cd882e85599ab114e8b293d472d818b4..9e7aa629247fd9e3947c16782aa7138b1860476e 100644 (file)
@@ -25,7 +25,6 @@
 //           Moved here from SMESH_NumberOfSegments_i.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//  $Header$
 //
 #include "StdMeshers_NumberOfSegments_i.hxx"
 #include "SMESH_Gen_i.hxx"
@@ -146,7 +145,7 @@ void StdMeshers_NumberOfSegments_i::SetNumberOfSegments( CORBA::Long theSegments
   }
 
   // Update Python script
-  SMESH::TPythonDump() << _this() << ".SetNumberOfSegments( " << theSegmentsNumber << " )";
+  SMESH::TPythonDump() << _this() << ".SetNumberOfSegments( " << SMESH::TVar(theSegmentsNumber) << " )";
 }
 
 //=============================================================================
@@ -305,7 +304,7 @@ void StdMeshers_NumberOfSegments_i::SetScaleFactor( CORBA::Double theScaleFactor
   try {
     this->GetImpl()->SetScaleFactor( theScaleFactor );
     // Update Python script
-    SMESH::TPythonDump() << _this() << ".SetScaleFactor( " << theScaleFactor << " )";
+    SMESH::TPythonDump() << _this() << ".SetScaleFactor( " << SMESH::TVar(theScaleFactor) << " )";
   }
   catch ( SALOME_Exception& S_ex ) {
     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
@@ -490,3 +489,13 @@ CORBA::Boolean StdMeshers_NumberOfSegments_i::IsDimSupported( SMESH::Dimension t
   return type == SMESH::DIM_1D;
 }
 
+//================================================================================
+/*!
+ * \brief Return method name corresponding to index of variable parameter
+ */
+//================================================================================
+
+std::string StdMeshers_NumberOfSegments_i::getMethodOfParameter(const int paramIndex, int ) const
+{
+  return paramIndex == 0 ? "SetNumberOfSegments" : "SetScaleFactor";
+}
index 87b7a775875c22aeb383db814f35019d0e044b73..14876bf284a3a9acf12909609f7f03181e38b218 100644 (file)
@@ -25,7 +25,6 @@
 //           Moved here from SMESH_NumberOfSegments_i.hxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//  $Header$
 //
 #ifndef _SMESH_NUMBEROFSEGMENTS_I_HXX_
 #define _SMESH_NUMBEROFSEGMENTS_I_HXX_
@@ -117,6 +116,9 @@ public:
 
   //Get Object Entry
   char* GetObjectEntry();
+
+ protected:
+  virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
 };
 
 #endif
index d4d2390de132f9da26b5b546a0d302513dc7ec8b..d15385bfa0b13791a111c0aa57e6d3843e570280 100644 (file)
@@ -23,7 +23,6 @@
 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
 //  File   : StdMeshers_SegmentLengthAroundVertex_i.cxx
 //  Module : SMESH
-//  $Header$
 //
 #include "StdMeshers_SegmentLengthAroundVertex_i.hxx"
 #include "SMESH_Gen.hxx"
@@ -91,7 +90,7 @@ void StdMeshers_SegmentLengthAroundVertex_i::SetLength( CORBA::Double theLength
   }
 
   // Update Python script
-  SMESH::TPythonDump() << _this() << ".SetLength( " << theLength << " )";
+  SMESH::TPythonDump() << _this() << ".SetLength( " << SMESH::TVar(theLength) << " )";
 }
 
 //=============================================================================
@@ -138,3 +137,13 @@ CORBA::Boolean StdMeshers_SegmentLengthAroundVertex_i::IsDimSupported( SMESH::Di
   return type == SMESH::DIM_1D;
 }
 
+//================================================================================
+/*!
+ * \brief Return method name corresponding to index of variable parameter
+ */
+//================================================================================
+
+std::string StdMeshers_SegmentLengthAroundVertex_i::getMethodOfParameter(const int, int ) const
+{
+  return "SetLength";
+}
index 42f98bb142ddac2c7378f46f4a401827fcc06632..dd30be3fa697988c102bc8888f490b5172a008d1 100644 (file)
@@ -23,7 +23,6 @@
 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
 //  File   : StdMeshers_SegmentLengthAroundVertex_i.hxx
 //  Module : SMESH
-//  $Header$
 //
 #ifndef _SMESH_SegmentLengthAroundVertex_I_HXX_
 #define _SMESH_SegmentLengthAroundVertex_I_HXX_
@@ -64,6 +63,9 @@ public:
   
   // Verify whether hypothesis supports given entity type 
   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+
+ protected:
+  virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
 };
 
 #endif
index 461d86b6c29795462f66400fcb6bc5d873e95e59..1b9f0d8e8065bd98887e236051224df329298ff5 100644 (file)
@@ -25,7 +25,6 @@
 //           Moved here from SMESH_LocalLength_i.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//  $Header$
 //
 #include "StdMeshers_StartEndLength_i.hxx"
 #include "SMESH_Gen_i.hxx"
@@ -96,7 +95,8 @@ void StdMeshers_StartEndLength_i::SetLength(CORBA::Double theLength,
 
   // Update Python script
   SMESH::TPythonDump() <<
-    _this() << ( theIsStart ? ".SetStartLength( " : ".SetEndLength( " ) << theLength << " )";
+    _this() << ( theIsStart ? ".SetStartLength( " : ".SetEndLength( " ) <<
+    SMESH::TVar(theLength) << " )";
 }
 
 //=============================================================================
@@ -257,3 +257,14 @@ CORBA::Boolean StdMeshers_StartEndLength_i::IsDimSupported( SMESH::Dimension typ
   return type == SMESH::DIM_1D;
 }
 
+//================================================================================
+/*!
+ * \brief Return method name corresponding to index of variable parameter
+ */
+//================================================================================
+
+std::string StdMeshers_StartEndLength_i::getMethodOfParameter(const int paramIndex,
+                                                              int       /*nbVars*/) const
+{
+  return paramIndex == 0 ? "SetStartLength" : "SetEndLength";
+}
index c43a1762842aed2e61cca1e6e773451558cdf7d9..bef2c5415456617cf6d247076bbf962d49053dfe 100644 (file)
@@ -85,7 +85,9 @@ public:
 
   //Get Object Entry
   char* GetObjectEntry();
+
+ protected:
+  virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
 };
 
 #endif
-
index 44a37f6b997c87a8eb1b4596197b602644823789..18c7365e7587f3130ddf6574454e5fa2e542dad8 100644 (file)
@@ -29,7 +29,6 @@
 #include "SMESH_Gen.hxx"
 #include "SMESH_Gen_i.hxx"
 #include "SMESH_PythonDump.hxx"
-//#include "StdMeshers_ObjRefUlils.hxx"
 
 #include "Utils_CorbaException.hxx"
 #include "utilities.h"
@@ -118,7 +117,7 @@ throw ( SALOME::SALOME_Exception )
   if ( thickness < 1e-100 )
     THROW_SALOME_CORBA_EXCEPTION( "Invalid thickness", SALOME::BAD_PARAM );
   GetImpl()->SetTotalThickness(thickness);
-  SMESH::TPythonDump() << _this() << ".SetTotalThickness( " << thickness << " )";
+  SMESH::TPythonDump() << _this() << ".SetTotalThickness( " << SMESH::TVar(thickness) << " )";
 }
 
 //================================================================================
@@ -145,7 +144,7 @@ throw ( SALOME::SALOME_Exception )
   if ( nb < 1 )
     THROW_SALOME_CORBA_EXCEPTION( "Invalid number of layers", SALOME::BAD_PARAM );
   GetImpl()->SetNumberLayers( nb );
-  SMESH::TPythonDump() << _this() << ".SetNumberLayers( " << nb << " )";
+  SMESH::TPythonDump() << _this() << ".SetNumberLayers( " << SMESH::TVar(nb) << " )";
 }
 
 //================================================================================
@@ -172,7 +171,7 @@ throw ( SALOME::SALOME_Exception )
   if ( factor < 1 )
     THROW_SALOME_CORBA_EXCEPTION( "Invalid stretch factor, it must be >= 1.0", SALOME::BAD_PARAM );
   GetImpl()->SetStretchFactor(factor);
-  SMESH::TPythonDump() << _this() << ".SetStretchFactor( " << factor << " )";
+  SMESH::TPythonDump() << _this() << ".SetStretchFactor( " << SMESH::TVar(factor) << " )";
 }
 
 //================================================================================
@@ -213,3 +212,20 @@ CORBA::Boolean StdMeshers_ViscousLayers_i::IsDimSupported( SMESH::Dimension type
   return type == SMESH::DIM_3D;
 }
 
+//================================================================================
+/*!
+ * \brief Return method name corresponding to index of variable parameter
+ */
+//================================================================================
+
+std::string StdMeshers_ViscousLayers_i::getMethodOfParameter(const int paramIndex, int ) const
+{
+  // order of methods was defined by StdMeshersGUI_StdHypothesisCreator::storeParams()
+  switch ( paramIndex )
+  {
+  case 0: return "SetTotalThickness";
+  case 1: return "SetNumberLayers";
+  case 2: return "SetStretchFactor";
+  }
+  return "";
+}
index 1713defba1983474e09a19648305c616e77910fd..99a3d14dc14383a51a3b0983b50965d4b0b5b30f 100644 (file)
@@ -67,15 +67,8 @@ class STDMESHERS_I_EXPORT StdMeshers_ViscousLayers_i:
   // Verify whether hypothesis supports given entity type 
   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
 
-  // Redefined Persistence
-//   virtual char* SaveTo();
-//   virtual void  LoadFrom( const char* theStream );
-//   virtual void  UpdateAsMeshesRestored();
-
- private:
-  //SMESH::string_array_var _groupEntries;
-  //std::vector< std::string > _groupIDs;
+ protected:
+  virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
 };
 
 #endif
-