Commit c4ce1f08 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@23896 18c085ea-50e0-402c-830e-de6fd14e8384
parent a1c9da78
......@@ -134,20 +134,27 @@ avtEdgeFilter::Equivalent(const AttributeGroup *a)
// Sends the specified input and output through the Edge filter.
//
// Arguments:
// in_ds The input dataset.
// <unused> The domain number.
// <unused> The label.
// inDR The input data representation.
//
// Returns: The output dataset.
// Returns: The output data representation.
//
// Programmer: Jeremy Meredith
// Creation: February 23, 2009
//
// Modifications:
// Eric Brugger, Thu Jul 24 09:29:05 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataSet *
avtEdgeFilter::ExecuteData(vtkDataSet *inDS, int, std::string)
avtDataRepresentation *
avtEdgeFilter::ExecuteData(avtDataRepresentation *inDR)
{
//
// Get the VTK data set.
//
vtkDataSet *inDS = inDR->GetDataVTK();
vtkGeometryFilter *geom = NULL;
vtkExtractEdges *ee = vtkExtractEdges::New();
if (inDS->GetDataObjectType() != VTK_POLY_DATA)
......@@ -163,13 +170,15 @@ avtEdgeFilter::ExecuteData(vtkDataSet *inDS, int, std::string)
ee->Update();
vtkPolyData *outDS = ee->GetOutput();
ManageMemory(outDS);
avtDataRepresentation *outDR = new avtDataRepresentation(outDS,
inDR->GetDomain(), inDR->GetLabel());
ee->Delete();
if (geom)
geom->Delete();
return outDS;
return outDR;
}
......
......@@ -43,12 +43,9 @@
#ifndef AVT_Edge_FILTER_H
#define AVT_Edge_FILTER_H
#include <avtPluginDataTreeIterator.h>
#include <EdgeAttributes.h>
class vtkDataSet;
#include <EdgeAttributes.h>
// ****************************************************************************
......@@ -62,6 +59,10 @@ class vtkDataSet;
// Programmer: Jeremy Meredith
// Creation: February 23, 2009
//
// Modifications:
// Eric Brugger, Thu Jul 24 09:28:40 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class avtEdgeFilter : public avtPluginDataTreeIterator
......@@ -82,7 +83,7 @@ class avtEdgeFilter : public avtPluginDataTreeIterator
protected:
EdgeAttributes atts;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual avtDataRepresentation *ExecuteData(avtDataRepresentation *);
void UpdateDataObjectInfo();
};
......
......@@ -135,20 +135,27 @@ avtEllipsoidSliceFilter::Equivalent(const AttributeGroup *a)
// Sends the specified input and output through the EllipsoidSlice 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: pugmire -- generated by xml2avt
// Creation: Tue Jun 3 09:44:03 PDT 2014
//
// Modifications:
// Eric Brugger, Thu Jul 24 13:23:21 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataSet *
avtEllipsoidSliceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
avtDataRepresentation *
avtEllipsoidSliceFilter::ExecuteData(avtDataRepresentation *in_dr)
{
//
// Get the VTK data set.
//
vtkDataSet *in_ds = in_dr->GetDataVTK();
vtkQuadric *quadric = vtkQuadric::New();
double coeffs[10];
......@@ -189,12 +196,13 @@ avtEllipsoidSliceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
out_ds = NULL;
}
ManageMemory(out_ds);
avtDataRepresentation *out_dr = new avtDataRepresentation(out_ds,
in_dr->GetDomain(), in_dr->GetLabel());
quadric->Delete();
cutter->Delete();
return out_ds;
return out_dr;
}
......@@ -43,12 +43,9 @@
#ifndef AVT_EllipsoidSlice_FILTER_H
#define AVT_EllipsoidSlice_FILTER_H
#include <avtPluginDataTreeIterator.h>
#include <EllipsoidSliceAttributes.h>
class vtkDataSet;
#include <EllipsoidSliceAttributes.h>
// ****************************************************************************
......@@ -60,6 +57,10 @@ class vtkDataSet;
// Programmer: pugmire -- generated by xml2avt
// Creation: Tue Jun 3 09:44:03 PDT 2014
//
// Modifications:
// Eric Brugger, Thu Jul 24 13:22:53 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class avtEllipsoidSliceFilter : public avtPluginDataTreeIterator
......@@ -78,9 +79,9 @@ class avtEllipsoidSliceFilter : public avtPluginDataTreeIterator
virtual bool Equivalent(const AttributeGroup*);
protected:
EllipsoidSliceAttributes atts;
EllipsoidSliceAttributes atts;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual avtDataRepresentation *ExecuteData(avtDataRepresentation *);
};
......
......@@ -164,11 +164,9 @@ avtExtractPointFunction2DFilter::PreExecute(void)
// Sends the specified input and output through the ExtractPointFunction2D 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: ghweber -- generated by xml2avt
// Creation: Tue Jun 4 10:46:56 PDT 2013
......@@ -178,11 +176,19 @@ avtExtractPointFunction2DFilter::PreExecute(void)
// Moved avtRealDims code into FIXME comment, to suppress warnings until
// such a time as they are used.
//
// Eric Brugger, Thu Jul 24 13:27:16 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataSet *
avtExtractPointFunction2DFilter::ExecuteData(vtkDataSet *in_ds, int domain, std::string)
avtDataRepresentation *
avtExtractPointFunction2DFilter::ExecuteData(avtDataRepresentation *in_dr)
{
//
// Get the VTK data set.
//
vtkDataSet *in_ds = in_dr->GetDataVTK();
// Ensure that we are working on rectilinear grid
vtkRectilinearGrid *rgrid = dynamic_cast<vtkRectilinearGrid*>(in_ds);
if (!rgrid)
......@@ -265,7 +271,13 @@ avtExtractPointFunction2DFilter::ExecuteData(vtkDataSet *in_ds, int domain, std:
}
ogrid->GetCellData()->SetScalars(odata);
odata->Delete();
return ogrid;
avtDataRepresentation *out_dr = new avtDataRepresentation(ogrid,
in_dr->GetDomain(), in_dr->GetLabel());
ogrid->Delete();
return out_dr;
}
else
return 0;
......
......@@ -43,12 +43,9 @@
#ifndef AVT_ExtractPointFunction2D_FILTER_H
#define AVT_ExtractPointFunction2D_FILTER_H
#include <avtPluginDataTreeIterator.h>
#include <ExtractPointFunction2DAttributes.h>
class vtkDataSet;
#include <ExtractPointFunction2DAttributes.h>
// ****************************************************************************
......@@ -60,6 +57,10 @@ class vtkDataSet;
// Programmer: ghweber -- generated by xml2avt
// Creation: Tue Jun 4 10:46:56 PDT 2013
//
// Modifications:
// Eric Brugger, Thu Jul 24 13:26:47 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class avtExtractPointFunction2DFilter : public avtPluginDataTreeIterator
......@@ -84,7 +85,7 @@ class avtExtractPointFunction2DFilter : public avtPluginDataTreeIterator
std::string outVarName;
virtual void PreExecute(void);
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual avtDataRepresentation *ExecuteData(avtDataRepresentation *);
virtual void PostExecute(void);
private:
......
......@@ -172,20 +172,27 @@ avtExtrudeFilter::Equivalent(const AttributeGroup *a)
// Sends the specified input and output through the Extrude 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: Brad Whitlock
// Creation: Wed Jun 22 13:48:57 PST 2011
//
// Modifications:
// Eric Brugger, Thu Jul 24 13:32:08 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataSet *
avtExtrudeFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
avtDataRepresentation *
avtExtrudeFilter::ExecuteData(avtDataRepresentation *in_dr)
{
//
// Get the VTK data set.
//
vtkDataSet *in_ds = in_dr->GetDataVTK();
vtkDataSet *out_ds = NULL;
if(in_ds->GetDataObjectType() == VTK_RECTILINEAR_GRID)
......@@ -208,7 +215,13 @@ avtExtrudeFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
out_ds->GetCellData()->RemoveArray("avtOriginalCellNumbers");
}
return out_ds;
avtDataRepresentation *out_dr = new avtDataRepresentation(out_ds,
in_dr->GetDomain(), in_dr->GetLabel());
if (out_ds != NULL)
out_ds->Delete();
return out_dr;
}
// ****************************************************************************
......
......@@ -43,14 +43,15 @@
#ifndef AVT_EXTRUDE_FILTER_H
#define AVT_EXTRUDE_FILTER_H
#include <avtPluginDataTreeIterator.h>
#include <ExtrudeAttributes.h>
class vtkDataSet;
class vtkPoints;
class vtkPointSet;
// ****************************************************************************
// Class: avtExtrudeFilter
//
......@@ -61,6 +62,8 @@ class vtkPointSet;
// Creation: Wed Jun 22 13:48:57 PST 2011
//
// Modifications:
// Eric Brugger, Thu Jul 24 13:31:45 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
......@@ -80,20 +83,20 @@ class avtExtrudeFilter : public avtPluginDataTreeIterator
virtual bool Equivalent(const AttributeGroup*);
protected:
ExtrudeAttributes atts;
ExtrudeAttributes atts;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual avtDataRepresentation *ExecuteData(avtDataRepresentation *);
virtual void UpdateDataObjectInfo(void);
virtual void UpdateDataObjectInfo(void);
void CopyVariables(vtkDataSet *in_ds, vtkDataSet *out_ds,
int nSteps, const int *cellReplication = NULL) const;
vtkPoints *CreateExtrudedPoints(vtkPoints *oldPoints,
int nSteps) const;
void ExtrudeExtents(double *dbounds) const;
vtkDataSet *ExtrudeToRectilinearGrid(vtkDataSet *in_ds) const;
vtkDataSet *ExtrudeToStructuredGrid(vtkDataSet *in_ds) const;
vtkDataSet *ExtrudeToUnStructuredGrid(vtkPointSet *in_ds) const;
void CopyVariables(vtkDataSet *in_ds, vtkDataSet *out_ds,
int nSteps, const int *cellReplication = NULL) const;
vtkPoints *CreateExtrudedPoints(vtkPoints *oldPoints,
int nSteps) const;
void ExtrudeExtents(double *dbounds) const;
vtkDataSet *ExtrudeToRectilinearGrid(vtkDataSet *in_ds) const;
vtkDataSet *ExtrudeToStructuredGrid(vtkDataSet *in_ds) const;
vtkDataSet *ExtrudeToUnStructuredGrid(vtkPointSet *in_ds) const;
};
......
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