]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Added fix of the bug IPAL19726 (Qt4 porting: problems with gauss points' selection)
authorouv <ouv@opencascade.com>
Fri, 30 May 2008 08:28:49 +0000 (08:28 +0000)
committerouv <ouv@opencascade.com>
Fri, 30 May 2008 08:28:49 +0000 (08:28 +0000)
src/VISUGUI/VisuGUI_GaussPointsSelectionPane.cxx
src/VISUGUI/VisuGUI_GaussPointsSelectionPane.h
src/VISUGUI/VisuGUI_SelectionPanel.cxx

index af0042e6592ef87c9069d88600917c8e7ac9ccba..cb99ebef6632501c4e22c4b4bc252068c628ab54 100644 (file)
@@ -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 )
index a00f47f20de4cebd093b28e2b742787bf154d450..a8b31a9ecde485903998a0a31faefe6dcb7cc82b 100644 (file)
@@ -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:
index 4f1a2ce1921c770af2fdd861af63bf15b6051934..16e5ce69f41b00614ea6e3f640ccaea64714d4fd 100644 (file)
@@ -421,8 +421,6 @@ void VisuGUI_SelectionPanel::onSelectionModeChanged( int theId )
   SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
   if (!aViewWindow) return;
 
-  myGaussPointsPane->UnselectAll(); // unselect gauss points
-
   switch (theId) {
   case 0: // Actor
     aViewWindow->SetSelectionMode(ActorSelection);