[Paraview] Plugin that is a reader and a filter

Moreland, Kenneth kmorel at sandia.gov
Wed Sep 22 10:27:05 EDT 2010


It's not clear to me exactly what the original question is asking.  Are you simply trying to define both a reader and filter in the same plugin?  In that case, you provide two ProxyGroup elements in the server manager definition and place the reader and filter in the appropriate one.

<ProxyGroup name="sources">
  // define reader
</ProxyGroup>
<ProxyGroup name="filters">
  // define filter
</ProxyGroup>

Is the question that you want the filter automatically applied when you open the file?  In that case, Utkarsh's solution of creating a new metareader in C++ that internally calls both the reader and filter is probably the cleanest solution.  It may also be possible to create a composite filter in ParaView.  However, I'm not sure anyone as actually tried to make a composite filter that starts with a reader, so the implementation in ParaView might not support that.

Do you really want to see both the reader and filter in the pipeline browser independently but have them both automatically created when the file is opened?  There is no way to do this with ParaView's conventional file open mechanism.  However, it's pretty easy to create a plugin that provides a toolbar button and/or a menu item that invokes a custom open operation that sets up whatever pipeline you want.  The Wiki plugin page has instructions on creating toolbar and menu actions in a plugin (which can be integrated in the same plugin where readers and filters are provided).  And as Andy stated, the SLACTools plugin has an example of providing one of these custom open operations.

-Ken


On 9/22/10 7:13 AM, "Utkarsh Ayachit" <utkarsh.ayachit at kitware.com> wrote:

Easiest solution would be apply the transform within the reader
itself. You can easily create a vtk-level subclass for your reader
that can do that. Then this is just a reader.

Utkarsh

On Tue, Sep 21, 2010 at 9:36 PM, David Doria <daviddoria at gmail.com> wrote:
> I want to make a plugin that will read a file (which contains a
> transform) and apply it to the input of the plugin. Classically I have
> had either:
>
>  <ProxyGroup name="sources"> // for readers, lets me file->open to
> select a file
>
> or
>
>  <ProxyGroup name="filters"> // for filters, to do something to the
> selected object in the pipeline
>
> For this plugin I want to do both. Is this possible?
>
> I have attached my xml files. Could someone let me know how it needs
> to be structured to achieve this?
>
> Thanks,
>
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview




   ****      Kenneth Moreland
    ***      Sandia National Laboratories
***********
*** *** ***  email: kmorel at sandia.gov
**  ***  **  phone: (505) 844-8919
    ***      web:   http://www.cs.unm.edu/~kmorel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100922/702a374c/attachment.htm>


More information about the ParaView mailing list