# Is it possible to visualize the point cloud in QVTKOpenGLWidget?

**URL:** https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534
**Category:** Support
**Created:** [May 20, 2022, 5:13am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534 "2022-05-20T05:13:59Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Panda12197](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/e480ec/32.png) [@Panda12197](https://discourse.vtk.org/u/Panda12197)
#### Post date: [May 20, 2022, 5:13am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/1 "2022-05-20T05:13:59Z")

</div>

I try to visualize the LiDAR point cloud in QVTKOpenGLWidget. In real time visualization, the program crash immediately after the widget appear.  
**Is it possible to visualize the point cloud in QVTKOpenGLWidget?**  
The main reason is that “to embed the pcl viewer in the Qt GUI and interact the viewer with mouse etc.,”.

My environment is ;

- Ubuntu 18.04
- VTK 8.2.0
- Qt Creator 5.9.5
- PCL 1.12.1

---

<div class="post-metadata">

### Author: ![hamblingreg52](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hamblingreg52/32/3220_2.png) [@hamblingreg52](https://discourse.vtk.org/u/hamblingreg52)
#### Post date: [May 21, 2022, 10:27am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/2 "2022-05-21T10:27:33Z")

</div>

Please share your initial code and then we will see what can be done about it. You need to recheck qmake as it can be the source of problem.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [May 21, 2022, 1:19pm UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/3 "2022-05-21T13:19:33Z")

</div>

Hello,

Take a look at this minimal working VTK/Qt/PCL example: [PCL Viewer with Qt GUI minimal code · GitHub](https://gist.github.com/Logrus/9988524) to have an idea of what you’re missing or doing wrong. If you’ve done everything right and if you’re building with QMake, then you may need to add these to the top of the `.cpp` files that are making VTK calls:

```cpp
#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingOpenGL2) // VTK was built with vtkRenderingOpenGL2
VTK_MODULE_INIT(vtkInteractionStyle)
VTK_MODULE_INIT(vtkRenderingFreeType)

```

regards,

Paulo

---

<div class="post-metadata">

### Author: ![Panda12197](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/e480ec/32.png) [@Panda12197](https://discourse.vtk.org/u/Panda12197)
#### Post date: [May 24, 2022, 3:46am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/4 "2022-05-24T03:46:16Z")

</div>

Hello Greg,

I am sorry for late reply. I run in Cmake. I will share my code.

**CMakeLists.txt**

```auto
cmake_minimum_required(VERSION 3.1.0)

project(gui VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

if(CMAKE_VERSION VERSION_LESS "3.7.0")
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()
#////QT5 start
find_package(Qt5 COMPONENTS Widgets Core REQUIRED)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
#///Qt ended

#////PCL
find_package(PCL 1.12 REQUIRED)
if( PCL_FOUND )
  include_directories( ${PCL_INCLUDE_DIRS} )
  add_definitions( ${PCL_DEFINITIONS} )
  link_directories( ${PCL_LIBRARY_DIRS} )
#///PCL ended

#///VTK
set(/usr/local/lib/cmake/vtk-8.2/lib)
find_package(VTK 8.2.0 REQUIRED COMPONENTS
    vtkGUISupportQt
    vtkInteractionStyle
    vtkRenderingCore
    vtkRenderingOpenGL2
)

#find_package(VTK REQUIRED)
include_directories(${VTK_INCLUDE_DIRS})
include(${VTK_USE_FILE})
#///VTK ended

find_package(Boost REQUIRED)
INCLUDE_DIRECTORIES(${BOOST_INCLUDE_DIRS})
add_executable(${PROJECT_NAME}
    mainwindow.ui
    mainwindow.cpp
    main.cpp
    )
target_link_libraries(${PROJECT_NAME} Qt5::Widgets ${EXTERNAL_LIBS} ${rs_driver_LIBRARIES} ${PCL_LIBRARIES} ${VTK_LIBRARIES} ${BOOST_LIBRARIES} vtkGUISupportQt
    vtkInteractionStyle
    vtkRenderingCore
    vtkRenderingOpenGL2
)
else()
message("PCL Not found! Can not compile rs_driver_viewer!")
endif()

install(TARGETS ${PROJECT_NAME}
        RUNTIME DESTINATION /usr/bin
)

```

The constructor is ;

```auto
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ren_= vtkSmartPointer<vtkRenderer>::New();
    renWin = vtkSmartPointer<vtkGenericOpenGLRenderWindow>::New();
    ren_->SetGradientBackground(1);
    ren_->SetBackground2(0.7, 0.7, 0.7);
    renWin -> AddRenderer(ren_.Get());
    pcl_viewer.reset(new pcl::visualization::PCLVisualizer(ren_.Get(),renWin.Get(),"viewer",false));
    ui->widget->SetRenderWindow(pcl_viewer->getRenderWindow());
    ui->widget->update();
    renWin->Render();

}

```

```auto
void MainWindow::on_lidar_btn_clicked()
{
    qDebug()<<"Clicked the button\n";
    RS_TITLE << "------------------------------------------------------" << RS_REND;
    RS_TITLE << " RS_Driver Viewer Version: v" << RSLIDAR_VERSION_MAJOR << "." << RSLIDAR_VERSION_MINOR << "."
             << RSLIDAR_VERSION_PATCH << RS_REND;
    RS_TITLE << "------------------------------------------------------" << RS_REND;
    if (sizeof(infoarray) < 2)
    {
      RS_INFOL << "Use 'rs_driver_viewer -h/--help' to check the argument menu..." << RS_REND;
    }
    if (checkKeywordExist(infosize, infoarray, "-h") || checkKeywordExist(infosize, infoarray, "--help"))
    {
      printHelpMenu();
    }

    pcl::PointCloud<pcl::PointXYZI>::Ptr pcl_pointcloud(new pcl::PointCloud<pcl::PointXYZI>);
    pcl_viewer->addPointCloud<pcl::PointXYZI>(pcl_pointcloud, "rslidar");
    qDebug()<<"initial Points"<<QString::number(pcl_pointcloud->points.size());
    pcl_viewer->setPointCloudRenderingProperties(PCL_VISUALIZER_POINT_SIZE, 1, "rslidar");

    LidarDriver<pcl::PointXYZI> driver; ///< Declare the driver object
    RSDriverParam param; ///< Create a parameter object
    parseParam(infosize,infoarray,param);
    printParam(param);
    driver.regExceptionCallback(exceptionCallback); ///< Register the exception callback function into the driver
    driver.regRecvCallback(pointCloudCallback); ///< Register the point cloud callback function into the driver

    if (!driver.init(param)) ///< Call the init function and pass the parameter
    {
      RS_ERROR << "Driver Initialize Error..." << RS_REND;
     // return -1;
    }
    driver.start(); ///< The driver thread will start

 
      while(next_point_cloud_flag==false)
        {
                  {
                        renWin->Render();
                        ui->widget->update();
                  }
          
        }
    }

```

regards,

Aye Moh

---

<div class="post-metadata">

### Author: ![Panda12197](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/e480ec/32.png) [@Panda12197](https://discourse.vtk.org/u/Panda12197)
#### Post date: [May 24, 2022, 4:31am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/5 "2022-05-24T04:31:34Z")

</div>

Hello Paulo,

I am sorry for my late reply.  
I add these three lines in .h file before. According to your suggestion, I copy at the top of the .cpp file, but the result is the same.  
When I load .pcd file (not real time point cloud) , it is loaded but the program is unexpectedly finished after mouse click and rotate for about 5 or 6 times.  
I also have a question, is it necessary to check **Module\_vtkGUISupportQtOpenGL** , when build VTK with Cmake? I got the build error when I checked this.

Bear with my English because it is not my first language either.

regards,  
Aye Moh

---

<div class="post-metadata">

### Author: ![hamblingreg52](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hamblingreg52/32/3220_2.png) [@hamblingreg52](https://discourse.vtk.org/u/hamblingreg52)
#### Post date: [May 28, 2022, 12:40pm UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/6 "2022-05-28T12:40:34Z")

</div>

@Panda12197 Hi, Have you followed the instructions given by @Paulo_Carvalho. I think they should work.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [May 29, 2022, 7:34pm UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/7 "2022-05-29T19:34:42Z")

</div>

> [@Panda12197](#):
>
> is it necessary to check **Module\_vtkGUISupportQtOpenGL** , when build VTK with Cmake?

No, I don’t use that module.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [May 29, 2022, 7:36pm UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/8 "2022-05-29T19:36:29Z")

</div>

> [@Panda12197](#):
>
> I add these three lines in .h file before.

It is not recommended to add them to header files. Only to the files that are compiled to object code (normally `.cpp`/`.cxx` files).

---

<div class="post-metadata">

### Author: ![Panda12197](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/e480ec/32.png) [@Panda12197](https://discourse.vtk.org/u/Panda12197)
#### Post date: [May 30, 2022, 7:26am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/9 "2022-05-30T07:26:34Z")

</div>

Hello Greg,

I try with the instructions given by @Paulo_Carvalho. But the result is the same.

---

<div class="post-metadata">

### Author: ![Panda12197](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/e480ec/32.png) [@Panda12197](https://discourse.vtk.org/u/Panda12197)
#### Post date: [May 30, 2022, 7:54am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/10 "2022-05-30T07:54:53Z")

</div>

Hello Paulo,

I add them to the .cpp file and run the code. But the result is the same.

I will show my code. Please check this!!  
In this program, I load .pcd file(not the real time).

**main.cpp**

```auto
int main(int argc, char *argv[])
{
    QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec();
}

```

**mainwindow.cpp**

```auto
#include "mainwindow.h"
#include "ui_mainwindow.h"

vtkSmartPointer<vtkRenderer> ren_;
vtkSmartPointer<vtkGenericOpenGLRenderWindow> renWin;
pcl::visualization::PCLVisualizer::Ptr viewer;

#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingOpenGL2)
VTK_MODULE_INIT(vtkInteractionStyle)
VTK_MODULE_INIT(vtkRenderingFreeType)

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ren_= vtkSmartPointer<vtkRenderer>::New();
    renWin = vtkSmartPointer<vtkGenericOpenGLRenderWindow>::New();
    renWin -> AddRenderer(ren_.Get());
    viewer.reset(new pcl::visualization::PCLVisualizer(ren_,renWin,"viewer",false));
    ui->widget->SetRenderWindow(viewer->getRenderWindow());
    ui->widget->update();
    renWin->Render();
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_load_btn_clicked()
{
    std::string name = "/home/gui_test/bunny.pcd";
    pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
    pcl::io::loadPCDFile(name,*cloud);
    qDebug()<<"Bunny Points"<<QString::number(cloud->points.size());
    viewer->addPointCloud<pcl::PointXYZ>(cloud,"cloud");
    viewer->resetCamera();
    ui->widget->update();
    renWin->Render();
}

```

**mainwindow.ui**

Promote QWidget to **QVTKOpenGLWidget**

When I click the load\_btn, bunny.pcd file is loaded to the widget. But the program is finished when I zoom or rotate the point cloud for about 5 times.

Now,I am using **Jetson Nano** board.  
**Is it possible that Jetson Nano is not enough for VTK and OpenGL?**

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [June 2, 2022, 3:31pm UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/11 "2022-06-02T15:31:24Z")

</div>

Hello,

> [@Panda12197](#):
>
> But the program is finished when I zoom or rotate the point cloud for about 5 times.

How many points are there in your LDAR samples? Jetson Nano is physically small but it is fairly capable of handling VTK. On the other hand, you can exhaust GPU memory even in high-end hardware if you shove too much data into the graphics card.

regards,

Paulo

---

<div class="post-metadata">

### Author: ![Panda12197](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/e480ec/32.png) [@Panda12197](https://discourse.vtk.org/u/Panda12197)
#### Post date: [June 2, 2022, 11:51pm UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/12 "2022-06-02T23:51:58Z")

</div>

Hello,  
@Paulo_Carvalho ,Thank you for your suggestion.

This sample point cloud has **397 points** and real time point cloud has **57600 points**. Now, I am testing with the bunny.pcd that has 397 point, but the program crashed. And I try the following VTK tutorials.

●[PointSource](https://kitware.github.io/vtk-examples/site/Cxx/PolyData/PointSource/) ,it render the point cloud without any error. But when I embed this render window to the Qt main window using QVTKOpenGLWidget , the program crashed after zoom or rotate the point cloud.

●I also try `vtk-8.2.0/GUISupport/Qt/Testing/Cxx/TestQVTKOpenGLWidget.cxx` and `vtk-8.2.0/GUISupport/Qt/Testing/Cxx/TestQVTKOpenGLNativeWidget.cxx` .

In TestQVTKOpenGLWidget -\>Program crashed after interacting the window for about a few seconds.  
In TestQVTKOpenGLNativeWidget → Nothing is displayed.

regards,

Aye\_Moh

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [June 3, 2022, 11:30am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/13 "2022-06-03T11:30:51Z")

</div>

Hi,

57k points is not that much. Then I suggest you to:  
a) Make sure you have the latest graphics card drivers installed;  
b) Make sure your OS is updated to the latest version;

If these don’t solve the problem, then:

c) Get the debug versions of VTK, Qt and PCL;  
d) Compile your program in debug mode;  
e) Run the program in debug mode in Qt Creator. The debugger will likely intercept the crash and stop the program at the offending instruction. Perhaps you’re using some uninitialized or null pointer.

take care,

Paulo

---

<div class="post-metadata">

### Author: ![Panda12197](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/e480ec/32.png) [@Panda12197](https://discourse.vtk.org/u/Panda12197)
#### Post date: [June 6, 2022, 4:41am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/14 "2022-06-06T04:41:56Z")

</div>

Hello,@Paulo_Carvalho

I got the debug version of VTK, Qt and PCL and compiled the program in debug mode.  
I run this [vtk-example](https://kitware.github.io/vtk-examples/site/Cxx/PolyData/PointSource/) in debug mode and there is no error. But when I embed the render window of this example into the Qt main window and run in debug mode, I got the following error.

> The inferior stopped because it received a signal from the operating system.  
> Signal name : SIGSEGV  
> Signal meaning : Segmentation fault

I also got the same error when I run the above bunny program.

regards,  
AyeMoh

---

<div class="post-metadata">

### Author: ![mau\_igna\_06](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mau_igna_06/32/8064_2.png) [@mau\_igna\_06](https://discourse.vtk.org/u/mau_igna_06)
#### Post date: [June 6, 2022, 8:29am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/15 "2022-06-06T08:29:55Z")

</div>

> [@Panda12197](#):
>
> ●[PointSource](https://kitware.github.io/vtk-examples/site/Cxx/PolyData/PointSource/) ,it render the point cloud without any error. But when I embed this render window to the Qt main window using QVTKOpenGLWidget , the program crashed after zoom or rotate the point cloud.

Have you tried with the regular standford bunny mesh? What happens then?

Also the camera maybe being set up wrong transformations that could explaing some kind of crash.

Why don’t you set up a docker with vnc an try to run your vgl application there, here is a link to get you started:

> <https://github.com/dcommander/virtualgl_docker_examples/issues/1>
>
> Dear dcommander
> 
> I tried \[this branch\](https://github.com/dcommander/virtualgl…\_docker\_examples/tree/vgl\_slicer\_turbovnc\_novnc-eglbackend) and I couldn't make it work.
> 
> \[Here\](https://discourse.slicer.org/t/using-slicer-via-vnc-virtualgl/11702/12?u=mau\_igna\_06) is how I made Slicer work inside Docker with novnc + TurboVNC + VirtualGL with EGL backend and no window manager.
> 
> Hope it is helpful for you.
> 
> Mauro

---

<div class="post-metadata">

### Author: ![Panda12197](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/e480ec/32.png) [@Panda12197](https://discourse.vtk.org/u/Panda12197)
#### Post date: [June 7, 2022, 12:25am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/16 "2022-06-07T00:25:13Z")

</div>

> [@mau\_igna\_06](#):
>
> Have you tried with the regular standford bunny mesh? What happens then?

I have not tried yet.

Now, I am trying to visualize the point cloud of 3D LiDAR in the Qt GUI using VTK (with QVTKOpenGLWidget).

---

<div class="post-metadata">

### Author: ![mau\_igna\_06](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mau_igna_06/32/8064_2.png) [@mau\_igna\_06](https://discourse.vtk.org/u/mau_igna_06)
#### Post date: [June 7, 2022, 9:24am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/17 "2022-06-07T09:24:20Z")

</div>

Also you can try your app in docker with this isntructions:

> <https://github.com/dcommander/virtualgl_docker_examples/issues/1>
>
> Dear dcommander
> 
> I tried \[this branch\](https://github.com/dcommander/virtualgl…\_docker\_examples/tree/vgl\_slicer\_turbovnc\_novnc-eglbackend) and I couldn't make it work.
> 
> \[Here\](https://discourse.slicer.org/t/using-slicer-via-vnc-virtualgl/11702/12?u=mau\_igna\_06) is how I made Slicer work inside Docker with novnc + TurboVNC + VirtualGL with EGL backend and no window manager.
> 
> Hope it is helpful for you.
> 
> Mauro

With virtual gpu accelerated rendering

---

<div class="post-metadata">

### Author: ![Panda12197](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/e480ec/32.png) [@Panda12197](https://discourse.vtk.org/u/Panda12197)
#### Post date: [June 8, 2022, 5:08am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/18 "2022-06-08T05:08:32Z")

</div>

@mau_igna_06 Thanks you for your suggestion .

> [@mau\_igna\_06](#):
>
> Also you can try your app in docker with this isntructions:

I will try.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [June 9, 2022, 9:58pm UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/19 "2022-06-09T21:58:04Z")

</div>

Hello,

Are you debugging in Qt Creator? If so, you can see the stack trace when the crash ensues. What does it read? You can also navigate through the several nested calling contexts and inspect the contents of the variables of each one.

regards,

Paulo

---

<div class="post-metadata">

### Author: ![Panda12197](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/e480ec/32.png) [@Panda12197](https://discourse.vtk.org/u/Panda12197)
#### Post date: [June 14, 2022, 12:13am UTC](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534/21 "2022-06-14T00:13:41Z")

</div>

I debug the program and I get the following stack trace.

> Generic Warning: In /home/vtk-v8.2.0/Rendering/OpenGL2/vtkOpenGLState.cxx, line 401  
> Error glClearDepth1 OpenGL errors detected  
> 0 : (1282) Invalid operation  
> with stack trace of  
> 0x7fb504536c : vtksys::SystemInformationImplementation::GetProgramStack[abi:cxx11](int, int) [(libvtksys-8.2.so.1) ???:-1]  
> 0x7fb503fe44 : vtksys::SystemInformation::GetProgramStack[abi:cxx11](int, int) [(libvtksys-8.2.so.1) ???:-1]  
> 0x7fb685b1ec : ??? [(???) ???:-1]  
> 0x7fb685ba0c : vtkOpenGLState::vtkglClearDepth(double) [(libvtkRenderingOpenGL2-8.2.so.1) ???:-1]  
> 0x7fb68445dc : vtkOpenGLRenderer::Clear() [(libvtkRenderingOpenGL2-8.2.so.1) ???:-1]  
> 0x7fb678a850 : vtkOpenGLCamera::Render(vtkRenderer\*) [(libvtkRenderingOpenGL2-8.2.so.1) ???:-1]  
> 0x7fb632ebc0 : vtkRenderer::UpdateCamera() [(libvtkRenderingCore-8.2.so.1) ???:-1]  
> 0x7fb68424f0 : vtkOpenGLRenderer::DeviceRender() [(libvtkRenderingOpenGL2-8.2.so.1) ???:-1]  
> 0x7fb632e540 : vtkRenderer::Render() [(libvtkRenderingCore-8.2.so.1) ???:-1]  
> 0x7fb632bc58 : vtkRendererCollection::Render() [(libvtkRenderingCore-8.2.so.1) ???:-1]  
> 0x7fb6349704 : vtkRenderWindow::DoStereoRender() [(libvtkRenderingCore-8.2.so.1) ???:-1]  
> 0x7fb63494fc : vtkRenderWindow::Render() [(libvtkRenderingCore-8.2.so.1) ???:-1]  
> 0x7fb683e390 : vtkOpenGLRenderWindow::Render() [(libvtkRenderingOpenGL2-8.2.so.1) ???:-1]  
> 0x7fb6775014 : vtkGenericOpenGLRenderWindow::Render() [(libvtkRenderingOpenGL2-8.2.so.1) ???:-1]  
> 0x7fb63569a0 : vtkRenderWindowInteractor::Render() [(libvtkRenderingCore-8.2.so.1) ???:-1]  
> 0x7fb65ba148 : vtkInteractorStyleTrackballCamera::Rotate() [(libvtkInteractionStyle-8.2.so.1) ???:-1]  
> 0x7fb65b9690 : vtkInteractorStyleTrackballCamera::OnMouseMove() [(libvtkInteractionStyle-8.2.so.1) ???:-1]  
> 0x7fb65b05f0 : vtkInteractorStyleRubberBandPick::OnMouseMove() [(libvtkInteractionStyle-8.2.so.1) ???:-1]  
> 0x7fb7e119d8 : pcl::visualization::PCLVisualizerInteractorStyle::OnMouseMove() [(libpcl\_visualization.so.1.12) ???:-1]  
> 0x7fb63bb024 : vtkInteractorStyle::ProcessEvents(vtkObject\*, unsigned long, void\*, void\*) [(libvtkRenderingCore-8.2.so.1) ???:-1]  
> 0x7fb545f564 : vtkCallbackCommand::Execute(vtkObject\*, unsigned long, void\*) [(libvtkCommonCore-8.2.so.1) ???:-1]  
> 0x7fb56abbdc : ??? [(???) ???:-1]  
> 0x7fb56ac31c : vtkObject::InvokeEvent(unsigned long, void\*) [(libvtkCommonCore-8.2.so.1) ???:-1]  
> 0x7fb79b5870 : QVTKInteractorAdapter::ProcessEvent(QEvent\*, vtkRenderWindowInteractor\*) [(libvtkGUISupportQt-8.2.so.1) ???:-1]  
> 0x7fb79e07d0 : QVTKOpenGLWindow::ProcessEvent(QEvent\*) [(libvtkGUISupportQt-8.2.so.1) ???:-1]  
> 0x7fb79e062c : QVTKOpenGLWindow::mouseMoveEvent(QMouseEvent\*) [(libvtkGUISupportQt-8.2.so.1) ???:-1]  
> 0x7fb704ece8 : QWindow::event(QEvent\*) [(libQt5Gui.so.5) ???:-1]

In debugger;

> 1 ??  
> 2 vtkOpenGLRenderTimer::ReusableStart vtkOpenGLRenderTimer.cxx 292 0x7fb682a644  
> 3 vtkOpenGLPolyDataMapper::RenderPieceStart vtkOpenGLPolyDataMapper.cxx 2434 0x7fb680320c  
> 4 vtkOpenGLPolyDataMapper::RenderPiece vtkOpenGLPolyDataMapper.cxx 2629 0x7fb6803c40  
> 5 vtkPolyDataMapper::Render vtkPolyDataMapper.cxx 68 0x7fb6312cc0  
> 6 vtkDataSetMapper::Render vtkDataSetMapper.cxx 159 0x7fb625e404  
> 7 vtkOpenGLActor::Render vtkOpenGLActor.cxx 105 0x7fb67838e8  
> 8 vtkLODActor::Render vtkLODActor.cxx 187 0x7fb488b7a4  
> 9 vtkLODActor::RenderOpaqueGeometry vtkLODActor.cxx 226 0x7fb488b99c  
> 10 vtkRenderer::UpdateOpaquePolygonalGeometry vtkRenderer.cxx 742 0x7fb632fb20  
> 11 vtkRenderer::DeviceRenderOpaqueGeometry vtkRenderer.cxx 431 0x7fb632e908  
> 12 vtkOpenGLRenderer::DeviceRenderOpaqueGeometry vtkOpenGLRenderer.cxx 433 0x7fb68437f0  
> 13 vtkOpenGLRenderer::UpdateGeometry vtkOpenGLRenderer.cxx 322 0x7fb6842e20  
> 14 vtkOpenGLRenderer::DeviceRender vtkOpenGLRenderer.cxx 234 0x7fb684253c  
> 15 vtkRenderer::Render vtkRenderer.cxx 371 0x7fb632e540  
> 16 vtkRendererCollection::Render vtkRendererCollection.cxx 51 0x7fb632bc58  
> 17 vtkRenderWindow::DoStereoRender vtkRenderWindow.cxx 330 0x7fb6349704  
> 18 vtkRenderWindow::Render vtkRenderWindow.cxx 291 0x7fb63494fc  
> 19 vtkOpenGLRenderWindow::Render vtkOpenGLRenderWindow.cxx 2564 0x7fb683e390  
> 20 vtkGenericOpenGLRenderWindow::Render vtkGenericOpenGLRenderWindow.cxx 242 0x7fb6775014  
> 21 vtkRenderWindowInteractor::Render vtkRenderWindowInteractor.cxx 185 0x7fb63569a0  
> 22 vtkInteractorStyleTrackballCamera::Rotate vtkInteractorStyleTrackballCamera.cxx 264 0x7fb65ba148  
> 23 vtkInteractorStyleTrackballCamera::OnMouseMove vtkInteractorStyleTrackballCamera.cxx 46 0x7fb65b9690  
> 24 vtkInteractorStyleRubberBandPick::OnMouseMove vtkInteractorStyleRubberBandPick.cxx 131 0x7fb65b05f0  
> 25 pcl::visualization::PCLVisualizerInteractorStyle::OnMouseMove interactor\_style.cpp 1312 0x7fb7e119d8  
> 26 vtkInteractorStyle::ProcessEvents vtkInteractorStyle.cxx 1081 0x7fb63bb024  
> 27 vtkCallbackCommand::Execute vtkCallbackCommand.cxx 42 0x7fb545f564  
> 28 vtkSubjectHelper::InvokeEvent vtkObject.cxx 569 0x7fb56abbdc  
> 29 vtkObject::InvokeEvent vtkObject.cxx 785 0x7fb56ac31c  
> 30 QVTKInteractorAdapter::ProcessEvent QVTKInteractorAdapter.cxx 147 0x7fb79b5870  
> 31 QVTKOpenGLWindow::ProcessEvent QVTKOpenGLWindow.cxx 452 0x7fb79e07d0  
> 32 QVTKOpenGLWindow::mouseMoveEvent QVTKOpenGLWindow.cxx 408 0x7fb79e062c  
> 33 QWindow::event(QEvent \*) 0x7fb704ece8  
> 34 QPaintDeviceWindow::event(QEvent \*) 0x7fb7078798  
> 35 QVTKOpenGLWindow::event QVTKOpenGLWindow.cxx 384 0x7fb79e052c 0x1

regards,

Aye Moh

[Next page](https://discourse.vtk.org/t/is-it-possible-to-visualize-the-point-cloud-in-qvtkopenglwidget/8534.md?page=2)
