mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-12 06:20:19 +08:00
cmake: added VTK_GLOBAL_WARNING_DISPLAY option (default off) for VTK>=9 (https://github.com/introlab/rtabmap_ros/issues/1111)
This commit is contained in:
+10
-4
@@ -294,14 +294,20 @@ SET(ADD_VTK_GUI_SUPPORT_QT_TO_CONF FALSE)
|
||||
IF(WITH_QT)
|
||||
FIND_PACKAGE(VTK)
|
||||
IF(NOT VTK_FOUND)
|
||||
MESSAGE(FATAL_ERROR "VTK is required when using Qt. Set -DWITH_QT=OFF if you don't want gui tools.")
|
||||
MESSAGE(FATAL_ERROR "VTK is required when using Qt. Set -DWITH_QT=OFF if you don't want gui tools.")
|
||||
ENDIF(NOT VTK_FOUND)
|
||||
|
||||
# If Qt is here, the GUI will be built
|
||||
IF(NOT(${VTK_MAJOR_VERSION} LESS 9))
|
||||
IF(NOT VTK_QT_VERSION)
|
||||
MESSAGE(FATAL_ERROR "WITH_QT option is ON, but VTK ${VTK_MAJOR_VERSION} has not been built with Qt support, disabling Qt.")
|
||||
ENDIF()
|
||||
IF(NOT VTK_QT_VERSION)
|
||||
MESSAGE(FATAL_ERROR "WITH_QT option is ON, but VTK ${VTK_MAJOR_VERSION} has not been built with Qt support, disabling Qt.")
|
||||
ENDIF()
|
||||
|
||||
option(VTK_GLOBAL_WARNING_DISPLAY "Show VTK warning display on runtime" OFF)
|
||||
IF(NOT VTK_GLOBAL_WARNING_DISPLAY)
|
||||
ADD_DEFINITIONS(-DVTK_GLOBAL_WARNING_DISPLAY_OFF)
|
||||
ENDIF()
|
||||
|
||||
MESSAGE(STATUS "VTK>=9 detected, will use VTK_QT_VERSION=${VTK_QT_VERSION} for Qt version.")
|
||||
IF(${VTK_QT_VERSION} EQUAL 6)
|
||||
FIND_PACKAGE(Qt6 COMPONENTS Widgets Core Gui OpenGL PrintSupport QUIET OPTIONAL_COMPONENTS Svg)
|
||||
|
||||
@@ -55,9 +55,6 @@ int main(int argc, char* argv[])
|
||||
CoInitialize(nullptr);
|
||||
#endif
|
||||
|
||||
#if VTK_MAJOR_VERSION >= 8 && defined(BUILD_AS_BUNDLE)
|
||||
vtkObject::GlobalWarningDisplayOff();
|
||||
#endif
|
||||
#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1)
|
||||
// needed to ensure appropriate OpenGL context is created for VTK rendering.
|
||||
QSurfaceFormat::setDefaultFormat(QVTKRenderWidget::defaultFormat());
|
||||
|
||||
@@ -204,6 +204,10 @@ CloudViewer::CloudViewer(QWidget *parent, CloudViewerInteractorStyle * style) :
|
||||
}
|
||||
_visualizer->getRenderWindow()->SetNumberOfLayers(4);
|
||||
|
||||
#ifdef VTK_GLOBAL_WARNING_DISPLAY_OFF
|
||||
_visualizer->getRenderWindow()->GlobalWarningDisplayOff();
|
||||
#endif
|
||||
|
||||
#if VTK_MAJOR_VERSION > 8
|
||||
this->setRenderWindow(_visualizer->getRenderWindow());
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user