Commit a1fa7d93 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@23816 18c085ea-50e0-402c-830e-de6fd14e8384
parent 07e2066e
......@@ -662,6 +662,10 @@ avtConnComponentsExpression::LabelGhostNeighbors(vtkDataSet *data_set)
// Programmer: Hank Childs
// Creation: November 30, 2013
//
// Modifications:
// Eric Brugger, Mon Jul 21 12:06:33 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
void
......@@ -695,7 +699,8 @@ avtConnComponentsExpression::LabelBoundaryNeighbors(vtkDataSet *data_set)
// use external routine to find which cells are external
avtFacelistFilter *flf = new avtFacelistFilter();
avtDataTree_p tree = flf->FindFaces(clone_ds, -1, "",
avtDataRepresentation clone_dr(clone_ds, -1, "");
avtDataTree_p tree = flf->FindFaces(&clone_dr,
GetInput()->GetInfo(), false, false,
true, true, NULL);
delete flf;
......
......@@ -130,6 +130,9 @@ avtFindExternalExpression::~avtFindExternalExpression()
// Change the avtFacelistFilter::FindFaces from a static function to a
// normal function for the thread code to work.
//
// Eric Brugger, Mon Jul 21 12:09:02 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataArray *
......@@ -152,7 +155,8 @@ avtFindExternalExpression::DeriveVariable(vtkDataSet *in_ds, int currentDomainsI
arr->Delete();
avtFacelistFilter *flf = new avtFacelistFilter();
avtDataTree_p tree = flf->FindFaces(new_ds, -1, "",
avtDataRepresentation new_dr(new_ds, -1, "");
avtDataTree_p tree = flf->FindFaces(&new_dr,
GetInput()->GetInfo(), false, false,
true, true, NULL);
delete flf;
......
......@@ -498,10 +498,9 @@ avtContourFilter::PreExecute(void)
// Sends the specified input and output through the contour filter.
//
// Arguments:
// in_ds The input dataset.
// domain The domain number.
// in_dr The input data representation.
//
// Returns: The output dataset.
// Returns: The output data tree.
//
// Programmer: Hank Childs
// Creation: July 24, 2000
......@@ -607,11 +606,21 @@ avtContourFilter::PreExecute(void)
// Kathleen Biagas, Fri Jan 25 16:04:46 PST 2013
// Call Update on the filter, not the data object.
//
// Eric Brugger, Mon Jul 21 10:15:17 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
avtDataTree_p
avtContourFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain, string label)
avtContourFilter::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 tt1 = visitTimer->StartTimer();
char *contourVar = (activeVariable != NULL ? activeVariable
......
......@@ -45,13 +45,13 @@
#include <filters_exports.h>
#include <ContourOpAttributes.h>
#include <avtSIMODataTreeIterator.h>
#include <ContourOpAttributes.h>
#include <string>
#include <vector>
class vtkDataSet;
// ****************************************************************************
// Class: avtContourFilter
......@@ -93,6 +93,9 @@ class vtkDataSet;
// Hank Childs, Sun Mar 6 08:18:53 PST 2005
// Removed "centering conversion module" data member.
//
// Eric Brugger, Mon Jul 21 10:13:44 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class AVTFILTERS_API avtContourFilter : public avtSIMODataTreeIterator
......@@ -125,7 +128,7 @@ class AVTFILTERS_API avtContourFilter : public avtSIMODataTreeIterator
virtual avtContract_p
ModifyContract(avtContract_p);
virtual avtDataTree_p ExecuteDataTree(vtkDataSet *, int, std::string);
virtual avtDataTree_p ExecuteDataTree(avtDataRepresentation *);
virtual void UpdateDataObjectInfo(void);
virtual void PreExecute(void);
......
......@@ -740,11 +740,9 @@ FixWraparounds(vtkDataSet *in_ds, int comp_idx)
// Sends the specified input and output through the CoordConvert 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: Hank Childs
// Creation: Fri Jun 27 16:41:32 PST 2003
......@@ -757,11 +755,19 @@ FixWraparounds(vtkDataSet *in_ds, int comp_idx)
// Jeremy Meredith, Fri Aug 7 15:35:29 EDT 2009
// Call a common transform function to avoid code duplication.
//
// Eric Brugger, Mon Jul 21 10:33:06 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataSet *
avtCoordSystemConvert::ExecuteData(vtkDataSet *in_ds, int, std::string)
avtDataRepresentation *
avtCoordSystemConvert::ExecuteData(avtDataRepresentation *in_dr)
{
//
// Get the VTK data set.
//
vtkDataSet *in_ds = in_dr->GetDataVTK();
std::vector<vtkDataSet *> deleteList;
CoordSystem ct_current = inputSys;
......@@ -798,7 +804,7 @@ avtCoordSystemConvert::ExecuteData(vtkDataSet *in_ds, int, std::string)
continuousPhi, vectorTransformMethod,
SphericalToCylindricalPoint);
else
return in_ds;
return in_dr;
deleteList.push_back(new_ds);
cur_ds = new_ds;
......@@ -819,14 +825,15 @@ avtCoordSystemConvert::ExecuteData(vtkDataSet *in_ds, int, std::string)
}
}
ManageMemory(cur_ds);
avtDataRepresentation *out_dr = new avtDataRepresentation(cur_ds,
in_dr->GetDomain(), in_dr->GetLabel());
for (unsigned int i = 0 ; i < deleteList.size() ; i++)
{
deleteList[i]->Delete();
}
return cur_ds;
return out_dr;
}
......
......@@ -44,6 +44,7 @@
#define AVT_CoordConvert_FILTER_H
#include <filters_exports.h>
#include <avtDataTreeIterator.h>
// ****************************************************************************
......@@ -64,6 +65,9 @@
// Added selectable vector transform method.
// Made the coord system enum be within the class namespace.
//
// Eric Brugger, Mon Jul 21 10:19:29 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class AVTFILTERS_API avtCoordSystemConvert : public avtDataTreeIterator
......@@ -104,7 +108,7 @@ class AVTFILTERS_API avtCoordSystemConvert : public avtDataTreeIterator
VectorTransformMethod vectorTransformMethod;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual avtDataRepresentation *ExecuteData(avtDataRepresentation *);
virtual void PostExecute(void);
virtual void UpdateDataObjectInfo(void);
......
......@@ -130,11 +130,9 @@ avtDisplaceFilter::SetVariable(const std::string &v)
// Sends the specified input and output through the Displace 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 xml2info
// Creation: Mon Nov 5 15:35:46 PST 2001
......@@ -167,11 +165,19 @@ avtDisplaceFilter::SetVariable(const std::string &v)
// Kathleen Biagas, Mon Jan 28 10:51:32 PST 2013
// Call Update on filter, not data object.
//
// Eric Brugger, Mon Jul 21 10:38:19 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataSet *
avtDisplaceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
avtDataRepresentation *
avtDisplaceFilter::ExecuteData(avtDataRepresentation *in_dr)
{
//
// Get the VTK data set.
//
vtkDataSet *in_ds = in_dr->GetDataVTK();
vtkDataSet *tmp_ds = NULL;
const char *displace_var = variable.c_str();
......@@ -223,11 +229,7 @@ avtDisplaceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
warp->SetScaleFactor(factor);
warp->Update();
rv = warp->GetOutput();
//
// Make this a dataset we can return even after we have freed memory.
//
ManageMemory(rv);
rv->Register(NULL);
warp->Delete();
}
......@@ -261,8 +263,6 @@ avtDisplaceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
pts->Delete();
rv = sg;
ManageMemory(rv);
sg->Delete();
}
else
{
......@@ -271,7 +271,6 @@ avtDisplaceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
EXCEPTION0(ImproperUseException);
}
//
// Clean up memory.
//
......@@ -281,7 +280,12 @@ avtDisplaceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
tmp_ds->Delete();
}
return rv;
avtDataRepresentation *out_dr = new avtDataRepresentation(rv,
in_dr->GetDomain(), in_dr->GetLabel());
rv->Delete();
return out_dr;
}
......
......@@ -47,8 +47,6 @@
#include <avtDataTreeIterator.h>
class vtkDataSet;
// ****************************************************************************
// Class: avtDisplaceFilter
......@@ -76,6 +74,9 @@ class vtkDataSet;
// Changed the inheritance, since this is no longer a plugin filter.
// (This filter was moved from /operators/Displace.)
//
// Eric Brugger, Mon Jul 21 10:37:53 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class AVTFILTERS_API avtDisplaceFilter : public avtDataTreeIterator
......@@ -95,7 +96,7 @@ class AVTFILTERS_API avtDisplaceFilter : public avtDataTreeIterator
double factor;
std::string variable;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual avtDataRepresentation *ExecuteData(avtDataRepresentation *);
virtual void PreExecute(void);
virtual void PostExecute(void);
......
......@@ -228,11 +228,9 @@ avtFacelistFilter::SetCreateEdgeListFor2DDatasets(bool val)
// structured meshes.
//
// Arguments:
// in_ds The input dataset.
// domain The domain number for in_ds.
// label The label.
// in_dr The input data representation.
//
// Returns: The output dataset.
// Returns: The output data tree.
//
// Programmer: Hank Childs
// Creation: February 26, 2002
......@@ -275,12 +273,19 @@ avtFacelistFilter::SetCreateEdgeListFor2DDatasets(bool val)
// Hank Childs, Fri Feb 4 13:46:18 PST 2011
// Split most of routine into the static function "FindFaces".
//
// Eric Brugger, Mon Jul 21 11:28:02 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
avtDataTree_p
avtFacelistFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain,
std::string label)
avtFacelistFilter::ExecuteDataTree(avtDataRepresentation *in_dr)
{
//
// Get the domain.
//
int domain = in_dr->GetDomain();
avtFacelist *fl = NULL;
avtDataValidity &v = GetInput()->GetInfo().GetValidity();
if (v.GetUsingAllData() && v.GetZonesPreserved())
......@@ -289,7 +294,7 @@ avtFacelistFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain,
fl = md->GetExternalFacelist(domain);
}
return FindFaces(in_ds, domain, label, GetInput()->GetInfo(),
return FindFaces(in_dr, GetInput()->GetInfo(),
create3DCellNumbers, forceFaceConsolidation,
createEdgeListFor2DDatasets, mustCreatePolyData, fl);
}
......@@ -299,7 +304,7 @@ avtFacelistFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain,
// Method: avtFacelistFilter::FindFaces
//
// Purpose:
// Finds the faces for a single domain. A static function that can be
// Finds the faces for a single domain. A public function that can be
// called outside of a pipeline.
//
// Notes: Most of this routine used to be located in ExecuteDataTree.
......@@ -307,15 +312,26 @@ avtFacelistFilter::ExecuteDataTree(vtkDataSet *in_ds, int domain,
// Programmer: Hank Childs
// Creation: February 4, 2010
//
// Modifications:
// Eric Brugger, Mon Jul 21 11:28:02 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
avtDataTree_p
avtFacelistFilter::FindFaces(vtkDataSet *in_ds, int domain, std::string label,
avtFacelistFilter::FindFaces(avtDataRepresentation *in_dr,
avtDataObjectInformation &info,
bool create3DCellNumbers, bool forceFaceConsolidation,
bool createEdgeListFor2DDatasets,
bool mustCreatePolyData, avtFacelist *fl)
{
//
// 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 tDim = info.GetAttributes().GetTopologicalDimension();
//int sDim = info.GetAttributes().GetSpatialDimension();
//int dis_elem = info.GetValidity().GetDisjointElements();
......
......@@ -47,7 +47,6 @@
#include <avtSIMODataTreeIterator.h>
class vtkRectilinearGridFacelistFilter;
class vtkStructuredGridFacelistFilter;
class vtkUnstructuredGridFacelistFilter;
......@@ -124,6 +123,9 @@ class avtMultiFacelist;
// David Camp, Tue May 21 13:56:12 PDT 2013
// Removed the static method for the threading code.
//
// Eric Brugger, Mon Jul 21 11:27:19 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class AVTFILTERS_API avtFacelistFilter : public avtSIMODataTreeIterator
......@@ -144,8 +146,7 @@ class AVTFILTERS_API avtFacelistFilter : public avtSIMODataTreeIterator
void SetMustCreatePolyData(bool val)
{ mustCreatePolyData = val; };
avtDataTree_p FindFaces(vtkDataSet *, int,
std::string,
avtDataTree_p FindFaces(avtDataRepresentation *,
avtDataObjectInformation &,
bool = false, bool = false,
bool = false, bool = false,
......@@ -157,8 +158,7 @@ class AVTFILTERS_API avtFacelistFilter : public avtSIMODataTreeIterator
bool mustCreatePolyData;
int forceFaceConsolidation;
virtual avtDataTree_p ExecuteDataTree(vtkDataSet *, int,
std::string);
virtual avtDataTree_p ExecuteDataTree(avtDataRepresentation *);
vtkDataSet *Take2DFaces(vtkDataSet *, bool, bool);
vtkDataSet *FindEdges(vtkDataSet *);
avtDataTree_p Take3DFaces(vtkDataSet *, int,
......
......@@ -104,11 +104,9 @@ avtFeatureEdgesFilter::~avtFeatureEdgesFilter()
// Sends the specified input and output through the FeatureEdges filter.
//
// Arguments:
// in_ds The input dataset.
// <unused> The domain number.
// <unused> The label.
// inDR The input data representation.
//
// Returns: The output unstructured grid.
// Returns: The output data representation.
//
// Programmer: Jeremy Meredith
// Creation: March 12, 2001
......@@ -140,11 +138,19 @@ avtFeatureEdgesFilter::~avtFeatureEdgesFilter()
// Kathleen Biagas, Mon Jan 28 10:52:35 PST 2013
// Call Update on filter not data object.
//
// Eric Brugger, Mon Jul 21 11:41:48 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataSet *
avtFeatureEdgesFilter::ExecuteData(vtkDataSet *inDS, int, string)
avtDataRepresentation *
avtFeatureEdgesFilter::ExecuteData(avtDataRepresentation *inDR)
{
//
// Get the VTK data set.
//
vtkDataSet *inDS = inDR->GetDataVTK();
if (inDS->GetDataObjectType() != VTK_POLY_DATA)
{
// We only work on surface data
......@@ -154,7 +160,7 @@ avtFeatureEdgesFilter::ExecuteData(vtkDataSet *inDS, int, string)
if (GetInput()->GetInfo().GetAttributes().GetTopologicalDimension() == 1)
{
return inDS;
return inDR;
}
vtkDataSet *outDS = NULL;
......@@ -218,8 +224,6 @@ avtFeatureEdgesFilter::ExecuteData(vtkDataSet *inDS, int, string)
output->SetLines(lines);
lines->Delete();
ManageMemory(output);
output->Delete();
outDS = output;
}
else
......@@ -249,12 +253,18 @@ avtFeatureEdgesFilter::ExecuteData(vtkDataSet *inDS, int, string)
if (output->GetNumberOfCells() > 0)
{
outDS = output;
outDS->Register(NULL);
}
ManageMemory(outDS);
featureEdgesFilter->Delete();
}
return outDS;
avtDataRepresentation *outDR = new avtDataRepresentation(outDS,
inDR->GetDomain(), inDR->GetLabel());
if (outDS != NULL)
outDS->Delete();
return outDR;
}
......
......@@ -52,7 +52,7 @@
// Class: avtFeatureEdgesFilter
//
// Purpose:
// Extracts feature edges of a dataset.
// Extracts feature edges of a data representation.
//
// Programmer: Jeremy Meredith
// Creation: March 12, 2002
......@@ -67,6 +67,9 @@
// Moved inlined constructor and destructor definitions to .C files
// because certain compilers have problems with them.
//
// Eric Brugger, Mon Jul 21 11:41:16 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class AVTFILTERS_API avtFeatureEdgesFilter : public avtDataTreeIterator
......@@ -80,7 +83,7 @@ class AVTFILTERS_API avtFeatureEdgesFilter : public avtDataTreeIterator
{ return "Extracting feature edges"; };
protected:
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