[Paraview-developers] Adding a Writer plugin to Catalyst in situ
Andy Bauer
andy.bauer at kitware.com
Tue Feb 27 10:48:53 EST 2018
Hi,
The key thing is that in the GUI you don't actually create a writer for the
Catalyst pipeline, you need to create a stub for the writer that gets
filled in when you run Catalyst. For example, looking in utilities.xml for
the XMLPImageDataWriter stub:
=================
<SourceProxy name="XMLPImageDataWriter" class="vtkPVNullSource"
label="Parallel Image Data Writer">
<InputProperty name="Input">
<ProxyGroupDomain name="groups">
<Group name="sources" />
<Group name="filters" />
</ProxyGroupDomain>
<DataTypeDomain name="input_type" composite_data_supported="0">
<DataType value="vtkImageData" />
</DataTypeDomain>
<Documentation>
The input.
</Documentation>
</InputProperty>
<StringVectorProperty name="FileName"
number_of_elements="1"
default_values="filename_%t.pvti">
</StringVectorProperty>
<IntVectorProperty name="WriteFrequency"
number_of_elements="1"
default_values="1">
<IntRangeDomain name="range" min="1" />
</IntVectorProperty>
<IntVectorProperty name="PaddingAmount"
number_of_elements="1"
default_values="0">
<IntRangeDomain name="range" min="0" />
</IntVectorProperty>
<Hints>
<!-- TODO: this doesn't work yet -->
<PipelineIcon name=":pqComponents/pqSave32.png" />
<!-- This will help us when exporting the script state -->
<WriterProxy group="writers" name="XMLPImageDataWriter" />
</Hints>
<!-- End of XMLPImageDataWriter -->
</SourceProxy>
==================
Note that this is in the insitu_writers_parameters group in that file. Some
subtleties for this, if I remember correctly, are:
- The SourceProxy name attribute may need to be the name of your actual
writer (here it's XMLPImageDataWriter) though I don't think so
- You probably want to include FileName, WriteFrequency and
PaddingAmount properties here.
- In the Hints section the WriterProxy should have the name attribute
set to the actual writer from your plugin.
If that doesn't seem to work, I'd suggest looking at coprocessing.py's
RegisterWriter(), WriterParamtersProxy() and WriteData() methods.
Best,
Andy
On Tue, Feb 27, 2018 at 10:11 AM, Louka Jacques--Chevallier <
louka.jacques--chevallier at pi.esisar.grenoble-inp.fr> wrote:
> Hello,
> I'm trying to implement a custom asynchronous writer as a plugin for
> paraview / Catalyst in situ.
>
> What actually works :
> -The writer works when it's invoked as pure c++
> -The xml that describes the writer seems OK as it shows the right
> extensions when using the "save data" feature in PV (after being imported
> of course)
> -I already added a plugin filter (not writer) to paraview and it works
> like a charm, so it's about the writer properties in particular
> -I'm able to display it as an entry in the in situ Writers menu (using the
> proxy group : in situ_writer_parameters)
> -Exporting a pipeline (in python) using this writer works well, it's shown
> with the right parameters
>
> What doesn't work :
> -When importing the (previously exported) pipeline.py, it seems that the
> writer is not found (meanwhile the filter is)
>
> What has been tried :
> -Using the LoadPlugin("mylib.so") in python
> -Recompiling unsuccessfully catalyst with the new files for the writer
> -Looking for plugins used the same way with in situ, but found nothing...
>
> I don't really know if it is even possible, or if it has been done before,
> any idea / suggestion will be appreciated ! ^.^
> Regards,
> Louka
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=
> Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/paraview-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview-developers/attachments/20180227/0585a3f6/attachment.html>
More information about the Paraview-developers
mailing list