]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Bug 0020378: Gui of SMESH hypothesis not multi-study ?
authorjfa <jfa@opencascade.com>
Thu, 25 Jun 2009 13:33:45 +0000 (13:33 +0000)
committerjfa <jfa@opencascade.com>
Thu, 25 Jun 2009 13:33:45 +0000 (13:33 +0000)
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
src/SMESHGUI/SMESHGUI_HypothesesUtils.h
src/SMESHGUI/SMESHGUI_MeshOp.cxx
src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx

index 685ebbc35b9e686eb89e0a32616e9c736d09b6db..dc4cd6c452670b1a3cab36145107b70a0b7bc5a0 100644 (file)
@@ -24,7 +24,7 @@
 //  Author : Nicolas REJNERI
 //  Module : SMESH
 //  $Header$
-//
+
 #include "SMESHGUI.h"
 
 #include "SMESH_Client.hxx"
@@ -2017,11 +2017,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         if ( !aHypothesis->_is_nil() )
         {
           CORBA::String_var aHypType = aHypothesis->GetName();
-          SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypType);
-          if (aCreator)
+          // BUG 0020378
+          //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypType);
+          SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(aHypType);
+          if (aCreator) {
             aCreator->edit( aHypothesis.in(), anIObject->getName(), desktop() );
-          else
-          {
+          }
+          else {
             // report error
           }
         }
index 375aaa4e93fef1796e362c1727ec72c3ea718d03..2a0930b7becd627497eb7c3497a2f0b6f2080b85 100644 (file)
@@ -18,7 +18,7 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
+
 #include "SMESHGUI_HypothesesUtils.h"
 
 #include "SMESHGUI.h"
@@ -81,8 +81,9 @@ namespace SMESH{
   THypothesisDataMap myHypothesesMap;
   THypothesisDataMap myAlgorithmsMap;
 
-  typedef map<string,SMESHGUI_GenericHypothesisCreator*> THypCreatorMap;
-  THypCreatorMap myHypCreatorMap;
+  // BUG 0020378
+  //typedef map<string,SMESHGUI_GenericHypothesisCreator*> THypCreatorMap;
+  //THypCreatorMap myHypCreatorMap;
 
   list<HypothesesSet*> myListOfHypothesesSets;
 
@@ -322,24 +323,26 @@ namespace SMESH{
     return false;
   }
 
-  SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator(const char* aHypType)
+  HypothesisCreatorPtr GetHypothesisCreator(const char* aHypType)
   {
     if(MYDEBUG) MESSAGE("Get HypothesisCreator for " << aHypType);
 
     SMESHGUI_GenericHypothesisCreator* aCreator = 0;
 
     // check, if creator for this hypothesis type already exists
-    if (myHypCreatorMap.find(aHypType) != myHypCreatorMap.end()) {
-      aCreator = myHypCreatorMap[aHypType];
-    }
-    else {
+    // BUG 0020378
+    //if (myHypCreatorMap.find(aHypType) != myHypCreatorMap.end()) {
+    //  aCreator = myHypCreatorMap[aHypType];
+    //}
+    //else
+    {
       // 1. Init list of available hypotheses, if needed
       InitAvailableHypotheses();
 
       // 2. Get names of plugin libraries
       HypothesisData* aHypData = GetHypothesisData(aHypType);
       if (!aHypData) 
-        return aCreator;
+        return HypothesisCreatorPtr(aCreator);
       QString aClientLibName = aHypData->ClientLibName;
       QString aServerLibName = aHypData->ServerLibName;
 
@@ -380,7 +383,8 @@ namespace SMESH{
            }
            else {
              // map hypothesis creator to a hypothesis name
-             myHypCreatorMap[aHypType] = aCreator;
+              // BUG 0020378
+             //myHypCreatorMap[aHypType] = aCreator;
            }
          }
        }
@@ -390,7 +394,7 @@ namespace SMESH{
       }
     }
 
-    return aCreator;
+    return HypothesisCreatorPtr(aCreator);
   }
 
 
index e9d2e6e087525453045013ddbf1baf2896370000..58991f63b5cd1b8386909274aff52f4d1c025139 100644 (file)
@@ -24,7 +24,7 @@
 //  Author : Julia DOROVSKIKH
 //  Module : SMESH
 //  $Header$
-//
+
 #ifndef SMESHGUI_HypothesesUtils_HeaderFile
 #define SMESHGUI_HypothesesUtils_HeaderFile
 
 
 #include <vector>
 
+// boost includes
+#include <boost/shared_ptr.hpp>
+
 class HypothesisData;
 class HypothesesSet;
 class SMESHGUI_GenericHypothesisCreator;
 class SALOMEDSClient_SObject;
 class algo_error_array;
 
-namespace SMESH{
+namespace SMESH
+{
+  typedef boost::shared_ptr<SMESHGUI_GenericHypothesisCreator> HypothesisCreatorPtr;
 
   SMESHGUI_EXPORT
   void InitAvailableHypotheses();
@@ -78,7 +83,7 @@ namespace SMESH{
                              const HypothesisData* algo2Data);
 
   SMESHGUI_EXPORT
-  SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator(const char* aHypType);
+  HypothesisCreatorPtr GetHypothesisCreator(const char* aHypType);
 
   SMESHGUI_EXPORT
   SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const char* aHypType,
index 8e8394dfb3e8c79a5089002d03243c9ecd6c686f..56ccb0bdfe3bec103d39a359baef5fbe4f1e382f 100644 (file)
@@ -1023,7 +1023,9 @@ void SMESHGUI_MeshOp::createHypothesis (const int theDim,
     SMESH::CreateHypothesis(theTypeName, aHypName, false);
   } else {
     // Get hypotheses creator client (GUI)
-    SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName);
+    // BUG 0020378
+    //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName);
+    SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(theTypeName);
 
     // Create hypothesis
     if (aCreator) {
@@ -1079,8 +1081,11 @@ void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex )
     return;
 
   CORBA::String_var aTypeName = aHyp->GetName();
-  SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator( aTypeName );
-  if ( aCreator ) {
+  // BUG 0020378
+  //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aTypeName);
+  SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(aTypeName);
+  if ( aCreator )
+  {
     int obj = myDlg->getActiveObject();
     removeCustomFilters(); // Issue 0020170
     myDlg->setEnabled( false );
@@ -1645,11 +1650,14 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim )
         SMESH::CreateHypothesis(aHypName, aHypData->Label, true);
       } else {
         // Get hypotheses creator client (GUI)
-        SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypName);
+        // BUG 0020378
+        //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypName);
+        SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(aHypName);
 
         // Create algorithm
-        if (aCreator)
+        if (aCreator) {
           aCreator->create(true, aHypName, myDlg);
+        }
         else
           SMESH::CreateHypothesis(aHypName, aHypData->Label, true);
       }
index e6b283477aecc99b8f9f57c645502b272819b5b1..81ee42406b1ad32ae1fa5430fba9987644058fca 100644 (file)
@@ -196,8 +196,9 @@ void StdMeshersGUI_LayerDistributionParamWdg::onEdit()
     return;
 
   CORBA::String_var hypType = myHyp->GetName();
-  SMESHGUI_GenericHypothesisCreator*
-    editor = SMESH::GetHypothesisCreator( hypType.in() );
+  // BUG 0020378
+  //SMESHGUI_GenericHypothesisCreator* editor = SMESH::GetHypothesisCreator(hypType.in());
+  SMESH::HypothesisCreatorPtr editor = SMESH::GetHypothesisCreator(hypType.in());
   if ( !editor ) return;
 
   if ( myDlg ) myDlg->hide();