[Paraview] How to add plug-in's parameters to ParaView state file
Hello everyone, I have developed exporter plug-in for ParaView with 50+ input parameters. At the moment, I'm setting parameters from dialog I start on menu action and preserve their values between ParaView sessions by using QSettings object. Is it possible to save these values in ParaView state files without changing ParaView main sources? Thanks, Nenad. ___ 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
Re: [Paraview] How to add plug-in's parameters to ParaView state file
Every time SaveState is called in the ParaView GUI, pqApplicationCore singleton fires a signal "stateSaved(vtkPVXMLElement*)". Your code can handle this signal to add new child XML elements to the root. Similarly, there's a stateLoadeded(...) signal that gets fired that you can handle to load the custom elements from the state xml. Utkarsh On Sun, Jan 2, 2011 at 9:04 PM, Nenad Vujicic wrote: > Hello everyone, > > I have developed exporter plug-in for ParaView with 50+ input > parameters. At the moment, I'm setting parameters from dialog I start > on menu action and preserve their values between ParaView sessions by > using QSettings object. Is it possible to save these values in > ParaView state files without changing ParaView main sources? > > Thanks, > Nenad. > ___ > 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
Re: [Paraview] How to add plug-in's parameters to ParaView state file
I have not tried this from a plug in, but I can't think of any reason why it would not work: #include "pqApplicationCore.h" #include "pqSettings.h" ... pqSettings *settings = pqApplicationCore::instance()->settings(); pqSettings is a subclass of QSettings (it adds a few methods for saving and restoring the positions of windows). The one returned by the pqApplicationCore singleton instance will point to ParaView's settings file. -Ken On 1/2/11 7:04 PM, "Nenad Vujicic" wrote: Hello everyone, I have developed exporter plug-in for ParaView with 50+ input parameters. At the moment, I'm setting parameters from dialog I start on menu action and preserve their values between ParaView sessions by using QSettings object. Is it possible to save these values in ParaView state files without changing ParaView main sources? Thanks, Nenad. ___ 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: kmo...@sandia.gov ** *** ** phone: (505) 844-8919 *** web: http://www.cs.unm.edu/~kmorel ___ 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
Re: [Paraview] How to add plug-in's parameters to ParaView state file
Dear Utkarsh, On Mon, Jan 3, 2011 at 2:30 PM, Utkarsh Ayachit wrote: > Every time SaveState is called in the ParaView GUI, pqApplicationCore > singleton fires a signal "stateSaved(vtkPVXMLElement*)". Your code can > handle this signal to add new child XML elements to the root. > Similarly, there's a stateLoadeded(...) signal that gets fired that > you can handle to load the custom elements from the state xml. > Thank You very much on Your suggestion. It works perfectly. Is there also some easy solution when working with pvpython and pvbatch clients or I should add Python parsing code to servermanager.py (servermanager::LoadState())? Thanks, Nenad. ___ 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
Re: [Paraview] How to add plug-in's parameters to ParaView state file
Nenad, The signals that pqApplication core fires are actually forwarded from vtk-events fired by the proxy manager (look at pqApplicationCore::onStateSaved/onStateLoaded). So you can add an observer to those events on the proxy manager from Python and handle them. However, you cannot really processes the arguments passed to when the event is fired in Python. One workaround would be to create a vtk-class that does the event handling and simply instantiate and initialize it in Python. Utkarsh On Mon, Jan 3, 2011 at 3:13 PM, Nenad Vujicic wrote: > Dear Utkarsh, > > On Mon, Jan 3, 2011 at 2:30 PM, Utkarsh Ayachit > wrote: >> Every time SaveState is called in the ParaView GUI, pqApplicationCore >> singleton fires a signal "stateSaved(vtkPVXMLElement*)". Your code can >> handle this signal to add new child XML elements to the root. >> Similarly, there's a stateLoadeded(...) signal that gets fired that >> you can handle to load the custom elements from the state xml. >> > > Thank You very much on Your suggestion. It works perfectly. Is there > also some easy solution when working with pvpython and pvbatch clients > or I should add Python parsing code to servermanager.py > (servermanager::LoadState())? > > Thanks, > Nenad. > ___ > 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