Commit 1ac01a6e authored by pugmire's avatar pugmire

Add resample expression.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@11810 18c085ea-50e0-402c-830e-de6fd14e8384
parent 7e21177f
......@@ -146,6 +146,7 @@ General/avtRandomExpression.C
General/avtRecenterExpression.C
General/avtRectilinearLaplacianExpression.C
General/avtRelativeDifferenceExpression.C
General/avtResampleExpression.C
General/avtResradExpression.C
General/avtSpecMFExpression.C
General/avtSurfaceNormalExpression.C
......
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. 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 other materials provided with the distribution.
* - Neither the name of the LLNS/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 LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, 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.
*
*****************************************************************************/
// ************************************************************************* //
// avtResampleExpression.h //
// ************************************************************************* //
#ifndef AVT_RESAMPLE_EXPRESSION_H
#define AVT_RESAMPLE_EXPRESSION_H
#include <avtSingleInputExpressionFilter.h>
#include <string>
// ****************************************************************************
// Class: avtResampleExpression
//
// Purpose:
// Resamples a variable.
//
// Programmer: Dave Pugmire
// Creation: Fri Jul 2 14:10:45 EDT 2010
//
// Modifications:
//
//
// ****************************************************************************
class EXPRESSION_API avtResampleExpression : public avtExpressionFilter
{
public:
avtResampleExpression();
virtual ~avtResampleExpression();
virtual const char *GetType(void) { return "avtResampleExpression"; };
virtual const char *GetDescription(void) {return "Resampling";};
virtual void ProcessArguments(ArgsExpr*, ExprPipelineState *);
protected:
virtual void Execute(void);
virtual int NumVariableArguments(){ return 0; }
virtual int GetVariableDimension(void);
virtual bool CanHandleSingletonConstants(void) {return true;}
virtual bool IsPointVariable(void);
int samplesX, samplesY, samplesZ;
};
#endif
......@@ -83,6 +83,7 @@
#include <avtRecenterExpression.h>
#include <avtRectilinearLaplacianExpression.h>
#include <avtRelativeDifferenceExpression.h>
#include <avtResampleExpression.h>
#include <avtResradExpression.h>
#include <avtTimeExpression.h>
#include <avtUnaryMinusExpression.h>
......@@ -459,6 +460,9 @@ avtVectorExpr::CreateFilters(ExprPipelineState *state)
// Cyrus Harrison, Tue Feb 2 14:54:25 PST 2010
// Added the "python" expression.
//
// Dave Pugmire, Fri Jul 2 14:22:34 EDT 2010
// Added the "resample" expression.
//
// ****************************************************************************
avtExpressionFilter *
......@@ -498,6 +502,8 @@ avtFunctionExpr::CreateFilters(string functionName)
return new avtLocalizedCompactnessExpression();
if (functionName == "recenter")
return new avtRecenterExpression();
if (functionName == "resample")
return new avtResampleExpression();
if (functionName == "displacement")
return new avtDisplacementExpression();
if (functionName == "degree")
......
......@@ -129,6 +129,9 @@ class avtWebpage;
// Hank Childs, Sun Feb 15 10:12:22 PST 2009
// Add friend status for avtTimeIteratorExpression.
//
// Dave Pugmire, Fri Jul 2 14:22:34 EDT 2010
// Add friend status for avtResampleExpression.
//
// ****************************************************************************
class PIPELINE_API avtDataset : public avtDataObject
......@@ -145,6 +148,7 @@ class PIPELINE_API avtDataset : public avtDataObject
friend class avtExecuteThenTimeLoopFilter;
friend class avtNamedSelectionManager;
friend class avtTimeIteratorExpression;
friend class avtResampleExpression;
public:
avtDataset(avtDataObjectSource *);
......
......@@ -159,6 +159,9 @@
// Hank Childs, Mon Jun 28 06:49:16 PDT 2010
// Add [min|max][x|y|z]_coord.
//
// Dave Pugmire, Fri Jul 2 14:22:34 EDT 2010
// Add resample expression.
//
// ****************************************************************************
struct ExprNameList
......@@ -348,6 +351,7 @@ const char *expr_misc[] = {
"mean_curvature",
"point_constant",
"recenter",
"resample",
"resrad",
"surface_normal",
" point_surface_normal",
......@@ -1546,6 +1550,9 @@ QvisExpressionsWindow::UpdateStandardExpressionEditor(const QString &expr_def)
//
// Modifications:
//
// Dave Pugmire, Fri Jul 2 14:22:34 EDT 2010
// Add resample expression.
//
// ****************************************************************************
QString
......@@ -1643,6 +1650,11 @@ QvisExpressionsWindow::ExpandFunction(const QString &func_name)
res += QString("(<var>, [\"nodal\", \"zonal\", \"toggle\"])");
doParens = false;
}
else if (func_name == "resample")
{
res += QString("(<var>, sX, sY, sZ)");
doParens = false;
}
else if(func_name == "value_for_material")
{
stdDefinitionEdit->insertPlainText("(<var>, <material-name-or-number>)");
......
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