Salome HOME
correct merge BR_hydro_v1_0_3 on BR_quadtree
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ProfileOp.cxx
index fa0ad6d72479b52aa4b85484c41c7acb1466ad3c..fc5d0f155569e1e4beb8b5d8830b8e65917cd45d 100644 (file)
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-#include "HYDROGUI_Module.h"
-#include "HYDROGUI_ProfileOp.h"
-#include "HYDROGUI_ProfileDlg.h"
-#include "HYDROGUI_Tool.h"
-#include "HYDROGUI_UpdateFlags.h"
-
-#include "HYDROData_Document.h"
-#include "HYDROData_Profile.h"
-#include "CurveCreator_Profile.hxx"
-#include "CurveCreator_Displayer.h"
+#include <HYDROGUI_Module.h>
+#include <HYDROGUI_ProfileOp.h>
+#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 <HYDROGUI_CurveCreatorProfile.h>
+#include <CurveCreator_Displayer.hxx>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -78,7 +78,7 @@ void HYDROGUI_ProfileOp::startOperation()
   if( myProfile )
     delete myProfile;
 
-  myProfile = new CurveCreator_Profile();
+  myProfile = new HYDROGUI_CurveCreatorProfile();
 
   HYDROGUI_Operation::startOperation();
 
@@ -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 )
@@ -228,9 +229,23 @@ bool HYDROGUI_ProfileOp::processApply( int& theUpdateFlags,
     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;
 }