Version: 8.3.0
SMESHGUI_GroupOpDlg Class Reference

#include <SMESHGUI_GroupOpDlg.h>

Inheritance diagram for SMESHGUI_GroupOpDlg:

Public Member Functions

 SMESHGUI_GroupOpDlg (SMESHGUI *)
 Class : SMESHGUI_GroupOpDlg Description : Perform boolean operations on groups. More...
 
virtual ~SMESHGUI_GroupOpDlg ()
 Destructor. More...
 
void Init ()
 Init dialog fields, connect signals and slots, show dialog. More...
 

Protected Slots

virtual bool onApply ()
 This virtual slot does nothing and should be redefined in derived classes. More...
 
virtual void onSelectionDone ()
 SLOT, called when selection is changed. More...
 
virtual void setVisible (bool visible)
 Calls onSelectionDone() and setVisible() method of base class. More...
 
virtual void reject ()
 SLOT called when dialog is closed. More...
 

Protected Member Functions

virtual void reset ()
 Resets state of the dialog, initializes its fields with default value, etc. More...
 
QString getName () const
 Gets name of group to be created. More...
 
void setName (const QString &theName)
 Sets name of group to be created. More...
 
QGroupBoxgetArgGrp () const
 Gets pointer on arguments group box. More...
 
void setHelpFileName (const QString &theFName)
 Sets help file name. More...
 
SMESHGUIgetSMESHGUI () const
 Gets pointer to the module instance. More...
 
bool isValid (const QList< SMESH::SMESH_GroupBase_var > &theListGrp)
 Validate list of groups used for operation. More...
 
bool getSelectedGroups (QList< SMESH::SMESH_GroupBase_var > &theOutList, QStringList &theOutNames)
 Gets list of currently selected groups from selection manager. More...
 
SMESH::ListOfGroupsconvert (const QList< SMESH::SMESH_GroupBase_var > &)
 Converts QT-list of group to the list acceptable by IDL interface. More...
 
SALOMEDS::Color getColor () const
 Get color to be assigned to group. More...
 
void setDefaultGroupColor ()
 Set default color for group. More...
 
void setIsApplyAndClose (const bool theFlag)
 Set value of the flag indicating that the dialog is accepted by Apply & Close button. More...
 
bool isApplyAndClose () const
 Get value of the flag indicating that the dialog is accepted by Apply & Close button. More...
 

Private Slots

void onOk ()
 SLOT called when "Ok" button pressed performs operation and closes dialog box. More...
 
void onHelp ()
 SLOT called when "Help" button pressed shows "Help" page. More...
 
void onDeactivate ()
 SLOT called when dialog must be deativated. More...
 
void onOpenView ()
 
void onCloseView ()
 

Private Member Functions

void enterEvent (QEvent *)
 Event filter updates selection mode and selection filter. More...
 
void keyPressEvent (QKeyEvent *)
 Provides reaction on �F1� button pressing. More...
 
QWidgetcreateButtonFrame (QWidget *)
 Create frame containing buttons. More...
 
QWidgetcreateMainFrame (QWidget *)
 Creates frame containing dialog's input fields. More...
 

Private Attributes

QPushButton * myOkBtn
 
QPushButton * myApplyBtn
 
QPushButton * myCloseBtn
 
QPushButton * myHelpBtn
 
QLineEdit * myNameEdit
 
QGroupBoxmyArgGrp
 
QtxColorButton * myColorBtn
 
SMESHGUImySMESHGUI
 
LightApp_SelectionMgr * mySelectionMgr
 
SVTK_Selector * mySelector
 
QString myHelpFileName
 
bool myIsApplyAndClose
 

Constructor & Destructor Documentation

SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg ( SMESHGUI theModule)

Class : SMESHGUI_GroupOpDlg Description : Perform boolean operations on groups.

Constructor

Parameters
theModulepointer on module instance

References createButtonFrame(), createMainFrame(), SMESH::GetSelector(), SMESH::GetViewWindow(), Init(), MARGIN, mySelector, mySMESHGUI, and SPACING.

SMESHGUI_GroupOpDlg::~SMESHGUI_GroupOpDlg ( )
virtual

Destructor.

Member Function Documentation

SMESH::ListOfGroups * SMESHGUI_GroupOpDlg::convert ( const QList< SMESH::SMESH_GroupBase_var > &  theIn)
protected

Converts QT-list of group to the list acceptable by IDL interface.

Parameters
theIninput list
Returns
list acceptable by IDL interface

Referenced by SMESHGUI_UnionGroupsDlg::onApply(), SMESHGUI_IntersectGroupsDlg::onApply(), and SMESHGUI_CutGroupsDlg::onApply().

QWidget * SMESHGUI_GroupOpDlg::createButtonFrame ( QWidget theParent)
private

Create frame containing buttons.

Parameters
theParentparent widget
Returns
pointer to the created frame

References MARGIN, myApplyBtn, myCloseBtn, myHelpBtn, myOkBtn, onApply(), onHelp(), onOk(), reject(), and SPACING.

Referenced by SMESHGUI_GroupOpDlg().

QWidget * SMESHGUI_GroupOpDlg::createMainFrame ( QWidget theParent)
private

Creates frame containing dialog's input fields.

Parameters
theParentparent widget
Returns
pointer on created widget

References MARGIN, myArgGrp, myColorBtn, myNameEdit, and SPACING.

Referenced by SMESHGUI_GroupOpDlg().

void SMESHGUI_GroupOpDlg::enterEvent ( QEvent *  )
private

Event filter updates selection mode and selection filter.

This virtual method is redefined from the base class it is called when dialog obtains input focus

References SMESHGUI::EmitSignalDeactivateDialog(), SMESH::GetViewWindow(), SMESH::GROUP, mySelectionMgr, mySelector, and mySMESHGUI.

QGroupBox * SMESHGUI_GroupOpDlg::getArgGrp ( ) const
protected
SALOMEDS::Color SMESHGUI_GroupOpDlg::getColor ( ) const
protected

Get color to be assigned to group.

Returns
color to be assigned to group

References myColorBtn.

Referenced by SMESHGUI_UnionGroupsDlg::onApply(), SMESHGUI_IntersectGroupsDlg::onApply(), SMESHGUI_CutGroupsDlg::onApply(), and SMESHGUI_DimGroupDlg::onApply().

QString SMESHGUI_GroupOpDlg::getName ( ) const
protected

Gets name of group to be created.

Returns
name of group to be created
See Also
setName()

References myNameEdit.

Referenced by SMESHGUI_UnionGroupsDlg::onApply(), SMESHGUI_IntersectGroupsDlg::onApply(), SMESHGUI_CutGroupsDlg::onApply(), and SMESHGUI_DimGroupDlg::onApply().

bool SMESHGUI_GroupOpDlg::getSelectedGroups ( QList< SMESH::SMESH_GroupBase_var > &  theOutList,
QStringList &  theOutNames 
)
protected

Gets list of currently selected groups from selection manager.

Parameters
theOutListout list of groups
theOutNamesout list of group of group names
Returns
TRUE if operation theOutList is not empty, FALSE otherwise

References mySelectionMgr.

Referenced by SMESHGUI_UnionGroupsDlg::onSelectionDone(), SMESHGUI_IntersectGroupsDlg::onSelectionDone(), SMESHGUI_CutGroupsDlg::onSelectionDone(), and SMESHGUI_DimGroupDlg::onSelectionDone().

SMESHGUI * SMESHGUI_GroupOpDlg::getSMESHGUI ( ) const
protected
void SMESHGUI_GroupOpDlg::Init ( )
bool SMESHGUI_GroupOpDlg::isApplyAndClose ( ) const
protected

Get value of the flag indicating that the dialog is accepted by Apply & Close button.

Returns
value of the flag
See Also
setApplyAndClose()

References myIsApplyAndClose.

Referenced by SMESHGUI_UnionGroupsDlg::onApply(), SMESHGUI_IntersectGroupsDlg::onApply(), SMESHGUI_CutGroupsDlg::onApply(), and SMESHGUI_DimGroupDlg::onApply().

bool SMESHGUI_GroupOpDlg::isValid ( const QList< SMESH::SMESH_GroupBase_var > &  theListGrp)
protected

Validate list of groups used for operation.

Checks whether they corresponds to the same face and have one type

Parameters
theListGrpinput list of groups
Returns
TRUE if groups are valid, FALSE otherwise

Referenced by SMESHGUI_UnionGroupsDlg::onApply(), SMESHGUI_IntersectGroupsDlg::onApply(), SMESHGUI_CutGroupsDlg::onApply(), and SMESHGUI_DimGroupDlg::onApply().

void SMESHGUI_GroupOpDlg::keyPressEvent ( QKeyEvent *  e)
private

Provides reaction on �F1� button pressing.

Parameters
ekey press event

References onHelp().

bool SMESHGUI_GroupOpDlg::onApply ( )
protectedvirtualslot

This virtual slot does nothing and should be redefined in derived classes.

Returns
return false;

Referenced by createButtonFrame(), and onOk().

void SMESHGUI_GroupOpDlg::onCloseView ( )
privateslot

References mySelector, and onDeactivate().

Referenced by Init().

void SMESHGUI_GroupOpDlg::onDeactivate ( )
privateslot

SLOT called when dialog must be deativated.

References mySelectionMgr.

Referenced by Init(), and onCloseView().

void SMESHGUI_GroupOpDlg::onHelp ( )
privateslot

SLOT called when "Help" button pressed shows "Help" page.

References myHelpFileName, and mySMESHGUI.

Referenced by createButtonFrame(), and keyPressEvent().

void SMESHGUI_GroupOpDlg::onOk ( )
privateslot

SLOT called when "Ok" button pressed performs operation and closes dialog box.

References onApply(), reject(), and setIsApplyAndClose().

Referenced by createButtonFrame().

void SMESHGUI_GroupOpDlg::onOpenView ( )
privateslot
void SMESHGUI_GroupOpDlg::onSelectionDone ( )
protectedvirtualslot

SLOT, called when selection is changed.

Current implementation does nothing. The method should be redefined in derived classes to update corresponding GUI controls

Referenced by Init(), and setVisible().

void SMESHGUI_GroupOpDlg::reject ( )
protectedvirtualslot

SLOT called when dialog is closed.

References SMESH::GetViewWindow(), mySelectionMgr, mySMESHGUI, reset(), and SMESHGUI::ResetState().

Referenced by createButtonFrame(), Init(), and onOk().

void SMESHGUI_GroupOpDlg::reset ( )
protectedvirtual

Resets state of the dialog, initializes its fields with default value, etc.

Usually called by onApply() slot to reinitialize dialog fields. This virtual method should be redefined in derived class to update its own fileds

Reimplemented in SMESHGUI_DimGroupDlg, SMESHGUI_CutGroupsDlg, SMESHGUI_IntersectGroupsDlg, and SMESHGUI_UnionGroupsDlg.

References myNameEdit, and setDefaultGroupColor().

Referenced by reject(), SMESHGUI_UnionGroupsDlg::reset(), SMESHGUI_IntersectGroupsDlg::reset(), SMESHGUI_CutGroupsDlg::reset(), and SMESHGUI_DimGroupDlg::reset().

void SMESHGUI_GroupOpDlg::setDefaultGroupColor ( )
protected

Set default color for group.

References SMESH::GetColor(), and myColorBtn.

Referenced by Init(), and reset().

void SMESHGUI_GroupOpDlg::setHelpFileName ( const QString &  theFName)
protected
void SMESHGUI_GroupOpDlg::setIsApplyAndClose ( const bool  theFlag)
protected

Set value of the flag indicating that the dialog is accepted by Apply & Close button.

Parameters
theFlagvalue of the flag
See Also
isApplyAndClose()

References myIsApplyAndClose.

Referenced by onOk().

void SMESHGUI_GroupOpDlg::setName ( const QString &  theName)
protected

Sets name of group to be created.

Parameters
theNamename of group to be created
See Also
getName()

References myNameEdit.

void SMESHGUI_GroupOpDlg::setVisible ( bool  visible)
protectedvirtualslot

Calls onSelectionDone() and setVisible() method of base class.

Parameters
visiblethe visible state of the dialog

References onSelectionDone().

Field Documentation

QPushButton* SMESHGUI_GroupOpDlg::myApplyBtn
private

Referenced by createButtonFrame().

QGroupBox* SMESHGUI_GroupOpDlg::myArgGrp
private

Referenced by createMainFrame(), and getArgGrp().

QPushButton* SMESHGUI_GroupOpDlg::myCloseBtn
private

Referenced by createButtonFrame().

QtxColorButton* SMESHGUI_GroupOpDlg::myColorBtn
private
QPushButton* SMESHGUI_GroupOpDlg::myHelpBtn
private

Referenced by createButtonFrame().

QString SMESHGUI_GroupOpDlg::myHelpFileName
private

Referenced by onHelp(), and setHelpFileName().

bool SMESHGUI_GroupOpDlg::myIsApplyAndClose
private
QLineEdit* SMESHGUI_GroupOpDlg::myNameEdit
private
QPushButton* SMESHGUI_GroupOpDlg::myOkBtn
private

Referenced by createButtonFrame().

LightApp_SelectionMgr* SMESHGUI_GroupOpDlg::mySelectionMgr
private
SVTK_Selector* SMESHGUI_GroupOpDlg::mySelector
private
SMESHGUI* SMESHGUI_GroupOpDlg::mySMESHGUI
private