<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style title="owaParaStyle">P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</style>
</head>
<body ocsi="x">
<div dir="ltr"><font face="Tahoma" color="#000000" size="2">Hallo</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">I have a question regarding a requirement that seems a bit out of line with the client-server architecture of Paraview;
</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">Let me start off by giving the bigger picture of the application that I have in mind;</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">I want to use Paraview in a development environment. The development environment will operate in a standard Python console. As I develope (build up) my data I want to visualize it periodically. I don't want to regenerate
the data from sratch everytime I want to visualize it. I basically want to work with live data that persists on the client side.
</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">A typical example Python script that I envisage using Python wrapped VTK and Paraview objects to display vtkPolydata would look something like this:</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">
<div dir="ltr"><font face="tahoma" size="2">=========================================================================================</font></div>
</font></div>
<div dir="ltr"><font face="times new roman"># Initialize Paraview pipeline</font></div>
<div dir="ltr"><font face="times new roman">mySource = InitializePV()</font></div>
<div dir="ltr"><font face="times new roman"></font> </div>
<font face="times new roman">
<div dir="ltr"><font face="times new roman"># Create poly data and plot it</font></div>
<div dir="ltr">import vtk<br>
pts=vtk.vtkPoints() <br>
pts.InsertNextPoint(0,0,0)<br>
pts.InsertNextPoint(1,0,.0)<br>
pts.InsertNextPoint(2,1,0)<br>
pts.InsertNextPoint(3,3,0.)</div>
<div dir="ltr"> </div>
<div dir="ltr">cel=vtk.vtkCellArray() <br>
cel.InsertNextCell(4) <br>
cel.InsertCellPoint(0)<br>
cel.InsertCellPoint(1)<br>
cel.InsertCellPoint(2)<br>
cel.InsertCellPoint(3)</div>
<div dir="ltr"> </div>
<div dir="ltr">pd = vtk.vtkPolyData()<br>
pd.SetPoints(pts)<br>
pd.SetPolys(cel)<br>
</div>
</font>
<div dir="ltr"><font face="times new roman">plotPolys(mySource,pd)</font></div>
<div dir="ltr"><font face="times new roman"></font> </div>
<div dir="ltr"><font face="times new roman">
<div dir="ltr"><font face="times new roman">
<div dir="ltr"><font face="times new roman">##### Change the points and plot</font></div>
<div dir="ltr"><font face="times new roman">
<div dir="ltr"><font face="times new roman">pd.GetPoints().SetPoint(2, 1,2,3)</font></div>
<div dir="ltr"><font face="times new roman">
<div dir="ltr"><font face="times new roman">plotPolys(mySource,pd)
<div dir="ltr"><font face="times new roman"></font> </div>
<div dir="ltr"><font face="times new roman">
<div dir="ltr"><font face="times new roman">##### Change the points and plot</font></div>
</font><font face="times new roman"><font face="times new roman">pd.GetPoints().SetPoint(2, 4,5,4)</font></div>
<div dir="ltr">
<div dir="ltr"><font face="times new roman">
<div dir="ltr"><font face="times new roman">plotPolys(mySource,pd)</font></div>
<div dir="ltr"><font face="times new roman"></font> </div>
</font></div>
</font></div>
</font></div>
</font></div>
</font></div>
</font><font face="times new roman"><font face="times new roman"><font face="times new roman"></font></div>
</font></font><font face="times new roman"></font></font><font face="tahoma" size="2">
<div dir="ltr"><font face="times new roman">
<div dir="ltr"></font><font face="times new roman"><font face="times new roman"><font face="times new roman"></font> </div>
</div>
</font></font><font face="times new roman"></font># etc</font></div>
<div dir="ltr"><font face="tahoma" size="2">====================</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">The Python functions initializePV() and plotPoints can typically look like the following:</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">initializePV():</font></div>
<div dir="ltr"><font face="tahoma" size="2">=========</font></div>
<div dir="ltr">pxm = servermanager.ProxyManager()<br>
sph=servermanager.sources.SphereSource()<br>
pxm.RegisterProxy("sources", "mysource", sph)<br>
view = pxm.GetProxy("views", "RenderView1")<br>
rep = servermanager.CreateRepresentation(sph, view)<br>
return sph</div>
<div dir="ltr"><font face="times new roman"></font> </div>
<div dir="ltr"><font face="times new roman">plotPoints(sourceObject,vtkObject):</font></div>
<div dir="ltr"><font face="times new roman">===============</font></div>
<div dir="ltr"><font face="times new roman"># Although this example currently generates vtkPoints I actually want to send vtkPolyData to the Paraview source - but this</font></div>
<div dir="ltr"><font face="times new roman"># is only to demonstrate the development environment I have in mind...</font> </div>
<div dir="ltr"><font face="times new roman"># The current vtk and proxy source classes needs to be updated to take a vtkPolyData pointer...</font></div>
<div dir="ltr"><font face="times new roman">sourceObject.SetMyPolyData(vtkObject)</font></div>
<div dir="ltr"><font face="times new roman">sourceObject.Update()</font></div>
<p><font face="tahoma" size="2"></font> </p>
<div dir="ltr"><font face="tahoma" size="2">=========================================================================================</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">In the example above the vtk data (pd) is a live object on the client side.</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">In short I want to generate vtk data on the client side and send a data pointer (typically a vtkPolyData pointer) to the visualization pipeline in Paraview. I thought of modifying a source object in Paraview to take
my data instead of generating the data on the server side. </font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">I don't want to work with the programmable source using a script for that implies that the data is again generated on the server side.
</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">According to the Paraview documentation it seems that the only way to manipulate the Paraview source objects is through Property objects (VectorProperty, ProxyProperty and InputProperty). Does this imply that according
to the current architecture that I will not be able to send a vtkObject (vtkPolyData) pointer to the server?
</font><font face="tahoma" size="2">If so what are the options with regards to the Paraview architecture so that I can use Paraview in the above demonstrated manner - i.e. generating data on the client side and let Paraview operate on such data?</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">Thanks in advancxe,</font></div>
<div dir="ltr"><font face="tahoma" size="2">Louis</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"> </div>
</body>
</html>