X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_FilterDlg.cxx;h=49d6ff7958aef493981cf9e0bbc59d007e455ea7;hp=b2e9627b8bc4e51151235c62f71d24cb9f8f2179;hb=c9c6669fab21f2a0d544d79e60ceb119800b4cb5;hpb=a2f0f70d5912ea83c868916f06eaefb58a32ec2e diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index b2e9627b8..49d6ff795 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -1604,10 +1604,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 +1624,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 +1886,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); } @@ -2192,13 +2194,8 @@ bool SMESHGUI_FilterDlg::createFilter (const int theType) long aPrecision = -1; SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); - if (mgr && mgr->hasValue("SMESH", "ControlsPrecision")) { - QString aStr = mgr->stringValue("SMESH", "ControlsPrecision"); - bool isOk = false; - int aVal = aStr.toInt(&isOk); - if (isOk) - aPrecision = aVal; - } + if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) ) + aPrecision = mgr->integerValue( "SMESH", "controls_precision", aPrecision ); for (CORBA::ULong i = 0; i < n; i++) { SMESH::Filter::Criterion aCriterion = createCriterion(); @@ -2366,12 +2363,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 @@ -2404,7 +2402,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())