1 # Plugin Howto {#PluginHowto}
5 ParaView comes with plethora of functionality bundled in: several readers,
6 multitude of filters, different types of views, etc. However, it is not
7 uncommon for developers to want to add new functionality to ParaView to, for
8 example, add support to their new file format or incorporate a new filter into
9 ParaView. ParaView makes it possible to add new functionality by using an
10 extensive plugin mechanism.
12 Plugins can be used to extend ParaView in several ways:
14 * Add new readers, writers, filters
15 * Add custom GUI components such as toolbar buttons to perform common tasks
16 * Add new views in for display data
18 Examples for different types of plugins are provided with the ParaView source
19 under `Examples/Plugins/`.
21 This document has major sections:
23 * First section covers how to use existing plugins in ParaView.
24 * Second section contains information for developers about writing new
31 Plugins are distributed as shared libraries (`*.so` on Unix and macOS, and
32 `*.dll` on Windows). For a plugin to be loadable in ParaView, it must be built
33 with the same version of ParaView as it is expected to be deployed on. Plugins
34 can be classified into two broad categories:
36 * *Server-side plugins*: These are plugins that extend the algorithmic
37 capabilities for ParaView. For example, new filters, readers or writers.
38 Since ParaView processes data on the server-side, these plugins need to be
40 * *Client-side plugins*: These are plugins that extend the ParaView GUI
41 including property panels for new filters, toolbars or views. These plugins
42 need to be loaded on the client.
44 Oftentimes a plugin has both server-side as well as client-side components to
45 it. For example, a plugin that adds a new filter and a property panel that goes
46 with that filter. Such plugins need to be loaded both on the server as well as
49 Generally, users don't have to worry whether a plugin is a server-side or
50 client-side plugin. Simply load the plugin on the server as well as the client.
51 ParaView will include relevant components from plugin on each of the processes.
55 There are four ways for loading plugins:
57 * *Using the GUI* (`Plugin Manager`)
58 - Plugins can be loaded into ParaView using the `Plugin Manager` accessible
59 from the `Tools | Manage Plugins/Extensions` menu. The `Plugin Manager`
60 has two sections for loading client plugins and server plugins (shown
61 only when connected to a server). To load a plugin on the client and
62 server side, simply browse to the plugin shared library. If the plugin is
63 loaded successfully, it will appear in the list of loaded plugins. The
64 `Plugin Manager` also lists the paths it searched to load plugins
66 - The `Plugin Manager` remembers all loaded plugins across ParaView
67 instances, so once a plugin is loaded once, it will appear in the future
69 - You can set up ParaView to automatically load the plugin at startup (for
70 client plugins) or on connecting to the server (for server plugins) by
71 checking the "Auto Load" checkbox on a loaded plugin.
72 - Plugin configuration file can also be added interactively in the UI by clicking on the
73 "Add plugin configuration file". This will add plugins to the list and potentially
74 load them if they are flagged as auto load plugins. Once a plugin have been added
75 this way, it is then saved in the settings. See below for the specification.
77 
78 
80 * *Using environment variable* (Auto-loading plugins)
81 - In order to have ParaView automatically load a set of plugins on startup,
82 one can use the `PV_PLUGIN_PATH` environment variable. `PV_PLUGIN_PATH`
83 may be used to list a set of directories (separated by colon (`:`) for
84 Unix platforms or semi-colon (`;`) on Windows) which ParaView will search
85 on startup to load plugins. This environment variable needs to be set on
86 both the client and server sides to load their respective plugins. Note
87 that plugins in PV_PLUGIN_PATH are always auto-loaded irrespective of the
88 status of the `Auto Load` checkbox in the `Plugin Manager`. Paths in this
89 list may also be of the structure created by the ParaView plugin macros
90 (e.g., `MyPlugin/MyPlugin.so`).
91 - Finer control can be used using the `PV_PLUGIN_CONFIG_FILE` environment
92 variable. `PV_PLUGIN_CONFIG_FILE` can be used to list a set of XML plugin
93 configuration files (separated by colon (`:`) on Unix platforms or
94 semi-colon (`;`) on Windows). ParaView will read these files on startup
95 to load specified plugins. The XML plugin configuration file format looks
96 like this (see below for the complete specification):
101 <Plugin name="MyPlugin" filename="/absolute/path/to/libMyPlugin.so"/>
102 <!-- Note that relative paths are calculated from the directory of this XML file. -->
103 <Plugin name="MyPluginRel" filename="relative/path/to/libMyPlugin.so"/>
107 Plugins listed this way will always be loaded, irrespective of the status
108 of the `Auto Load` checkbox in the `Plugin Manager`.
109 * *Using the ParaView internal plugin configuration file `.plugins`*
110 (Make plugins available and possibly Auto-load plugins)
111 - Plugins that are listed in the `.plugins` file on the client and server
112 will automatically be listed in the `Plugin Manager`, and may optionally
113 be auto loaded. ParaView creates its own `.plugins` file listing plugins
114 known during its build and uses it as the default. An example `.plugins`
115 file, auto loading H5PartReader, looks like this (see below for the complete specification):
118 <?xml version="1.0"?>
120 <Plugin name="Moments" auto_load="0"/>
121 <Plugin name="PrismPlugin" auto_load="0"/>
122 <Plugin name="PointSprite_Plugin" auto_load="0"/>
123 <Plugin name="pvblot" auto_load="0"/>
124 <Plugin name="H5PartReader" auto_load="1"/>
128 * *Default search paths*
129 - Recognized locations are:
130 * A `plugins` subdirectory under the `paraview-X.Y` directory in the
131 library path (usually `lib` on Unix platforms and `bin` on Windows).
133 ## Delayed load plugins
135 When loading a plugin configuration file (see above), it is possible to specify certain parameters
136 that will affect how the plugin will be loaded, eg: `auto_load="1"` will load the plugin as soon as the
137 plugin configuration file is loaded.
139 It is also possible to delay the loading of plugin until they are actually needed, by first
140 only loading the XML part of a plugin and loading the actual plugin shared library file only
141 when the proxy provided by the XML is created.
143 This means that any part of the plugin that is visible to users but not described as XML, such as Qt additions,
144 will not be visible until a proxy is created.
146 This also means that the XML of the plugin must be available alongside the actual plugin and this is where the specific
147 syntax of the plugin configuration file comes into play.
149 A plugin configuration file for a delayed load plugin would look like this:
152 <?xml version="1.0"?>
154 <Plugin name="ElevationFilter" auto_load="0" delayed_load="1">
155 <XML filename="ElevationFilter/MyElevationFilter.xml"/>
160 The `XML` `filename` argument is a relative or absolute path to a XML file.
162 Such file can be automatically generated during the compilation of a ParaView plugin.
164 It would look like this in the `CMakeLists.txt` of a plugin:
167 paraview_plugin_build(
168 RUNTIME_DESTINATION "${CMAKE_INSTALL_BINDIR}"
169 LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}"
170 LIBRARY_SUBDIRECTORY "${PARAVIEW_PLUGIN_SUBDIR}"
171 PLUGINS_FILE_NAME "elev.plugins.xml"
172 DELAYED_LOAD ElevationFilter
176 The XML files are also required to be listed as `SERVER_MANAGER_XMLS` in the `paraview_plugin_add` call,
177 XML files added using `paraview_add_server_manager_xmls` are not supported.
179 ## Plugin configuration file XML Schema
181 Here is the exhaustive plugin configuration file XML schema
186 <?xml version="1.0"?>
188 <Plugin name="PluginName" filename="relative/or/absolute/path/to/plugin.ext" auto_load="bool" delayed_load="bool">
189 <XML filename="relative/or/absolute/path/to/file.xml"/>
190 <XML filename="relative/or/absolute/path/to/file2.xml"/>
195 * The `<Plugins>` tag is the root element of the document, which contains zero-to-many `<Plugin>` tags.
196 * Each `<Plugin>` tag represents a plugin to add with the following configuration:
197 * The `name` attribute (required) uniquely identifies the plugin, it is also used to find the plugin filename in directories relative to the plugin configuration file if the `filename` attribute is not provided.
198 * The `filename` attribute (optional) is a relative or absolute path to the plugin file to be loaded.
199 * The `auto_load` attribute (optional) is a boolean that control if the plugin should be loaded as soon as the plugin is added.
200 * The `delayed_load` attribute (optional) is a boolean that control if the plugin should be *actually* loaded only when needed (see above).
201 * Each `<Plugin>` tag contains zero-to-many `<XML>` tags.
202 * Each `<XML>` tag represents a XML file associated with the plugin, only used in context of `delayed_load="1"`
203 * The `filename` attribute (required) is a relative or absolute path to a the XML file to be loaded in the context of the delayed load mechanism
207 If plugin loading fails, the `PV_PLUGIN_DEBUG` environment variable may be set
208 for either the client or server processes. ParaView will then print verbose
209 information about each step and causes for failure, as show below.
212 ***************************************************
213 Attempting to load /home/utkarsh/Kitware/ParaView3/ParaView3Bin/bin/libSurfaceLIC.so
214 Loaded shared library successfully. Now trying to validate that it's a ParaView plugin.
215 Updating Shared Library Paths: /home/utkarsh/Kitware/ParaView3/ParaView3Bin/bin
216 Plugin instance located successfully. Now loading components from the plugin instance based on the interfaces it implements.
217 ----------------------------------------------------------------
224 ServerManager Plugin : Yes
230 This section covers writing and compiling different types of Plugins. To create
231 a plugin, one must have their own build of ParaView. Binaries downloaded from
232 www.paraview.org do not include necessary header files or import libraries
233 (where applicable) for compiling plugins.
235 The `CMakeLists.txt` file used in all following examples start off with the
239 # ParaView requires CMake 3.8 in order to be used.
240 cmake_minimum_required(VERSION 3.8)
241 project(myplugin C CXX)
243 find_package(ParaView REQUIRED)
246 Where CMake will ask for the `ParaView_DIR` which you point to the ParaView
247 build or install tree you would to build your with.
249 Note that the `C` and `CXX` languages are required in general because ParaView
250 may need to find other packages which are written with only C in mind (MPI is
251 the usual culprit here) and need to know about the C compiler that is
254 ## Exposing an Existing Filter
256 Sometimes, the filter that one wants to add to ParaView is already available in
257 VTK, it's just not exposed through the ParaView GUI. This is the easiest type
258 of plugin to create. There are two options:
260 1. setup the plugin using only an XML file; and
261 2. actually compile the plugin into a shared library.
263 The first option is the easiest, but the second option will prepare you for
264 creating a custom filter in the future as the process is nearly identical.
266 ## Adding a New Filter
268 It is also possible to add new filters to ParaView. The filter has to be a
269 VTK-based algorithm, written as following the standard procedures for writing
270 VTK algorithms. Generally for such cases where we are adding a new VTK class to
271 ParaView (be it a filter, reader or a writer), we need to do the following
274 * Write a *Server Manager Configuration XML* which describes the `Proxy`
275 interface for the filter. Basically, this defines the interface for the
276 client to create and modify instances of the new class on the server side.
277 Please refer to the [ParaView Guide][] for details about writing these
279 * Write a configuration XML for the GUI to make ParaView GUI aware of this
280 new class, if applicable. For filters, this is optional, since ParaView
281 automatically recognizes filters added through plugins and lists them in
282 the *Alphabetical* sub-menu. One may use the GUI configuration XML to add
283 the new filter to a specific category in the *Filters* menu, or add a new
284 category. For readers and writers, this is required since ParaView GUI
285 needs to know what extensions your reader/writer supports etc.
289 Plugins may access resources relative to themselves by using the
290 `paraview_plugin_add_location` interface to get the location of the plugin at
291 runtime. Note that this only works when built as a shared plugin. For static
292 plugins, the path will come in as a `nullptr`. If a plugin with resources
293 intends to support resources, it is recommended to use a `.qrc` file to embed
294 the resources into the plugin.
296 For installation of resources, the `_paraview_build_plugin_directory` variable
297 contains the location of the plugin under the build and install prefixes. Build
298 resources may be placed under
299 `"${CMAKE_BINARY_DIR}/${_paraview_build_plugin_directory}"` and installed with
300 `DESTINATION "${_paraview_build_plugin_directory}"`. The plugin itself belongs
301 to the `${_paraview_build_PLUGINS_COMPONENT}` component, so resources should
302 generally use a component with a related name.
308 If you have not built ParaView from source, using an XML plugin is your only
311 First, a server manager XML for the filter is required. The GUI XML to add the
312 filter to any specific category is optional.
314 For example, let's say we simply want to expose the `vtkCellDerivatives` filter
315 in VTK. Then first, we'll write the server manager configuration XML (call it
316 `CellDerivatives.xml`), similar to what we would have done for adding a new
320 <ServerManagerConfiguration>
321 <ProxyGroup name="filters">
322 <SourceProxy name="MyCellDerivatives" class="vtkCellDerivatives" label="My Cell Derivatives">
324 long_help="Create point attribute array by projecting points onto an elevation vector."
325 short_help="Create a point array representing elevation.">
329 command="SetInputConnection">
330 <ProxyGroupDomain name="groups">
331 <Group name="sources"/>
332 <Group name="filters"/>
334 <DataTypeDomain name="input_type">
335 <DataType value="vtkDataSet"/>
340 </ServerManagerConfiguration>
343 At this point, we can stop and use the plugin in ParaView by loading the XML
344 file directly into the plugin manager.
346 Please note that if you are writing the XML for a filter that takes just one
347 input, you *must* set the `name` attribute for the `InputProperty` XML element
348 to `Input`. If you do not, then the filter will not be displayed properly in
349 ParaView's pipeline browser.
351 ### Compiling into a Shared Library
353 If you have built ParaView from source, it is possible to compile the plugin
354 into into a shared library. To do this, we can use the following top-level:
358 # Standard CMake boilerplate. ParaView's `find_package` requires at least 3.8.
359 cmake_minimum_required(VERSION 3.8)
360 project(sharedlibrary)
362 # These five lines are required in order to set up installation directories
363 # (which also control build directory locations) and enable shared builds
364 # (CMake's default is for a static build).
365 include(GNUInstallDirs)
366 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
367 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
368 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
369 set(BUILD_SHARED_LIBS ON)
371 # Find ParaView. This will bring in ParaView's CMake API and imported targets.
372 find_package(ParaView REQUIRED)
374 # Scan the plugin file in order to set up internal data structures for building
376 paraview_plugin_scan(
377 # The `paraview.plugin` file describing the plugin.
378 PLUGIN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Plugin/paraview.plugin"
379 # A result variable for the (enabled) plugins found during the scan.
380 PROVIDES_PLUGINS plugins
381 # Enable plugins during this scan by default.
382 ENABLE_BY_DEFAULT ON)
384 # Build the plugins discovered during the scan.
385 paraview_plugin_build(
389 The mentioned `paraview.plugin` file describes the plugin to the build system:
395 Expose the vtkCellDerivatives class to ParaView.
397 # This module provides the `vtkCellDerivatives` filter.
401 In the `Plugin` directory (beside the `paraview.plugin` file), the plugin is
402 given the information it needs to build:
405 paraview_add_plugin(CellDerivatives
407 SERVER_MANAGER_XML CellDerivatives.xml)
410 Then using CMake, one can build a plugin for this new filter. We can now load
411 the plugin through the plugin manager by selecting the created `.so` or `.dll`
414 ### Qt resource plugins
416 Similarly compiled Qt resources (`*.bqrc`) can be loaded at runtime. A `.bqrc`
417 file is a binary file containing resources which can include icons, the GUI
418 configuration XML for adding categories, etc. A `.bqrc` can be made from a
419 `.qrc` by running the `rcc` utility provided by Qt:
422 rcc -binary -o myfile.bqrc myfile.qrc
425 ### Adding a New Filter
427 For this example, refer to `Examples/Plugins/ElevationFilter` in the ParaView
428 source. Let's say we have written a new `vtkMyElevationFilter`
429 (`vtkMyElevationFilter.{h,cxx}`), which extends the functionality of the
430 `vtkElevationFilter` and we want to package that as a plugin for ParaView. For
431 starters, we simply want to use this filter in ParaView (e.g., not doing
432 anything fancy with *Filters* menu categories). As described, we need to write
433 the server manager configuration XML (`MyElevationFilter.xml`). Once that's
434 done, we write a `CMakeLists.txt` file to package this into a plugin.
436 This `CMakeLists.txt` needs to include the following lines:
439 cmake_minimum_required(VERSION 3.8)
442 include(GNUInstallDirs)
443 set(BUILD_SHARED_LIBS ON)
445 find_package(ParaView REQUIRED)
447 paraview_plugin_scan(
448 PLUGIN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Plugin/paraview.plugin"
449 PROVIDES_PLUGINS plugins
450 ENABLE_BY_DEFAULT ON)
452 paraview_plugin_build(
456 The referenced `paraview.plugin` file contains:
462 An example paraview plugin containing server manager XML and the server
463 manager classes to build. This plugin can be loaded on the server side.
469 And the `CMakeLists.txt` file beside it contains:
472 paraview_add_plugin(ElevationFilter
474 MODULES ElevationFilters
475 MODULE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/ElevationFilters/vtk.module")
478 Because we are building our own custom filter, it needs to be a VTK module in
479 order to support having its information available to the XML code. First, the
480 module is declared in a `vtk.module` file:
491 And then the module is built with its associated server manager XML file
492 attached to the module. Note that the module name cannot be the same as the
493 plugin name due to the way the library targets are managed internally.
497 vtkMyElevationFilter)
499 # Find external packages here using `find_package`.
501 vtk_module_add_module(ElevationFilters
504 # Link to external packages here using `vtk_module_link(ElevationFilters)`.
506 paraview_add_server_manager_xmls(
507 XMLS MyElevationFilter.xml)
510 Then using CMake, one can build a plugin for this new filter. Once this plugin
511 is loaded the filter will appear under the *Alphabetical* list in the *Filters*
512 menu. Note that there will be two libraries in the resulting directory. Be sure
513 to load the `ElevationFilter` one which is the plugin, not the
514 `ElevationFilters` module library.
516 ### Filters with Multiple Input Ports
518 If a filter requires multiple input ports, there are two options:
520 1. Create helper functions in the VTK filter such as `SetYourInputName` which
521 deal with addressing the VTK pipeline in the C++ code; and
522 2. Address/access the input connection by number in the XML. The `port_index`
523 property specifies which input connection the particular input will be
524 connected to. The `SetInputConnection` function is the command that will
525 actually be called with this `port_index` to setup the pipeline.
527 An example XML file for a filter with multiple inputs is below. The filter
528 takes three `vtkPolyData` objects as input.
531 <ServerManagerConfiguration>
532 <ProxyGroup name="filters">
533 <SourceProxy name="LandmarkTransformFilter" class="vtkLandmarkTransformFilter" label="LandmarkTransformFilter">
535 long_help="Align two point sets using vtkLandmarkTransform to compute the best transformation between the two point sets."
536 short_help="vtkLandmarkTransformFilter.">
540 name="SourceLandmarks"
542 command="SetInputConnection">
543 <ProxyGroupDomain name="groups">
544 <Group name="sources"/>
545 <Group name="filters"/>
547 <DataTypeDomain name="input_type">
548 <DataType value="vtkPolyData"/>
551 Set the source data set. This data set that will move towards the target data set.
556 name="TargetLandmarks"
558 command="SetInputConnection">
559 <ProxyGroupDomain name="groups">
560 <Group name="sources"/>
561 <Group name="filters"/>
563 <DataTypeDomain name="input_type">
564 <DataType value="vtkPolyData"/>
567 Set the target data set. This data set will stay stationary.
574 command="SetInputConnection">
575 <ProxyGroupDomain name="groups">
576 <Group name="sources"/>
577 <Group name="filters"/>
579 <DataTypeDomain name="input_type">
580 <DataType value="vtkPolyData"/>
583 Set the source data set landmark points.
588 <!-- see below for what options to put here -->
593 </ServerManagerConfiguration>
596 To set the inputs in ParaView, simply select one of the inputs in the *Pipeline
597 Browser* and then select the filter from the *Filters* menu. This will open a
598 dialog box which will allow you to specify which object to connect to each
601 ### Adding *Categories* to the *Filters* Menu
603 Now suppose we want to add a new category to the *Filters* menu, called
604 *Plugin* containing an *Custom Extensions* submenu, and then show this filter in that submenu.
605 In that case we need to add a `ParaViewFilters` tag inside the root `ServerManagerConfiguration`
606 to describe categories.
608 If the name of the category is the same as an already existing category such as
609 *Data Analysis*, then the filter gets added to the existing category.
611 Otherwise a new category is created. Categories can be nested.
615 <Category name="Plugins">
616 <Category name="Extensions" menu_label="Custom Extensions">
617 <Proxy group="filters" name="MyElevationFilter" />
623 A previous method was to add a hint to the XML file that tells ParaView in which category to display this.
624 In this case, the `Hints` element of the XML file can contain:
628 <ShowInMenu category="Extensions" />
634 You can see that some filters in the *Filters* menu (e.g., *Clip*) have icons
635 associated with them. It's possible for the plugin to add icons for filters it
636 adds as well. For that you need to write a Qt resource file (say
637 `MyElevation.qrc`) as follows:
641 <qresource prefix="/MyIcons" >
642 <file>MyElevationIcon.png</file>
647 To use the icon for a filter in the pipeline add the following hint to the
652 <ShowInMenu icon=":/MyIcons/MyElevationIcon.png" />
656 Finally, the plugin's `CMakeLists.txt` file much change to include our
657 `MyElevation.qrc` file as follows:
660 paraview_add_plugin(ElevationFilter
662 MODULES ElevationFilters
663 MODULE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/ElevationFilters/vtk.module"
664 UI_RESOURCES MyElevation.qrc)
667 ### Adding GUI Parameters
669 Simply add these in the server manager XML to expose parameters of the filter
670 to the ParaView user.
674 This property appears as a button containing the text described by the value of the "name" attribute, here: "My Button".
675 When a user click on the button, a call to the command, `MyButtonClicked` is performed directly on VTK class associated with the proxy.
680 command="MyButtonClicked">
684 #### Integer Property
686 This property appears as a text box.
690 name="bStartByMatchingCentroids"
691 command="SetbStartByMatchingCentroids"
692 number_of_elements="1"
697 #### Boolean Property
699 This property appears as a check box control. A boolean property uses the
700 `IntVectorProperty` with an extra line (`BooleanDomain`) indicating this should
701 be a check box rather than a text field.
705 name="bStartByMatchingCentroids"
706 command="SetbStartByMatchingCentroids"
707 number_of_elements="1"
709 <BooleanDomain name="bool"/>
715 This property appears as a text box.
718 <StringVectorProperty
719 name="YourStringVariable"
720 command="SetYourStringVariable"
721 number_of_elements="1"
723 </StringVectorProperty>
728 This property appears as a text box.
731 <DoubleVectorProperty
732 name="YourDoubleVariable"
733 command="SetYourDoubleVariable"
734 number_of_elements="1"
736 </DoubleVectorProperty>
739 #### Multi-Value Double Property
741 This property appears as a text box.
744 <DoubleVectorProperty
745 name="YourDoubleVectorVariable"
746 command="SetYourDoubleVectorVariable"
747 number_of_elements="3"
748 default_values="1.0 0.0 0.0">
749 </DoubleVectorProperty>
752 #### Double Property Slider
754 This creates a slider that ranges from `0.0` to `1.0`.
757 <DoubleVectorProperty
758 name="PercentToRemove"
759 command="SetPercentToRemove"
760 number_of_elements="1"
761 default_values="0.1">
762 <DoubleRangeDomain name="range" min="0.0" max="1.0" />
763 </DoubleVectorProperty>
768 This creates a drop down list with 3 choices. The values associated with the
769 choices may be specified.
774 command="SetTransformMode"
775 number_of_elements="1"
777 <EnumerationDomain name="enum">
778 <Entry value="6" text="RigidBody"/>
779 <Entry value="7" text="Similarity"/>
780 <Entry value="12" text="Affine"/>
783 This property indicates which transform mode will be used.
788 #### Drop Down List with Values from Input Arrays
790 This creates a list that lets you choose among the input arrays of the input of
791 a `ProgrammableFilter`:
794 <StringVectorProperty
795 name="SelectInputScalars"
797 command="SetInputArrayToProcess"
798 number_of_elements="5"
799 element_types="0 0 0 0 2"
803 attribute_type="Scalars"
804 input_domain_name="inputs_array">
806 <Property name="Input" function="Input" />
807 </RequiredProperties>
809 </StringVectorProperty>
812 This will look like the following image:
814 
816 #### Drop Down List with Values from Input File
818 If you need to populate a list with values from a file and be able to
819 select/deselect list entries (e.g., to pick which variables are loaded from the
820 file), use a XML similar to this:
823 <StringVectorProperty information_only="1"
824 name="CellArrayInfo">
825 <ArraySelectionInformationHelper attribute_name="Cell" />
826 </StringVectorProperty>
827 <StringVectorProperty
828 command="SetCellArrayStatus"
830 information_property="CellArrayInfo"
832 name="CellArrayStatus"
833 number_of_elements="0"
834 number_of_elements_per_command="2"
836 <ArraySelectionDomain name="array_list">
838 <Property function="ArrayList"
839 name="CellArrayInfo" />
840 </RequiredProperties>
841 </ArraySelectionDomain>
843 This property lists which cell-centered arrays to read.
845 </StringVectorProperty>
848 You can see an example in use in ParaView's [core readers][] XML.
850 You may also do it in the following manner:
853 <StringVectorProperty
854 command="SetCellArrayStatus"
856 information_property="CellArrayInfo"
858 name="CellArrayStatus"
859 number_of_elements="0"
860 number_of_elements_per_command="2"
862 <ArrayListDomain name="array_list"
863 attribute_type="Scalars"
864 input_domain_name="inputs_array">
866 <Property name="Input" function="Input" />
867 </RequiredProperties>
869 </StringVectorProperty>
872 In which case the result will look like this:
874 
876 <!-- TODO: port this section
877 #### Tutorials for creating filters ====
879 Go to this page for the main article for the tutorials: [[Python Filters Tutorials]]
884 Adding a new reader through a plugin is similar to adding a filter. The only
885 difference is that we do not need to specify what category the reader should be
886 added to in the GUI. For the latest version of ParaView we do not need to
887 specify anything special for the GUI as all of the details of the reader are
888 available in the XML proxy definition of the reader. For ParaView version 4.0.1
889 and earlier we need the XML to define what file extensions this reader can
890 handle. This XML (`MyReaderGUI.xml`) looks like this:
894 <Reader name="MyPNGReader" extensions="png"
895 file_description="My PNG Files">
900 An example `MyPNGReader.xml` is shown below. In almost all cases you must have
901 a `SetFileName` function property. You are free to have other properties as
902 well, as with a standard (non-reader) filter. Also, the `Hints` section is needed
903 in order to associate the file extension with the reader on the client. The
904 `ReaderFactory` hint is what the client uses to identify readers from sources.
906 Optionally, you can provide an information property `RegistrationName` to specify the reader
907 pipeline name to use. `RegistrationName` is a feature available for any proxy, not just readers.
910 <ServerManagerConfiguration>
911 <ProxyGroup name="sources">
912 <SourceProxy name="MyPNGReader" class="vtkMyPNGReader" label="PNGReader">
914 long_help="Read a PNG file."
915 short_help="Read a PNG file.">
917 <StringVectorProperty
920 command="SetFileName"
921 number_of_elements="1">
922 <FileListDomain name="files"/>
924 This property specifies the file name for the PNG reader.
926 </StringVectorProperty>
928 <StringVectorProperty
929 name="RegistrationName"
930 number_of_elements="1"
931 default_values="MyCustomName"
932 command="GetRegistrationName"
933 panel_visibility="never"
934 information_only="1">
936 This property specify the pipeline name for the reader, using the return value of `command`.
937 If `command` attributes is not specified, it uses `default_values`.
939 </StringVectorProperty>
942 <ReaderFactory extensions="png"
943 file_description="PNG File Format" />
947 </ServerManagerConfiguration>
950 The CMake code for a reader plugin uses the same structure as the filter
951 example. The only likely difference is that the plugin should also pass
952 `REQUIRED_ON_SERVER` to `paraview_add_plugin` since the server side needs the
953 reader available for its use.
955 If you want your reader to work correctly with a file series, please refer to [[Animating legacy VTK file series#Making custom readers work with file series|file series animation]] for details.
957 Once you generate the project using CMake and compile the project, in ParaView
958 go to *Tools > Manage Plugins/Extensions*. Under *Local Plugins*, click *Load
959 New* and browse for the shared library file you just created. You should now
960 see your new file type in the *Files of type* list in the *Open file* dialog.
964 Similar to a reader plugin, for a writer plugin we need to tell ParaView what
965 extensions this writer supports. For the current version of ParaView this is
966 done in the `Hints` section of the server manager XML definition as follows:
970 <WriterFactory extensions="tif"
971 file_description="My Tiff Files" />
975 #### Adding Customizations for Properties Panel
977 <!-- TODO link to external page -->
979 [[ParaView/Properties Panel|Properties Panel]] is the primary panel in ParaView
980 used to change the parameters for visualization modules and displays. Plugins
981 can provide new types of [`pqPropertyWidget`][pqPropertyWidget] subclasses that
982 can be used to control properties/property groups on this Properties panel.
984 To register a new `pqPropertyWidget` subclass to be associated with a
985 particular widget type for a property (`vtkSMProperty`), use the following
986 CMake code in your plugin:
989 paraview_plugin_add_property_widget
991 TYPE my_property_widget_type
993 INTERFACES interfaces
996 paraview_add_plugin(propwidget
998 UI_INTERFACES ${interfaces}
1002 The `KIND` argument must be one of `WIDGET`, `GROUP_WIDGET`, or
1003 `WIDGET_DECORATOR`. For a `vtkSMProperty`, `WIDGET` is required.
1005 The `CLASS_NAME` argument must refer to a `pqPropertyWidget` subclass with a
1006 constructor with the following signature:
1009 ClassName(vtkSMProxy *smproxy, vtkSMProperty *smproperty, QWidget *parentObject)
1012 The `TYPE` argument specifies the string that will be used in the server
1013 manager XML as the value for the `panel_widget` attribute to request creation
1014 of this widget for a `vtkSMProperty` subclass.
1016 To register a new `pqPropertyWidget` subclass to be associated with a
1017 particular widget type for a property group (`vtkSMPropertyGroup`), use
1018 `GROUP_WIDGET` for the `KIND` argument. The referenced `CLASS_NAME` must
1019 subclass `pqPropertyWidget` and have a constructor with the signature:
1022 ClassName(vtkSMProxy *smproxy, vtkSMPropertyGroup *smgroup, QWidget *parentObject);
1025 As before, the `TYPE` specifies the string that will be used in the server
1026 manager XML as the value for the `panel_widget` attribute on a `PropertyGroup`
1027 element to request creation of this widget for that group.
1029 Another mechanism for adding customizations for *Properties* panel is to
1030 provide [`pqPropertyWidgetDecorator`][pqPropertyWidgetDecorator] subclasses to
1031 add custom control logic for widgets on the panel.
1033 Decorators use the `WIDGET_DECORATOR` argument to `KIND`.
1035 The `CLASS_NAME` must point to a `pqPropertyWidgetDecorator` subclass and the
1036 `TYPE` is the string name used to request the creation of the decorator in the
1037 server manager XML as described [[ParaView/Properties Panel|here]].
1039 An example for customizing the Properties panel can be found in the ParaView
1040 source under `Examples/Plugins/PropertyWidgets`.
1042 #### Adding Documentation for Plugins
1044 Developers can provide documentation for plugins that is shown in ParaView's
1045 *Help* window. There are two mechanisms for adding documentation from plugins.
1047 * Any server manager XML files added directly to the `paraview_add_plugin`
1048 function or those attached to modules passed to its `MODULES` argument
1049 using `paraview_add_server_manager_xmls` are automatically parsed to
1050 process `Documentation` elements. HTML pages summarizing the proxy and
1051 properties are automatically generated. This ensures that when the user
1052 clicks "?" for a filter or source added via the plugin, the help window
1053 shows appropriate help pages.
1054 * Using the `DOCUMENTATION_DIR` argument to `paraview_add_plugin` to specify
1055 a directory containing HTML pages and images that gets added a the
1056 documentation for the plugin (in addition to the documentation generated
1057 using the `SERVER_MANAGER_XML` files. For example:
1060 paraview_add_plugin(SurfaceLIC
1062 DOCUMENTATION_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc")
1065 This results in adding documentation to the *ParaView Online Help* when the
1066 plugin is loaded, as shown below.
1068 
1070 It is also possible to customize further the documentation with 3 additional
1073 * `DOCUMENTATION_ADD_PATTERNS`: If specified, add patterns to search for the
1074 documentation files within `DOCUMENTATION_DIR` other than the default ones
1075 (i.e. `*.html`, `*.css`, `*.png`, `*.js` and `*.jpg`). This can be used to
1076 add new file extension (ex: `*.txt`) or even subdirectories (ex:
1077 `subDir/*.*`). Subdirectory hierarchy is kept so if you store all of your
1078 images in a `img/` sub directory and if your html file is at the root level
1079 of your documentation directory, then you should reference them using
1080 `<img src="img/my_image.png"/>` in the html file.
1081 * `DOCUMENTATION_TOC`: If specified, the function will use the given string to
1082 describe the table of content for the documentation. A TOC is divided into
1083 sections. Every section points to a specific file (`ref` keyword) that is
1084 accessed when selected in the UI. A section that contains other
1085 sections can be folded into the UI. An example of such a string is:
1089 <section title="Top level section title" ref="page1.html">
1090 <section title="Page Title 1" ref="page1.html"/>
1091 <section title="Sub section Title" ref="page2.html">
1092 <section title="Page Title 2" ref="page2.html"/>
1093 <section title="Page Title 3" ref="page3.html"/>
1099 * `DOCUMENTATION_DEPENDENCIES`: Targets that are needed to be built before
1100 actually building the documentation. This can be useful when the plugin
1101 developer relies on a third party documentation generator like Doxygen for
1104 #### Adding a Toolbar
1106 Filters, reader, and writers are by far the most common ways for extending
1107 ParaView. However, ParaView plugin functionality goes far beyond that. The
1108 following sections cover some of these advanced plugins that can be written.
1110 Applications use toolbars to provide easy access to commonly used
1111 functionality. It is possible to have plugins that add new toolbars to
1112 ParaView. The plugin developer implements his own C++ code to handle the
1113 callback for each button on the toolbar. Hence one can do virtually any
1114 operation using the toolbar plugin with some understanding of the ParaView
1115 Server Manager framework and the ParaView GUI components.
1117 Please refer to `Examples/Plugins/SourceToolbar` for this section. There we are
1118 adding a toolbar with two buttons to create a sphere and a cylinder source. For
1119 adding a toolbar, one needs to implement a subclass for
1120 [`QActionGroup`][QActionGroup] which adds the [`QAction`][QAction]s for each of
1121 the toolbar button and then implements the handler for the callback when the
1122 user clicks any of the buttons. In the example `SourceToobarActions.{h,cxx}` is
1123 the `QActionGroup` subclass that adds the two tool buttons.
1125 To build the plugin, the `CMakeLists.txt` file is:
1128 # This is a macro for adding QActionGroup subclasses automatically as toolbars.
1129 paraview_plugin_add_action_group(
1130 CLASS_NAME SourceToolbarActions
1131 GROUP_NAME "ToolBar/SourceToolbar"
1132 INTERFACES interfaces
1135 # Now create a plugin for the toolbar. Here we pass the `interfaces` and
1136 # `sources` returned by the above call.
1137 paraview_add_plugin(SourceToolbar
1139 UI_INTERFACES ${interfaces}
1141 SourceToolbarActions.cxx)
1144 For the `GROUP_NAME`, we are using `ToolBar/SourceToolbar`; here `ToolBar` is a
1145 keyword which implies that the action group is a toolbar (and shows up under
1146 *View > Toolbars* menu) with the name `SourceToolbar`. When the plugin is
1147 loaded, this toolbar will show up with two buttons.
1151 Adding a menu to the menu bar of the main window is almost identical to adding
1152 a toolbar. The only difference is that you use the keyword `MenuBar` in lieu
1153 of `ToolBar` in the `GROUP_NAME` of the action group. So if you change the
1154 `paraview_plugin_add_action_group` command above to the following, the plugin
1155 will add a menu titled `MyActions` to the menu bar.
1158 paraview_plugin_add_action_group(
1159 CLASS_NAME SourceToolbarActions
1160 GROUP_NAME "MenuBar/MyActions"
1161 INTERFACES interfaces
1165 If you give the name of an existing menu, then the commands will be added to
1166 that menu rather than create a new one. So, for example, if the `GROUP_NAME`
1167 is `MenuBar/File`, the commands will be added to the bottom of the *File* menu.
1169 #### Adding a Context Menu
1171 Context menus are popup menus created when a user right-clicks inside a view
1172 (typically a render-view, but possible with any view). You can register a plugin
1173 that will create a context menu with items specific to the object underneath the
1174 cursor at the time the user right-clicks. The first instance of
1175 `pqContextMenuInterface` that returns a non-null menu is used; returning a
1176 null menu indicates the object(s) selected when the user right clicks are not
1177 relevant to your interface. For this reason, your subclass should avoid creating
1178 menus unrelated to a specific application or object type.
1180 To add a `pqContextMenuInterface` subclass to ParaView, simply pass your class
1181 name to the `UI_INTERFACES` argument of `paraview_add_plugin()` and the source,
1182 as usual, to the `SOURCES` argument:
1185 paraview_add_plugin(FancyMenu
1187 UI_INTERFACES FancyMenu
1188 SOURCES FancyMenu.h FancyMenu.cxx
1193 See the `Examples/Plugins/ContextMenu` directory for a simple example.
1195 #### Autostart Plugins
1197 This refers to a plugin which needs to be notified when ParaView starts up or
1198 the plugin is loaded which ever happens later and then notified when ParaView
1199 quits. Example is in `Examples/Plugins/Autostart` in the ParaView source. For
1200 such a plugin, we need to provide a `QObject` subclass
1201 (`pqMyApplicationStarter`) with methods that need to be called on startup and
1205 class pqMyApplicationStarter : public QObject
1209 // Callback for startup.
1210 // This cannot take any arguments
1213 // Callback for shutdown.
1214 // This cannot take any arguments
1219 The `CMakeLists.txt` looks as follows:
1222 # Macro for auto-start plugins. We specify the class name and the methods to
1223 # call on startup and shutdown on an instance of that class. It returns the
1224 # interface and sources created in the variables passed to the `INTERFACES` and
1225 # `SOURCES` arguments, respectively.
1226 paraview_plugin_add_auto_start(
1227 CLASS_NAME pqMyApplicationStarter # the class name for our class
1228 STARTUP onStartup # specify the method to call on startup
1229 SHUTDOWN onShutdown # specify the method to call on shutdown
1230 INTERFACES interfaces
1233 # Create a plugin for this starter
1234 paraview_add_plugin(Autostart
1236 UI_INTERFACES ${interfaces}
1237 SOURCES pqMyApplicationStarter.cxx ${interfaces})
1240 #### Getting the Location of a Dynamically-Loaded Plugin
1242 Some dynamically-loaded plugins include data or text files in the same
1243 directory as the plugin binary object (DLL or shared object). To locate
1244 these files at runtime, plugins can register a callback that is notified
1245 with the file system location of the plugin when it is loaded. To do this,
1246 we need to provide a `QObject` subclass (`pqMyLocationPlugin`) with a
1247 method to store the plugin location.
1250 class pqMyPluginLocation : public QObject
1254 // Callback when plugin is loaded.
1255 void StoreLocation(const char* location);
1259 The `CMakeLists.txt` looks as follows:
1262 # Macro for adding the location callback. We specify the class name and the
1263 # method to call with the filesystem location as "CLASS_NAME" and "STORE"
1264 # arguments. It returns the interface and sources created in the variables
1265 # passed to the "INTERFACES" and "SOURCES" arguments.
1266 paraview_plugin_add_location(
1267 CLASS_NAME pqMyPluginLocation # the class name for our class
1268 STORE StoreLocation # the method to call when the plugin is loaded
1269 INTERFACES interfaces
1273 #### Adding new Representations for 3D View using Plugins
1275 ParaView's 3D view the most commonly used view for showing polygonal or
1276 volumetric data. By default, ParaView provides representation-types for showing
1277 the dataset as surface, wireframe, points etc. It’s possible to add
1278 representations using plugins that extends this set of available
1279 representation types.
1281 Before we start looking at how to write such a plugin, we need to gain some
1282 understanding of the 3D view and its representations. The 3D view uses 3 basic
1283 representation proxies for rendering all types of data:
1285 * (representations, `UnstructuredGridRepresentation`) – for
1286 `vtkUnstructuredGrid` or a composite dataset consisting of
1287 `vtkUnstructuredGrid`.
1288 * (representations, `UniformGridRepresentation`) – for `vtkImageData` or a
1289 composite dataset consisting of `vtkImageData`
1290 * (representations, `GeometryRepresentation`) – for all other data types.
1292 Each of these representation proxies are basically composite representation
1293 proxies that use other representation proxies to do the actual rendering, e.g.,
1294 `GeometryRepresentation` uses `SurfaceRepresentation` for rendering the data as
1295 wireframe, points, surface, and surface-with-edges and `OutlineRepresentation`
1296 for rendering an outline for the data. Subsequently, the 3 composite
1297 representation proxies provide a property named `Representation` which allows
1298 the user to pick the representation type he wants to see the data as. The
1299 composite representation proxy has logic to enable one of its internal
1300 representations based on the type chosen by the user.
1302 These 3 composite representation types are fixed and cannot be changed by
1303 plugins. What plugins can do is add more internal representations to any of
1304 these 3 composite representations to support new representations types that the
1305 user can choose using the representation type combo box on the display tab or
1308 
1310 ##### Using a New Mapper
1312 In this example, we see how to integrate a special polydata mapper written in
1313 VTK into ParaView. Let’s say the mapper is called `vtkMySpecialPolyDataMapper`
1314 which is simply a subclass of `vtkPainterPolyDataMapper`. In practice,
1315 `vtkMySpecialPolyDataMapper` can internally use different painters to do
1316 perform special rendering tasks.
1318 To integrate this mapper into ParaView, first we need to create a
1319 `vtkSMRepresentationProxy` subclass for that uses this mapper. In this example,
1320 since the mapper is a simple replacement for the standard
1321 `vtkPainterPolyDataMapper`, we can define our representation proxy as a
1322 specialization of the `SurfaceRepresentation` as follows:
1325 <ServerManagerConfiguration>
1326 <ProxyGroup name="representations">
1327 <RepresentationProxy
1328 name="MySpecialRepresentation"
1329 class="vtkMySpecialRepresentation"
1330 processes="client|renderserver|dataserver"
1331 base_proxygroup="representations"
1332 base_proxyname="SurfaceRepresentation">
1334 This is the new representation type we are adding. This is identical to
1335 the SurfaceRepresentation except that we are overriding the mapper with
1338 </RepresentationProxy>
1340 </ServerManagerConfiguration>
1343 `vtkMySpecialRepresentation` is a subclass of
1344 `vtkGeometryRepresentationWithFaces` where in the constructor we simply
1345 override the mappers as follows:
1348 vtkMySpecialRepresentation::vtkMySpecialRepresentation()
1350 // Replace the mappers created by the superclass.
1351 this->Mapper->Delete();
1352 this->LODMapper->Delete();
1354 this->Mapper = vtkMySpecialPolyDataMapper::New();
1355 this->LODMapper = vtkMySpecialPolyDataMapper::New();
1357 // Since we replaced the mappers, we need to call SetupDefaults() to ensure
1358 // the pipelines are setup correctly.
1359 this->SetupDefaults();
1363 Next we need to register this new type with the any (or all) of the 3 standard
1364 composite representations so that it will become available to the user to
1365 choose in the representation type combo box. To decide which of the 3 composite
1366 representations we want to add our representation to, think of the input data
1367 types our representation supports. If it can support any type of data set, then
1368 we can add our representation all the 3 representations (as is the case with
1369 this example). However if we are adding a representation for volume rendering
1370 of `vtkUnstructuredGrid` then we will add it only to the
1371 `UnstructuredGridRepresentation`. This is done by using the `Extension` XML
1372 tag. It simply means that we are extending the original XML for the proxy
1373 definition with the specified additions. Now to make this representation
1374 available as a type to the user, we use the `RepresentationType` element , with
1375 `text` used as the text shown for the type in the combo-box, `subproxy`
1376 specifies the name of representation subproxy to activate when the user chooses
1377 the specified type. Optionally one can also specify the `subtype` attribute,
1378 which if present is the value set on a property named `Representation` for the
1379 subproxy when the type is chosen. This allows for the subproxy to provide more
1380 than one representation type.
1383 <ServerManagerConfiguration>
1384 <ProxyGroup name="representations">
1385 <Extension name="GeometryRepresentation">
1387 Extends standard GeometryRepresentation by adding
1388 MySpecialRepresentation as a new type of representation.
1391 <!-- this adds to what is already defined in PVRepresentationBase -->
1393 subproxy="MySpecialRepresentation"
1394 text="Special Mapper"
1398 <Proxy name="MySpecialRepresentation"
1399 proxygroup="representations"
1400 proxyname="MySpecialRepresentation">
1402 <ShareProperties subproxy="SurfaceRepresentation">
1403 <Exception name="Input" />
1404 <Exception name="Visibility" />
1405 <Exception name="Representation" />
1410 </ServerManagerConfiguration>
1413 The `CMakeLists.txt` file is not much different from what it would be like for
1414 adding a simple filter or a reader where the representation class is placed
1415 into the contained module.
1417 Source code for this example is available under
1418 `Examples/Plugins/Representation` in the ParaView source directory.
1422 The ParaView git repository contains many examples in the `Examples/Plugins`
1425 ## Adding plugins to ParaView source
1427 There are several plugins that are included in ParaView source itself and are
1428 built as part of ParaView's build process. To add such a plugin to the ParaView
1429 build there are two options, adding it to the `ParaView/Plugins` directory is
1430 currently the only supported mechanism.
1432 <!-- TODO: Restore the external plugin building process to support custom plugins in static builds.
1434 1. Place the source for the plugin in a directory under `ParaView/Plugins`.
1435 2. Add the source directory to the CMake variable
1436 `EXTRA_EXTERNAL_PLUGIN_DIRS` when building ParaView.
1438 Both approaches result in identical behavior.
1441 In general users should simply build their plugins separately, outside the
1442 ParaView source. However, when building ParaView statically, adding the plugin
1443 to be built as part of ParaView ensures that the static executables load the
1444 plugin, otherwise there is no mechanism for loading a plugin in statically
1447 In your plugin source directory, ParaView searches for a file name
1448 `paraview.plugin` which provides ParaView with information about the plugin.
1449 This file should contain the following contents:
1452 # Comments are allowed.
1456 A description of the plugin. This text is attached to the CMake option to
1459 # List of VTK modules required by the code contained in the plugin. This
1460 # allows ParaView to build the full set of requested modules if the plugin is
1465 If now the plugin is enabled (by the user or by default) by turning ON the
1466 `PARAVIEW_PLUGIN_ENABLE_PluginName` CMake option, then CMake will look for a
1467 `CMakeLists.txt` file next to the `paraview.plugin`. This file contains the
1468 calls to build the plugin including the `paraview_add_plugin` call, and
1469 building of any other libraries that the plugin needs.
1471 A good place to start would be look at examples under `ParaView/Plugins`
1474 ## Plugins in Static Applications
1476 It is possible to import plugins into a ParaView-based application at compile
1477 time. When building ParaView-based applications statically, this is the only
1478 option to bring in components from plugins. When built statically (i.e., with
1479 `BUILD_SHARED_LIBS` set to false), ParaView will automatically link and load
1480 plugins that were enabled via CMake by inserting the necessary
1481 `PV_PLUGIN_IMPORT_INIT` and `PV_PLUGIN_IMPORT` macros.
1483 The code below shows how the `PV_PLUGIN` macros would be used to statically load
1484 plugins in custom applications:
1487 #define PARAVIEW_BUILDING_PLUGIN
1488 #include "vtkPVPlugin.h"
1490 // Adds required forward declarations.
1491 PV_PLUGIN_IMPORT_INIT(MyFilterPlugin)
1492 PV_PLUGIN_IMPORT_INIT(MyReaderPlugin)
1494 class MyMainWindow : public QMainWindow
1499 MyMainWindow::MyMainWindow(...)
1501 // ... after initialization ...
1503 // Calls relevant callbacks to load the plugins and update the
1504 // GUI/Server-Manager
1505 PV_PLUGIN_IMPORT(MyFilterPlugin);
1506 PV_PLUGIN_IMPORT(MyReaderPlugin);
1512 ### *Tools > Manage Plugins* is not visible!
1514 Plugins can only be loaded dynamically when ParaView is built with shared
1515 libraries. You must recompile ParaView with `BUILD_SHARED_LIBS=ON`.
1517 ### Compile error `invalid conversion from 'vtkYourFiltersSuperClass*' to 'vtkYourFilter*'`
1519 Any VTK object that needs to be treated as a filter or source has to be a
1520 `vtkAlgorithm` subclass. The particular superclass a filter is derived from has
1521 to be given not only in the standard C++ way:
1524 class VTKMODULE_EXPORT vtkMyElevationFilter : public vtkElevationFilter
1527 but additionally declared with help of the `vtkTypeMacro`. For the example
1531 class VTKMODULE_EXPORT vtkMyElevationFilter : public vtkElevationFilter
1534 vtkTypeMacro(vtkMyElevationFilter, vtkElevationFilter);
1538 Otherwise, compiling the filter will fail with a variety of error messages
1539 (depending on superclass) like
1542 vtkMyElevationFilter.cxx:19: error: no 'void vtkMyElevationFilter::CollectRevisions(std::ostream&)'
1543 member function declared in class 'vtkMyElevationFilter'
1548 vtkMyElevationFilterClientServer.cxx:97: error: invalid conversion from ‘vtkPolyDataAlgorithm*’ to
1552 ### Mysterious Segmentation Faults in Plugins that use Custom VTK Classes
1554 This primarily concerns plugins that make calls to your own custom `vtkMy` (or
1555 whatever you called it) library of VTK extensions.
1559 * The plugin will load, but causes a segfault when you try to use it.
1560 * If you use a debugger you may notice that in some cases when your code
1561 calls `vtkClassA.MethodB`, what actually gets called is
1562 `vtkClassC.MethodD`, where `MethodB` is a virtual member function. This is
1563 occurs because of different vtable entries in the Paraview-internal
1564 versions of the VTK libraries.
1566 The solution is to make sure that your `vtkMy` library is compiled against
1567 ParaView's internal VTK libraries. Even if you compiled VTK and ParaView using
1568 the same VTK sources, you *must not* link against the external VTK libraries.
1569 (The linker won't complain, because it will find all the symbols it needs, but
1570 this leads to unexpected behaviour.)
1572 To be explicit, when compiling your `vtkMy` library, you must set the CMake
1573 variable `VTK_DIR` to point to the `VTK` subdirectory in the directory in which
1574 you built ParaView. (On my system, CMake automatically finds VTK at
1575 `/usr/lib/vtk-5.2`, and I must change `VTK_DIR` to
1576 `~/source/ParaView3/build/VTK`.)
1578 ### "Is not a valid Qt plugin" in Windows
1580 Make sure that all the DLLs that your plugin depends on are on the `PATH`. If
1581 in doubt, try placing your plugin and all its dependent DLLs in the `bin`
1582 directory of your build and load it from there.
1584 ### The system cannot find the path specified. `error MSB6006: "cmd.exe" exited with code 3.`
1586 You may get an error like this when trying to build your plugin with
1590 1> CS Wrapping - generating vtkMyElevationFilterClientServer.cxx
1591 1> The system cannot find the path specified.
1592 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3.
1593 1>Done executing task "CustomBuild" -- FAILED.
1596 This is caused for a mismatch between the configuration you used when building
1597 ParaView (e.g. Debug, Release, etc.) and the configuration currently chosen for
1598 building your plugin. So ensure those match.
1600 The problem is caused because inside the Linker properties there are references
1601 to the `*.lib` files, including the name of the directory that matches the
1602 configuration type, which may look something like
1603 `C:\Users\MyUser\ParaView-v4.2.0-build\lib\Release\vtkPVAnimation-pv4.2.lib`.
1605 ### Changing ParaView_DIR after the first configuration do not work as expected
1607 The plugin infrastructure and package finding logic do not support that as
1608 clearing the cache is not something we can reliably do as a config.cmake file.
1610 Just remove the build directory content and configure from scratch.
1612 [ParaView Guide]: http://www.kitware.com/products/books/paraview.html
1613 [core readers]: https://gitlab.kitware.com/paraview/paraview/-/blob/87babdbeab6abe20aac6f8b2692788abc6bb20ac/ParaViewCore/ServerManager/SMApplication/Resources/readers.xml#L158-179
1614 [pqPropertyWidget]: https://www.paraview.org/paraview-docs/nightly/cxx/classpqPropertyWidget.html
1615 [pqPropertyWidgetDecorator]: https://www.paraview.org/paraview-docs/nightly/cxx/classpqPropertyWidgetDecorator.html
1616 [QActionGroup]: https://doc.qt.io/qt-5/qactiongroup.html
1617 [QAction]: https://doc.qt.io/qt-5/qaction.html