]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Bug fixing
authorapo <apo@opencascade.com>
Mon, 27 Nov 2006 06:37:03 +0000 (06:37 +0000)
committerapo <apo@opencascade.com>
Mon, 27 Nov 2006 06:37:03 +0000 (06:37 +0000)
42 files changed:
src/PIPELINE/VISU_PipeLine.cxx
src/PIPELINE/VISU_PipeLine.hxx
src/PIPELINE/VISU_StreamLinesPL.cxx
src/PIPELINE/VISU_StreamLinesPL.hxx
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_CacheDlg.cxx
src/VISUGUI/VisuGUI_Prs3dTools.h
src/VISUGUI/VisuGUI_Slider.cxx
src/VISUGUI/VisuGUI_Slider.h
src/VISUGUI/VisuGUI_Tools.cxx
src/VISUGUI/VisuGUI_Tools.h
src/VISU_I/VISUConfig.hh
src/VISU_I/VISU_ColoredPrs3dCache_i.cc
src/VISU_I/VISU_ColoredPrs3dCache_i.hh
src/VISU_I/VISU_ColoredPrs3dFactory.hh
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_ColoredPrs3d_i.hh
src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_CutLines_i.hh
src/VISU_I/VISU_CutPlanes_i.cc
src/VISU_I/VISU_CutPlanes_i.hh
src/VISU_I/VISU_DeformedShape_i.cc
src/VISU_I/VISU_DeformedShape_i.hh
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_GaussPoints_i.hh
src/VISU_I/VISU_IsoSurfaces_i.cc
src/VISU_I/VISU_IsoSurfaces_i.hh
src/VISU_I/VISU_Mesh_i.cc
src/VISU_I/VISU_Mesh_i.hh
src/VISU_I/VISU_Plot3D_i.cc
src/VISU_I/VISU_Plot3D_i.hh
src/VISU_I/VISU_Result_i.cc
src/VISU_I/VISU_Result_i.hh
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_ScalarMap_i.hh
src/VISU_I/VISU_StreamLines_i.cc
src/VISU_I/VISU_StreamLines_i.hh
src/VISU_I/VISU_TimeAnimation.cxx
src/VISU_I/VISU_Vectors_i.cc
src/VISU_I/VISU_Vectors_i.hh

index 0e7f6fc55aed867a9ca3e1f01aa5249f0973dbba..c4c4cd7559416e1c29adcc2b5a48ea93b9e3f0db 100644 (file)
@@ -188,40 +188,42 @@ VISU_PipeLine
   myMapper->Update();
 }
 
-int
-VISU_PipeLine
-::CheckAvailableMemory(const vtkFloatingPointType& theSize)
-{
-  try{
-    if(theSize > ULONG_MAX) return 0;
-    size_t aSize = size_t(theSize);
-    char *aCheck = new char[aSize];
-    if(aCheck) delete [] aCheck;
-    if(MYDEBUG && aCheck == NULL)
-      MESSAGE("CheckAvailableMemory("<<theSize<<") - cannot alloacate such amount of memory!!!");
-    return aCheck != NULL;
-    //return theSize < 1000*1024*1024;
-  }catch(std::bad_alloc& exc){
-    if(MYDEBUG)
-      MESSAGE("CheckAvailableMemory("<<theSize<<") " << exc.what());
-  } catch(...) {
-    if(MYDEBUG)
-      MESSAGE("CheckAvailableMemory("<<theSize<<") - unexpected exception was caught!!!");
+size_t
+VISU_PipeLine
+::CheckAvailableMemory(size_t theSize)
+{
+  if(theSize < ULONG_MAX){
+    try{
+      if(char *aCheck = new char[theSize]){
+       delete [] aCheck;
+       return theSize;
+      }
+    }catch(std::bad_alloc& exc){
+    }catch(...){
+    }
   }
   return 0;
 }
 
-vtkFloatingPointType
+size_t
 VISU_PipeLine
-::GetAvailableMemory(vtkFloatingPointType theSize, 
-                    vtkFloatingPointType theMinSize)
+::GetAvailableMemory(size_t theSize, 
+                    size_t theMinSize)
 {
-  while(!CheckAvailableMemory(theSize))
-    if(theSize > theMinSize)
-      theSize /= 2;
+  // Finds acceptable memory size by half-deflection methods
+  static size_t EPSILON = 2 * 1024;
+  size_t aMax = std::max(theSize, theMinSize);
+  size_t aMin = std::min(theSize, theMinSize);
+  cout<<"GetAvailableMemory - "<<aMax<<"; "<<aMin;
+  while(CheckAvailableMemory(aMax) == 0 && CheckAvailableMemory(aMin) > 0 && (aMax - aMin) > EPSILON){
+    size_t aRoot = (aMax + aMin) / 2;
+    if(CheckAvailableMemory(aRoot))
+      aMin = aRoot;
     else
-      return 0;
-  return theSize;
+      aMax = aRoot;
+  }
+  cout<<"; "<<aMax<<endl;
+  return aMax;
 }
 
 //------------------------ Clipping planes -----------------------------------
index 0d1ea0574be2f4a349d2f3d83e9905297ffe742a..e10275260d67fea3e7b9c75450c14c3e63bc7556 100644 (file)
@@ -142,13 +142,13 @@ public:
   Update();
 
   static
-  int
-  CheckAvailableMemory(const vtkFloatingPointType& theSize);
+  size_t
+  CheckAvailableMemory(size_t theSize);
   
   static
-  vtkFloatingPointType
-  GetAvailableMemory(vtkFloatingPointType theSize = 16*1024*1024.0,
-                    vtkFloatingPointType theMinSize = 1024*1024.0);
+  size_t
+  GetAvailableMemory(size_t theSize = 16*1024*1024,
+                    size_t theMinSize = 1024*1024);
 
   // Clipping planes
   void 
index b1f7471c04b8d540d5f190538a026d99222f5164..ac9d8c7f9540e89868a5520fecdb5f7551dd3ba0 100644 (file)
@@ -86,7 +86,7 @@ void VISU_StreamLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){
 }
 
 
-vtkFloatingPointType
+size_t
 VISU_StreamLinesPL
 ::GetNecasseryMemorySize(vtkIdType theNbOfPoints, 
                         vtkFloatingPointType theStepLength,
@@ -110,11 +110,11 @@ VISU_StreamLinesPL
   vtkFloatingPointType anAssignedDataSize = aCellsSize*4.0*sizeof(vtkFloatingPointType);
   vtkFloatingPointType anOutputDataSetSize = aMeshSize + anAssignedDataSize;
 
-  vtkFloatingPointType aResult = aStreamArraySize*aNbCells + anOutputDataSetSize;
+  size_t aResult = size_t(aStreamArraySize*aNbCells + anOutputDataSetSize);
   return aResult;
 }
 
-int
+size_t
 VISU_StreamLinesPL
 ::FindPossibleParams(vtkPointSet* theDataSet, 
                     vtkFloatingPointType& theStepLength,
@@ -123,9 +123,9 @@ VISU_StreamLinesPL
 {
   static vtkFloatingPointType aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
   vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
-  vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
-  int isPoss = CheckAvailableMemory(aSize);
-  if(!isPoss){
+  size_t aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
+  size_t anIsPossible = CheckAvailableMemory(aSize);
+  if(!anIsPossible){
     vtkFloatingPointType aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime);
     vtkFloatingPointType aMinStepLength = GetMinStepLength(theDataSet);
     vtkFloatingPointType aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease;
@@ -144,13 +144,13 @@ VISU_StreamLinesPL
       }
       aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
       if(CheckAvailableMemory(aSize)){
-       isPoss = i;
+       anIsPossible = i;
        break;
       }
     }
   }
-  if(MYDEBUG) MESSAGE("FindPossibleParams - aSize = "<<aSize<<"; isPoss = "<<isPoss);
-  return isPoss;
+  if(MYDEBUG) MESSAGE("FindPossibleParams - aSize = "<<aSize<<"; anIsPossible = "<<anIsPossible);
+  return anIsPossible;
 }
 
 
@@ -234,7 +234,7 @@ VISU_StreamLinesPL
 }
 
 
-int
+size_t
 VISU_StreamLinesPL
 ::IsPossible(vtkPointSet* theDataSet, 
             vtkFloatingPointType thePercents)
@@ -245,7 +245,7 @@ VISU_StreamLinesPL
   aPointsFilter->SetInput(theDataSet);
   vtkPointSet* aDataSet = aPointsFilter->GetOutput();
   aDataSet->Update();
-  int aRes = FindPossibleParams(aDataSet,aStepLength,aBasePropTime,thePercents);
+  size_t aRes = FindPossibleParams(aDataSet,aStepLength,aBasePropTime,thePercents);
   aPointsFilter->UnRegisterAllOutputs();
   aPointsFilter->Delete();
   return aRes;
@@ -303,8 +303,8 @@ VISU_StreamLinesPL
   vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet);
   thePercents = 1.0;
   vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
-  vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
-  vtkFloatingPointType aRealSize = GetAvailableMemory(aSize);
+  size_t aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
+  size_t aRealSize = GetAvailableMemory(aSize);
   vtkFloatingPointType anAverageVolume = aVolume / aRealSize;
   vtkFloatingPointType aStep = pow(double(anAverageVolume), double(1.0/double(degree)));
   return aStep;
index 7c020dac23dda544bef424e12aa004051b156cb1..67c6ab3f8ddc32cb92bdf158ea57f20dc833669a 100644 (file)
@@ -187,20 +187,20 @@ public:
   GetVelocityCoeff(vtkPointSet* theDataSet);
 
   static
-  int
+  size_t
   IsPossible(vtkPointSet* theDataSet, 
             vtkFloatingPointType thePercents = 0.3);
 
 protected:
   static 
-  vtkFloatingPointType
+  size_t
   GetNecasseryMemorySize(vtkIdType theNbOfPoints, 
                         vtkFloatingPointType theStepLength, 
                         vtkFloatingPointType thePropogationTime, 
                         vtkFloatingPointType thePercents = 0.3);
 
   static
-  int
+  size_t
   FindPossibleParams(vtkPointSet* theDataSet, 
                     vtkFloatingPointType& theStepLength, 
                     vtkFloatingPointType& thePropogationTime, 
index 4809eeb67460896d7f1cb96af3c97b2329ad3c73..246aa02033319413d1845fef8f44d1abeec47b20 100644 (file)
@@ -87,8 +87,6 @@
 #include "VISU_View_i.hh"
 #include "VISU_ViewManager_i.hh"
 #include "VISU_Plot3D_i.hh"
-#include "VISU_ColoredPrs3dCache_i.hh"
-#include "VISU_ColoredPrs3dHolder_i.hh"
 
 #include "VISU_Actor.h"
 
 #include "VisuGUI_TransparencyDlg.h"
 #include "VisuGUI_CacheDlg.h"
 
-#include "VISU_ColoredPrs3dHolder_i.hh"
-
 #include "VISU_ScalarMap_i.hh"
 #include "VisuGUI_ScalarBarDlg.h"
 
@@ -1698,6 +1694,11 @@ DoSameAs(VISU::Prs3d_i* thePrs3d)
   typedef typename TL::TColoredEnum2Type<colored_prs3d_type_enum>::TResult TColoredPrs3d;
   TColoredPrs3d* aColoredPrs3d = dynamic_cast<TColoredPrs3d*>(thePrs3d);
   TColoredPrs3d* aSameColoredPrs3d = new TColoredPrs3d(VISU::ColoredPrs3d_i::EPublishUnderTimeStamp);
+  aSameColoredPrs3d->SetCResult(aColoredPrs3d->GetCResult());
+  aSameColoredPrs3d->SetMeshName(aColoredPrs3d->GetCMeshName().c_str());
+  aSameColoredPrs3d->SetEntity(aColoredPrs3d->GetEntity());
+  aSameColoredPrs3d->SetFieldName(aColoredPrs3d->GetCFieldName().c_str());
+  aSameColoredPrs3d->SetTimeStampNumber(aColoredPrs3d->GetTimeStampNumber());
   aSameColoredPrs3d->SameAs(aColoredPrs3d);
 }
 
@@ -3307,12 +3308,9 @@ void VisuGUI::OnPlot3dFromCutPlane()
 
 void VisuGUI::OnCacheProperties()
 {
-  CORBA::Object_var anObject = GetSelectedObj( this );
-  if( CORBA::is_nil( anObject ) )
-    return;
-
-  VISU::ColoredPrs3dCache_i* aCache = dynamic_cast<VISU::ColoredPrs3dCache_i*>(VISU::GetServant(anObject).in());
-  if( !aCache )
+  CORBA::Object_var anObject = GetSelectedObj(this);
+  VISU::ColoredPrs3dCache_var aCache = VISU::GetInterface<VISU::ColoredPrs3dCache>(anObject);
+  if( CORBA::is_nil( aCache ) )
     return;
 
   VisuGUI_CacheDlg* aDlg = new VisuGUI_CacheDlg( this,
index 2ee018b5718b17b213cd25cb47bf5891b8246e15..617b083686d5554707f2d0d2a12adca3e217dd3b 100644 (file)
@@ -30,7 +30,6 @@
 #include "VisuGUI_Tools.h"
 
 #include "VISU_PipeLine.hxx"
-#include "VISU_ColoredPrs3dCache_i.hh"
 
 #include "SUIT_Desktop.h"
 #include "SUIT_MessageBox.h"
index 12b5523b08f1f9eacb0fe310353a501b505ae8b2..f602972225c0a5920623011a9ac9636a4864771a 100644 (file)
@@ -28,8 +28,9 @@
 #ifndef VisuGUI_Prs3dTools_HeaderFile
 #define VisuGUI_Prs3dTools_HeaderFile
 
+#include "VISUConfig.hh"
+#include "VisuGUI_Tools.h"
 #include "VisuGUI_ViewTools.h"
-#include "VisuGUI_DialogRunner.h"
 #include "VISU_ColoredPrs3dFactory.hh"
 #include "VISU_ColoredPrs3dCache_i.hh"
 
 
 namespace VISU
 {
-  class ColoredPrs3d_i;
-  class CutLines_i;
-
-  //---------------------------------------------------------------
-  inline
-  int
-  runAndWait( QDialog* dlg, const bool modal )
-  {
-    VisuGUI_DialogRunner r( dlg );
-    return r.run( modal );
-  }
-
   //---------------------------------------------------------------
   template<class TPrs3d_i, class TViewer, class TDlg, int TIsDlgModal>
   void
@@ -301,16 +290,24 @@ namespace VISU
 
 
   //----------------------------------------------------------------------------
-  VISU::Prs3d_i*
-  GetPrs3d(CORBA::Object_ptr theObject)
+  template<typename TInterface> 
+  typename TInterface::_var_type
+  GetInterface(CORBA::Object_ptr theObject)
+  {
+    if(!CORBA::is_nil(theObject))
+      return TInterface::_narrow(theObject);
+    return TInterface::_nil();
+  }
+  
+
+  //----------------------------------------------------------------------------
+  template<typename TServant> 
+  TServant*
+  GetServantInterface(CORBA::Object_ptr theObject)
   {
     if(!CORBA::is_nil(theObject)){
-      VISU::Base_var aBase = VISU::Base::_narrow(theObject);
-      if(!CORBA::is_nil(aBase)){
-       PortableServer::ServantBase_var aServant = VISU::GetServant(aBase);
-       if(aServant.in())
-         return dynamic_cast<VISU::Prs3d_i*>(aServant.in());
-      }
+      PortableServer::ServantBase_var aServant = GetServant(theObject);
+      return dynamic_cast<TServant*>(aServant.in());
     }
     return NULL;
   }
index 25f61d9fbce1f7ec1c8bc14433a4402a31fd9628..12682cbea354689a0d801ef58261edddb6d87a19 100644 (file)
@@ -80,6 +80,11 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI_Module* theModule,
     myMainWindow( theViewWindow->getMainWindow1() ),
     mySelectionMgr( theSelectionMgr )
 {
+  VISU::ViewManager_var aViewManager = VISU::GetVisuGen( myModule )->GetViewManager();
+  VISU::View_var aView = aViewManager->GetCurrentView();
+  if(!CORBA::is_nil(aView.in()))
+    myView3D = VISU::View3D::_narrow(aView);
+
   //SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
 
   setHorizontallyStretchable( true );
@@ -207,26 +212,23 @@ VisuGUI_Slider::~VisuGUI_Slider()
 
 void VisuGUI_Slider::enableControls( bool on )
 {
-  //mySlider->setMinValue( 0 );
-  //mySlider->setMaxValue( 0 );
-  //mySlider->setValue( 0 );
-
+  widget()->setEnabled( on );
   if( on )
   {
-    myTimeStampStrings->clear();
-    myTimeStampIndices->clear();
-
-    if( myHolderList.size() == 0 )
+    if( myHolderList.empty() )
       return;
 
-    VISU::ColoredPrs3dHolder_var aHolder = myHolderList[0];
-    VISU::ColoredPrs3d_var aPrs = aHolder->GetDevice();
+    myTimeStampStrings->clear();
+    myTimeStampIndices->clear();
 
-    CORBA::Long aTimeStampNumber = aPrs->GetTimeStampNumber();
-    VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = aPrs->GetTimeStampsRange();
+    VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
 
+    VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = aHolder->GetTimeStampsRange();
     CORBA::Long aLength = aTimeStampsRange->length();
 
+    VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
+    CORBA::Long aTimeStampNumber = anInput->myTimeStampNumber;
+
     mySlider->setMinValue( 0 );
     mySlider->setMaxValue( aLength-1 );
 
@@ -234,40 +236,40 @@ void VisuGUI_Slider::enableControls( bool on )
     myLastTimeStamp->setText( aTimeStampsRange[aLength-1].myTime.in() );
     myTimeStampsNumber->setText( QString("(") + QString::number( aLength ) + ")" );
 
-    int current = 0;
-    for( int index = 0; index < aLength; index++ )
+    CORBA::Long a_current_index = 0;
+    for( CORBA::Long an_index = 0; an_index < aLength; an_index++ )
     {
-      VISU::ColoredPrs3d::TimeStampInfo anInfo = aTimeStampsRange[ index ];
-      long aNumber = anInfo.myNumber;
+      VISU::ColoredPrs3d::TimeStampInfo anInfo = aTimeStampsRange[ an_index ];
+      CORBA::Long aNumber = anInfo.myNumber;
       QString aTime = anInfo.myTime.in();
 
       myTimeStampStrings->insertItem( aTime );
       myTimeStampIndices->insertItem( QString::number( aNumber ) );
 
       if( aNumber == aTimeStampNumber )
-       current = index;
+       a_current_index = an_index;
     }
-
-    mySlider->setValue( current );
+    myTimeStampStrings->setFont(myTimeStampStrings->font());
+    myTimeStampStrings->updateGeometry();
+    
+    myTimeStampIndices->setFont(myTimeStampStrings->font());
+    myTimeStampIndices->updateGeometry();
+
+    myTimeStampStrings->setCurrentItem( a_current_index );
+    myTimeStampIndices->setCurrentItem( a_current_index );
+    mySlider->setValue( a_current_index );
   }
   else
   {
     myPlayButton->setOn( false );
   }
 
-  myTimeStampStrings->setFont(myTimeStampStrings->font());
-  myTimeStampStrings->updateGeometry();
-
-  myTimeStampIndices->setFont(myTimeStampStrings->font());
-  myTimeStampIndices->updateGeometry();
-
-  widget()->setEnabled( on );
 }
 
 void VisuGUI_Slider::onSelectionChanged()
 {
   //cout << "VisuGUI_Slider::onSelectionChanged()" << endl;
-  myHolderList.resize(0);
+  myHolderList.clear();
 
   _PTR(SObject) aSObject;
 
@@ -277,8 +279,7 @@ void VisuGUI_Slider::onSelectionChanged()
   SALOME_ListIO aListIO;
   mySelectionMgr->selectedObjects(aListIO);
   SALOME_ListIteratorOfListIO anIter(aListIO);
-  for( int k = 0; anIter.More(); anIter.Next() )
-  {
+  for(; anIter.More(); anIter.Next() ){
     Handle(SALOME_InteractiveObject) anIO = anIter.Value();
     if (anIO->hasEntry()) {
       SalomeApp_Study* theStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
@@ -293,16 +294,14 @@ void VisuGUI_Slider::onSelectionChanged()
          if(!CORBA::is_nil(aHolder))
          {
            //cout << "ColoredPrs3dHolder" << endl;
-           myHolderList.resize(k+1);
-           myHolderList[k] = aHolder;
-           k++;
+           myHolderList.push_back(aHolder);
          }
         }
       }
     }
   }
 
-  enableControls( myHolderList.size() != 0 );
+  enableControls( !myHolderList.empty() );
 }
 
 void VisuGUI_Slider::onTimeStampActivated( int value )
@@ -359,46 +358,38 @@ void VisuGUI_Slider::onLast()
 
 void VisuGUI_Slider::onValueChanged( int value )
 {
-  if( myHolderList.size() == 0 )
+  if( myHolderList.empty() )
     return;
 
-  VISU::ColoredPrs3dHolder_var aHolder = myHolderList[0];
-  VISU::ColoredPrs3d_var aPrs = aHolder->GetDevice();
-
-  VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = aPrs->GetTimeStampsRange();
+  VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
 
+  VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = aHolder->GetTimeStampsRange();
   CORBA::Long aLength = aTimeStampsRange->length();
   if(value < 0 || aLength <= value)
     return;
 
+  VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
+  CORBA::Long aTimeStampNumber = anInput->myTimeStampNumber;
   CORBA::Long aNumber = aTimeStampsRange[ value ].myNumber;
+  if(aNumber == aTimeStampNumber)
+    return;
 
-  HolderList::iterator it = myHolderList.begin();
-  HolderList::iterator itEnd = myHolderList.end();
-  for( ; it != itEnd; ++it )
+  THolderList::const_iterator anIter = myHolderList.begin();
+  THolderList::const_iterator anIterEnd = myHolderList.end();
+  for( ; anIter != anIterEnd; anIter++ )
   {
-    VISU::ColoredPrs3dHolder_var aHolder = *it;
+    VISU::ColoredPrs3dHolder_var aHolder = *anIter;
     if( CORBA::is_nil( aHolder.in() ) )
       continue;
 
-    VISU::ColoredPrs3dHolder::BasicInput* anInput = aHolder->GetBasicInput();
+    VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
     anInput->myTimeStampNumber = aNumber;
 
-    VISU::View_var aView = VISU::GetVisuGen( myModule )->GetViewManager()->GetCurrentView();
-    if( CORBA::is_nil( aView.in() ) )
-      continue;
-
-    VISU::View3D_var aView3D = VISU::View3D::_narrow( aView );
-    if( CORBA::is_nil( aView3D.in() ) )
-      continue;
-
-    aHolder->Apply( aHolder->GetDevice(), *anInput, aView3D );
+    aHolder->Apply( aHolder->GetDevice(), anInput, myView3D );
   }
 
   myTimeStampStrings->setCurrentItem( value );
   myTimeStampIndices->setCurrentItem( value );
-
-  myMainWindow->Repaint();
 }
 
 void VisuGUI_Slider::onSpeedChanged( int value )
index f4473268c1b2c7c687e6b5dbc3bf8d10e743ddf2..bc86ba6716ced801f951e7212cbf37782a8c056e 100644 (file)
@@ -39,8 +39,6 @@ namespace VISU
   class ColoredPrs3dHolder_i;
 }
 
-typedef std::vector<VISU::ColoredPrs3dHolder_var> HolderList;
-
 class QCheckBox;
 class QComboBox;
 class QLabel;
@@ -91,6 +89,7 @@ private:
   VisuGUI_Module*  myModule;
   VVTK_MainWindow* myMainWindow;
   LightApp_SelectionMgr* mySelectionMgr;
+  VISU::View3D_var myView3D;
 
   QSlider*         mySlider;
   QLabel*          myFirstTimeStamp;
@@ -112,8 +111,8 @@ private:
 
   QTimer*          myTimer;
 
-  //PrsList          myPrsList;
-  HolderList       myHolderList;
+  typedef std::vector<VISU::ColoredPrs3dHolder_var> THolderList;
+  THolderList      myHolderList;
 };
 
 #endif
index 9b2d8e733b93ac60ed916285a9252cbeeb0de8cb..f4da70aefd2b30d564777ff4f0f0998f8d01854e 100644 (file)
 
 
 #include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
+#include "VisuGUI_Prs3dTools.h"
+#include "VisuGUI_DialogRunner.h"
 
 #include "VisuGUI.h"
-#include "VisuGUI_ViewTools.h"
 
 #include "VISU_Gen_i.hh"
 #include "VISU_Prs3d_i.hh"
 //=============================================================================
 namespace VISU
 {
+  //------------------------------------------------------------
   SUIT_Desktop*
   GetDesktop(const CAM_Module* theModule)
   {
     return theModule->application()->desktop();
   }
 
+  //------------------------------------------------------------
   LightApp_SelectionMgr*
   GetSelectionMgr(const SalomeApp_Module* theModule)
   {
     return theModule->getApp()->selectionMgr();
   }
 
+  //------------------------------------------------------------
   SalomeApp_Study*
   GetAppStudy(const CAM_Module* theModule)
   {
@@ -91,12 +96,14 @@ namespace VISU
       dynamic_cast<SalomeApp_Study*>(theModule->application()->activeStudy());
   }
 
+  //------------------------------------------------------------
   _PTR(Study)
   GetCStudy(const SalomeApp_Study* theStudy)
   {
     return theStudy->studyDS();
   }
 
+  //------------------------------------------------------------
   bool
   IsStudyLocked( _PTR(Study) theStudy )
   {
@@ -105,6 +112,7 @@ namespace VISU
     return true;
   }
 
+  //------------------------------------------------------------
   bool
   CheckLock( _PTR(Study) theStudy,
             QWidget* theWidget )
@@ -119,6 +127,15 @@ namespace VISU
     return false;
   }
 
+  //------------------------------------------------------------
+  int
+  runAndWait( QDialog* dlg, const bool modal )
+  {
+    VisuGUI_DialogRunner r( dlg );
+    return r.run( modal );
+  }
+
+  //------------------------------------------------------------
   LightApp_DataObject*
   FindDataObject(SUIT_DataObject* theDataObject,
                 const QString& theEntry,
@@ -146,6 +163,7 @@ namespace VISU
     return NULL;
   }
 
+  //------------------------------------------------------------
   LightApp_DataObject*
   FindDataObject(CAM_Module* theModule,
                 _PTR(SObject) theSObject)
@@ -160,6 +178,7 @@ namespace VISU
     return FindDataObject(aRootDataObject,anEntry.c_str(),aLevel);
   }
 
+  //------------------------------------------------------------
   void
   UpdateObjBrowser(SalomeApp_Module* theModule,
                   bool theIsUpdateDataModel,
@@ -173,6 +192,7 @@ namespace VISU
     theModule->getApp()->updateActions();
   }
 
+  //------------------------------------------------------------
   bool
   IsSObjectTable( _PTR(SObject) theSObject )
   {
@@ -186,6 +206,7 @@ namespace VISU
     return false;
   }
 
+  //------------------------------------------------------------
   VISU_Gen_i*
   GetVisuGen(const CAM_Module* theModule)
   {
@@ -204,6 +225,7 @@ namespace VISU
     return aGen;
   }
 
+  //------------------------------------------------------------
   SALOME_MED::MED_Gen_var
   GetMEDEngine()
   {
@@ -219,7 +241,9 @@ namespace VISU
   }
 
 
-  VISU::Storable::TRestoringMap getMapOfValue (_PTR(SObject) theSObject)
+  //------------------------------------------------------------
+  VISU::Storable::TRestoringMap 
+  getMapOfValue(_PTR(SObject) theSObject)
   {
     VISU::Storable::TRestoringMap aMap;
     if (theSObject) {
@@ -234,7 +258,9 @@ namespace VISU
     return aMap;
   }
 
-  QString getValue (_PTR(SObject) theSObject, QString theKey)
+  //------------------------------------------------------------
+  QString 
+  getValue(_PTR(SObject) theSObject, QString theKey)
   {
     QString aStr("");
     VISU::Storable::TRestoringMap aMap = getMapOfValue(theSObject);
@@ -268,6 +294,7 @@ namespace VISU
     return CORBA::Object::_nil();
   }
 
+  //------------------------------------------------------------
   CORBA::Object_var
   GetSelectedObj(const SalomeApp_Module* theModule,
                 Handle(SALOME_InteractiveObject)* theIO,
@@ -287,6 +314,7 @@ namespace VISU
     return CORBA::Object::_nil();
   }
 
+  //------------------------------------------------------------
   VISU::Prs3d_i*
   GetPrsToModify(const SalomeApp_Module* theModule,
                 Handle(SALOME_InteractiveObject)* theIO,
@@ -296,24 +324,18 @@ namespace VISU
       return NULL;
 
     CORBA::Object_var anObject = GetSelectedObj(theModule, theIO);
-    if (CORBA::is_nil(anObject))
-      return NULL;
-
-    PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
-    if (!aServant.in())
-      return NULL;
-
-    VISU::Base_i* aBase = dynamic_cast<VISU::Base_i*>(aServant.in());
-    if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
-      VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
-      VISU::ColoredPrs3d_var aColoredPrs3d = aHolder->GetDevice();
-      aServant = VISU::GetServant(aColoredPrs3d);
-      aBase = dynamic_cast<VISU::Base_i*>(aServant.in());
+    if(VISU::Base_i* aBase = GetServantInterface<VISU::Base_i>(anObject)){
+      if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
+       VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
+       VISU::ColoredPrs3d_var aColoredPrs3d = aHolder->GetDevice();
+       aBase = dynamic_cast<VISU::Base_i*>(GetServant(aColoredPrs3d).in());
+      }
+      return dynamic_cast<VISU::Prs3d_i*>(aBase);
     }
-
-    return dynamic_cast<VISU::Prs3d_i*>(aBase);
+    return NULL;
   }
 
+  //------------------------------------------------------------
   void
   Add(LightApp_SelectionMgr* theSelectionMgr,
       const Handle(SALOME_InteractiveObject)& theIO)
@@ -324,6 +346,7 @@ namespace VISU
     theSelectionMgr->setSelectedObjects(aListIO);
   }
 
+  //------------------------------------------------------------
   void
   Remove(LightApp_SelectionMgr* theSelectionMgr,
         const Handle(SALOME_InteractiveObject)& theIO)
@@ -341,9 +364,8 @@ namespace VISU
     theSelectionMgr->setSelectedObjects(aNewListIO);
   }
 
-  /*!
-   * Restores selection after presentation creating and editing
-   */
+  //------------------------------------------------------------
+  //! Restores selection after presentation creating and editing
   void
   RestoreSelection(VisuGUI* theModule, VISU::Prs3d_i* thePrs3d)
   {
@@ -455,6 +477,7 @@ namespace VISU
     return true;
   }
 
+  //------------------------------------------------------------
   void
   DeleteSObject(VisuGUI* theModule,
                _PTR(Study) theStudy,
@@ -484,6 +507,7 @@ namespace VISU
     }
   }
 
+  //------------------------------------------------------------
   void
   DeletePrs3d(VisuGUI* theModule,
               VISU::Prs3d_i* thePrs)
@@ -499,79 +523,54 @@ namespace VISU
     thePrs->RemoveFromStudy();
   }
 
+  //------------------------------------------------------------
   // Presentation management
-
   void
   ChangeRepresentation (const SalomeApp_Module* theModule,
                         VISU::PresentationType  theType)
   {
-    SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
-    if (!vw)
-      return;
-
-    Handle(SALOME_InteractiveObject) anIO;
-    CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
-    if (CORBA::is_nil(anObject)) return;
-
-    VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
-    if (CORBA::is_nil(aVisuObj)) return;
-
-    PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
-    if (!aServant.in()) return;
-
-    VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
-    if (aPrs3d) {
-      if (VISU_Actor* anActor = GetActor(aPrs3d, vw)) {
-        switch (theType) {
-        case VISU::SHRINK:
-          if (anActor->IsShrunk())
-            anActor->UnShrink();
-          else
-            anActor->SetShrink();
-          break;
-        default:
-          if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
-            aMesh->SetPresentationType(theType);
-            RecreateActor(theModule, aMesh);
-          } else {
-            anActor->SetRepresentation(theType);
-          }
-        }
-        vw->Repaint();
+    if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)){
+      if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(theModule)){
+       if (VISU_Actor* anActor = GetActor(aPrs3d, aViewWindow)) {
+         switch (theType) {
+         case VISU::SHRINK:
+           if (anActor->IsShrunk())
+             anActor->UnShrink();
+           else
+             anActor->SetShrink();
+           break;
+         default:
+           if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
+             aMesh->SetPresentationType(theType);
+             RecreateActor(theModule, aMesh);
+           } else {
+             anActor->SetRepresentation(theType);
+           }
+         }
+         aViewWindow->Repaint();
+       }
       }
     }
   }
 
+  //------------------------------------------------------------
   void
   SetShading ( const SalomeApp_Module* theModule,
              bool theOn )
   {
-    SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
-    if (!vw)
-      return;
-
-    Handle(SALOME_InteractiveObject) anIO;
-    CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
-    if (CORBA::is_nil(anObject)) return;
-
-    VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
-    if (CORBA::is_nil(aVisuObj)) return;
-
-    PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
-    if (!aServant.in()) return;
-
-    VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
-    if (aPrs3d) {
-      if (VISU_Actor* anActor = GetActor(aPrs3d, vw)) {
-       if ( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
-         aScalarMapActor->SetShading( theOn );
+    if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)){
+      if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(theModule)){
+       if (VISU_Actor* anActor = GetActor(aPrs3d, aViewWindow)) {
+         if ( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
+           aScalarMapActor->SetShading( theOn );
+       }
+       aViewWindow->Repaint();
       }
-      vw->Repaint();
     }
   }
 
+  //------------------------------------------------------------
   // SObject type
-
   bool
   CheckTimeStamp(const SalomeApp_Module* theModule,
                  _PTR(SObject)&          theSObject,
@@ -600,6 +599,7 @@ namespace VISU
     return false;
   }
 
+  //------------------------------------------------------------
   VISU::Result_i*
   CheckResult(const SalomeApp_Module* theModule,
               _PTR(SObject)           theSource,
@@ -635,8 +635,8 @@ namespace VISU
     return dynamic_cast<VISU::Result_i*>(VISU::GetServant(anObject).in());
   }
 
+  //------------------------------------------------------------
   // VTK View
-
   VISU_Actor*
   PublishMeshInView(const SalomeApp_Module* theModule,
                     VISU::Prs3d_i* thePrs,
@@ -661,6 +661,7 @@ namespace VISU
     return aActor;
   }
 
+  //------------------------------------------------------------
   void
   RepaintViewWindows (const SalomeApp_Module* theModule,
                       const Handle(SALOME_InteractiveObject)& theIObject)
@@ -688,6 +689,7 @@ namespace VISU
     }
   }
 
+  //------------------------------------------------------------
   VISU_Actor*
   FindActor(SVTK_ViewWindow* theViewWindow,
             const char* theEntry)
@@ -703,6 +705,7 @@ namespace VISU
     return NULL;
   }
 
+  //------------------------------------------------------------
   VISU_Actor*
   FindActor(SVTK_ViewWindow* theViewWindow,
             VISU::Prs3d_i* thePrs)
@@ -715,6 +718,7 @@ namespace VISU
     return NULL;
   }
 
+  //------------------------------------------------------------
   void
   RecreateActor (const SalomeApp_Module* theModule,
                  VISU::Prs3d_i* thePrs)
@@ -740,6 +744,7 @@ namespace VISU
     QApplication::restoreOverrideCursor();
   }
 
+  //------------------------------------------------------------
   static 
   bool
   ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
@@ -778,6 +783,7 @@ namespace VISU
     return somethingVisible;
   }
 
+  //------------------------------------------------------------
   void SetFitAll(SVTK_ViewWindow* theViewWindow)
   {
     static vtkFloatingPointType PRECISION = 0.000001;
@@ -839,6 +845,7 @@ namespace VISU
     return NULL;
   }
 
+  //------------------------------------------------------------
   // Internal function used by several public functions below
   void
   UpdateCurve(VISU::Curve_i* theCurve,
@@ -892,6 +899,7 @@ namespace VISU
     }
   }
 
+  //------------------------------------------------------------
   void
   PlotTable(const SalomeApp_Module* theModule,
             VISU::Table_i* table,
@@ -941,6 +949,7 @@ namespace VISU
     }
   }
 
+  //------------------------------------------------------------
   void
   PlotCurve(const SalomeApp_Module* theModule,
             VISU::Curve_i* theCurve,
@@ -974,6 +983,7 @@ namespace VISU
     aPlot->Repaint();
   }
 
+  //------------------------------------------------------------
   void
   PlotRemoveCurve(const SalomeApp_Module* theModule,
                  VISU::Curve_i* pCrv)
@@ -1001,6 +1011,7 @@ namespace VISU
     }
   }
   
+  //------------------------------------------------------------
   void
   PlotContainer(const SalomeApp_Module* theModule,
                 VISU::Container_i* container,
@@ -1036,6 +1047,7 @@ namespace VISU
     aPlot->Repaint();
   }
 
+  //------------------------------------------------------------
   void
   CreatePlot(SalomeApp_Module* theModule,
              _PTR(SObject) theTableSO)
@@ -1290,6 +1302,7 @@ namespace VISU
     return aList;
   }
 
+  //------------------------------------------------------------
   int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow)
   {
     int minIndx = 1;
@@ -1311,6 +1324,7 @@ namespace VISU
     return minIndx;
   }
 
+  //------------------------------------------------------------
   void AddScalarBarPosition (VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
                              VISU::Prs3d_i* thePrs3d, int pos)
   {
@@ -1319,6 +1333,7 @@ namespace VISU
     aMap[theViewWindow].insert(aPair);
   }
 
+  //------------------------------------------------------------
   void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
                                VISU::Prs3d_i* thePrs3d)
   {
@@ -1330,4 +1345,5 @@ namespace VISU
        return;
       }
   }
+  //------------------------------------------------------------
 }
index c68ffffcc3be8ceffad31f5d9da92e65e61925eb..41647fcb0d71df1ea681ecc5f8e106c63a6c22a6 100644 (file)
@@ -39,6 +39,7 @@
 #include CORBA_SERVER_HEADER(MED_Gen)
 
 class QWidget;
+class QDialog;
 
 class SUIT_Desktop;
 class SUIT_ViewWindow;
@@ -71,6 +72,8 @@ namespace VISU
   bool                                 CheckLock( _PTR(Study) theStudy,
                                                  QWidget* theWidget );
 
+  int                                  runAndWait( QDialog* dlg, const bool modal );
+
   void                                 UpdateObjBrowser(SalomeApp_Module* theModule,
                                                        bool theIsUpdateDataModel = true,
                                                        _PTR(SObject) theSObject = _PTR(SObject)());
@@ -83,12 +86,15 @@ namespace VISU
 
   // Selection
   LightApp_SelectionMgr*               GetSelectionMgr(const SalomeApp_Module* theModule);
+
   CORBA::Object_var                    GetSelectedObj(const SalomeApp_Study* theStudy,
                                                      const QString& theEntry,
                                                      VISU::Storable::TRestoringMap* theMap = NULL);
+
   CORBA::Object_var                    GetSelectedObj(const SalomeApp_Module* theModule,
                                                      Handle(SALOME_InteractiveObject)* theIO = NULL,
                                                      VISU::Storable::TRestoringMap* theMap = NULL);
+
   VISU::Prs3d_i*                       GetPrsToModify(const SalomeApp_Module* theModule,
                                                      Handle(SALOME_InteractiveObject)* theIO = NULL,
                                                      VISU::Storable::TRestoringMap* theMap = NULL);
index cbfb91577ff76846b7c669c218c2040dfb820b72..5464c505d3066c65328a7718273fa91fa26a22f9 100644 (file)
@@ -76,6 +76,8 @@ namespace VISU
                  public virtual PortableServer::RefCountServantBase
   {
   public:
+    typedef VISU::Base TInterface;
+
     Base_i();
     virtual ~Base_i();
     virtual char* GetID();
index 93af69967eb35a270400d2e0d92256a68d3495ee..5a18f0be302c0b8327253ef229313f2ae4ddf7c0 100644 (file)
@@ -43,8 +43,6 @@ static int MYDEBUG = 0;
 static int MYDEBUG = 0;
 #endif
 
-static int INCMEMORY = 4;
-
 static int MEMORY_UNIT = 1000;
 
 //----------------------------------------------------------------------------
@@ -92,8 +90,9 @@ VISU::ColoredPrs3dCache_i
 
 //----------------------------------------------------------------------------
 template<unsigned int colored_prs3d_type_enum> 
-int
-CheckIsPossible(const VISU::ColoredPrs3dHolder::BasicInput& theInput)
+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();
@@ -102,7 +101,12 @@ CheckIsPossible(const VISU::ColoredPrs3dHolder::BasicInput& theInput)
   CORBA::Long aTimeStampNumber = theInput.myTimeStampNumber;
 
   typedef typename VISU::TL::TColoredEnum2Type<colored_prs3d_type_enum>::TResult TColoredPrs3d;
-  return TColoredPrs3d::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
+  return TColoredPrs3d::IsPossible(aResult,
+                                  aMeshName,
+                                  anEntity,
+                                  aFieldName,
+                                  aTimeStampNumber,
+                                  theMemoryCheck);
 }
 
 
@@ -110,85 +114,62 @@ CheckIsPossible(const VISU::ColoredPrs3dHolder::BasicInput& theInput)
 int
 VISU::ColoredPrs3dCache_i
 ::IsPossible(VISU::VISUType theType,
-            const VISU::ColoredPrs3dHolder::BasicInput& theInput,
-            bool theMemoryCheck)
+            const VISU::ColoredPrs3dHolder::BasicInput& theInput)
 {
   //cout << "VISU::ColoredPrs3dCache_i::IsPossible " << endl;
-  bool anIsPossible = false;
+  size_t aMemoryNeeded = 0;
   switch(theType){
   case TSCALARMAP:
-    anIsPossible =  CheckIsPossible<TSCALARMAP>(theInput);
+    aMemoryNeeded = CheckIsPossible<TSCALARMAP>(theInput, true);
+    break;
   case TGAUSSPOINTS:
-    anIsPossible =  CheckIsPossible<TGAUSSPOINTS>(theInput);
+    aMemoryNeeded = CheckIsPossible<TGAUSSPOINTS>(theInput, true);
+    break;
   case TDEFORMEDSHAPE:
-    anIsPossible =  CheckIsPossible<TDEFORMEDSHAPE>(theInput);
+    aMemoryNeeded = CheckIsPossible<TDEFORMEDSHAPE>(theInput, true);
+    break;
   case TSCALARMAPONDEFORMEDSHAPE:
-    anIsPossible =  CheckIsPossible<TSCALARMAPONDEFORMEDSHAPE>(theInput);
+    aMemoryNeeded = CheckIsPossible<TSCALARMAPONDEFORMEDSHAPE>(theInput, true);
+    break;
   case TISOSURFACE:
-    anIsPossible =  CheckIsPossible<TISOSURFACE>(theInput);
+    aMemoryNeeded = CheckIsPossible<TISOSURFACE>(theInput, true);
+    break;
   case TSTREAMLINES:
-    anIsPossible =  CheckIsPossible<TSTREAMLINES>(theInput);
+    aMemoryNeeded = CheckIsPossible<TSTREAMLINES>(theInput, true);
+    break;
   case TPLOT3D:
-    anIsPossible =  CheckIsPossible<TPLOT3D>(theInput);
+    aMemoryNeeded = CheckIsPossible<TPLOT3D>(theInput, true);
+    break;
   case TCUTPLANES:
-    anIsPossible =  CheckIsPossible<TCUTPLANES>(theInput);
+    aMemoryNeeded = CheckIsPossible<TCUTPLANES>(theInput, true);
+    break;
   case TCUTLINES:
-    anIsPossible =  CheckIsPossible<TCUTLINES>(theInput);
+    aMemoryNeeded = CheckIsPossible<TCUTLINES>(theInput, true);
+    break;
   case TVECTORS:
-    anIsPossible =  CheckIsPossible<TVECTORS>(theInput);
+    aMemoryNeeded = CheckIsPossible<TVECTORS>(theInput, true);
+    break;
   }
-
-  if( anIsPossible && theMemoryCheck )
-  {
-    //cout << "Memory checking..." << endl;
-    if( GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED )
-    {
-      long aMemoryUsed = 0;
-
-      VISU::ColoredPrs3d_i* aPrs3d;
-      TColoredPrs3dHolderMap::iterator aMapIterator = myHolderMap.begin();
-      TColoredPrs3dHolderMap::iterator aMapIteratorEnd = myHolderMap.end();
-      for(; aMapIterator != aMapIteratorEnd; ++aMapIterator)
-      {
-       TLastVisitedPrsList aList = aMapIterator->second;
-
-       TLastVisitedPrsList::iterator it = aList.begin();
-       TLastVisitedPrsList::iterator itEnd = aList.end();
-       for(; it != itEnd; ++it)
-       {
-         aPrs3d = *it;
-         if( aPrs3d )
+  if(aMemoryNeeded > 0){
+    if(GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED){
+      size_t aMemoryUsed = 0;
+      TColoredPrs3dHolderMap::const_iterator aHolderIter = myHolderMap.begin();
+      TColoredPrs3dHolderMap::const_iterator aHolderIterEnd = myHolderMap.end();
+      for(; aHolderIter != aHolderIterEnd; aHolderIter++){
+       const TLastVisitedPrsList& aPrsList = aHolderIter->second;
+       TLastVisitedPrsList::const_iterator aPrsIter = aPrsList.begin();
+       TLastVisitedPrsList::const_iterator aPrsIterEnd = aPrsList.end();
+       for(; aPrsIter != aPrsIterEnd; aPrsIter++){
+         if(VISU::ColoredPrs3d_i* aPrs3d = *aPrsIter)
            aMemoryUsed += aPrs3d->GetMemorySize();
        }
       }
-
-      long aMemoryLimit = GetLimitedMemory() * MEMORY_UNIT;
-
-      //cout << "Cache memory  : " << aMemoryLimit << endl;
-      //cout << "Memory used   : " << aMemoryUsed << endl;
-
-      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();
-      long aTimeStampNumber = theInput.myTimeStampNumber;
-
-      VISU::Result_i::TInput* anInput = aResult->GetInput();
-      float aMemoryNeeded = anInput->GetTimeStampSize(aMeshName,
-                                                     (VISU::TEntity)anEntity,
-                                                     aFieldName,
-                                                     aTimeStampNumber);
-      aMemoryNeeded *= INCMEMORY;
-      //cout << "Memory needed : " << aMemoryNeeded << endl;
-
-      if( aMemoryUsed + aMemoryNeeded > aMemoryLimit )
-       anIsPossible = false;
+      size_t aMemoryLimit = GetLimitedMemory() * MEMORY_UNIT;
+      //cout<<"Memory needed: "<<aMemoryNeeded<<"; used: "<<aMemoryUsed<<"; limit: "<<aMemoryLimit<<endl;
+      return aMemoryUsed + aMemoryNeeded < aMemoryLimit;
     }
-    else
-      anIsPossible = false;
   }
-
-  return anIsPossible;
+  return aMemoryNeeded > 0;
 }
 
 
@@ -353,7 +334,7 @@ VISU::ColoredPrs3dCache_i
                   VISU::ColoredPrs3dHolder_i* theHolder)
 {
   thePrs3d->SetHolderEntry( theHolder->GetEntry() );
-  GetLastVisitedPrsList(theHolder).push_back(thePrs3d);  
+  GetLastVisitedPrsList(theHolder).push_front(thePrs3d);  
   return thePrs3d;
 }
 
@@ -387,7 +368,7 @@ VISU::ColoredPrs3dCache_i
 {
   TLastVisitedPrsList aList = GetLastVisitedPrsList(theHolder);
   if( !aList.empty() )
-    return aList.back();
+    return aList.front();
 
   return NULL;
 }
@@ -399,28 +380,23 @@ VISU::ColoredPrs3dCache_i
 ::FindPrsByInput(TLastVisitedPrsList& theLastVisitedPrsList,
                 const VISU::ColoredPrs3dHolder::BasicInput& theInput)
 {
-  //cout << "VISU::ColoredPrs3dCache_i::FindPrsByInput() ";
-  VISU::ColoredPrs3d_i* aPrs3d = NULL;
-  VISU::ColoredPrs3dHolder::BasicInput_var anInput;
-  TLastVisitedPrsList::iterator it = theLastVisitedPrsList.begin();
-  TLastVisitedPrsList::iterator itEnd = theLastVisitedPrsList.end();
-  for(; it != itEnd; ++it)
+  // User reverse iteration to start from last visited items
+  TLastVisitedPrsList::iterator anIter = theLastVisitedPrsList.begin();
+  TLastVisitedPrsList::iterator aEndIter = theLastVisitedPrsList.end();
+  for(; anIter != aEndIter; anIter++)
   {
-    aPrs3d = *it;
-    anInput = aPrs3d->GetBasicInput();
-
+    VISU::ColoredPrs3d_i* aPrs3d = *anIter;
+    VISU::ColoredPrs3dHolder::BasicInput_var anInput = aPrs3d->GetBasicInput();
     if(anInput->myResult->_is_equivalent(theInput.myResult) &&
        !strcmp(anInput->myMeshName.in(), theInput.myMeshName.in()) &&
        anInput->myEntity == theInput.myEntity &&
        !strcmp(anInput->myFieldName.in(), theInput.myFieldName.in()) &&
        anInput->myTimeStampNumber == theInput.myTimeStampNumber )
     {
-      //cout << "returns " << aPrs3d->GetName() << endl;
+      theLastVisitedPrsList.erase(anIter);
       return aPrs3d;
     }
   }
-
-  //cout << "returns NULL" << endl;
   return NULL;
 }
 
@@ -434,32 +410,38 @@ VISU::ColoredPrs3dCache_i
                       VISU::View3D_ptr theView3D)
 {
   //cout << "VISU::ColoredPrs3dCache_i::UpdateLastVisitedPrs" << endl;
+  VISU::ColoredPrs3d_i* aLastVisitedPrs3d = GetLastVisitedPrs(theHolder);
   TLastVisitedPrsList& aLastVisitedPrsList = GetLastVisitedPrsList(theHolder);
   VISU::ColoredPrs3d_i* aPrs3d = FindPrsByInput(aLastVisitedPrsList, theInput);
-  if(aPrs3d)
-  {
-    aLastVisitedPrsList.pop_front();
-  }
-  else if(IsPossible(theHolder->GetPrsType(), theInput, true))
-  {
+  bool anIsCheckPossible = GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED;
+  if(aPrs3d){
+    aLastVisitedPrsList.push_front(aPrs3d);
+    //cout << "FindPrsByInput " << aPrs3d;
+  }else if(anIsCheckPossible && IsPossible(theHolder->GetPrsType(), theInput)){
     aPrs3d = CreatePrs(theHolder->GetPrsType(), theInput, theHolder);
-    //cout << "Created " << aPrs3d->GetName() << endl;
-  }
-  else
-  {
-    //cout << "Move only" << endl;
-    aPrs3d = aLastVisitedPrsList.front();
-    aLastVisitedPrsList.pop_front();
+    //cout << "Created " << aPrs3d;
+  }else{
+    aPrs3d = aLastVisitedPrsList.back();
+    aLastVisitedPrsList.pop_back();
+    aLastVisitedPrsList.push_front(aPrs3d);
+    //cout << "Move only " << aPrs3d;
   }
-  aLastVisitedPrsList.push_back(aPrs3d);
+  //cout << "; " << aLastVisitedPrsList.size() << endl;
 
+  aPrs3d->SetResultObject(theInput.myResult);
+  aPrs3d->SetMeshName(theInput.myMeshName);
+  aPrs3d->SetEntity(theInput.myEntity);
+  aPrs3d->SetFieldName(theInput.myFieldName);
+  aPrs3d->SetTimeStampNumber(theInput.myTimeStampNumber);
   aPrs3d->SameAs(thePrs);
-
-  if(aPrs3d && !CORBA::is_nil(theView3D))
-  {
-    //cout << "Display " << aPrs3d->GetName() << endl;
-    VISU::ColoredPrs3d_var aColoredPrs3d = aPrs3d->_this();
-    theView3D->DisplayOnly(aColoredPrs3d);
+  if(!CORBA::is_nil(theView3D)){
+    if(aPrs3d != aLastVisitedPrs3d){
+      VISU::ColoredPrs3d_var aColoredPrs3d = aLastVisitedPrs3d->_this();
+      theView3D->Erase(aColoredPrs3d);
+      aColoredPrs3d = aPrs3d->_this();
+      theView3D->Display(aColoredPrs3d);
+    }else
+      theView3D->Update();
     return true;
   }
 
index ad847d82434e6c6b5cc9b92bdd3353b5e0b47cea..4eb1f3cbe044405cece63a19d1e71e14de93e0f2 100644 (file)
@@ -158,8 +158,7 @@ namespace VISU
     //----------------------------------------------------------------------------
     virtual int
     IsPossible(VISU::VISUType theType,
-              const VISU::ColoredPrs3dHolder::BasicInput& theInput,
-              bool theMemoryCheck = false);
+              const VISU::ColoredPrs3dHolder::BasicInput& theInput);
 
     VISU::ColoredPrs3d_i*
     FindPrsByInput(TLastVisitedPrsList& theLastVisitedPrsList,
index cd7a6a3e49138fb564aebc19e0dca7dae059dad9..3dac4d9415f65471749faedf70cca15e2a7ab144 100644 (file)
@@ -203,7 +203,7 @@ namespace VISU
              const std::string& theMeshName, 
              VISU::Entity theEntity,
              const std::string& theFieldName, 
-             CORBA::Long theIteration)
+             CORBA::Long theTimeStampNumber)
   {
     typedef typename TPrs3d_i::TInterface TPrs3d;
     typename TPrs3d::_var_type aPrs3d;
@@ -213,10 +213,10 @@ namespace VISU
       if(aStudy->GetProperties()->IsLocked()) 
        return NULL;
     
-      if(TPrs3d_i::IsPossible(aResult, theMeshName, theEntity, theFieldName, theIteration)){
+      if(TPrs3d_i::IsPossible(aResult, theMeshName, theEntity, theFieldName, theTimeStampNumber, true)){
        TPrs3d_i* aPresent = new TPrs3d_i(ColoredPrs3d_i::EPublishUnderTimeStamp);
        
-       if(CreatColoredPrs3d(aPresent, aResult, theMeshName, theEntity, theFieldName, theIteration))
+       if(CreatColoredPrs3d(aPresent, aResult, theMeshName, theEntity, theFieldName, theTimeStampNumber))
          return aPresent;
        
        aPresent->_remove_ref();
@@ -227,21 +227,21 @@ namespace VISU
 
 
   //----------------------------------------------------------------------------
-  template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type
+  template<typename TPrs3d_i> 
+  typename TPrs3d_i::TInterface::_var_type
   Prs3dOnField(Result_ptr theResult, 
               const std::string& theMeshName, 
               VISU::Entity theEntity,
               const std::string& theFieldName, 
-              CORBA::Long theIteration)
+              CORBA::Long theTimeStampNumber)
   {
-    typedef typename TPrs3d_i::TInterface TPrs3d;
-    typename TPrs3d::_var_type aPrs3d;
     if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,
                                                theMeshName,
                                                theEntity,
                                                theFieldName,
-                                               theIteration))
+                                               theTimeStampNumber))
       return aPrs3d->_this();
+    typedef typename TPrs3d_i::TInterface TPrs3d;
     return TPrs3d::_nil();
   }
   //----------------------------------------------------------------------------
index f6e71de9b7a900b57c06b70573ec5471a51c76a5..0c382e1b6975df926f0d7492d014e575c8aefa4f 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <strstream>
 #include <vtkMapper.h>
+#include <vtkDataSet.h>
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
@@ -348,20 +349,10 @@ CORBA::Long
 VISU::ColoredPrs3d_i
 ::GetMemorySize()
 {
-  VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>( VISU::GetServant(GetResultObject()).in() );
-  std::string aMeshName   = GetCMeshName();
-  VISU::Entity anEntity   = GetEntity();
-  std::string aFieldName  = GetCFieldName();
-  long aTimeStampNumber   = GetTimeStampNumber();
-
-  VISU::Result_i::TInput* anInput = aResult->GetInput();
-  float aSize = anInput->GetTimeStampSize(aMeshName,
-                                         (VISU::TEntity)anEntity,
-                                         aFieldName,
-                                         aTimeStampNumber);
-  aSize *= INCMEMORY;
-
-  return (CORBA::Long)aSize;
+  vtkDataSet* aDataSet = GetPipeLine()->GetMapper()->GetInput();
+  vtkFloatingPointType aSize = aDataSet->GetActualMemorySize() * 1024.0;
+  vtkFloatingPointType aMemorySize = aSize * INCMEMORY;
+  return CORBA::Long(aMemorySize);
 }
 
 VISU::ColoredPrs3dHolder::BasicInput*
@@ -405,14 +396,8 @@ VISU::ColoredPrs3d_i
   if(const ColoredPrs3d_i* aPrs3d = dynamic_cast<const ColoredPrs3d_i*>(theOrigin)){
     ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(aPrs3d);
  
-    SetCResult(anOrigin->GetCResult());
-    SetMeshName(anOrigin->GetCMeshName().c_str());
-    SetEntity(anOrigin->GetEntity());
-    SetFieldName(anOrigin->GetCFieldName().c_str());
-    SetTimeStampNumber(anOrigin->GetTimeStampNumber());
-    OnSetInput();
-
-    Build(ESameAs);
+    if(OnSetInput())
+      Build(ESameAs);
     
     TSuperClass::SameAs(theOrigin);
     
@@ -442,20 +427,6 @@ VISU::ColoredPrs3d_i
   }
 }
   
-//----------------------------------------------------------------------------
-void
-VISU::ColoredPrs3d_i
-::SameAsParams(const ColoredPrs3d_i* theOrigin)
-{
-  CORBA::Long aTimeStampNumber = GetTimeStampNumber();
-  SameAs(theOrigin);
-  SetTimeStampNumber(aTimeStampNumber);
-  OnSetInput();
-
-  Build(ESameAs);
-  Update();
-}
-
 //----------------------------------------------------------------------------
 CORBA::Long 
 VISU::ColoredPrs3d_i
@@ -920,7 +891,7 @@ VISU::ColoredPrs3d_i
 ::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
         const std::string& theFieldName, 
-        int theTimeStampNumber)
+        CORBA::Long theTimeStampNumber)
 {
   SetMeshName(theMeshName.c_str());
   SetEntity(theEntity);
index ab830a34ef2e5e02ea54483ac48e2a1c6fd7f7d7..f5738ea84db75afea6d8e3f85fd5759f5de9927d 100644 (file)
@@ -45,6 +45,7 @@ namespace VISU
   public:
     //----------------------------------------------------------------------------
     typedef Prs3d_i TSuperClass;
+    typedef VISU::ColoredPrs3d TInterface;
 
     /*! 
       The enumeration allow to define what mode should be used for the presentation building.
@@ -237,7 +238,7 @@ namespace VISU
     Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
           const std::string& theFieldName, 
-          int theTimeStampNumber);
+          CORBA::Long theTimeStampNumber);
 
     /*!
       Retores state of the presentation
@@ -260,14 +261,6 @@ namespace VISU
     void
     SameAs(const Prs3d_i* theOrigin);
 
-    /*!
-     *  \brief Works like SameAs() method, but keep myTimeStampNumber value unchanged.
-     *
-     *  Is used in VISU_TimeAnimation class implementation.
-     */
-    void
-    SameAsParams(const ColoredPrs3d_i* theOrigin);
-
     virtual 
     bool
     IsBoldTitle();
index e5db69d219dd90ac207eaa62d44ed731f197d111..eba9b965da534a6c59d584392e253461ae11fe5c 100644 (file)
@@ -46,21 +46,21 @@ static int MYDEBUG = 0;
 
 
 //---------------------------------------------------------------
-int
+size_t
 VISU::CutLines_i
 ::IsPossible(Result_i* theResult, 
             const std::string& theMeshName, 
             VISU::Entity theEntity, 
             const std::string& theFieldName, 
-            int theTimeStampNumber, 
-            int isMemoryCheck)
+            CORBA::Long theTimeStampNumber, 
+            bool theIsMemoryCheck)
 {
   return TSuperClass::IsPossible(theResult,
                                 theMeshName,
                                 theEntity,
                                 theFieldName,
                                 theTimeStampNumber,
-                                isMemoryCheck);
+                                theIsMemoryCheck);
 }
 
 //---------------------------------------------------------------
@@ -125,7 +125,7 @@ VISU::CutLines_i
 ::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
         const std::string& theFieldName, 
-        int theTimeStampNumber)
+        CORBA::Long theTimeStampNumber)
 {
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
@@ -477,7 +477,7 @@ bool
 VISU::CutLines_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
 }
 
 
index 0a934d5d41144764cffc844269d1fb0c44317888..fc2c11d1b4ccc870631d54d259b418d429854683 100644 (file)
@@ -203,13 +203,13 @@ namespace VISU
   public:
     //! Extends VISU_ColoredPrs3d_i::IsPossible
     static
-    int
+    size_t
     IsPossible(Result_i* theResult, 
               const std::string& theMeshName, 
               VISU::Entity theEntity,
               const std::string& theFieldName, 
-              int theTimeStampNumber, 
-              int isMemoryCheck = true);
+              CORBA::Long theTimeStampNumber,
+              bool theIsMemoryCheck);
 
     //! Extends VISU_ColoredPrs3d_i::Create
     virtual 
@@ -217,7 +217,7 @@ namespace VISU
     Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
           const std::string& theFieldName, 
-          int theTimeStampNumber);
+          CORBA::Long theTimeStampNumber);
 
     //! Extends VISU_ColoredPrs3d_i::ToStream
     virtual 
index 3577406502574352bf62645a2d0df6c6e8524ea0..c19a4b94d6307280d0144c4ad1ef165b0b6a2f80 100644 (file)
@@ -39,16 +39,16 @@ static int MYDEBUG = 0;
 
 
 //----------------------------------------------------------------------------
-in
+size_
 VISU::CutPlanes_i
 ::IsPossible(Result_i* theResult, 
-            const std::string& theMeshName, 
-            VISU::Entity theEntity, 
-            const std::string& theFieldName, 
-            int theTimeStampNumber, 
-            int isMemoryCheck)
+              const std::string& theMeshName, 
+              VISU::Entity theEntity,
+              const std::string& theFieldName, 
+              CORBA::Long theTimeStampNumber,
+              bool theIsMemoryCheck)
 {
-  return TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,isMemoryCheck);
+  return TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,theIsMemoryCheck);
 }
 
 
@@ -102,9 +102,9 @@ VISU::CutPlanes_i
 VISU::Storable* 
 VISU::CutPlanes_i
 ::Create(const std::string& theMeshName, 
-        VISU::Entity theEntity,
-        const std::string& theFieldName, 
-        int theTimeStampNumber)
+          VISU::Entity theEntity,
+          const std::string& theFieldName, 
+          CORBA::Long theTimeStampNumber)
 {
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
@@ -285,7 +285,7 @@ bool
 VISU::CutPlanes_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
 }
 
 //----------------------------------------------------------------------------
index e15479293a251fce15781caa1a62607d7f19c392..45f23f9a109254da5766442dc47affcc59abd699 100644 (file)
@@ -132,13 +132,13 @@ namespace VISU
   public:
     //! Redefines VISU_ColoredPrs3d_i::IsPossible
     static
-    int
+    size_t
     IsPossible(Result_i* theResult, 
               const std::string& theMeshName, 
               VISU::Entity theEntity,
               const std::string& theFieldName, 
-              int theTimeStampNumber, 
-              int isMemoryCheck = true);
+              CORBA::Long theTimeStampNumber,
+              bool theIsMemoryCheck);
 
     //! Redefines VISU_ColoredPrs3d_i::Create
     virtual 
@@ -146,7 +146,7 @@ namespace VISU
     Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
           const std::string& theFieldName, 
-          int theTimeStampNumber);
+          CORBA::Long theTimeStampNumber);
 
     //! Redefines VISU_ColoredPrs3d_i::ToStream
     virtual
index b8d0f05feb6581bdd3cdc88ca19d9c219167741d..9f7f3969ba89d57b707f88fabaf739472b2ff71e 100644 (file)
@@ -44,28 +44,29 @@ static int MYDEBUG = 0;
 
 
 //---------------------------------------------------------------
-int
+size_t
 VISU::DeformedShape_i
 ::IsPossible(Result_i* theResult, 
             const std::string& theMeshName, 
-            VISU::Entity theEntity, 
+            VISU::Entity theEntity,
             const std::string& theFieldName, 
-            int theTimeStampNumber, 
-            int isMemoryCheck)
+            CORBA::Long theTimeStampNumber,
+            bool theIsMemoryCheck)
 {
   try{
-    bool aResult = TSuperClass::IsPossible(theResult,
-                                          theMeshName,
-                                          theEntity,
-                                          theFieldName,
-                                          theTimeStampNumber,
-                                          isMemoryCheck);
+    size_t aResult = TSuperClass::IsPossible(theResult,
+                                            theMeshName,
+                                            theEntity,
+                                            theFieldName,
+                                            theTimeStampNumber,
+                                            theIsMemoryCheck);
     if(aResult){
       VISU::Result_i::TInput* anInput = theResult->GetInput();
       VISU::PField aField = anInput->GetField(theMeshName,
                                              (VISU::TEntity)theEntity,
                                              theFieldName);
-      return aField->myNbComp > 1;
+      if(aField->myNbComp > 1)
+       return aResult;
     }
   }catch(std::exception& exc){
     INFOS("Follow exception was occured :\n"<<exc.what());
@@ -147,7 +148,7 @@ VISU::DeformedShape_i
 ::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
         const std::string& theFieldName, 
-        int theTimeStampNumber)
+        CORBA::Long theTimeStampNumber)
 {
   myIsColored = false;
   myColor.R = myColor.G = myColor.B = 0.5;
@@ -271,7 +272,7 @@ bool
 VISU::DeformedShape_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
 }
 
 
index 84d7e846d2cf811ce8e17d5f898cb6563c1d3788..3cf54aa3ec60efbc44ab5d30222fba80d83719c6 100644 (file)
@@ -111,20 +111,20 @@ namespace VISU
 
   public:
     static
-    int
+    size_t
     IsPossible(Result_i* theResult, 
               const std::string& theMeshName, 
               VISU::Entity theEntity,
               const std::string& theFieldName, 
-              int theTimeStampNumber, 
-              int isMemoryCheck = true);
+              CORBA::Long theTimeStampNumber,
+              bool theIsMemoryCheck);
 
     virtual 
     Storable* 
     Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
           const std::string& theFieldName, 
-          int theTimeStampNumber);
+          CORBA::Long theTimeStampNumber);
 
     static const std::string myComment;
 
index 0ced6ab82ef6b6f052fff9efc846e79ea0272d66..9a47812d07dfc0f4156f6df40bc462c2f6e58c73 100644 (file)
@@ -50,20 +50,18 @@ static int MYDEBUG = 0;
 #endif
 
 //----------------------------------------------------------------------------
-int
+size_t
 VISU::GaussPoints_i
 ::IsPossible(Result_i* theResult, 
             const std::string& theMeshName, 
-            VISU::Entity theEntity, 
+            VISU::Entity theEntity,
             const std::string& theFieldName, 
-            int theIteration, 
-            int isMemoryCheck)
+            CORBA::Long theTimeStampNumber,
+            bool theIsMemoryCheck)
 {
   try{
     if(theEntity != VISU::NODE)
-      return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
-    else
-      return false;
+      return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,theIsMemoryCheck);
   }catch(std::exception& exc){
     INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
@@ -131,11 +129,11 @@ VISU::GaussPoints_i
 VISU::Storable* 
 VISU::GaussPoints_i
 ::Create(const std::string& theMeshName, 
-        VISU::Entity theEntity, 
-        const std::string& theFieldName, 
-        int theIteration)
+          VISU::Entity theEntity,
+          const std::string& theFieldName, 
+          CORBA::Long theTimeStampNumber)
 {
-  TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
+  TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
 
@@ -537,7 +535,7 @@ bool
 VISU::GaussPoints_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
 }
 
 
index 98af17b3f239507108c887ad1fe2005a61a7a70c..51d4abcf4aeaa4fbb7a2c8a18b28411cbebf9079 100644 (file)
@@ -306,19 +306,19 @@ namespace VISU
 
   public:
     static 
-    int
+    size_t
     IsPossible(Result_i* theResult, 
               const std::string& theMeshName, 
               VISU::Entity theEntity,
               const std::string& theFieldName, 
-              int theIteration, 
-              int isMemoryCheck = true);
+              CORBA::Long theTimeStampNumber,
+              bool theIsMemoryCheck);
     virtual
     Storable* 
     Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
           const std::string& theFieldName, 
-          int theIteration);
+          CORBA::Long theTimeStampNumber);
 
     static const std::string myComment;
 
index bf5a8e0d1e9fedd32e1a939c629fe2099367c31b..ac7fd08fd224df0f77a27ee483c3871b9ee10d5e 100644 (file)
@@ -38,21 +38,21 @@ static int MYDEBUG = 0;
 #endif
 
 //---------------------------------------------------------------
-int
+size_t
 VISU::IsoSurfaces_i
 ::IsPossible(Result_i* theResult, 
             const std::string& theMeshName, 
-            VISU::Entity theEntity, 
+            VISU::Entity theEntity,
             const std::string& theFieldName, 
-            int theTimeStampNumber, 
-            int isMemoryCheck)
+            CORBA::Long theTimeStampNumber,
+            bool theIsMemoryCheck)
 {
   return TSuperClass::IsPossible(theResult,
                                 theMeshName,
                                 theEntity,
                                 theFieldName,
                                 theTimeStampNumber,
-                                isMemoryCheck);
+                                theIsMemoryCheck);
 }
 
 //---------------------------------------------------------------
@@ -105,7 +105,7 @@ VISU::IsoSurfaces_i
 ::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
         const std::string& theFieldName, 
-        int theTimeStampNumber)
+        CORBA::Long theTimeStampNumber)
 {
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
@@ -221,7 +221,7 @@ bool
 VISU::IsoSurfaces_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
 }
 
 //---------------------------------------------------------------
index 89985fcdd2b92c2a775c53997214b9b096eec404..93e4b8dfe629e4fd2d903b87c93f01d98abac970 100644 (file)
@@ -106,20 +106,20 @@ namespace VISU
 
   public:
     static
-    int
+    size_t
     IsPossible(Result_i* theResult, 
               const std::string& theMeshName, 
               VISU::Entity theEntity,
               const std::string& theFieldName, 
-              int theTimeStampNumber, 
-              int isMemoryCheck = true);
+              CORBA::Long theTimeStampNumber,
+              bool theIsMemoryCheck);
 
     virtual
     Storable* 
     Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
           const std::string& theFieldName, 
-          int theTimeStampNumber);
+          CORBA::Long theTimeStampNumber);
 
     static const std::string myComment;
 
index c958c2b123b8bc8bb5c2d90f09692b1d1a56e72c..a6ce4c96cab973d09cf7b5c57b586c34aabc48bc 100644 (file)
@@ -93,6 +93,15 @@ VISU::Mesh_i
 }
 
 
+//----------------------------------------------------------------------------
+void
+VISU::Mesh_i
+::SameAs(const Prs3d_i* theOrigin)
+{
+  return; // "SameAs" command for mesh is not valid in current architecture
+}
+
+
 //---------------------------------------------------------------
 void
 VISU::Mesh_i
@@ -119,28 +128,108 @@ VISU::Mesh_i
 
 
 //----------------------------------------------------------------------------
-void
+void 
 VISU::Mesh_i
-::SameAs(const Prs3d_i* theOrigin)
-{
-  return; // "SameAs" command for mesh is not valid in current architecture
+::SetCellColor(const SALOMEDS::Color& theColor) 
+{ 
+  myCellColor = theColor;
+}
+
+
+//----------------------------------------------------------------------------
+SALOMEDS::Color 
+VISU::Mesh_i
+::GetCellColor() 
+{ 
+  return myCellColor;
+}
+
+
+//----------------------------------------------------------------------------
+void 
+VISU::Mesh_i
+::SetNodeColor(const SALOMEDS::Color& theColor) 
+{ 
+  myNodeColor = theColor;
+}
+
+
+//----------------------------------------------------------------------------
+SALOMEDS::Color 
+VISU::Mesh_i
+::GetNodeColor() 
+{ 
+  return myNodeColor;
+}
+
+
+//----------------------------------------------------------------------------
+void 
+VISU::Mesh_i
+::SetLinkColor(const SALOMEDS::Color& theColor) 
+{ 
+  myLinkColor = theColor;
 }
 
 
+//----------------------------------------------------------------------------
+SALOMEDS::Color 
+VISU::Mesh_i
+::GetLinkColor() 
+{ 
+  return myLinkColor;
+}
+
 
 //----------------------------------------------------------------------------
-int
+void 
+VISU::Mesh_i
+::SetPresentationType(VISU::PresentationType theType) 
+{ 
+  myPresentType = theType;
+}
+
+
+//----------------------------------------------------------------------------
+VISU::PresentationType 
+VISU::Mesh_i
+::GetPresentationType() 
+{ 
+  return myPresentType;
+}
+
+
+//----------------------------------------------------------------------------
+VISU::Entity 
+VISU::Mesh_i
+::GetEntity() const
+{ 
+  return VISU::Entity(myEntity);
+}
+
+
+//----------------------------------------------------------------------------
+const std::string&
+VISU::Mesh_i
+::GetSubMeshName() const
+{ 
+  return mySubMeshName;
+}
+
+
+//----------------------------------------------------------------------------
+size_t
 VISU::Mesh_i
 ::IsPossible(Result_i* theResult, 
             const std::string& theMeshName,
             Entity theEntity, 
-            const char* theFamilyName)
+            const std::string& theFamilyName)
 {
   try{
     MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<"; theFamilyName = '"<<theFamilyName<<"'");
-    float aSize = INCMEMORY*
+    size_t aSize = INCMEMORY*
       theResult->GetInput()->GetMeshOnEntitySize(theMeshName,(VISU::TEntity)theEntity);
-    bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+    size_t aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
     MESSAGE("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
     return aResult;
   }catch(std::exception& exc){
@@ -151,11 +240,12 @@ VISU::Mesh_i
   return 0;
 }
 
+//----------------------------------------------------------------------------
 VISU::Storable* 
 VISU::Mesh_i
 ::Create(const std::string& theMeshName,
         Entity theEntity,
-        const char* theFamilyName)
+        const std::string& theFamilyName)
 {
   SetMeshName(theMeshName.c_str());
   myEntity = int(theEntity);//jfa IPAL9284
@@ -164,17 +254,18 @@ VISU::Mesh_i
 }
 
 
-int 
+//----------------------------------------------------------------------------
+size_t 
 VISU::Mesh_i
 ::IsPossible(Result_i* theResult, 
             const std::string& theMeshName, 
-            const char* theGroupName)
+            const std::string& theGroupName)
 {
   try{
     MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
-    float aSize = INCMEMORY*
+    size_t aSize = INCMEMORY*
       theResult->GetInput()->GetMeshOnGroupSize(theMeshName,theGroupName);
-    bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+    size_t aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
     INFOS("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
     return aResult;
   }catch(std::exception& exc){
@@ -186,10 +277,11 @@ VISU::Mesh_i
 }
 
 
+//----------------------------------------------------------------------------
 VISU::Storable* 
 VISU::Mesh_i
 ::Create(const std::string& theMeshName,
-        const char* theGroupName)
+        const std::string& theGroupName)
 {
   SetMeshName(theMeshName.c_str());
   myEntity = -1;//jfa IPAL9284
@@ -198,6 +290,7 @@ VISU::Mesh_i
 }
 
 
+//----------------------------------------------------------------------------
 VISU::Storable* 
 VISU::Mesh_i
 ::Restore(const Storable::TRestoringMap& theMap)
@@ -226,6 +319,7 @@ VISU::Mesh_i
 }
 
 
+//----------------------------------------------------------------------------
 void 
 VISU::Mesh_i
 ::ToStream(std::ostringstream& theStr)
@@ -252,6 +346,7 @@ VISU::Mesh_i
 }
 
 
+//----------------------------------------------------------------------------
 VISU::Mesh_i
 ::~Mesh_i()
 {
@@ -259,6 +354,7 @@ VISU::Mesh_i
 }
 
 
+//----------------------------------------------------------------------------
 VISU::Storable* 
 VISU::Mesh_i
 ::Build(int theRestoring)
@@ -360,6 +456,7 @@ VISU::Mesh_i
 }
 
 
+//----------------------------------------------------------------------------
 VISU_Actor* 
 VISU::Mesh_i
 ::CreateActor()
@@ -379,6 +476,7 @@ VISU::Mesh_i
 }
 
 
+//----------------------------------------------------------------------------
 void
 VISU::Mesh_i
 ::UpdateActor(VISU_Actor* theActor) 
@@ -392,3 +490,5 @@ VISU::Mesh_i
     anActor->GetNodeProperty()->SetColor(myNodeColor.R, myNodeColor.G, myNodeColor.B);
   }
 }
+
+//----------------------------------------------------------------------------
index 4a16acbf468b0dd78a0092dd033162b0952028c9..d27262a58605304bc8a2f304205c1d4e8e347232 100644 (file)
@@ -37,11 +37,12 @@ namespace VISU
                 public virtual Prs3d_i
   {
     static int myNbPresent;
-    Mesh_i();
     Mesh_i(const Mesh_i&);
+    Mesh_i();
 
   public:
     typedef Prs3d_i TSuperClass;
+    typedef VISU::Mesh TInterface;
 
     explicit
     Mesh_i(Result_i* theResult);
@@ -50,29 +51,64 @@ namespace VISU
     Mesh_i(Result_i* theResult,
           SALOMEDS::SObject_ptr theSObject);
 
-    virtual void SameAs(const Prs3d_i* theOrigin);
-    virtual ~Mesh_i();
-    virtual void RemoveFromStudy();
+    virtual
+    ~Mesh_i();
 
-    virtual VISU::VISUType GetType() { return VISU::TMESH;};
+    virtual
+    void
+    SameAs(const Prs3d_i* theOrigin);
 
-    virtual void SetCellColor(const SALOMEDS::Color& theColor) { myCellColor = theColor;}
-    virtual SALOMEDS::Color GetCellColor() { return myCellColor;}
+    virtual
+    void
+    RemoveFromStudy();
 
-    virtual void SetNodeColor(const SALOMEDS::Color& theColor) { myNodeColor = theColor;}
-    virtual SALOMEDS::Color GetNodeColor() { return myNodeColor;}
+    virtual
+    VISU::VISUType 
+    GetType() 
+    { 
+      return VISU::TMESH;
+    }
 
-    virtual void SetLinkColor(const SALOMEDS::Color& theColor) { myLinkColor = theColor;}
-    virtual SALOMEDS::Color GetLinkColor() { return myLinkColor;}
+    virtual 
+    void 
+    SetCellColor(const SALOMEDS::Color& theColor);
 
-    virtual void SetPresentationType(VISU::PresentationType theType) { myPresentType = theType;}
-    virtual PresentationType GetPresentationType() { return myPresentType;}
+    virtual 
+    SALOMEDS::Color 
+    GetCellColor();
 
-    typedef VISU::Mesh TInterface;
-    VISU_MeshPL* GetMeshPL(){ return myMeshPL;}
+    virtual 
+    void 
+    SetNodeColor(const SALOMEDS::Color& theColor);
+
+    virtual 
+    SALOMEDS::Color 
+    GetNodeColor();
+
+    virtual 
+    void 
+    SetLinkColor(const SALOMEDS::Color& theColor);
+
+    virtual 
+    SALOMEDS::Color 
+    GetLinkColor();
+
+    virtual 
+    void
+    SetPresentationType(VISU::PresentationType theType);
+
+    virtual
+    VISU::PresentationType 
+    GetPresentationType();
+
+    VISU_MeshPL* GetSpecificPL() const
+    { 
+      return myMeshPL;
+    }
 
   protected:
-    Storable* Build(int theRestoring);
+    Storable* 
+    Build(int theRestoring);
 
     VISU_MeshPL* myMeshPL;
 
@@ -81,30 +117,64 @@ namespace VISU
     VISU::VISUType myType;
 
     VISU::PresentationType myPresentType;
-    struct SALOMEDS::Color myCellColor, myNodeColor, myLinkColor;
+    SALOMEDS::Color myCellColor;
+    SALOMEDS::Color myNodeColor;
+    SALOMEDS::Color myLinkColor;
 
   public:
-    static int IsPossible(Result_i* theResult, const std::string& theMeshName,
-                         Entity theEntity, const char* theFamilyName = "");
-    virtual Storable* Create(const std::string& theMeshName, Entity theEntity, const char* theFamilyName = "");
-
-    static int IsPossible(Result_i* theResult, const std::string& theMeshName, const char* theGroupName);
-    virtual Storable* Create(const std::string& theMeshName, const char* theGroupName);
+    static 
+    size_t
+    IsPossible(Result_i* theResult, 
+              const std::string& theMeshName,
+              VISU::Entity theEntity, 
+              const std::string& theFamilyName = "");
+    virtual 
+    Storable* 
+    Create(const std::string& theMeshName, 
+          VISU::Entity theEntity, 
+          const std::string& theFamilyName = "");
+
+    static 
+    size_t
+    IsPossible(Result_i* theResult, 
+              const std::string& theMeshName, 
+              const std::string& theGroupName);
+    virtual 
+    Storable* 
+    Create(const std::string& theMeshName, 
+          const std::string& theGroupName);
+
+    VISU::Entity
+    GetEntity() const;
+
+    const std::string& 
+    GetSubMeshName() const;
+
+    virtual
+    void
+    ToStream(std::ostringstream& theStr);
+
+    virtual
+    const char* 
+    GetComment() const;
 
-    VISU::Entity GetEntity() const { return VISU::Entity(myEntity);}
-    const string& GetSubMeshName() const { return mySubMeshName;}
-
-    virtual void ToStream(std::ostringstream& theStr);
-
-    virtual const char* GetComment() const;
     static const std::string myComment;
-    virtual QString GenerateName();
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+    virtual
+    QString
+    GenerateName();
+
+    virtual
+    Storable* 
+    Restore(const Storable::TRestoringMap& theMap);
 
-    virtual VISU_Actor* CreateActor();
+    virtual
+    VISU_Actor* 
+    CreateActor();
 
-    virtual void UpdateActor(VISU_Actor* theActor);
+    virtual
+    void 
+    UpdateActor(VISU_Actor* theActor);
   };
 }
 
index b76c1a0f7240fb4ca5cddf355f2fbda52ed9f353..2d4d8696ea5575310f41abe08a63b522515b8cfe 100644 (file)
@@ -32,21 +32,21 @@ static int MYDEBUG = 0;
 
 
 //---------------------------------------------------------------
-in
+size_
 VISU::Plot3D_i
 ::IsPossible(Result_i* theResult, 
             const std::string& theMeshName, 
-            VISU::Entity theEntity, 
+            VISU::Entity theEntity,
             const std::string& theFieldName, 
-            int theTimeStampNumber, 
-            int isMemoryCheck)
+            CORBA::Long theTimeStampNumber,
+            bool theIsMemoryCheck)
 {
   return TSuperClass::IsPossible(theResult,
                                 theMeshName,
                                 theEntity,
                                 theFieldName,
                                 theTimeStampNumber,
-                                isMemoryCheck);
+                                theIsMemoryCheck);
 }
 
 //---------------------------------------------------------------
@@ -101,7 +101,7 @@ VISU::Plot3D_i
 ::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
         const std::string& theFieldName, 
-        int theTimeStampNumber)
+        CORBA::Long theTimeStampNumber)
 {
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
@@ -294,7 +294,7 @@ bool
 VISU::Plot3D_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
 }
 
 //---------------------------------------------------------------
index 906aa6a96a09a8350f2cc84bbb0ad2adbdbde97b..4a34b4ca1568146e668207548ec140ad0d8bca61 100644 (file)
@@ -130,20 +130,20 @@ namespace VISU
 
   public:
     static
-    int
+    size_t
     IsPossible(Result_i* theResult, 
               const std::string& theMeshName, 
               VISU::Entity theEntity,
               const std::string& theFieldName, 
-              int theTimeStampNumber, 
-              int isMemoryCheck = true);
+              CORBA::Long theTimeStampNumber,
+              bool theIsMemoryCheck);
 
     virtual 
     Storable* 
     Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
           const std::string& theFieldName, 
-          int theTimeStampNumber);
+          CORBA::Long theTimeStampNumber);
 
     virtual
     void
index 367f24bf01cce4eac235f7ed671be6f27e545206..ef12cf31e6c85f277eb1908db4b4755a6512da41 100644 (file)
@@ -924,13 +924,13 @@ VISU::Result_i
 
 
 //---------------------------------------------------------------
-int
+size_t
 VISU::Result_i
 ::IsPossible()
 {
   try{
     float aSize = myInput->GetSize();
-    bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+    size_t aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
     MESSAGE("Result_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<float(aResult));
     return aResult;
   }catch(std::exception& exc){
index e60c748d209d4bbcd1f8aebbd660790de8292cc0..370d146d98dc4dff145348a2194ea3087166f0e8 100644 (file)
@@ -137,7 +137,7 @@ namespace VISU
     CORBA::Boolean myIsAllDone;
 
   public:
-    virtual int IsPossible();
+    virtual size_t IsPossible();
 
     virtual Storable* Create(const char* theFileName);
     virtual Storable* Create(SALOMEDS::SObject_ptr theMedSObject);
index 87a41fa69915d38318ba720b3c7b6cc951f8f7a3..b4c68d1f837e3435ea64220ec58012fbc3985eef 100644 (file)
@@ -50,16 +50,16 @@ static int INCMEMORY = 4+12;
 
 
 //---------------------------------------------------------------
-int
+size_t
 VISU::ScalarMapOnDeformedShape_i
 ::IsPossible(Result_i* theResult, 
             const std::string& theMeshName, 
-            VISU::Entity theEntity, 
+            VISU::Entity theEntity,
             const std::string& theFieldName, 
-            int theTimeStampNumber, 
-            int isMemoryCheck)
+            CORBA::Long theTimeStampNumber,
+            bool theIsMemoryCheck)
 {
-  bool aResult = false;
+  size_t aResult = 0;
   try{
     aResult = TSuperClass::IsPossible(theResult,
                                      theMeshName,
@@ -67,17 +67,17 @@ VISU::ScalarMapOnDeformedShape_i
                                      theFieldName,
                                      theTimeStampNumber,
                                      false);
-    if(isMemoryCheck && aResult){
+    if(theIsMemoryCheck && aResult){
       VISU::Result_i::TInput* anInput = theResult->GetInput();
       const VISU::PField aField = anInput->GetField(theMeshName,
                                                    (VISU::TEntity)theEntity,
                                                    theFieldName);
       if(aField->myNbComp <= 1)
-       return false;
-      float aSize = anInput->GetTimeStampSize(theMeshName,
-                                             (VISU::TEntity)theEntity,
-                                             theFieldName,
-                                             theTimeStampNumber);
+       return 0;
+      size_t aSize = anInput->GetTimeStampSize(theMeshName,
+                                              (VISU::TEntity)theEntity,
+                                              theFieldName,
+                                              theTimeStampNumber);
       aSize *= INCMEMORY;
       aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
       MESSAGE("ScalarMapOnDeformedShape_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
@@ -141,7 +141,7 @@ VISU::ScalarMapOnDeformedShape_i
 ::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
         const std::string& theFieldName, 
-        int theTimeStampNumber)
+        CORBA::Long theTimeStampNumber)
 {
   myIsColored = true;
   myColor.R = myColor.G = myColor.B = 0.5;
@@ -309,7 +309,7 @@ bool
 VISU::ScalarMapOnDeformedShape_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
 }
 
 
index 033df7b06b4312046f2ca14e077ba75fc88a0797..7a6ad5154fc48a42ed95880f172ffc65a9307710 100644 (file)
@@ -117,13 +117,13 @@ namespace VISU
   public:
     //! Redefines VISU_ColoredPrs3d_i::IsPossible
     static
-    int
+    size_t
     IsPossible(Result_i* theResult, 
-                  const std::string& theMeshName, 
-                  VISU::Entity theEntity,
-                  const std::string& theFieldName, 
-                  int theTimeStampNumber, 
-                  int isMemoryCheck = true);
+              const std::string& theMeshName, 
+              VISU::Entity theEntity,
+              const std::string& theFieldName, 
+              CORBA::Long theTimeStampNumber,
+              bool theIsMemoryCheck);
 
     //! Redefines VISU_ColoredPrs3d_i::IsPossible
     virtual
@@ -131,7 +131,7 @@ namespace VISU
     Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
           const std::string& theFieldName, 
-          int theTimeStampNumber);
+          CORBA::Long theTimeStampNumber);
 
     //! Redefines VISU_ColoredPrs3d_i::ToStream
     virtual
index 881aec5f1c63685b60dc1019fa18f6f9a21223db..9ec1a92662263d6ff0fd54dfe3390346c9283f30 100644 (file)
@@ -48,17 +48,17 @@ static int INCMEMORY = 4;
 
 
 //----------------------------------------------------------------------------
-int
+size_t
 VISU::ScalarMap_i
 ::IsPossible(Result_i* theResult, 
             const std::string& theMeshName, 
             VISU::Entity theEntity, 
             const std::string& theFieldName, 
-            int theTimeStampNumber, 
-            int isMemoryCheck)
+            CORBA::Long theTimeStampNumber, 
+            bool theIsMemoryCheck)
 {
+  size_t aResult = 0;
   try{
-    bool aResult = true;
     if(theResult){
       VISU::Result_i::TInput* anInput = theResult->GetInput();
       float aSize = anInput->GetTimeStampSize(theMeshName,
@@ -66,18 +66,19 @@ VISU::ScalarMap_i
                                              theFieldName,
                                              theTimeStampNumber);
       aSize *= INCMEMORY;
-      if(isMemoryCheck){
+      aResult = 1;
+      if(theIsMemoryCheck){
        aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
-       if(MYDEBUG) MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+       if(MYDEBUG) 
+         MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
       }
     }
-    return aResult;
   }catch(std::exception& exc){
     INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
     INFOS("Unknown exception was occured!");
   }
-  return 0;
+  return aResult;
 }
 
 //----------------------------------------------------------------------------
@@ -155,7 +156,7 @@ VISU::ScalarMap_i
 ::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
         const std::string& theFieldName, 
-        int theTimeStampNumber)
+        CORBA::Long theTimeStampNumber)
 {
   TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 
@@ -296,7 +297,7 @@ bool
 VISU::ScalarMap_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
 }
 
 
index 978e552fb1fb6b776457b96a6073ddd020e4581e..94cb91cea6d82536ff5d0b92abb72790bca78db6 100644 (file)
@@ -104,13 +104,13 @@ namespace VISU
       with the given basic parameters or not.
     */
     static
-    int
+    size_t
     IsPossible(Result_i* theResult, 
               const std::string& theMeshName, 
               VISU::Entity theEntity,
               const std::string& theFieldName, 
-              int theTimeStampNumber, 
-              int isMemoryCheck = true);
+              CORBA::Long theTimeStampNumber,
+              bool theIsMemoryCheck);
 
     //! Redefines VISU_ColoredPrs3d_i::Create
     virtual
@@ -118,7 +118,7 @@ namespace VISU
     Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
           const std::string& theFieldName, 
-          int theTimeStampNumber);
+          CORBA::Long theTimeStampNumber);
 
     virtual 
     void
index d3d6c26188a344530a35860c2ba43dfe24558ea4..f830214a9c1d7da3783549fdcd4cff3af0e5fe93 100644 (file)
@@ -45,14 +45,14 @@ static int MYDEBUG = 0;
 
 
 //---------------------------------------------------------------
-int
+size_t
 VISU::StreamLines_i
 ::IsPossible(Result_i* theResult, 
             const std::string& theMeshName, 
-            VISU::Entity theEntity, 
+            VISU::Entity theEntity,
             const std::string& theFieldName, 
-            int theTimeStampNumber, 
-            int isMemoryCheck)
+            CORBA::Long theTimeStampNumber,
+            bool theIsMemoryCheck)
 {
   try{
     if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,false)) 
@@ -62,7 +62,7 @@ VISU::StreamLines_i
     VISU::PIDMapper anIDMapper = 
       anInput->GetTimeStampOnMesh(theMeshName,VISU::TEntity(theEntity),theFieldName,theTimeStampNumber);
     VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
-    bool aResult = VISU_StreamLinesPL::IsPossible(aDataSet);
+    size_t aResult = VISU_StreamLinesPL::IsPossible(aDataSet);
     MESSAGE("StreamLines_i::IsPossible - aResult = "<<aResult);
     return aResult;
   }catch(std::exception& exc){
@@ -143,7 +143,7 @@ VISU::StreamLines_i
 ::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
         const std::string& theFieldName, 
-        int theTimeStampNumber)
+        CORBA::Long theTimeStampNumber)
 {
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
@@ -353,7 +353,7 @@ bool
 VISU::StreamLines_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
 }
 
 
index edf55fbe9dbc9cdab74973b2168f24c4f5b2518b..6aec9ba0e51d926bacec085fdf697c84907783a7 100644 (file)
@@ -134,13 +134,13 @@ namespace VISU
   public:
     //! Extends VISU_ColoredPrs3d_i::IsPossible
     static 
-    int
+    size_t
     IsPossible(Result_i* theResult, 
               const std::string& theMeshName, 
               VISU::Entity theEntity,
               const std::string& theFieldName, 
-              int theTimeStampNumber, 
-              int isMemoryCheck = true);
+              CORBA::Long theTimeStampNumber,
+              bool theIsMemoryCheck);
 
     //! Extends VISU_ColoredPrs3d_i::Create
     virtual
@@ -148,7 +148,7 @@ namespace VISU
     Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
           const std::string& theFieldName, 
-          int theTimeStampNumber);
+          CORBA::Long theTimeStampNumber);
 
     //! Extends VISU_ColoredPrs3d_i::ToStream
     virtual
index 0657e52840fc471f902fa5787f9d1c7b8275420b..13705bc0d6fd0975ff7586a431e75d26bb5c0eef 100644 (file)
@@ -1116,7 +1116,7 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField)
     aData.myPrs[0]->GetOffset(aData.myOffset);
     for (int i = 1; i < aData.myNbFrames; i++) {
       //jfa 03.08.2005:aData.myPrs[i]->SameAs(aData.myPrs[0]);
-      aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005
+      aData.myPrs[i]->SameAs(aData.myPrs[0]);//jfa 03.08.2005
     }
   }
   string aStr = aAnimSObject->GetID();
index f7634ac73485410c3a1e3fde0658bbce5f4da727..5be3f8309333d4b4ca4c47ea2612519b83586ff0 100644 (file)
@@ -45,16 +45,16 @@ static int INCMEMORY = 4+12;
 
 
 //---------------------------------------------------------------
-in
+size_
 VISU::Vectors_i
 ::IsPossible(Result_i* theResult, 
             const std::string& theMeshName, 
-            VISU::Entity theEntity, 
+            VISU::Entity theEntity,
             const std::string& theFieldName, 
-            int theTimeStampNumber, 
-            int isMemoryCheck)
+            CORBA::Long theTimeStampNumber,
+            bool theIsMemoryCheck)
 {
-  bool aResult = false;
+  size_t aResult = 0;
   try{
     aResult = TSuperClass::IsPossible(theResult,
                                      theMeshName,
@@ -62,7 +62,7 @@ VISU::Vectors_i
                                      theFieldName,
                                      theTimeStampNumber,
                                      false);
-    if(isMemoryCheck && aResult){
+    if(theIsMemoryCheck && aResult){
       VISU::Result_i::TInput* anInput = theResult->GetInput();
       float aSize = anInput->GetTimeStampSize(theMeshName,
                                              (VISU::TEntity)theEntity,
@@ -150,7 +150,7 @@ VISU::Vectors_i
 ::Create(const std::string& theMeshName, 
         VISU::Entity theEntity,
         const std::string& theFieldName, 
-        int theTimeStampNumber)
+        CORBA::Long theTimeStampNumber)
 {
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
@@ -275,7 +275,7 @@ bool
 VISU::Vectors_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
 }
 
 //---------------------------------------------------------------
index e83613b70ccf6ec961095676880a3f1f6c8aa3b5..80bdc0515a4948fbf2de363269b06bdc1b17663b 100644 (file)
@@ -116,12 +116,13 @@ namespace VISU
   public:
     //! Redefines VISU_ColoredPrs3d_i::IsPossible
     static 
-    int IsPossible(Result_i* theResult, 
-                  const std::string& theMeshName, 
-                  VISU::Entity theEntity,
-                  const std::string& theFieldName, 
-                  int theTimeStampNumber, 
-                  int isMemoryCheck = true);
+    size_t 
+    IsPossible(Result_i* theResult, 
+              const std::string& theMeshName, 
+              VISU::Entity theEntity,
+              const std::string& theFieldName, 
+              CORBA::Long theTimeStampNumber,
+              bool theIsMemoryCheck);
 
     //! Redefines VISU_ColoredPrs3d_i::Create
     virtual
@@ -129,7 +130,7 @@ namespace VISU
     Create(const std::string& theMeshName, 
           VISU::Entity theEntity,
           const std::string& theFieldName, 
-          int theTimeStampNumber);
+          CORBA::Long theTimeStampNumber);
 
     //! Redefines VISU_ColoredPrs3d_i::ToStream
     virtual