[Paraview] Python parser issues

Paul Edwards paul.m.edwards at gmail.com
Thu Jun 25 11:43:27 EDT 2009


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 <paul.m.edwards at gmail.com>

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090625/7bdb4073/attachment.htm>


More information about the ParaView mailing list