Commit 332b78ad authored by brugger's avatar brugger

I converted more filters to use avtDataRepresentations instead

of vtkDataSets.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23934 18c085ea-50e0-402c-830e-de6fd14e8384
parent e601c1db
......@@ -207,10 +207,9 @@ avtOnionPeelFilter::Equivalent(const AttributeGroup *a)
// Sends the specified input and output through the OnionPeel filter.
//
// Arguments:
// in_ds The input dataset.
// <unused> The domain number.
// in_dr The input data representation.
//
// Returns: The output unstructured grid.
// Returns: The output data representation.
//
// Programmer: Kathleen Bonnell
// Creation: October 09, 2000
......@@ -287,14 +286,19 @@ avtOnionPeelFilter::Equivalent(const AttributeGroup *a)
// seed cell was specified as a global cell number and material interface
// reconstruction was applied.
//
// Kathleen Biagas, Fri Jul 25 12:58:09 MST 2014
// Use new att 'honorOriginalMesh' in determining whether to reconstruct.
// Eric Brugger, Thu Jul 31 11:43:08 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataSet *
avtOnionPeelFilter::ExecuteData(vtkDataSet *in_ds, int DOM, std::string)
avtDataRepresentation *
avtOnionPeelFilter::ExecuteData(avtDataRepresentation *in_dr)
{
//
// Get the VTK data set.
//
vtkDataSet *in_ds = in_dr->GetDataVTK();
if (successfullyExecuted)
{
return NULL;
......@@ -486,7 +490,11 @@ avtOnionPeelFilter::ExecuteData(vtkDataSet *in_ds, int DOM, std::string)
removeGhostCells->Delete();
}
successfullyExecuted |= (!encounteredBadSeed && !encounteredGhostSeed);
return outds;
avtDataRepresentation *out_dr = new avtDataRepresentation(outds,
in_dr->GetDomain(), in_dr->GetLabel());
return out_dr;
}
// ****************************************************************************
......
......@@ -43,12 +43,10 @@
#ifndef AVT_ONION_PEEL_FILTER_H
#define AVT_ONION_PEEL_FILTER_H
#include <avtPluginDataTreeIterator.h>
#include <OnionPeelAttributes.h>
#include <OnionPeelAttributes.h>
class vtkDataSet;
class vtkOnionPeelFilter;
class vtkPolyDataOnionPeelFilter;
......@@ -92,6 +90,9 @@ class vtkPolyDataOnionPeelFilter;
// BadSeedCellCallback. Added groupCategory, encounteredGhostSeed, and
// successfullyExecuted.
//
// Eric Brugger, Thu Jul 31 11:42:38 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class avtOnionPeelFilter : public avtPluginDataTreeIterator
......@@ -126,7 +127,7 @@ class avtOnionPeelFilter : public avtPluginDataTreeIterator
bool groupCategory;
bool successfullyExecuted;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual avtDataRepresentation *ExecuteData(avtDataRepresentation *);
virtual void PreExecute();
virtual void PostExecute();
......
......@@ -493,20 +493,27 @@ avtPDFFilter::ModifyContract(avtContract_p s)
// Sends the specified input and output through the PDF filter.
//
// Arguments:
// in_ds The input dataset.
// <unused> The domain number.
// <unused> The label.
// in_dr The input data representation.
//
// Returns: The output dataset.
// Returns: The output data representation.
//
// Programmer: childs -- generated by xml2avt
// Creation: Sun Nov 20 12:22:59 PDT 2005
//
// Modifications:
// Eric Brugger, Thu Jul 31 12:09:01 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataSet *
avtPDFFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
avtDataRepresentation *
avtPDFFilter::ExecuteData(avtDataRepresentation *in_dr)
{
//
// Get the VTK data set.
//
vtkDataSet *in_ds = in_dr->GetDataVTK();
bool isNodal1 = true;
vtkDataArray *arr1=in_ds->GetPointData()->GetArray(atts.GetVar1().c_str());
if (arr1 == NULL)
......
......@@ -43,12 +43,9 @@
#ifndef AVT_PDF_FILTER_H
#define AVT_PDF_FILTER_H
#include <avtPluginDataTreeIterator.h>
#include <PDFAttributes.h>
class vtkDataSet;
#include <PDFAttributes.h>
// ****************************************************************************
......@@ -60,6 +57,10 @@ class vtkDataSet;
// Programmer: childs -- generated by xml2avt
// Creation: Sun Nov 20 12:22:59 PDT 2005
//
// Modifications:
// Eric Brugger, Thu Jul 31 12:08:35 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class avtPDFFilter : public avtPluginDataTreeIterator
......@@ -93,7 +94,7 @@ class avtPDFFilter : public avtPluginDataTreeIterator
float var3Min;
float var3Max;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual avtDataRepresentation *ExecuteData(avtDataRepresentation *);
};
......
......@@ -147,11 +147,9 @@ avtProjectFilter::Equivalent(const AttributeGroup *a)
// Sends the specified input and output through the Project filter.
//
// Arguments:
// in_ds The input dataset.
// <unused> The domain number.
// <unused> The label.
// in_dr The input data representation.
//
// Returns: The output dataset.
// Returns: The output data representation.
//
// Programmer: Jeremy Meredith
// Creation: September 3, 2004
......@@ -166,11 +164,19 @@ avtProjectFilter::Equivalent(const AttributeGroup *a)
// Kathleen Biagas, Wed Aug 8 17:31:54 PDT 2012
// Use templatized ProjectVectors.
//
// Eric Brugger, Thu Jul 31 14:44:16 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataSet *
avtProjectFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
avtDataRepresentation *
avtProjectFilter::ExecuteData(avtDataRepresentation *in_dr)
{
//
// Get the VTK data set.
//
vtkDataSet *in_ds = in_dr->GetDataVTK();
int datatype = in_ds->GetDataObjectType();
vtkPointSet *out_ds = NULL;
switch (datatype)
......@@ -226,8 +232,12 @@ avtProjectFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
arr->Delete();
}
avtDataRepresentation *out_dr = new avtDataRepresentation(out_ds,
in_dr->GetDomain(), in_dr->GetLabel());
return out_ds;
out_ds->Delete();
return out_dr;
}
......@@ -413,6 +423,9 @@ avtProjectFilter::ProjectPoint(double &x,double &y,double &z)
// Kathleen Biagas, Wed Aug 8 15:37:10 PDT 2012
// Preserve coordinate data type.
//
// Eric Brugger, Thu Jul 31 14:44:16 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkPointSet *
avtProjectFilter::ProjectRectilinearGrid(vtkRectilinearGrid *in_ds)
......@@ -455,14 +468,6 @@ avtProjectFilter::ProjectRectilinearGrid(vtkRectilinearGrid *in_ds)
out->GetCellData()->ShallowCopy(in_ds->GetCellData());
out->GetPointData()->ShallowCopy(in_ds->GetPointData());
//
// We want to reduce the reference count of this dataset so it doesn't get
// leaked. But where to store it? Fortunately, our base class handles
// this for us.
//
ManageMemory(out);
out->Delete();
return out;
}
......@@ -489,6 +494,9 @@ avtProjectFilter::ProjectRectilinearGrid(vtkRectilinearGrid *in_ds)
// Kathleen Biagas, Wed Aug 8 17:33:35 PDT 2012
// Preserve coordinate type.
//
// Eric Brugger, Thu Jul 31 14:44:16 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkPointSet *
......@@ -550,8 +558,6 @@ avtProjectFilter::ProjectPointSet(vtkPointSet *in_ds)
}
}
ManageMemory(out_ds);
out_ds->Delete();
return out_ds;
}
......
......@@ -43,8 +43,8 @@
#ifndef AVT_Project_FILTER_H
#define AVT_Project_FILTER_H
#include <avtPluginDataTreeIterator.h>
#include <ProjectAttributes.h>
class vtkDataSet;
......@@ -74,6 +74,9 @@ class vtkRectilinearGrid;
// Added double precision version of projection for increased
// accuracy.
//
// Eric Brugger, Thu Jul 31 14:42:52 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class avtProjectFilter : public avtPluginDataTreeIterator
......@@ -93,7 +96,7 @@ class avtProjectFilter : public avtPluginDataTreeIterator
protected:
ProjectAttributes atts;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual avtDataRepresentation *ExecuteData(avtDataRepresentation *);
virtual void PostExecute(void);
virtual void UpdateDataObjectInfo(void);
avtContract_p ModifyContract(avtContract_p);
......
......@@ -486,23 +486,32 @@ avtReflectFilter::UpdateDataObjectInfo(void)
// Sends the specified input and output through the Reflect filter.
//
// Arguments:
// in_ds The input dataset.
// dom The domain number.
// str An identifying string.
// in_dr The input data representation.
//
// Returns: The output dataset.
// Returns: The output data tree.
//
// Programmer: childs -- generated by xml2info
// Creation: Thu Mar 7 10:35:24 PDT 2002
//
// Modifications:
// Eric Brugger, Thu Jul 31 19:15:48 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
avtDataTree_p
avtReflectFilter::ExecuteDataTree(vtkDataSet *in_ds, int dom, string str)
avtReflectFilter::ExecuteDataTree(avtDataRepresentation *in_dr)
{
//
// Get the VTK data set, the domain number, and the label.
//
vtkDataSet *in_ds = in_dr->GetDataVTK();
int domain = in_dr->GetDomain();
std::string label = in_dr->GetLabel();
int i;
if (in_ds == NULL)
if (in_dr == NULL)
{
return NULL;
}
......@@ -524,7 +533,7 @@ avtReflectFilter::ExecuteDataTree(vtkDataSet *in_ds, int dom, string str)
//
// Construct a data tree out of our reflections.
//
avtDataTree_p rv = new avtDataTree(8, reflections, dom, str);
avtDataTree_p rv = new avtDataTree(8, reflections, domain, label);
//
// Clean up memory.
......
......@@ -43,11 +43,10 @@
#ifndef AVT_Reflect_FILTER_H
#define AVT_Reflect_FILTER_H
#include <avtSIMODataTreeIterator.h>
#include <avtPluginFilter.h>
#include <ReflectAttributes.h>
#include <ReflectAttributes.h>
class vtkDataArray;
class vtkDataSet;
......@@ -69,6 +68,9 @@ class vtkRectilinearGrid;
// Hank Childs, Fri Sep 3 12:10:47 PDT 2010
// Add Boolean to zero out velocities on the boundary.
//
// Eric Brugger, Thu Jul 31 19:15:11 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class avtReflectFilter : public virtual avtSIMODataTreeIterator,
......@@ -96,7 +98,7 @@ class avtReflectFilter : public virtual avtSIMODataTreeIterator,
virtual void PreExecute(void);
virtual void PostExecute(void);
virtual avtDataTree_p ExecuteDataTree(vtkDataSet *, int, std::string);
virtual avtDataTree_p ExecuteDataTree(avtDataRepresentation *);
virtual avtContract_p
ModifyContract(avtContract_p);
virtual void UpdateDataObjectInfo(void);
......
......@@ -145,11 +145,9 @@ avtRemoveCellsFilter::Equivalent(const AttributeGroup *a)
// Sends the specified input and output through the RemoveCells filter.
//
// Arguments:
// in_ds The input dataset.
// <unused> The domain number.
// <unused> The label.
// in_dr The input data representation.
//
// Returns: The output dataset.
// Returns: The output data representation.
//
// Programmer: haddox1 -- generated by xml2info
// Creation: Mon Jun 2 13:48:29 PST 2003
......@@ -159,18 +157,26 @@ avtRemoveCellsFilter::Equivalent(const AttributeGroup *a)
// Hank Childs, Thu Mar 10 09:55:08 PST 2005
// Fix memory leak.
//
// Eric Brugger, Thu Jul 31 19:27:52 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataSet *
avtRemoveCellsFilter::ExecuteData(vtkDataSet *in_ds, int domain, std::string)
avtDataRepresentation *
avtRemoveCellsFilter::ExecuteData(avtDataRepresentation *in_dr)
{
//
// Get the VTK data set and the domain number.
//
vtkDataSet *in_ds = in_dr->GetDataVTK();
int domain = in_dr->GetDomain();
vector<int> cells;
ParseAtts(domain, cells);
if(cells.size() == 0)
{
in_ds->Register(NULL);
return in_ds;
return in_dr;
}
sort(cells.begin(), cells.end());
......@@ -226,7 +232,12 @@ avtRemoveCellsFilter::ExecuteData(vtkDataSet *in_ds, int domain, std::string)
outCD->Squeeze();
return ug;
avtDataRepresentation *out_dr = new avtDataRepresentation(ug,
in_dr->GetDomain(), in_dr->GetLabel());
ug->Delete();
return out_dr;
}
// ****************************************************************************
......
......@@ -43,13 +43,12 @@
#ifndef AVT_RemoveCells_FILTER_H
#define AVT_RemoveCells_FILTER_H
#include <avtPluginDataTreeIterator.h>
#include <RemoveCellsAttributes.h>
#include <vector>
class vtkDataSet;
// ****************************************************************************
// Class: avtRemoveCellsFilter
......@@ -60,6 +59,10 @@ class vtkDataSet;
// Programmer: haddox1 -- generated by xml2info
// Creation: Mon Jun 2 13:48:29 PST 2003
//
// Modifications:
// Eric Brugger, Thu Jul 31 19:27:19 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class avtRemoveCellsFilter : public avtPluginDataTreeIterator
......@@ -82,7 +85,7 @@ class avtRemoveCellsFilter : public avtPluginDataTreeIterator
void ParseAtts(int domain, std::vector<int> &cells);
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual avtDataRepresentation *ExecuteData(avtDataRepresentation *);
virtual void UpdateDataObjectInfo(void);
};
......
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