Commit 9ed44c0a authored by bonnell's avatar bonnell

Added patch from Takuya Oshima for correctly handling Timestep information the...

Added patch from Takuya Oshima for correctly handling Timestep information the VTK way, fix path separators on Windows.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@21705 18c085ea-50e0-402c-830e-de6fd14e8384
parent daaa3ffb
......@@ -74,6 +74,11 @@ using std::map;
// Programmer: biagas2 -- generated by xml2avt
// Creation: Tue May 21 11:07:32 PDT 2013
//
// Modifications:
// Kathleen Biagas, Tue Aug 27 11:51:17 PDT 2013
// Change how we read time information, to be more VTK compliant. Patch
// provided by Takuya Oshima.
//
// ****************************************************************************
avtOpenFOAMFileFormat::avtOpenFOAMFileFormat(const char *filename,
......@@ -120,12 +125,8 @@ avtOpenFOAMFileFormat::avtOpenFOAMFileFormat(const char *filename,
#endif
}
vtkExecutive *e = reader->GetExecutive();
vtkInformation *request = vtkInformation::New();
request->Set(vtkDemandDrivenPipeline::REQUEST_INFORMATION());
reader->ProcessRequest(request, e->GetInputInformation(),
e->GetOutputInformation());
vtkInformation *outInfo = e->GetOutputInformation(0);
reader->UpdateInformation();
vtkInformation *outInfo = reader->GetOutputInformation(0);
const int nTimes
= outInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS());
for (int i = 0; i < nTimes; ++i)
......@@ -195,13 +196,19 @@ avtOpenFOAMFileFormat::FreeUpResources(void)
// Programmer: biagas2 -- generated by xml2avt
// Creation: Tue May 21 11:07:32 PDT 2013
//
// Modifications:
// Kathleen Biagas, Tue Aug 27 11:51:17 PDT 2013
// Change how we read time information, to be more VTK compliant. Patch
// provided by Takuya Oshima.
//
// ****************************************************************************
void
avtOpenFOAMFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md,
int timeState)
{
reader->SetTimeValue(timeSteps[timeState]);
vtkStreamingDemandDrivenPipeline::SetUpdateTimeStep(
reader->GetOutputInformation(0), timeSteps[timeState]);
if (readZones)
{
// turn on ReadZones so we can get the names of the pointZones,
......@@ -733,6 +740,11 @@ avtOpenFOAMFileFormat::GetVectorVar(int timestate, int domain,
// Programmer: Kathleen Biagas
// Creation: May 21, 2013
//
// Modifications:
// Kathleen Biagas, Tue Aug 27 11:51:17 PDT 2013
// Change how we read time information, to be more VTK compliant. Patch
// provided by Takuya Oshima.
//
// ****************************************************************************
void
......@@ -744,7 +756,8 @@ avtOpenFOAMFileFormat::ActivateTimestep(int timestate)
}
if (timestate != currentTimeStep)
{
reader->SetTimeValue(timeSteps[timestate]);
vtkStreamingDemandDrivenPipeline::SetUpdateTimeStep(
reader->GetOutputInformation(0), timeSteps[timestate]);
currentTimeStep = timestate;
}
}
......
......@@ -55,6 +55,7 @@
#include "visit_vtkOpenFOAMReader.h"
#include <algorithm>
#include <vector>
#include <vtksys/SystemTools.hxx>
#include <vtksys/ios/sstream>
......@@ -1411,7 +1412,14 @@ public:
// reset line number to indicate the beginning of the file when an
// exception is thrown
this->Superclass::LineNumber = 0;
#ifdef _WIN32
// ensure correct path-separators on Windows.
vtkStdString tmp = fileName;
std::replace(tmp.begin(), tmp.end(), '/', '\\');
this->Superclass::FileName = tmp;
#else
this->Superclass::FileName = fileName;
#endif
if (this->Superclass::File)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment