From c1abe84d6c3ef18b35ff8460035907d64fee8928 Mon Sep 17 00:00:00 2001 From: enk Date: Tue, 10 Apr 2007 13:12:57 +0000 Subject: [PATCH] Fix for Bug NPAL14169: EDF VISU 256 : No continuum on a scalarmap --- src/CONVERTOR/Makefile.in | 6 +- src/CONVERTOR/VISU_CommonCellsFilter.cxx | 269 +++++++++++++++++++++++ src/CONVERTOR/VISU_CommonCellsFilter.hxx | 41 ++++ src/CONVERTOR/VISU_Convertor_impl.cxx | 146 +++++++++++- src/CONVERTOR/VISU_Convertor_impl.hxx | 49 ++++- src/CONVERTOR/VISU_MedConvertor.cxx | 14 +- 6 files changed, 503 insertions(+), 22 deletions(-) create mode 100644 src/CONVERTOR/VISU_CommonCellsFilter.cxx create mode 100644 src/CONVERTOR/VISU_CommonCellsFilter.hxx diff --git a/src/CONVERTOR/Makefile.in b/src/CONVERTOR/Makefile.in index 19d33a5a..66e57008 100644 --- a/src/CONVERTOR/Makefile.in +++ b/src/CONVERTOR/Makefile.in @@ -40,7 +40,8 @@ EXPORT_HEADERS = \ VISU_ConvertorUtils.hxx \ VISU_MergeFilter.hxx \ VISU_AppendFilter.hxx \ - VISU_ExtractUnstructuredGrid.hxx + VISU_ExtractUnstructuredGrid.hxx \ + VISU_CommonCellsFilter.hxx # Libraries targets @@ -53,7 +54,8 @@ LIB_SRC = \ VISU_ExtractUnstructuredGrid.cxx \ VISU_MergeFilter.cxx \ VISU_AppendFilter.cxx \ - VISU_MedConvertor.cxx + VISU_MedConvertor.cxx \ + VISU_CommonCellsFilter.cxx # Executables targets BIN = VISUConvertor diff --git a/src/CONVERTOR/VISU_CommonCellsFilter.cxx b/src/CONVERTOR/VISU_CommonCellsFilter.cxx new file mode 100644 index 00000000..6ca42755 --- /dev/null +++ b/src/CONVERTOR/VISU_CommonCellsFilter.cxx @@ -0,0 +1,269 @@ +// File : VISU_CommonCellsFilter.cxx +// Created : Wed Apr 4 08:45:07 2007 +// Author : Eugeny NIKOLAEV (enk) +// Copyright : Open CASCADE + +#include "VISU_CommonCellsFilter.hxx" + +// VTK product headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// STL +#include +#include +#include + +namespace +{ + typedef std::vector TSortedArray; + typedef std::map TId2IdMap; + + inline + void + GetSortedArray(vtkIntArray *theArray, + TSortedArray& theSortedArray) + { + int aMaxId = theArray->GetMaxId(); + int* aPointer = theArray->GetPointer(0); + int* anEndPointer = theArray->GetPointer(aMaxId + 1); + TSortedArray aSortedArray(aPointer, anEndPointer); + std::sort(aSortedArray.begin(), aSortedArray.end()); + theSortedArray.swap(aSortedArray); + } + + inline + void + GetIdsForCopy(vtkUnstructuredGrid *inputUGrid, + vtkIntArray* inputPointIds, + TSortedArray& outputSortedArray) + { + if(inputUGrid){ + TSortedArray aSortedPointIds; + TSortedArray aOutputCellIds; + GetSortedArray(inputPointIds,aSortedPointIds); + + int nbInputCells = inputUGrid->GetNumberOfCells(); + + TSortedArray aPointCellIds; + for(int idCell=0;idCellGetCell(idCell); + vtkIdList* ptIds = aCell->GetPointIds(); + int aMaxId = ptIds->GetNumberOfIds(); + int* aPointer = ptIds->GetPointer(0); + int* anEndPointer = ptIds->GetPointer(aMaxId + 1); + TSortedArray aSortedArray(aPointer, anEndPointer); + std::sort(aSortedArray.begin(), aSortedArray.end()); + + int aMaxLength = std::max(aSortedArray.size(), aSortedPointIds.size()); + TSortedArray anIntersectionArray(aMaxLength); + TSortedArray::iterator anArrayIter = anIntersectionArray.begin(); + anArrayIter = std::set_intersection(aSortedArray.begin(), + aSortedArray.end(), + aSortedPointIds.begin(), + aSortedPointIds.end(), + anArrayIter); + anIntersectionArray.erase(anArrayIter, anIntersectionArray.end()); + if(anIntersectionArray.size() == aSortedArray.size()) + aOutputCellIds.push_back(idCell); + } + + outputSortedArray.swap(aOutputCellIds); + } + } + + inline + void + CopyElementsToOutput(vtkUnstructuredGrid* theInputUG, + int& theNbElements, + TSortedArray& theElementIdsForCopy, + TId2IdMap& theOldId2NewIdPointsMap, + vtkIntArray* theOuputIDSArray, + vtkUnstructuredGrid* theOutputUG) + { + vtkIntArray* aInputCellsMapper = + dynamic_cast(theInputUG->GetCellData()->GetArray("VISU_CELLS_MAPPER")); + int* aInputCellsMapperPointer = aInputCellsMapper->GetPointer(0); + for(int aCellIndex=0;aCellIndexGetCell(aCellId)->GetPointIds(); + vtkIdList* aNewPointIds = vtkIdList::New(); + int nbPointIds = aOldPointIds->GetNumberOfIds(); + aNewPointIds->SetNumberOfIds(nbPointIds); + for(int j=0;jGetId(j); + int aNewId = theOldId2NewIdPointsMap[aOldId]; + aNewPointIds->SetId(j,aNewId); + } + const int aOldCellId = theElementIdsForCopy[aCellIndex]; + theOutputUG->InsertNextCell(theInputUG->GetCellType(aOldCellId), + aNewPointIds); + if(aInputCellsMapperPointer) + theOuputIDSArray->InsertNextValue(aInputCellsMapperPointer[aOldCellId]); + else + theOuputIDSArray->InsertNextValue(aOldCellId); + + aNewPointIds->Delete(); + } + } +} + +vtkStandardNewMacro(VISU_CommonCellsFilter); + +VISU_CommonCellsFilter +::VISU_CommonCellsFilter() +{} + +VISU_CommonCellsFilter +::~VISU_CommonCellsFilter() +{} + +void +VISU_CommonCellsFilter +::SetProfileUG(vtkUnstructuredGrid *input) +{ + this->SetInput(input); +} + +vtkUnstructuredGrid* +VISU_CommonCellsFilter +::GetProfileUG() +{ + return dynamic_cast(this->GetInput()); +} + +void +VISU_CommonCellsFilter +::SetCellsUG(vtkUnstructuredGrid *input) +{ + this->vtkProcessObject::SetNthInput(1, input); +} + +vtkUnstructuredGrid* +VISU_CommonCellsFilter +::GetCellsUG() +{ + if (this->NumberOfInputs < 2) + { + return NULL; + } + return dynamic_cast(this->Inputs[1]); +} + +void +VISU_CommonCellsFilter +::Execute() +{ + vtkUnstructuredGrid* anInputProfileUG = this->GetProfileUG(); + vtkUnstructuredGrid* anInputCellsUG = this->GetCellsUG(); + + vtkUnstructuredGrid* anOutput = this->GetOutput(); + + if(anInputCellsUG == NULL){ + anOutput->ShallowCopy(anInputProfileUG); + } + else{ + // check if anInputProfileUG already have cells types not equal VTK_VERTEX + vtkCellTypes* aCellTypes = vtkCellTypes::New(); + + anInputProfileUG->GetCellTypes(aCellTypes); + if(aCellTypes){ + if (aCellTypes->GetNumberOfTypes()!=1 ) + anOutput->ShallowCopy(anInputProfileUG); + else{ + if(aCellTypes->GetCellType(0) != VTK_VERTEX) + anOutput->DeepCopy(anInputProfileUG); + else{ + + vtkCellData* aInputCellData = anInputProfileUG->GetCellData(); + + // + // Calculate output points + // + vtkIdList* aPointIdsForCopy = vtkIdList::New(); + vtkPoints* aOutputPointSet = vtkPoints::New(); + TId2IdMap aOldId2NewIdPointsMap; + + aOutputPointSet->Reset(); + + vtkIntArray* aPointIDS = + dynamic_cast(aInputCellData->GetArray("VISU_CELLS_MAPPER")); + if(aPointIDS){ + aPointIdsForCopy->SetNumberOfIds(aPointIDS->GetNumberOfTuples()); + for(int i=0;iGetNumberOfTuples();i++){ + aPointIdsForCopy->SetId(i,aPointIDS->GetValue(i)); + } + aOutputPointSet->SetNumberOfPoints(aPointIdsForCopy->GetNumberOfIds()); + // aOutputPointSet copy points from anInputProfileUG to aOutputPointSet, which + // in aPointIdsForCopy ids list + anInputProfileUG->GetPoints()->GetPoints(aPointIdsForCopy,aOutputPointSet); + for(int i=0;iGetNumberOfIds();i++) + aOldId2NewIdPointsMap[aPointIdsForCopy->GetId(i)] = i; + anOutput->SetPoints(aOutputPointSet); + } + aOutputPointSet->Delete(); + // applay scalar,vector,normal,tensor ... values + anOutput->GetPointData()->CopyFieldOff("VISU_CELLS_MAPPER"); + anOutput->GetPointData()->CopyFieldOff("VISU_POINTS_MAPPER"); + anOutput->GetPointData()->PassData(aInputCellData); + //anOutput->GetPointData()->GetArray("VISU_CELLS_MAPPER")->SetName("VISU_POINTS_MAPPER"); + + // apply VISU_POINTS_MAPPER + vtkIntArray* aNewPointsIdsArray = vtkIntArray::New(); + aNewPointsIdsArray->SetName("VISU_POINTS_MAPPER"); + aNewPointsIdsArray->SetNumberOfComponents(1); + aNewPointsIdsArray->SetNumberOfTuples(aPointIdsForCopy->GetNumberOfIds()); + for(int i=0;iGetNumberOfIds();i++) + aNewPointsIdsArray->SetValue(i,aPointIdsForCopy->GetId(i)); + anOutput->GetPointData()->AddArray(aNewPointsIdsArray); + + + + aNewPointsIdsArray->Delete(); + + + // Calculate output cells + int nbCells=0; + + TSortedArray aCellIdsForCopy; + + GetIdsForCopy(anInputCellsUG,aPointIDS,aCellIdsForCopy); + nbCells = aCellIdsForCopy.size(); + + // copy cells to output + int aAllocMem = nbCells; + anOutput->Allocate(aAllocMem); + vtkIntArray* theOuputIDSArray = vtkIntArray::New(); + theOuputIDSArray->SetName("VISU_CELLS_MAPPER"); + theOuputIDSArray->SetNumberOfComponents(1); + theOuputIDSArray->SetNumberOfTuples(aAllocMem); + + if(nbCells>0 && anInputCellsUG) + CopyElementsToOutput(anInputCellsUG, + nbCells, + aCellIdsForCopy, + aOldId2NewIdPointsMap, + theOuputIDSArray, + anOutput); + + anOutput->GetCellData()->AddArray(theOuputIDSArray); + + theOuputIDSArray->Delete(); + aPointIdsForCopy->Delete(); + } + } + + } + else + anOutput->ShallowCopy(anInputProfileUG); + } +} diff --git a/src/CONVERTOR/VISU_CommonCellsFilter.hxx b/src/CONVERTOR/VISU_CommonCellsFilter.hxx new file mode 100644 index 00000000..1113ea4a --- /dev/null +++ b/src/CONVERTOR/VISU_CommonCellsFilter.hxx @@ -0,0 +1,41 @@ +// File : VISU_CommonCellsFilter.hxx +// Created : Tue Apr 3 16:16:53 2007 +// Author : Eugeny NIKOLAEV (enk) +// Copyright : Open CASCADE + + +#ifndef VISU_CommonCellsFilter_HeaderFile +#define VISU_CommonCellsFilter_HeaderFile + +#include + +class VISU_CommonCellsFilter: public vtkUnstructuredGridToUnstructuredGridFilter +{ +public: + static VISU_CommonCellsFilter *New(); + vtkTypeMacro(VISU_CommonCellsFilter,vtkUnstructuredGridToUnstructuredGridFilter); + + // Description: + // Specify the Unstructured Grid which overview + // nodal profile. + void SetProfileUG(vtkUnstructuredGrid *input); + vtkUnstructuredGrid* GetProfileUG(); + + // Description: + // Specify the Unstructured Grid which overview + // cells data on CELL_ENTITY. + void SetCellsUG(vtkUnstructuredGrid *input); + vtkUnstructuredGrid* GetCellsUG(); + +protected: + VISU_CommonCellsFilter(); + ~VISU_CommonCellsFilter(); + + void Execute(); //generate output data + +private: + VISU_CommonCellsFilter(const VISU_CommonCellsFilter&); // Lock copy + void operator=(const VISU_CommonCellsFilter&); // Lock copy +}; + +#endif diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 22270f1d..aa52822c 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -29,6 +29,7 @@ #include "VTKViewer_AppendFilter.h" #include "VISU_MergeFilter.hxx" #include "VTKViewer_CellLocationsArray.h" +#include "VISU_CommonCellsFilter.hxx" #include #include @@ -460,6 +461,66 @@ namespace VISU return myIDMapper->GetElemCell(theObjID); } + //--------------------------------------------------------------- + TIDCommonCellsFilter + ::TIDCommonCellsFilter(): + myIsSpecialKey(false) + {} + + const TVTKCommonCellsFilter& + TIDCommonCellsFilter + ::GetFilter() const + { + if(!myFilter.GetPointer()){ + myFilter = VISU_CommonCellsFilter::New(); + myFilter->Delete(); + myMergeFilter = VISU_MergeFilter::New(); + myMergeFilter->Delete(); + } + return myFilter; + } + + TVTKOutput* + TIDCommonCellsFilter + ::GetVTKOutput() + { + if(!myFilter.GetPointer()){ + const TVTKAppendFilter& anAppendFilter = myIDMapper->GetFilter(); + TVTKOutput* aGeometry; + + const TVTKSource& aSource = mySource.GetSource(); + TDataSet* aDataSet; + const TVTKCommonCellsFilter& aFilter = GetFilter(); + + if(myIsSpecialKey){ + PNamedIDMapperMap::iterator aIter; + aIter = myMappers.find(VISU::CELL_ENTITY); + if(aIter!=myMappers.end()) aFilter->SetCellsUG((aIter->second)->GetVTKOutput()); + else { + aIter = myMappers.find(VISU::FACE_ENTITY); + if(aIter!=myMappers.end()) aFilter->SetCellsUG((aIter->second)->GetVTKOutput()); + else { + aIter = myMappers.find(VISU::EDGE_ENTITY); + if(aIter!=myMappers.end()) aFilter->SetCellsUG((aIter->second)->GetVTKOutput()); + } + } + } + + aGeometry = anAppendFilter->GetOutput(); + aDataSet = aSource.GetPointer(); + aDataSet->ShallowCopy(aGeometry); + + myMergeFilter->SetGeometry(aGeometry); + myMergeFilter->SetScalars(aDataSet); + myMergeFilter->SetVectors(aDataSet); + myMergeFilter->AddField("VISU_FIELD",aDataSet); + myMergeFilter->AddField("VISU_CELLS_MAPPER",aDataSet); + myMergeFilter->AddField("VISU_POINTS_MAPPER",aDataSet); + + aFilter->SetProfileUG(myMergeFilter->GetOutput()); + } + return myFilter->GetOutput(); + } //--------------------------------------------------------------- void @@ -827,7 +888,7 @@ namespace VISU TValForTimeImpl ::TValForTimeImpl(): myGaussPtsIDFilter(new TGaussPtsIDFilter()), - myIDMapperFilter(new TIDMapperFilter()) + myIDMapperFilter(new TIDCommonCellsFilter()) {} const TMeshValue& @@ -2119,27 +2180,85 @@ VISU_Convertor_impl const VISU::PMeshOnEntityImpl& theMeshOnEntity, const VISU::PFieldImpl& theField, const VISU::PValForTimeImpl& theValForTime, - const VISU::PIDMapperFilter& theIDMapperFilter, + const VISU::PIDCommonCellsFilter& theIDMapperFilter, const VISU::PProfileImpl& theProfile, const VISU::TEntity& theEntity) { TVTKOutput* anOutput = NULL; +#ifndef _DEXCEPT_ try{ +#endif + // load points if theMeshOnEntity->myEntity == NODE_ENTITY + // load all coordinates itc. + LoadMeshOnEntity(theMesh,theMeshOnEntity); GetMeshOnEntity(theMeshOnEntity->myMeshName,theMeshOnEntity->myEntity); if(GetMeshOnProfile(theMesh,theMeshOnEntity,theProfile)){ + + bool isNeedInCells = false; theIDMapperFilter->myIDMapper = theProfile; - anOutput = theIDMapperFilter->GetVTKOutput(); - const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource(); - ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity); + + if(theMeshOnEntity->myEntity == VISU::NODE_ENTITY){ + + // add geometry elements to output, + // if timestamp on NODE_ENTITY and + // on profiles with status eAddPart + TGeom2SubProfile::const_iterator anIter = theProfile->myGeom2SubProfile.begin(); + for(; anIter != (theProfile->myGeom2SubProfile).end(); anIter++){ + const EGeometry aGeom = anIter->first; + const PSubProfileImpl aSubProfile = anIter->second; + if(aSubProfile->myStatus == VISU::eAddPart && aGeom == VISU::ePOINT1){ + isNeedInCells = true; + break; + } + } + if(isNeedInCells){ + theIDMapperFilter->myIsSpecialKey = true; + GetTimeStampOnNodalProfile(theMesh,theIDMapperFilter,theField,theValForTime,theEntity); + anOutput = theIDMapperFilter->GetVTKOutput(); + } + } + + if(!isNeedInCells){ + anOutput = theIDMapperFilter->GetVTKOutput(); + const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource(); + ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity); + } } +#ifndef _DEXCEPT_ }catch(std::exception& exc){ MSG(MYDEBUG,"Follow exception was occured :\n"<myMeshOnEntityMap; + VISU::TMeshOnEntityMap::const_iterator aIter = aMeshOnEntityMap.begin(); + for(;aIter!=aMeshOnEntityMap.end();aIter++){ + VISU::TEntity aEntity = aIter->first; + if(aEntity != NODE_ENTITY){ + VISU::PNamedIDMapper aMapper = GetMeshOnEntity(theMesh->myName,aEntity); + if(aMapper) + theIDMapperFilter->myMappers[aEntity] = aMapper; + } + } + + theIDMapperFilter->GetVTKOutput(); + const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource(); + ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity); + +} //--------------------------------------------------------------- VISU::PIDMapper @@ -2169,7 +2288,7 @@ VISU_Convertor_impl PFieldImpl aField = boost::get<3>(aFindTimeStamp); //Main part of code - PIDMapperFilter anIDMapperFilter = aValForTime->myIDMapperFilter; + PIDCommonCellsFilter anIDMapperFilter = aValForTime->myIDMapperFilter; #ifndef _DEXCEPT_ try{ #endif @@ -2334,15 +2453,22 @@ VISU_Convertor_impl VISU_Convertor_impl::TFindMeshOnEntity VISU_Convertor_impl ::FindMeshOnEntity(const string& theMeshName, - const VISU::TEntity& theEntity) + const VISU::TEntity& theEntity, + bool checkExists) { + PMeshOnEntityImpl aMeshOnEntity; PMeshImpl aMesh = FindMesh(theMeshName); VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(theEntity); - if(aMeshOnEntityMapIter == aMeshOnEntityMap.end()) - EXCEPTION(runtime_error,"FindMeshOnEntity >> There is no mesh on the entity - "<> There is no mesh on the entity - "<second; + aMeshOnEntity = aMeshOnEntityMapIter->second; return TFindMeshOnEntity(aMesh, aMeshOnEntity); diff --git a/src/CONVERTOR/VISU_Convertor_impl.hxx b/src/CONVERTOR/VISU_Convertor_impl.hxx index 4d77ada8..f9f6b157 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.hxx +++ b/src/CONVERTOR/VISU_Convertor_impl.hxx @@ -38,6 +38,7 @@ class vtkPoints; class vtkUnstructuredGrid; class VTKViewer_AppendFilter; class VISU_MergeFilter; +class VISU_CommonCellsFilter; #include "VISU_Convertor.hxx" #include "MED_SliceArray.hxx" @@ -73,6 +74,7 @@ namespace VISU typedef vtkSmartPointer TVTKSource; typedef vtkSmartPointer TVTKPoints; typedef vtkSmartPointer TVTKMergeFilter; + typedef vtkSmartPointer TVTKCommonCellsFilter; typedef vtkSmartPointer TVTKAppendFilter; @@ -165,7 +167,7 @@ namespace VISU TVTKOutput* GetVTKOutput(); }; - typedef SharedPtr PAppendFilter; + typedef SharedPtr PMergeFilter; //--------------------------------------------------------------- @@ -428,7 +430,37 @@ namespace VISU }; typedef SharedPtr PIDMapperFilter; + typedef std::map PNamedIDMapperMap; + //--------------------------------------------------------------- + //! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh + struct TIDCommonCellsFilter: virtual TIDMapperFilter + { + protected: + mutable TVTKCommonCellsFilter myFilter; + mutable TVTKMergeFilter myMergeFilter; + public: + + TIDCommonCellsFilter(); + + //! This method allow to create corresponding VTK filter by demand (not at once) + const TVTKCommonCellsFilter& + GetFilter() const; + + //! if false, TIDCommonCellsFilter - same as TIDMapperFilter + //! if true, TIDCommonCellsFilter - use VISU_CommonCellsFilter + bool myIsSpecialKey; + + //! Vector of id mappers, which consist of meshonentity in next sequence: + //! CELL_ENTITY,FACE_ENTITY,EDGE_ENTITY + PNamedIDMapperMap myMappers; + //! Reimplement the TIDMapperFilter::GetVTKOutput + virtual + TVTKOutput* + GetVTKOutput(); + }; + typedef SharedPtr PIDCommonCellsFilter; + //--------------------------------------------------------------- struct TGaussImpl; typedef SharedPtr PGaussImpl; @@ -754,7 +786,7 @@ namespace VISU struct TValForTimeImpl: virtual TValForTime { PGaussPtsIDFilter myGaussPtsIDFilter; //!< Keep VTK representation for mesh and data on Gauss Points - PIDMapperFilter myIDMapperFilter; //!< Keep VTK representation for ordinary mesh and data + PIDCommonCellsFilter myIDMapperFilter; //!< Keep VTK representation for ordinary mesh and data TGeom2Value myGeom2Value; //!< Keep value that is assigned to the mesh TGeom2NbGauss myGeom2NbGauss; //!< Keep number of Gauss Points @@ -913,7 +945,8 @@ protected: typedef boost::tuple TFindMeshOnEntity; TFindMeshOnEntity FindMeshOnEntity(const std::string& theMeshName, - const VISU::TEntity& theEntity); + const VISU::TEntity& theEntity, + bool checkExists=false); //! An utility method to find TFamily by name of its parent mesh, corresponding entity and its name typedef boost::tuple TFindFamilyOnEntity; @@ -955,9 +988,17 @@ protected: const VISU::PMeshOnEntityImpl& theMeshOnEntity, const VISU::PFieldImpl& theField, const VISU::PValForTimeImpl& theValForTime, - const VISU::PIDMapperFilter& theIDMapperFilter, + const VISU::PIDCommonCellsFilter& theIDMapperFilter, const VISU::PProfileImpl& theProfile, const VISU::TEntity& theEntity); + + void + GetTimeStampOnNodalProfile(const VISU::PMeshImpl& theMesh, + const VISU::PIDCommonCellsFilter& theIDMapperFilter, + const VISU::PFieldImpl& theField, + const VISU::PValForTimeImpl& theValForTime, + const VISU::TEntity& theEntity); + protected: //! To fill intermeiate representation of TMeshOnEntity from a MED source diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index f0b3b05b..60744663 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -736,7 +736,7 @@ static int MY_GROUP_DEBUG = 0; const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first; VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom); - TInt aNbElem = theGrilleInfo->GetNbCells(); + TInt aNbElem = aGeom2SizeIter->second;//theGrilleInfo->GetNbCells(); aMeshOnEntity->myNbCells += aNbElem; aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1); @@ -1083,10 +1083,12 @@ static int MY_GROUP_DEBUG = 0; TMEDSubProfile ::GetElemObjID(vtkIdType theID) const { - if(myIsElemNum) - return myElemNum[theID]; - else - return theID; + if(mySubMeshID.empty()) + if(myIsElemNum) + return myElemNum[theID]; + else + return theID; + return mySubMeshID[theID]; } @@ -1978,7 +1980,7 @@ VISU_MedConvertor vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom); INITMSG(MYDEBUG,"aVNbNodes = "<GetNbCells(); + TInt aNbElem = aGeom2SizeIter->second;//aGrilleInfo->GetNbCells(); if(aNbElem > 0){ PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh()); -- 2.39.2