# Writing LidarView plugin

**URL:** https://discourse.paraview.org/t/writing-lidarview-plugin/11449
**Category:** LidarView, Lidar, and SLAM
**Created:** [February 20, 2023, 2:04pm UTC](https://discourse.paraview.org/t/writing-lidarview-plugin/11449 "2023-02-20T14:04:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![land\_mn](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/f17d59/32.png) [@land\_mn](https://discourse.paraview.org/u/land_mn)
#### Post date: [February 20, 2023, 2:04pm UTC](https://discourse.paraview.org/t/writing-lidarview-plugin/11449/1 "2023-02-20T14:04:56Z")

</div>

Hi,

I successfully wrote a LidarView plugin (in Windows) by following the structure of the current plugins.

Still, I have a few issues that can make my further work easier.

1. The structure of the plugin is complex, something like this:

```auto
(LidarView_source_root)
  Plugins
    1st_lvl_plugin_dir
      CMakeLists.txt
      Plugin
        CMakeLists.txt
        paraview.plugin
        3rd_lvl_plugin_dir
                CMakeLists.txt
          vtk.module
          4th_lvl_plugin_dir(s)
            *.cxx
            *.h
            (other source file)

```

Is this essential? Are all files needed? Or can it be simpler?

1. Where is the right place to add “include directories” and how?

Specifically - I want to add include paths to: lqHelper.h from LVCore and pqApplicationCore.h from ParaView. Could these be referred to by a predefined CMake variable?

1. To make the plugin compile I had to manually edit the CMake files of Paraview. Is there a proper way to pass variables to Paraview build from LidarView’s cmake configuration\command?
2. About the newly released Lidarview version, I can’t find an offline installer for Qt 5.15.7 either in the url you mentioned in the **LidarView\_Developer\_Guide.md** , nor on the Qt site. Building this version of Qt from source code gave a directory structure that is difficult to include.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 20, 2023, 2:11pm UTC](https://discourse.paraview.org/t/writing-lidarview-plugin/11449/2 "2023-02-20T14:11:51Z")

</div>

@Gatien_Ferret @Timothee_Couble

---

<div class="post-metadata">

### Author: ![Timothee\_Couble](https://discourse.paraview.org/user_avatar/discourse.paraview.org/timothee_couble/32/9790_2.png) [@Timothee\_Couble](https://discourse.paraview.org/u/Timothee_Couble)
#### Post date: [February 22, 2023, 5:05pm UTC](https://discourse.paraview.org/t/writing-lidarview-plugin/11449/3 "2023-02-22T17:05:16Z")

</div>

Hi @land_mn,

> [@land\_mn](#):
>
> The structure of the plugin is complex, something like this:

I think the only essential directory are the `2nd_lvl_plugin_dir` and `3rd_lvl_plugin_dir` as `paraview.plugin` and `vtk.module` file will check for associated `CMakeLists.txt`. This structure is generally the one used to add a plugin in ParaView and LidarView. If you want to remove one one level it would be the `4th_lvl_plugin_dir`.

> [@land\_mn](#):
>
> Where is the right place to add “include directories” and how

Theses files are only available on paraview and lidarview plugin side (not in the vtk module), you can checkout [here](https://gitlab.kitware.com/paraview/paraview/-/tree/master/Examples/Plugins/ComplexPluginArchitecture) for an example that uses vtk module and add a qt component. (There a lot of plugin example in the ParaView [Examples/Plugins](https://gitlab.kitware.com/paraview/paraview/-/tree/master/Examples/Plugins) directory)

> [@land\_mn](#):
>
> To make the plugin compile I had to manually edit the CMake files of Paraview. Is there a proper way to pass variables to Paraview build from LidarView’s cmake configuration\command?

You should be able to compile your plugin with LidarView by copying [VelodynePlugin CMakeList](https://gitlab.kitware.com/LidarView/velodyneplugin/-/blob/releasev5.1.0/CMakeLists.txt), changes the name and a `add_subdirectory(Plugins/YourPlugin)` in LidarView root `CMakeLists.txt`.

> [@land\_mn](#):
>
> About the newly released Lidarview version

I just added a documentation about how to install qt5 [here](https://gitlab.kitware.com/LidarView/lidarview-superbuild/-/blob/master/Documentation/install_qt.md) with the correct links.

Let met know if you have any other questions.
