Back to index

salome-smesh  6.5.0
SMESHGUI_Preferences_ColorDlg.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // SMESH SMESHGUI : GUI for SMESH component
00024 // File   : SMESHGUI_Preferences_ColorDlg.cxx
00025 // Author : Nicolas REJNERI, Open CASCADE S.A.S.
00026 // SMESH includes
00027 //
00028 #include "SMESHGUI_Preferences_ColorDlg.h"
00029 
00030 #include "SMESHGUI.h"
00031 #include "SMESHGUI_SpinBox.h"
00032 #include "SMESHGUI_Utils.h"
00033 
00034 // SALOME GUI includes
00035 #include <SUIT_Desktop.h>
00036 #include <SUIT_MessageBox.h>
00037 #include <SUIT_ResourceMgr.h>
00038 #include <SUIT_Session.h>
00039 #include <QtxColorButton.h>
00040 #include <VTKViewer_MarkerWidget.h>
00041 #include <LightApp_Application.h>
00042 #include <SalomeApp_IntSpinBox.h>
00043 
00044 // Qt includes
00045 #include <QGroupBox>
00046 #include <QLabel>
00047 #include <QPushButton>
00048 #include <QVBoxLayout>
00049 #include <QHBoxLayout>
00050 #include <QGridLayout>
00051 #include <QCheckBox>
00052 #include <QKeyEvent>
00053 
00054 #define SPACING 6
00055 #define MARGIN  11
00056 
00057 //=================================================================================
00058 // function : SMESHGUI_Preferences_ColorDlg()
00059 // purpose  : Constructs a SMESHGUI_Preferences_ColorDlg which is a child
00060 //            of 'parent', with the name 'name' and widget flags set to 'f'
00061 //            The dialog will by default be modeless, unless you
00062 //            set'modal' to true to construct a modal dialog.
00063 //=================================================================================
00064 SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModule )
00065   : QDialog( SMESH::GetDesktop( theModule ) ),
00066     mySMESHGUI( theModule )
00067 {
00068   setModal( true );
00069   setWindowTitle( tr( "DIALOG_TITLE" ) );
00070   setSizeGripEnabled( true );
00071 
00072   // -------------------------------
00073   QVBoxLayout* topLayout = new QVBoxLayout( this );
00074   topLayout->setSpacing( SPACING );
00075   topLayout->setMargin( MARGIN );
00076 
00077   // -------------------------------
00078   QGroupBox* ButtonGroup1 = new QGroupBox( tr( "GRP_ELEMENTS" ), this );
00079   QGridLayout* ButtonGroup1Layout = new QGridLayout( ButtonGroup1 );
00080   ButtonGroup1Layout->setSpacing( SPACING );
00081   ButtonGroup1Layout->setMargin( MARGIN );
00082 
00083   QLabel* TextLabel_Fill = new QLabel( tr( "SURFACE_COLOR_LBL" ), ButtonGroup1 );
00084 
00085   toolSurfColor = new QtxBiColorTool(ButtonGroup1);
00086   toolSurfColor->setText( tr( "BACKSURFACE_COLOR_LBL" ));
00087 
00088   QLabel* TextLabel_Outline = new QLabel( tr( "OUTLINE_COLOR_LBL" ), ButtonGroup1 );
00089   btnOutlineColor = new QtxColorButton( ButtonGroup1 );
00090 
00091   QLabel* TextLabel_Wireframe = new QLabel( tr( "WIREFRAME_COLOR_LBL" ), ButtonGroup1 );
00092   btnWireframeColor = new QtxColorButton( ButtonGroup1 );
00093 
00094   QLabel* TextLabel_0DElements_Color = new QLabel( tr( "0D_ELEMENTS_COLOR_LBL" ), ButtonGroup1 );
00095   btn0DElementsColor = new QtxColorButton( ButtonGroup1 );
00096 
00097   QLabel* TextLabel_0DElements_Size = new QLabel( tr( "0D_ELEMENTS_SIZE_LBL" ), ButtonGroup1 );
00098   SpinBox_0DElements_Size = new SalomeApp_IntSpinBox( ButtonGroup1 );
00099   SpinBox_0DElements_Size->setAcceptNames( false ); // No Notebook variables allowed
00100   SpinBox_0DElements_Size->setRange( 1, 10 );
00101   SpinBox_0DElements_Size->setSingleStep( 1 );
00102   SpinBox_0DElements_Size->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00103   SpinBox_0DElements_Size->setButtonSymbols( QSpinBox::PlusMinus );
00104 
00105   QLabel* TextLabel_Width = new QLabel( tr( "LINE_WIDTH_LBL" ), ButtonGroup1 );
00106   SpinBox_Width = new SalomeApp_IntSpinBox( ButtonGroup1 );
00107   SpinBox_Width->setAcceptNames( false ); // No Notebook variables allowed
00108   SpinBox_Width->setRange( 1, 5 );
00109   SpinBox_Width->setSingleStep( 1 );
00110   SpinBox_Width->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00111   SpinBox_Width->setButtonSymbols( QSpinBox::PlusMinus );
00112 
00113   QLabel* TextLabel_ShrinkCoeff = new QLabel( tr( "SHRINK_COEF_LBL" ), ButtonGroup1 );
00114   SpinBox_Shrink = new SalomeApp_IntSpinBox( ButtonGroup1 );
00115   SpinBox_Shrink->setAcceptNames( false ); // No Notebook variables allowed
00116   SpinBox_Shrink->setRange( 20, 100 );
00117   SpinBox_Shrink->setSingleStep( 1 );
00118   SpinBox_Shrink->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00119   SpinBox_Shrink->setButtonSymbols( QSpinBox::PlusMinus );
00120 
00121   ButtonGroup1Layout->addWidget( TextLabel_Fill,             0, 0 );
00122   ButtonGroup1Layout->addWidget( toolSurfColor,              0, 1, 1, 3 );
00123 
00124   ButtonGroup1Layout->addWidget( TextLabel_Outline,          1, 0 );
00125   ButtonGroup1Layout->addWidget( btnOutlineColor,            1, 1 );
00126   ButtonGroup1Layout->addWidget( TextLabel_Wireframe,        1, 2 );
00127   ButtonGroup1Layout->addWidget( btnWireframeColor,         1, 3 );
00128 
00129   ButtonGroup1Layout->addWidget( TextLabel_0DElements_Color, 2, 0 );
00130   ButtonGroup1Layout->addWidget( btn0DElementsColor,         2, 1 );
00131 
00132   ButtonGroup1Layout->addWidget( TextLabel_0DElements_Size,  2, 2 );
00133   ButtonGroup1Layout->addWidget( SpinBox_0DElements_Size,    2, 3 );
00134 
00135   ButtonGroup1Layout->addWidget( TextLabel_Width,            3, 0 );
00136   ButtonGroup1Layout->addWidget( SpinBox_Width,              3, 1 );
00137   ButtonGroup1Layout->addWidget( TextLabel_ShrinkCoeff,      3, 2 );
00138   ButtonGroup1Layout->addWidget( SpinBox_Shrink,             3, 3 );
00139 
00140   // -------------------------------
00141   QGroupBox* ButtonGroup2 = new QGroupBox( tr( "GRP_NODES" ), this );
00142   QGridLayout* ButtonGroup2Layout = new QGridLayout( ButtonGroup2 );
00143   ButtonGroup2Layout->setSpacing( SPACING );
00144   ButtonGroup2Layout->setMargin( MARGIN );
00145 
00146   QLabel* TextLabel_Nodes_Color = new QLabel( tr( "NODES_COLOR_LBL" ), ButtonGroup2 );
00147   btnNodeColor = new QtxColorButton( ButtonGroup2 );
00148 
00149   QGroupBox* MarkerGroup = new QGroupBox( tr( "NODES_MARKER_LBL" ), ButtonGroup2 );
00150   QVBoxLayout* MarkerGroupLayout = new QVBoxLayout( MarkerGroup );
00151   MarkerGroupLayout->setSpacing( 0 );
00152   MarkerGroupLayout->setMargin( 0 );
00153 
00154   MarkerWidget = new VTKViewer_MarkerWidget( MarkerGroup );
00155 
00156   MarkerGroupLayout->addWidget( MarkerWidget );
00157 
00158   ButtonGroup2Layout->addWidget( TextLabel_Nodes_Color, 0, 0 );
00159   ButtonGroup2Layout->addWidget( btnNodeColor,          0, 1 );
00160   ButtonGroup2Layout->addWidget( MarkerGroup,           1, 0, 1, 3 );
00161   ButtonGroup2Layout->setColumnStretch( 2, 1 );
00162 
00163   // -------------------------------
00164   QGroupBox* ButtonGroup3 = new QGroupBox( tr( "GRP_ORIENTATION" ), this );
00165   QGridLayout* ButtonGroup3Layout = new QGridLayout( ButtonGroup3 );
00166   ButtonGroup3Layout->setSpacing( SPACING );
00167   ButtonGroup3Layout->setMargin( MARGIN );
00168 
00169   QLabel* TextLabel_Orientation_Color = new QLabel( tr( "ORIENTATION_COLOR_LBL" ), ButtonGroup3 );
00170   btnOrientationColor = new QtxColorButton( ButtonGroup3 );
00171 
00172   QLabel* TextLabel_Orientation_Scale = new QLabel( tr( "ORIENTATION_SCALE_LBL" ), ButtonGroup3 );
00173   SpinBox_Orientation_Scale = new SMESHGUI_SpinBox( ButtonGroup3 );
00174   SpinBox_Orientation_Scale->setAcceptNames( false ); // No Notebook variables allowed
00175   SpinBox_Orientation_Scale->RangeStepAndValidator( .05, .5, .05, "parametric_precision" );
00176   SpinBox_Orientation_Scale->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00177   SpinBox_Orientation_Scale->setButtonSymbols( QSpinBox::PlusMinus );
00178 
00179   CheckBox_Orientation_3DVectors = new QCheckBox( tr( "3D_VECTORS_LBL" ), ButtonGroup3 );
00180 
00181   ButtonGroup3Layout->addWidget( TextLabel_Orientation_Color,    0, 0 );
00182   ButtonGroup3Layout->addWidget( btnOrientationColor,            0, 1 );
00183   ButtonGroup3Layout->addWidget( TextLabel_Orientation_Scale,    0, 2 );
00184   ButtonGroup3Layout->addWidget( SpinBox_Orientation_Scale,      0, 3 );
00185   ButtonGroup3Layout->addWidget( CheckBox_Orientation_3DVectors, 1, 0, 1, 4 );
00186 
00187   // -------------------------------
00188   QGroupBox* ButtonGroup4 = new QGroupBox( tr( "GRP_SELECTION" ), this );
00189   QGridLayout* ButtonGroup4Layout = new QGridLayout( ButtonGroup4 );
00190   ButtonGroup3Layout->setSpacing( SPACING );
00191   ButtonGroup3Layout->setMargin( MARGIN );
00192   
00193   QLabel* TextLabel_Selection_Color = new QLabel( tr( "SELECTION_COLOR_LBL" ), ButtonGroup4 );
00194   btnSelectionColor = new QtxColorButton( ButtonGroup4 );
00195   
00196   QLabel* TextLabel_Preselection_Color = new QLabel( tr( "PRESELECTION_COLOR_LBL" ), ButtonGroup4 );
00197   btnPreselectionColor = new QtxColorButton( ButtonGroup4 );
00198   
00199   ButtonGroup4Layout->addWidget( TextLabel_Selection_Color,      0, 0 );
00200   ButtonGroup4Layout->addWidget( btnSelectionColor,              0, 1 );
00201   ButtonGroup4Layout->addWidget( TextLabel_Preselection_Color,   0, 2 );
00202   ButtonGroup4Layout->addWidget( btnPreselectionColor,           0, 3 );
00203 
00204   // -------------------------------
00205   QGroupBox* GroupButtons = new QGroupBox( this );
00206   QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
00207   GroupButtonsLayout->setSpacing( SPACING );
00208   GroupButtonsLayout->setMargin( MARGIN );
00209 
00210   QPushButton* buttonOk = new QPushButton( tr( "SMESH_BUT_OK" ), GroupButtons );
00211   buttonOk->setAutoDefault( true );
00212   buttonOk->setDefault( true );
00213 
00214   QPushButton* buttonCancel = new QPushButton( tr( "SMESH_BUT_CANCEL" ), GroupButtons );
00215   buttonCancel->setAutoDefault( true );
00216 
00217   QPushButton* buttonHelp = new QPushButton( tr( "SMESH_BUT_HELP" ), GroupButtons );
00218   buttonHelp->setAutoDefault( true );
00219 
00220   GroupButtonsLayout->addWidget( buttonOk );
00221   GroupButtonsLayout->addSpacing( 10 );
00222   GroupButtonsLayout->addStretch();
00223   GroupButtonsLayout->addWidget( buttonCancel );
00224   GroupButtonsLayout->addWidget( buttonHelp );
00225 
00226   // -------------------------------
00227   topLayout->addWidget( ButtonGroup1 );
00228   topLayout->addWidget( ButtonGroup2 );
00229   topLayout->addWidget( ButtonGroup3 );
00230   //  rnv: Selection and preselection colors are defined only in the Preferences 
00231   //  topLayout->addWidget( ButtonGroup4 );
00232   ButtonGroup4->hide();
00233   topLayout->addWidget( GroupButtons );
00234 
00235   // -------------------------------
00236   mySMESHGUI->SetActiveDialogBox( this );
00237 
00238   myHelpFileName = "colors_size_page.html";
00239 
00240   /* signals and slots connections */
00241   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
00242   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
00243   connect( buttonHelp,   SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) );
00244 
00245   connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ),
00246            this,       SLOT( DeactivateActiveDialog() ) );
00247   /* to close dialog if study change */
00248   connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ),
00249            this,       SLOT( ClickOnCancel() ) );
00250 }
00251 
00252 //=================================================================================
00253 // function : ~SMESHGUI_Preferences_ColorDlg()
00254 // purpose  : Destructor
00255 //=================================================================================
00256 SMESHGUI_Preferences_ColorDlg::~SMESHGUI_Preferences_ColorDlg()
00257 {
00258 }
00259 
00260 //=================================================================================
00261 // function : ClickOnOk()
00262 // purpose  :
00263 //=================================================================================
00264 void SMESHGUI_Preferences_ColorDlg::ClickOnOk()
00265 {
00266   mySMESHGUI->ResetState();
00267   accept();
00268 }
00269 
00270 //=================================================================================
00271 // function : ClickOnCancel()
00272 // purpose  :
00273 //=================================================================================
00274 void SMESHGUI_Preferences_ColorDlg::ClickOnCancel()
00275 {
00276   mySMESHGUI->ResetState();
00277   reject();
00278 }
00279 
00280 //=================================================================================
00281 // function : ClickOnHelp()
00282 // purpose  :
00283 //=================================================================================
00284 void SMESHGUI_Preferences_ColorDlg::ClickOnHelp()
00285 {
00286   LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
00287   if (app) 
00288     app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
00289   else {
00290     QString platform;
00291 #ifdef WIN32
00292     platform = "winapplication";
00293 #else
00294     platform = "application";
00295 #endif
00296     SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
00297                              tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
00298                              arg(app->resourceMgr()->stringValue("ExternalBrowser", 
00299                                                                  platform)).
00300                              arg(myHelpFileName));
00301   }
00302 }
00303 
00304 //=================================================================================
00305 // function : DeactivateActiveDialog()
00306 // purpose  :
00307 //=================================================================================
00308 void SMESHGUI_Preferences_ColorDlg::DeactivateActiveDialog()
00309 {
00310 }
00311 
00312 //=================================================================================
00313 // function : closeEvent()
00314 // purpose  :
00315 //=================================================================================
00316 void SMESHGUI_Preferences_ColorDlg::closeEvent( QCloseEvent* )
00317 {
00318   ClickOnCancel(); /* same than click on cancel button */
00319 }
00320 
00321 //=================================================================================
00322 // function : ActivateThisDialog()
00323 // purpose  :
00324 //=================================================================================
00325 void SMESHGUI_Preferences_ColorDlg::ActivateThisDialog()
00326 {
00327   /* Emit a signal to deactivate any active dialog */
00328   mySMESHGUI->EmitSignalDeactivateDialog();
00329 }
00330 
00331 //=================================================================================
00332 // function : SetColor()
00333 // purpose  :
00334 //=================================================================================
00335 void SMESHGUI_Preferences_ColorDlg::SetColor( int type, const QColor& color )
00336 {
00337   switch ( type ) {
00338   case 1 : toolSurfColor->setMainColor( color );     break; // fill
00339   case 2 : btnWireframeColor->setColor( color );     break; // wireframe
00340   case 3 : btnNodeColor->setColor( color );          break; // node
00341   case 4 : btnOutlineColor->setColor( color );       break; // outline
00342   case 5 : btn0DElementsColor->setColor( color );    break; // 0d elements
00343   case 6 : btnOrientationColor->setColor( color );   break; // orientation of faces
00344   case 7 : btnSelectionColor->setColor( color );     break; // selection color
00345   case 8 : btnPreselectionColor->setColor( color );  break; // pre-selection color
00346   default: break;
00347   }
00348 }
00349 
00350 //=================================================================================
00351 // function : GetColor()
00352 // purpose  :
00353 //=================================================================================
00354 QColor SMESHGUI_Preferences_ColorDlg::GetColor( int type )
00355 {
00356   QColor color;
00357   switch ( type ) {
00358   case 1 : color = toolSurfColor->mainColor();    break; // fill
00359   case 2 : color = btnWireframeColor->color();    break; // outline
00360   case 3 : color = btnNodeColor->color();         break; // node
00361   case 4 : color = btnOutlineColor->color();      break; // node
00362   case 5 : color = btn0DElementsColor->color();   break; // 0d elements
00363   case 6 : color = btnOrientationColor->color();  break; // orientation of faces
00364   case 7 : color = btnSelectionColor->color();    break; // selection color
00365   case 8 : color = btnPreselectionColor->color(); break; // pre-selection color
00366 
00367   default: break;
00368   }
00369   return color;
00370 }
00371 
00372 //=================================================================================
00373 // function : SetIntValue()
00374 // purpose  :
00375 //=================================================================================
00376 void SMESHGUI_Preferences_ColorDlg::SetIntValue( int type, int value )
00377 {
00378   switch ( type ) {
00379   case 1 : SpinBox_Width->setValue( value );           break; // width
00380   case 2 : SpinBox_Shrink->setValue( value );          break; // shrink coeff
00381   case 3 : SpinBox_0DElements_Size->setValue( value ); break; // 0d elements
00382   default: break;
00383   }
00384 }
00385 
00386 //=================================================================================
00387 // function : GetIntValue()
00388 // purpose  :
00389 //=================================================================================
00390 int SMESHGUI_Preferences_ColorDlg::GetIntValue( int type )
00391 {
00392   int res = 0;
00393   switch ( type ) {
00394   case 1 : res = SpinBox_Width->value();           break; // width
00395   case 2 : res = SpinBox_Shrink->value();          break; // shrink coeff
00396   case 3 : res = SpinBox_0DElements_Size->value(); break; // 0d elements
00397   default: break;
00398   }
00399   return res;
00400 }
00401 
00402 //=================================================================================
00403 // function : SetDoubleValue()
00404 // purpose  :
00405 //=================================================================================
00406 void SMESHGUI_Preferences_ColorDlg::SetDoubleValue( int type, double value )
00407 {
00408   switch ( type ) {
00409   case 1 : SpinBox_Orientation_Scale->setValue( value ); break; // orientation scale
00410   default: break;
00411   }
00412 }
00413 
00414 //=================================================================================
00415 // function : GetDoubleValue()
00416 // purpose  :
00417 //=================================================================================
00418 double SMESHGUI_Preferences_ColorDlg::GetDoubleValue( int type )
00419 {
00420   double res = 0;
00421   switch ( type ) {
00422   case 1 : res = SpinBox_Orientation_Scale->value(); break; // orientation scale
00423   default: break;
00424   }
00425   return res;
00426 }
00427 
00428 //=================================================================================
00429 // function : SetBooleanValue()
00430 // purpose  :
00431 //=================================================================================
00432 void SMESHGUI_Preferences_ColorDlg::SetBooleanValue( int type, bool value )
00433 {
00434   switch ( type ) {
00435   case 1 : CheckBox_Orientation_3DVectors->setChecked( value ); break; // 3D vectors
00436   default: break;
00437   }
00438 }
00439 
00440 //=================================================================================
00441 // function : GetBooleanValue()
00442 // purpose  :
00443 //=================================================================================
00444 bool SMESHGUI_Preferences_ColorDlg::GetBooleanValue( int type )
00445 {
00446   bool res = false;
00447   switch ( type ) {
00448   case 1 : res = CheckBox_Orientation_3DVectors->isChecked(); break; // 3D vectors
00449   default: break;
00450   }
00451   return res;
00452 }
00453 
00454 //=================================================================================
00455 // function : setCustomMarkerMap()
00456 // purpose  :
00457 //=================================================================================
00458 void SMESHGUI_Preferences_ColorDlg::setCustomMarkerMap( VTK::MarkerMap theMarkerMap )
00459 {
00460   MarkerWidget->setCustomMarkerMap( theMarkerMap );
00461 }
00462 
00463 //=================================================================================
00464 // function : getCustomMarkerMap()
00465 // purpose  :
00466 //=================================================================================
00467 VTK::MarkerMap SMESHGUI_Preferences_ColorDlg::getCustomMarkerMap()
00468 {
00469   return MarkerWidget->getCustomMarkerMap();
00470 }
00471 
00472 //=================================================================================
00473 // function : setStandardMarker()
00474 // purpose  :
00475 //=================================================================================
00476 void SMESHGUI_Preferences_ColorDlg::setStandardMarker( VTK::MarkerType theMarkerType,
00477                                                        VTK::MarkerScale theMarkerScale )
00478 {
00479   MarkerWidget->setStandardMarker( theMarkerType, theMarkerScale );
00480 }
00481 
00482 //=================================================================================
00483 // function : setCustomMarker()
00484 // purpose  :
00485 //=================================================================================
00486 void SMESHGUI_Preferences_ColorDlg::setCustomMarker( int theId )
00487 {
00488   MarkerWidget->setCustomMarker( theId );
00489 }
00490 
00491 //=================================================================================
00492 // function : getMarkerType()
00493 // purpose  :
00494 //=================================================================================
00495 VTK::MarkerType SMESHGUI_Preferences_ColorDlg::getMarkerType() const
00496 {
00497   return MarkerWidget->getMarkerType();
00498 }
00499 
00500 //=================================================================================
00501 // function : getStandardMarkerScale()
00502 // purpose  :
00503 //=================================================================================
00504 VTK::MarkerScale SMESHGUI_Preferences_ColorDlg::getStandardMarkerScale() const
00505 {
00506   return MarkerWidget->getStandardMarkerScale();
00507 }
00508 
00509 //=================================================================================
00510 // function : getCustomMarkerID()
00511 // purpose  :
00512 //=================================================================================
00513 int SMESHGUI_Preferences_ColorDlg::getCustomMarkerID() const
00514 {
00515   return MarkerWidget->getCustomMarkerID();
00516 }
00517 
00518 //=================================================================================
00519 // function : SetDeltaBrightness(int)
00520 // purpose  :
00521 //=================================================================================
00522 void SMESHGUI_Preferences_ColorDlg::SetDeltaBrightness(int delta) 
00523 {
00524   toolSurfColor->setDelta(delta);
00525 }
00526 //=================================================================================
00527 // function : GetDeltaBrightness()
00528 // purpose  :
00529 //=================================================================================
00530 int SMESHGUI_Preferences_ColorDlg::GetDeltaBrightness() 
00531 {
00532   return toolSurfColor->delta();
00533 }
00534 
00535 //=================================================================================
00536 // function : keyPressEvent()
00537 // purpose  :
00538 //=================================================================================
00539 void SMESHGUI_Preferences_ColorDlg::keyPressEvent( QKeyEvent* e )
00540 {
00541   QDialog::keyPressEvent( e );
00542   if ( e->isAccepted() )
00543     return;
00544 
00545   if ( e->key() == Qt::Key_F1 ) {
00546     e->accept();
00547     ClickOnHelp();
00548   }
00549 }