Salome HOME
Updated for bug IPAL19474.
authorskl <skl@opencascade.com>
Mon, 23 Jun 2008 07:56:20 +0000 (07:56 +0000)
committerskl <skl@opencascade.com>
Mon, 23 Jun 2008 07:56:20 +0000 (07:56 +0000)
doc/salome/gui/SMESH/input/selection_filter_library.doc
src/SMESHGUI/SMESHGUI_FilterDlg.cxx

index a921d85768c4b030dd87b339022e7e016be9059b..70dc9a65f2e169f4b8c68bf212bc915b500468f1 100644 (file)
@@ -42,6 +42,9 @@ the whole \b Mesh, the <b>Initial Selection</b> or the <b>Current Group</b>.
 existing filter from <b>Selection filter library</b> and <b>Add
 to...</b> button gives you a possibility to save your current filter
 in the Library.
+\n <b>Note:</b> If button <b>Apply and Close</b> is disabled, there
+is no selected mesh in Object Browser and the filter can not be
+created. You have to select the mesh and the button will be enabled.
 
 \image html a-filteronedges.png
 
@@ -150,4 +153,4 @@ the point of view of MED convention.
 </ul>
 
 
-*/
\ No newline at end of file
+*/
index 5758ddf7bce7f91d89122b6145ac25b5af42e097..19e13e85d125b19c549f4da51b90df72a3755b9c 100755 (executable)
@@ -2192,6 +2192,10 @@ void SMESHGUI_FilterDlg::SetSourceWg (QWidget* theWg)
 void SMESHGUI_FilterDlg::SetMesh (SMESH::SMESH_Mesh_var theMesh)
 {
   myMesh = theMesh;
+  if ( myMesh->_is_nil() ) {
+    myButtons[BTN_OK]->setEnabled(false);
+    myButtons[BTN_Apply]->setEnabled(false);
+  }
 }
 
 //=======================================================================
@@ -2526,6 +2530,14 @@ void SMESHGUI_FilterDlg::onSelectionDone()
   int aRow, aCol;
   const SALOME_ListIO& aList = mySelector->StoredIObjects();
 
+  if ( myMesh->_is_nil() && aList.Extent()>0 ) {
+    myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(aList.First());
+    if ( !(myMesh->_is_nil()) ) {
+      myButtons[BTN_OK]->setEnabled(true);
+      myButtons[BTN_Apply]->setEnabled(true);
+    }
+  }
+
   if (aList.Extent() != 1 ||
       !myTable->CurrentCell(aRow, aCol) ||
       myTable->GetCriterionType(aRow) != FT_BelongToGeom &&
@@ -2545,6 +2557,7 @@ void SMESHGUI_FilterDlg::onSelectionDone()
     }
 }
 
+
 //=======================================================================
 // name    : SMESHGUI_FilterDlg::onCriterionChanged
 // Purpose : SLOT called when cretarion of current row changed. Update selection