]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #417: showing new objects
authorasl <asl@opencascade.com>
Thu, 7 Aug 2014 12:00:15 +0000 (12:00 +0000)
committerasl <asl@opencascade.com>
Thu, 7 Aug 2014 12:00:15 +0000 (12:00 +0000)
43 files changed:
src/HYDROData/HYDROData_Bathymetry.cxx
src/HYDROData/HYDROData_Bathymetry.h
src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.cxx
src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.h
src/HYDROGUI/HYDROGUI_CalculationOp.cxx
src/HYDROGUI/HYDROGUI_CalculationOp.h
src/HYDROGUI/HYDROGUI_ChannelOp.cxx
src/HYDROGUI/HYDROGUI_ChannelOp.h
src/HYDROGUI/HYDROGUI_DigueOp.cxx
src/HYDROGUI/HYDROGUI_DigueOp.h
src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx
src/HYDROGUI/HYDROGUI_ExportCalculationOp.h
src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx
src/HYDROGUI/HYDROGUI_GeoreferencementOp.h
src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.cxx
src/HYDROGUI/HYDROGUI_ImmersibleZoneOp.h
src/HYDROGUI/HYDROGUI_ImportBathymetryOp.cxx
src/HYDROGUI/HYDROGUI_ImportBathymetryOp.h
src/HYDROGUI/HYDROGUI_ImportGeomObjectOp.cxx
src/HYDROGUI/HYDROGUI_ImportGeomObjectOp.h
src/HYDROGUI/HYDROGUI_ImportImageOp.cxx
src/HYDROGUI/HYDROGUI_ImportImageOp.h
src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx
src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.h
src/HYDROGUI/HYDROGUI_ImportProfilesOp.cxx
src/HYDROGUI/HYDROGUI_Operation.cxx
src/HYDROGUI/HYDROGUI_Operation.h
src/HYDROGUI/HYDROGUI_Poly3DOp.cxx
src/HYDROGUI/HYDROGUI_Poly3DOp.h
src/HYDROGUI/HYDROGUI_PolylineOp.cxx
src/HYDROGUI/HYDROGUI_PolylineOp.h
src/HYDROGUI/HYDROGUI_ProfileOp.cxx
src/HYDROGUI/HYDROGUI_ProfileOp.h
src/HYDROGUI/HYDROGUI_SetColorOp.cxx
src/HYDROGUI/HYDROGUI_SetColorOp.h
src/HYDROGUI/HYDROGUI_StreamOp.cxx
src/HYDROGUI/HYDROGUI_StreamOp.h
src/HYDROGUI/HYDROGUI_TranslateObstacleOp.cxx
src/HYDROGUI/HYDROGUI_TranslateObstacleOp.h
src/HYDROGUI/HYDROGUI_TwoImagesOp.cxx
src/HYDROGUI/HYDROGUI_TwoImagesOp.h
src/HYDROGUI/HYDROGUI_ZLevelsOp.cxx
src/HYDROGUI/HYDROGUI_ZLevelsOp.h

index 9bdfd1cfd54a5fc2a5a47fcb50bcbf656348fe28..dab80218810d7c8049a79d411d7b663359a73f38 100644 (file)
@@ -466,14 +466,14 @@ bool HYDROData_Bathymetry::importFromXYZFile( QFile&          theFile,
 }
 
 
-bool HYDROData_Bathymetry::CreateBoundaryPolyline() const
+Handle_HYDROData_PolylineXY HYDROData_Bathymetry::CreateBoundaryPolyline() const
 {
   Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
   Handle_HYDROData_PolylineXY aResult = 
     Handle_HYDROData_PolylineXY::DownCast( aDocument->CreateObject( KIND_POLYLINEXY ) );
 
   if( aResult.IsNull() )
-    return false;
+    return aResult;
 
   //search free name
   QString aPolylinePref = GetName() + "_Boundary";
@@ -508,5 +508,5 @@ bool HYDROData_Bathymetry::CreateBoundaryPolyline() const
   aResult->AddPoint( 0, HYDROData_IPolyline::Point( Xmax, Ymin ) );
   aResult->Update();
 
-  return true;
+  return aResult;
 }
index a5dfb35bfb6799e7085485602af8486061c9e2be..72ef41395ee1faed7c93450fc55c1b2744362754 100644 (file)
@@ -6,6 +6,7 @@
 
 class QFile;
 class gp_XYZ;
+class Handle_HYDROData_PolylineXY;
 
 DEFINE_STANDARD_HANDLE(HYDROData_Bathymetry, HYDROData_IAltitudeObject)
 
@@ -112,7 +113,7 @@ public:
    */
   HYDRODATA_EXPORT virtual bool             ImportFromFile( const TCollection_AsciiString& theFileName );
 
-  HYDRODATA_EXPORT bool CreateBoundaryPolyline() const;
+  HYDRODATA_EXPORT Handle_HYDROData_PolylineXY CreateBoundaryPolyline() const;
 
 private:
 
index cf042190c10bbab4b2780124e18143c6ec38c38a..1dd589b72eb7d04f09f4819f51dea95f2340c10d 100644 (file)
@@ -24,6 +24,8 @@
 #include <HYDROGUI_Tool.h>
 #include <HYDROGUI_UpdateFlags.h>
 #include <HYDROGUI_Module.h>
+#include <HYDROGUI_DataObject.h>
+#include <HYDROData_PolylineXY.h>
 
 HYDROGUI_BathymetryBoundsOp::HYDROGUI_BathymetryBoundsOp( HYDROGUI_Module* theModule )
 : HYDROGUI_Operation( theModule )
@@ -50,13 +52,18 @@ void HYDROGUI_BathymetryBoundsOp::startOperation()
     onApply();
 }
 
-bool HYDROGUI_BathymetryBoundsOp::processApply( int& theUpdateFlags, QString& theErrorMsg )
+bool HYDROGUI_BathymetryBoundsOp::processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                                QStringList& theBrowseObjectsEntries )
 {
-  bool isOK = myBath->CreateBoundaryPolyline();
+  Handle_HYDROData_PolylineXY aPolyline = myBath->CreateBoundaryPolyline();
+  bool isOK = !aPolyline.IsNull();
   theUpdateFlags = 0;
   if( isOK ) {
     module()->setIsToUpdate( myBath );
     theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
+    
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aPolyline );
+    theBrowseObjectsEntries.append( anEntry );
   }
   else
     theErrorMsg = tr( "CANNOT_CREATE_BOUNDARY_POLYLINE" );
index 00b92d56831a6f39bdd7b59fee7a1a00c2ab80df..7586c17d2e36b08dc6c03a9f23f61a8b4facebce 100644 (file)
@@ -37,7 +37,8 @@ public:
 protected:
   virtual void startOperation();
   virtual HYDROGUI_InputPanel* createInputPanel() const;
-  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
+                             QStringList& theBrowseObjectsEntries );
 
 private:
   Handle(HYDROData_Bathymetry) myBath;
index 71f47ea772995f6a2441a8a4987af21af80bf8fb..954e789f45028ac10c404ea4ff7056d38026ace0 100644 (file)
@@ -498,13 +498,20 @@ bool HYDROGUI_CalculationOp::confirmRegionsChange() const
 }
 
 bool HYDROGUI_CalculationOp::processApply( int&     theUpdateFlags,
-                                           QString& theErrorMsg )
+                                           QString& theErrorMsg,
+                                           QStringList& theBrowseObjectsEntries )
 {
   HYDROGUI_CalculationDlg* aPanel = 
     ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
   if ( !aPanel )
     return false;
 
+  if( !myIsEdit )
+  {
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( myEditedObject );
+    theBrowseObjectsEntries.append( anEntry );
+  }
+
   theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init;
 
   return true;
@@ -516,12 +523,13 @@ void HYDROGUI_CalculationOp::onApply()
 
   int anUpdateFlags = 0;
   QString anErrorMsg;
+  QStringList aBrowseObjectsEntries;
 
   bool aResult = false;
   
   try
   {
-    aResult = processApply( anUpdateFlags, anErrorMsg );
+    aResult = processApply( anUpdateFlags, anErrorMsg, aBrowseObjectsEntries );
   }
   catch ( Standard_Failure )
   {
@@ -540,6 +548,7 @@ void HYDROGUI_CalculationOp::onApply()
   {
     module()->update( anUpdateFlags );
     commit();
+    browseObjects( aBrowseObjectsEntries );
   }
   else
   {
index 829c01bbe3a42f64592f7ec146c1750857c65f0c..81c19c61dcd4142c75b9524c964d78be9a09a17f 100644 (file)
@@ -52,7 +52,8 @@ protected:
   virtual HYDROGUI_InputPanel*    createInputPanel() const;
 
   virtual void                    onApply();
-  virtual bool                    processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool                    processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                                QStringList& theBrowseObjectsEntries );
 
   void setAvailableGroups();
 
index 0a6227851bcce28a3f74afdb2faab14bc741189f..e820deb641e97d42beba677505cbd82b080385ca 100644 (file)
@@ -23,6 +23,7 @@
 #include "HYDROGUI_ChannelOp.h"
 
 #include "HYDROGUI_DataModel.h"
+#include <HYDROGUI_DataObject.h>
 #include "HYDROGUI_ChannelDlg.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Shape.h"
@@ -143,7 +144,8 @@ HYDROGUI_InputPanel* HYDROGUI_ChannelOp::createInputPanel() const
 }
 
 bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags,
-                                       QString& theErrorMsg )
+                                       QString& theErrorMsg,
+                                       QStringList& theBrowseObjectsEntries )
 {
   HYDROGUI_ChannelDlg* aPanel = ::qobject_cast<HYDROGUI_ChannelDlg*>( inputPanel() );
   if ( !aPanel )
@@ -203,7 +205,11 @@ bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags,
   erasePreview();
 
   if( !myIsEdit )
+  {
     module()->setObjectVisible( HYDROGUI_Tool::GetActiveOCCViewId( module() ), myEditedObject, true );
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( myEditedObject );
+    theBrowseObjectsEntries.append( anEntry );
+  }
 
   module()->setIsToUpdate( myEditedObject );
 
index 798d7a89ae747e3aa981f3111758b83421a87c8b..bb1c5acbf20b6b14e037f7b148f473e0dada911a 100644 (file)
@@ -46,7 +46,8 @@ protected:
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
-  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                           QStringList& theBrowseObjectsEntries );
 
 protected slots:
   virtual void               onCreatePreview();
index f16708f3da20d4839370f3f66a217c84bc1d363b..60c8119fd8b96855aa78a28110e3d17655899942 100644 (file)
@@ -54,9 +54,10 @@ void HYDROGUI_DigueOp::startOperation()
 }
 
 bool HYDROGUI_DigueOp::processApply( int& theUpdateFlags,
-                                     QString& theErrorMsg )
+                                     QString& theErrorMsg,
+                                     QStringList& theBrowseObjectsEntries )
 {
-  if ( !HYDROGUI_ChannelOp::processApply( theUpdateFlags, theErrorMsg ) )
+  if ( !HYDROGUI_ChannelOp::processApply( theUpdateFlags, theErrorMsg, theBrowseObjectsEntries ) )
     return false;
 
   if ( !myIsEdit )
index 782626a789388e002eb18db4ff45a1946115142a..f5c434555423de87a6a132bf9d29adea856cb250 100644 (file)
@@ -37,7 +37,8 @@ protected:
 
   virtual void                 startOperation();
 
-  virtual bool                 processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool                 processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                             QStringList& theBrowseObjectsEntries );
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
index 8e3f852269c927ff25d3d220ff6a4747b65b3493..d91522bbe093b1b6dc28b9f2b7e710c037949675 100644 (file)
@@ -68,7 +68,8 @@ void HYDROGUI_ExportCalculationOp::commitOperation()
 }
 
 bool HYDROGUI_ExportCalculationOp::processApply( int& theUpdateFlags,
-                                                QString& theErrorMsg )
+                                                 QString& theErrorMsg,
+                                                 QStringList& theBrowseObjectsEntries )
 {
   // Get the selected calculation case
   Handle(HYDROData_CalculationCase) aCalculation = 
@@ -107,9 +108,10 @@ void HYDROGUI_ExportCalculationOp::onApply()
   QString anErrorMsg;
 
   bool aResult = false;
-  
+  QStringList aBrowseObjectsEntries;
+
   try {
-    aResult = processApply( anUpdateFlags, anErrorMsg );
+    aResult = processApply( anUpdateFlags, anErrorMsg, aBrowseObjectsEntries );
   }
   catch ( Standard_Failure )
   {
@@ -127,6 +129,7 @@ void HYDROGUI_ExportCalculationOp::onApply()
   if ( aResult ) {
     module()->update( anUpdateFlags );
     commit();
+    browseObjects( aBrowseObjectsEntries );
 
     // Show message box
     SUIT_MessageBox::information( module()->getApp()->desktop(),
index 1b42f3ffab6c04b1612b94e8fee79e36466a0d4b..7cbe6b2953436f3af7fc1b184cecbd50b1a5c120 100644 (file)
@@ -38,7 +38,8 @@ protected:
   virtual void               abortOperation();
   virtual void               commitOperation();
 
-  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                           QStringList& theBrowseObjectsEntries );
   virtual void               onApply();
 };
 
index d7b389e6bd0f3fee6e3287ec754888ee5302f01d..3b67d4752ac8f93a6e525a3d23ad8ebc87ed70f3 100644 (file)
@@ -115,7 +115,8 @@ HYDROGUI_InputPanel* HYDROGUI_GeoreferencementOp::createInputPanel() const
 }
 
 bool HYDROGUI_GeoreferencementOp::processApply( int& theUpdateFlags,
-                                                QString& theErrorMsg )
+                                                QString& theErrorMsg,
+                                                QStringList& theBrowseObjectsEntries )
 {
   theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init;
 
index 6fa244c0b1f937c9b9f114cd36755af1c7459919..753df02cf2366c4fb85abc1c4ff6e1675a140f4a 100644 (file)
@@ -47,7 +47,8 @@ protected:
 
   virtual HYDROGUI_InputPanel*    createInputPanel() const;
 
-  virtual bool                    processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool                    processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                                QStringList& theBrowseObjectsEntries );
 
 protected slots:
   void                            onModeActivated( const int theActualMode );
index 405f5f8948253fae783b0a6c4c4b01871f739292..b6c0fd02b4ab084efd0951c861606f00be946af1 100644 (file)
@@ -28,6 +28,7 @@
 #include "HYDROGUI_Shape.h"
 #include "HYDROGUI_Tool.h"
 #include "HYDROGUI_UpdateFlags.h"
+#include "HYDROGUI_DataObject.h"
 
 #include <HYDROData_Bathymetry.h>
 #include <HYDROData_Iterator.h>
@@ -128,7 +129,8 @@ HYDROGUI_InputPanel* HYDROGUI_ImmersibleZoneOp::createInputPanel() const
 }
 
 bool HYDROGUI_ImmersibleZoneOp::processApply( int& theUpdateFlags,
-                                              QString& theErrorMsg )
+                                              QString& theErrorMsg,
+                                              QStringList& theBrowseObjectsEntries )
 {
   HYDROGUI_ImmersibleZoneDlg* aPanel = ::qobject_cast<HYDROGUI_ImmersibleZoneDlg*>( inputPanel() );
   if ( !aPanel )
@@ -194,7 +196,11 @@ bool HYDROGUI_ImmersibleZoneOp::processApply( int& theUpdateFlags,
   closePreview();
 
   if( !myIsEdit )
+  {
     module()->setObjectVisible( HYDROGUI_Tool::GetActiveOCCViewId( module() ), aZoneObj, true );
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aZoneObj );
+    theBrowseObjectsEntries.append( anEntry );
+  }
 
   module()->setIsToUpdate( aZoneObj );
 
index 20cddaca872716a121a1411b66642be2afbe912b..d69d2a267cbf258223252a78527e11609e39b4cc 100644 (file)
@@ -44,7 +44,8 @@ protected:
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
-  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                           QStringList& theBrowseObjectsEntries );
 
   virtual HYDROGUI_Shape*   getPreviewShape() const { return myPreviewPrs; };
 
index 60ae9a44e734a48dcf163936b55d69b888d50318..4e8280554f9db623297af278e8acff78c9f2b1ef 100644 (file)
@@ -23,6 +23,7 @@
 #include "HYDROGUI_ImportBathymetryOp.h"
 
 #include "HYDROGUI_DataModel.h"
+#include "HYDROGUI_DataObject.h"
 #include "HYDROGUI_ImportBathymetryDlg.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Tool.h"
@@ -96,7 +97,8 @@ HYDROGUI_InputPanel* HYDROGUI_ImportBathymetryOp::createInputPanel() const
 }
 
 bool HYDROGUI_ImportBathymetryOp::processApply( int& theUpdateFlags,
-                                                QString& theErrorMsg )
+                                                QString& theErrorMsg,
+                                                QStringList& theBrowseObjectsEntries )
 {
   HYDROGUI_ImportBathymetryDlg* aPanel = 
     ::qobject_cast<HYDROGUI_ImportBathymetryDlg*>( inputPanel() );
@@ -196,6 +198,13 @@ bool HYDROGUI_ImportBathymetryOp::processApply( int& theUpdateFlags,
   }
 
   theUpdateFlags = UF_Model | UF_VTKViewer | UF_VTK_Init | UF_VTK_Forced;
+
+  if( !myIsEdit )
+  {
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aBathymetryObj );
+    theBrowseObjectsEntries.append( anEntry );
+  }
+
   return true;
 }
 
index cdf6a39b455a07a6dfc3328ea7f4ccb95a4336bd..5713e31d6637da09043ce70ac120f390a0dcee34 100644 (file)
@@ -43,7 +43,8 @@ protected:
 
   virtual HYDROGUI_InputPanel*    createInputPanel() const;
 
-  virtual bool                    processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool                    processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                                QStringList& theBrowseObjectsEntries );
 
 
 protected slots:
index 7832f3b35dc8fe796c58453b128c849ffaff22b7..e8cb3e0328bd6e32262eb90c12842a415e2eab82 100644 (file)
@@ -23,7 +23,7 @@
 #include "HYDROGUI_ImportGeomObjectOp.h"
 
 #include "HYDROGUI_GeomObjectDlg.h"
-
+#include "HYDROGUI_DataObject.h"
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Tool.h"
@@ -145,7 +145,8 @@ void HYDROGUI_ImportGeomObjectOp::commitOperation()
 }
 
 bool HYDROGUI_ImportGeomObjectOp::processApply( int& theUpdateFlags,
-                                                QString& theErrorMsg )
+                                                QString& theErrorMsg,
+                                                QStringList& theBrowseObjectsEntries )
 {
   // Get active SalomeApp_Study
   SalomeApp_Study* aStudy = 
@@ -264,6 +265,8 @@ bool HYDROGUI_ImportGeomObjectOp::processApply( int& theUpdateFlags,
       if ( anIsOk ) {
         anObject->Update();
         module()->setIsToUpdate( anObject );
+        QString aHydroObjEntry = HYDROGUI_DataObject::dataObjectEntry( anObject );
+        theBrowseObjectsEntries.append( aHydroObjEntry );
         theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
       }
     }
index b8830f9fa155d6a72c2b62d6420a15dc296a73b1..75d701281be4ebae92c3277988328ab88fbd1c67 100644 (file)
@@ -58,7 +58,8 @@ protected:
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
-  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                           QStringList& theBrowseObjectsEntries );
 
 protected slots:
   void                       onExternalOperationFinished( const QString&, const QString&, 
index 58ca39f3bcef537c399e36802742ff456b55668e..72f2ac2dcac15953dfdaa5a200062fc9cef8791a 100644 (file)
@@ -23,6 +23,7 @@
 #include "HYDROGUI_ImportImageOp.h"
 
 #include "HYDROGUI_DataModel.h"
+#include <HYDROGUI_DataObject.h>
 #include "HYDROGUI_ImportImageDlg.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_PrsImage.h"
@@ -344,7 +345,8 @@ bool HYDROGUI_ImportImageOp::checkPoints( const QPointF& thePointA,
 }
 
 bool HYDROGUI_ImportImageOp::processApply( int& theUpdateFlags,
-                                           QString& theErrorMsg )
+                                           QString& theErrorMsg,
+                                           QStringList& theBrowseObjectsEntries )
 {
   HYDROGUI_ImportImageDlg* aPanel = (HYDROGUI_ImportImageDlg*)inputPanel();
 
@@ -446,7 +448,11 @@ bool HYDROGUI_ImportImageOp::processApply( int& theUpdateFlags,
   if( myIsEdit )
     anImageObj = myEditedObject;
   else
+  {
     anImageObj = Handle(HYDROData_Image)::DownCast( doc()->CreateObject( KIND_IMAGE ) );
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( anImageObj );
+    theBrowseObjectsEntries.append( anEntry );
+  }
 
   if( anImageObj.IsNull() )
     return false;
index 0acdd0bc9b7aa8ab8ffb01817f67747708ca3302..7a2c399c24e0179874322fac41fd5249fd45057e 100644 (file)
@@ -49,7 +49,8 @@ protected:
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
-  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                           QStringList& theBrowseObjectsEntries );
   bool                       isReferenceCorrect() const;
 
 protected slots:
index 301e826d7e3088d3bf0baaf83ffec34057e64f55..432ef681db1e6de079183cce869e2fc5757be955 100644 (file)
@@ -23,7 +23,7 @@
 #include "HYDROGUI_ImportObstacleFromFileOp.h"
 
 #include "HYDROGUI_GeomObjectDlg.h"
-
+#include <HYDROGUI_DataObject.h>
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_Tool.h"
@@ -98,7 +98,8 @@ void HYDROGUI_ImportObstacleFromFileOp::commitOperation()
 }
 
 bool HYDROGUI_ImportObstacleFromFileOp::processApply( int& theUpdateFlags,
-                                                      QString& theErrorMsg )
+                                                      QString& theErrorMsg,
+                                                      QStringList& theBrowseObjectsEntries )
 {
   QString aFileName;
   QString anObstacleName;
@@ -176,6 +177,10 @@ bool HYDROGUI_ImportObstacleFromFileOp::processApply( int& theUpdateFlags,
       anIsOk = true;
       module()->setIsToUpdate( anObstacle );
       theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
+      QString anEntry = HYDROGUI_DataObject::dataObjectEntry( anObstacle );
+      theBrowseObjectsEntries.append( anEntry );
+
+
     } else {
       theErrorMsg = tr( "BAD_IMPORTED_OBSTACLE_FILE" ).arg( aFileName );
     }
index e264729300fe8044288b9db828f4bfef0d5fedab..b32d0dd0f54eebce0779d19cba833e1a440b2ef7 100644 (file)
@@ -42,7 +42,8 @@ protected:
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
-  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
+                             QStringList& theBrowseObjectsEntries );
 
 private:
   SUIT_FileDlg* myFileDlg;
index 2e05ab91315e0ec50dbc81b7e49b457f92ddecaf..9d637fc351f0efe95469b212e243cdf46ba36e70 100644 (file)
@@ -81,6 +81,8 @@ void HYDROGUI_ImportProfilesOp::onApply()
   }
 
   QApplication::setOverrideCursor( Qt::WaitCursor );
+  QStringList aBrowseObjectsEntries;
+  //TODO: to implement the addition of imported profiles' entries to the list
 
   startDocOperation();
 
@@ -141,6 +143,7 @@ void HYDROGUI_ImportProfilesOp::onApply()
     commit();
 
     module()->update( UF_Model | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init );
+    browseObjects( aBrowseObjectsEntries );
   }
 
   QApplication::restoreOverrideCursor();
index 6c9d4ed9f7fd0cd0a0a3aa01e7253b1860e927ac..442b6e7d383eea1caf424124421c8c4d7390c704 100644 (file)
@@ -233,7 +233,8 @@ void HYDROGUI_Operation::closeInputPanel()
 }
 
 bool HYDROGUI_Operation::processApply( int& theUpdateFlags,
-                                       QString& theErrorMsg )
+                                       QString& theErrorMsg,
+                                       QStringList& theBrowseObjectsEntries )
 {
   return false;
 }
@@ -290,10 +291,11 @@ void HYDROGUI_Operation::onApply()
   QString anErrorMsg;
 
   bool aResult = false;
-  
+  QStringList aBrowseObjectsEntries;
+
   try
   {
-    aResult = processApply( anUpdateFlags, anErrorMsg );
+    aResult = processApply( anUpdateFlags, anErrorMsg, aBrowseObjectsEntries );
   }
   catch ( Standard_Failure )
   {
@@ -313,6 +315,7 @@ void HYDROGUI_Operation::onApply()
     module()->update( anUpdateFlags );
     commitDocOperation();
     commit();
+    browseObjects( aBrowseObjectsEntries );
   }
   else
   {
@@ -377,4 +380,9 @@ QString HYDROGUI_Operation::getHelpContext() const
    return QString();
 }
 
-
+void HYDROGUI_Operation::browseObjects( const QStringList& theBrowseObjectsEntries )
+{
+  bool isApplyAndClose = true;
+  bool isOptimizedBrowse = true;
+  module()->getApp()->browseObjects( theBrowseObjectsEntries, isApplyAndClose, isOptimizedBrowse );
+}
index 05879abfc0ad272539dc1f61a88d7f58dd860160..44a77d875090dd480074c1a4d1835cd2ca30e223 100644 (file)
@@ -71,7 +71,8 @@ protected:
   virtual HYDROGUI_InputPanel*        createInputPanel() const;
   virtual void                        closeInputPanel();
 
-  virtual bool                        processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool                        processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                                    QStringList& theBrowseObjectsEntries );
   virtual void                        processCancel();
 
   void                                startDocOperation();
@@ -85,6 +86,8 @@ protected:
   void                                printErrorMessage( const QString& theErrorMsg );
   void                                setPrintErrorMessage( const bool theIsPrint );
 
+  void                                browseObjects( const QStringList& theBrowseObjectsEntries );
+
 protected slots:
 
   virtual void                        onApply();
index 8259381af1ee2d4767cf1fdd1a0842c11ec95a49..5c8ff2f2a0606a5e0a0912ad13562c6de37b83c8 100644 (file)
@@ -23,6 +23,7 @@
 #include "HYDROGUI_Poly3DOp.h"
 
 #include "HYDROGUI_Module.h"
+#include <HYDROGUI_DataObject.h>
 #include "HYDROGUI_Tool.h"
 #include "HYDROGUI_Poly3DDlg.h"
 #include "HYDROGUI_UpdateFlags.h"
@@ -108,7 +109,8 @@ void HYDROGUI_Poly3DOp::startOperation()
 }
 
 bool HYDROGUI_Poly3DOp::processApply( int& theUpdateFlags,
-                                         QString& theErrorMsg )
+                                      QString& theErrorMsg,
+                                      QStringList& theBrowseObjectsEntries )
 {
   HYDROGUI_Poly3DDlg* aPanel = dynamic_cast<HYDROGUI_Poly3DDlg*>( inputPanel() );
 
@@ -149,6 +151,8 @@ bool HYDROGUI_Poly3DOp::processApply( int& theUpdateFlags,
   else
   {
     aResult = Handle(HYDROData_Polyline3D)::DownCast( doc()->CreateObject( KIND_POLYLINE ) );
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aResult );
+    theBrowseObjectsEntries.append( anEntry );
   }
 
   if( aResult.IsNull() )
index 572e179a43d9f31d4856928211726674cd02e589..d8fd16d507febc834ac925294acdce8950d8fb08 100644 (file)
@@ -40,7 +40,8 @@ protected:
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
-  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                           QStringList& theBrowseObjectsEntries );
 
 private:
   bool                       myIsEdit;
index 47b25a1233b9769803854985c2caa4e4ab4dbcff..a97508ef261b4073a2d426e0371419965d2c1580 100755 (executable)
@@ -23,6 +23,7 @@
 #include "HYDROGUI_PolylineOp.h"
 
 #include "HYDROGUI_Module.h"
+#include "HYDROGUI_DataObject.h"
 #include "HYDROGUI_PolylineDlg.h"
 #include "HYDROGUI_Tool.h"
 #include "HYDROGUI_UpdateFlags.h"
@@ -211,7 +212,8 @@ HYDROGUI_InputPanel* HYDROGUI_PolylineOp::createInputPanel() const
 }
 
 bool HYDROGUI_PolylineOp::processApply( int& theUpdateFlags,
-                                        QString& theErrorMsg )
+                                        QString& theErrorMsg,
+                                        QStringList& theBrowseObjectsEntries )
 {
   HYDROGUI_PolylineDlg* aPanel = ::qobject_cast<HYDROGUI_PolylineDlg*>( inputPanel() );
   if ( !aPanel )
@@ -321,6 +323,8 @@ bool HYDROGUI_PolylineOp::processApply( int& theUpdateFlags,
   if( !myIsEdit )
   {
     module()->setObjectVisible( anActiveViewId, aPolylineObj, true );
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aPolylineObj );
+    theBrowseObjectsEntries.append( anEntry );
   }  
 
   return true;
index d79d582dff2cd5f89f3b416494f20a39bf7262d5..25b2f8dc178b341e03bce0e443ca1f08c72e1862 100755 (executable)
@@ -49,7 +49,8 @@ protected:
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
-  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                           QStringList& theBrowseObjectsEntries );
 
 protected slots:
   void                       onEditorSelectionChanged();
index 53700cc00c215c311a563b32773585944f142182..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 )
@@ -239,6 +240,11 @@ bool HYDROGUI_ProfileOp::processApply( int& theUpdateFlags,
   theUpdateFlags = UF_Model;
   if ( myIsEdit )
     theUpdateFlags |= UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
+  else
+  {
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aProfileObj );
+    theBrowseObjectsEntries.append( anEntry );
+  }
 
   return true;
 }
index dd5e2370a7ed754baedc71ece1a77933b6d01bca..d93311a1da5cc6c40cd325da9e0c2e70af334d4e 100644 (file)
@@ -47,7 +47,8 @@ protected:
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
-  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                           QStringList& theBrowseObjectsEntries );
 
 private:
   void                       displayPreview();
index fa24977fa50617448340f140640f298382b402cf..464434b6b61f6363fa182368d84e8768c7c0e3f0 100644 (file)
@@ -118,7 +118,8 @@ void HYDROGUI_SetColorOp::startOperation()
 }
 
 bool HYDROGUI_SetColorOp::processApply( int& theUpdateFlags,
-                                        QString& theErrorMsg )
+                                        QString& theErrorMsg,
+                                        QStringList& theBrowseObjectsEntries )
 {
   if ( !myColorDlg || myEditedObject.IsNull() )
     return false;
index 9fce5bd1baf625add529393719403cb1ea2dc9a7..08729bd39551bc46c1dbdee83083bf08adedfbc1 100644 (file)
@@ -43,7 +43,8 @@ public:
 protected:
   virtual void startOperation();
 
-  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
+                             QStringList& theBrowseObjectsEntries );
 
 private:
   HYDROGUI_ColorDlg* myColorDlg;
index cabf8c677b047fd4c88830eb661c316e840234ae..ca39e32e83dffbae41c6a5a3f9286a7b8db9a7c7 100755 (executable)
@@ -23,6 +23,7 @@
 #include "HYDROGUI_StreamOp.h"
 
 #include "HYDROGUI_Module.h"
+#include <HYDROGUI_DataObject.h>
 #include "HYDROGUI_Shape.h"
 #include "HYDROGUI_StreamDlg.h"
 #include "HYDROGUI_Tool.h"
@@ -184,7 +185,8 @@ HYDROGUI_InputPanel* HYDROGUI_StreamOp::createInputPanel() const
 }
 
 bool HYDROGUI_StreamOp::processApply( int& theUpdateFlags,
-                                      QString& theErrorMsg )
+                                      QString& theErrorMsg,
+                                      QStringList& theBrowseObjectsEntries )
 {
   HYDROGUI_StreamDlg* aPanel = ::qobject_cast<HYDROGUI_StreamDlg*>( inputPanel() );
   if ( !aPanel )
@@ -260,6 +262,8 @@ bool HYDROGUI_StreamOp::processApply( int& theUpdateFlags,
   // Show the object in case of creation mode of the operation
   if( !myIsEdit ) {
     module()->setObjectVisible( HYDROGUI_Tool::GetActiveOCCViewId( module() ), myEditedObject, true );
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( myEditedObject );
+    theBrowseObjectsEntries.append( anEntry );
   }
 
   module()->setIsToUpdate( myEditedObject );
index 1173b67989c714dd07f9f106897e5ac3e74c4658..300e269eba799ac1c0c5efe921514c81a338796a 100755 (executable)
@@ -46,7 +46,8 @@ protected:
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
-  virtual bool                 processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool                 processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                             QStringList& theBrowseObjectsEntries );
 
   virtual bool                 isToAbortOnApply() const { return false; }
 
index 7275fe0a4f0158db1b0fb905489429022fb148dd..27be271fa85e18bb665df5bdf5fa6a842d100a7b 100644 (file)
@@ -101,7 +101,8 @@ HYDROGUI_InputPanel* HYDROGUI_TranslateObstacleOp::createInputPanel() const
 }
 
 bool HYDROGUI_TranslateObstacleOp::processApply( int& theUpdateFlags,
-                                                 QString& theErrorMsg )
+                                                 QString& theErrorMsg,
+                                                 QStringList& theBrowseObjectsEntries )
 {
   HYDROGUI_TranslateObstacleDlg* aPanel = ::qobject_cast<HYDROGUI_TranslateObstacleDlg*>( inputPanel() );
   if ( !aPanel || myEditedObject.IsNull() ) {
index d2fa5e683f40d2af219e85c50533e3845a411e2b..c005d78f936a7c081e00a96bb32ffa03096d171a 100644 (file)
@@ -46,7 +46,8 @@ protected:
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
-  virtual bool                 processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool                 processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                             QStringList& theBrowseObjectsEntries );
 
   virtual HYDROGUI_Shape*   getPreviewShape() const { return myPreviewPrs; };
 
index f57f39c0d181620bb66d20856170486dae44a941..990673a64a649ebcf7070fc41513c59d85d7f571 100644 (file)
@@ -26,6 +26,7 @@
 #include "HYDROGUI_Tool.h"
 #include "HYDROGUI_TwoImagesDlg.h"
 #include "HYDROGUI_UpdateFlags.h"
+#include <HYDROGUI_DataObject.h>
 
 #include <HYDROData_Document.h>
 #include <HYDROData_Image.h>
@@ -151,7 +152,8 @@ void HYDROGUI_TwoImagesOp::onAlreadySelected( const QString& theName )
 }
 
 bool HYDROGUI_TwoImagesOp::processApply( int& theUpdateFlags,
-                                         QString& theErrorMsg )
+                                         QString& theErrorMsg,
+                                         QStringList& theBrowseObjectsEntries )
 {
   HYDROGUI_TwoImagesDlg* aPanel = dynamic_cast<HYDROGUI_TwoImagesDlg*>( inputPanel() );
 
@@ -208,6 +210,8 @@ bool HYDROGUI_TwoImagesOp::processApply( int& theUpdateFlags,
     anOperator = aFactory->Operator( anOperatorName );
 
     aResult = aFactory->CreateImage( doc(), anOperator );
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aResult );
+    theBrowseObjectsEntries.append( anEntry );
   }
 
   if( aResult.IsNull() || !anOperator )
index 095d47f100cae27538e2b148d3040e45bbcacec7..274224a19c3d721fed166549fb86451be2a64558 100644 (file)
@@ -43,7 +43,8 @@ protected:
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
-  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg,
+                                           QStringList& theBrowseObjectsEntries );
 
 protected slots:
   /** Show warning if the name has already been selected 
index 1b9fba2d2251bcedcfc071f5792bb450c057ad1c..3f7c1eaf732e55ca72ae2f5dbaee49911b2edf11 100644 (file)
@@ -95,7 +95,8 @@ void HYDROGUI_ZLevelsOp::startOperation()
 /**
 */
 bool HYDROGUI_ZLevelsOp::processApply( int& theUpdateFlags,
-                                       QString& theErrorMsg )
+                                       QString& theErrorMsg,
+                                       QStringList& theBrowseObjectsEntries )
 {
   bool aRes = false;
 
index 7bb84ebc231bd979a708a7250d8c992df7b60fc1..7d43033bad2b0a3236848299403f2cd314ba2cf6 100644 (file)
@@ -43,7 +43,8 @@ public:
 
 protected:
   virtual void startOperation();
-  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg );
+  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
+                             QStringList& theBrowseObjectsEntries );
   virtual void processCancel();
 
 private: