<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
in a programmable Filter do something like this:<br>
<br>
<tt> import math<br>
input = self.GetInputDataObject(0, 0)<br>
output = self.GetOutputDataObject(0)<br>
COUNT=input.GetNumberOfPoints()<br>
pd=input.GetPointData()<br>
m=0<br>
v=0<br>
for i in xrange(COUNT):<br>
r=pd.GetArray('radius').GetValue(i)<br>
v=v+((4.0/3.0)*math.pi*r*r*r)<br>
m=m+pd.GetArray('Mass').GetValue(i)<br>
outputarray = vtk.vtkStringArray()<br>
outputarray.SetName("Text")<br>
outputarray.SetNumberOfTuples(1)<br>
outputarray.SetValue(0,"N=%d\nV=%1.6f m³\nm=%1.6f kg" %
(COUNT,v,m))<br>
output.GetRowData().AddArray(outputarray)</tt><br>
<br>
Attention: if you save this to a state-file change the ³ to 3
because it will not be escaped and you can not load the state
anymore.<br>
<br>
best wishes,<br>
Christian<br>
<br>
Am 02.11.2012 21:49, schrieb Scott Ripplinger:<br>
</div>
<blockquote
cite="mid:CAG0uffXrOQkWvT8q45mjnEdZ-KUynsUAjcFjAR4eDe+uRr2Z0g@mail.gmail.com"
type="cite">I need to sum all the values in a vector of a scalar
property. I've struggled understanding the documentation for the
python calculator and programmable filter, mainly in how to access
the point data that I want to use. Any tips will be appreciated.
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the ParaView Wiki at: <a class="moz-txt-link-freetext" href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a>
</pre>
</blockquote>
<br>
</body>
</html>