Commit 314622cf authored by bonnell's avatar bonnell

Replace ds->Update with filter->Update

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@20157 18c085ea-50e0-402c-830e-de6fd14e8384
parent e9326b1f
......@@ -697,6 +697,9 @@ avtExpressionFilter::GetVariableDimension(void)
// Added code to delete the copy of the ds vtkDataSet. We where leaking
// memory in a few places below because we exited the function early.
//
// Kathleen Biagas, Mon Jan 28 11:10:37 PST 2013
// Call Update on filter, not data object.
//
// ****************************************************************************
vtkDataArray *
......@@ -749,8 +752,8 @@ avtExpressionFilter::Recenter(vtkDataSet *ds, vtkDataArray *arr,
vtkPointDataToCellData *pd2cd = vtkPointDataToCellData::New();
pd2cd->SetInput(ds2);
pd2cd->Update();
vtkDataSet *ds3 = pd2cd->GetOutput();
ds3->Update();
outv = ds3->GetCellData()->GetScalars();
outv->Register(NULL);
pd2cd->Delete();
......@@ -781,8 +784,8 @@ avtExpressionFilter::Recenter(vtkDataSet *ds, vtkDataArray *arr,
vtkCellDataToPointData *cd2pd = vtkCellDataToPointData::New();
cd2pd->SetInput(ds2);
cd2pd->Update();
vtkDataSet *ds3 = cd2pd->GetOutput();
ds3->Update();
outv = ds3->GetPointData()->GetScalars();
outv->Register(NULL);
cd2pd->Delete();
......
......@@ -164,6 +164,9 @@ avtDisplaceFilter::SetVariable(const std::string &v)
// Kathleen Biagas, Tue Aug 21 16:52:12 MST 2012
// Preserve coordinate type.
//
// Kathleen Biagas, Mon Jan 28 10:51:32 PST 2013
// Call Update on filter, not data object.
//
// ****************************************************************************
vtkDataSet *
......@@ -196,7 +199,7 @@ avtDisplaceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
vtkCellDataToPointData *cd2pd = vtkCellDataToPointData::New();
cd2pd->SetInput(one_var_ds);
cd2pd->GetOutput()->Update();
cd2pd->Update();
vtkDataSet *pt_one_var_ds = cd2pd->GetOutput();
tmp_ds = (vtkDataSet *) in_ds->NewInstance();
......@@ -218,8 +221,8 @@ avtDisplaceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
vtkWarpVector *warp = vtkWarpVector::New();
warp->SetInput((vtkPointSet *)in_ds);
warp->SetScaleFactor(factor);
warp->Update();
rv = warp->GetOutput();
rv->Update();
//
// Make this a dataset we can return even after we have freed memory.
......
......@@ -137,6 +137,9 @@ avtFeatureEdgesFilter::~avtFeatureEdgesFilter()
// Kathleen Biagas, Tue Aug 21 16:50:07 MST 2012
// Preserve coordinate type.
//
// Kathleen Biagas, Mon Jan 28 10:52:35 PST 2013
// Call Update on filter not data object.
//
// ****************************************************************************
vtkDataSet *
......@@ -239,9 +242,9 @@ avtFeatureEdgesFilter::ExecuteData(vtkDataSet *inDS, int, string)
featureEdgesFilter->NonManifoldEdgesOff();
featureEdgesFilter->ManifoldEdgesOff();
featureEdgesFilter->ColoringOff();
featureEdgesFilter->Update();
vtkDataSet *output = featureEdgesFilter->GetOutput();
output->Update();
if (output->GetNumberOfCells() > 0)
{
......
......@@ -156,6 +156,9 @@ avtNamedSelectionFilter::ExecuteData(vtkDataSet *in_ds, int dom, std::string)
// Brad Whitlock, Mon Jun 20 17:06:33 PST 2011
// I moved this code out from another function to make it more general.
//
// Kathleen Biagas, Mon Jan 28 10:56:30 PST 2013
// Call upate on filter not data object.
//
// ****************************************************************************
vtkDataSet *
......@@ -183,8 +186,8 @@ avtNamedSelectionFilter::SelectedData(vtkDataSet *in_ds,
thres->ThresholdBetween(0.5, 1.5);
thres->SetInputArrayToProcess(0, 0, 0,
vtkDataObject::FIELD_ASSOCIATION_CELLS, "_avt_thresh_var");
thres->Update();
rv = thres->GetOutput();
rv->Update();
ManageMemory(rv);
thres->Delete();
ds->Delete();
......
......@@ -276,6 +276,9 @@ avtThresholdFilter::Equivalent(const AttributeGroup *a)
// the Threshold filter inherits from the structured mesh chunker, which
// assumes the return value has an extra reference.
//
// Kathleen Biagas, Mon Jan 28 11:09:02 PST 2013
// Call Update on the fitler not the data object.
//
// ****************************************************************************
vtkDataSet *
......@@ -389,8 +392,8 @@ avtThresholdFilter::ProcessOneChunk(
EXCEPTION1(VisItException, errMsg);
}
threshold->Update();
curOutDataSet = threshold->GetOutput();
curOutDataSet->Update();
}
if (curOutDataSet->GetNumberOfCells() <= 0)
......
......@@ -101,6 +101,9 @@ YoungsMIR::~YoungsMIR()
// Jeremy Meredith, Mon Jan 4 15:09:23 EST 2010
// Added some timings.
//
// Kathleen Biagas, Mon Jan 28 10:35:29 PST 2013
// Call update on the filter not the data object.
//
// ****************************************************************************
bool
YoungsMIR::ReconstructMesh(vtkDataSet *orig_ds, avtMaterial *orig_mat, int dim)
......@@ -149,8 +152,8 @@ YoungsMIR::ReconstructMesh(vtkDataSet *orig_ds, avtMaterial *orig_mat, int dim)
int th_grad = visitTimer->StartTimer();
vtkCQS *cqs = vtkCQS::New();
cqs->SetInput(ds);
cqs->Update();
ds = cqs->GetOutput();
ds->Update();
ds->Register(NULL);
cqs->Delete();
......@@ -167,8 +170,8 @@ YoungsMIR::ReconstructMesh(vtkDataSet *orig_ds, avtMaterial *orig_mat, int dim)
sprintf(str2, "grad%05d", mapUsedMatToMat[m]);
grad->SetGradientArrayName(str2);
grad->Update();
ds = grad->GetOutput();
ds->Update();
ds->Register(NULL);
grad->Delete();
}
......@@ -178,8 +181,8 @@ YoungsMIR::ReconstructMesh(vtkDataSet *orig_ds, avtMaterial *orig_mat, int dim)
int th_recenter = visitTimer->StartTimer();
vtkVisItPointDataToCellData *pd2cd = vtkVisItPointDataToCellData::New();
pd2cd->SetInput(ds);
pd2cd->Update();
ds = pd2cd->GetOutput();
ds->Update();
ds->Register(NULL);
pd2cd->Delete();
visitTimer->StopTimer(th_recenter, "MIR: Recenter gradients");
......
......@@ -117,58 +117,6 @@ avtVTKDatasetToDatasetFilter::SetInput(vtkDataSet **list, int listN)
}
// ****************************************************************************
// Method: avtVTKDatasetToDatasetFilter::UpdateInput
//
// Purpose:
// Overrides the avtDatasetToDatasetFilter UpdateInput method. Since this
// will end the avt pipeline, it updates the vtk input.
//
// Arguments:
// dl A list of the domains of interest to the filters below this
// one in the pipeline.
//
// Returns: true if the input was modified.
//
// Programmer: Hank Childs
// Creation: July 24, 2000
//
// Modifications:
//
// Jeremy Meredith, Tue Sep 26 09:42:26 PDT 2000
// Added call to GetDomainVTK since FetchDomain returns an avtDomain.
//
// Hank Childs, Tue Jan 30 18:52:48 PST 2001
// Load balance in parallel.
//
// Kathleen Bonnell, Fri Feb 9 16:57:06 PST 2001
// Added call to GetDomain() since FetchDomain returns an avtDomainTree.
//
// Hank Childs, Thu Mar 1 14:45:20 PST 2001
// Switched FetchDomain to FetchDomains (with s).
//
// Kathleen Bonnell, Mon Apr 9 13:02:51 PDT 2001
// Reflect change from avtDomainTree to avtDataTree. Added call
// to Traverse to perform the actual update.
//
// ****************************************************************************
bool
avtVTKDatasetToDatasetFilter::UpdateInput(avtDomainList *dl)
{
//
// Make this work well when we are testing in parallel.
//
avtLoadBalancer lb;
lb.Calculate(dl);
avtDataTree_p tree = source->FetchDomains(dl);
tree->Traverse(CUpdateData, NULL, modified);
return modified;
}
// ****************************************************************************
// Method: avtVTKDatasetToDatasetFilter::Execute
//
......
......@@ -65,6 +65,9 @@
// Jeremy Meredith, Thu Sep 28 12:50:55 PDT 2000
// Removed CreateOutputDatasets.
//
// Kathleen Biagas, Mon Jan 28 11:24:36 PST 2013
// Remove no longer used method 'UpdateInput'.
//
// ****************************************************************************
class PIPELINE_API avtVTKDatasetToDatasetFilter : public avtDatasetToDatasetFilter
......@@ -83,7 +86,6 @@ class PIPELINE_API avtVTKDatasetToDatasetFilter : public avtDatasetToDatasetFilt
virtual void CalcDomainList(void);
virtual void Execute(avtDomainList *);
virtual bool UpdateInput(avtDomainList *);
};
......
......@@ -633,41 +633,6 @@ CGetVariableList(avtDataRepresentation &data, void *nv, bool &success)
}
// ****************************************************************************
// Method: CUpdateData
//
// Purpose:
// Updates the vtk input.
//
// Arguments:
// data The data to be updated.
// <unused>
// modified True if the data was modified.
//
// Notes:
// This method is designed to be used as the function parameter of
// avtDataTree::Iterate.
//
// Programmer: Kathleen Bonnell
// Creation: April 18, 2001
//
// ****************************************************************************
void
CUpdateData(avtDataRepresentation &data, void *, bool &modified)
{
if (!data.Valid())
{
EXCEPTION0(NoInputException);
}
vtkDataSet *ds = data.GetDataVTK();
unsigned long mtime = ds->GetMTime();
ds->Update();
if (mtime != ds->GetMTime())
modified = true;
}
// ****************************************************************************
// Method: CAddInputToAppendFilter
//
......
......@@ -135,6 +135,9 @@ class vtkDataArray;
// Hank Childs, Sat Jan 1 17:35:23 PST 2011
// Moved visitIsFinite to header, so other classes can use it.
//
// Kathleen Biagas, Mon Jan 28 10:06:01 PST 2013
// Remove no longer used method CUpdateData.
//
// ****************************************************************************
//
......@@ -143,7 +146,6 @@ class vtkDataArray;
PIPELINE_API void CGetSpatialExtents(avtDataRepresentation &, void *, bool &);
PIPELINE_API void CGetDataExtents(avtDataRepresentation &, void *, bool &);
PIPELINE_API void CUpdateData(avtDataRepresentation &, void *, bool &);
PIPELINE_API void CAddInputToAppendFilter(avtDataRepresentation &, void *, bool &);
PIPELINE_API void CBreakVTKPipelineConnections(avtDataRepresentation &,
void *, bool &);
......
......@@ -618,6 +618,9 @@ avtDataRepresentation::GetDataString(int &length, DataSetType &dst, bool compres
// Removed call to SetSource(NULL) as it now removes information necessary
// to the dataset.
//
// Kathleen Biagas, Mon Jan 28 10:29:06 PST 2013
// Call Update on the reader, not the dataset.
//
// ****************************************************************************
vtkDataSet *
......@@ -718,11 +721,10 @@ avtDataRepresentation::GetDataVTK(void)
}
else
{
asVTK->Update();
reader->Update();
}
asVTK->Register(NULL);
//asVTK->SetSource(NULL);
reader->Delete();
charArray->Delete();
originalString = NULL;
......
......@@ -21,7 +21,6 @@
}
else
{
input->Update();
numPts = input->GetNumberOfPoints();
}
......
......@@ -22,7 +22,6 @@
}
else
{
input->Update();
numPts = input->GetNumberOfPoints();
}
......
......@@ -349,6 +349,9 @@ avtVTKFileReader::ReadInFile(void)
// Eric Brugger, Mon Jun 18 12:28:25 PDT 2012
// I enhanced the reader so that it can read parallel VTK files.
//
// Kathleen Biagas, Mon Jan 28 11:06:32 PST 2013
// Remove calls to ds->Update.
//
// ****************************************************************************
void
......@@ -390,13 +393,6 @@ avtVTKFileReader::ReadInDataset(int domain)
EXCEPTION1(InvalidFilesException, pieceFileNames[domain]);
}
dataset->Register(NULL);
//
// Force the read and make sure that the reader is really gone,
// so we don't eat up too many file descriptors.
//
dataset->Update();
//dataset->SetSource(NULL);
reader->Delete();
}
else if (pieceExtension == "vti")
......@@ -410,8 +406,6 @@ avtVTKFileReader::ReadInDataset(int domain)
EXCEPTION1(InvalidFilesException, pieceFileNames[domain]);
}
dataset->Register(NULL);
dataset->Update();
//dataset->SetSource(NULL);
reader->Delete();
}
else if (pieceExtension == "vtr")
......@@ -426,8 +420,6 @@ avtVTKFileReader::ReadInDataset(int domain)
EXCEPTION1(InvalidFilesException, pieceFileNames[domain]);
}
dataset->Register(NULL);
dataset->Update();
//dataset->SetSource(NULL);
reader->Delete();
}
else if (pieceExtension == "vts")
......@@ -442,8 +434,6 @@ avtVTKFileReader::ReadInDataset(int domain)
EXCEPTION1(InvalidFilesException, pieceFileNames[domain]);
}
dataset->Register(NULL);
dataset->Update();
//dataset->SetSource(NULL);
reader->Delete();
}
else if (pieceExtension == "vtp")
......@@ -457,8 +447,6 @@ avtVTKFileReader::ReadInDataset(int domain)
EXCEPTION1(InvalidFilesException, pieceFileNames[domain]);
}
dataset->Register(NULL);
dataset->Update();
//dataset->SetSource(NULL);
reader->Delete();
}
else if (pieceExtension == "vtu")
......@@ -473,8 +461,6 @@ avtVTKFileReader::ReadInDataset(int domain)
EXCEPTION1(InvalidFilesException, pieceFileNames[domain]);
}
dataset->Register(NULL);
dataset->Update();
//dataset->SetSource(NULL);
reader->Delete();
}
else
......
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