title: Is it possible to use the (polyData) writers in VTK for data types from other libraries?
body: <p>I am using ParaView for data visualization, and therefore I need to write my own data in a supported format (like ASCII .vtk). For this purpose, I wrote a legacy ASCII .vtk writer , and it's working fine. However, since I wrote a write-intensive application that runs in parallel, I would like to try out the vtk XML writer.</p>
  
  <p>Is possible to re-use the writers with Classes that come from another library? </p>
  
  <p>From looking at the <a href="http://www.vtk.org/doc/nightly/html/classvtkPolyDataWriter.html" rel="nofollow">vtkPolyDataWriter documentation</a>, I noticed that VTK is object oriented and that the writers rely heavily on the "Visualization Pipeline" flow using ports, e.g.:</p>
  
  <pre><code> 353     vtkNew&lt;vtkPolyDataWriter&gt; writer0;
   354     writer0-&gt;SetFileName( "./hyperTreeGridContour.vtk" );
   355     writer0-&gt;SetInputConnection( contour-&gt;GetOutputPort() );
   356     writer0-&gt;Write();
  </code></pre>
  
  <p>from <a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/HyperTree/Cxx/HyperTreeGridDemonstrator.cxxhttp://" rel="nofollow">vtkPolyData Example</a>. </p>
  
  <p>Is it then possible to re-use <a href="http://www.vtk.org/doc/nightly/html/classvtkWriter.html" rel="nofollow">the writers</a> with classes outside VTK hierarchy? </p>
  
  <p>The writeable object should be a vtkObject, but <a href="http://www.vtk.org/doc/nightly/html/classvtkPolyData.html#a47cd25a22735630cecd990ed22e64f76" rel="nofollow">vtkPolyData</a> class, that gets written out at the end, relies even further on VTK specific types. </p>