Updates will be applied - 3:30pm EDT (UTC -400). No downtime expected.

Commit 4870b29f authored by brugger's avatar brugger

I started to convert the filters to use avtDataRepresentations instead

of vtkDataSets.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23809 18c085ea-50e0-402c-830e-de6fd14e8384
parent 68494b55
......@@ -102,10 +102,9 @@ avtCondenseDatasetFilter::~avtCondenseDatasetFilter()
// Sends the specified input and output through the CondenseDataset filter.
//
// Arguments:
// in_ds The input dataset.
// <unused> The domain number.
// in_dr The input data representation.
//
// Returns: The output dataset.
// Returns: The output data representation.
//
// Programmer: Kathleen Bonnell
// Creation: November 07, 2000
......@@ -155,14 +154,21 @@ avtCondenseDatasetFilter::~avtCondenseDatasetFilter()
// Burlen Loring, Mon Apr 14 15:56:19 PDT 2014
// Don't take two references to the output
//
// Eric Brugger, Fri Jul 18 16:07:04 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
vtkDataSet *
avtCondenseDatasetFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
avtDataRepresentation *
avtCondenseDatasetFilter::ExecuteData(avtDataRepresentation *in_dr)
{
int i;
//
// Get the VTK data set.
//
vtkDataSet *in_ds = in_dr->GetDataVTK();
// Remove any variable that has "VTK" or "AVT" in its name. Make a for
// loop with two iterations. Iteration #1 is to determine if we have
// to strip out arrays. Iteration #2 is to strip out the arrays. The
......@@ -348,8 +354,8 @@ avtCondenseDatasetFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
out_ds = no_vars;
}
if (out_ds != in_ds)
ManageMemory(out_ds);
avtDataRepresentation *out_dr = new avtDataRepresentation(out_ds,
in_dr->GetDomain(), in_dr->GetLabel());
if (needToDeleteOutDs)
out_ds->Delete();
......@@ -357,7 +363,7 @@ avtCondenseDatasetFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
if (needToDeleteNoVars)
no_vars->Delete();
return out_ds;
return out_dr;
}
......
......@@ -48,11 +48,6 @@
#include <avtDataTreeIterator.h>
class vtkPolyDataRelevantPointsFilter;
class vtkUnstructuredGridRelevantPointsFilter;
class vtkDataSet;
// ****************************************************************************
// Class: avtCondenseDatasetFilter
//
......@@ -85,6 +80,9 @@ class vtkDataSet;
// Jeremy Meredith, Thu Feb 15 11:44:28 EST 2007
// Added support for rectilinear grids with an inherent transform.
//
// Eric Brugger, Fri Jul 18 16:04:48 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class AVTFILTERS_API avtCondenseDatasetFilter : public avtDataTreeIterator
......@@ -102,7 +100,7 @@ class AVTFILTERS_API avtCondenseDatasetFilter : public avtDataTreeIterator
void BypassHeuristic(bool val) {bypassHeuristic = val; };
protected:
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual avtDataRepresentation *ExecuteData(avtDataRepresentation *);
virtual bool FilterUnderstandsTransformedRectMesh();
private:
......
......@@ -37,14 +37,16 @@
*****************************************************************************/
// ************************************************************************* //
// avtDataTreeIterator.C //
// avtDataTreeIterator.C //
// ************************************************************************* //
#include <vtkDataSet.h>
#include <avtDataRepresentation.h>
#include <avtDataTree.h>
#include <avtDataTreeIterator.h>
#include <ImproperUseException.h>
// ****************************************************************************
// Method: avtDataTreeIterator constructor
......@@ -143,6 +145,76 @@ avtDataTreeIterator::ReleaseData(void)
}
// ****************************************************************************
// Method: avtDataTreeIterator::ExecuteDataTree
//
// Purpose:
// Defines the pure virtual function executedomaintree.
// Serves as a wrapper for the ExecuteDomain method.
//
// Arguments:
// in_dr The data representation to pass to the derived type.
//
// Programmer: Kathleen Bonnell
// Creation: February 9, 2001
//
// Modifications:
//
// Kathleen Bonnell, Tue Apr 10 10:49:10 PDT 2001
// Made this method return avtDataTree.
//
// Kathleen Bonnell, Wed Sep 19 13:35:35 PDT 2001
// Added string argument so that labels will get passed on.
//
// Hank Childs, Fri Oct 19 10:56:55 PDT 2001
// Allow for derived types to return NULL.
//
// Hank Childs, Wed Sep 11 09:17:46 PDT 2002
// Pass the label down to the derived types as well.
//
// Hank Childs, Mon Jun 27 10:02:55 PDT 2005
// Choose better file names when doing a "-dump" in parallel.
//
// Hank Childs, Tue Jul 5 09:41:28 PDT 2005
// Fix cut-n-paste bug with last change.
//
// Hank Childs, Wed Aug 31 09:10:11 PDT 2005
// Make sure that -dump in parallel increments the dump index.
//
// Hank Childs, Thu Dec 21 15:38:53 PST 2006
// Removed -dump functionality, since it is now handled at a lower level.
//
// Eric Brugger, Fri Jul 18 14:45:40 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
avtDataTree_p
avtDataTreeIterator::ExecuteDataTree(avtDataRepresentation *in_dr)
{
avtDataRepresentation *out_dr = ExecuteData(in_dr);
if (out_dr == (avtDataRepresentation *)-1)
{
vtkDataSet *out_ds = ExecuteData(in_dr->GetDataVTK(),
in_dr->GetDomain(),
in_dr->GetLabel());
if (out_ds == NULL)
{
return NULL;
}
return new avtDataTree(out_ds, in_dr->GetDomain(), in_dr->GetLabel());
}
if (out_dr == NULL)
{
return NULL;
}
return new avtDataTree(1, out_dr);
}
// ****************************************************************************
// Method: avtDataTreeIterator::ExecuteDataTree
//
......@@ -197,3 +269,56 @@ avtDataTreeIterator::ExecuteDataTree(vtkDataSet* ds, int dom, std::string label)
return new avtDataTree(out_ds, dom, label);
}
// ****************************************************************************
// Method: avtDataTreeIterator::ExecuteData
//
// Purpose:
// This defines a default ExecuteData method in case a filter has not
// been converted to use avtDataRepresentation. This method should be
// made pure virtual when all the filters have been converted.
//
// Arguments:
// in_dr Not used.
//
// Programmer: Eric Brugger
// Creation: Fri Jul 18 14:45:40 PDT 2014
//
// Modifications:
//
// ****************************************************************************
avtDataRepresentation *
avtDataTreeIterator::ExecuteData(avtDataRepresentation*)
{
return (avtDataRepresentation*) -1;
}
// ****************************************************************************
// Method: avtDataTreeIterator::ExecuteData
//
// Purpose:
// This defines a default ExecuteData method for filters that have been
// converted to use avtDataRepresentation. This method should never be
// called. This method should be removed when all the filters have been
// converted.
//
// Arguments:
// ds Not used.
// dom Not used.
// label Not used.
//
// Programmer: Eric Brugger
// Creation: Fri Jul 18 14:45:40 PDT 2014
//
// Modifications:
//
// ****************************************************************************
vtkDataSet *
avtDataTreeIterator::ExecuteData(vtkDataSet*, int, std::string)
{
EXCEPTION0(ImproperUseException);
}
......@@ -91,6 +91,9 @@
// Hank Childs, Thu Dec 21 09:17:43 PST 2006
// Remove support for debug dumps.
//
// Eric Brugger, Fri Jul 18 14:00:24 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class PIPELINE_API avtDataTreeIterator : virtual public avtSIMODataTreeIterator
......@@ -104,8 +107,10 @@ class PIPELINE_API avtDataTreeIterator : virtual public avtSIMODataTreeIterator
protected:
vtkDataSet *lastDataset;
virtual avtDataTree_p ExecuteDataTree(avtDataRepresentation *);
virtual avtDataRepresentation *ExecuteData(avtDataRepresentation *);
virtual avtDataTree_p ExecuteDataTree(vtkDataSet *, int, std::string);
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string) = 0;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
void ManageMemory(vtkDataSet *);
};
......
......@@ -37,22 +37,21 @@
*****************************************************************************/
// ************************************************************************* //
// avtSIMODataTreeIterator.C //
// avtSIMODataTreeIterator.C //
// ************************************************************************* //
#include <avtSIMODataTreeIterator.h>
#include <vtkDataSet.h>
#include <avtCommonDataFunctions.h>
#include <avtDataRepresentation.h>
#include <avtDataTree.h>
#include <avtExecutionManager.h>
#include <avtExtents.h>
#include <IncompatibleDomainListsException.h>
#include <ImproperUseException.h>
#include <DebugStream.h>
#include <string>
#include "avtExecutionManager.h"
// ****************************************************************************
......@@ -184,6 +183,52 @@ avtSIMODataTreeIterator::Execute(void)
SetOutputDataTree(newTree);
}
// ****************************************************************************
// Method: avtSIMODataTreeIterator::ExecuteDataTree
//
// Purpose:
// This is a default ExecuteDataTree method for filters that have not
// been converted to use an avtDataRepresentation. Once all the filters
// have been converted to work with avtDataRepresentations this method
// can be removed.
//
// Programmer: Eric Brugger
// Creation: Fri Jul 18 13:45:44 PDT 2014
//
// Modifications:
//
// ****************************************************************************
avtDataTree_p
avtSIMODataTreeIterator::ExecuteDataTree(avtDataRepresentation *dr)
{
return ExecuteDataTree(dr->GetDataVTK(), dr->GetDomain(), dr->GetLabel());
}
// ****************************************************************************
// Method: avtSIMODataTreeIterator::ExecuteDataTree
//
// Purpose:
// This function is used to call the execute data tree method on the
// data leaves. This method should be implemented in the filters that
// derive from it and it is an error to call it.
//
// Programmer: Eric Brugger
// Creation: Fri Jul 18 13:45:44 PDT 2014
//
// Modifications:
//
// ****************************************************************************
avtDataTree_p
avtSIMODataTreeIterator::ExecuteDataTree(vtkDataSet *, int, std::string)
{
EXCEPTION0(ImproperUseException);
}
// ****************************************************************************
// Method: avtSIMODataTreeIterator::ExecuteDataTreeOnThread
//
......@@ -199,6 +244,9 @@ avtSIMODataTreeIterator::Execute(void)
// Kevin Bensema, Thu 1 August 12:39 PDT 2013
// Fixed memory leak by deleting SIMOWorkItem pointer passed in.
//
// Eric Brugger, Fri Jul 18 13:45:44 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
typedef struct StructSIMOWorkItem
......@@ -213,15 +261,11 @@ avtSIMODataTreeIterator::ExecuteDataTreeOnThread(void *cbdata)
{
SIMOWorkItem *work = (SIMOWorkItem *)cbdata;
vtkDataSet *in_ds = work->inDT->GetDataRepresentation().GetDataVTK();
int dom = work->inDT->GetDataRepresentation().GetDomain();
std::string label = work->inDT->GetDataRepresentation().GetLabel();
//
// We own the returned dataset because you cannot delete it if
// it only has one reference and you want to return it.
//
avtDataTree_p retDT = work->This->ExecuteDataTree(in_ds, dom, label);
avtDataTree_p retDT = work->This->ExecuteDataTree(&(work->inDT->GetDataRepresentation()));
if( *(retDT) )
work->outDT->operator=( *(retDT) );
......
......@@ -56,9 +56,10 @@ class avtExtents;
//
// Purpose:
// A derived type of avtDatasetToDatasetFilter. This will iterate over
// each vtkDataSet from an input avtDataTree. This particular flavor
// is "SIMO": Single Input Multiple Output, meaning that the output for
// a single vtkDataSet can and likely will be multiple vtkDataSet outputs.
// each avtDataRepresentation from an input avtDataTree. This particular
// flavor is "SIMO": Single Input Multiple Output, meaning that the
// output for a single avtDataRepresentation can and likely will be
// multiple avtDataRepresentation outputs.
//
// Programmer: Hank Childs
// Creation: July 24, 2000
......@@ -92,6 +93,9 @@ class avtExtents;
// Hank Childs, Mon Dec 27 10:58:14 PST 2004
// Made inheritance virtual.
//
// Eric Brugger, Fri Jul 18 13:24:47 PDT 2014
// Modified the class to work with avtDataRepresentation.
//
// ****************************************************************************
class PIPELINE_API avtSIMODataTreeIterator : virtual public
......@@ -107,7 +111,8 @@ class PIPELINE_API avtSIMODataTreeIterator : virtual public
virtual void Execute(void);
virtual void Execute(avtDataTree_p inDT, avtDataTree_p &outDT);
virtual avtDataTree_p ExecuteDataTree(vtkDataSet *,int,std::string) = 0;
virtual avtDataTree_p ExecuteDataTree(avtDataRepresentation *);
virtual avtDataTree_p ExecuteDataTree(vtkDataSet *,int,std::string);
virtual bool ThreadSafe(void) { return(true); };
void FinishExecute(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