Commit 747b780a authored by Berk Geveci's avatar Berk Geveci Committed by George Zagaris
Browse files

Updated filters and sources to work with new pipeline logic.

Change-Id: Id76d3bc545a64675a0820cb1d9b45c61a51efc6a
parent e27ae6a9
......@@ -25,7 +25,7 @@
// the contents of the composite dataset in this pass.
// Sources that can produce more than one piece (note that a piece is
// different than a block; each piece consistes of 0 or more blocks) should
// set MAXIMUM_NUMBER_OF_PIECES to -1.
// set CAN_HANDLE_PIECE_REQUEST.
//
// * REQUEST_UPDATE_EXTENT: This pass is identical to the one implemented
// in vtkStreamingDemandDrivenPipeline
......
......@@ -428,10 +428,8 @@ int vtkDataObjectGenerator::RequestInformation(vtkInformation *req,
//Say that this filter can break up its output into any number of pieces
vtkInformation *outInfo = outV->GetInformationObject(0);
/*
outInfo->Set(
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(), -1);
*/
vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(), 1);
//If my output is an atomic structured type, fill in the whole extent info
vtkInternalStructureCache *top = this->Structure->children.front();
......
......@@ -398,55 +398,6 @@ int vtkProbeFilter::RequestInformation(
outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),
inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()),
6);
/*
outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),
inInfo->Get(
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES()));
*/
/*
// Special case for ParaView.
if (this->SpatialMatch == 2)
{
outInfo->Set(
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),
sourceInfo->Get(
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES()));
}
*/
if (this->SpatialMatch == 1)
{
/*
//int m1 =
//inInfo->Get(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES());
//int m2 =
//sourceInfo->Get(
//vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES());
if (m1 < 0 && m2 < 0)
{
//outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),
//-1);
}
else
{
if (m1 < -1)
{
m1 = VTK_INT_MAX;
}
if (m2 < -1)
{
m2 = VTK_INT_MAX;
}
if (m2 < m1)
{
m1 = m2;
}
//outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),
//m1);
}
*/
}
// A variation of the bug fix from John Biddiscombe.
// Make sure that the scalar type and number of components
......
......@@ -188,7 +188,7 @@ int vtkTimeSourceExample::RequestInformation(
);
}
//info->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(), -1);
info->Set(vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(), 1);
return 1;
}
......
......@@ -489,19 +489,10 @@ int vtkTemporalFractal::ProcessRequest(
// execute information
if(request->Has(vtkDemandDrivenPipeline::REQUEST_INFORMATION()))
{
/*
if(request->Has(vtkStreamingDemandDrivenPipeline::FROM_OUTPUT_PORT()))
{
int outputPort = request->Get(
vtkStreamingDemandDrivenPipeline::FROM_OUTPUT_PORT());
vtkInformation* info = outputVector->GetInformationObject(outputPort);
if (info)
{
info->Set(
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(), -1);
}
}
*/
vtkInformation* info = outputVector->GetInformationObject(0);
info->Set(
vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(), 1);
return this->RequestInformation(request, inputVector, outputVector);
}
......
......@@ -79,13 +79,12 @@ vtkArcSource::vtkArcSource(int res)
int vtkArcSource::RequestInformation(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **vtkNotUsed(inputVector),
vtkInformationVector *vtkNotUsed(outputVector))
vtkInformationVector *outputVector)
{
/*
// get the info object
vtkInformation* outInfo = outputVector->GetInformationObject(0);
outInfo->Set( vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(), -1 );
*/
outInfo->Set( vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(), 1 );
return 1;
}
......
......@@ -304,13 +304,11 @@ int vtkConeSource::RequestData(
int vtkConeSource::RequestInformation(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **vtkNotUsed(inputVector),
vtkInformationVector *vtkNotUsed(outputVector))
vtkInformationVector *outputVector)
{
/*
vtkInformation *outInfo = outputVector->GetInformationObject(0);
outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),
-1);
*/
outInfo->Set(vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(),
1);
return 1;
}
......
......@@ -58,14 +58,12 @@ vtkLineSource::~vtkLineSource()
int vtkLineSource::RequestInformation(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **vtkNotUsed(inputVector),
vtkInformationVector *vtkNotUsed(outputVector))
vtkInformationVector *outputVector)
{
/*
// get the info object
vtkInformation *outInfo = outputVector->GetInformationObject(0);
outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),
-1);
*/
outInfo->Set(vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(),
1);
return 1;
}
......
......@@ -40,20 +40,6 @@ vtkRegularPolygonSource::vtkRegularPolygonSource()
this->SetNumberOfInputPorts(0);
}
int vtkRegularPolygonSource::RequestInformation(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **vtkNotUsed(inputVector),
vtkInformationVector *vtkNotUsed(outputVector))
{
/*
// get the info object
vtkInformation *outInfo = outputVector->GetInformationObject(0);
outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),-1);
*/
return 1;
}
int vtkRegularPolygonSource::RequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **vtkNotUsed(inputVector),
......@@ -66,12 +52,6 @@ int vtkRegularPolygonSource::RequestData(
vtkPolyData *output = vtkPolyData::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT()));
// We only produce one piece
if (outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()) > 0)
{
return 1;
}
double x[3], r[3];
int i, j, numPts=this->NumberOfSides;
vtkPoints *newPoints;
......
......@@ -258,6 +258,18 @@ void vtkSelectionSource::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "QueryString: " << (this->QueryString ? this->QueryString : "NULL") << endl;
}
//----------------------------------------------------------------------------
int vtkSelectionSource::RequestInformation(
vtkInformation* vtkNotUsed(request),
vtkInformationVector** vtkNotUsed(inputVector),
vtkInformationVector* outputVector)
{
vtkInformation* outInfo = outputVector->GetInformationObject(0);
outInfo->Set(vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(), 1);
return 1;
}
//----------------------------------------------------------------------------
int vtkSelectionSource::RequestData(
vtkInformation* vtkNotUsed( request ),
......
......@@ -133,6 +133,9 @@ protected:
vtkSelectionSource();
~vtkSelectionSource();
virtual int RequestInformation(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
virtual int RequestData(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
......
......@@ -267,6 +267,7 @@ int vtkAMRBaseReader::RequestInformation(
this->Metadata->GenerateParentChildInformation();
vtkTimerLog::MarkEndEvent("vtkAMRBaseReader::GenerateParentChildInformation");
info->Set(vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(), 1);
// std::cout<<"Generate Meta Data: ";
// for(int levelIdx=0 ; levelIdx < this->Metadata->GetNumberOfLevels(); ++levelIdx )
......
......@@ -897,11 +897,6 @@ int vtkMultiBlockPLOT3DReader::RequestInformation(
fclose(qFp);
}
/*
info->Set(
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(), 1);
*/
return 1;
}
......
......@@ -181,11 +181,28 @@ int vtkParticleReader::RequestInformation(
vtkInformationVector **vtkNotUsed(inputVector),
vtkInformationVector *outputVector)
{
// get the info object
vtkInformation *outInfo = outputVector->GetInformationObject(0);
this->OpenFile();
int ft = this->FileType;
if ( ft == FILE_TYPE_IS_UNKNOWN )
{
ft = DetermineFileType();
if ( ft == FILE_TYPE_IS_UNKNOWN )
{
vtkErrorMacro(<< "File type cannot be determined.");
return 0;
}
}
this->File->close();
delete this->File;
this->File = NULL;
outInfo->Set(vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(),
1);
if (ft == FILE_TYPE_IS_BINARY)
{
vtkInformation *outInfo = outputVector->GetInformationObject(0);
outInfo->Set(vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(),
1);
}
return 1;
}
......
......@@ -582,11 +582,6 @@ int vtkTecplotReader::RequestInformation( vtkInformation * request,
return 0;
}
/*
vtkInformation * info = outputVector->GetInformationObject( 0 );
info->Set( vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(), -1 );
*/
this->GetDataArraysList();
return 1;
......
......@@ -332,13 +332,17 @@ int vtkWindBladeReader::RequestInformation(vtkInformation* reqInfo,
field->SetDimensions(this->Dimension);
fieldInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),
this->WholeExtent, 6);
fieldInfo->Set(CAN_PRODUCE_SUB_EXTENT(),1);
ground->SetDimensions(this->GDimension);
groundInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),
this->GExtent, 6);
groundInfo->Set(CAN_PRODUCE_SUB_EXTENT(),1);
bladeInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),
this->WholeExtent, 6);
// Simply loads the blade on all processes
bladeInfo->Set(vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(), 1);
// Create the rectilinear coordinate spacing for entire problem
this->CreateCoordinates();
......
......@@ -538,6 +538,9 @@ int vtkImageReader2::RequestInformation (
vtkDataObject::SetPointDataActiveScalarInfo(outInfo, this->DataScalarType,
this->NumberOfScalarComponents);
outInfo->Set(CAN_PRODUCE_SUB_EXTENT(), 1);
return 1;
}
......
......@@ -2367,12 +2367,6 @@ int vtkLSDynaReader::RequestInformation( vtkInformation* vtkNotUsed(request),
timeRange[1] = p->TimeValues[p->TimeValues.size() - 1];
outInfo->Set( vtkStreamingDemandDrivenPipeline::TIME_RANGE(), timeRange, 2 );
/*
// Currently, this is a serial reader.
outInfo->Set(
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(), 1);
*/
return 1;
}
......
......@@ -246,10 +246,8 @@ int vtkNetCDFCAMReader::RequestInformation(
outInfo->Remove(vtkStreamingDemandDrivenPipeline::TIME_RANGE());
}
/*
outInfo->Set(
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(), -1);
*/
vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(), 1);
return 1;
}
......
......@@ -992,17 +992,19 @@ int vtkNetCDFCFReader::RequestInformation(vtkInformation *request,
return 0;
}
/*
// Superclass understands structured data, but we have to handle unstructured
// "extents" (pieces).
vtkInformation *outInfo = outputVector->GetInformationObject(0);
vtkDataObject *output = vtkDataObject::GetData(outInfo);
if (output && (output->GetExtentType() != VTK_3D_EXTENT))
if (output->GetExtentType() != VTK_3D_EXTENT)
{
outInfo->Set(
vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(), -1);
vtkStreamingDemandDrivenPipeline::CAN_HANDLE_PIECE_REQUEST(), 1);
}
else
{
outInfo->Set(CAN_PRODUCE_SUB_EXTENT(), 1);
}
*/
return 1;
}
......
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