[Paraview-developers] Developing interactive ParaView reader

Michael Schlottke m.schlottke at aia.rwth-aachen.de
Tue Jun 4 01:48:12 EDT 2013


Hi Utkarsh,

> Both of these can be achieved by recently added components called
> pqPropertyWidgetDecorator
> (http://paraview.org/Wiki/ParaView/Properties_Panel#pqPropertyWidgetDecorator_.28base-class:_QObject.29).

The website alone did not help much, but together with the concrete examples in ParaView-4.0.0-RC2/Examples/Plugins/PropertyWidgets I finally got both features to work. However, I am wondering if my course of action is the "right" one or if this is just a hack:
- in RequestInformation() I open the input file and check if certain data arrays are available, and set a member variable in the reader accordingly
- I also add a "int HasDataAvailable()" method to the reader, which basically returns 1/0 depending on the member variable set above
- in ServerConf.xml I add a  '<IntVectorProperty name="dataAvailable" information_only="1" command="HasDataAvailable" …>' property
- in my decorator class I query to "dataAvailable" property to check if some data-related properties should be shown or not

> Other readers already do this e.g. Xdmf reader, Exodus reader. You
> basically need to define the XML with appropriate properties and then
> expose the API on  the readers.


Thanks for the hint! With http://paraview.org/Wiki/Writing_ParaView_Readers as a guideline, and the code in ParaView-4.0.0-RC2/ParaViewCore/ServerManager/SMApplication/Resources/readers.xml, and ParaView-4.0.0-RC2/VTK/IO/Xdmf2/vtkXdmfReader.h/cxx, it took me just a little bit of trial and error to make it possible to create a list that is filled values of my choosing. With some fiddling I was also able to rename some of the methods to I could actually have two different fields populated with information from the reader input file. However, I am still not 100% clear on how it actually works - is there some documentation on the different XML tags and how they can be used (and, maybe, if there are some more types that I just do not know of yet)?

Anyhow, again, thank you very much for the quick and helpful advice!

Michael

On May 31, 2013, at 14:26 , Utkarsh Ayachit wrote:

> Michael
> 
>> 1) Change the visible options in the properties panel depending on information in the file (e.g. only show checkbox if a certain data array was found)
>> 2) Change the usable options depending on other options the user has chosen (e.g. only if he chooses to load additional data, let him use the data array selector, otherwise don't show it/grey it out)
> 
> Both of these can be achieved by recently added components called
> pqPropertyWidgetDecorator
> (http://paraview.org/Wiki/ParaView/Properties_Panel#pqPropertyWidgetDecorator_.28base-class:_QObject.29).
> 
>> 3) Populate options with information from the file (e.g. data array names to select, or a drop down list with existing hierarchy levels etc.)
> 
> Other readers already do this e.g. Xdmf reader, Exodus reader. You
> basically need to define the XML with appropriate properties and then
> expose the API on  the readers.
> 
> Utkarsh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20130604/ece0af46/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2308 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20130604/ece0af46/attachment-0001.bin>


More information about the Paraview-developers mailing list