#include <SMESHGUI_Operation.h>

Public Member Functions | |
| SMESHGUI_Operation () | |
| virtual | ~SMESHGUI_Operation () |
Protected Slots | |
| virtual void | onOk () |
| virtual bool | onApply () |
| virtual void | onCancel () |
| void | onHelp () |
Protected Member Functions | |
| virtual void | initDialog () |
| sets the dialog widgets to state just after operation start | |
| virtual void | startOperation () |
| virtual bool | isReadyToStart () const |
| virtual void | setIsApplyAndClose (const bool theFlag) |
| virtual bool | isApplyAndClose () const |
| virtual void | setDialogActive (const bool) |
| Set according dialog active or inactive. | |
| SMESHGUI * | getSMESHGUI () const |
| bool | isStudyLocked (const bool=true) const |
| Verifies whether study of operation is locked. | |
| _PTR (Study) studyDS() const | |
| virtual bool | isValid (SUIT_Operation *) const |
| Verifies whether given operator is valid for this one. | |
Protected Attributes | |
| QString | myHelpFileName |
| bool | myIsApplyAndClose |
Definition at line 46 of file SMESHGUI_Operation.h.
| SMESHGUI_Operation::SMESHGUI_Operation | ( | ) |
Definition at line 51 of file SMESHGUI_Operation.cxx.
References myHelpFileName.
: LightApp_Operation(), myIsApplyAndClose( false ) { myHelpFileName = ""; }
| SMESHGUI_Operation::~SMESHGUI_Operation | ( | ) | [virtual] |
Definition at line 62 of file SMESHGUI_Operation.cxx.
{
}
| SMESHGUI_Operation._PTR | ( | Study | ) | const [protected] |
Referenced by SMESHGUI_ShapeByMeshOp.commitOperation(), SMESHGUI_Make2DFrom3DOp.compute2DMesh(), SMESHGUI_BaseComputeOp.computeMesh(), SMESHGUI_ConvToQuadOp.ConnectRadioButtons(), SMESHGUI_BaseComputeOp.evaluateMesh(), SMESHGUI_PrecomputeOp.getAssignedAlgos(), SMESHGUI_PrecomputeOp.initDialog(), SMESHGUI_Make2DFrom3DOp.isValid(), SMESHGUI_GroupOnShapeOp.onApply(), SMESHGUI_ConvToQuadOp.onApply(), SMESHGUI_PrecomputeOp.onPreview(), SMESHGUI_FindElemByPointOp.onSelectionDone(), SMESHGUI_SelectionOp.selected(), SMESHGUI_Make2DFrom3DOp.selectionDone(), SMESHGUI_GroupOnShapeOp.selectionDone(), SMESHGUI_ConvToQuadOp.selectionDone(), SMESHGUI_ShapeByMeshOp.SetMesh(), and SMESHGUI_SelectionOp.typeById().
| SMESHGUI * SMESHGUI_Operation::getSMESHGUI | ( | ) | const [protected] |
Definition at line 70 of file SMESHGUI_Operation.cxx.
Referenced by SMESHGUI_BaseComputeOp.computeMesh(), SMESHGUI_BaseComputeOp.evaluateMesh(), isReadyToStart(), SMESHGUI_MeshOp.onGeomSelectionByMesh(), onHelp(), SMESHGUI_PrecomputeOp.onPreview(), SMESHGUI_BaseComputeOp.onPublishShape(), SMESHGUI_BaseComputeOp.onShowBadMesh(), SMESHGUI_MakeNodeAtPointOp.startOperation(), SMESHGUI_FindElemByPointOp.startOperation(), and SMESHGUI_SelectionOp.viewWindow().
{
return dynamic_cast<SMESHGUI*>( module() );
}
| void SMESHGUI_Operation::initDialog | ( | ) | [protected, virtual] |
sets the dialog widgets to state just after operation start
Reimplemented in SMESHGUI_PrecomputeOp, SMESHGUI_MeshOrderOp, and SMESHGUI_SelectionOp.
Definition at line 215 of file SMESHGUI_Operation.cxx.
Referenced by startOperation().
{
}
| bool SMESHGUI_Operation::isApplyAndClose | ( | ) | const [protected, virtual] |
Definition at line 234 of file SMESHGUI_Operation.cxx.
References myIsApplyAndClose.
Referenced by SMESHGUI_MeshOp.onApply(), SMESHGUI_Make2DFrom3DOp.onApply(), and SMESHGUI_GroupOnShapeOp.onApply().
{
return myIsApplyAndClose;
}
| bool SMESHGUI_Operation::isReadyToStart | ( | ) | const [protected, virtual] |
Definition at line 115 of file SMESHGUI_Operation.cxx.
References getSMESHGUI(), and isStudyLocked().
{
if ( !LightApp_Operation::isReadyToStart() )
return false;
else if ( getSMESHGUI() == 0 )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
tr( "NO_MODULE" ) );
return false;
}
else if ( isStudyLocked() )
return false;
return true;
}
Verifies whether study of operation is locked.
| theMess | - specifies whether message box must be shown if study is locked |
Verifies whether study of operation is locked. If second parameter is TRUE and study is locked when corresponding message box appears
Definition at line 247 of file SMESHGUI_Operation.cxx.
References SMESHGUI.desktop().
Referenced by isReadyToStart(), SMESHGUI_MeshOp.onApply(), SMESHGUI_MakeNodeAtPointOp.onApply(), SMESHGUI_Make2DFrom3DOp.onApply(), and SMESHGUI_GroupOnShapeOp.onApply().
{
if ( studyDS() )
{
if ( studyDS()->GetProperties()->IsLocked() )
{
if ( theMess )
SUIT_MessageBox::warning( SMESHGUI::desktop(), tr( "WRN_WARNING" ),
tr( "WRN_STUDY_LOCKED" ) );
return true;
}
}
return false;
}
| bool SMESHGUI_Operation::isValid | ( | SUIT_Operation * | theOtherOp | ) | const [protected, virtual] |
Verifies whether given operator is valid for this one.
| theOtherOp | - other operation |
Virtual method redefined from base class verifies whether given operator is valid for this one (i.e. can be started "above" this operator). In current implementation method retuns false if theOtherOp operation is not intended for deleting objects or mesh elements.
Reimplemented in SMESHGUI_BaseComputeOp, and SMESHGUI_MeshOp.
Definition at line 273 of file SMESHGUI_Operation.cxx.
{
static QStringList anOps;
if ( anOps.count() == 0 )
{
anOps.append( "SMESHGUI_DeleteOp" );
// to do add other operations here
}
return ( theOtherOp &&
( ( theOtherOp->inherits("SMESHGUI_Operation") && ( !anOps.contains(theOtherOp->metaObject()->className() ) || anOps.contains(metaObject()->className()) ) ) ||
( theOtherOp->inherits("LightApp_ShowHideOp") ) ) );
return true;
}
| bool SMESHGUI_Operation::onApply | ( | ) | [protected, virtual, slot] |
Reimplemented in SMESHGUI_BaseComputeOp, SMESHGUI_ConvToQuadOp, SMESHGUI_FindElemByPointOp, SMESHGUI_GroupOnShapeOp, SMESHGUI_Make2DFrom3DOp, SMESHGUI_MakeNodeAtPointOp, SMESHGUI_MeshOp, SMESHGUI_MeshOrderOp, and SMESHGUI_ShapeByMeshOp.
Definition at line 173 of file SMESHGUI_Operation.cxx.
Referenced by onOk(), and startOperation().
{
return false;
}
| void SMESHGUI_Operation::onCancel | ( | ) | [protected, virtual, slot] |
Reimplemented in SMESHGUI_PrecomputeOp, and SMESHGUI_MeshOrderOp.
Definition at line 182 of file SMESHGUI_Operation.cxx.
Referenced by startOperation(), and SMESHGUI_BaseComputeOp.startOperation().
{
abort();
}
| void SMESHGUI_Operation::onHelp | ( | ) | [protected, slot] |
Definition at line 191 of file SMESHGUI_Operation.cxx.
References getSMESHGUI(), and myHelpFileName.
Referenced by startOperation(), and SMESHGUI_PrecomputeOp.startOperation().
{
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app)
app->onHelpContextModule(getSMESHGUI() ? app->moduleName(getSMESHGUI()->moduleName()) : QString(""), myHelpFileName);
else {
QString platform;
#ifdef WIN32
platform = "winapplication";
#else
platform = "application";
#endif
SUIT_MessageBox::warning( desktop(), tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName) );
}
}
| void SMESHGUI_Operation::onOk | ( | ) | [protected, virtual, slot] |
Definition at line 159 of file SMESHGUI_Operation.cxx.
References onApply(), and setIsApplyAndClose().
Referenced by startOperation(), and SMESHGUI_PrecomputeOp.startOperation().
{
setIsApplyAndClose( true );
if( onApply() )
commit();
setIsApplyAndClose( false );
//else
// abort();
}
| void SMESHGUI_Operation::setDialogActive | ( | const bool | active | ) | [protected, virtual] |
Set according dialog active or inactive.
Definition at line 135 of file SMESHGUI_Operation.cxx.
References ex13_hole1partial.d, and SMESHGUI_Dialog.setContentActive().
{
LightApp_Operation::setDialogActive( active );
SMESHGUI_Dialog* d = dynamic_cast<SMESHGUI_Dialog*>( dlg() );
if( d )
d->setContentActive( active );
}
| void SMESHGUI_Operation::setIsApplyAndClose | ( | const bool | theFlag | ) | [protected, virtual] |
Definition at line 224 of file SMESHGUI_Operation.cxx.
References myIsApplyAndClose.
Referenced by onOk().
{
myIsApplyAndClose = theFlag;
}
| void SMESHGUI_Operation::startOperation | ( | ) | [protected, virtual] |
Reimplemented in SMESHGUI_BaseComputeOp, SMESHGUI_ComputeOp, SMESHGUI_PrecomputeOp, SMESHGUI_EvaluateOp, SMESHGUI_ConvToQuadOp, SMESHGUI_FindElemByPointOp, SMESHGUI_GroupOnShapeOp, SMESHGUI_Make2DFrom3DOp, SMESHGUI_MakeNodeAtPointOp, SMESHGUI_MeshOp, SMESHGUI_MeshOrderOp, SMESHGUI_SelectionOp, and SMESHGUI_ShapeByMeshOp.
Definition at line 79 of file SMESHGUI_Operation.cxx.
References initDialog(), onApply(), onCancel(), onHelp(), and onOk().
{
if( dlg() )
{
disconnect( dlg(), SIGNAL( dlgOk() ), this, SLOT( onOk() ) );
disconnect( dlg(), SIGNAL( dlgApply() ), this, SLOT( onApply() ) );
disconnect( dlg(), SIGNAL( dlgCancel() ), this, SLOT( onCancel() ) );
disconnect( dlg(), SIGNAL( dlgClose() ), this, SLOT( onCancel() ) );
disconnect( dlg(), SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
if( dlg()->testButtonFlags( QtxDialog::OK ) )
connect( dlg(), SIGNAL( dlgOk() ), this, SLOT( onOk() ) );
if( dlg()->testButtonFlags( QtxDialog::Apply ) )
connect( dlg(), SIGNAL( dlgApply() ), this, SLOT( onApply() ) );
if( dlg()->testButtonFlags( QtxDialog::Cancel ) )
connect( dlg(), SIGNAL( dlgCancel() ), this, SLOT( onCancel() ) );
if( dlg()->testButtonFlags( QtxDialog::Help ) )
connect( dlg(), SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
//if( dlg()->testButtonFlags( QtxDialog::Close ) )
//if dialog hasn't close, cancel, no and etc buttons, dlgClose will be emitted when dialog is closed not by OK
connect( dlg(), SIGNAL( dlgClose() ), this, SLOT( onCancel() ) );
initDialog();
}
LightApp_Operation::startOperation();
}
QString SMESHGUI_Operation.myHelpFileName [protected] |
Definition at line 74 of file SMESHGUI_Operation.h.
Referenced by onHelp(), SMESHGUI_BaseComputeOp.SMESHGUI_BaseComputeOp(), SMESHGUI_FindElemByPointOp.SMESHGUI_FindElemByPointOp(), SMESHGUI_GroupOnShapeOp.SMESHGUI_GroupOnShapeOp(), SMESHGUI_MakeNodeAtPointOp.SMESHGUI_MakeNodeAtPointOp(), SMESHGUI_MeshOrderOp.SMESHGUI_MeshOrderOp(), SMESHGUI_Operation(), SMESHGUI_PrecomputeOp.SMESHGUI_PrecomputeOp(), SMESHGUI_MeshOp.startOperation(), SMESHGUI_Make2DFrom3DOp.startOperation(), and SMESHGUI_ConvToQuadOp.startOperation().
bool SMESHGUI_Operation.myIsApplyAndClose [protected] |
Definition at line 75 of file SMESHGUI_Operation.h.
Referenced by isApplyAndClose(), and setIsApplyAndClose().