Salome HOME
refs #430: incorrect coordinates in dump polyline
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Operation.cxx
index 761083b8b64e90628ba81754c8d740b1d8119a6c..442b6e7d383eea1caf424124421c8c4d7390c704 100644 (file)
@@ -144,13 +144,14 @@ OCCViewer_ViewManager* HYDROGUI_Operation::getPreviewManager()
  */
 void HYDROGUI_Operation::setPreviewManager( OCCViewer_ViewManager* theManager )
 {
-  if ( !theManager && myPreviewManager )
-    module()->getOCCDisplayer()->RemoveZLayer( myPreviewManager, getPreviewZLayer() );
+  //No good: preview Z layer could be used by usual presentations
+  //if ( !theManager && myPreviewManager )
+  //  module()->getOCCDisplayer()->RemoveZLayer( myPreviewManager, getPreviewZLayer() );
 
   myPreviewManager = theManager;
 
   if ( myPreviewManager )
-    setPreviewZLayer( module()->getOCCDisplayer()->AddTopZLayer( myPreviewManager ) );
+    setPreviewZLayer( module()->getOCCDisplayer()->AddPreviewZLayer( myPreviewManager ) );
 }
 
 void HYDROGUI_Operation::startOperation()
@@ -232,7 +233,8 @@ void HYDROGUI_Operation::closeInputPanel()
 }
 
 bool HYDROGUI_Operation::processApply( int& theUpdateFlags,
-                                       QString& theErrorMsg )
+                                       QString& theErrorMsg,
+                                       QStringList& theBrowseObjectsEntries )
 {
   return false;
 }
@@ -289,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 )
   {
@@ -312,6 +315,7 @@ void HYDROGUI_Operation::onApply()
     module()->update( anUpdateFlags );
     commitDocOperation();
     commit();
+    browseObjects( aBrowseObjectsEntries );
   }
   else
   {
@@ -376,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 );
+}