<div>
<span class="Apple-style-span" style="font-size: 13px; ">Now I understand your approach.<div>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.</div><div><br></div><div>Thanks for all your help!</div></span></div><div><br></div>
<p style="color: #A0A0A8;">Am Donnerstag, 18. August 2011 um 15:06 schrieb Biddiscombe, John A.:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div>Lars<br><br>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.<br><br>[snip]<br><blockquote type="cite"><div>This is clear. <br></div></blockquote>[end]<br><br>good, <br><br>...<br><blockquote type="cite"><div>I assume I can get *it like this:<br></div></blockquote><br>QList<pqPipelineSource*> sources_and_filters =<br>pqApplicationCore::instance()->getServerManagerModel()->findItems<pqPipelineSource*>(); <br>...<br>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).<br><br><blockquote><blockquote><blockquote type="cite"><div></div></blockquote></blockquote></blockquote>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.<br><<<<br>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.<br><br><blockquote><blockquote><blockquote type="cite"><div></div></blockquote></blockquote></blockquote> vtkSMPropertyHelper modified(source->getProxy(), "MyNameString");<br> modified.Set(xmlName.c_str()); // or something like that<br>This sets the name on the proxy. <br><<<<br><br>yes, this sets the name on the client side of the proxy - only the local copy <br><br><blockquote><blockquote><blockquote type="cite"><div></div></blockquote></blockquote></blockquote>then you need to push your string into the VTK class using something like<br>source->getProxy()->UpdateVTKObjects()<br>or UpdatePipeline (I forget the correct calls)<br>But what is that doing? <br><<<<br><br>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.<br><br><blockquote><blockquote><blockquote type="cite"><div></div></blockquote></blockquote></blockquote>See vtkOpenSGExporter.h / .cxx on Github: <br><a href="https://github.com/bilke/pv_opensg_plugin">https://github.com/bilke/pv_opensg_plugin</a><br><br>Thank you very much for your help!!<br><<<<br><br>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.<br><br>JB<br></div></div></span>
</blockquote>
<div>
<br>
</div>