Salome HOME
IPAL21493 Incorrect behaviour of Computation, Evaluation succeed dialog boxes in...
authordmv <dmv@opencascade.com>
Thu, 3 Dec 2009 12:31:27 +0000 (12:31 +0000)
committerdmv <dmv@opencascade.com>
Thu, 3 Dec 2009 12:31:27 +0000 (12:31 +0000)
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI.h
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
src/SMESHGUI/SMESHGUI_ComputeDlg.h

index 9b37f7b2d04d73287e8cb67cb2c80941a9f7e583..34f6ed0d9c806adcc849b015c57fa73201d4d81a 100644 (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 res = SalomeApp_Module::activateModule( study );
 bool SMESHGUI::activateModule( SUIT_Study* study )
 {
   bool res = SalomeApp_Module::activateModule( study );
index f6960a481de9ab267d1e82ae6464e7fd9b63091b..66ac986ec50d2e3fb1a128b40bfe17a52257e7aa 100644 (file)
@@ -150,6 +150,8 @@ protected:
 
   virtual bool                    isSelectionCompatible();
 
 
   virtual bool                    isSelectionCompatible();
 
+  virtual bool                    reusableOperation( const int id ); 
+
 private:
   void                            OnEditDelete();
   int                             addVtkFontPref( const QString& label, 
 private:
   void                            OnEditDelete();
   int                             addVtkFontPref( const QString& label, 
index 60042708182ece6acfc5f87afcd7a7fd97604fb7..43bd2cdc9864517a7669ef9c7ea86e4478f7c6ce 100644 (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
index 858cb0b48f05bb50e5bf628c4683b95123a6add1..bc979d3fa4b273c7f66fcdd64bf5ea062700af9a 100644 (file)
@@ -72,6 +72,8 @@ public:
   SMESHGUI_BaseComputeOp();
   virtual ~SMESHGUI_BaseComputeOp();
 
   SMESHGUI_BaseComputeOp();
   virtual ~SMESHGUI_BaseComputeOp();
 
+  SMESH::SMESH_Mesh_ptr          getMesh();
+
 protected:
   virtual void                   startOperation();
   virtual void                   stopOperation();
 protected:
   virtual void                   startOperation();
   virtual void                   stopOperation();
@@ -91,6 +93,8 @@ protected:
                                                     SMESH::compute_error_array_var&,
                                                     const bool,
                                                     const QString&);
                                                     SMESH::compute_error_array_var&,
                                                     const bool,
                                                     const QString&);
+
+  virtual bool                   isValid( SUIT_Operation* theOp ) const;
     
 protected slots:
   virtual bool                   onApply();
     
 protected slots:
   virtual bool                   onApply();