[Paraview] Fwd: How to plug into paraview his own writer ?

houssen houssen at ipgp.fr
Wed Jul 1 16:49:37 EDT 2015


Hi Cory,

I had to spread my time over several topics these days... So I had not 
much time to get back to the paraview writer.

I believe I have done pretty much everything for the writer to work but 
at save time, I still get this error :
~> ERROR: In 
/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/ParaViewCore/ServerImplementation/Core/vtkSIProxy.cxx, 
line 307
vtkSIWriterProxy (0x5cc38e0): Failed to create myWriter. Aborting for 
debugging purposes.
The writer instance is not created for some reason.

At this point, I run paraview, I load the plugin with "tools / manage 
plugins" (load seems OK), I open some data, I save with "my writer" (I 
see my writer in the save GUI + I am asked for a file-to-save name), I 
click OK and then it crahses. I believe the xml file is wrong and / or 
something is missing... But I didn't yet figured it out. It seems I have 
no pvserver (see in the mail) : can this trigger the crash ? Do I need a 
pvserver for the writer to work ?

I answered your question in the mail.

Franck

Le 2015-06-30 6:08, Cory Quammen a écrit :
> Hi Franck,
>
> It looks like you've been making progress, so I'll answer your
> questions from your second email.
>
>  
>
>> Question 1 : how to write myWriter.xml ?
>>
>> 1.1. seems I must set <InputProperty command="SetInputConnection"
>> name="Input"> in myWriter.xml. Does this means I will also have to
>> implement myWriter::SetInputConnection ?
>
> No. Your writer will inherit from subclass of vtkAlgorithm, the class
> that defines "SetInputConnection", and you should not need to 
> override
> it. XdmfWriter inherits from vtkDataObjectAlgorithm, which itself
> inherits vtkAlgorithm.
>  
>
>> 1.2. seems I must set <StringVectorProperty name="FileName"
>> command="SetFileName"> in myWriter.xml. Does this means I will also
>> have to implement myWriter::SetFileName ?
>
> Yes, like vtkXdmfWriter.
>
>  2.2 in myWriter.hpp, I need to derive from a vtkObject this way
> (like XdmfWriter.cpp does)
>
>> ew (); // Needed to be plugged into paraview
>>     vtkTypeMacro ( myWriter, vtkDataObjectAlgorithm ); // Needed
>> to be plugged into paraview
>> + suppress copy constructor and operator=
>>
>> Am I correct ?
>>
>> Yes.
>>
>> Question 3 : in myWriter.cpp, on
> I am supposed to be called back (to get focus back) when I click the
> "save data" button ? Here, how can I get data to be saved (data that 
> I
> can see in paraview viewer befo
>
>> n ParaView, when you choose, File -> Save Data, the data from the
>> selected Pipeline Browser object will be saved. This will have some
>> kind of data type, e.g., vtkImageData, vtkPolyData, etc. What kind
>> of data type would you like your writer to support?

Structured and likely also unstructured grids

>>
>> The data should
> in the member function myWriter::RequestData(). This is where you
> should write your data. 

OK (I suppose I'll get vtkStructuredGrid / vtkUnstructuredGrid as 
vtkObject in myWriter::RequestData according to 
http://www.vtk.org/Wiki/VTK/Tutorials/New_Pipeline#Typical_Pipeline_Execution)

>
>  Finally, myWriter.xml seems OK. myWriter.*pp compile OK. Paraview
> finds myWriter.xml at run time (exporting PV_PLUGIN_PATH) and loads
> libmywriter.so without problem. I see the writer in the "save data"
> GUI (drop down list with different save formats). I save with
> myWriter, I get a (basic) GUI with file name only (no extra 
> parameter)
> : I crash when I click "OK, save" with this error message :
>  ERROR: In /.../ParaView-v4.3.1-sourc
>
>> ailed to create myWriter. Aborting for debugging purposes.
>>
>> vtkSIWriterProxy does this at line 303 :
>> vtkObjectBase* obj = this->Interpreter->NewInstance(className);
>> but obj is NULL.
>>
>> I get obj is NULL because I missed something in myWriter
>> implementation : what did I miss ?
>>
>> Are you running pvserver separately and connecting to it with the
>> client? If so, make sure PV_PLUGIN_PATH is defined in the
>> environment in which pvserver is run. Have you tried to load your
>> plugin through the Tools -> Manage Plugins... dialog?
>>

No I just run a client. I don't need the server : is it necessary for 
the writer to work ?

~> paraview &
~> ps -aux | grep pvserver
houssen   5315  0.0  0.0  14544   948 pts/0    S+   22:38   0:00 grep 
pvserver
~> ps -aux | grep paraview
houssen   5313 16.0  1.1 1175692 179424 pts/0  S    22:38   0:01 
/home/houssen/Programs/ParaView/ParaView-v4.3.1-source/local/lib/paraview-4.3/paraview
houssen   5317  0.0  0.0  14544   944 pts/0    S+   22:38   0:00 grep 
paraview


>> I hope that helps get you further in writing your data files.
>>
>> Thanks,
>> Cory
>>  
>> Can somebody help
> t me some clue ?
>
>  FH
>
>  -------- Message original --------
>  Objet: How to plug into paraview his own writer ?
>  Date: 2015-06-12 15:54
>  De: houssen <houssen at imap.ipgp.fr [6]>
>  À: <paraview at paraview.org [7]>
>
>  I followed 2 tutorials (
>
> Links:
> ------
> [1] http://www.kitware.com
> [2] http://www.kitware.com/opensource/opensource.html
> [3] http://paraview.org/Wiki/ParaView
> [4] http://markmail.org/search/?q=ParaView
> [5] http://public.kitware.com/mailman/listinfo/paraview
> [6] mailto:houssen at imap.ipgp.fr
> [7] mailto:paraview at paraview.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: myWriter.tar.gz
Type: application/x-gzip
Size: 1591 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150701/8116c72b/attachment.bin>


More information about the ParaView mailing list