From: isn Date: Tue, 9 Apr 2019 17:45:45 +0000 (+0300) Subject: dumping-to-py of digue X-Git-Tag: SH_V2_2_0~99^2~24^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=58d58848fd9a381ce77e4889d275a980e4d9c452;p=modules%2Fhydro.git dumping-to-py of digue --- diff --git a/src/HYDROData/HYDROData_Channel.cxx b/src/HYDROData/HYDROData_Channel.cxx index 3abe2317..0f31fc1f 100644 --- a/src/HYDROData/HYDROData_Channel.cxx +++ b/src/HYDROData/HYDROData_Channel.cxx @@ -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 diff --git a/src/HYDROPy/HYDROData_Channel.sip b/src/HYDROPy/HYDROData_Channel.sip index f1ef457a..4d4e4449 100644 --- a/src/HYDROPy/HYDROData_Channel.sip +++ b/src/HYDROPy/HYDROData_Channel.sip @@ -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: