IPAL21493 Incorrect behaviour of Computation, Evaluation succeed dialog boxes in consecutive operations.

This commit is contained in:
dmv 2009-12-03 12:31:27 +00:00
parent 7ee78f2e75
commit 2ed875d56d
4 changed files with 39 additions and 0 deletions

View File

@ -3406,6 +3406,13 @@ bool SMESHGUI::isSelectionCompatible()
return isCompatible; return isCompatible;
} }
bool SMESHGUI::reusableOperation( const int id )
{
// compute, evaluate and precompute are not reusable operations
return ( id == 701 || id == 711 || id == 712 ) ? false : SalomeApp_Module::reusableOperation( id );
}
bool SMESHGUI::activateModule( SUIT_Study* study ) bool SMESHGUI::activateModule( SUIT_Study* study )
{ {
bool res = SalomeApp_Module::activateModule( study ); bool res = SalomeApp_Module::activateModule( study );

View File

@ -150,6 +150,8 @@ protected:
virtual bool isSelectionCompatible(); virtual bool isSelectionCompatible();
virtual bool reusableOperation( const int id );
private: private:
void OnEditDelete(); void OnEditDelete();
int addVtkFontPref( const QString& label, int addVtkFontPref( const QString& label,

View File

@ -616,6 +616,15 @@ SMESHGUI_BaseComputeOp::SMESHGUI_BaseComputeOp()
myHelpFileName = "about_meshes_page.html"; // V4 myHelpFileName = "about_meshes_page.html"; // V4
} }
SMESH::SMESH_Mesh_ptr SMESHGUI_BaseComputeOp::getMesh()
{
LightApp_SelectionMgr* Sel = selectionMgr();
SALOME_ListIO selected; Sel->selectedObjects( selected );
Handle(SALOME_InteractiveObject) anIO = selected.First();
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(anIO);
return myMesh->_is_nil() ? aMesh._retn() : SMESH::SMESH_Mesh::_duplicate( myMesh );
}
//================================================================================ //================================================================================
/*! /*!
* \brief Start operation * \brief Start operation
@ -1171,6 +1180,23 @@ void SMESHGUI_ComputeOp::startOperation()
computeMesh(); computeMesh();
} }
//================================================================================
/*!
* \brief check the same operations on the same mesh
*/
//================================================================================
bool SMESHGUI_BaseComputeOp::isValid( SUIT_Operation* theOp ) const
{
SMESHGUI_BaseComputeOp* baseOp = dynamic_cast<SMESHGUI_BaseComputeOp*>( theOp );
bool ret = true;
if ( !myMesh->_is_nil() && baseOp ) {
SMESH::SMESH_Mesh_var aMesh = baseOp->getMesh();
if ( !aMesh->_is_nil() && aMesh->GetId() == myMesh->GetId() ) ret = false;
}
return ret;
}
//================================================================================ //================================================================================
/*! /*!
* \brief Gets dialog of this operation * \brief Gets dialog of this operation

View File

@ -72,6 +72,8 @@ public:
SMESHGUI_BaseComputeOp(); SMESHGUI_BaseComputeOp();
virtual ~SMESHGUI_BaseComputeOp(); virtual ~SMESHGUI_BaseComputeOp();
SMESH::SMESH_Mesh_ptr getMesh();
protected: protected:
virtual void startOperation(); virtual void startOperation();
virtual void stopOperation(); virtual void stopOperation();
@ -91,6 +93,8 @@ protected:
SMESH::compute_error_array_var&, SMESH::compute_error_array_var&,
const bool, const bool,
const QString&); const QString&);
virtual bool isValid( SUIT_Operation* theOp ) const;
protected slots: protected slots:
virtual bool onApply(); virtual bool onApply();