#include <SMESHGUI_Preferences_ColorDlg.h>

Definition at line 46 of file SMESHGUI_Preferences_ColorDlg.h.
| SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg | ( | SMESHGUI * | theModule | ) |
Definition at line 64 of file SMESHGUI_Preferences_ColorDlg.cxx.
References btn0DElementsColor, btnBackFaceColor, btnFillColor, btnNodeColor, btnOrientationColor, btnOutlineColor, CheckBox_Orientation_3DVectors, ClickOnCancel(), ClickOnHelp(), ClickOnOk(), DeactivateActiveDialog(), MARGIN, MarkerWidget, myHelpFileName, mySMESHGUI, SMESHGUI_SpinBox.RangeStepAndValidator(), SMESHGUI.SetActiveDialogBox(), SPACING, SpinBox_0DElements_Size, SpinBox_Orientation_Scale, SpinBox_Shrink, and SpinBox_Width.
: QDialog( SMESH::GetDesktop( theModule ) ), mySMESHGUI( theModule ) { setModal( true ); setWindowTitle( tr( "Preferences - Set Color" ) ); setSizeGripEnabled( true ); // ------------------------------- QVBoxLayout* topLayout = new QVBoxLayout( this ); topLayout->setSpacing( SPACING ); topLayout->setMargin( MARGIN ); // ------------------------------- QGroupBox* ButtonGroup1 = new QGroupBox( tr( "Elements" ), this ); QGridLayout* ButtonGroup1Layout = new QGridLayout( ButtonGroup1 ); ButtonGroup1Layout->setSpacing( SPACING ); ButtonGroup1Layout->setMargin( MARGIN ); QLabel* TextLabel_Fill = new QLabel( tr( "Fill" ), ButtonGroup1 ); btnFillColor = new QtxColorButton( ButtonGroup1 ); QLabel* TextLabel_BackFace = new QLabel( tr( "Back Face" ), ButtonGroup1 ); btnBackFaceColor = new QtxColorButton( ButtonGroup1 ); QLabel* TextLabel_Outine = new QLabel( tr( "Outline" ), ButtonGroup1 ); btnOutlineColor = new QtxColorButton( ButtonGroup1 ); QLabel* TextLabel_0DElements_Color = new QLabel( tr( "0D elements" ), ButtonGroup1 ); btn0DElementsColor = new QtxColorButton( ButtonGroup1 ); QLabel* TextLabel_0DElements_Size = new QLabel( tr( "Size of 0D elements" ), ButtonGroup1 ); SpinBox_0DElements_Size = new SalomeApp_IntSpinBox( ButtonGroup1 ); SpinBox_0DElements_Size->setAcceptNames( false ); // No Notebook variables allowed SpinBox_0DElements_Size->setRange( 1, 10 ); SpinBox_0DElements_Size->setSingleStep( 1 ); SpinBox_0DElements_Size->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); SpinBox_0DElements_Size->setButtonSymbols( QSpinBox::PlusMinus ); QLabel* TextLabel_Width = new QLabel( tr( "Width" ), ButtonGroup1 ); SpinBox_Width = new SalomeApp_IntSpinBox( ButtonGroup1 ); SpinBox_Width->setAcceptNames( false ); // No Notebook variables allowed SpinBox_Width->setRange( 0, 5 ); SpinBox_Width->setSingleStep( 1 ); SpinBox_Width->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); SpinBox_Width->setButtonSymbols( QSpinBox::PlusMinus ); QLabel* TextLabel_ShrinkCoeff = new QLabel( tr( "Shrink coef." ), ButtonGroup1 ); SpinBox_Shrink = new SalomeApp_IntSpinBox( ButtonGroup1 ); SpinBox_Shrink->setAcceptNames( false ); // No Notebook variables allowed SpinBox_Shrink->setRange( 20, 100 ); SpinBox_Shrink->setSingleStep( 1 ); SpinBox_Shrink->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); SpinBox_Shrink->setButtonSymbols( QSpinBox::PlusMinus ); ButtonGroup1Layout->addWidget( TextLabel_Fill, 0, 0 ); ButtonGroup1Layout->addWidget( btnFillColor, 0, 1 ); ButtonGroup1Layout->addWidget( TextLabel_BackFace, 0, 2 ); ButtonGroup1Layout->addWidget( btnBackFaceColor, 0, 3 ); ButtonGroup1Layout->addWidget( TextLabel_Outine, 1, 0 ); ButtonGroup1Layout->addWidget( btnOutlineColor, 1, 1 ); ButtonGroup1Layout->addWidget( TextLabel_0DElements_Color, 1, 2 ); ButtonGroup1Layout->addWidget( btn0DElementsColor, 1, 3 ); ButtonGroup1Layout->addWidget( TextLabel_0DElements_Size, 2, 0 ); ButtonGroup1Layout->addWidget( SpinBox_0DElements_Size, 2, 1 ); ButtonGroup1Layout->addWidget( TextLabel_Width, 3, 0 ); ButtonGroup1Layout->addWidget( SpinBox_Width, 3, 1 ); ButtonGroup1Layout->addWidget( TextLabel_ShrinkCoeff, 3, 2 ); ButtonGroup1Layout->addWidget( SpinBox_Shrink, 3, 3 ); // ------------------------------- QGroupBox* ButtonGroup2 = new QGroupBox( tr( "Nodes" ), this ); QGridLayout* ButtonGroup2Layout = new QGridLayout( ButtonGroup2 ); ButtonGroup2Layout->setSpacing( SPACING ); ButtonGroup2Layout->setMargin( MARGIN ); QLabel* TextLabel_Nodes_Color = new QLabel( tr( "Color" ), ButtonGroup2 ); btnNodeColor = new QtxColorButton( ButtonGroup2 ); QGroupBox* MarkerGroup = new QGroupBox( tr( "Marker" ), ButtonGroup2 ); QVBoxLayout* MarkerGroupLayout = new QVBoxLayout( MarkerGroup ); MarkerGroupLayout->setSpacing( 0 ); MarkerGroupLayout->setMargin( 0 ); MarkerWidget = new VTKViewer_MarkerWidget( MarkerGroup ); MarkerGroupLayout->addWidget( MarkerWidget ); ButtonGroup2Layout->addWidget( TextLabel_Nodes_Color, 0, 0 ); ButtonGroup2Layout->addWidget( btnNodeColor, 0, 1 ); ButtonGroup2Layout->addWidget( MarkerGroup, 1, 0, 1, 3 ); ButtonGroup2Layout->setColumnStretch( 2, 1 ); // ------------------------------- QGroupBox* ButtonGroup3 = new QGroupBox( tr( "Orientation of faces" ), this ); QGridLayout* ButtonGroup3Layout = new QGridLayout( ButtonGroup3 ); ButtonGroup3Layout->setSpacing( SPACING ); ButtonGroup3Layout->setMargin( MARGIN ); QLabel* TextLabel_Orientation_Color = new QLabel( tr( "Color" ), ButtonGroup3 ); btnOrientationColor = new QtxColorButton( ButtonGroup3 ); QLabel* TextLabel_Orientation_Scale = new QLabel( tr( "Scale" ), ButtonGroup3 ); SpinBox_Orientation_Scale = new SMESHGUI_SpinBox( ButtonGroup3 ); SpinBox_Orientation_Scale->setAcceptNames( false ); // No Notebook variables allowed SpinBox_Orientation_Scale->RangeStepAndValidator( .05, .5, .05, "parametric_precision" ); SpinBox_Orientation_Scale->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); SpinBox_Orientation_Scale->setButtonSymbols( QSpinBox::PlusMinus ); CheckBox_Orientation_3DVectors = new QCheckBox( tr( "3D vectors" ), ButtonGroup3 ); ButtonGroup3Layout->addWidget( TextLabel_Orientation_Color, 0, 0 ); ButtonGroup3Layout->addWidget( btnOrientationColor, 0, 1 ); ButtonGroup3Layout->addWidget( TextLabel_Orientation_Scale, 0, 2 ); ButtonGroup3Layout->addWidget( SpinBox_Orientation_Scale, 0, 3 ); ButtonGroup3Layout->addWidget( CheckBox_Orientation_3DVectors, 1, 0, 1, 4 ); // ------------------------------- QGroupBox* GroupButtons = new QGroupBox( this ); QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons ); GroupButtonsLayout->setSpacing( SPACING ); GroupButtonsLayout->setMargin( MARGIN ); QPushButton* buttonOk = new QPushButton( tr( "&OK" ), GroupButtons ); buttonOk->setAutoDefault( true ); buttonOk->setDefault( true ); QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ), GroupButtons ); buttonCancel->setAutoDefault( true ); QPushButton* buttonHelp = new QPushButton( tr( "&Help" ), GroupButtons ); buttonHelp->setAutoDefault( true ); GroupButtonsLayout->addWidget( buttonOk ); GroupButtonsLayout->addSpacing( 10 ); GroupButtonsLayout->addStretch(); GroupButtonsLayout->addWidget( buttonCancel ); GroupButtonsLayout->addWidget( buttonHelp ); // ------------------------------- topLayout->addWidget( ButtonGroup1 ); topLayout->addWidget( ButtonGroup2 ); topLayout->addWidget( ButtonGroup3 ); topLayout->addWidget( GroupButtons ); // ------------------------------- mySMESHGUI->SetActiveDialogBox( this ); myHelpFileName = "colors_size_page.html"; /* signals and slots connections */ connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ); connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) ); connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ); /* to close dialog if study change */ connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ); }
| SMESHGUI_Preferences_ColorDlg::~SMESHGUI_Preferences_ColorDlg | ( | ) |
Definition at line 230 of file SMESHGUI_Preferences_ColorDlg.cxx.
{
}
| void SMESHGUI_Preferences_ColorDlg::ActivateThisDialog | ( | ) | [private, slot] |
Definition at line 299 of file SMESHGUI_Preferences_ColorDlg.cxx.
References SMESHGUI.EmitSignalDeactivateDialog(), and mySMESHGUI.
{
/* Emit a signal to deactivate any active dialog */
mySMESHGUI->EmitSignalDeactivateDialog();
}
| void SMESHGUI_Preferences_ColorDlg::ClickOnCancel | ( | ) | [private, slot] |
Definition at line 248 of file SMESHGUI_Preferences_ColorDlg.cxx.
References mySMESHGUI, and SMESHGUI.ResetState().
Referenced by closeEvent(), and SMESHGUI_Preferences_ColorDlg().
{
mySMESHGUI->ResetState();
reject();
}
| void SMESHGUI_Preferences_ColorDlg::ClickOnHelp | ( | ) | [private, slot] |
Definition at line 258 of file SMESHGUI_Preferences_ColorDlg.cxx.
References myHelpFileName, and mySMESHGUI.
Referenced by keyPressEvent(), and SMESHGUI_Preferences_ColorDlg().
{
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
QString platform;
#ifdef WIN32
platform = "winapplication";
#else
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
}
| void SMESHGUI_Preferences_ColorDlg::ClickOnOk | ( | ) | [private, slot] |
Definition at line 238 of file SMESHGUI_Preferences_ColorDlg.cxx.
References mySMESHGUI, and SMESHGUI.ResetState().
Referenced by SMESHGUI_Preferences_ColorDlg().
{
mySMESHGUI->ResetState();
accept();
}
| void SMESHGUI_Preferences_ColorDlg::closeEvent | ( | QCloseEvent * | ) | [protected] |
Definition at line 290 of file SMESHGUI_Preferences_ColorDlg.cxx.
References ClickOnCancel().
{
ClickOnCancel(); /* same than click on cancel button */
}
| void SMESHGUI_Preferences_ColorDlg::DeactivateActiveDialog | ( | ) | [private, slot] |
Definition at line 282 of file SMESHGUI_Preferences_ColorDlg.cxx.
Referenced by SMESHGUI_Preferences_ColorDlg().
{
}
Definition at line 413 of file SMESHGUI_Preferences_ColorDlg.cxx.
References CheckBox_Orientation_3DVectors, and SMESH_AdvancedEditor.res.
Referenced by SetDisplayMode().
{
bool res = false;
switch ( type ) {
case 1 : res = CheckBox_Orientation_3DVectors->isChecked(); break; // 3D vectors
default: break;
}
return res;
}
| QColor SMESHGUI_Preferences_ColorDlg::GetColor | ( | int | type | ) |
Definition at line 326 of file SMESHGUI_Preferences_ColorDlg.cxx.
References btn0DElementsColor, btnBackFaceColor, btnFillColor, btnNodeColor, btnOrientationColor, and btnOutlineColor.
Referenced by SetDisplayMode().
{
QColor color;
switch ( type ) {
case 1 : color = btnFillColor->color(); break; // fill
case 2 : color = btnOutlineColor->color(); break; // outline
case 3 : color = btnNodeColor->color(); break; // node
case 4 : color = btnBackFaceColor->color(); break; // back face
case 5 : color = btn0DElementsColor->color(); break; // 0d elements
case 6 : color = btnOrientationColor->color(); break; // orientation of faces
default: break;
}
return color;
}
| int SMESHGUI_Preferences_ColorDlg::getCustomMarkerID | ( | ) | const |
Definition at line 482 of file SMESHGUI_Preferences_ColorDlg.cxx.
References MarkerWidget.
Referenced by SetDisplayMode().
{
return MarkerWidget->getCustomMarkerID();
}
| VTK::MarkerMap SMESHGUI_Preferences_ColorDlg::getCustomMarkerMap | ( | ) |
Definition at line 436 of file SMESHGUI_Preferences_ColorDlg.cxx.
References MarkerWidget.
Referenced by SetDisplayMode().
{
return MarkerWidget->getCustomMarkerMap();
}
| double SMESHGUI_Preferences_ColorDlg::GetDoubleValue | ( | int | type | ) |
Definition at line 387 of file SMESHGUI_Preferences_ColorDlg.cxx.
References SMESH_AdvancedEditor.res, and SpinBox_Orientation_Scale.
Referenced by SetDisplayMode().
{
double res = 0;
switch ( type ) {
case 1 : res = SpinBox_Orientation_Scale->value(); break; // orientation scale
default: break;
}
return res;
}
Definition at line 359 of file SMESHGUI_Preferences_ColorDlg.cxx.
References SMESH_AdvancedEditor.res, SpinBox_0DElements_Size, SpinBox_Shrink, and SpinBox_Width.
Referenced by SetDisplayMode().
{
int res = 0;
switch ( type ) {
case 1 : res = SpinBox_Width->value(); break; // width
case 2 : res = SpinBox_Shrink->value(); break; // shrink coeff
case 3 : res = SpinBox_0DElements_Size->value(); break; // 0d elements
default: break;
}
return res;
}
| VTK::MarkerType SMESHGUI_Preferences_ColorDlg::getMarkerType | ( | ) | const |
Definition at line 464 of file SMESHGUI_Preferences_ColorDlg.cxx.
References MarkerWidget.
Referenced by SetDisplayMode().
{
return MarkerWidget->getMarkerType();
}
| VTK::MarkerScale SMESHGUI_Preferences_ColorDlg::getStandardMarkerScale | ( | ) | const |
Definition at line 473 of file SMESHGUI_Preferences_ColorDlg.cxx.
References MarkerWidget.
Referenced by SetDisplayMode().
{
return MarkerWidget->getStandardMarkerScale();
}
| void SMESHGUI_Preferences_ColorDlg::keyPressEvent | ( | QKeyEvent * | e | ) | [protected] |
Definition at line 491 of file SMESHGUI_Preferences_ColorDlg.cxx.
References ClickOnHelp().
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Qt::Key_F1 ) {
e->accept();
ClickOnHelp();
}
}
Definition at line 401 of file SMESHGUI_Preferences_ColorDlg.cxx.
References CheckBox_Orientation_3DVectors.
Referenced by SetDisplayMode().
{
switch ( type ) {
case 1 : CheckBox_Orientation_3DVectors->setChecked( value ); break; // 3D vectors
default: break;
}
}
| void SMESHGUI_Preferences_ColorDlg::SetColor | ( | int | type, |
| const QColor & | color | ||
| ) |
Definition at line 309 of file SMESHGUI_Preferences_ColorDlg.cxx.
References btn0DElementsColor, btnBackFaceColor, btnFillColor, btnNodeColor, btnOrientationColor, and btnOutlineColor.
Referenced by SetDisplayMode().
{
switch ( type ) {
case 1 : btnFillColor->setColor( color ); break; // fill
case 2 : btnOutlineColor->setColor( color ); break; // outline
case 3 : btnNodeColor->setColor( color ); break; // node
case 4 : btnBackFaceColor->setColor( color ); break; // back face
case 5 : btn0DElementsColor->setColor( color ); break; // 0d elements
case 6 : btnOrientationColor->setColor( color ); break; // orientation of faces
default: break;
}
}
| void SMESHGUI_Preferences_ColorDlg::setCustomMarker | ( | int | theId | ) |
Definition at line 455 of file SMESHGUI_Preferences_ColorDlg.cxx.
References MarkerWidget.
Referenced by SetDisplayMode().
{
MarkerWidget->setCustomMarker( theId );
}
| void SMESHGUI_Preferences_ColorDlg::setCustomMarkerMap | ( | VTK::MarkerMap | theMarkerMap | ) |
Definition at line 427 of file SMESHGUI_Preferences_ColorDlg.cxx.
References MarkerWidget.
Referenced by SetDisplayMode().
{
MarkerWidget->setCustomMarkerMap( theMarkerMap );
}
| void SMESHGUI_Preferences_ColorDlg::SetDoubleValue | ( | int | type, |
| double | value | ||
| ) |
Definition at line 375 of file SMESHGUI_Preferences_ColorDlg.cxx.
References SpinBox_Orientation_Scale.
Referenced by SetDisplayMode().
{
switch ( type ) {
case 1 : SpinBox_Orientation_Scale->setValue( value ); break; // orientation scale
default: break;
}
}
Definition at line 345 of file SMESHGUI_Preferences_ColorDlg.cxx.
References SpinBox_0DElements_Size, SpinBox_Shrink, and SpinBox_Width.
Referenced by SetDisplayMode().
{
switch ( type ) {
case 1 : SpinBox_Width->setValue( value ); break; // width
case 2 : SpinBox_Shrink->setValue( value ); break; // shrink coeff
case 3 : SpinBox_0DElements_Size->setValue( value ); break; // 0d elements
default: break;
}
}
| void SMESHGUI_Preferences_ColorDlg::setStandardMarker | ( | VTK::MarkerType | theMarkerType, |
| VTK::MarkerScale | theMarkerScale | ||
| ) |
Definition at line 445 of file SMESHGUI_Preferences_ColorDlg.cxx.
References MarkerWidget.
Referenced by SetDisplayMode().
{
MarkerWidget->setStandardMarker( theMarkerType, theMarkerScale );
}
QtxColorButton* SMESHGUI_Preferences_ColorDlg.btn0DElementsColor [private] |
Definition at line 89 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by GetColor(), SetColor(), and SMESHGUI_Preferences_ColorDlg().
QtxColorButton* SMESHGUI_Preferences_ColorDlg.btnBackFaceColor [private] |
Definition at line 87 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by GetColor(), SetColor(), and SMESHGUI_Preferences_ColorDlg().
QtxColorButton* SMESHGUI_Preferences_ColorDlg.btnFillColor [private] |
Definition at line 86 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by GetColor(), SetColor(), and SMESHGUI_Preferences_ColorDlg().
QtxColorButton* SMESHGUI_Preferences_ColorDlg.btnNodeColor [private] |
Definition at line 93 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by GetColor(), SetColor(), and SMESHGUI_Preferences_ColorDlg().
QtxColorButton* SMESHGUI_Preferences_ColorDlg.btnOrientationColor [private] |
Definition at line 95 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by GetColor(), SetColor(), and SMESHGUI_Preferences_ColorDlg().
QtxColorButton* SMESHGUI_Preferences_ColorDlg.btnOutlineColor [private] |
Definition at line 88 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by GetColor(), SetColor(), and SMESHGUI_Preferences_ColorDlg().
QCheckBox* SMESHGUI_Preferences_ColorDlg.CheckBox_Orientation_3DVectors [private] |
Definition at line 97 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by GetBooleanValue(), SetBooleanValue(), and SMESHGUI_Preferences_ColorDlg().
VTKViewer_MarkerWidget* SMESHGUI_Preferences_ColorDlg.MarkerWidget [private] |
Definition at line 94 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by getCustomMarkerID(), getCustomMarkerMap(), getMarkerType(), getStandardMarkerScale(), setCustomMarker(), setCustomMarkerMap(), setStandardMarker(), and SMESHGUI_Preferences_ColorDlg().
QString SMESHGUI_Preferences_ColorDlg.myHelpFileName [private] |
Definition at line 99 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by ClickOnHelp(), and SMESHGUI_Preferences_ColorDlg().
SMESHGUI* SMESHGUI_Preferences_ColorDlg.mySMESHGUI [private] |
Definition at line 84 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by ActivateThisDialog(), ClickOnCancel(), ClickOnHelp(), ClickOnOk(), and SMESHGUI_Preferences_ColorDlg().
SalomeApp_IntSpinBox* SMESHGUI_Preferences_ColorDlg.SpinBox_0DElements_Size [private] |
Definition at line 90 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by GetIntValue(), SetIntValue(), and SMESHGUI_Preferences_ColorDlg().
Definition at line 96 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by GetDoubleValue(), SetDoubleValue(), and SMESHGUI_Preferences_ColorDlg().
SalomeApp_IntSpinBox* SMESHGUI_Preferences_ColorDlg.SpinBox_Shrink [private] |
Definition at line 92 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by GetIntValue(), SetIntValue(), and SMESHGUI_Preferences_ColorDlg().
SalomeApp_IntSpinBox* SMESHGUI_Preferences_ColorDlg.SpinBox_Width [private] |
Definition at line 91 of file SMESHGUI_Preferences_ColorDlg.h.
Referenced by GetIntValue(), SetIntValue(), and SMESHGUI_Preferences_ColorDlg().