Operator to check and modify mesh computation submesh priority (order) More...
#include <SMESHGUI_MeshOrderOp.h>

Public Member Functions | |
| SMESHGUI_MeshOrderOp () | |
| Constructor. | |
| virtual | ~SMESHGUI_MeshOrderOp () |
| Destructor. | |
Protected Slots | |
| virtual bool | onApply () |
| Apply changes. | |
| virtual void | onCancel () |
| Apply changes. | |
| virtual void | onOk () |
| void | onHelp () |
Protected Member Functions | |
| virtual LightApp_Dialog * | dlg () const |
| Return operation dialog. | |
| virtual void | startOperation () |
| perform it's intention action: compute 2D mesh on 3D | |
| virtual void | initDialog () |
| sets the dialog widgets to state just after operation start | |
| 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 |
Private Attributes | |
| SMESHGUI_MeshOrderDlg * | myDlg |
| SMESHGUI_MeshOrderMgr * | myMgr |
Operator to check and modify mesh computation submesh priority (order)
Definition at line 68 of file SMESHGUI_MeshOrderOp.h.
| SMESHGUI_MeshOrderOp::SMESHGUI_MeshOrderOp | ( | ) |
Constructor.
Definition at line 50 of file SMESHGUI_MeshOrderOp.cxx.
References myDlg, and SMESHGUI_Operation.myHelpFileName.
: SMESHGUI_Operation(), myDlg(0), myMgr(0) { myDlg = new SMESHGUI_MeshOrderDlg( desktop() ); myHelpFileName = "constructing_meshes_page.html#mesh_order_anchor"; }
| SMESHGUI_MeshOrderOp::~SMESHGUI_MeshOrderOp | ( | ) | [virtual] |
| SMESHGUI_Operation._PTR | ( | Study | ) | const [protected, inherited] |
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().
| LightApp_Dialog * SMESHGUI_MeshOrderOp::dlg | ( | ) | const [protected, virtual] |
Return operation dialog.
Definition at line 74 of file SMESHGUI_MeshOrderOp.cxx.
References myDlg.
{
return myDlg;
}
| SMESHGUI * SMESHGUI_Operation::getSMESHGUI | ( | ) | const [protected, inherited] |
Definition at line 70 of file SMESHGUI_Operation.cxx.
Referenced by SMESHGUI_BaseComputeOp.computeMesh(), SMESHGUI_BaseComputeOp.evaluateMesh(), SMESHGUI_Operation.isReadyToStart(), SMESHGUI_MeshOp.onGeomSelectionByMesh(), SMESHGUI_Operation.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_MeshOrderOp::initDialog | ( | ) | [protected, virtual] |
sets the dialog widgets to state just after operation start
Init dialog and mesh order box.
Reimplemented from SMESHGUI_Operation.
Definition at line 98 of file SMESHGUI_MeshOrderOp.cxx.
References SMESH.GetMeshByIO(), SMESHGUI_MeshOrderMgr.GetMeshOrder(), SMESHGUI_MeshOrderDlg.GetMeshOrderBox(), myDlg, myMgr, onCancel(), and SMESHGUI_MeshOrderMgr.SetMesh().
{
if (!myDlg )
return;
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil();
// check selection
LightApp_SelectionMgr *Sel = selectionMgr();
SALOME_ListIO selected; Sel->selectedObjects( selected );
if (selected.Extent() == 1)
aMesh = SMESH::GetMeshByIO(selected.First());
if (aMesh->_is_nil()) {
SUIT_MessageBox::warning(desktop(),
tr("SMESH_WRN_WARNING"),
tr("SMESH_WRN_NO_AVAILABLE_DATA"));
onCancel();
return;
}
myMgr = new SMESHGUI_MeshOrderMgr( myDlg->GetMeshOrderBox() );
myMgr->SetMesh( aMesh );
if ( !myMgr->GetMeshOrder() ) {
SUIT_MessageBox::information(desktop(),
tr("SMESH_INFORMATION"),
tr("SMESH_NO_CONCURENT_MESH"));
onCancel();
return;
}
}
| bool SMESHGUI_Operation::isApplyAndClose | ( | ) | const [protected, virtual, inherited] |
Definition at line 234 of file SMESHGUI_Operation.cxx.
References SMESHGUI_Operation.myIsApplyAndClose.
Referenced by SMESHGUI_MeshOp.onApply(), SMESHGUI_Make2DFrom3DOp.onApply(), and SMESHGUI_GroupOnShapeOp.onApply().
{
return myIsApplyAndClose;
}
| bool SMESHGUI_Operation::isReadyToStart | ( | ) | const [protected, virtual, inherited] |
Definition at line 115 of file SMESHGUI_Operation.cxx.
References SMESHGUI_Operation.getSMESHGUI(), and SMESHGUI_Operation.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 SMESHGUI_Operation.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, inherited] |
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_MeshOrderOp::onApply | ( | ) | [protected, virtual, slot] |
Apply changes.
Reimplemented from SMESHGUI_Operation.
Definition at line 136 of file SMESHGUI_MeshOrderOp.cxx.
References SMESHGUI.Modified(), myMgr, SMESH_AdvancedEditor.res, and SMESHGUI_MeshOrderMgr.SetMeshOrder().
{
SUIT_OverrideCursor aWaitCursor;
bool res = myMgr ? myMgr->SetMeshOrder() : false;
if( res )
SMESHGUI::Modified();
delete myMgr;
myMgr = 0;
return res;
}
| void SMESHGUI_MeshOrderOp::onCancel | ( | ) | [protected, virtual, slot] |
Apply changes.
Reimplemented from SMESHGUI_Operation.
Definition at line 156 of file SMESHGUI_MeshOrderOp.cxx.
References myMgr.
Referenced by initDialog().
| void SMESHGUI_Operation::onHelp | ( | ) | [protected, slot, inherited] |
Definition at line 191 of file SMESHGUI_Operation.cxx.
References SMESHGUI_Operation.getSMESHGUI(), and SMESHGUI_Operation.myHelpFileName.
Referenced by SMESHGUI_Operation.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, inherited] |
Definition at line 159 of file SMESHGUI_Operation.cxx.
References SMESHGUI_Operation.onApply(), and SMESHGUI_Operation.setIsApplyAndClose().
Referenced by SMESHGUI_Operation.startOperation(), and SMESHGUI_PrecomputeOp.startOperation().
{
setIsApplyAndClose( true );
if( onApply() )
commit();
setIsApplyAndClose( false );
//else
// abort();
}
| void SMESHGUI_Operation::setDialogActive | ( | const bool | active | ) | [protected, virtual, inherited] |
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, inherited] |
Definition at line 224 of file SMESHGUI_Operation.cxx.
References SMESHGUI_Operation.myIsApplyAndClose.
Referenced by SMESHGUI_Operation.onOk().
{
myIsApplyAndClose = theFlag;
}
| void SMESHGUI_MeshOrderOp::startOperation | ( | ) | [protected, virtual] |
perform it's intention action: compute 2D mesh on 3D
Reimplemented from SMESHGUI_Operation.
Definition at line 85 of file SMESHGUI_MeshOrderOp.cxx.
References myDlg, myMgr, and SMESHGUI_Dialog.show().
{
SMESHGUI_Operation::startOperation();
if (myMgr)
myDlg->show();
}
SMESHGUI_MeshOrderDlg* SMESHGUI_MeshOrderOp.myDlg [private] |
Definition at line 89 of file SMESHGUI_MeshOrderOp.h.
Referenced by dlg(), initDialog(), SMESHGUI_MeshOrderOp(), and startOperation().
QString SMESHGUI_Operation.myHelpFileName [protected, inherited] |
Definition at line 74 of file SMESHGUI_Operation.h.
Referenced by SMESHGUI_Operation.onHelp(), SMESHGUI_BaseComputeOp.SMESHGUI_BaseComputeOp(), SMESHGUI_FindElemByPointOp.SMESHGUI_FindElemByPointOp(), SMESHGUI_GroupOnShapeOp.SMESHGUI_GroupOnShapeOp(), SMESHGUI_MakeNodeAtPointOp.SMESHGUI_MakeNodeAtPointOp(), SMESHGUI_MeshOrderOp(), SMESHGUI_Operation.SMESHGUI_Operation(), SMESHGUI_PrecomputeOp.SMESHGUI_PrecomputeOp(), SMESHGUI_MeshOp.startOperation(), SMESHGUI_Make2DFrom3DOp.startOperation(), and SMESHGUI_ConvToQuadOp.startOperation().
bool SMESHGUI_Operation.myIsApplyAndClose [protected, inherited] |
Definition at line 75 of file SMESHGUI_Operation.h.
Referenced by SMESHGUI_Operation.isApplyAndClose(), and SMESHGUI_Operation.setIsApplyAndClose().
SMESHGUI_MeshOrderMgr* SMESHGUI_MeshOrderOp.myMgr [private] |
Definition at line 90 of file SMESHGUI_MeshOrderOp.h.
Referenced by initDialog(), onApply(), onCancel(), and startOperation().