Here is a diff that fixes the problem:

Index: ./VTK/Common/vtkFunctionParser.cxx
===================================================================
RCS file: /cvsroot/ParaView3/ParaView3/VTK/Common/vtkFunctionParser.cxx,v
retrieving revision 1.44
diff -r1.44 vtkFunctionParser.cxx
1455,1457c1455,1460
<       index += this->GetMathFunctionStringLength(functionNumber);
<       currentChar = this->Function[index];
<       if ( currentChar != '(' )
---
>       currentChar =
this->Function[index+this->GetMathFunctionStringLength(functionNumber)];
>       if ( currentChar == '(' )
>         {
>         index += this->GetMathFunctionStringLength(functionNumber);
>         }
>       else
1459,1460d1461
<         vtkErrorMacro("Syntax error: input to math function not in "
<                       << "parentheses; see position " << index);
1463c1464
<         return 0;
---
>         return 1;

Regards,
Paul


2009/6/25 Paul Edwards <[email protected]>

> Hi,
>
> I have a filter than creates secondary flow variables for post processing.
> They have names such as "absolute temperature".  There is a problem with the
> Python parser where it will take the "abs" from absolute and interpret it as
> the math function.  Is there a way around this?
>
> Here are steps to reproduce this:
>
> from paraview.simple import *
> cone = Cone()
> calc = Calculator(cone)
> calc.Function = "17"
> calc.ResultArrayName = "absolute"
> calc2 = Calculator(calc)
> calc2.Function = "(absolute) - 15"
> calc2.UpdatePipeline()
>
> The only solution I can think of is to rename the scalars that are output
> from the filter.  Does anyone have any other ideas?  (In future might it be
> worth allowing the user to put values in {}'s or something?)
>
> Regards,
> Paul
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to