]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To fix a regression with wrong cashing of timestamp's data
authorapo <apo@opencascade.com>
Fri, 30 Sep 2005 06:18:00 +0000 (06:18 +0000)
committerapo <apo@opencascade.com>
Fri, 30 Sep 2005 06:18:00 +0000 (06:18 +0000)
src/CONVERTOR/VISUConvertor.cxx
src/CONVERTOR/VISU_Convertor.hxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_Convertor_impl.hxx
src/CONVERTOR/VISU_MedConvertor.cxx
src/OBJECT/VISU_GaussPtsAct.cxx
src/PIPELINE/VISU_GaussPointsPL.cxx
src/PIPELINE/VISU_GaussPointsPL.hxx
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_GaussPoints_i.hh

index 897e7a81578b1a482966e4ecbfd41707b0cf5b7d..25aa1b328161fce0cb97827fec0d25dab041cbc7 100644 (file)
@@ -85,7 +85,7 @@ void parseFile(const char* theFileName)
            int aTimeStamp = aValFieldIter->first;
 
            if(anEntity != VISU::NODE_ENTITY){
-             VISU::PGaussMesh aGaussMesh = 
+             VISU::PGaussPtsIDMapper aGaussMesh = 
                aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
              VISU::TVTKOutput* aDataSet = aGaussMesh->GetVTKOutput();
              
index 7fa63b582aea7d59e1437ced415dbe4f91c8a9d5..d9145a7c94702e55f35a01483f494f2bc7a44792 100644 (file)
@@ -234,7 +234,7 @@ public:
   GetSize() = 0;
 
   virtual
-  VISU::PIDMapper 
+  VISU::PNamedIDMapper 
   GetMeshOnEntity(const std::string& theMeshName, 
                  const VISU::TEntity& theEntity) = 0;
   
@@ -271,7 +271,7 @@ public:
                     int theStampsNum) = 0;
 
   virtual
-  VISU::PGaussMesh 
+  VISU::PGaussPtsIDMapper 
   GetTimeStampOnGaussPts(const std::string& theMeshName, 
                         const VISU::TEntity& theEntity,
                         const std::string& theFieldName,
index 30f24fedd91864655f77ed67430bc8671f6028d7..196b65bc95e96f166c748701c284245f6b143a5d 100644 (file)
@@ -369,11 +369,11 @@ namespace VISU
 
   //---------------------------------------------------------------
   TVTKOutput* 
-  TProfileMergeFilter
+  TIDMapperFilter
   ::GetVTKOutput()
   {
     if(!myFilter.GetPointer()){
-      const TVTKAppendFilter& anAppendFilter = myProfile.GetFilter();
+      const TVTKAppendFilter& anAppendFilter = myIDMapper.GetFilter();
       TVTKOutput* aGeometry = anAppendFilter->GetOutput();
       
       const TVTKSource& aSource = mySource.GetSource();
@@ -390,45 +390,45 @@ namespace VISU
   }
 
   vtkIdType
-  TProfileMergeFilter
+  TIDMapperFilter
   ::GetNodeObjID(vtkIdType theID) const
   {
-    return myProfile.GetNodeObjID(theID);
+    return myIDMapper.GetNodeObjID(theID);
   }
   
   vtkIdType
-  TProfileMergeFilter
+  TIDMapperFilter
   ::GetNodeVTKID(vtkIdType theID) const
   {
-    return myProfile.GetNodeVTKID(theID);
+    return myIDMapper.GetNodeVTKID(theID);
   }
 
   float*  
-  TProfileMergeFilter
+  TIDMapperFilter
   ::GetNodeCoord(vtkIdType theObjID)
   {
-    return myProfile.GetNodeCoord(theObjID);
+    return myIDMapper.GetNodeCoord(theObjID);
   }
 
   vtkIdType
-  TProfileMergeFilter
+  TIDMapperFilter
   ::GetElemObjID(vtkIdType theID) const
   {
-    return myProfile.GetElemObjID(theID);
+    return myIDMapper.GetElemObjID(theID);
   }
 
   vtkIdType
-  TProfileMergeFilter
+  TIDMapperFilter
   ::GetElemVTKID(vtkIdType theID) const
   {
-    return myProfile.GetElemVTKID(theID);
+    return myIDMapper.GetElemVTKID(theID);
   }
 
   vtkCell* 
-  TProfileMergeFilter
+  TIDMapperFilter
   ::GetElemCell(vtkIdType theObjID)
   {
-    return myProfile.GetElemCell(theObjID);
+    return myIDMapper.GetElemCell(theObjID);
   }
   
 
@@ -473,7 +473,7 @@ namespace VISU
 
   TGaussPointID 
   TGaussMeshImpl
-  ::GetObjID(int theID) const
+  ::GetObjID(vtkIdType theID) const
   {
     const TVTKAppendFilter& anAppendFilter = GetFilter();
     vtkIdType anInputDataSetID;
@@ -496,6 +496,23 @@ namespace VISU
     return myParent;
   }
 
+
+  //---------------------------------------------------------------
+  TGaussPointID 
+  TGaussPtsIDFilter
+  ::GetObjID(vtkIdType theID) const
+  {
+    return myGaussPtsIDMapper->GetObjID(theID);
+  }
+  
+  TNamedIDMapper* 
+  TGaussPtsIDFilter::
+  GetParent()
+  {
+    return myGaussPtsIDMapper->GetParent();
+  }
+
+
   //---------------------------------------------------------------
   vtkIdType
   TSubMeshImpl
@@ -773,7 +790,8 @@ namespace VISU
   //---------------------------------------------------------------
   TValForTimeImpl
   ::TValForTimeImpl():
-    myProfileMergeFilter(new TProfileMergeFilter())
+    myGaussPtsIDFilter(new TGaussPtsIDFilter()),
+    myIDMapperFilter(new TIDMapperFilter())
   {}
 
   const TMeshValue& 
@@ -1603,7 +1621,7 @@ VISU_Convertor_impl
 
 
 //---------------------------------------------------------------
-VISU::PIDMapper 
+VISU::PNamedIDMapper 
 VISU_Convertor_impl
 ::GetMeshOnEntity(const string& theMeshName, 
                  const VISU::TEntity& theEntity)
@@ -1842,11 +1860,11 @@ VISU_Convertor_impl
   PFieldImpl aField = boost::get<3>(aFindTimeStamp);
 
   //Main part of code
-  PProfileMergeFilter aProfileMergeFilter = aValForTime->myProfileMergeFilter;
+  PIDMapperFilter anIDMapperFilter = aValForTime->myIDMapperFilter;
 #ifndef _DEXCEPT_
   try{
 #endif
-    if(!aProfileMergeFilter->myIsVTKDone){
+    if(!anIDMapperFilter->myIsVTKDone){
       LoadValForTimeOnMesh(aMesh,aMeshOnEntity,aField,aValForTime);
 
       try{
@@ -1868,12 +1886,12 @@ VISU_Convertor_impl
        aProfileSource.myIsVTKDone = true;
       }
 
-      aProfileMergeFilter->myProfile = aProfile;
-      TVTKOutput* anOutput = aProfileMergeFilter->GetVTKOutput();
-      const TVTKSource& aSource = aProfileMergeFilter->mySource.GetSource();
+      anIDMapperFilter->myIDMapper = aProfile;
+      TVTKOutput* anOutput = anIDMapperFilter->GetVTKOutput();
+      const TVTKSource& aSource = anIDMapperFilter->mySource.GetSource();
       GetTimeStampOnProfile(aSource,aField,aValForTime);
 
-      aProfileMergeFilter->myIsVTKDone = true;
+      anIDMapperFilter->myIsVTKDone = true;
 
       if(MYDEBUGWITHFILES){
        string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
@@ -1901,12 +1919,12 @@ VISU_Convertor_impl
   }
 #endif
 
-  return aProfileMergeFilter;
+  return anIDMapperFilter;
 }
 
 
 //---------------------------------------------------------------
-VISU::PGaussMesh 
+VISU::PGaussPtsIDMapper 
 VISU_Convertor_impl
 ::GetTimeStampOnGaussPts(const string& theMeshName, 
                         const VISU::TEntity& theEntity,
@@ -1933,26 +1951,29 @@ VISU_Convertor_impl
   PFieldImpl aField = boost::get<3>(aFindTimeStamp);
 
   //Main part of code
-  PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh;
-  TSource& aGaussPtsSource = aGaussMesh->mySource;
+  PGaussPtsIDFilter aGaussPtsIDFilter = aValForTime->myGaussPtsIDFilter;
 #ifndef _DEXCEPT_
   try{
 #endif
-    if(!aGaussPtsSource.myIsVTKDone){
+    if(!aGaussPtsIDFilter->myIsVTKDone){
       LoadValForTimeOnGaussPts(aMesh,aMeshOnEntity,aField,aValForTime);
       
       GetMeshOnEntity(aVTKMeshOnEntity->myMeshName,aVTKMeshOnEntity->myEntity);
       
       PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh;
-      const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
-      BuildGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
+      TSource& aGaussPtsSource = aGaussMesh->mySource;
+      if(!aGaussPtsSource.myIsVTKDone){
+       BuildGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
+       aGaussPtsSource.myIsVTKDone = true;
+      }
       
-      const TVTKAppendFilter& anAppendFilter = aGaussMesh->GetFilter();
-      const TVTKSource& aSource = aGaussPtsSource.GetSource();
-      aSource->ShallowCopy(anAppendFilter->GetOutput());
+      aGaussPtsIDFilter->myIDMapper = aGaussMesh;
+      aGaussPtsIDFilter->myGaussPtsIDMapper = aGaussMesh;
+      TVTKOutput* anOutput = aGaussPtsIDFilter->GetVTKOutput();
+      const TVTKSource& aSource = aGaussPtsIDFilter->mySource.GetSource();
       GetTimeStampOnGaussMesh(aSource,aField,aValForTime);
 
-      aGaussPtsSource.myIsVTKDone = true;
+      aGaussPtsIDFilter->myIsVTKDone = true;
 
       if(MYDEBUGWITHFILES){
        string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
@@ -1960,16 +1981,16 @@ VISU_Convertor_impl
        string aPrefix = string(getenv("HOME"))+"/"+getenv("USER")+"-";
        string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) + 
          aFieldName + dtos("-%d",theStampsNum) + "-Conv.vtk";
-       VISU::WriteToFile(aSource.GetPointer(),aFileName);
+       VISU::WriteToFile(anOutput,aFileName);
       }
       if(MYVTKDEBUG){
        GetTimeStampSize(theMeshName,theEntity,theFieldName,theStampsNum);
-       aSource->Update();
+       anOutput->Update();
        if(theEntity == VISU::NODE_ENTITY)
-         BEGMSG(MYVTKDEBUG,"GetPointData() = "<<float(aSource->GetPointData()->GetActualMemorySize()*1000)<<endl);
+         BEGMSG(MYVTKDEBUG,"GetPointData() = "<<float(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
        else
-         BEGMSG(MYVTKDEBUG,"GetCellData() = "<<float(aSource->GetCellData()->GetActualMemorySize()*1000)<<endl);
-       BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<float(aSource->GetActualMemorySize()*1000)<<endl);
+         BEGMSG(MYVTKDEBUG,"GetCellData() = "<<float(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
+       BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<float(anOutput->GetActualMemorySize()*1000)<<endl);
       }
     }
 #ifndef _DEXCEPT_
@@ -1980,7 +2001,7 @@ VISU_Convertor_impl
   }
 #endif
 
-  return aGaussMesh;
+  return aGaussPtsIDFilter;
 }
 
 //---------------------------------------------------------------
index 6ecb9b6952717d0824e6a0254e80e16e3a170223..c7d231a0837d3cf2cb5da71bee5aceeccf947632 100644 (file)
@@ -280,9 +280,9 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TProfileMergeFilter: virtual TMergeFilter
-  { 
-    TProfileImpl myProfile;
+  struct TIDMapperFilter: virtual TMergeFilter
+  {
+    TAppendFilter myIDMapper;
     TSource mySource;
 
     virtual 
@@ -313,7 +313,7 @@ namespace VISU
     TVTKOutput* 
     GetVTKOutput();
   };
-  typedef SharedPtr<TProfileMergeFilter> PProfileMergeFilter;
+  typedef SharedPtr<TIDMapperFilter> PIDMapperFilter;
 
 
   //---------------------------------------------------------------
@@ -372,6 +372,22 @@ namespace VISU
   typedef SharedPtr<TGaussMeshImpl> PGaussMeshImpl;
 
 
+  struct TGaussPtsIDFilter: virtual TIDMapperFilter,
+                           virtual TGaussPtsIDMapper
+  { 
+    PGaussPtsIDMapper myGaussPtsIDMapper;
+
+    virtual 
+    TGaussPointID 
+    GetObjID(vtkIdType theID) const;
+
+    virtual 
+    TNamedIDMapper*
+    GetParent();
+  };
+  typedef SharedPtr<TGaussPtsIDFilter> PGaussPtsIDFilter;
+
+
   //---------------------------------------------------------------
   typedef TVector<vtkIdType> TConnect;
   typedef TVector<TConnect> TCell2Connect;
@@ -562,7 +578,8 @@ namespace VISU
 
   struct TValForTimeImpl: virtual TValForTime
   {
-    PProfileMergeFilter myProfileMergeFilter;
+    PGaussPtsIDFilter myGaussPtsIDFilter;
+    PIDMapperFilter myIDMapperFilter;
     TGeom2Value myGeom2Value;
     vtkIdType myNbGauss;
    
@@ -607,7 +624,7 @@ public:
   GetSize();
 
   virtual 
-  VISU::PIDMapper 
+  VISU::PNamedIDMapper 
   GetMeshOnEntity(const std::string& theMeshName, 
                  const VISU::TEntity& theEntity);
 
@@ -653,7 +670,7 @@ public:
                   int theStampsNum);
 
   virtual
-  VISU::PGaussMesh 
+  VISU::PGaussPtsIDMapper 
   GetTimeStampOnGaussPts(const std::string& theMeshName, 
                         const VISU::TEntity& theEntity,
                         const std::string& theFieldName,
index 474b9c92e16af5343675c9047aa65fde91be3cc0..c0530b21799b45bc1172b02747dc044830cdaee8 100644 (file)
@@ -1952,14 +1952,14 @@ VISU_MedConvertor
                       VISU::PMEDField theField, 
                       VISU::PMEDValForTime theValForTime)
 {
-  PProfileMergeFilter aProfileMergeFilter = theValForTime->myProfileMergeFilter;
+  PIDMapperFilter anIDMapperFilter = theValForTime->myIDMapperFilter;
   return LoadValForTime(theMed,
                        theMesh,
                        theMeshOnEntity,
                        theField,
                        theValForTime,
                        false,
-                       aProfileMergeFilter->myIsVTKDone);
+                       anIDMapperFilter->myIsVTKDone);
 }
 
 
@@ -1972,13 +1972,12 @@ VISU_MedConvertor
                           VISU::PMEDField theField, 
                           VISU::PMEDValForTime theValForTime)
 {
-  PGaussMeshImpl aGaussMesh = theValForTime->myGaussMesh;
-  TSource& aGaussPtsSource = aGaussMesh->mySource;
+  PGaussPtsIDFilter aGaussPtsIDFilter = theValForTime->myGaussPtsIDFilter;
   return LoadValForTime(theMed,
                        theMesh,
                        theMeshOnEntity,
                        theField,
                        theValForTime,
                        true,
-                       aGaussPtsSource.myIsDone);
+                       aGaussPtsIDFilter->myIsVTKDone);
 }
index d80157ca045051de4d846769867b0fdeffbb1a81..3fa5a171a527c47505b7bd74e303e6053f47c1e0 100644 (file)
@@ -531,8 +531,8 @@ VISU_GaussPtsAct
          std::ostringstream aStr;
          aStr<<"Global ID: "<<anObjId;
 
-         const VISU::PGaussMesh& aGaussMesh = myGaussPointsPL->GetGaussMesh();
-         VISU::TNamedIDMapper* aParent = aGaussMesh->GetParent();
+         const VISU::PGaussPtsIDMapper& aGaussPtsIDMapper = myGaussPointsPL->GetGaussPtsIDMapper();
+         VISU::TNamedIDMapper* aParent = aGaussPtsIDMapper->GetParent();
 
          VISU::TGaussPointID aGaussPointID = myGaussPointsPL->GetObjID(anObjId);
          VISU::TCellID aCellID = aGaussPointID.first;
@@ -678,14 +678,14 @@ VISU_GaussPtsAct
        if(aSelectionMode == CellSelection){
          // Hilighting an element from the parent Mesh
          if(theSelector->HasIndex(myIO)){
-           const VISU::PGaussMesh& aGaussMesh = myGaussPointsPL->GetGaussMesh();
-           VISU::TNamedIDMapper* aParent = aGaussMesh->GetParent();
+           const VISU::PGaussPtsIDMapper& aGaussPtsIDMapper = myGaussPointsPL->GetGaussPtsIDMapper();
+           VISU::TNamedIDMapper* aParent = aGaussPtsIDMapper->GetParent();
 
            myCellSource->Reset();
            myCellSource->Modified(); // a VTK bug
            myCellSource->SetPoints(aParent->GetVTKOutput()->GetPoints());
 
-           VISU::TGaussPointID aGaussPointID = aGaussMesh->GetObjID(anObjId);
+           VISU::TGaussPointID aGaussPointID = aGaussPtsIDMapper->GetObjID(anObjId);
            vtkIdType aCellID = aGaussPointID.first;
            vtkCell* aCell = aParent->GetElemCell(aCellID);
            myCellSource->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
index 292babe59c32adf70d9bc7071f09de66eda0fc64..fd1275df08a9c1cd2742baf62816d81d8540713d 100644 (file)
@@ -61,14 +61,14 @@ VISU_GaussPointsPL
 {
   Superclass::ShallowCopy(thePipeLine);
   if(VISU_GaussPointsPL *aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine)){
-    SetGaussMesh(aPipeLine->GetGaussMesh());
+    SetGaussPtsIDMapper(aPipeLine->GetGaussPtsIDMapper());
     
     vtkPolyData* aDatsSet = myPSMapper->GetInput();
     myPSMapper->ShallowCopy(aPipeLine->GetPSMapper());
     // To restore mapper input from pipeline
     myPSMapper->SetInput(aDatsSet);
 
-    SetGaussMesh(aPipeLine->GetGaussMesh());
+    SetGaussPtsIDMapper(aPipeLine->GetGaussPtsIDMapper());
     SetClamp(aPipeLine->GetClamp());
     SetRelativeSize(aPipeLine->GetRelativeSize());
     SetRelativeMinSize(aPipeLine->GetRelativeMinSize());
@@ -170,22 +170,22 @@ VISU::TGaussPointID
 VISU_GaussPointsPL
 ::GetObjID(vtkIdType theID) const
 {
-  return myGaussMesh->GetObjID(theID);
+  return myGaussPtsIDMapper->GetObjID(theID);
 }
 
 void
 VISU_GaussPointsPL
-::SetGaussMesh(const VISU::PGaussMesh& theGaussMesh)
+::SetGaussPtsIDMapper(const VISU::PGaussPtsIDMapper& theGaussPtsIDMapper)
 {
-  myGaussMesh = theGaussMesh;
-  SetIDMapper(myGaussMesh);
+  myGaussPtsIDMapper = theGaussPtsIDMapper;
+  SetIDMapper(myGaussPtsIDMapper);
 }
 
-const VISU::PGaussMesh&  
+const VISU::PGaussPtsIDMapper&  
 VISU_GaussPointsPL
-::GetGaussMesh() const
+::GetGaussPtsIDMapper() const
 {
-  return myGaussMesh;
+  return myGaussPtsIDMapper;
 }
 
 //----------------------------------------------------------------------------
index 192542aeb3d10e16d20867922f38baa4d464cc59..d07188e3ea1f82f2600b62fd78be2294bd0a48be 100644 (file)
@@ -79,10 +79,10 @@ public:
   GetObjID(vtkIdType theID) const;
 
   void 
-  SetGaussMesh(const VISU::PGaussMesh& theGaussMesh);
+  SetGaussPtsIDMapper(const VISU::PGaussPtsIDMapper& theGaussPtsIDMapper);
 
-  const VISU::PGaussMesh&  
-  GetGaussMesh() const;
+  const VISU::PGaussPtsIDMapper&  
+  GetGaussPtsIDMapper() const;
 
   void
   SetBicolor(bool theBicolor);
@@ -167,7 +167,7 @@ public:
 protected:
   VISU_OpenGLPointSpriteMapper* myPSMapper;
   vtkGeometryFilter* myGeomFilter;
-  VISU::PGaussMesh myGaussMesh;
+  VISU::PGaussPtsIDMapper myGaussPtsIDMapper;
 
   vtkDataArray *myScalarArray;
   float mySourceScalarRange[2];
index 68f662f64e0702dd3d60d032575d009fd9d4972e..b80d408187eeb7a5243586b92aa72c144f18fb19 100644 (file)
@@ -241,13 +241,13 @@ VISU::GaussPoints_i
   if(myField == NULL) 
     throw std::runtime_error("There is no Field with the parameters !!!");
 
-  VISU::PGaussMesh aGaussMesh =
+  VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
     theResult->GetInput()->GetTimeStampOnGaussPts(myMeshName,myEntity,myFieldName,myIteration);
 
-  if(!aGaussMesh
+  if(!aGaussPtsIDMapper
     throw std::runtime_error("There is no TimeStamp with the parameters !!!");
 
-  myGaussPointsPL->SetGaussMesh(aGaussMesh);
+  myGaussPointsPL->SetGaussPtsIDMapper(aGaussPtsIDMapper);
   myGaussPointsPL->Build();
 }
 
index d29e5d3b3311263ca3d6de2c3828f20c3cc3f97a..34143510989dd5d464143c8feea85ae5deb78724 100644 (file)
@@ -93,10 +93,17 @@ namespace VISU
     SetTextures( const QString& theMainTexture,
                 const QString& theAlphaTexture );
 
-    void SetIsActiveLocalScalarBar(const bool theFlag);
-    bool GetIsActiveLocalScalarBar()const;
-    void SetIsDispGlobalScalarBar(const bool theFlag);
-    bool GetIsDispGlobalScalarBar()const;
+    void
+    SetIsActiveLocalScalarBar(const bool theFlag);
+
+    bool
+    GetIsActiveLocalScalarBar() const;
+
+    void
+    SetIsDispGlobalScalarBar(const bool theFlag);
+
+    bool
+    GetIsDispGlobalScalarBar() const;
 
   protected:
     virtual