From: ouv Date: Tue, 28 Nov 2006 08:39:08 +0000 (+0000) Subject: CheckIsPossible() moved to VISU_ColoredPrs3dFactory X-Git-Tag: WP1_2_3_05-12-2006_cache_system~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=441cf056cde748823dbb456925c20fdeee5178d8;p=modules%2Fvisu.git CheckIsPossible() moved to VISU_ColoredPrs3dFactory --- diff --git a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc index 7fc1d141..478c2eee 100644 --- a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc @@ -114,28 +114,6 @@ VISU::ColoredPrs3dCache_i } -//---------------------------------------------------------------------------- -template -size_t -CheckIsPossible(const VISU::ColoredPrs3dHolder::BasicInput& theInput, - bool theMemoryCheck) -{ - VISU::Result_i* aResult = dynamic_cast( 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::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(theInput, true); - break; - case TGAUSSPOINTS: - aMemory = CheckIsPossible(theInput, true); - break; - case TDEFORMEDSHAPE: - aMemory = CheckIsPossible(theInput, true); - break; - case TSCALARMAPONDEFORMEDSHAPE: - aMemory = CheckIsPossible(theInput, true); - break; - case TISOSURFACE: - aMemory = CheckIsPossible(theInput, true); - break; - case TSTREAMLINES: - aMemory = CheckIsPossible(theInput, true); - break; - case TPLOT3D: - aMemory = CheckIsPossible(theInput, true); - break; - case TCUTPLANES: - aMemory = CheckIsPossible(theInput, true); - break; - case TCUTLINES: - aMemory = CheckIsPossible(theInput, true); - break; - case TVECTORS: - aMemory = CheckIsPossible(theInput, true); - break; - } + size_t aMemory = VISU::CheckIsPossible(theType, theInput, true); + if(aMemory > 0){ if(GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED){ CORBA::Float aMemoryUsed = GetMemorySize(); diff --git a/src/VISU_I/VISU_ColoredPrs3dFactory.cc b/src/VISU_I/VISU_ColoredPrs3dFactory.cc index 4c5afcc5..cd6e5148 100644 --- a/src/VISU_I/VISU_ColoredPrs3dFactory.cc +++ b/src/VISU_I/VISU_ColoredPrs3dFactory.cc @@ -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(theInput, theMemoryCheck); + break; + case TGAUSSPOINTS: + aMemory = CheckIsPossible(theInput, theMemoryCheck); + break; + case TDEFORMEDSHAPE: + aMemory = CheckIsPossible(theInput, theMemoryCheck); + break; + case TSCALARMAPONDEFORMEDSHAPE: + aMemory = CheckIsPossible(theInput, theMemoryCheck); + break; + case TISOSURFACE: + aMemory = CheckIsPossible(theInput, theMemoryCheck); + break; + case TSTREAMLINES: + aMemory = CheckIsPossible(theInput, theMemoryCheck); + break; + case TPLOT3D: + aMemory = CheckIsPossible(theInput, theMemoryCheck); + break; + case TCUTPLANES: + aMemory = CheckIsPossible(theInput, theMemoryCheck); + break; + case TCUTLINES: + aMemory = CheckIsPossible(theInput, theMemoryCheck); + break; + case TVECTORS: + aMemory = CheckIsPossible(theInput, theMemoryCheck); + break; + } + return aMemory; + } + + //---------------------------------------------------------------------------- } diff --git a/src/VISU_I/VISU_ColoredPrs3dFactory.hh b/src/VISU_I/VISU_ColoredPrs3dFactory.hh index b631d479..2f0766e6 100644 --- a/src/VISU_I/VISU_ColoredPrs3dFactory.hh +++ b/src/VISU_I/VISU_ColoredPrs3dFactory.hh @@ -277,7 +277,35 @@ namespace VISU theTimeStampNumber); return dynamic_cast(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 + size_t + CheckIsPossible(const VISU::ColoredPrs3dHolder::BasicInput& theInput, + bool theMemoryCheck) + { + VISU::Result_i* aResult = dynamic_cast( 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::TResult TColoredPrs3d; + return TColoredPrs3d::IsPossible(aResult, + aMeshName, + anEntity, + aFieldName, + aTimeStampNumber, + theMemoryCheck); + } //---------------------------------------------------------------------------- }