Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / VISUGUI / VisuGUI_GaussPointsSelectionPane.cxx
index 972065d0352cbe605a001da2d3ead37d3f7b7703..54b638bf2255b70ea89b08e77346375c451d3800 100644 (file)
@@ -1,7 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU Lesser General Public
@@ -19,6 +16,7 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  VISU VISUGUI : GUI of VISU component
 //  File   : VisuGUI_GaussPointsSelectionPane.cxx
 //  Author : Oleg Uvarov
@@ -88,29 +86,29 @@ namespace
 
       SVTK_RenderWindowInteractor* anInteractor = NULL;
       if( SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>( myModule ) )
-       //if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() )
-         anInteractor = aViewWindow->GetInteractor();
+        //if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() )
+          anInteractor = aViewWindow->GetInteractor();
 
       if ( !anInteractor )
-       return aResult;
+        return aResult;
       
       mySelector = anInteractor->GetSelector();
       if ( !mySelector )
-       return aResult;
+        return aResult;
       
       const SALOME_ListIO& aListIO = mySelector->StoredIObjects();
       if ( aListIO.Extent() != 1 ) 
-       return aResult;
+        return aResult;
       
       myIO = aListIO.First();
       if ( mySelector->HasIndex( myIO ) )
-       mySelector->GetIndex(myIO, myMapIndex);
-       
+        mySelector->GetIndex(myIO, myMapIndex);
+        
       VTK::ActorCollectionCopy aCopy(anInteractor->getRenderer()->GetActors());
       myActor = SVTK::Find<VISU_GaussPtsAct>(aCopy.GetActors(),
-                                            SVTK::TIsSameIObject<VISU_GaussPtsAct>( myIO ));
+                                             SVTK::TIsSameIObject<VISU_GaussPtsAct>( myIO ));
       if ( !myActor )
-       return aResult;
+        return aResult;
       
       myPipeLine = myActor->GetGaussPointsPL();
 
@@ -132,7 +130,7 @@ namespace
   {
   public:
     GaussPtsIDValidator( const SalomeApp_Module* theModule,
-                        QObject * theParent ):
+                         QObject * theParent ):
       QIntValidator( 0, VTK_LARGE_ID, theParent ),
       myHelper(theModule)
     {}
@@ -142,10 +140,10 @@ namespace
     validate ( QString & theInput, int & thePos ) const
     {
       if ( QIntValidator::validate( theInput, thePos ) == QValidator::Invalid)
-       return QValidator::Invalid;
+        return QValidator::Invalid;
       
       if ( !myHelper.get() )
-       return QValidator::Invalid;
+        return QValidator::Invalid;
 
       return QValidator::Acceptable;
     }
@@ -159,8 +157,8 @@ namespace
   {
   public:
     GaussCellIDValidator( QLineEdit* theLocalPointLabel,
-                         const SalomeApp_Module* theModule,
-                         QObject * theParent ):
+                          const SalomeApp_Module* theModule,
+                          QObject * theParent ):
       GaussPtsIDValidator( theModule, theParent ),
       myLocalPointLineEdit( theLocalPointLabel )
     {}
@@ -170,16 +168,16 @@ namespace
     validate ( QString & theInput, int & thePos ) const
     {
       if( theInput.isEmpty() )
-       return QValidator::Acceptable;
+        return QValidator::Acceptable;
 
       if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid)
-       return QValidator::Invalid;
+        return QValidator::Invalid;
 
       VISU::TCellID aCellID = theInput.toInt();
       VISU::TLocalPntID aLocalPntID = myLocalPointLineEdit->text().toInt();
       VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper();
       if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 )
-       return QValidator::Intermediate;
+        return QValidator::Intermediate;
 
       return QValidator::Acceptable;
     }
@@ -193,8 +191,8 @@ namespace
   {
   public:
     GaussLocalPointIDValidator( QLineEdit* theParentElementLineEdit,
-                               const SalomeApp_Module* theModule,
-                               QObject * theParent ):
+                                const SalomeApp_Module* theModule,
+                                QObject * theParent ):
       GaussPtsIDValidator( theModule, theParent ),
       myParentElementLineEdit( theParentElementLineEdit )
     {}
@@ -204,16 +202,16 @@ namespace
     validate ( QString & theInput, int & thePos ) const
     {
       if( theInput.isEmpty() )
-       return QValidator::Acceptable;
+        return QValidator::Acceptable;
 
       if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid)
-       return QValidator::Invalid;
+        return QValidator::Invalid;
 
       VISU::TLocalPntID aLocalPntID = theInput.toInt();
       VISU::TCellID aCellID = myParentElementLineEdit->text().toInt();
       VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper();
       if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 )
-       return QValidator::Intermediate;
+        return QValidator::Intermediate;
 
       return QValidator::Acceptable;
     }
@@ -254,7 +252,7 @@ void VisuGUI_ValidatedLineEdit::MarkValidated( const QString& theText )
 //---------------------------------------------------------------------------------
 
 VisuGUI_GaussPointsSelectionPane::VisuGUI_GaussPointsSelectionPane( const SalomeApp_Module* theModule,
-                                                                   QWidget* theParent ) :
+                                                                    QWidget* theParent ) :
   QWidget( theParent ),
   myModule( theModule ),
   myEventCallbackCommand( vtkCallbackCommand::New() )
@@ -341,16 +339,16 @@ void VisuGUI_GaussPointsSelectionPane::setInteractor( SVTK_RenderWindowInteracto
 
   //printf( "AddObserver(vtkCommand::KeyPressEvent)\n" );
   aDevice->AddObserver(vtkCommand::KeyPressEvent, 
-                      myEventCallbackCommand.GetPointer(), 
-                      myPriority);
+                       myEventCallbackCommand.GetPointer(), 
+                       myPriority);
 
   if( aDevice->HasObserver(vtkCommand::EndPickEvent) )
     aDevice->RemoveObservers(vtkCommand::EndPickEvent);
 
   //printf( "AddObserver(vtkCommand::EndPickEvent)\n" );
   aDevice->AddObserver(vtkCommand::EndPickEvent, 
-                      myEventCallbackCommand.GetPointer(), 
-                      myPriority);
+                       myEventCallbackCommand.GetPointer(), 
+                       myPriority);
 }
 
 SVTK_RenderWindowInteractor* VisuGUI_GaussPointsSelectionPane::getInteractor()
@@ -367,9 +365,9 @@ SVTK_RenderWindowInteractor* VisuGUI_GaussPointsSelectionPane::getInteractor()
 }
 
 void VisuGUI_GaussPointsSelectionPane::ProcessEvents(vtkObject* vtkNotUsed(theObject),
-                                                    unsigned long theEvent,
-                                                    void* theClientData,
-                                                    void* vtkNotUsed(theCallData))
+                                                     unsigned long theEvent,
+                                                     void* theClientData,
+                                                     void* vtkNotUsed(theCallData))
 {
   VisuGUI_GaussPointsSelectionPane* self = reinterpret_cast<VisuGUI_GaussPointsSelectionPane*>(theClientData);
 
@@ -495,10 +493,10 @@ void VisuGUI_GaussPointsSelectionPane::Help()
     platform = "application";
 #endif
     SUIT_MessageBox::warning( 0,
-                             QObject::tr("WRN_WARNING"),
-                             QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                               arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
-                             QObject::tr("BUT_OK"));
+                              QObject::tr("WRN_WARNING"),
+                              QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                                arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
+                              QObject::tr("BUT_OK"));
   }
 }