Create a new plugin with custom property widget

Hi,

I would like to write a toolbar plugin. Once clicked, it will show up some custom widgets in the property panel. These custom widgets may contain some dropdown menus and text boxes to define some simulation parameters for my solver. And eventually, these parameters will be written to a run script file. This plugin does not require any input data, just a GUI to define parameters for my solver.

I have been using Paraview for a while, but I am new to writing a new plugin. I checked the existing plugins in Examples/plugin, but it seems that all of them call existing functions in Paraview. I can not find a good template to start. Any suggestions?

Thanks very much in advance!

Thanks,
Ping

Considering you are using paraview master, take a look into Examples/Plugin/PropertyWidget

1 Like

Hi Mathieu,

Thanks for your reply! I first load a mesh using a mesh reader. Then I load the PropertyWidget plugin, which essentially shrinks the mesh. Now, my question is: how can I access the functions or properties of the mesh reader from the PropertyWidget plugin? I need this capability to get the path of the loaded mesh and the names of all its boundary patches.

I guess I need to change the .cxx file of the PropertyWidget plugin, but is there an existing Paraview filter that does similar things, which I can refer to? Thanks!

Ping

You can’t.

What do you want to do exactly ?

I want to write a plugin that can do this: Users first load a mesh, e.g., in OpenFOAM format, in Paraview, then users load my filter plugin. This filter will have some custom property widgets that allow users to select a list of mesh patches/boundaries (in OpenFOAMMeshReser, this is called Mesh Regions), then users can hit a “Generate File” button to output the names of the selected patches to a file on their local disk. This file will be used later for numerical simulations.

These patches and boundaries name should be recoverable from the names of the blocks.
Can you check that, once you open your dataset with the OpenFOAM reader, the names are visible in the information widget in ParaView ?

Yes, I can see the patch names in the information widget in Paraview. How can I get these patch names from my plugin? Thanks!

You need to create a new filter that parses the multiblock structures and names and then outputs them the way you want.

1 Like