<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
<pre>I followed 2 tutorials (http://www.itk.org/Wiki/ParaView/Plugin_HowTo#Writing_Plugins, http://www.kitware.com/media/html/WritingAParaViewReaderPlug-in.html) but I feel like I missed some steps : this is not working.
<br />I need to "catch" data (I can see in 2D/3D paraview viewer) to write them into a specific file format. I am looking for the minimal (simplest) way to do this : the only writer input is the file name, then I would like to understand how to "get data from" paraview (from inside a vtk object I guess ?), then I just will have to do the easy part which is to write data to a specific format. <br />
My understanding is that, first I need a CMakeLists.txt like :
~> more CMakeLists.txt 
FIND_PACKAGE ( ParaView REQUIRED )
INCLUDE ( ${PARAVIEW_USE_FILE} )
ADD_PARAVIEW_PLUGIN ( myWriter "1.0" SERVER_MANAGER_XML myWriter.xml SERVER_MANAGER_SOURCES myWriter.cpp )

In the same directory, I need a (minimal) myWriter.xml file that looks like :<br />~> more myWrite.xml<br /> <ServerManagerConfiguration>
  <ProxyGroup name="<strong>writers</strong>">
    <SourceProxy name="<strong>myWriter</strong>" class="<strong>myWriter</strong>" label="my writer">
      <Documentation short_help="my own writer"/>
      <InputProperty>
        <StringVectorProperty name="FileName" command="<strong>SetFileName</strong>" number_of_elements=”1”/>
      </InputProperty>
      <Hints>
        <WriterFactory extensions="mw" file_description="my written file"/>
      </Hints>
    </SourceProxy>
  </ProxyGroup>
</ServerManagerConfiguration>
My understanding is that somehow the xml subscribes my for a specific callback I am called back on the "save data" button is cliked in the GUI.<br />
Still, in this same directory, I have myWriter.cpp and myWriter.hpp : how to implement them ?<br />1. The myWriter class must define and implement a SetFileName method because of the <StringVectorProperty> xml tag in myWriter.xml : right ? wrong ?<br />    This is the file name (including file path) one sets in the GUI : right ? wrong ?<br />2. myWriter is supposed to derive from another class : which one ? where to find it ?<br />3. How the myWriter implementation will "catch" data in paraview ? Which method to override / re-implement ?<br />    When I am called from paraview (triggered by the click on "save data" button), I guess I am called on a specific method "myWriter::cbMethod ( vtkXXX * pDataInParaviewViewer )"<br />    What is this method ? <br /><br />Also, at this step, I export PV_PLUGIN_PATH=/mnt/users/houssen/Documents/solve-rel/paraview. When I run paraview and use the "save data" button I get this :<br />Generic Warning: In /.../Programs/ParaView/ParaView-v4.3.1-source/ParaViewCore/ServerManager/Core/vtkSMWriterFactory.cxx, line 135<br />writers : myWriter has no input property.<br />... But I have an <InputProperty> tag in the xml : what's wrong ?</pre>
<pre><br />Can somebody help me on this ?</pre>
<pre><br />Franck

Note : I run Ubuntu and paraview-4.3</pre>
</body></html>