Commit 1e2ffdea authored by hrchilds's avatar hrchilds
Browse files

Add TraceHistory operator and ExtrudedVol database.

Move DisplaceFilter to /components/Filters
Minor fixes to xml2avt and co_trunk/co_branch code.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@1047 18c085ea-50e0-402c-830e-de6fd14e8384
parent 62c9fb32
......@@ -104,6 +104,9 @@
# Thomas R. Treadway, Tue Mar 27 12:18:12 PDT 2007
# Added Mesa libraries.
#
# Hank Childs, Fri May 18 16:01:06 PDT 2007
# Added avtDisplaceFilter.
#
##############################################################################
##
......@@ -124,6 +127,7 @@ SRC=\
avtCurrentExtentFilter.C \
avtCurveConstructorFilter.C \
avtCustomTransform.C \
avtDisplaceFilter.C \
avtFacelistFilter.C \
avtFeatureEdgesFilter.C \
avtGhostZoneAndFacelistFilter.C \
......
......@@ -68,11 +68,16 @@
// Hank Childs, Tue Jun 29 07:59:53 PDT 2004
// Removed initialization of issuedWarning; data member has been removed.
//
// Hank Childs, Fri May 18 16:01:06 PDT 2007
// Initialize factor, variable.
//
// ****************************************************************************
avtDisplaceFilter::avtDisplaceFilter()
{
OverrideTrueSpatialExtents();
factor = 1.;
variable = "default";
}
......@@ -92,69 +97,27 @@ avtDisplaceFilter::~avtDisplaceFilter()
// ****************************************************************************
// Method: avtDisplaceFilter::Create
//
// Programmer: childs -- generated by xml2info
// Creation: Mon Nov 5 15:35:46 PST 2001
//
// ****************************************************************************
avtFilter *
avtDisplaceFilter::Create()
{
return new avtDisplaceFilter();
}
// ****************************************************************************
// Method: avtDisplaceFilter::SetAtts
// Method: avtDisplaceFilter::SetVariable
//
// Purpose:
// Sets the state of the filter based on the attribute object.
//
// Arguments:
// a The attributes to use.
//
// Programmer: childs -- generated by xml2info
// Creation: Mon Nov 5 15:35:46 PST 2001
// Sets the variable to displace by.
//
// Modifications:
//
// Hank Childs, Thu Oct 6 16:46:54 PDT 2005
// Add support for default. ['6654]
// Programmer: Hank Childs
// Creation: May 18, 2007
//
// ****************************************************************************
void
avtDisplaceFilter::SetAtts(const AttributeGroup *a)
avtDisplaceFilter::SetVariable(const std::string &v)
{
atts = *(const DisplaceAttributes*)a;
if (strcmp(atts.GetVariable().c_str(), "default") != 0)
variable = v;
if (strcmp(v.c_str(), "default") != 0)
{
SetActiveVariable(atts.GetVariable().c_str());
SetActiveVariable(v.c_str());
}
}
// ****************************************************************************
// Method: avtDisplaceFilter::Equivalent
//
// Purpose:
// Returns true if creating a new avtDisplaceFilter with the given
// parameters would result in an equivalent avtDisplaceFilter.
//
// Programmer: childs -- generated by xml2info
// Creation: Mon Nov 5 15:35:46 PST 2001
//
// ****************************************************************************
bool
avtDisplaceFilter::Equivalent(const AttributeGroup *a)
{
return (atts == *(DisplaceAttributes*)a);
}
// ****************************************************************************
// Method: avtDisplaceFilter::ExecuteData
//
......@@ -197,7 +160,7 @@ avtDisplaceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
{
vtkDataSet *tmp_ds = NULL;
const char *displace_var = atts.GetVariable().c_str();
const char *displace_var = variable.c_str();
if (strcmp(displace_var, "default") == 0)
displace_var = pipelineVariable;
......@@ -243,7 +206,7 @@ avtDisplaceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
{
vtkWarpVector *warp = vtkWarpVector::New();
warp->SetInput((vtkPointSet *)in_ds);
warp->SetScaleFactor(atts.GetFactor());
warp->SetScaleFactor(factor);
rv = warp->GetOutput();
rv->Update();
......@@ -266,7 +229,6 @@ avtDisplaceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
vtkPoints *pts = vtkPoints::New();
int npts = dims[0]*dims[1]*dims[2];
pts->SetNumberOfPoints(npts);
float factor = atts.GetFactor();
for (int i = 0 ; i < npts ; i++)
{
int xi = i % dims[0];
......@@ -318,14 +280,20 @@ avtDisplaceFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
// Programmer: Hank Childs
// Creation: September 5, 2006
//
// Modifications:
//
// Hank Childs, Fri May 18 16:19:20 PDT 2007
// Call avtStreamer's PostExecute, not avtPluginStreamer, since the
// inheritance changed.
//
// ****************************************************************************
void
avtDisplaceFilter::PreExecute(void)
{
avtPluginStreamer::PreExecute();
avtStreamer::PreExecute();
const char *displace_var = atts.GetVariable().c_str();
const char *displace_var = variable.c_str();
if (strcmp(displace_var, "default") == 0)
displace_var = pipelineVariable;
......@@ -359,12 +327,18 @@ avtDisplaceFilter::PreExecute(void)
// Programmer: Hank Childs
// Creation: May 24, 2004
//
// Modifications:
//
// Hank Childs, Fri May 18 16:19:20 PDT 2007
// Call avtStreamer's PostExecute, not avtPluginStreamer, since the
// inheritance changed.
//
// ****************************************************************************
void
avtDisplaceFilter::PostExecute(void)
{
avtPluginStreamer::PostExecute();
avtStreamer::PostExecute();
avtDataAttributes& outAtts = GetOutput()->GetInfo().GetAttributes();
......
......@@ -43,9 +43,7 @@
#define AVT_Displace_FILTER_H
#include <avtPluginStreamer.h>
#include <DisplaceAttributes.h>
#include <avtStreamer.h>
class vtkDataSet;
......@@ -72,25 +70,28 @@ class vtkDataSet;
// Hank Childs, Tue Sep 5 16:07:45 PDT 2006
// Added PreExecute method, so we could check validity of "default".
//
// Hank Childs, Fri May 18 15:59:03 PDT 2007
// Changed the inheritance, since this is no longer a plugin filter.
// (This filter was moved from /operators/Displace.)
//
// ****************************************************************************
class avtDisplaceFilter : public avtPluginStreamer
class avtDisplaceFilter : public avtStreamer
{
public:
avtDisplaceFilter();
virtual ~avtDisplaceFilter();
static avtFilter *Create();
virtual const char *GetType(void) { return "avtDisplaceFilter"; };
virtual const char *GetDescription(void)
{ return "Displacing by a vector"; };
virtual void SetAtts(const AttributeGroup*);
virtual bool Equivalent(const AttributeGroup*);
void SetFactor(double f) { factor = f; };
void SetVariable(const std::string &v);
protected:
DisplaceAttributes atts;
double factor;
std::string variable;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
virtual void PreExecute(void);
......
......@@ -116,7 +116,7 @@ avtDataset::avtDataset(vtkDataSet *ds, avtDataset *obj)
// Method: avtDataset copy constructor
//
// Programmer: Mark C. Miller
// Creation: 23Apr03
// Creation: April 23, 2003
//
// ****************************************************************************
......@@ -128,6 +128,22 @@ avtDataset::avtDataset(avtDataset_p in, bool dontCopyData)
}
// ****************************************************************************
// Method: avtDataset copy constructor
//
// Programmer: Hank Childs
// Creation: May 18, 2007
//
// ****************************************************************************
avtDataset::avtDataset(avtDataset_p in, avtDataTree_p newTree)
: avtDataObject(in->source)
{
info.Copy(in->GetInfo());
dataTree = newTree;
}
// ****************************************************************************
// Method: avtDataset destructor
//
......
......@@ -105,6 +105,9 @@ class avtWebpage;
// Hank Childs, Thu Dec 21 09:58:57 PST 2006
// Added method for debug dumps.
//
// Hank Childs, Fri May 18 16:51:07 PDT 2007
// Add a constructor for creating a new data set with a specific data tree.
//
// ****************************************************************************
class PIPELINE_API avtDataset : public avtDataObject
......@@ -122,6 +125,8 @@ class PIPELINE_API avtDataset : public avtDataObject
avtDataset(avtDataObjectSource *);
avtDataset(ref_ptr<avtDataset> ds,
bool dontCopyData = false);
avtDataset(ref_ptr<avtDataset> ds,
avtDataTree_p);
avtDataset(vtkDataSet *);
avtDataset(vtkDataSet *, avtDataset *);
virtual ~avtDataset();
......
<?xml version="1.0"?>
<Plugin name="ExtrudedVol" type="database" label="ExtrudedVol" version="1.0" enabled="true" mdspecificcode="false" engspecificcode="false" onlyengine="false" noengine="false" dbtype="STMD" haswriter="true" hasoptions="true">
<Extensions>
exvol
</Extensions>
<Attribute name="" purpose="" persistent="true" keyframe="true" exportAPI="" exportInclude="">
</Attribute>
</Plugin>
/*****************************************************************************
*
* Copyright (c) 2000 - 2007, The Regents of the University of California
* Produced at the Lawrence Livermore National Laboratory
* All rights reserved.
*
* This file is part of VisIt. For details, see http://www.llnl.gov/visit/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or materials provided with the distribution.
* - Neither the name of the UC/LLNL nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF
* CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
#include <ExtrudedVolPluginInfo.h>
#include <avtExtrudedVolFileFormat.h>
#include <avtSTMDFileFormatInterface.h>
#include <avtGenericDatabase.h>
#include <avtExtrudedVolOptions.h>
// ****************************************************************************
// Method: ExtrudedVolCommonPluginInfo::GetDatabaseType
//
// Purpose:
// Returns the type of a ExtrudedVol database.
//
// Programmer: childs -- generated by xml2info
// Creation: Fri May 18 17:43:54 PST 2007
//
// ****************************************************************************
DatabaseType
ExtrudedVolCommonPluginInfo::GetDatabaseType()
{
return DB_TYPE_STMD;
}
// ****************************************************************************
// Method: ExtrudedVolCommonPluginInfo::GetDefaultExtensions
//
// Purpose:
// Returns the default extensions for a ExtrudedVol database.
//
// Programmer: childs -- generated by xml2info
// Creation: Fri May 18 17:43:54 PST 2007
//
// ****************************************************************************
std::vector<std::string>
ExtrudedVolCommonPluginInfo::GetDefaultExtensions()
{
std::vector<std::string> defaultExtensions;
defaultExtensions.push_back("exvol");
return defaultExtensions;
}
// ****************************************************************************
// Method: ExtrudedVolCommonPluginInfo::SetupExtrudedVolDatabase
//
// Purpose:
// Sets up a ExtrudedVol database.
//
// Arguments:
// list A list of file names.
// nList The number of timesteps in list.
// nBlocks The number of blocks in the list.
//
// Returns: A ExtrudedVol database from list.
//
// Programmer: childs -- generated by xml2info
// Creation: Fri May 18 17:43:54 PST 2007
//
// ****************************************************************************
avtDatabase *
ExtrudedVolCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtSTMDFileFormat **ffl = new avtSTMDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
{
ffl[i] = new avtExtrudedVolFileFormat(list[i], readOptions);
}
avtSTMDFileFormatInterface *inter
= new avtSTMDFileFormatInterface(ffl, nList);
return new avtGenericDatabase(inter);
}
// ****************************************************************************
// Method: ExtrudedVolCommonPluginInfo::GetReadOptions
//
// Purpose:
// Gets the read options.
//
// Programmer: childs -- generated by xml2info
// Creation: Fri May 18 17:43:54 PST 2007
//
// ****************************************************************************
DBOptionsAttributes *
ExtrudedVolCommonPluginInfo::GetReadOptions() const
{
return GetExtrudedVolReadOptions();
}
// ****************************************************************************
// Method: ExtrudedVolCommonPluginInfo::GetWriteOptions
//
// Purpose:
// Gets the write options.
//
// Programmer: childs -- generated by xml2info
// Creation: Fri May 18 17:43:54 PST 2007
//
// ****************************************************************************
DBOptionsAttributes *
ExtrudedVolCommonPluginInfo::GetWriteOptions() const
{
return GetExtrudedVolWriteOptions();
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2007, The Regents of the University of California
* Produced at the Lawrence Livermore National Laboratory
* All rights reserved.
*
* This file is part of VisIt. For details, see http://www.llnl.gov/visit/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or materials provided with the distribution.
* - Neither the name of the UC/LLNL nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF
* CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
#include <ExtrudedVolPluginInfo.h>
#include <avtExtrudedVolWriter.h>
#if defined(__APPLE__)
#define GetEngineInfo ExtrudedVol_GetEngineInfo
#endif
// ****************************************************************************
// Function: GetEngineInfo
//
// Purpose:
// Return a new EnginePluginInfo for the ExtrudedVol database.
//
// Programmer: childs -- generated by xml2info
// Creation: Fri May 18 17:43:54 PST 2007
//
// ****************************************************************************
extern "C" EngineDatabasePluginInfo* GetEngineInfo()
{
return new ExtrudedVolEnginePluginInfo;
}
// ****************************************************************************
// Method: ExtrudedVolCommonPluginInfo::GetWriter
//
// Purpose:
// Sets up a ExtrudedVol writer.
//
// Returns: A ExtrudedVol writer.
//
// Programmer: childs -- generated by xml2info
// Creation: Fri May 18 17:43:54 PST 2007
//
// ****************************************************************************
avtDatabaseWriter *
ExtrudedVolEnginePluginInfo::GetWriter(void)
{
return new avtExtrudedVolWriter(writeOptions);
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2007, The Regents of the University of California
* Produced at the Lawrence Livermore National Laboratory
* All rights reserved.
*
* This file is part of VisIt. For details, see http://www.llnl.gov/visit/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or materials provided with the distribution.
* - Neither the name of the UC/LLNL nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF
* CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
#include <ExtrudedVolPluginInfo.h>
#if defined(__APPLE__)
#define GetMDServerInfo ExtrudedVol_GetMDServerInfo
#endif
// ****************************************************************************
// Function: GetMDServerInfo
//
// Purpose:
// Return a new MDServerPluginInfo for the ExtrudedVol database.
//
// Programmer: childs -- generated by xml2info
// Creation: Fri May 18 17:43:54 PST 2007
//
// ****************************************************************************
extern "C" MDServerDatabasePluginInfo* GetMDServerInfo()
{
return new ExtrudedVolMDServerPluginInfo;
}
// this makes compilers happy... remove if we ever have functions here
void ExtrudedVolMDServerPluginInfo::dummy()
{
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2007, The Regents of the University of California
* Produced at the Lawrence Livermore National Laboratory
* All rights reserved.
*
* This file is part of VisIt. For details, see http://www.llnl.gov/visit/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or materials provided with the distribution.
* - Neither the name of the UC/LLNL nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF
* CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER