Commit 98195895 authored by bonnell's avatar bonnell

In preparation for VTK 6, modified a few filters to call Update on vtk filters not vtk objects

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@20152 18c085ea-50e0-402c-830e-de6fd14e8384
parent 1b197eca
......@@ -113,6 +113,10 @@ avtSurfaceNormalExpression::~avtSurfaceNormalExpression()
// Mark C. Miller, Sat Aug 25 22:06:48 PDT 2012
// Changed leak fix and put n->Delete() both in exception block at at end
// of routine rather than ahead of arr->Register().
//
// Kathleen Biagas, Fri Jan 25 16:28:49 PST 2013
// Call 'Update' on filter instead of data object.
//
// ****************************************************************************
vtkDataArray *
......@@ -145,8 +149,8 @@ avtSurfaceNormalExpression::DeriveVariable(vtkDataSet *in_ds)
else
n->SetNormalTypeToCell();
n->SetInput(pd);
n->Update();
vtkPolyData *out = n->GetOutput();
out->Update();
vtkDataArray *arr = NULL;
if (isPoint)
......
......@@ -149,6 +149,10 @@ avtRevolvedSurfaceArea::PreExecute(void)
//
// Mark C. Miller, Wed Aug 22 09:43:01 PDT 2012
// Fixed leaks of VTK objects from early return.
//
// Kathleen Biagas, Fri Jan 25 16:30:50 PST 2013
// Call Update on filter not data object.
//
// ****************************************************************************
vtkDataArray *
......@@ -188,7 +192,7 @@ avtRevolvedSurfaceArea::DeriveVariable(vtkDataSet *in_ds)
boundaryFilter->SetInput(geomFilter->GetOutput());
boundaryFilter->GetOutput()->SetUpdateGhostLevel(2);
boundaryFilter->GetOutput()->Update();
boundaryFilter->Update();
allLines = boundaryFilter->GetOutput();
// using SetSource(NULL) for vtkDataSets no longer a good idea.
......@@ -211,8 +215,8 @@ avtRevolvedSurfaceArea::DeriveVariable(vtkDataSet *in_ds)
//
vtkDataSetRemoveGhostCells *gzFilter = vtkDataSetRemoveGhostCells::New();
gzFilter->SetInput(allLines);
gzFilter->Update();
vtkDataSet *ds_1d_nogz = gzFilter->GetOutput();
ds_1d_nogz->Update();
// We need line segment polydata, and should have it by now.
if (ds_1d_nogz->GetDataObjectType() != VTK_POLY_DATA)
......
......@@ -604,6 +604,9 @@ avtContourFilter::PreExecute(void)
// Hank Childs, Mon Oct 10 11:17:27 PDT 2011
// Add a connectivity dependence when it comes to caching.
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
// ****************************************************************************
avtDataTree_p
......@@ -736,7 +739,7 @@ avtContourFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, string label)
cf->SetCellList(list2, list.size());
}
output->Update();
cf->Update();
if (output->GetNumberOfCells() == 0)
out_ds[i] = NULL;
else
......
......@@ -505,6 +505,9 @@ avtFacelistFilter::FindFaces(vtkDataSet *in_ds, int domain, std::string label,
// Brad Whitlock, Tue Jan 22 13:55:12 PST 2013
// Also use extents for VOI when processing structured grids.
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
// ****************************************************************************
avtDataTree_p
......@@ -906,7 +909,7 @@ avtFacelistFilter::Take2DFaces(vtkDataSet *in_ds, bool forceFaceConsolidation,
rf->SetForceFaceConsolidation(forceFaceConsolidation ? 1 : 0);
rf->SetInput((vtkRectilinearGrid *) in_ds);
rf->SetOutput(out_ds);
out_ds->Update();
rf->Update();
rf->SetOutput(NULL);
//out_ds->SetSource(NULL);
rf->Delete();
......
......@@ -446,6 +446,10 @@ AssignToProc(int val, int nlines)
//
// Mark C. Miller, Mon Jan 22 22:09:01 PST 2007
// Changed MPI_COMM_WORLD to VISIT_MPI_COMM
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
// ****************************************************************************
void
......@@ -609,8 +613,8 @@ avtLineScanFilter::PostExecute(void)
}
if (appender->GetTotalNumberOfInputConnections() >= 1)
{
appender->Update();
vtkPolyData *output = appender->GetOutput();
output->Update();
avtDataTree_p newtree = new avtDataTree(output, -1);
SetOutputDataTree(newtree);
}
......@@ -642,8 +646,8 @@ avtLineScanFilter::PostExecute(void)
vtkAppendPolyData *appender = vtkAppendPolyData::New();
for (int i = 0 ; i < nLeaves ; i++)
appender->AddInput((vtkPolyData *) leaves[i]);
appender->Update();
vtkPolyData *output = appender->GetOutput();
output->Update();
avtDataTree_p newtree = new avtDataTree(output, -1);
SetOutputDataTree(newtree);
appender->Delete();
......
......@@ -792,6 +792,9 @@ avtLineoutFilter::NoSampling(vtkDataSet *in_ds, int domain)
// the data set remove ghost cells filter doesn't know what it's real
// output is until it updates.
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
// ****************************************************************************
vtkDataSet *
......@@ -808,8 +811,8 @@ avtLineoutFilter::Sampling(vtkDataSet *in_ds, int domain)
filter->SetPoint2(point2);
filter->SetNumberOfSamplePoints(numberOfSamplePoints);
filter->GetOutput()->SetUpdateGhostLevel(0);
filter->Update();
vtkPolyData *outPolys = filter->GetOutput();
outPolys->Update();
vtkDataSet *rv = outPolys;
if (outPolys->GetNumberOfCells() == 0 ||
......
......@@ -137,6 +137,9 @@ avtSmoothPolyDataFilter::SetSmoothingLevel(int sl)
// Jeremy Meredith, Mon Feb 23 16:58:50 EST 2009
// Added deletion of geometry filter.
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
// ****************************************************************************
vtkDataSet *
......@@ -191,7 +194,7 @@ avtSmoothPolyDataFilter::ExecuteData(vtkDataSet *inDS, int, string)
break;
}
newDS->Update();
smoothPolyData->Update();
vtkDataSet *outDS = NULL;
if (newDS->GetNumberOfCells() > 0)
......
......@@ -290,6 +290,9 @@ avtTransform::~avtTransform()
// Dave Pugmire, Fri May 14 08:04:43 EDT 2010
// Flag for vector transformations.
//
// Kathleen Biagas, Fri Jan 25 16:39:17 PST 2013
// Call Update on filter, not data object.
//
// ****************************************************************************
vtkDataSet *
......@@ -331,8 +334,8 @@ avtTransform::ExecuteData(vtkDataSet *in_ds, int, std::string)
break;
}
transform->Update();
vtkPointSet *out_ds = transform->GetOutput();
out_ds->Update();
ManageMemory(out_ds);
transform->Delete();
......
......@@ -334,7 +334,7 @@ avtCompactTreeFilter::Execute(void)
}
else
{
ds->Update();
pmap->polyFilter->Update();
outTree = new avtDataTree(ds, -1);
}
ds->Delete();
......
......@@ -737,6 +737,9 @@ CreateStringFromVTKInput(vtkImageData *img, unsigned char *&str, int &len)
// Removed call to SetSource(NULL) as it now removes information necessary
// for the dataset.
//
// Kathleen Biagas, Fri Jan 25 16:40:41 PST 2013
// Call update on reader, not data object.
//
// ****************************************************************************
void avtImageRepresentation::GetImageFromString(unsigned char *str,
......@@ -765,8 +768,8 @@ void avtImageRepresentation::GetImageFromString(unsigned char *str,
charArray->SetArray((char *) str, strLength, iOwnIt);
reader->SetReadFromInputString(1);
reader->SetInputArray(charArray);
reader->Update();
img = reader->GetOutput();
img->Update();
img->SetScalarType(VTK_UNSIGNED_CHAR);
img->Register(NULL);
// calling SetSource sets' PipelineInformation to NULL, and then
......
......@@ -184,6 +184,9 @@ avtLabeledCurveMapper::SetUpFilters(int nInputs)
// Use label associated with input if multiple labels set.
// Keep track of input number an actor is associated with.
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
// ****************************************************************************
void
......@@ -207,7 +210,7 @@ avtLabeledCurveMapper::SetDatasetInput(vtkDataSet *ds, int inNum)
filter[inNum]->SetInput(ds);
filter[inNum]->SetOnRatio(ds->GetNumberOfPoints()/5);
filter[inNum]->GetOutput()->Update();
filter[inNum]->Update();
vtkPoints *points = filter[inNum]->GetOutput()->GetPoints();
double pos[3];
vtkIdType i;
......
......@@ -697,6 +697,9 @@ vtkParallelImageSpaceRedistributor::RequestData(
// Removed call to SetSource(NULL), with new vtk pipeline, it also removes
// necessary information from the dataset.
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the reader, not the data object.
//
// **************************************************************************
vtkPolyData *
......@@ -710,9 +713,8 @@ vtkParallelImageSpaceRedistributor::GetDataVTK(unsigned char *asChar,
charArray->SetArray((char *) asChar, (int) asCharLength, iOwnIt);
reader->SetReadFromInputString(1);
reader->SetInputArray(charArray);
reader->Update();
vtkPolyData *asVTK = reader->GetOutput();
asVTK->Update();
asVTK->Register(NULL);
//asVTK->SetSource(NULL);
......
......@@ -150,6 +150,9 @@ void vtkVisItDataSetMapper::ReleaseGraphicsResources( vtkWindow *renWin )
// Brad Whitlock, Wed Sep 14 15:30:14 PDT 2011
// Remove setting the painting delegate to make textured points work in SR.
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
// ****************************************************************************
void vtkVisItDataSetMapper::Render(vtkRenderer *ren, vtkActor *act)
......@@ -222,8 +225,8 @@ void vtkVisItDataSetMapper::Render(vtkRenderer *ren, vtkActor *act)
else
{
this->GeometryExtractor->SetInput(this->GetInput());
this->GeometryExtractor->Update();
vtkPolyData *pd = this->GeometryExtractor->GetOutput();
pd->Update();
haveVertices = (pd->GetNumberOfVerts() > 0);
this->PolyDataMapper->SetInput(pd);
}
......
......@@ -473,6 +473,9 @@ avtCompactnessQuery::PostExecute(void)
// Hank Childs, Fri Feb 15 15:30:32 PST 2008
// Fix memory leak.
//
// Kathleen Biagas, Fri Jan 25 16:32:38 PST 2013
// Call Update on filter, not data object.
//
// ****************************************************************************
void
......@@ -487,9 +490,9 @@ avtCompactnessQuery::Execute1(vtkDataSet *ds, const int dom)
vtkDataSetRemoveGhostCells *gzFilter2 = vtkDataSetRemoveGhostCells::New();
gzFilter2->SetInput(ds);
vtkDataSet *ds_2d_nogz = gzFilter2->GetOutput();
gzFilter2->Update();
ds_2d_nogz->Update();
vtkDataSet *ds_2d_nogz = gzFilter2->GetOutput();
//
// Create the area, volume and centroid arrays
......@@ -557,14 +560,14 @@ avtCompactnessQuery::Execute1(vtkDataSet *ds, const int dom)
geomFilter->SetInput(ds);
boundaryFilter->SetInput(geomFilter->GetOutput());
boundaryFilter->GetOutput()->SetUpdateGhostLevel(2);
boundaryFilter->GetOutput()->Update();
boundaryFilter->Update();
vtkPolyData *allLines = boundaryFilter->GetOutput();
//allLines->SetSource(NULL);
gzFilter1->SetInput(allLines);
gzFilter1->Update();
vtkDataSet *ds_1d_nogz = gzFilter1->GetOutput();
ds_1d_nogz->Update();
// We need polydata, and should have it by now.
if (ds_1d_nogz->GetDataObjectType() != VTK_POLY_DATA)
......@@ -648,6 +651,9 @@ avtCompactnessQuery::Execute1(vtkDataSet *ds, const int dom)
// Hank Childs, Mon Aug 30 17:15:30 PDT 2004
// Remove call to SetGhostLevel.
//
// Kathleen Biagas, Fri Jan 25 16:32:38 PST 2013
// Call Update on filter, not data object.
//
// ****************************************************************************
void
......@@ -661,10 +667,9 @@ avtCompactnessQuery::Execute2(vtkDataSet *ds, const int dom)
vtkDataSetRemoveGhostCells *gzFilter2 = vtkDataSetRemoveGhostCells::New();
gzFilter2->SetInput(ds);
gzFilter2->Update();
vtkDataSet *ds_2d_nogz = gzFilter2->GetOutput();
ds_2d_nogz->Update();
//
// Create the area, volume and centroid arrays
//
......
......@@ -170,6 +170,9 @@ avtEulerianQuery::VerifyInput()
// Remove call to SetSource(NULL) as it now removes information necessary
// for the dataset.
//
// Kathleen Biagas, Fri Jan 25 16:35:54 PST 2013
// Call Update on filter, not data object.
//
// ****************************************************************************
void
......@@ -183,6 +186,7 @@ avtEulerianQuery::Execute(vtkDataSet *in_ds, const int dom)
vtkDataSetRemoveGhostCells *ghost_remover =
vtkDataSetRemoveGhostCells::New();
ghost_remover->SetInput(gFilter->GetOutput());
ghost_remover->Update();
vtkDataSet *out = ghost_remover->GetOutput();
if (out->GetDataObjectType() != VTK_POLY_DATA)
{
......@@ -191,7 +195,6 @@ avtEulerianQuery::Execute(vtkDataSet *in_ds, const int dom)
}
vtkPolyData *pds = (vtkPolyData *) out;
pds->Update();
// I believe this isn't good enough. I believe the facelist filter
// simply passes points through, and only modifies the cell structure.
......
......@@ -358,6 +358,9 @@ avtHohlraumFluxQuery::SetDivideEmisByAbsorb(bool flag)
// Hank Childs, Fri May 2 09:02:39 PDT 2008
// Add a warning for no intersections.
//
// Kathleen Biagas, Fri Jan 25 16:36:38 PST 2013
// Call update on filter, not data object.
//
// ****************************************************************************
void
......@@ -380,8 +383,8 @@ avtHohlraumFluxQuery::ExecuteLineScan(vtkPolyData *pd)
cpd->SetToleranceIsAbsolute(0);
cpd->SetTolerance(1e-7);
cpd->SetInput(pd);
cpd->Update();
vtkPolyData *output = cpd->GetOutput();
output->Update();
UpdateProgress(extraMsg*currentNode+extraMsg/3, totalProg);
......
......@@ -208,6 +208,10 @@ avtLineScanTransformQuery::PostExecute(void)
// Programmer: David Bremer
// Creation: August 8, 2006
//
// Modifications:
// Kathleen Biagas, Fri Jan 25 16:37:37 PST 2013
// Call Update on filter, not data object.
//
// ****************************************************************************
void
......@@ -243,8 +247,8 @@ avtLineScanTransformQuery::ExecuteLineScan(vtkPolyData *pd)
cpd->SetToleranceIsAbsolute(0);
cpd->SetTolerance(1e-7);
cpd->SetInput(pd);
cpd->Update();
vtkPolyData *output = cpd->GetOutput();
output->Update();
UpdateProgress(extraMsg*currentNode+extraMsg/3, totalProg);
......
......@@ -507,6 +507,9 @@ vtkDataSetRemoveGhostCells::PolyDataExecute()
// Eric Brugger, Wed Jan 9 14:56:57 PST 2013
// Modified to inherit from vtkDataSetAlgorithm.
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
// ***************************************************************************
void
......@@ -570,7 +573,7 @@ vtkDataSetRemoveGhostCells::RectilinearGridExecute()
vtkVisItExtractRectilinearGrid *extractor = vtkVisItExtractRectilinearGrid::New();
extractor->SetInput(inGrid);
extractor->SetVOI(voi);
extractor->GetOutput()->Update();
extractor->Update();
outGrid->ShallowCopy(extractor->GetOutput());
extractor->Delete();
......@@ -611,6 +614,9 @@ vtkDataSetRemoveGhostCells::RectilinearGridExecute()
// Eric Brugger, Wed Jan 9 14:56:57 PST 2013
// Modified to inherit from vtkDataSetAlgorithm.
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
// ***************************************************************************
void
......@@ -652,7 +658,7 @@ vtkDataSetRemoveGhostCells::StructuredGridExecute()
vtkVisItExtractGrid *extractor = vtkVisItExtractGrid::New();
extractor->SetInput(inGrid);
extractor->SetVOI(voi);
extractor->GetOutput()->Update();
extractor->Update();
outGrid->ShallowCopy(extractor->GetOutput());
extractor->Delete();
......
......@@ -107,6 +107,9 @@ vtkLinesFromOriginalCells::~vtkLinesFromOriginalCells()
// Eric Brugger, Wed Jan 9 11:44:42 PST 2013
// Modified to inherit from vtkPolyDataAlgorithm.
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
// ****************************************************************************
int vtkLinesFromOriginalCells::RequestData(
vtkInformation *vtkNotUsed(request),
......@@ -151,7 +154,7 @@ int vtkLinesFromOriginalCells::RequestData(
"field data. Using vtkExtractEdges.");
vtkExtractEdges *extractor = vtkExtractEdges::New();
extractor->SetInput(input);
extractor->GetOutput()->Update();
extractor->Update();
output->ShallowCopy(extractor->GetOutput());
extractor->Delete();
return 1;
......
......@@ -492,6 +492,9 @@ vtkSlicer::RectilinearGridExecute(void)
// Eric Brugger, Thu Jan 10 10:24:20 PST 2013
// Modified to inherit from vtkPolyDataAlgorithm.
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
// ****************************************************************************
void
......@@ -681,7 +684,7 @@ vtkSlicer::UnstructuredGridExecute(void)
appender->AddInput(just_from_zoo);
just_from_zoo->Delete();
appender->GetOutput()->Update();
appender->Update();
output->ShallowCopy(appender->GetOutput());
appender->Delete();
......
......@@ -345,6 +345,9 @@ vtkVisItContourFilter::RectilinearGridExecute(vtkDataSet *input,
// Brad Whitlock, Wed Apr 11 11:37:18 PDT 2012
// When we can't contour a cell, insert faces too for polyhedral cells.
//
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
///////////////////////////////////////////////////////////////////////////////
int
......@@ -491,7 +494,7 @@ vtkVisItContourFilter::UnstructuredGridExecute(vtkDataSet *input,
vtkAppendPolyData *appender = vtkAppendPolyData::New();
appender->AddInput(not_from_zoo);
appender->AddInput(just_from_zoo);
appender->GetOutput()->Update();
appender->Update();
output->ShallowCopy(appender->GetOutput());
appender->Delete();
......
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