From ded06ac3171e7349e1e4592149c8c01e1413f471 Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 13 Mar 2008 07:49:31 +0000 Subject: [PATCH] Additional corrections for IPAL19178. --- src/VVTK/VVTK_PickingDlg.cxx | 38 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/VVTK/VVTK_PickingDlg.cxx b/src/VVTK/VVTK_PickingDlg.cxx index 76fead72..75670122 100644 --- a/src/VVTK/VVTK_PickingDlg.cxx +++ b/src/VVTK/VVTK_PickingDlg.cxx @@ -676,26 +676,26 @@ void VVTK_PickingDlg::onClickApply() void VVTK_PickingDlg::onClickClose() { SelectorHelper aHelper( myInteractor ); - if ( !aHelper.get() ) - return; - - const TColStd_IndexedMapOfInteger& aMapIndex = aHelper.myMapIndex; - if ( aMapIndex.Extent() != 1 ) - return; + if ( aHelper.get() ) + { + const TColStd_IndexedMapOfInteger& aMapIndex = aHelper.myMapIndex; + if ( aMapIndex.Extent() == 1 ) + { + int anObjId = aHelper.myMapIndex(1); + VISU::TGaussPointID aGaussPointID = aHelper.myPipeLine->GetObjID( anObjId ); + VISU::TCellID aCellID = aGaussPointID.first; + VISU::TLocalPntID aLocalPntID = aGaussPointID.second; + + VISU::PGaussPtsIDMapper anIDMapper = aHelper.myPipeLine->GetGaussPtsIDMapper(); + vtkIdType anObjVtkId = anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ); + if ( anObjVtkId >= 0 ) + { + aHelper.myActor->Highlight( false ); + aHelper.myMapIndex.Clear(); + } + } + } - int anObjId = aHelper.myMapIndex(1); - VISU::TGaussPointID aGaussPointID = aHelper.myPipeLine->GetObjID( anObjId ); - VISU::TCellID aCellID = aGaussPointID.first; - VISU::TLocalPntID aLocalPntID = aGaussPointID.second; - - VISU::PGaussPtsIDMapper anIDMapper = aHelper.myPipeLine->GetGaussPtsIDMapper(); - vtkIdType anObjVtkId = anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ); - if ( anObjVtkId < 0 ) - return; - - aHelper.myActor->Highlight( false ); - aHelper.myMapIndex.Clear(); - reject(); } -- 2.39.2