Commit e33aeb63 authored by bonnell's avatar bonnell
Browse files

Allow double-precision sized constant float expressions. Resolves #1818

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23257 18c085ea-50e0-402c-830e-de6fd14e8384
parent 7cd142f8
......@@ -67,6 +67,9 @@ class vtkDataArray;
// Jeremy Meredith, Wed Feb 20 10:00:31 EST 2008
// Support either nodal or zonal values.
//
// Kathleen Biagas, Thu May 1 17:18:30 PDT 2014
// Changed value to double.
//
// ****************************************************************************
class EXPRESSION_API avtConstantFunctionExpression
......@@ -86,7 +89,7 @@ class EXPRESSION_API avtConstantFunctionExpression
virtual int NumVariableArguments(void) { return 2; }
private:
bool nodal;
float value;
double value;
};
......
......@@ -61,6 +61,9 @@ class ExprPipelineState;
// Jeremy Meredith, Thu Aug 7 14:34:01 EDT 2008
// Reorder constructor initializers to be the correct order.
//
// Kathleen Biagas, Thu May 1 17:11:14 PDT 2014
// Change avtFloatContExpr arg to double.
//
class EXPRESSION_API avtExprNode : public virtual ExprNode
......@@ -83,7 +86,7 @@ class EXPRESSION_API avtFloatConstExpr
: public avtExprNode, public FloatConstExpr
{
public:
avtFloatConstExpr(const Pos &p, float v)
avtFloatConstExpr(const Pos &p, double v)
: ExprNode(p), avtExprNode(p), FloatConstExpr(p,v) {}
virtual void CreateFilters(ExprPipelineState *);
};
......
......@@ -53,6 +53,9 @@
// base classes. Made FunctionExpr and MachExpr use names
// instead of Identifier tokens. These two changes were to
// remove Token references from the parse tree node classes.
//
// Kathleen Biagas, Thu May 1 17:13:28 PDT 2014
// Changed FloatConstExpr to double.
class EXPRESSION_API avtExprNodeFactory: public ExprNodeFactory
{
......@@ -64,7 +67,7 @@ public:
CreateIntegerConstExpr(const Pos & p, int v);
virtual ConstExpr*
CreateFloatConstExpr(const Pos & p, float v);
CreateFloatConstExpr(const Pos & p, double v);
virtual ConstExpr*
CreateStringConstExpr(const Pos & p, std::string v);
......@@ -102,7 +105,7 @@ avtExprNodeFactory::CreateIntegerConstExpr(const Pos & p, int v)
}
inline ConstExpr*
avtExprNodeFactory::CreateFloatConstExpr(const Pos & p, float v)
avtExprNodeFactory::CreateFloatConstExpr(const Pos & p, double v)
{
return new avtFloatConstExpr(p, v);
}
......
......@@ -114,7 +114,11 @@ class Pos;
// Cyrus Harrison, Fri Aug 14 15:22:43 PDT 2009
// Added helpers for processing numeric & string lists.
//
// Kathleen Biagas, Thu May 1 17:13:28 PDT 2014
// Changed FloatConstExpr to double.
//
// ****************************************************************************
class EXPR_API2 ExprNode : public ExprParseTreeNode
{
public:
......@@ -157,14 +161,14 @@ class EXPR_API2 IntegerConstExpr : public ConstExpr
class EXPR_API2 FloatConstExpr : public ConstExpr
{
public:
FloatConstExpr(const Pos &p, float v)
FloatConstExpr(const Pos &p, double v)
: ExprNode(p), ConstExpr(p, ConstExpr::Float), value(v) {}
virtual ~FloatConstExpr();
virtual const std::string GetTypeName() { return "FloatConst"; }
virtual void PrintNode(ostream &o);
float GetValue() { return value; }
double GetValue() { return value; }
protected:
float value;
double value;
};
class EXPR_API2 StringConstExpr : public ConstExpr
......
......@@ -53,6 +53,9 @@
// base classes. Made FunctionExpr and MachExpr use names
// instead of Identifier tokens. These two changes were to
// remove Token references from the parse tree node classes.
//
// Kathleen Biagas, Thu May 1 17:16:09 PDT 2014
// Changed FloatConstExpr to double.
class EXPR_API ExprNodeFactory
......@@ -66,7 +69,7 @@ public:
{ return new IntegerConstExpr(p, v); }
virtual ConstExpr*
CreateFloatConstExpr(const Pos & p, float v)
CreateFloatConstExpr(const Pos & p, double v)
{ return new FloatConstExpr(p, v); }
virtual ConstExpr*
......
......@@ -171,7 +171,11 @@ ExprParser::~ExprParser()
// Allow unary minus to get integrated directly into float and int
// constants.
//
// Kathleen Biagas, Thu May 1 17:17:32 PDT 2014
// Changed FloatConstExpr to double.
//
// ****************************************************************************
ParseTreeNode*
ExprParser::ApplyRule(const Symbol &sym,
const Rule *rule,
......@@ -246,7 +250,7 @@ ExprParser::ApplyRule(const Symbol &sym,
E[1]->GetTypeName() == "FloatConst")
{
ConstExpr *c = dynamic_cast<ConstExpr*>(E[1]);
float v = dynamic_cast<FloatConstExpr*>(c)->GetValue();
double v = dynamic_cast<FloatConstExpr*>(c)->GetValue();
node = factory->CreateFloatConstExpr(p,-v);
}
else
......
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