Salome HOME
PAL10332 - references are interpreted as original objects in filters, dialogs, etc.
[modules/visu.git] / src / VISUGUI / VisuGUI_Plot3DDlg.cxx
index 19ff935dcfdd4ec3c9a3f1686a5a0563533db56e..78cbcec2aa5c7dc520dcb2237d571878d869bf47 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "SALOME_Actor.h"
 #include "SVTK_ViewWindow.h"
+#include "SUIT_Desktop.h"
 
 #include <qlayout.h>
 #include <qvalidator.h>
@@ -60,10 +61,8 @@ using namespace std;
 static void renderViewFrame (SVTK_ViewWindow* vw)
 {
   if (vw) {
-//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
-      vw->getRenderer()->ResetCameraClippingRange();
-      vw->Repaint();
-//}
+    vw->getRenderer()->ResetCameraClippingRange();
+    vw->Repaint();
   }
 }
 
@@ -498,8 +497,8 @@ bool VisuGUI_Plot3DPane::check()
 //function : Constructor
 //purpose  :
 //=======================================================================
-VisuGUI_Plot3DDlg::VisuGUI_Plot3DDlg(QWidget* parent)
-  : QDialog(parent, "VisuGUI_Plot3DDlg", false, WStyle_Customize |
+VisuGUI_Plot3DDlg::VisuGUI_Plot3DDlg (SalomeApp_Module* theModule)
+  : QDialog(VISU::GetDesktop(theModule), "VisuGUI_Plot3DDlg", false, WStyle_Customize |
             WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
 {
   setCaption(tr("TITLE"));
@@ -551,38 +550,8 @@ VisuGUI_Plot3DDlg::VisuGUI_Plot3DDlg(QWidget* parent)
 //=======================================================================
 void VisuGUI_Plot3DDlg::accept()
 {
-/*if (!VISU::CheckActiveStudyLock()) {
-    return;
-  }
-  if (myIsoPane->check() && myScalarPane->check()) {
-    if (!isModal()) {
-      VISU::Plot3D_i* prs = myIsoPane->GetPrs();
-      bool isCreation = !VISU::GetActor(prs, myViewWindow);
-      if (storeToPrsObject(prs)) {
-       if (isCreation) { // creation
-         if (myViewWindow) {
-           try {
-              VISU::CreateActor(prs);
-           }
-           catch (...) {
-             reject();
-             return;
-           }
-           myViewWindow->onFitAll();
-         }
-       } else { // edition
-         VISU::RecreateActor(prs);
-          renderViewFrame(myViewWindow);
-       }
-      } else {
-       if (isCreation) {
-          prs->RemoveFromStudy();
-          //study->updateObjBrowser();
-       }
-      }
-}*/
+  if (myIsoPane->check() && myScalarPane->check())
     QDialog::accept();
-//}
 }
 
 //=======================================================================
@@ -593,13 +562,5 @@ void VisuGUI_Plot3DDlg::reject()
 {
   myIsoPane->check(); // hide preview
 
-/*if (!isModal() && myIsoPane->GetPrs() &&
-      !VISU::GetActor(myIsoPane->GetPrs(), myViewWindow)) {
-    _PTR(Study) aStudy = VISU::GetCStudy(VISU::GetAppStudy(myModule));
-    if (!aStudy->GetProperties()->IsLocked()) {
-      myIsoPane->GetPrs()->RemoveFromStudy();
-      myIsoPane->GetStudyFrame()->getStudy()->updateObjBrowser();
-    }
-}*/
   QDialog::reject();
 }