Currently I am unable to figure out how to create a set of points in paraview with the python shell or programmable filter. I have constructed a script <br>that can read a database and output a single point source for each point (see below). Is there something I am missing to instead construct a point set, or will I have to create a point set source object first?
<br><br>#!/usr/bin/env python<br>import time<br>import sys<br>import paraview<br>from pysqlite2 import dbapi2 as sqlite<br><br>COLS_TO_GET = 100<br><br># Locate the view to which we'll add the "display". All views are
<br># registered in the group "view_modules" with the proxy manager.<br>#pxm = paraview.pyProxyManager()<br>iter = pxm.group_iter("view_modules");<br>activeView = None<br>for proxy in iter:<br> if proxy.IsA
("vtkSMRenderModuleProxy"):<br> activeView = proxy<br> break<br>if activeView:<br> db = sqlite.connect('/home/rmaynard/ProjParaview/rmaynard/Python/mine.db') <br> c = db.cursor()<br> <br> #start time tracking
<br> startTime = time.time()<br> <br> c.execute('select * from data where lbExpl > 0')<br> cols = c.fetchmany(COLS_TO_GET)<br> for row in cols:<br> grab the row x, y, z <br> (x,y,z) = row[:3]<br>
point = paraview.CreateProxy("sources","PointSource","sources", "point.%d.%d.%d"%(x,y,z))<br> point.SetCenter(x,y,z) <br> point.UpdateVTKObjects(); <br> disp = paraview.CreateDisplay
(point, activeView);<br> <br> activeView.StillRender();<br> #end time tracking<br> endTime = time.time()<br> print endTime-startTime<br> c.close()<br> db.close() <br><br>