]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
dumping-to-py of digue BR_H2018_3
authorisn <isn@opencascade.com>
Tue, 9 Apr 2019 17:45:45 +0000 (20:45 +0300)
committerisn <isn@opencascade.com>
Tue, 9 Apr 2019 17:47:17 +0000 (20:47 +0300)
src/HYDROData/HYDROData_Channel.cxx
src/HYDROPy/HYDROData_Channel.sip

index 3abe2317594762db4962204097c86ed631d5ab48..0f31fc1f1ac737f96bbd000251424402e7e918d7 100644 (file)
@@ -88,7 +88,7 @@ HYDROData_Channel::~HYDROData_Channel()
 }
 
 QStringList HYDROData_Channel::DumpToPython( const QString& thePyScriptPath,
-                                             MapOfTreatedObjects& theTreatedObjects ) const
+  MapOfTreatedObjects& theTreatedObjects ) const
 {
   QStringList aResList = dumpObjectCreation( theTreatedObjects );
   QString aName = GetObjPyName();
@@ -96,8 +96,25 @@ QStringList HYDROData_Channel::DumpToPython( const QString& thePyScriptPath,
   Handle(HYDROData_Polyline3D) aRefGideLine = GetGuideLine();
   setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aRefGideLine, "SetGuideLine" );
 
-  Handle(HYDROData_Profile) aRefProfile = GetProfile();
-  setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aRefProfile, "SetProfile" );
+  bool mode = GetProfileMode();
+  QString aMode = mode ? "True" : "False" ;
+  aResList << QString( "%1.SetProfileMode( %2 )" ).arg( aName ).arg( aMode );
+
+  if (mode)
+  {
+    Handle(HYDROData_Profile) aRefProfile = GetProfile();
+    setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aRefProfile, "SetProfile" );
+  }
+  else
+  {
+    QString aLC = QString::number( GetLCValue(), 'f', 3 );
+    QString aDeltaZ = QString::number( GetDeltaZValue(), 'f', 3 );
+    QString aCoteZ = QString::number( GetCoteZValue(), 'f', 3 );
+
+    aResList << QString( "%1.SetLCValue( %2 )" ).arg( aName ).arg( aLC );
+    aResList << QString( "%1.SetDeltaZValue( %2 )" ).arg( aName ).arg( aDeltaZ );
+    aResList << QString( "%1.SetCoteZValue( %2 )" ).arg( aName ).arg( aCoteZ );
+  }
 
   aResList << QString( "%1.SetEquiDistance( %2 )" ).arg( aName ).arg( GetEquiDistance() );
 
@@ -106,6 +123,7 @@ QStringList HYDROData_Channel::DumpToPython( const QString& thePyScriptPath,
   aResList << QString( "" );
 
   return aResList;
+
 }
 
 HYDROData_SequenceOfObjects HYDROData_Channel::GetAllReferenceObjects() const
index f1ef457ad7c53d671555f6108ba9be2d45425a1b..4d4e4449641229491a64b3746a66440f1ac4e0f5 100644 (file)
@@ -138,6 +138,18 @@ public:
 
   void SetEquiDistance( double );
   double GetEquiDistance() const;
+
+  void SetLCValue( double );
+  double GetLCValue() const;
+  
+  void SetDeltaZValue( double );
+  double GetDeltaZValue() const;
+  
+  void SetCoteZValue( double );
+  double GetCoteZValue() const;
+
+  void SetProfileMode( bool );
+  bool GetProfileMode() const; 
   
 protected: