#include <SMESHGUI_Measurements.h>

Public Types | |
| enum | { MinDistance, BoundingBox } |
Measurement type. More... | |
Public Member Functions | |
| SMESHGUI_MeasureDlg (QWidget *=0, int=MinDistance) | |
| Constructor. | |
| ~SMESHGUI_MeasureDlg () | |
| Destructor. | |
| void | reject () |
| Perform clean-up actions on the dialog box closing. | |
Protected Member Functions | |
| void | keyPressEvent (QKeyEvent *) |
| Process keyboard event. | |
| void | enterEvent (QEvent *) |
| Reactivate dialog box, when mouse pointer goes into it. | |
Private Types | |
| enum | { NodeMode, ElemMode } |
Private Slots | |
| void | help () |
| Show help page. | |
| void | updateSelection () |
| Setup selection mode depending on the current dialog box state. | |
| void | activate () |
| Activate dialog box. | |
| void | deactivate () |
| Deactivate dialog box. | |
Private Attributes | |
| QTabWidget * | myTabWidget |
| SMESHGUI_MinDistance * | myMinDist |
| SMESHGUI_BoundingBox * | myBndBox |
Definition at line 138 of file SMESHGUI_Measurements.h.
anonymous enum [private] |
Definition at line 142 of file SMESHGUI_Measurements.h.
| anonymous enum |
Measurement type.
Definition at line 146 of file SMESHGUI_Measurements.h.
{
MinDistance,
BoundingBox
};
Constructor.
| parent | parent widget |
| page | specifies the dialog page to be shown at the start-up |
Definition at line 1093 of file SMESHGUI_Measurements.cxx.
References BoundingBox, deactivate(), SMESHGUI.GetSMESHGUI(), help(), MinDistance, myBndBox, myMinDist, myTabWidget, reject(), SMESHGUI.resourceMgr(), and updateSelection().
: QDialog( parent ) { setModal( false ); setAttribute( Qt::WA_DeleteOnClose, true ); setWindowTitle( tr( "MEASUREMENTS" ) ); setSizeGripEnabled( true ); SUIT_ResourceMgr* resMgr = SMESHGUI::resourceMgr(); myTabWidget = new QTabWidget( this ); // min distance myMinDist = new SMESHGUI_MinDistance( myTabWidget ); myTabWidget->addTab( myMinDist, resMgr->loadPixmap( "SMESH", tr( "ICON_MEASURE_MIN_DIST" ) ), tr( "MIN_DIST" ) ); // bounding box myBndBox = new SMESHGUI_BoundingBox( myTabWidget ); myTabWidget->addTab( myBndBox, resMgr->loadPixmap( "SMESH", tr( "ICON_MEASURE_BND_BOX" ) ), tr( "BND_BOX" ) ); // buttons QPushButton* okBtn = new QPushButton( tr( "SMESH_BUT_OK" ), this ); okBtn->setAutoDefault( true ); okBtn->setDefault( true ); okBtn->setFocus(); QPushButton* helpBtn = new QPushButton( tr( "SMESH_BUT_HELP" ), this ); helpBtn->setAutoDefault( true ); QHBoxLayout* btnLayout = new QHBoxLayout; btnLayout->setSpacing( SPACING ); btnLayout->setMargin( 0 ); btnLayout->addWidget( okBtn ); btnLayout->addStretch( 10 ); btnLayout->addWidget( helpBtn ); QVBoxLayout* l = new QVBoxLayout ( this ); l->setMargin( MARGIN ); l->setSpacing( SPACING ); l->addWidget( myTabWidget ); l->addStretch(); l->addLayout( btnLayout ); myTabWidget->setCurrentIndex( qMax( (int)MinDistance, qMin( (int)BoundingBox, page ) ) ); connect( okBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( helpBtn, SIGNAL( clicked() ), this, SLOT( help() ) ); connect( myTabWidget, SIGNAL( currentChanged( int ) ), this, SLOT( updateSelection() ) ); connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( deactivate() ) ); connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalCloseAllDialogs() ), this, SLOT( reject() ) ); updateSelection(); }
| SMESHGUI_MeasureDlg::~SMESHGUI_MeasureDlg | ( | ) |
| void SMESHGUI_MeasureDlg::activate | ( | ) | [private, slot] |
Activate dialog box.
Definition at line 1214 of file SMESHGUI_Measurements.cxx.
References SMESHGUI.EmitSignalDeactivateDialog(), SMESHGUI.GetSMESHGUI(), myTabWidget, SMESHGUI.SetActiveDialogBox(), and updateSelection().
Referenced by enterEvent().
{
SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
SMESHGUI::GetSMESHGUI()->SetActiveDialogBox( this );
myTabWidget->setEnabled( true );
updateSelection();
}
| void SMESHGUI_MeasureDlg::deactivate | ( | ) | [private, slot] |
Deactivate dialog box.
Definition at line 1225 of file SMESHGUI_Measurements.cxx.
References SMESHGUI_BoundingBox.deactivate(), SMESHGUI_MinDistance.deactivate(), myBndBox, myMinDist, myTabWidget, and SMESHGUI.selectionMgr().
Referenced by SMESHGUI_MeasureDlg().
{
myMinDist->deactivate();
myBndBox->deactivate();
myTabWidget->setEnabled( false );
disconnect( SMESHGUI::selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( updateInfo() ) );
}
| void SMESHGUI_MeasureDlg::enterEvent | ( | QEvent * | ) | [protected] |
Reactivate dialog box, when mouse pointer goes into it.
Definition at line 1184 of file SMESHGUI_Measurements.cxx.
References activate().
{
activate();
}
| void SMESHGUI_MeasureDlg::help | ( | ) | [private, slot] |
Show help page.
Definition at line 1204 of file SMESHGUI_Measurements.cxx.
References MinDistance, myTabWidget, and SMESH.ShowHelpFile().
Referenced by keyPressEvent(), and SMESHGUI_MeasureDlg().
{
SMESH::ShowHelpFile( myTabWidget->currentIndex() == MinDistance ?
"measurements_page.html#min_distance_anchor" :
"measurements_page.html#bounding_box_anchor" );
}
| void SMESHGUI_MeasureDlg::keyPressEvent | ( | QKeyEvent * | e | ) | [protected] |
Process keyboard event.
| e | key press event |
Definition at line 1172 of file SMESHGUI_Measurements.cxx.
References help().
{
QDialog::keyPressEvent( e );
if ( !e->isAccepted() && e->key() == Qt::Key_F1 ) {
e->accept();
help();
}
}
| void SMESHGUI_MeasureDlg::reject | ( | ) |
Perform clean-up actions on the dialog box closing.
Definition at line 1158 of file SMESHGUI_Measurements.cxx.
References SMESH.GetViewWindow(), SMESHGUI.selectionMgr(), and SMESH.SetPointRepresentation().
Referenced by SMESHGUI_MeasureDlg().
{
LightApp_SelectionMgr* selMgr = SMESHGUI::selectionMgr();
selMgr->clearFilters();
SMESH::SetPointRepresentation( false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )
aViewWindow->SetSelectionMode( ActorSelection );
QDialog::reject();
}
| void SMESHGUI_MeasureDlg::updateSelection | ( | ) | [private, slot] |
Setup selection mode depending on the current dialog box state.
Definition at line 1192 of file SMESHGUI_Measurements.cxx.
References BoundingBox, MinDistance, myBndBox, myMinDist, myTabWidget, SMESHGUI_BoundingBox.updateSelection(), and SMESHGUI_MinDistance.updateSelection().
Referenced by activate(), and SMESHGUI_MeasureDlg().
{
if ( myTabWidget->currentIndex() == MinDistance )
myMinDist->updateSelection();
else if ( myTabWidget->currentIndex() == BoundingBox )
myBndBox->updateSelection();
}
SMESHGUI_BoundingBox* SMESHGUI_MeasureDlg.myBndBox [private] |
Definition at line 169 of file SMESHGUI_Measurements.h.
Referenced by deactivate(), SMESHGUI_MeasureDlg(), and updateSelection().
Definition at line 168 of file SMESHGUI_Measurements.h.
Referenced by deactivate(), SMESHGUI_MeasureDlg(), and updateSelection().
QTabWidget* SMESHGUI_MeasureDlg.myTabWidget [private] |
Definition at line 167 of file SMESHGUI_Measurements.h.
Referenced by activate(), deactivate(), help(), SMESHGUI_MeasureDlg(), and updateSelection().