From: adv Date: Thu, 12 Sep 2013 06:55:06 +0000 (+0000) Subject: Dump of Image objects to python script corrected accordingly with changes for Feature #6. X-Git-Tag: BR_hydro_v_0_1~38 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0b03d0dadeae29fa369fd831057962a998de9709;p=modules%2Fhydro.git Dump of Image objects to python script corrected accordingly with changes for Feature #6. --- diff --git a/src/HYDROData/HYDROData_Image.cxx b/src/HYDROData/HYDROData_Image.cxx index cd63a215..08a069fd 100644 --- a/src/HYDROData/HYDROData_Image.cxx +++ b/src/HYDROData/HYDROData_Image.cxx @@ -122,6 +122,10 @@ QStringList HYDROData_Image::DumpToPython( MapOfTreatedObjects& theTreatedObject .arg( anImageName ).arg( aRefImgName ); } } + + // Necessary to update image in case of composed operator + aResList << QString( "" ); + aResList << QString( "%1.Update();" ).arg( anImageName ); } // Dump transformation matrix for image diff --git a/src/HYDROPy/HYDROData_Image.sip b/src/HYDROPy/HYDROData_Image.sip index f1e7cff9..b79f0f74 100644 --- a/src/HYDROPy/HYDROData_Image.sip +++ b/src/HYDROPy/HYDROData_Image.sip @@ -108,16 +108,15 @@ public: * Appends reference to other image. * \param theReferenced the image referenced by this */ - void AppendReference( HYDROData_Image theReferenced ) [void (Handle_HYDROData_Image)]; + void AppendReference( HYDROData_Object theReferenced ) [void (Handle_HYDROData_Object)]; %MethodCode - Handle(HYDROData_Image) anImage = - Handle(HYDROData_Image)::DownCast( createHandle( a0 ) ); - if ( !anImage.IsNull() ) + Handle(HYDROData_Object) aRefObj = createHandle( a0 ); + if ( !aRefObj.IsNull() ) { Py_BEGIN_ALLOW_THREADS - sipSelfWasArg ? sipCpp->HYDROData_Image::AppendReference( anImage ) : - sipCpp->AppendReference( anImage ); + sipSelfWasArg ? sipCpp->HYDROData_Image::AppendReference( aRefObj ) : + sipCpp->AppendReference( aRefObj ); Py_END_ALLOW_THREADS } @@ -134,17 +133,17 @@ public: * \param theIndex number of reference [0; NbReference) * \returns the referenced image, or Null if index is invalid */ - HYDROData_Image Reference( const int theIndex ) const [Handle_HYDROData_Image (const int)]; + HYDROData_Object Reference( const int theIndex ) const [Handle_HYDROData_Object (const int)]; %MethodCode - Handle(HYDROData_Image) anImage; + Handle(HYDROData_Object) aRefObj; Py_BEGIN_ALLOW_THREADS - sipSelfWasArg ? sipCpp->HYDROData_Image::Reference( a0 ) : - sipCpp->Reference( a0 ); + aRefObj = sipSelfWasArg ? sipCpp->HYDROData_Image::Reference( a0 ) : + sipCpp->Reference( a0 ); Py_END_ALLOW_THREADS - sipRes = dynamic_cast( createPointer( anImage ) ); + sipRes = createPointer( aRefObj ); %End @@ -154,16 +153,15 @@ public: * \param theIndex number of reference [0; NbReference] * \param theReferenced the image referenced by this */ - void ChangeReference( const int theIndex, HYDROData_Image theReferenced ) [void (const int, Handle_HYDROData_Image)]; + void ChangeReference( const int theIndex, HYDROData_Object theReferenced ) [void (const int, Handle_HYDROData_Object)]; %MethodCode - Handle(HYDROData_Image) anImage = - Handle(HYDROData_Image)::DownCast( createHandle( a1 ) ); - if ( !anImage.IsNull() ) + Handle(HYDROData_Object) aRefObj = createHandle( a1 ); + if ( !aRefObj.IsNull() ) { Py_BEGIN_ALLOW_THREADS - sipSelfWasArg ? sipCpp->HYDROData_Image::ChangeReference( a0, anImage ) : - sipCpp->ChangeReference( a0, anImage ); + sipSelfWasArg ? sipCpp->HYDROData_Image::ChangeReference( a0, aRefObj ) : + sipCpp->ChangeReference( a0, aRefObj ); Py_END_ALLOW_THREADS } diff --git a/src/HYDROPy/HYDROData_Object.sip b/src/HYDROPy/HYDROData_Object.sip index ba45f00f..3e201871 100644 --- a/src/HYDROPy/HYDROData_Object.sip +++ b/src/HYDROPy/HYDROData_Object.sip @@ -76,6 +76,11 @@ public: */ void SetName(const QString& theName); + /** + * Updates object state. + */ + void Update(); + /** * Checks is object exists in the data structure. * \returns true is object is not exists in the data model