Salome HOME
merge trunk on BR_quadtree 20140820
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ProfileOp.cxx
index 8266fd7a9b6ee3f2261490b156767a874f76a62a..609bdafdf98cca622bbcfa9f42d153daee9234d9 100644 (file)
@@ -24,7 +24,7 @@
 #include "HYDROGUI_ProfileDlg.h"
 #include "HYDROGUI_Tool.h"
 #include "HYDROGUI_UpdateFlags.h"
-
+#include <HYDROGUI_DataObject.h>
 #include "HYDROData_Document.h"
 #include "HYDROData_Profile.h"
 #include "CurveCreator_Profile.hxx"
@@ -155,7 +155,8 @@ HYDROGUI_InputPanel* HYDROGUI_ProfileOp::createInputPanel() const
 }
 
 bool HYDROGUI_ProfileOp::processApply( int& theUpdateFlags,
-                                        QString& theErrorMsg )
+                                       QString& theErrorMsg,
+                                       QStringList& theBrowseObjectsEntries )
 {
   HYDROGUI_ProfileDlg* aPanel = ::qobject_cast<HYDROGUI_ProfileDlg*>( inputPanel() );
   if ( !aPanel )
@@ -223,9 +224,28 @@ bool HYDROGUI_ProfileOp::processApply( int& theUpdateFlags,
 
   aProfileUZ->SetSectionType( 0, aSectType );
 
+  if ( !myIsEdit )
+  {
+    aProfileObj->SetBorderColor( HYDROData_Profile::DefaultBorderColor() );
+  }
+
+  // At first we update the child u,z profile object
+  aProfileUZ->SetToUpdate( true );
+  aProfileUZ->Update();
+
+  // And now we update our edited object
   aProfileObj->Update();
+  module()->setIsToUpdate( aProfileObj );
+
+  theUpdateFlags = UF_Model;
+  if ( myIsEdit )
+    theUpdateFlags |= UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
+  else
+  {
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aProfileObj );
+    theBrowseObjectsEntries.append( anEntry );
+  }
 
-  theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced;
   return true;
 }