]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
CheckIsPossible() moved to VISU_ColoredPrs3dFactory
authorouv <ouv@opencascade.com>
Tue, 28 Nov 2006 08:39:08 +0000 (08:39 +0000)
committerouv <ouv@opencascade.com>
Tue, 28 Nov 2006 08:39:08 +0000 (08:39 +0000)
src/VISU_I/VISU_ColoredPrs3dCache_i.cc
src/VISU_I/VISU_ColoredPrs3dFactory.cc
src/VISU_I/VISU_ColoredPrs3dFactory.hh

index 7fc1d141b4102f7a0428635e73a037d7929831c0..478c2eee9432933625abd5bd042eefa4ab39311f 100644 (file)
@@ -114,28 +114,6 @@ VISU::ColoredPrs3dCache_i
 }
 
 
-//----------------------------------------------------------------------------
-template<unsigned int colored_prs3d_type_enum> 
-size_t
-CheckIsPossible(const VISU::ColoredPrs3dHolder::BasicInput& theInput,
-               bool theMemoryCheck)
-{
-  VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>( VISU::GetServant(theInput.myResult).in() );
-  std::string aMeshName = theInput.myMeshName.in();
-  VISU::Entity anEntity = theInput.myEntity;
-  std::string aFieldName = theInput.myFieldName.in();
-  CORBA::Long aTimeStampNumber = theInput.myTimeStampNumber;
-
-  typedef typename VISU::TL::TColoredEnum2Type<colored_prs3d_type_enum>::TResult TColoredPrs3d;
-  return TColoredPrs3d::IsPossible(aResult,
-                                  aMeshName,
-                                  anEntity,
-                                  aFieldName,
-                                  aTimeStampNumber,
-                                  theMemoryCheck);
-}
-
-
 //----------------------------------------------------------------------------
 int
 VISU::ColoredPrs3dCache_i
@@ -143,39 +121,8 @@ VISU::ColoredPrs3dCache_i
             const VISU::ColoredPrs3dHolder::BasicInput& theInput)
 {
   //cout << "VISU::ColoredPrs3dCache_i::IsPossible " << endl;
-  size_t aMemory = 0;
-  switch(theType){
-  case TSCALARMAP:
-    aMemory = CheckIsPossible<TSCALARMAP>(theInput, true);
-    break;
-  case TGAUSSPOINTS:
-    aMemory = CheckIsPossible<TGAUSSPOINTS>(theInput, true);
-    break;
-  case TDEFORMEDSHAPE:
-    aMemory = CheckIsPossible<TDEFORMEDSHAPE>(theInput, true);
-    break;
-  case TSCALARMAPONDEFORMEDSHAPE:
-    aMemory = CheckIsPossible<TSCALARMAPONDEFORMEDSHAPE>(theInput, true);
-    break;
-  case TISOSURFACE:
-    aMemory = CheckIsPossible<TISOSURFACE>(theInput, true);
-    break;
-  case TSTREAMLINES:
-    aMemory = CheckIsPossible<TSTREAMLINES>(theInput, true);
-    break;
-  case TPLOT3D:
-    aMemory = CheckIsPossible<TPLOT3D>(theInput, true);
-    break;
-  case TCUTPLANES:
-    aMemory = CheckIsPossible<TCUTPLANES>(theInput, true);
-    break;
-  case TCUTLINES:
-    aMemory = CheckIsPossible<TCUTLINES>(theInput, true);
-    break;
-  case TVECTORS:
-    aMemory = CheckIsPossible<TVECTORS>(theInput, true);
-    break;
-  }
+  size_t aMemory = VISU::CheckIsPossible(theType, theInput, true);
+
   if(aMemory > 0){
     if(GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED){
       CORBA::Float aMemoryUsed = GetMemorySize();
index 4c5afcc50f6efd0856d815b3f21ca821febf2d66..cd6e5148ca4ea76af7cc01c208a84e28c3b17cce 100644 (file)
@@ -164,5 +164,48 @@ namespace VISU
   }
   
   
+  //----------------------------------------------------------------------------
+  size_t
+  CheckIsPossible(VISU::VISUType theType,
+                 const VISU::ColoredPrs3dHolder::BasicInput& theInput,
+                 bool theMemoryCheck)
+  {
+    size_t aMemory = 0;
+    switch(theType){
+    case TSCALARMAP:
+      aMemory = CheckIsPossible<TSCALARMAP>(theInput, theMemoryCheck);
+      break;
+    case TGAUSSPOINTS:
+      aMemory = CheckIsPossible<TGAUSSPOINTS>(theInput, theMemoryCheck);
+      break;
+    case TDEFORMEDSHAPE:
+      aMemory = CheckIsPossible<TDEFORMEDSHAPE>(theInput, theMemoryCheck);
+      break;
+    case TSCALARMAPONDEFORMEDSHAPE:
+      aMemory = CheckIsPossible<TSCALARMAPONDEFORMEDSHAPE>(theInput, theMemoryCheck);
+      break;
+    case TISOSURFACE:
+      aMemory = CheckIsPossible<TISOSURFACE>(theInput, theMemoryCheck);
+      break;
+    case TSTREAMLINES:
+      aMemory = CheckIsPossible<TSTREAMLINES>(theInput, theMemoryCheck);
+      break;
+    case TPLOT3D:
+      aMemory = CheckIsPossible<TPLOT3D>(theInput, theMemoryCheck);
+      break;
+    case TCUTPLANES:
+      aMemory = CheckIsPossible<TCUTPLANES>(theInput, theMemoryCheck);
+      break;
+    case TCUTLINES:
+      aMemory = CheckIsPossible<TCUTLINES>(theInput, theMemoryCheck);
+      break;
+    case TVECTORS:
+      aMemory = CheckIsPossible<TVECTORS>(theInput, theMemoryCheck);
+      break;
+    }
+    return aMemory;
+  }
+
+
   //----------------------------------------------------------------------------
 }
index b631d479e81d6cf58a5a0c549974f2c5287ff936..2f0766e6122df5bc473b436dde1d85a22d6de9fd 100644 (file)
@@ -277,7 +277,35 @@ namespace VISU
                                                                 theTimeStampNumber);
     return dynamic_cast<TColoredPrs3d_i*>(aColoredPrs3d);
   }
+
+  //----------------------------------------------------------------------------
+  //! Check is possible to create ColoredPrs3dHolder with the given input
+  size_t
+  CheckIsPossible(VISU::VISUType theType,
+                 const VISU::ColoredPrs3dHolder::BasicInput& theInput,
+                 bool theMemoryCheck);
     
+  //----------------------------------------------------------------------------
+  //! Check is possible to create ColoredPrs3dHolder with the given input
+  template<unsigned int colored_prs3d_type_enum> 
+  size_t
+  CheckIsPossible(const VISU::ColoredPrs3dHolder::BasicInput& theInput,
+                 bool theMemoryCheck)
+  {
+    VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>( VISU::GetServant(theInput.myResult).in() );
+    std::string aMeshName = theInput.myMeshName.in();
+    VISU::Entity anEntity = theInput.myEntity;
+    std::string aFieldName = theInput.myFieldName.in();
+    CORBA::Long aTimeStampNumber = theInput.myTimeStampNumber;
+
+    typedef typename VISU::TL::TColoredEnum2Type<colored_prs3d_type_enum>::TResult TColoredPrs3d;
+    return TColoredPrs3d::IsPossible(aResult,
+                                    aMeshName,
+                                    anEntity,
+                                    aFieldName,
+                                    aTimeStampNumber,
+                                    theMemoryCheck);
+  }
 
   //----------------------------------------------------------------------------
 }