From: apo Date: Fri, 30 Sep 2005 06:18:00 +0000 (+0000) Subject: To fix a regression with wrong cashing of timestamp's data X-Git-Tag: BR-D5-38-2003_D2005-12-10~103 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b83e2a22a60a056ba2cd346fcf3b5cebaae672eb;p=modules%2Fvisu.git To fix a regression with wrong cashing of timestamp's data --- diff --git a/src/CONVERTOR/VISUConvertor.cxx b/src/CONVERTOR/VISUConvertor.cxx index 897e7a81..25aa1b32 100644 --- a/src/CONVERTOR/VISUConvertor.cxx +++ b/src/CONVERTOR/VISUConvertor.cxx @@ -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(); diff --git a/src/CONVERTOR/VISU_Convertor.hxx b/src/CONVERTOR/VISU_Convertor.hxx index 7fa63b58..d9145a7c 100644 --- a/src/CONVERTOR/VISU_Convertor.hxx +++ b/src/CONVERTOR/VISU_Convertor.hxx @@ -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, diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 30f24fed..196b65bc 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -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() = "<GetPointData()->GetActualMemorySize()*1000)<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()); diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 292babe5..fd1275df 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -61,14 +61,14 @@ VISU_GaussPointsPL { Superclass::ShallowCopy(thePipeLine); if(VISU_GaussPointsPL *aPipeLine = dynamic_cast(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; } //---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index 192542ae..d07188e3 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -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]; diff --git a/src/VISU_I/VISU_GaussPoints_i.cc b/src/VISU_I/VISU_GaussPoints_i.cc index 68f662f6..b80d4081 100644 --- a/src/VISU_I/VISU_GaussPoints_i.cc +++ b/src/VISU_I/VISU_GaussPoints_i.cc @@ -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(); } diff --git a/src/VISU_I/VISU_GaussPoints_i.hh b/src/VISU_I/VISU_GaussPoints_i.hh index d29e5d3b..34143510 100644 --- a/src/VISU_I/VISU_GaussPoints_i.hh +++ b/src/VISU_I/VISU_GaussPoints_i.hh @@ -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