I want to implement my own right-click context menu and hide paraview default one in paraview plugin way.
I read some paraview source code, I found I can create similar class like pqPipelineContextMenuBehavior, However, the difficult is i want to use paraview plugin to implement it, and must keep paraview source code untouched!
My question is: is it possible to use plugin to fulfill this? How to do?
I want to have more control on context menu, like i want there are some specific menu actions when after right click.
For example, i want show information about each leaf type of a tree, how many leaves on this tree, how long of the longest tree trunk, How many trunk bifurcation points…
By the way, i also need to read each trunk from different files but into one vtkMultiBlockDataset, how can i achieve this?
I prefer c++ plugin way, however, i found each reader can only read one file, the architecture already define inside the paraview, it is impossible for me to let one reader to read multiple files…
This is a secondary answer to the earlier question about reading all the data into a single vtkMultiBlockDataSet. ParaView allows several types of files to be read in as a time series if their files have a conventional numbering (e.g. file0.vtk, file1.vtk, file2.vtk, etc.). If your file type supports this, you can read the data as a time series and then run the Group Time Steps filter to combine the data from all time steps into a single vtkMultiBlockDataSet. That tends to be a lot easier than trying to open all the files separately.
@mwestphal pretty much covered the options. The only addition I would add would be to build a python macro, which is usually my go-to solution. The only problem is that AFAIK there is no way to open the file dialog from a macro.
@sharon Context-menus via plugins are coming soon to ParaView. This post describes the mechanism being added to allow user-provided menus. It will allow plugins to omit ParaView’s menu if needed, although this may not be advisable in all cases.