Commit 5d4765cd authored by Rusty Blue's avatar Rusty Blue

STYLE: Let CopyEntry handle Has/Set/Remove logic

parent 71097f13
......@@ -35,7 +35,7 @@ PURPOSE. See the above copyright notice for more information.
#include "vtkStructuredGrid.h"
#include "vtkUniformGrid.h"
vtkCxxRevisionMacro(vtkCompositeDataPipeline, "1.9");
vtkCxxRevisionMacro(vtkCompositeDataPipeline, "1.10");
vtkStandardNewMacro(vtkCompositeDataPipeline);
vtkInformationKeyMacro(vtkCompositeDataPipeline,BEGIN_LOOP,Integer);
......@@ -981,47 +981,15 @@ void vtkCompositeDataPipeline::CopyFromDataToInformation(
//----------------------------------------------------------------------------
void vtkCompositeDataPipeline::PushInformation(vtkInformation* inInfo)
{
if (inInfo->Has(WHOLE_EXTENT()))
{
this->InformationCache->Set(WHOLE_EXTENT(), inInfo->Get(WHOLE_EXTENT()), 6);
}
else
{
this->InformationCache->Remove(WHOLE_EXTENT());
}
if (inInfo->Has(MAXIMUM_NUMBER_OF_PIECES()))
{
this->InformationCache->Set(MAXIMUM_NUMBER_OF_PIECES(),
inInfo->Get(MAXIMUM_NUMBER_OF_PIECES()));
}
else
{
this->InformationCache->Remove(MAXIMUM_NUMBER_OF_PIECES());
}
this->InformationCache->CopyEntry(inInfo, WHOLE_EXTENT());
this->InformationCache->CopyEntry(inInfo, MAXIMUM_NUMBER_OF_PIECES());
}
//----------------------------------------------------------------------------
void vtkCompositeDataPipeline::PopInformation(vtkInformation* inInfo)
{
if (this->InformationCache->Has(WHOLE_EXTENT()))
{
inInfo->Set(WHOLE_EXTENT(), this->InformationCache->Get(WHOLE_EXTENT()), 6);
}
else
{
inInfo->Remove(WHOLE_EXTENT());
}
if (this->InformationCache->Has(MAXIMUM_NUMBER_OF_PIECES()))
{
inInfo->Set(MAXIMUM_NUMBER_OF_PIECES(),
this->InformationCache->Get(MAXIMUM_NUMBER_OF_PIECES()));
}
else
{
inInfo->Remove(MAXIMUM_NUMBER_OF_PIECES());
}
inInfo->CopyEntry(this->InformationCache, WHOLE_EXTENT());
inInfo->CopyEntry(this->InformationCache, MAXIMUM_NUMBER_OF_PIECES());
}
//----------------------------------------------------------------------------
......
......@@ -20,7 +20,7 @@
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkXMLPUnstructuredDataReader, "1.15");
vtkCxxRevisionMacro(vtkXMLPUnstructuredDataReader, "1.16");
//----------------------------------------------------------------------------
vtkXMLPUnstructuredDataReader::vtkXMLPUnstructuredDataReader()
......@@ -140,13 +140,8 @@ void vtkXMLPUnstructuredDataReader::SetupOutputInformation(vtkInformation *outIn
void vtkXMLPUnstructuredDataReader::CopyOutputInformation(vtkInformation *outInfo, int port)
{
this->Superclass::CopyOutputInformation(outInfo, port);
vtkInformation *localInfo = this->GetExecutive()->GetOutputInformation( port );
if ( localInfo->Has(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES()) )
{
outInfo->CopyEntry( localInfo,
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES() );
}
outInfo->CopyEntry( this->GetExecutive()->GetOutputInformation( port ),
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES() );
}
//----------------------------------------------------------------------------
......
......@@ -23,7 +23,7 @@
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkXMLUnstructuredDataReader, "1.17");
vtkCxxRevisionMacro(vtkXMLUnstructuredDataReader, "1.18");
//----------------------------------------------------------------------------
vtkXMLUnstructuredDataReader::vtkXMLUnstructuredDataReader()
......@@ -333,7 +333,8 @@ void vtkXMLUnstructuredDataReader::SetupOutputInformation(vtkInformation *outInf
// Set the maximum number of pieces that can be provided by this
// reader.
outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(), this->NumberOfPieces);
outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),
this->NumberOfPieces);
}
......@@ -341,13 +342,8 @@ void vtkXMLUnstructuredDataReader::SetupOutputInformation(vtkInformation *outInf
void vtkXMLUnstructuredDataReader::CopyOutputInformation(vtkInformation *outInfo, int port)
{
this->Superclass::CopyOutputInformation(outInfo, port);
vtkInformation *localInfo = this->GetExecutive()->GetOutputInformation( port );
if ( localInfo->Has(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES()) )
{
outInfo->CopyEntry( localInfo,
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES() );
}
outInfo->CopyEntry( this->GetExecutive()->GetOutputInformation( port ),
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES() );
}
......
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