X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_FilterDlg.cxx;h=95f8ed3039d5e3e72b2157a38ba6a641790c1e4f;hp=f1b72a35e62a8c7a8b312c57f9c7e19a162acf20;hb=81f4aba6d730b754eeac248a753c33ba673beaa1;hpb=9a358116f4ee87b52d3d86752c4fb6b3f814a69f diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index f1b72a35e..95f8ed303 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -428,7 +428,7 @@ QString SMESHGUI_FilterTable::Table::text (int row, int col) const // Purpose : Constructor //======================================================================= SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule, - QWidget* parent, + QWidget* parent, const int type) : QFrame(parent), myIsLocked( false ), @@ -443,7 +443,7 @@ SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule, // Purpose : Constructor //======================================================================= SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule, - QWidget* parent, + QWidget* parent, const QValueList& types) : QFrame(parent), myIsLocked( false ), @@ -674,7 +674,7 @@ bool SMESHGUI_FilterTable::IsValid (const bool theMess, const int theEntityType) aCriterion == FT_BelongToGeom || aCriterion == FT_BelongToPlane || aCriterion == FT_BelongToCylinder || - aCriterion == FT_LyingOnGeom) { + aCriterion == FT_LyingOnGeom) { if (aTable->text(i, 2).isEmpty()) { if (theMess) QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"), @@ -984,7 +984,7 @@ void SMESHGUI_FilterTable::updateAdditionalWidget() GetCriterionType(aRow) != FT_LyingOnGeom && GetCriterionType(aRow) != FT_RangeOfIds && GetCriterionType(aRow) != FT_FreeEdges && - GetCriterionType(aRow) != FT_BadOrientedVolume; + GetCriterionType(aRow) != FT_BadOrientedVolume; if (!myAddWidgets.contains(anItem)) { myAddWidgets[ anItem ] = new AdditionalWidget(myWgStack); @@ -1065,10 +1065,10 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con aTable->SetEditable(false, row, 2); } else if (aCriterionType == SMESH::FT_RangeOfIds || - aCriterionType == SMESH::FT_BelongToGeom || - aCriterionType == SMESH::FT_BelongToPlane || - aCriterionType == SMESH::FT_BelongToCylinder || - aCriterionType == SMESH::FT_LyingOnGeom) + aCriterionType == SMESH::FT_BelongToGeom || + aCriterionType == SMESH::FT_BelongToPlane || + aCriterionType == SMESH::FT_BelongToCylinder || + aCriterionType == SMESH::FT_LyingOnGeom) { QMap aMap; aMap[ FT_EqualTo ] = tr("EQUAL_TO"); @@ -1314,6 +1314,7 @@ const QMap& SMESHGUI_FilterTable::getCriteria (const int theType) aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM"); aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM"); aCriteria[ SMESH::FT_BadOrientedVolume ] = tr("BAD_ORIENTED_VOLUME"); + aCriteria[ SMESH::FT_Volume3D ] = tr("VOLUME_3D"); } return aCriteria; } @@ -1604,10 +1605,11 @@ SMESHGUI_FilterDlg::SMESHGUI_FilterDlg( SMESHGUI* theModule, : QDialog( SMESH::GetDesktop( theModule ), theName, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), mySMESHGUI( theModule ), - mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), - myViewWindow( SMESH::GetViewWindow( theModule ) ), - mySelector( myViewWindow->GetSelector() ) + mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ) { + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + mySelector = aViewWindow->GetSelector(); + construct(theTypes); } @@ -1623,8 +1625,8 @@ SMESHGUI_FilterDlg::SMESHGUI_FilterDlg( SMESHGUI* theModule, mySMESHGUI( theModule ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ) { - myViewWindow = SMESH::GetViewWindow( theModule ); - mySelector = myViewWindow->GetSelector(); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + mySelector = aViewWindow->GetSelector(); QValueList aTypes; aTypes.append(theType); construct(aTypes); @@ -1885,7 +1887,8 @@ void SMESHGUI_FilterDlg::onClose() aResMap.Add(anIndMap(i)); mySelector->AddOrRemoveIndex( anIter.Key(), aResMap, false); - myViewWindow->highlight( anIter.Key(), true, true ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->highlight( anIter.Key(), true, true ); } mySelectionMgr->setSelectedObjects(aList, false); } @@ -2036,9 +2039,9 @@ bool SMESHGUI_FilterDlg::isValid() const { int aType = myTable->GetCriterionType(i); if (aType == FT_BelongToGeom || - aType == FT_BelongToPlane || - aType == FT_BelongToCylinder || - aType == FT_LyingOnGeom) { + aType == FT_BelongToPlane || + aType == FT_BelongToCylinder || + aType == FT_LyingOnGeom) { QString aName; myTable->GetThreshold(i, aName); @@ -2361,12 +2364,13 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QValueListSelectionMode()!=aSelMode) { + SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); + if ( aViewWindow && aViewWindow->SelectionMode()!=aSelMode) { mySelectionMgr->clearSelected(); mySelectionMgr->clearFilters(); if (aSelMode == NodeSelection) SMESH::SetPointRepresentation(true); - myViewWindow->SetSelectionMode(aSelMode); + aViewWindow->SetSelectionMode(aSelMode); } // Clear selection @@ -2399,7 +2403,8 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QValueListAddOrRemoveIndex(anIO, aMap, false); - myViewWindow->highlight( anIO, true, true ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->highlight( anIO, true, true ); // insert previously stored filter in viewer if necessary if (!aFilter.IsNull()) @@ -2490,10 +2495,10 @@ void SMESHGUI_FilterDlg::updateSelection() int aRow, aCol; if (myTable->CurrentCell(aRow, aCol) && - (myTable->GetCriterionType(aRow) == FT_BelongToGeom || - myTable->GetCriterionType(aRow) == FT_BelongToPlane || - myTable->GetCriterionType(aRow) == FT_BelongToCylinder || - myTable->GetCriterionType(aRow) == FT_LyingOnGeom)) { + (myTable->GetCriterionType(aRow) == FT_BelongToGeom || + myTable->GetCriterionType(aRow) == FT_BelongToPlane || + myTable->GetCriterionType(aRow) == FT_BelongToCylinder || + myTable->GetCriterionType(aRow) == FT_LyingOnGeom)) { if (myTable->GetCriterionType(aRow) == FT_BelongToGeom || myTable->GetCriterionType(aRow) == FT_LyingOnGeom) {