Salome HOME
22599: EDF 8159 SMESH: Bad groups created by extrusion
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupDlg.cxx
index 9445167a443eb3c3f132d9bf5233b30585c821e1..6176934a633b33b2b9339140e5b37a31a733d777 100644 (file)
@@ -462,7 +462,8 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(reject()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),  this, SLOT(onObjectSelectionChanged()));
   connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()),      this, SLOT(onVisibilityChanged()));
-
+  connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()),   this, SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseView()),              this, SLOT(onCloseView()));
   rb1->setChecked(true); // VSR !!!
   onGrpTypeChanged(0); // VSR!!!
 
@@ -1197,7 +1198,10 @@ bool SMESHGUI_GroupDlg::onApply()
           }
           // update a visible group accoding to a changed contents
           if ( !isConversion && anActor->GetVisibility() )
+          {
             SMESH::Update( anIO, true );
+            SMESH::RepaintCurrentView();
+          }
         }
       }
     }
@@ -1326,6 +1330,10 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
         // any visible actor of group or submesh of myMesh
         SetAppropriateActor();
 
+        setDefaultGroupColor();
+        if (myName->text().isEmpty())
+          setDefaultName();
+
         aString = aList.First()->getName();
         myMeshGroupLine->setText(aString);
         myMeshGroupLine->home( false );
@@ -1762,10 +1770,10 @@ void SMESHGUI_GroupDlg::setFilters()
   myFilterDlg->SetEnabled( /*setInViewer=*/isStandalone,
                            /*diffSources=*/isStandalone );
   myFilterDlg->SetMesh( myMesh );
+  myFilterDlg->SetGroup( myGroupOnFilter );
   myFilterDlg->SetSelection();
   myFilterDlg->SetSourceWg( myElements, false );
 
-
   myFilterDlg->show();
 }
 
@@ -2241,6 +2249,32 @@ void SMESHGUI_GroupDlg::reject()
   if ( myFilterDlg ) myFilterDlg->UnRegisterFilters();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_GroupDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    mySMESHGUI->EmitSignalDeactivateDialog();
+    setEnabled(true);
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_GroupDlg::onCloseView()
+{
+  onDeactivate();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : onHelp()
 // purpose  :
@@ -2282,6 +2316,10 @@ void SMESHGUI_GroupDlg::onDeactivate()
 void SMESHGUI_GroupDlg::enterEvent (QEvent*)
 {
   if (!isEnabled()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     mySMESHGUI->EmitSignalDeactivateDialog();
     setEnabled(true);
     mySelectionMode = grpNoSelection;