[prev in list] [next in list] [prev in thread] [next in thread]
List: paraview
Subject: [Paraview] Help with Clip filter Annotation
From: Guðni_Karl_Rosenkjær <grosenkj () eos ! ubc ! ca>
Date: 2013-02-28 20:14:15
Message-ID: CAOqTh==t__6K+fZi8fq1T1OryT4ua89Of1TGZATZnh35LWevAQ () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hello all,
I am making a Annotation for Clip filter that shows the current location. I
have been trying to use the new PythonAnnotation filter but I am not able
to access the Origin and Offset properties from the input to the filters
Expression. This is the Expression I tried: 'At %.0f Northing' %
input.ClipType.Offset+input.ClipType.Origin[1]
In order to get around this, I have made this small python script.
> from paraview.simple import *
>
> # Get the active source
> actSource = GetActiveSource()
>
> # Add the filter
> anno = PythonAnnotation(actSource)
> # Calculate the Northing, offset + origin
> north = anno.Input[0].ClipType.Offset + anno.Input[0].ClipType.Origin[1]
>
> # Set the anno expression
> exprStr = "'At %.0f Northing' % {0:.0f} ".format(north)
> anno.Expression = exprStr
> Show(anno)
> Render()
This works initially, but I am not able to figure out how to get filter to
"update" when the properties of the Clip filter are changed.
All suggestions and help are highly appreciated.
Thanks
Gudni Karl
[Attachment #5 (text/html)]
<p><br>
Hello all,</p>
<p>I am making a Annotation for Clip filter that shows the current location. I have \
been trying to use the new PythonAnnotation filter but I am not able to access the \
Origin and Offset properties from the input to the filters Expression. This is the \
Expression I tried: 'At %.0f Northing' % \
input.ClipType.Offset+input.ClipType.Origin[1] </p>
<p>In order to get around this, I have made this small python script. </p>
<p>> from paraview.simple import *<br>
><br>
> # Get the active source<br>
> actSource = GetActiveSource()<br>
><br>
> # Add the filter<br>
> anno = PythonAnnotation(actSource)<br>
> # Calculate the Northing, offset + origin<br>
> north = anno.Input[0].ClipType.Offset + anno.Input[0].ClipType.Origin[1]<br>
><br>
> # Set the anno expression<br>
> exprStr = "'At %.0f Northing' % {0:.0f} ".format(north)<br>
> anno.Expression = exprStr<br>
> Show(anno)<br>
> Render() <br></p>
<p>This works initially, but I am not able to figure out how to get filter to \
"update" when the properties of the Clip filter are changed. </p> <p>All \
suggestions and help are highly appreciated. </p> <p>Thanks<br>
Gudni Karl </p>
_______________________________________________
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic