[Paraview] Call plugin filter from custom toolbar

Jérôme jerome.velut at gmail.com
Sun Mar 7 12:54:32 EST 2010


Hi,
here is a code-snippet I used to add a custom source to the pipeline
browser:

#####################################"
      // The objectBuilder make the view factory available
      pqObjectBuilder* builder =
pqApplicationCore::instance()->getObjectBuilder();

      // The server manager model is used for getting the server to plug the
source in.
      pqServerManagerModel* smm =
pqApplicationCore::instance()->getServerManagerModel();
      QList<pqServer*> serversList = smm->findItems<pqServer*>( );

      // I use it only on a stand-alone paraview. So I just check the
validity of the
      // built-in server, that serverList.count() != 0 and serverList[0] is
the built-in server
      // It has to be adapted for client/server systems.
      if( serversList.count() != 0 )
      {
         pqPipelineSource* pipelineSource = 0;
         pipelineSource = builder->createSource( "sources",
                                                 "MyCustomSource",
                                                 serversList[0] );
     }
#########################################

If your filter is selectable from the menu, it means that you have a valid
XML
description: the builder will do the right job. Just adapt it for a filter
rather than
a source.

HTH
Jerome


2010/3/7 Christian Werner <christian.werner at rwth-aachen.de>

> Hello!
>
> I have written some plugins for paraview and would like to make them
> accessible in a seperate toolbar. Looking around how this might work I found
> a nice example that showed how to gerenate a new custom toolbar. (
> /Examples/Plugins/GUIToolBar )
>
> There I find a function that triggers some action:
>
> void MyToolBarActions::onAction()
> {
>  QMessageBox::information(NULL, "MyAction", "MyAction was invoked\n");
> }
>
> How can I change this such that on of my plugins, say vtkMyFilter, is
> executed? Up until now I have to browse the alphabetic listing for this. I
> am using ParaView 3.6 by the way.
>
>
> Best regards,
> Christian
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100307/28c6eaff/attachment.htm>


More information about the ParaView mailing list