[Paraview] Accessing a specific variable in Python Programmable Filter

Su, Simon M CTR USARMY ARL (US) simon.m.su.ctr at mail.mil
Fri May 16 15:53:43 EDT 2014


Dave,

thanks
-simon

________________________________
From: David E DeMarle [dave.demarle at kitware.com]
Sent: Friday, May 16, 2014 3:51 PM
To: Su, Simon M CTR USARMY ARL (US)
Cc: paraview at paraview.org
Subject: Re: [Paraview] Accessing a specific variable in Python Programmable Filter

input.GetPointData().GetArray("Colors")



David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Fri, May 16, 2014 at 3:46 PM, Su, Simon M CTR USARMY ARL (US) <simon.m.su.ctr at mail.mil<mailto:simon.m.su.ctr at mail.mil>> wrote:
Hello,

After staring at http://www.paraview.org/Wiki/Python_Programmable_Filter for a while, the way to access the data for a specific variable name still eludes me. This is the python code from the wiki on Add the Colors variable to a PolyData

=============================

input = self.GetPolyDataInput();
output =  self.GetPolyDataOutput();

colors = vtk.vtkUnsignedCharArray();
colors.SetNumberOfComponents(3);
colors.SetName("Colors");

numPoints = input.GetNumberOfPoints()
for i in range(0, numPoints):
    colors.InsertNextTuple3(255,0,0);

output=input
output.GetPointData().AddArray(colors)

===============================

How do I from the next filter, access the variable name "Colors" that I created?

Any help is much appreciated.

thanks
-simon

_______________________________________________
Powered by www.kitware.com<http://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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20140516/57037e80/attachment.html>


More information about the ParaView mailing list