From ac577021e5dbd0a16b16e4726668bbca0002d751 Mon Sep 17 00:00:00 2001 From: ouv Date: Fri, 30 May 2008 08:28:49 +0000 Subject: [PATCH] Added fix of the bug IPAL19726 (Qt4 porting: problems with gauss points' selection) --- .../VisuGUI_GaussPointsSelectionPane.cxx | 49 ++----------------- .../VisuGUI_GaussPointsSelectionPane.h | 3 -- src/VISUGUI/VisuGUI_SelectionPanel.cxx | 2 - 3 files changed, 5 insertions(+), 49 deletions(-) diff --git a/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.cxx b/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.cxx index af0042e6..cb99ebef 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.cxx @@ -461,6 +461,8 @@ void VisuGUI_GaussPointsSelectionPane::KeyPressed() void VisuGUI_GaussPointsSelectionPane::SelectionEvent() { //printf( "VisuGUI_GaussPointsSelectionPane::SelectionEvent()\n" ); + ClearIDControls(); + SelectorHelper aHelper( myModule ); if( aHelper.get() ) { @@ -474,15 +476,8 @@ void VisuGUI_GaussPointsSelectionPane::SelectionEvent() myParentElementLineEdit->setText( QString::number( aCellID ) ); myLocalPointLineEdit->setText( QString::number( aLocalPntID ) ); - - VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get(); - aPickingSettings->InvokeEvent( VISU::UpdatePickingSettingsEvent,NULL ); - - SetSelected( aCellID, aLocalPntID ); - return; } } - ClearIDControls(); } void VisuGUI_GaussPointsSelectionPane::onSelectionValidate() @@ -494,20 +489,14 @@ void VisuGUI_GaussPointsSelectionPane::onSelectionValidate() void VisuGUI_GaussPointsSelectionPane::onSelectionApply() { //printf( "VisuGUI_GaussPointsSelectionPane::onSelectionApply()\n" ); - VISU::TCellID aCellId = myParentElementLineEdit->text().toInt(); - VISU::TLocalPntID aLocalPntId = myLocalPointLineEdit->text().toInt(); - SetSelected( aCellId, aLocalPntId ); -} - -void VisuGUI_GaussPointsSelectionPane::SetSelected( VISU::TCellID theCellId, VISU::TLocalPntID theLocalPntId ) -{ - //printf( "VisuGUI_GaussPointsSelectionPane::SetSelected( %d, %d )\n", theCellId, theLocalPntId ); SelectorHelper aHelper( myModule ); if( !aHelper.get() ) return; + VISU::TCellID aCellId = myParentElementLineEdit->text().toInt(); + VISU::TLocalPntID aLocalPntId = myLocalPointLineEdit->text().toInt(); VISU::PGaussPtsIDMapper anIDMapper = aHelper.myPipeLine->GetGaussPtsIDMapper(); - vtkIdType anObjVtkId = anIDMapper->GetVTKID( VISU::TGaussPointID( theCellId, theLocalPntId ) ); + vtkIdType anObjVtkId = anIDMapper->GetVTKID( VISU::TGaussPointID( aCellId, aLocalPntId ) ); if( anObjVtkId < 0 ) return; @@ -524,33 +513,6 @@ void VisuGUI_GaussPointsSelectionPane::ClearIDControls() myLocalPointLineEdit->setText( "" ); } -void VisuGUI_GaussPointsSelectionPane::UnselectAll() -{ - //printf( "VisuGUI_GaussPointsSelectionPane::UnselectAll()\n" ); - SelectorHelper aHelper( myModule ); - 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 ) - { - //printf( "anObjVtkId = %d\n", anObjVtkId ); - aHelper.myActor->Highlight( false ); - aHelper.myMapIndex.Clear(); - } - } - } - ClearIDControls(); -} - void VisuGUI_GaussPointsSelectionPane::Apply() { /* @@ -577,7 +539,6 @@ void VisuGUI_GaussPointsSelectionPane::onApplyCursorSize( double theValue ) VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get(); aPickingSettings->SetCursorSize( theValue ); aPickingSettings->InvokeEvent( VISU::UpdatePickingSettingsEvent,NULL ); - //onSelectionApply(); } void VisuGUI_GaussPointsSelectionPane::onApplyPyramidHeight( double theValue ) diff --git a/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.h b/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.h index a00f47f2..a8b31a9e 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.h +++ b/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.h @@ -73,8 +73,6 @@ public: void SetInteractor( SVTK_RenderWindowInteractor* ); - void UnselectAll(); - void Apply(); //void Help(); @@ -102,7 +100,6 @@ private: void SelectionEvent(); //void keyPressEvent( QKeyEvent* e ); - void SetSelected( VISU::TCellID, VISU::TLocalPntID ); void ClearIDControls(); private: diff --git a/src/VISUGUI/VisuGUI_SelectionPanel.cxx b/src/VISUGUI/VisuGUI_SelectionPanel.cxx index 4f1a2ce1..16e5ce69 100644 --- a/src/VISUGUI/VisuGUI_SelectionPanel.cxx +++ b/src/VISUGUI/VisuGUI_SelectionPanel.cxx @@ -421,8 +421,6 @@ void VisuGUI_SelectionPanel::onSelectionModeChanged( int theId ) SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(myModule); if (!aViewWindow) return; - myGaussPointsPane->UnselectAll(); // unselect gauss points - switch (theId) { case 0: // Actor aViewWindow->SetSelectionMode(ActorSelection); -- 2.39.2