Now I understand your approach.
I will first try out Takuya's suggestion. Maybe that will work. If not I will 
keep your thoughts in my mind and maybe reimplement the exporter as a 
filter/source object.

Thanks for all your help!


Am Donnerstag, 18. August 2011 um 15:06 schrieb Biddiscombe, John A.:

> Lars
>  
> I assumed you had some kind of custom panel for your exporter. If you are 
> just doing file->export, then my approach won’t be suitable.
>  
> [snip]
> > This is clear.  
> [end]
>  
> good,  
>  
> ...
> > I assume I can get *it like this:
>  
> QList<pqPipelineSource*> sources_and_filters =
> pqApplicationCore::instance()->getServerManagerModel()->findItems<pqPipelineSource*>();
>   
> ...
> yes that's the kind of thing. Sadly, I don't memorize the syntax so I'm not 
> quite sure exactly how one gets the sources, but you can look at example 
> plugins (I cut'n paste from all my others with tweaks each time for new 
> features).
>  
> But where and when do I have to call that code? Because at the moment my 
> plugin is executed by clicking on "File / Export" in ParaView, so I don't 
> have any GUI related code. Everything is on the VTK side.
> <<<
> if you had a custom panel, then you could hook into the accept method and do 
> the proxy manipulation there, just before the proxy is actually updated and 
> the writer writes.
>  
> vtkSMPropertyHelper modified(source->getProxy(), "MyNameString");
>  modified.Set(xmlName.c_str()); // or something like that
> This sets the name on the proxy.  
> <<<
>  
> yes, this sets the name on the client side of the proxy - only the local copy 
>  
>  
> then you need to push your string into the VTK class using something like
> source->getProxy()->UpdateVTKObjects()
> or UpdatePipeline (I forget the correct calls)
> But what is that doing?  
> <<<
>  
> the UpdateVTKObjects actually pushes the local client side proxy values to 
> the remote object which manages your real VTK object, the actual writer which 
> is doing stuff.
>  
> See vtkOpenSGExporter.h / .cxx on Github:  
> https://github.com/bilke/pv_opensg_plugin
>  
> Thank you very much for your help!!
> <<<
>  
> I'm afraid I have too much of my own work to do to look at your code, but 
> perhaps you're getting closer. you can create a filter with a custom panel, 
> but make your writer the filter if you follow me. then when the user clicks 
> accept, the writer will write, rather than using the drop down menu for 
> export. it may not be ideal, but it was my first idea.
>  
> JB

_______________________________________________
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

Reply via email to