An update will be applied December 9th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit b116e441 authored by bonnell's avatar bonnell
Browse files

Remove avt bleed into common: move VisWindow exceptions out of...

Remove avt bleed into common: move VisWindow exceptions out of common/Exceptions into avt/VisWindow; moved ExpressionType-to-avtType conversions into avt/.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@7201 18c085ea-50e0-402c-830e-de6fd14e8384
parent 45938fdc
......@@ -95,6 +95,7 @@ MetaData_src= \
MetaData/avtCurveMetaData.C\
MetaData/avtDatabaseMetaData.C\
MetaData/avtDefaultPlotMetaData.C\
MetaData/avtExpressionTypeConversions.C\
MetaData/avtLabelMetaData.C\
MetaData/avtMatSpeciesMetaData.C\
MetaData/avtMaterialMetaData.C\
......
......@@ -5433,7 +5433,11 @@ avtDatabaseMetaData::GetNDomains(const std::string &var) const
// Kathleen Bonnell, Fri Sep 28 13:34:13 PDT 2007
// Use 'VariableNamesEqual' instead of '=='.
//
// Brad Whitlock, Tue Jan 20 16:01:51 PST 2009
// Change conversion function.
//
// ****************************************************************************
#include <avtExpressionTypeConversions.h>
avtVarType
avtDatabaseMetaData::DetermineVarType(std::string var_in, bool do_expr) const
......@@ -5447,7 +5451,7 @@ avtDatabaseMetaData::DetermineVarType(std::string var_in, bool do_expr) const
ParsingExprList *pel = ParsingExprList::Instance();
Expression *e = pel->GetExpression(var_in);
if (e != NULL)
return ParsingExprList::GetAVTType(e->GetType());
return ExprType_To_avtVarType(e->GetType());
}
std::string var;
......
......@@ -2152,7 +2152,11 @@ Definition:
// Kathleen Bonnell, Fri Sep 28 13:34:13 PDT 2007
// Use 'VariableNamesEqual' instead of '=='.
//
// Brad Whitlock, Tue Jan 20 16:01:51 PST 2009
// Change conversion function.
//
// ****************************************************************************
#include <avtExpressionTypeConversions.h>
avtVarType
avtDatabaseMetaData::DetermineVarType(std::string var_in, bool do_expr) const
......@@ -2166,7 +2170,7 @@ avtDatabaseMetaData::DetermineVarType(std::string var_in, bool do_expr) const
ParsingExprList *pel = ParsingExprList::Instance();
Expression *e = pel->GetExpression(var_in);
if (e != NULL)
return ParsingExprList::GetAVTType(e->GetType());
return ExprType_To_avtVarType(e->GetType());
}
std::string var;
......
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* 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.
*
*****************************************************************************/
#include <avtExpressionTypeConversions.h>
// ****************************************************************************
// Method: ExprType_To_avtVarType
//
// Purpose:
// Returns the avtVarType for the expression type.
//
// Arguments:
// type : The expression type
//
// Returns: The avtVarType of the expression or AVT_UNKNOWN_TYPE if the type
// cannot be determined.
//
// Note:
//
// Programmer: Brad Whitlock
// Creation: Thu Jul 18 14:45:25 PST 2002
//
// Modifications:
// Sean Ahern, Wed Dec 11 16:29:52 PST 2002
// Changed the interface so that it works with ExprTypes.
//
// Sean Ahern, Mon Mar 17 23:01:02 America/Los_Angeles 2003
// Changed the expression type names.
//
// Hank Childs, Tue Jul 19 13:39:12 PDT 2005
// Added array expression.
//
// Kathleen Bonnell, Wed Aug 2 17:20:11 PDT 2006
// Added curve expression.
//
// ****************************************************************************
avtVarType
ExprType_To_avtVarType(const Expression::ExprType type)
{
avtVarType retval = AVT_UNKNOWN_TYPE;
// Check to see if the variable is an expression.
switch (type)
{
case Expression::ScalarMeshVar:
retval = AVT_SCALAR_VAR;
break;
case Expression::VectorMeshVar:
retval = AVT_VECTOR_VAR;
break;
case Expression::TensorMeshVar:
retval = AVT_TENSOR_VAR;
break;
case Expression::SymmetricTensorMeshVar:
retval = AVT_SYMMETRIC_TENSOR_VAR;
break;
case Expression::ArrayMeshVar:
retval = AVT_ARRAY_VAR;
break;
case Expression::CurveMeshVar:
retval = AVT_CURVE;
break;
case Expression::Mesh:
retval = AVT_MESH;
break;
case Expression::Material:
retval = AVT_MATERIAL;
break;
case Expression::Species:
retval = AVT_MATSPECIES;
break;
case Expression::Unknown:
default:
retval = AVT_UNKNOWN_TYPE;
}
return retval;
}
// ****************************************************************************
// Method: avtVarType_To_ExprType
//
// Purpose:
// Returns the expression type for the AVT variable type.
//
// Arguments:
// type : The AVT variable type
//
// Returns: The expression type or UNKNOWN if the type cannot be determined.
//
// Note:
//
// Programmer: Hank Childs
// Creation: January 8, 2007
//
// ****************************************************************************
Expression::ExprType
avtVarType_To_ExprType(avtVarType type)
{
Expression::ExprType retval = Expression::Unknown;
// Check to see if the variable is an expression.
switch (type)
{
case AVT_SCALAR_VAR:
retval = Expression::ScalarMeshVar;
break;
case AVT_VECTOR_VAR:
retval = Expression::VectorMeshVar;
break;
case AVT_TENSOR_VAR:
retval = Expression::TensorMeshVar;
break;
case AVT_SYMMETRIC_TENSOR_VAR:
retval = Expression::SymmetricTensorMeshVar;
break;
case AVT_ARRAY_VAR:
retval = Expression::ArrayMeshVar;
break;
case AVT_CURVE:
retval = Expression::CurveMeshVar;
break;
case AVT_MESH:
retval = Expression::Mesh;
break;
case AVT_MATERIAL:
retval = Expression::Material;
break;
case AVT_MATSPECIES:
retval = Expression::Species;
break;
case AVT_UNKNOWN_TYPE:
default:
retval = Expression::Unknown;
}
return retval;
}
/*****************************************************************************
*
* Copyright (c) 2000 - 2008, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400142
* 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.
*
*****************************************************************************/
#ifndef AVT_EXPRESSION_TYPE_CONVERSION_H
#define AVT_EXPRESSION_TYPE_CONVERSION_H
#include <avtTypes.h>
#include <Expression.h>
#include <dbatts_exports.h>
DBATTS_API avtVarType ExprType_To_avtVarType(Expression::ExprType type);
DBATTS_API Expression::ExprType avtVarType_To_ExprType(avtVarType type);
#endif
......@@ -57,6 +57,7 @@
#include <avtDatabaseMetaData.h>
#include <avtDataObjectSource.h>
#include <avtDataset.h>
#include <avtExpressionTypeConversions.h>
#include <avtExtents.h>
#include <avtIOInformation.h>
#include <avtIntervalTree.h>
......@@ -2399,9 +2400,13 @@ avtDatabase::GetFileListFromTextFile(const char *textfile,
// Cyrus Harrison, Fri Sep 14 13:59:30 PDT 2007
// Added support for user settable floating point format string
//
// Brad Whitlock, Tue Jan 20 16:06:53 PST 2009
// I changed a type conversion function.
//
// Mark C. Miller, Thu Feb 12 11:33:59 PST 2009
// Removed std:: qualification on some STL classes due to use of using
// statements at top
//
// ****************************************************************************
void
......@@ -2604,7 +2609,7 @@ avtDatabase::Query(PickAttributes *pa)
ExprNode *tree = ParsingExprList::GetExpressionTree(vName);
if (tree != NULL)
{
varType = ParsingExprList::GetAVTType
varType = ExprType_To_avtVarType
(ParsingExprList::GetExpression(vName)->GetType());
delete tree;
}
......
......@@ -58,6 +58,7 @@
#include <avtExprNode.h>
#include <avtExtents.h>
#include <avtCommonDataFunctions.h>
#include <avtExpressionTypeConversions.h>
#include <ParsingExprList.h>
......@@ -787,6 +788,10 @@ avtExpressionFilter::ExamineContract(avtContract_p spec)
// Programmer: Hank Childs
// Creation: January 8, 2007
//
// Modifications:
// Brad Whitlock, Tue Jan 20 15:55:24 PST 2009
// I changed the name of a conversion function.
//
// ****************************************************************************
avtVarType
......@@ -812,7 +817,7 @@ avtExpressionFilter::DetermineVariableType(std::string &varname)
//
Expression *exp = ParsingExprList::GetExpression(varname.c_str());
if (exp != NULL)
return ParsingExprList::GetAVTType(exp->GetType());
return ExprType_To_avtVarType(exp->GetType());
//
// It's not in the input and it's not an expression. Give up.
......
......@@ -45,7 +45,7 @@
#include <stdio.h>
#include <Expression.h>
#include <ParsingExprList.h>
#include <avtExpressionTypeConversions.h>
// ****************************************************************************
......@@ -91,6 +91,9 @@ avtSymmPlaneExpression::~avtSymmPlaneExpression()
// Hank Childs, Mon Jan 8 10:31:22 PST 2007
// Do not assume that the expression created is a scalar.
//
// Brad Whitlock, Tue Jan 20 16:24:40 PST 2009
// I changed a conversion function name.
//
// ****************************************************************************
void
......@@ -103,7 +106,7 @@ avtSymmPlaneExpression::GetMacro(std::vector<std::string> &args,
args[1].c_str());
ne = new_expr;
avtVarType et = DetermineVariableType(args[0]);
type = ParsingExprList::GetExpressionTypeFromAVT(et);
type = avtVarType_To_ExprType(et);
if (type == Expression::Unknown)
type = Expression::ScalarMeshVar;
}
......
......@@ -45,7 +45,7 @@
#include <stdio.h>
#include <Expression.h>
#include <ParsingExprList.h>
#include <avtExpressionTypeConversions.h>
// ****************************************************************************
......@@ -91,6 +91,9 @@ avtSymmPointExpression::~avtSymmPointExpression()
// Hank Childs, Mon Jan 8 10:31:22 PST 2007
// Do not assume that the expression created is a scalar.
//
// Brad Whitlock, Tue Jan 20 16:24:40 PST 2009
// I changed a conversion function name.
//
// ****************************************************************************
void
......@@ -103,7 +106,7 @@ avtSymmPointExpression::GetMacro(std::vector<std::string> &args,
args[1].c_str());
ne = new_expr;
avtVarType et = DetermineVariableType(args[0]);
type = ParsingExprList::GetExpressionTypeFromAVT(et);
type = avtVarType_To_ExprType(et);
if (type == Expression::Unknown)
type = Expression::ScalarMeshVar;
}
......
......@@ -45,7 +45,7 @@
#include <stdio.h>
#include <Expression.h>
#include <ParsingExprList.h>
#include <avtExpressionTypeConversions.h>
// ****************************************************************************
......@@ -91,6 +91,9 @@ avtSymmTransformExpression::~avtSymmTransformExpression()
// Hank Childs, Mon Jan 8 10:31:22 PST 2007
// Do not assume that the expression created is a scalar.
//
// Brad Whitlock, Tue Jan 20 16:24:40 PST 2009
// I changed a conversion function name.
//
// ****************************************************************************
void
......@@ -103,7 +106,7 @@ avtSymmTransformExpression::GetMacro(std::vector<std::string> &args,
args[1].c_str());
ne = new_expr;
avtVarType et = DetermineVariableType(args[0]);
type = ParsingExprList::GetExpressionTypeFromAVT(et);
type = avtVarType_To_ExprType(et);
if (type == Expression::Unknown)
type = Expression::ScalarMeshVar;
}
......
......@@ -54,6 +54,7 @@
#include <avtIdentityExpression.h>
#include <avtSourceFromAVTDataset.h>
#include <avtTypes.h>
#include <avtExpressionTypeConversions.h>
#include <ParsingExprList.h>
#include <PickAttributes.h>
......@@ -256,6 +257,9 @@ avtExpressionEvaluatorFilter::Execute(void)
// Use the ParsingExprList method to map AVT variable types to expression
// types. (We essentially had two versions of the same routine.)
//
// Brad Whitlock, Tue Jan 20 15:57:01 PST 2009
// I changed the name of a type conversion function.
//
// ****************************************************************************
void
......@@ -274,7 +278,7 @@ avtExpressionEvaluatorFilter::VerifyVariableTypes(void)
if (et == Expression::Mesh || et == Expression::Material ||
et == Expression::Species || et == Expression::Unknown)
continue;
avtVarType et_as_avt = ParsingExprList::GetAVTType(et);
avtVarType et_as_avt = ExprType_To_avtVarType(et);
// consider a ScalarVar to be equivalent to a Curve Expression.
if (vt != et_as_avt &&
......
......@@ -79,7 +79,7 @@ class EXPRESSION_API avtIdentityExpression : public avtUnaryMathExpression
{ return "Applying the identity filter"; }
// "Tolerated" may be a better phrase than "Expected" here.
virtual bool NullInputIsExpected(void) { return true; }
//virtual bool NullInputIsExpected(void) { return true; }
protected:
virtual void DoOperation(vtkDataArray *in, vtkDataArray *out,
......
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