From: Christophe Bourcier Date: Wed, 10 May 2023 12:11:55 +0000 (+0200) Subject: Fix the GeometryTimeValue so the initial time may not be the first one X-Git-Tag: V9_11_0a1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fa289a83d362acf20cc8cfb48701d9f8234f4ff3;p=modules%2Fparavis.git Fix the GeometryTimeValue so the initial time may not be the first one Thanks to Charles Gueunet at Kitware SciViz #112 --- 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);