Hi,
The previously posted patch accidentally issued a warning for every file
series, even those that provided disjoint time steps. Fixed.
Karl
> I'd like to propose a patch that warns the user for such a file series
> and falls back to fake time step values. I'm not sure about implications
> for animation functions, though, I'm afraid. But having applied the
> patch, one can step through sametimes*.foo as well.
diff --git a/Servers/Filters/vtkFileSeriesReader.cxx
b/Servers/Filters/vtkFileSeriesReader.cxx
index 96d86fb..d142cd8 100644
--- a/Servers/Filters/vtkFileSeriesReader.cxx
+++ b/Servers/Filters/vtkFileSeriesReader.cxx
@@ -60,6 +60,7 @@ class vtkFileSeriesReaderTimeRanges
{
public:
void Reset();
+ int Length();
void AddTimeRange(int index, vtkInformation *srcInfo);
int GetAggregateTimeInfo(vtkInformation *outInfo);
int GetInputTimeInfo(int index, vtkInformation *outInfo);
@@ -83,6 +84,12 @@ void vtkFileSeriesReaderTimeRanges::Reset()
}
//-----------------------------------------------------------------------------
+int vtkFileSeriesReaderTimeRanges::Length()
+{
+ return this->RangeMap.size();
+}
+
+//-----------------------------------------------------------------------------
void vtkFileSeriesReaderTimeRanges::AddTimeRange(int index,
vtkInformation *srcInfo)
{
@@ -553,6 +560,27 @@ int vtkFileSeriesReader::RequestInformation(
this->RequestInformationForInput(i, request, outputVector);
this->Internal->TimeRanges->AddTimeRange(i, outInfo);
}
+
+ // Catch case where multiple files set the same timestep
+ int numTimeSteps = this->Internal->TimeRanges->Length();
+ if (numTimeSteps < numFiles)
+ {
+ vtkWarningMacro("Multiple files contain identical time step values. "
+ << "Reverting to fake time step values.");
+
+ this->Internal->TimeRanges->Reset();
+ outInfo->Remove(vtkStreamingDemandDrivenPipeline::TIME_STEPS());
+ outInfo->Remove(vtkStreamingDemandDrivenPipeline::TIME_RANGE());
+
+ // Input files have non-unique time steps. Fake a time step for each
equal to the
+ // index.
+ for (int i = 0; i < numFiles; i++)
+ {
+ double time = (double)i;
+ outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), &time, 1);
+ this->Internal->TimeRanges->AddTimeRange(i, outInfo);
+ }
+ }
}
// Now that we have collected all of the time information, set the aggregate
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the ParaView Wiki at:
http://paraview.org/Wiki/ParaView
Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview