Salome HOME
PAL9022. Attach generated mesh elements to whatever meshed shape, SHELL or SOLID
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_SingleEditDlg.cxx
index cf7750be8bf7c5d3688e80597696e6c039036199..fcf0682b49ef72c673973f5c70e453e60a7cb997 100755 (executable)
@@ -113,7 +113,6 @@ SMESHGUI_SingleEditDlg
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
     mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
-    myViewWindow(SMESH::GetViewWindow(theModule)),
     mySMESHGUI(theModule)
 {
   QVBoxLayout* aDlgLay = new QVBoxLayout(this, MARGIN, SPACING);
@@ -137,7 +136,7 @@ QFrame* SMESHGUI_SingleEditDlg::createMainFrame (QWidget* theParent)
 {
   QGroupBox* aMainGrp = new QGroupBox(1, Qt::Vertical, tr("EDGE_BETWEEN"), theParent);
 
-  QPixmap aPix (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
+  QPixmap aPix (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
 
   new QLabel(tr("SMESH_EDGE"), aMainGrp);
   (new QPushButton(aMainGrp))->setPixmap(aPix);
@@ -240,7 +239,8 @@ void SMESHGUI_SingleEditDlg::Init()
   this->show();
 
   // set selection mode
-  myViewWindow->SetSelectionMode(EdgeOfCellSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(EdgeOfCellSelection);
 
   onSelectionDone();
 }
@@ -262,7 +262,8 @@ void SMESHGUI_SingleEditDlg::onOk()
 //=======================================================================
 void SMESHGUI_SingleEditDlg::onClose()
 {
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
   mySelectionMgr->clearSelected();
   disconnect(mySelectionMgr, 0, this, 0);
   disconnect(mySMESHGUI, 0, this, 0);
@@ -442,7 +443,8 @@ void SMESHGUI_SingleEditDlg::enterEvent (QEvent*)
 {
   if (!isEnabled()) {
     mySMESHGUI->EmitSignalDeactivateDialog();
-    myViewWindow->SetSelectionMode(EdgeOfCellSelection);
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->SetSelectionMode(EdgeOfCellSelection);
     setEnabled(true);
   }
 }