Commit 2bbc674a authored by Chris Harris's avatar Chris Harris
Browse files

Update vtkXdmf<Reader|Writer> to work with VTK changes


Suggested-By: default avatarYuanxin Liu <leo.liu@kitware.com>
parent 410831ab
...@@ -322,7 +322,7 @@ int vtkXdmfReader::RequestInformation(vtkInformation *, vtkInformationVector **, ...@@ -322,7 +322,7 @@ int vtkXdmfReader::RequestInformation(vtkInformation *, vtkInformationVector **,
if (time_steps.size() > 0) if (time_steps.size() > 0)
{ {
outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(),
&time_steps[0], static_cast<int>(time_steps.size())); &time_steps[0], static_cast<int>(time_steps.size()));
double timeRange[2]; double timeRange[2];
timeRange[0] = time_steps.front(); timeRange[0] = time_steps.front();
...@@ -403,9 +403,9 @@ int vtkXdmfReader::RequestData(vtkInformation *, vtkInformationVector **, ...@@ -403,9 +403,9 @@ int vtkXdmfReader::RequestData(vtkInformation *, vtkInformationVector **,
if (this->LastTimeIndex < if (this->LastTimeIndex <
this->XdmfDocument->GetActiveDomain()->GetTimeSteps().size()) this->XdmfDocument->GetActiveDomain()->GetTimeSteps().size())
{ {
double time = double time =
this->XdmfDocument->GetActiveDomain()->GetTimeForIndex(this->LastTimeIndex); this->XdmfDocument->GetActiveDomain()->GetTimeForIndex(this->LastTimeIndex);
output->GetInformation()->Set(vtkDataObject::DATA_TIME_STEPS(), &time, 1); output->GetInformation()->Set(vtkDataObject::DATA_TIME_STEP(), time);
} }
return 1; return 1;
} }
...@@ -413,11 +413,11 @@ int vtkXdmfReader::RequestData(vtkInformation *, vtkInformationVector **, ...@@ -413,11 +413,11 @@ int vtkXdmfReader::RequestData(vtkInformation *, vtkInformationVector **,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
int vtkXdmfReader::ChooseTimeStep(vtkInformation* outInfo) int vtkXdmfReader::ChooseTimeStep(vtkInformation* outInfo)
{ {
if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS())) if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()))
{ {
// we do not support multiple timestep requests. // we do not support multiple timestep requests.
double time = double time =
outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS())[0]; outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP());
return this->XdmfDocument->GetActiveDomain()->GetIndexForTime(time); return this->XdmfDocument->GetActiveDomain()->GetIndexForTime(time);
} }
......
...@@ -310,8 +310,8 @@ int vtkXdmfWriter::RequestUpdateExtent( ...@@ -310,8 +310,8 @@ int vtkXdmfWriter::RequestUpdateExtent(
//but that is annoying. //but that is annoying.
double timeReq = inTimes[this->CurrentTimeIndex]; double timeReq = inTimes[this->CurrentTimeIndex];
inputVector[0]->GetInformationObject(0)->Set( inputVector[0]->GetInformationObject(0)->Set(
vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS(), vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP(),
&timeReq, 1); timeReq);
} }
return 1; return 1;
...@@ -371,16 +371,16 @@ int vtkXdmfWriter::RequestData( ...@@ -371,16 +371,16 @@ int vtkXdmfWriter::RequestData(
vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
vtkDataObject* input = inInfo->Get(vtkDataObject::DATA_OBJECT()); vtkDataObject* input = inInfo->Get(vtkDataObject::DATA_OBJECT());
vtkInformation *inDataInfo = input->GetInformation(); vtkInformation *inDataInfo = input->GetInformation();
if (inDataInfo->Has(vtkDataObject::DATA_TIME_STEPS())) if (inDataInfo->Has(vtkDataObject::DATA_TIME_STEP()))
{ {
//I am assuming we are not given a temporal data object and getting just one time. //I am assuming we are not given a temporal data object and getting just one time.
double *dataT = input->GetInformation()->Get(vtkDataObject::DATA_TIME_STEPS()); double dataT = input->GetInformation()->Get(vtkDataObject::DATA_TIME_STEP());
//cerr << "Writing " << this->CurrentTimeIndex << " " << *dataT << endl; //cerr << "Writing " << this->CurrentTimeIndex << " " << *dataT << endl;
XdmfTime *xT = grid->GetTime(); XdmfTime *xT = grid->GetTime();
xT->SetDeleteOnGridDelete(true); xT->SetDeleteOnGridDelete(true);
xT->SetTimeType(XDMF_TIME_SINGLE); xT->SetTimeType(XDMF_TIME_SINGLE);
xT->SetValue(*dataT); xT->SetValue(dataT);
grid->Insert(xT); grid->Insert(xT);
} }
......
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