From fa289a83d362acf20cc8cfb48701d9f8234f4ff3 Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Wed, 10 May 2023 14:11:55 +0200 Subject: [PATCH] Fix the GeometryTimeValue so the initial time may not be the first one Thanks to Charles Gueunet at Kitware SciViz #112 --- .../StaticMeshModule/vtkStaticEnSight6BinaryReader.cxx | 5 ++++- .../StaticMeshModule/vtkStaticEnSightGoldBinaryReader.cxx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Plugins/StaticMesh/plugin/StaticMeshModule/vtkStaticEnSight6BinaryReader.cxx b/src/Plugins/StaticMesh/plugin/StaticMeshModule/vtkStaticEnSight6BinaryReader.cxx index 677df958..517f6274 100644 --- a/src/Plugins/StaticMesh/plugin/StaticMeshModule/vtkStaticEnSight6BinaryReader.cxx +++ b/src/Plugins/StaticMesh/plugin/StaticMeshModule/vtkStaticEnSight6BinaryReader.cxx @@ -85,6 +85,9 @@ int vtkStaticEnSight6BinaryReader::RequestData(vtkInformation* vtkNotUsed(reques vtkIdType timeSet = this->TimeSetIds->IsId(this->GeometryTimeSet); if (timeSet >= 0) { + // Always consider the first mesh when reading geometry + this->GeometryTimeValue = this->MinimumTimeValue; + vtkDataArray* times = this->TimeSets->GetItem(timeSet); this->GeometryTimeValue = times->GetComponent(0, 0); for (vtkIdType i = 1; i < times->GetNumberOfTuples(); i++) @@ -92,11 +95,11 @@ int vtkStaticEnSight6BinaryReader::RequestData(vtkInformation* vtkNotUsed(reques double newTime = times->GetComponent(i, 0); if (newTime <= this->ActualTimeValue && newTime > this->GeometryTimeValue) { - this->GeometryTimeValue = newTime; timeStep++; timeStepInFile++; } } + if (this->TimeSetFileNameNumbers->GetNumberOfItems() > 0) { int collectionNum = this->TimeSetsWithFilenameNumbers->IsId(this->GeometryTimeSet); diff --git a/src/Plugins/StaticMesh/plugin/StaticMeshModule/vtkStaticEnSightGoldBinaryReader.cxx b/src/Plugins/StaticMesh/plugin/StaticMeshModule/vtkStaticEnSightGoldBinaryReader.cxx index ed9d60d6..707e58c9 100644 --- a/src/Plugins/StaticMesh/plugin/StaticMeshModule/vtkStaticEnSightGoldBinaryReader.cxx +++ b/src/Plugins/StaticMesh/plugin/StaticMeshModule/vtkStaticEnSightGoldBinaryReader.cxx @@ -85,6 +85,9 @@ int vtkStaticEnSightGoldBinaryReader::RequestData(vtkInformation* vtkNotUsed(req vtkIdType timeSet = this->TimeSetIds->IsId(this->GeometryTimeSet); if (timeSet >= 0) { + // Always consider the first mesh when reading geometry + this->GeometryTimeValue = this->MinimumTimeValue; + vtkDataArray* times = this->TimeSets->GetItem(timeSet); this->GeometryTimeValue = times->GetComponent(0, 0); for (vtkIdType i = 1; i < times->GetNumberOfTuples(); i++) @@ -92,11 +95,11 @@ int vtkStaticEnSightGoldBinaryReader::RequestData(vtkInformation* vtkNotUsed(req double newTime = times->GetComponent(i, 0); if (newTime <= this->ActualTimeValue && newTime > this->GeometryTimeValue) { - this->GeometryTimeValue = newTime; timeStep++; timeStepInFile++; } } + if (this->TimeSetFileNameNumbers->GetNumberOfItems() > 0) { int collectionNum = this->TimeSetsWithFilenameNumbers->IsId(this->GeometryTimeSet); -- 2.39.2