]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To move Holder dependant factory methods to Factory header file
authorapo <apo@opencascade.com>
Mon, 27 Nov 2006 07:01:23 +0000 (07:01 +0000)
committerapo <apo@opencascade.com>
Mon, 27 Nov 2006 07:01:23 +0000 (07:01 +0000)
src/VISUGUI/VisuGUI_CacheDlg.h
src/VISUGUI/VisuGUI_Prs3dTools.h
src/VISU_I/VISU_ColoredPrs3dCache_i.cc
src/VISU_I/VISU_ColoredPrs3dCache_i.hh
src/VISU_I/VISU_ColoredPrs3dFactory.cc
src/VISU_I/VISU_ColoredPrs3dFactory.hh

index aea2afe664777fa914f2e1450ed7631dada7686e..77e51ad9a6a005a0e815680744af8c309dc7fef6 100644 (file)
@@ -35,11 +35,6 @@ class QSpinBox;
 
 class SalomeApp_Module;
 
-namespace VISU
-{
-  class ColoredPrs3dCache_i;
-}
-
 class VisuGUI_CacheDlg : public QDialog
 {
   Q_OBJECT
index f602972225c0a5920623011a9ac9636a4864771a..203064993ddfd181b4fa882c4b2a6a1ae67d934c 100644 (file)
@@ -32,7 +32,6 @@
 #include "VisuGUI_Tools.h"
 #include "VisuGUI_ViewTools.h"
 #include "VISU_ColoredPrs3dFactory.hh"
-#include "VISU_ColoredPrs3dCache_i.hh"
 
 #include <vtkRenderer.h>
 
index 5a18f0be302c0b8327253ef229313f2ae4ddf7c0..61c8c4a3d912ca870b428b6f3d0e0843ae30ae03 100644 (file)
@@ -277,39 +277,6 @@ VISU::ColoredPrs3dCache_i
   return this;
 }
 
-//----------------------------------------------------------------------------
-VISU::ColoredPrs3d_i*
-VISU::
-CreateHolder2GetDeviceByEnum(VISU::VISUType theType,
-                            VISU::Result_ptr theResult, 
-                            const std::string& theMeshName, 
-                            VISU::Entity theEntity,
-                            const std::string& theFieldName, 
-                            CORBA::Long theIteration)
-{
-  VISU::ColoredPrs3d_i* aColoredPrs3d = NULL;
-  if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
-    VISU::ColoredPrs3dHolder::BasicInput anInput;
-    anInput.myResult = VISU::Result::_duplicate(theResult);
-    anInput.myMeshName = theMeshName.c_str();
-    anInput.myEntity = theEntity;
-    anInput.myFieldName = theFieldName.c_str();
-    anInput.myTimeStampNumber = theIteration;
-
-    SALOMEDS::Study_var aStudy = aResult->GetStudyDocument();
-    VISU::ColoredPrs3dCache_var aCache = ColoredPrs3dCache_i::GetInstance(aStudy);
-    VISU::ColoredPrs3dHolder_var aHolder = aCache->CreateHolder(theType, anInput);
-
-    if( CORBA::is_nil(aHolder) )
-      return NULL;
-
-    VISU::ColoredPrs3d_var aPrs3d = aHolder->GetDevice();
-    aColoredPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(GetServant(aPrs3d).in());
-  }
-  return aColoredPrs3d;
-}
-
-    
 //----------------------------------------------------------------------------
 VISU::ColoredPrs3d_i*
 VISU::ColoredPrs3dCache_i
index 4eb1f3cbe044405cece63a19d1e71e14de93e0f2..2c3d32d50fe5b21b9d00d3d4e01b91fd1f771bb3 100644 (file)
@@ -173,38 +173,8 @@ namespace VISU
     static const std::string myComment;
   };
 
+
   //----------------------------------------------------------------------------
-  //! Creates ColoredPrs3dHolder by enumeration value and gets its first device
-  ColoredPrs3d_i*
-  CreateHolder2GetDeviceByEnum(VISU::VISUType theType,
-                              VISU::Result_ptr theResult, 
-                              const std::string& theMeshName, 
-                              VISU::Entity theEntity,
-                              const std::string& theFieldName, 
-                              CORBA::Long theIteration);
-    
-  
-  //----------------------------------------------------------------------------
-  //! Creates ColoredPrs3dHolder by type and gets its first device
-  template<class TColoredPrs3d_i> 
-  TColoredPrs3d_i*
-  CreateHolder2GetDeviceByType(VISU::Result_ptr theResult, 
-                              const std::string& theMeshName, 
-                              VISU::Entity theEntity,
-                              const std::string& theFieldName, 
-                              CORBA::Long theIteration)
-  {
-    typedef typename TL::TColoredType2Enum<TColoredPrs3d_i>::TResult TEnum;
-    VISU::VISUType aColoredPrs3dType = VISU::VISUType(TEnum::value);
-    ColoredPrs3d_i* aColoredPrs3d = CreateHolder2GetDeviceByEnum(aColoredPrs3dType,
-                                                                theResult, 
-                                                                theMeshName, 
-                                                                theEntity,
-                                                                theFieldName, 
-                                                                theIteration);
-    return dynamic_cast<TColoredPrs3d_i*>(aColoredPrs3d);
-  }
-    
 }
 
 #endif
index 456d5ea59195f4c70234c6c301975fa7c42ceff8..4c5afcc50f6efd0856d815b3f21ca821febf2d66 100644 (file)
@@ -25,6 +25,7 @@
 //  Module : VISU
 
 #include "VISU_ColoredPrs3dFactory.hh"
+#include "VISU_ColoredPrs3dCache_i.hh"
 
 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
 #define NO_CAS_CATCH
@@ -129,5 +130,39 @@ namespace VISU
     }
     return NULL;
   }
+
+
+  //----------------------------------------------------------------------------
+  VISU::ColoredPrs3d_i*
+  CreateHolder2GetDeviceByEnum(VISU::VISUType theType,
+                              VISU::Result_ptr theResult, 
+                              const std::string& theMeshName, 
+                              VISU::Entity theEntity,
+                              const std::string& theFieldName, 
+                              CORBA::Long theIteration)
+  {
+    VISU::ColoredPrs3d_i* aColoredPrs3d = NULL;
+    if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
+      VISU::ColoredPrs3dHolder::BasicInput anInput;
+      anInput.myResult = VISU::Result::_duplicate(theResult);
+      anInput.myMeshName = theMeshName.c_str();
+      anInput.myEntity = theEntity;
+      anInput.myFieldName = theFieldName.c_str();
+      anInput.myTimeStampNumber = theIteration;
+      
+      SALOMEDS::Study_var aStudy = aResult->GetStudyDocument();
+      VISU::ColoredPrs3dCache_var aCache = ColoredPrs3dCache_i::GetInstance(aStudy);
+      VISU::ColoredPrs3dHolder_var aHolder = aCache->CreateHolder(theType, anInput);
+      
+      if( CORBA::is_nil(aHolder) )
+       return NULL;
+      
+      VISU::ColoredPrs3d_var aPrs3d = aHolder->GetDevice();
+      aColoredPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(GetServant(aPrs3d).in());
+    }
+    return aColoredPrs3d;
+  }
+  
+  
   //----------------------------------------------------------------------------
 }
index 3dac4d9415f65471749faedf70cca15e2a7ab144..b631d479e81d6cf58a5a0c549974f2c5287ff936 100644 (file)
@@ -244,6 +244,41 @@ namespace VISU
     typedef typename TPrs3d_i::TInterface TPrs3d;
     return TPrs3d::_nil();
   }
+
+
+  //----------------------------------------------------------------------------
+  //! Creates ColoredPrs3dHolder by enumeration value and gets its first device
+  ColoredPrs3d_i*
+  CreateHolder2GetDeviceByEnum(VISU::VISUType theType,
+                              VISU::Result_ptr theResult, 
+                              const std::string& theMeshName, 
+                              VISU::Entity theEntity,
+                              const std::string& theFieldName, 
+                              CORBA::Long theTimeStampNumber);
+    
+  
+  //----------------------------------------------------------------------------
+  //! Creates ColoredPrs3dHolder by type and gets its first device
+  template<class TColoredPrs3d_i> 
+  TColoredPrs3d_i*
+  CreateHolder2GetDeviceByType(VISU::Result_ptr theResult, 
+                              const std::string& theMeshName, 
+                              VISU::Entity theEntity,
+                              const std::string& theFieldName, 
+                              CORBA::Long theTimeStampNumber)
+  {
+    typedef typename TL::TColoredType2Enum<TColoredPrs3d_i>::TResult TEnum;
+    VISU::VISUType aColoredPrs3dType = VISU::VISUType(TEnum::value);
+    ColoredPrs3d_i* aColoredPrs3d = CreateHolder2GetDeviceByEnum(aColoredPrs3dType,
+                                                                theResult, 
+                                                                theMeshName, 
+                                                                theEntity,
+                                                                theFieldName, 
+                                                                theTimeStampNumber);
+    return dynamic_cast<TColoredPrs3d_i*>(aColoredPrs3d);
+  }
+    
+
   //----------------------------------------------------------------------------
 }