]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Dump of Image objects to python script corrected accordingly with changes for Feature #6.
authoradv <adv@opencascade.com>
Thu, 12 Sep 2013 06:55:06 +0000 (06:55 +0000)
committeradv <adv@opencascade.com>
Thu, 12 Sep 2013 06:55:06 +0000 (06:55 +0000)
src/HYDROData/HYDROData_Image.cxx
src/HYDROPy/HYDROData_Image.sip
src/HYDROPy/HYDROData_Object.sip

index cd63a215c6ee310b02af5e3cd7c1d649fea0c556..08a069fd756abcdb2ef11a4c6943781354fadb7d 100644 (file)
@@ -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
index f1e7cff982c558d22356b165ef5c3c429f9aeeea..b79f0f74dad1c4b50ce1861fb6130983b0383a18 100644 (file)
@@ -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<HYDROData_Image*>( 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
     }
   
index ba45f00f2ddde692c2d10d10b6954814c45de272..3e201871b886da6ffc9a8da04171697aaee7f6ee 100644 (file)
@@ -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