From: dmv Date: Thu, 3 Dec 2009 12:31:27 +0000 (+0000) Subject: IPAL21493 Incorrect behaviour of Computation, Evaluation succeed dialog boxes in... X-Git-Tag: V6_0_0~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2ed875d56d133c56ca7cd9d68504a2c12c94120b;p=modules%2Fsmesh.git IPAL21493 Incorrect behaviour of Computation, Evaluation succeed dialog boxes in consecutive operations. --- diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 9b37f7b2d..34f6ed0d9 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3406,6 +3406,13 @@ bool SMESHGUI::isSelectionCompatible() 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 res = SalomeApp_Module::activateModule( study ); diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index f6960a481..66ac986ec 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -150,6 +150,8 @@ protected: virtual bool isSelectionCompatible(); + virtual bool reusableOperation( const int id ); + private: void OnEditDelete(); int addVtkFontPref( const QString& label, diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 600427081..43bd2cdc9 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -616,6 +616,15 @@ SMESHGUI_BaseComputeOp::SMESHGUI_BaseComputeOp() 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 @@ -1171,6 +1180,23 @@ void SMESHGUI_ComputeOp::startOperation() computeMesh(); } +//================================================================================ +/*! + * \brief check the same operations on the same mesh + */ +//================================================================================ + +bool SMESHGUI_BaseComputeOp::isValid( SUIT_Operation* theOp ) const +{ + SMESHGUI_BaseComputeOp* baseOp = dynamic_cast( 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 diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.h b/src/SMESHGUI/SMESHGUI_ComputeDlg.h index 858cb0b48..bc979d3fa 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.h +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.h @@ -72,6 +72,8 @@ public: SMESHGUI_BaseComputeOp(); virtual ~SMESHGUI_BaseComputeOp(); + SMESH::SMESH_Mesh_ptr getMesh(); + protected: virtual void startOperation(); virtual void stopOperation(); @@ -91,6 +93,8 @@ protected: SMESH::compute_error_array_var&, const bool, const QString&); + + virtual bool isValid( SUIT_Operation* theOp ) const; protected slots: virtual bool onApply();