mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 06:28:00 +08:00
[vtk|opencv4|openimageio] Switch to Qt6 (#29078)
* Switch stuff to Qt6 * give opencv4 the correct deps * add Qt5Compat to find_dependency * refine vtk deps and promote targets to global * fix dep * ci is probably faster than my desktop pc building. * remove invalid patch part * add qt6 patch * second patch * make openimageio ignore qt5 * [skip actions] qt6 part 3 * vtk qt6 patch * try openimageio again * move gl include * fix patch * does it work now? * remove qualified name * more qt6 fixes * more patches * update and fix rtabmap * gles feature in qtbase needs to be disabled for vtk since vtk assumes desktop opengl * remove patch add error if qtbase was build with gles2 * disable also second patch * fix theia * paraview consolidate patches * fix case issue * fix missing , * add more qt6 changes * remove unnecessary patches * bump port version * remove comments from vtk * add platform features for tools. * fix format * bump ports * another one to bump * v db Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
parent
c18618a4eb
commit
46dda5372b
@ -1,7 +1,7 @@
|
||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/vcpkg.json" _contents)
|
||||
string(JSON OPENCV_VERSION GET "${_contents}" version)
|
||||
|
||||
set(USE_QT_VERSION "5")
|
||||
set(USE_QT_VERSION "6")
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
@ -525,7 +525,7 @@ find_dependency(Tesseract)")
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
find_dependency(Qt${USE_QT_VERSION} COMPONENTS Core Gui Widgets Test Concurrent)")
|
||||
find_dependency(Qt${USE_QT_VERSION} COMPONENTS Core Gui Widgets Test Concurrent Core5Compat)")
|
||||
if("opengl" IN_LIST FEATURES)
|
||||
string(APPEND DEPS_STRING "
|
||||
find_dependency(Qt${USE_QT_VERSION} COMPONENTS OpenGL)")
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "opencv4",
|
||||
"version": "4.7.0",
|
||||
"port-version": 1,
|
||||
"port-version": 2,
|
||||
"description": "computer vision library",
|
||||
"homepage": "https://github.com/opencv/opencv",
|
||||
"license": "Apache-2.0",
|
||||
@ -252,9 +252,16 @@
|
||||
"qt": {
|
||||
"description": "Qt GUI support for opencv",
|
||||
"dependencies": [
|
||||
"qt5compat",
|
||||
{
|
||||
"name": "qt5-base",
|
||||
"default-features": false
|
||||
"name": "qtbase",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"concurrent",
|
||||
"gui",
|
||||
"testlib",
|
||||
"widgets"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
36
ports/openimageio/more_qt6.patch
Normal file
36
ports/openimageio/more_qt6.patch
Normal file
@ -0,0 +1,36 @@
|
||||
diff --git a/src/iv/imageviewer.cpp b/src/iv/imageviewer.cpp
|
||||
index 79839dd5a..f49da67c0 100644
|
||||
--- a/src/iv/imageviewer.cpp
|
||||
+++ b/src/iv/imageviewer.cpp
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#include <QApplication>
|
||||
#include <QComboBox>
|
||||
-#include <QDesktopWidget>
|
||||
#include <QFileDialog>
|
||||
#include <QKeyEvent>
|
||||
#include <QLabel>
|
||||
@@ -1951,8 +1951,8 @@ ImageViewer::fitWindowToImage(bool zoomok, bool minsize)
|
||||
}
|
||||
|
||||
if (!m_fullscreen) {
|
||||
- QDesktopWidget* desktop = QApplication::desktop();
|
||||
- QRect availgeom = desktop->availableGeometry(this);
|
||||
+ auto desktop = this->screen();
|
||||
+ QRect availgeom = desktop->availableGeometry();
|
||||
int availwidth = availgeom.width() - extraw - 20;
|
||||
int availheight = availgeom.height() - extrah - menuBar()->height()
|
||||
- 20;
|
||||
diff --git a/src/iv/ivgl.cpp b/src/iv/ivgl.cpp
|
||||
index 2551d02ae..890bb4d92 100644
|
||||
--- a/src/iv/ivgl.cpp
|
||||
+++ b/src/iv/ivgl.cpp
|
||||
@@ -11,6 +11,8 @@
|
||||
#include <QLabel>
|
||||
#include <QMouseEvent>
|
||||
#include <QProgressBar>
|
||||
+#include <QPainter>
|
||||
+#include <QPen>
|
||||
|
||||
#include "ivutils.h"
|
||||
#include <OpenImageIO/strutil.h>
|
@ -13,6 +13,8 @@ vcpkg_from_github(
|
||||
imath-version-guard.patch
|
||||
fix-openimageio_include_dir.patch
|
||||
fix-vs2019-encoding-conversion.patch
|
||||
qt6.patch
|
||||
more_qt6.patch
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/ext")
|
||||
@ -43,7 +45,6 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
tools OIIO_BUILD_TOOLS
|
||||
tools USE_OPENGL
|
||||
tools USE_QT
|
||||
tools USE_QT5
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
|
65
ports/openimageio/qt6.patch
Normal file
65
ports/openimageio/qt6.patch
Normal file
@ -0,0 +1,65 @@
|
||||
diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake
|
||||
index 8131672..7a6455e 100644
|
||||
--- a/src/cmake/externalpackages.cmake
|
||||
+++ b/src/cmake/externalpackages.cmake
|
||||
@@ -264,15 +264,15 @@ checked_find_package (Nuke)
|
||||
checked_find_package (OpenGL) # used for iv
|
||||
|
||||
# Qt -- used for iv
|
||||
-set (qt5_modules Core Gui Widgets)
|
||||
+set (qt6_modules Core Gui Widgets)
|
||||
if (OPENGL_FOUND)
|
||||
- list (APPEND qt5_modules OpenGL)
|
||||
+ list (APPEND qt6_modules OpenGL OpenGLWidgets)
|
||||
endif ()
|
||||
option (USE_QT "Use Qt if found" ON)
|
||||
-checked_find_package (Qt5 COMPONENTS ${qt5_modules})
|
||||
-if (USE_QT AND NOT Qt5_FOUND AND APPLE)
|
||||
- message (STATUS " If you think you installed qt5 with Homebrew and it still doesn't work,")
|
||||
- message (STATUS " try: export PATH=/usr/local/opt/qt5/bin:$PATH")
|
||||
+checked_find_package (Qt6 COMPONENTS ${qt6_modules})
|
||||
+if (USE_QT AND NOT Qt6_FOUND AND APPLE)
|
||||
+ message (STATUS " If you think you installed qt6 with Homebrew and it still doesn't work,")
|
||||
+ message (STATUS " try: export PATH=/usr/local/opt/qt6/bin:$PATH")
|
||||
endif ()
|
||||
|
||||
|
||||
diff --git a/src/iv/CMakeLists.txt b/src/iv/CMakeLists.txt
|
||||
index 88a2151..cbc4a54 100644
|
||||
--- a/src/iv/CMakeLists.txt
|
||||
+++ b/src/iv/CMakeLists.txt
|
||||
@@ -3,18 +3,18 @@
|
||||
# https://github.com/OpenImageIO/oiio
|
||||
|
||||
set (CMAKE_AUTOMOC ON)
|
||||
-if (Qt5_POSITION_INDEPENDENT_CODE)
|
||||
+if (Qt6_POSITION_INDEPENDENT_CODE)
|
||||
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
check_is_enabled (iv iv_enabled)
|
||||
-if (iv_enabled AND Qt5_FOUND AND OPENGL_FOUND)
|
||||
+if (iv_enabled AND Qt6_FOUND AND OPENGL_FOUND)
|
||||
fancy_add_executable (
|
||||
SYSTEM_INCLUDE_DIRS
|
||||
${OPENGL_INCLUDE_DIR}
|
||||
LINK_LIBRARIES
|
||||
OpenImageIO
|
||||
- Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL
|
||||
+ Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets
|
||||
${OPENGL_LIBRARIES}
|
||||
)
|
||||
if (iv_enabled AND FORCE_OPENGL_1)
|
||||
diff --git a/src/iv/imageviewer.h b/src/iv/imageviewer.h
|
||||
index f20b79a..ca67b52 100644
|
||||
--- a/src/iv/imageviewer.h
|
||||
+++ b/src/iv/imageviewer.h
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <QAction>
|
||||
#include <QCheckBox>
|
||||
#include <QDialog>
|
||||
-#include <QGLWidget>
|
||||
+#include <QOpenGLWidget>
|
||||
#include <QMainWindow>
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "openimageio",
|
||||
"version": "2.4.5.0",
|
||||
"port-version": 2,
|
||||
"port-version": 3,
|
||||
"description": "A library for reading and writing images, and a bunch of related classes, utilities, and application.",
|
||||
"homepage": "https://github.com/OpenImageIO/oiio",
|
||||
"license": "BSD-3-Clause",
|
||||
@ -103,7 +103,7 @@
|
||||
"dependencies": [
|
||||
"opengl",
|
||||
{
|
||||
"name": "qt5-base",
|
||||
"name": "qtbase",
|
||||
"default-features": false
|
||||
}
|
||||
]
|
||||
|
506
ports/paraview/53.diff
Normal file
506
ports/paraview/53.diff
Normal file
@ -0,0 +1,506 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index b3c91500041421328fde0821ef6876c78eef55d6..b4157a3d53407b536b3694b12faa3ed7794fb4c5 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,27 +1,20 @@
|
||||
-if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
- CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
|
||||
-endif ()
|
||||
+CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
|
||||
|
||||
PROJECT(QtTesting)
|
||||
|
||||
IF(NOT DEFINED QtTesting_QT_VERSION)
|
||||
- SET(QtTesting_QT_VERSION "4" CACHE STRING "Expected Qt version")
|
||||
+ SET(QtTesting_QT_VERSION "5" CACHE STRING "Expected Qt version")
|
||||
MARK_AS_ADVANCED(QtTesting_QT_VERSION)
|
||||
- SET_PROPERTY(CACHE QtTesting_QT_VERSION PROPERTY STRINGS 4 5)
|
||||
+ SET_PROPERTY(CACHE QtTesting_QT_VERSION PROPERTY STRINGS 5 6)
|
||||
ENDIF()
|
||||
-IF(NOT (QtTesting_QT_VERSION VERSION_EQUAL "4" OR
|
||||
- QtTesting_QT_VERSION VERSION_EQUAL "5"))
|
||||
- message(FATAL_ERROR "Expected value for QtTesting_QT_VERSION is either '4' or '5'")
|
||||
+IF(NOT (QtTesting_QT_VERSION VERSION_EQUAL "5" OR
|
||||
+ QtTesting_QT_VERSION VERSION_EQUAL "6"))
|
||||
+ message(FATAL_ERROR "Expected value for QtTesting_QT_VERSION is either '5' or '6'")
|
||||
ENDIF()
|
||||
|
||||
set(qt_imported_targets)
|
||||
-IF(QtTesting_QT_VERSION VERSION_GREATER "4")
|
||||
- FIND_PACKAGE(Qt5 REQUIRED COMPONENTS Core Widgets)
|
||||
- SET(qt_imported_targets Qt5::Core Qt5::Widgets)
|
||||
-ELSE()
|
||||
- FIND_PACKAGE(Qt4 REQUIRED COMPONENTS QtGui)
|
||||
- SET(qt_imported_targets Qt4::QtCore Qt4::QtGui)
|
||||
-ENDIF()
|
||||
+FIND_PACKAGE(Qt${QtTesting_QT_VERSION} REQUIRED COMPONENTS Core Widgets)
|
||||
+SET(qt_imported_targets Qt${QtTesting_QT_VERSION}::Core Qt${QtTesting_QT_VERSION}::Widgets)
|
||||
|
||||
IF(NOT DEFINED QT_TESTING_WITH_PYTHON)
|
||||
OPTION(QT_TESTING_WITH_PYTHON "Enable Qt Testing with Python" OFF)
|
||||
diff --git a/Testing/CMake/qtTestingMacroGenerateMocs.cmake b/Testing/CMake/qtTestingMacroGenerateMocs.cmake
|
||||
index 4b1f34a4fa5d7e7effb63ae49518e75c47e2598c..953e7402bc269cf3af41914945b194348cfc428a 100644
|
||||
--- a/Testing/CMake/qtTestingMacroGenerateMocs.cmake
|
||||
+++ b/Testing/CMake/qtTestingMacroGenerateMocs.cmake
|
||||
@@ -19,3 +19,13 @@ macro(QT5_GENERATE_MOCS)
|
||||
OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${moc_file})
|
||||
endforeach()
|
||||
endmacro()
|
||||
+
|
||||
+
|
||||
+macro(QT6_GENERATE_MOCS)
|
||||
+ foreach(file ${ARGN})
|
||||
+ set(moc_file moc_${file})
|
||||
+ QT_GENERATE_MOC(${file} ${moc_file})
|
||||
+ set_property(SOURCE ${file} APPEND PROPERTY
|
||||
+ OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${moc_file})
|
||||
+ endforeach()
|
||||
+endmacro()
|
||||
diff --git a/Testing/Cpp/CMakeLists.txt b/Testing/Cpp/CMakeLists.txt
|
||||
index fed244434f888af3ba2f4b50609f94d08eebd47b..31e629c990290bb5d4fce52005c1781aebdf3b5a 100644
|
||||
--- a/Testing/Cpp/CMakeLists.txt
|
||||
+++ b/Testing/Cpp/CMakeLists.txt
|
||||
@@ -1,6 +1,9 @@
|
||||
include(../CMake/qtTestingMacroGenerateMocs.cmake)
|
||||
|
||||
-IF(QtTesting_QT_VERSION VERSION_GREATER "4")
|
||||
+IF(QtTesting_QT_VERSION VERSION_GREATER "5")
|
||||
+ FIND_PACKAGE(Qt6 REQUIRED QUIET COMPONENTS Test)
|
||||
+ SET(TEST_LIBRARIES Qt6::Test)
|
||||
+ELSEIF(QtTesting_QT_VERSION VERSION_GREATER "4")
|
||||
FIND_PACKAGE(Qt5 REQUIRED QUIET COMPONENTS Test)
|
||||
SET(TEST_LIBRARIES Qt5::Test)
|
||||
ELSE()
|
||||
@@ -38,7 +41,10 @@ include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
-if(QtTesting_QT_VERSION VERSION_GREATER "4")
|
||||
+if(QtTesting_QT_VERSION VERSION_GREATER "5")
|
||||
+ QT6_GENERATE_MOCS(${TEST_SOURCES})
|
||||
+ QT6_WRAP_CPP( TEST_MOC_SRCS ${TEST_MOC_HEADERS} )
|
||||
+elseif(QtTesting_QT_VERSION VERSION_GREATER "4")
|
||||
QT5_GENERATE_MOCS(${TEST_SOURCES})
|
||||
QT5_WRAP_CPP( TEST_MOC_SRCS ${TEST_MOC_HEADERS} )
|
||||
else()
|
||||
diff --git a/pq3DViewEventPlayer.cxx b/pq3DViewEventPlayer.cxx
|
||||
index 5be26b88d394ee82543b039e2173f7624e960808..3ec526a9033328cc924f02dd4c0ba21f30b9a7de 100644
|
||||
--- a/pq3DViewEventPlayer.cxx
|
||||
+++ b/pq3DViewEventPlayer.cxx
|
||||
@@ -35,7 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QApplication>
|
||||
#include <QKeyEvent>
|
||||
#include <QMouseEvent>
|
||||
-#include <QRegExp>
|
||||
+#include <QRegularExpression>
|
||||
#include <QWidget>
|
||||
#include <QtDebug>
|
||||
|
||||
@@ -53,18 +53,19 @@ bool pq3DViewEventPlayer::playEvent(
|
||||
{
|
||||
if (Command == "mousePress" || Command == "mouseRelease" || Command == "mouseMove")
|
||||
{
|
||||
- QRegExp mouseRegExp("\\(([^,]*),([^,]*),([^,]),([^,]),([^,]*)\\)");
|
||||
- if (mouseRegExp.indexIn(Arguments) != -1)
|
||||
+ QRegularExpression mouseRegExp("\\(([^,]*),([^,]*),([^,]),([^,]),([^,]*)\\)");
|
||||
+ QRegularExpressionMatch match = mouseRegExp.match(Arguments);
|
||||
+ if (match.hasMatch())
|
||||
{
|
||||
- QVariant v = mouseRegExp.cap(1);
|
||||
+ QVariant v = match.captured(1);
|
||||
int x = static_cast<int>(v.toDouble() * widget->size().width());
|
||||
- v = mouseRegExp.cap(2);
|
||||
+ v = match.captured(2);
|
||||
int y = static_cast<int>(v.toDouble() * widget->size().height());
|
||||
- v = mouseRegExp.cap(3);
|
||||
+ v = match.captured(3);
|
||||
Qt::MouseButton button = static_cast<Qt::MouseButton>(v.toInt());
|
||||
- v = mouseRegExp.cap(4);
|
||||
+ v = match.captured(4);
|
||||
Qt::MouseButtons buttons = static_cast<Qt::MouseButton>(v.toInt());
|
||||
- v = mouseRegExp.cap(5);
|
||||
+ v = match.captured(5);
|
||||
Qt::KeyboardModifiers keym = static_cast<Qt::KeyboardModifier>(v.toInt());
|
||||
QEvent::Type type = (Command == "mousePress")
|
||||
? QEvent::MouseButtonPress
|
||||
diff --git a/pq3DViewEventTranslator.cxx b/pq3DViewEventTranslator.cxx
|
||||
index e42b28ec22ef24f07b5adffb1fb7740df320adf5..17f7b2d9e17a36b926c585f85ce37c1ee21b6eff 100644
|
||||
--- a/pq3DViewEventTranslator.cxx
|
||||
+++ b/pq3DViewEventTranslator.cxx
|
||||
@@ -71,8 +71,13 @@ bool pq3DViewEventTranslator::translateEvent(QObject* Object, QEvent* Event, boo
|
||||
if (mouseEvent)
|
||||
{
|
||||
QSize size = widget->size();
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
+ double normalized_x = mouseEvent->position().x() / static_cast<double>(size.width());
|
||||
+ double normalized_y = mouseEvent->position().y() / static_cast<double>(size.height());
|
||||
+#else
|
||||
double normalized_x = mouseEvent->x() / static_cast<double>(size.width());
|
||||
double normalized_y = mouseEvent->y() / static_cast<double>(size.height());
|
||||
+#endif
|
||||
int button = mouseEvent->button();
|
||||
int buttons = mouseEvent->buttons();
|
||||
int modifiers = mouseEvent->modifiers();
|
||||
@@ -88,7 +93,10 @@ bool pq3DViewEventTranslator::translateEvent(QObject* Object, QEvent* Event, boo
|
||||
QMouseEvent e(QEvent::MouseButtonPress, QPoint(), Qt::MouseButton(), Qt::MouseButtons(),
|
||||
Qt::KeyboardModifiers());
|
||||
|
||||
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
+ // FIXME: QMouseEvent copy ctor is private in Qt6
|
||||
lastMoveEvent = e;
|
||||
+#endif
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
@@ -98,10 +106,18 @@ bool pq3DViewEventTranslator::translateEvent(QObject* Object, QEvent* Event, boo
|
||||
QMouseEvent* mouseEvent = dynamic_cast<QMouseEvent*>(Event);
|
||||
if (mouseEvent)
|
||||
{
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
+ QMouseEvent e(QEvent::MouseMove,
|
||||
+ QPoint(mouseEvent->position().x(), mouseEvent->position().y()),
|
||||
+#else
|
||||
QMouseEvent e(QEvent::MouseMove, QPoint(mouseEvent->x(), mouseEvent->y()),
|
||||
+#endif
|
||||
mouseEvent->button(), mouseEvent->buttons(), mouseEvent->modifiers());
|
||||
|
||||
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
+ // FIXME: QMouseEvent copy ctor is private in Qt6
|
||||
lastMoveEvent = e;
|
||||
+#endif
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
@@ -117,8 +133,13 @@ bool pq3DViewEventTranslator::translateEvent(QObject* Object, QEvent* Event, boo
|
||||
// record last move event if it is valid
|
||||
if (lastMoveEvent.type() == QEvent::MouseMove)
|
||||
{
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
+ double normalized_x = lastMoveEvent.position().x() / static_cast<double>(size.width());
|
||||
+ double normalized_y = lastMoveEvent.position().y() / static_cast<double>(size.height());
|
||||
+#else
|
||||
double normalized_x = lastMoveEvent.x() / static_cast<double>(size.width());
|
||||
double normalized_y = lastMoveEvent.y() / static_cast<double>(size.height());
|
||||
+#endif
|
||||
int button = lastMoveEvent.button();
|
||||
int buttons = lastMoveEvent.buttons();
|
||||
int modifiers = lastMoveEvent.modifiers();
|
||||
@@ -131,8 +152,13 @@ bool pq3DViewEventTranslator::translateEvent(QObject* Object, QEvent* Event, boo
|
||||
.arg(modifiers));
|
||||
}
|
||||
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
+ double normalized_x = mouseEvent->position().x() / static_cast<double>(size.width());
|
||||
+ double normalized_y = mouseEvent->position().y() / static_cast<double>(size.height());
|
||||
+#else
|
||||
double normalized_x = mouseEvent->x() / static_cast<double>(size.width());
|
||||
double normalized_y = mouseEvent->y() / static_cast<double>(size.height());
|
||||
+#endif
|
||||
int button = mouseEvent->button();
|
||||
int buttons = mouseEvent->buttons();
|
||||
int modifiers = mouseEvent->modifiers();
|
||||
diff --git a/pqAbstractButtonEventTranslator.cxx b/pqAbstractButtonEventTranslator.cxx
|
||||
index ad785ec90b564cde7fc5146e8060da8daf0cb459..bdcdced3de5248324b1bcca791026202878000b9 100644
|
||||
--- a/pqAbstractButtonEventTranslator.cxx
|
||||
+++ b/pqAbstractButtonEventTranslator.cxx
|
||||
@@ -36,6 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QAction>
|
||||
#include <QDebug>
|
||||
#include <QKeyEvent>
|
||||
+#include <QMenu>
|
||||
#include <QMouseEvent>
|
||||
#include <QPushButton>
|
||||
#include <QToolButton>
|
||||
diff --git a/pqAbstractItemViewEventPlayer.cxx b/pqAbstractItemViewEventPlayer.cxx
|
||||
index 95860b099bae0c71b0b37aab980d06eb5d1caf1e..9ab04ae0e954a295b12b910e7e050bafd24555b2 100644
|
||||
--- a/pqAbstractItemViewEventPlayer.cxx
|
||||
+++ b/pqAbstractItemViewEventPlayer.cxx
|
||||
@@ -48,7 +48,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
/// Converts a string representation of a model index into the real thing
|
||||
static QModelIndex OldGetIndex(QAbstractItemView& View, const QString& Name)
|
||||
{
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
+ QStringList rows = Name.split('/', Qt::SkipEmptyParts);
|
||||
+#else
|
||||
QStringList rows = Name.split('/', QString::SkipEmptyParts);
|
||||
+#endif
|
||||
QString column;
|
||||
|
||||
if (rows.size())
|
||||
@@ -88,7 +92,11 @@ static QModelIndex GetIndexByItemName(QAbstractItemView& View, const QString& Na
|
||||
|
||||
static QModelIndex GetIndex(QAbstractItemView* View, const QString& Name)
|
||||
{
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
+ QStringList idxs = Name.split('/', Qt::SkipEmptyParts);
|
||||
+#else
|
||||
QStringList idxs = Name.split('/', QString::SkipEmptyParts);
|
||||
+#endif
|
||||
|
||||
QModelIndex index;
|
||||
for (int i = 0; i != idxs.size(); ++i)
|
||||
@@ -200,7 +208,8 @@ bool pqAbstractItemViewEventPlayer::playEvent(
|
||||
if (Command == "mouseWheel")
|
||||
{
|
||||
int delta = args[0].toInt();
|
||||
- QWheelEvent we(QPoint(x, y), delta, buttons, keym);
|
||||
+ QWheelEvent we(QPointF(x, y), QPointF(x, y), QPoint(0, 0), QPoint(0, delta), buttons, keym,
|
||||
+ Qt::NoScrollPhase, false);
|
||||
QCoreApplication::sendEvent(Object, &we);
|
||||
return true;
|
||||
}
|
||||
diff --git a/pqAbstractItemViewEventPlayerBase.cxx b/pqAbstractItemViewEventPlayerBase.cxx
|
||||
index 8a523e668e4f8d37caae67787ab15cdd3ef7f9ff..fc52293a226a663f87e59246a60f94815e536900 100644
|
||||
--- a/pqAbstractItemViewEventPlayerBase.cxx
|
||||
+++ b/pqAbstractItemViewEventPlayerBase.cxx
|
||||
@@ -163,11 +163,12 @@ bool pqAbstractItemViewEventPlayerBase::playEvent(
|
||||
return false;
|
||||
}
|
||||
|
||||
- QRegExp regExp1("^([\\d\\.]+),(\\d+)$");
|
||||
- if (command == "setCheckState" && regExp1.indexIn(arguments) != -1)
|
||||
+ QRegularExpression regExp1("^([\\d\\.]+),(\\d+)$");
|
||||
+ QRegularExpressionMatch match = regExp1.match(arguments);
|
||||
+ if (command == "setCheckState" && match.hasMatch())
|
||||
{
|
||||
- QString strIndex = regExp1.cap(1);
|
||||
- int check_state = regExp1.cap(2).toInt();
|
||||
+ QString strIndex = match.captured(1);
|
||||
+ int check_state = match.captured(2).toInt();
|
||||
|
||||
QModelIndex index =
|
||||
pqAbstractItemViewEventPlayerBase::GetIndex(strIndex, abstractItemView, error);
|
||||
diff --git a/pqAbstractItemViewEventTranslator.cxx b/pqAbstractItemViewEventTranslator.cxx
|
||||
index b769cca66eab194773d5338171152715181efaa3..07f7b42071582906fcbdbbc149a69773c92b31e6 100644
|
||||
--- a/pqAbstractItemViewEventTranslator.cxx
|
||||
+++ b/pqAbstractItemViewEventTranslator.cxx
|
||||
@@ -153,11 +153,19 @@ bool pqAbstractItemViewEventTranslator::translateEvent(QObject* Object, QEvent*
|
||||
if (wheelEvent)
|
||||
{
|
||||
QString idxStr;
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
+ QModelIndex idx = object->indexAt(wheelEvent->position().toPoint());
|
||||
+#else
|
||||
QModelIndex idx = object->indexAt(wheelEvent->pos());
|
||||
+#endif
|
||||
idxStr = toIndexStr(idx);
|
||||
QRect r = object->visualRect(idx);
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
+ relPt = wheelEvent->position().toPoint() - r.topLeft();
|
||||
+#else
|
||||
relPt = wheelEvent->pos() - r.topLeft();
|
||||
- int numStep = wheelEvent->delta() > 0 ? 120 : -120;
|
||||
+#endif
|
||||
+ int numStep = wheelEvent->angleDelta().y() > 0 ? 120 : -120;
|
||||
int buttons = wheelEvent->buttons();
|
||||
int modifiers = wheelEvent->modifiers();
|
||||
Q_EMIT recordEvent(Object, "mouseWheel", QString("%1,%2,%3,%4,%5")
|
||||
diff --git a/pqBasicWidgetEventPlayer.cxx b/pqBasicWidgetEventPlayer.cxx
|
||||
index 27663a340efb87b92fc4ce10ac393238e8925e95..11ac0d577d53b66e7f624354292a70fb26b553d3 100644
|
||||
--- a/pqBasicWidgetEventPlayer.cxx
|
||||
+++ b/pqBasicWidgetEventPlayer.cxx
|
||||
@@ -83,7 +83,8 @@ bool pqBasicWidgetEventPlayer::playEvent(
|
||||
if (command == "mouseWheel")
|
||||
{
|
||||
int delta = args[0].toInt();
|
||||
- QWheelEvent we(QPoint(x, y), delta, buttons, keym);
|
||||
+ QWheelEvent we(QPoint(x, y), QPoint(x, y), QPoint(0, 0), QPoint(0, delta), buttons,
|
||||
+ keym, Qt::NoScrollPhase, false);
|
||||
QCoreApplication::sendEvent(object, &we);
|
||||
return true;
|
||||
}
|
||||
diff --git a/pqBasicWidgetEventTranslator.cxx b/pqBasicWidgetEventTranslator.cxx
|
||||
index bdbc340cb9714aea681024d24055be113f6b1bd4..57026f6a65408252602765ad6de6771fef58afa8 100644
|
||||
--- a/pqBasicWidgetEventTranslator.cxx
|
||||
+++ b/pqBasicWidgetEventTranslator.cxx
|
||||
@@ -80,8 +80,13 @@ bool pqBasicWidgetEventTranslator::translateEvent(
|
||||
.arg(mouseEvent->button())
|
||||
.arg(mouseEvent->buttons())
|
||||
.arg(mouseEvent->modifiers())
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
+ .arg(mouseEvent->position().x())
|
||||
+ .arg(mouseEvent->position().y());
|
||||
+#else
|
||||
.arg(mouseEvent->x())
|
||||
.arg(mouseEvent->y());
|
||||
+#endif
|
||||
|
||||
if (event->type() != QEvent::MouseButtonRelease)
|
||||
{
|
||||
@@ -116,13 +121,18 @@ bool pqBasicWidgetEventTranslator::translateEvent(
|
||||
{
|
||||
int buttons = wheelEvent->buttons();
|
||||
int modifiers = wheelEvent->modifiers();
|
||||
- int numStep = wheelEvent->delta();
|
||||
+ int numStep = wheelEvent->angleDelta().y() > 0 ? 120 : -120;
|
||||
Q_EMIT recordEvent(object, "mouseWheel", QString("%1,%2,%3,%4,%5")
|
||||
.arg(numStep)
|
||||
.arg(buttons)
|
||||
.arg(modifiers)
|
||||
- .arg(wheelEvent->x())
|
||||
- .arg(wheelEvent->y()));
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
+ .arg(wheelEvent->position().x())
|
||||
+ .arg(wheelEvent->position().y()));
|
||||
+#else
|
||||
+ .arg(wheelEvent->pos().x())
|
||||
+ .arg(wheelEvent->pos().y()));
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
return true;
|
||||
diff --git a/pqEventRecorder.cxx b/pqEventRecorder.cxx
|
||||
index e20b15ef096a68f5126e387dbfb551a8a5a01c31..8737dfa9fefdbcbe5e9df6dda1621f043e345b69 100644
|
||||
--- a/pqEventRecorder.cxx
|
||||
+++ b/pqEventRecorder.cxx
|
||||
@@ -192,8 +192,10 @@ void pqEventRecorder::start()
|
||||
// Set the device
|
||||
this->Stream.setDevice(this->File);
|
||||
|
||||
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
// Set UTF8 Codec
|
||||
this->Stream.setCodec("UTF-8");
|
||||
+#endif
|
||||
|
||||
// Set the Stream to the Observer
|
||||
this->ActiveObserver->setStream(&this->Stream);
|
||||
diff --git a/pqEventTranslator.cxx b/pqEventTranslator.cxx
|
||||
index beb7be450741abef46cee21f11f502ecf84f0552..9d9d691848847e47ad2596bea4134e1ccb14665d 100644
|
||||
--- a/pqEventTranslator.cxx
|
||||
+++ b/pqEventTranslator.cxx
|
||||
@@ -103,7 +103,7 @@ struct pqEventTranslator::pqImplementation
|
||||
/// Stores the working set of widget translators
|
||||
QList<pqWidgetEventTranslator*> Translators;
|
||||
/// Stores the set of objects that should be ignored when translating events
|
||||
- QMap<QObject*, QRegExp> IgnoredObjects;
|
||||
+ QMap<QObject*, QRegularExpression> IgnoredObjects;
|
||||
|
||||
// list of widgets for which mouse propagation will happen
|
||||
// we'll only translate the first and ignore the rest
|
||||
@@ -272,7 +272,7 @@ pqEventComment* pqEventTranslator::eventComment() const
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
-void pqEventTranslator::ignoreObject(QObject* object, QRegExp commandFilter)
|
||||
+void pqEventTranslator::ignoreObject(QObject* object, QRegularExpression commandFilter)
|
||||
{
|
||||
this->Implementation->IgnoredObjects.insert(object, commandFilter);
|
||||
}
|
||||
@@ -353,11 +353,21 @@ bool pqEventTranslator::eventFilter(QObject* object, QEvent* event)
|
||||
{
|
||||
// Check it is not the overlay, and it contains the mouse cursor
|
||||
if (topWidget != this->Implementation->CheckOverlay &&
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
+ topWidget->geometry().contains(
|
||||
+ static_cast<QMouseEvent*>(event)->globalPosition().toPoint(), true))
|
||||
+#else
|
||||
topWidget->geometry().contains(static_cast<QMouseEvent*>(event)->globalPos(), true))
|
||||
+#endif
|
||||
{
|
||||
// Recover the child widget onder the cursor, if any
|
||||
QWidget* childWidget = topWidget->childAt(
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
+ topWidget->mapFromGlobal(
|
||||
+ static_cast<QMouseEvent*>(event)->globalPosition().toPoint()));
|
||||
+#else
|
||||
topWidget->mapFromGlobal(static_cast<QMouseEvent*>(event)->globalPos()));
|
||||
+#endif
|
||||
|
||||
// If child exist, check it is not the overlayed widget and indeed a new widget
|
||||
if (childWidget == NULL ||
|
||||
@@ -583,7 +593,7 @@ void pqEventTranslator::onRecordEvent(
|
||||
{
|
||||
if (this->Implementation->IgnoredObjects.contains(Object))
|
||||
{
|
||||
- QRegExp commandFilter = this->Implementation->IgnoredObjects.value(Object);
|
||||
+ QRegularExpression commandFilter = this->Implementation->IgnoredObjects.value(Object);
|
||||
if (Command.contains(commandFilter))
|
||||
{
|
||||
return;
|
||||
diff --git a/pqEventTranslator.h b/pqEventTranslator.h
|
||||
index d756bec96f42db4db8e28517a0d610cbef0e1ef4..4b0549f6d794cfeb43ecd6ea2644a5067e25c34d 100644
|
||||
--- a/pqEventTranslator.h
|
||||
+++ b/pqEventTranslator.h
|
||||
@@ -36,7 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "QtTestingExport.h"
|
||||
#include <QObject>
|
||||
#include <QRect>
|
||||
-#include <QRegExp>
|
||||
+#include <QRegularExpression>
|
||||
|
||||
class pqEventComment;
|
||||
class pqTestUtility;
|
||||
@@ -92,8 +92,8 @@ public:
|
||||
/// translating events which command is equivalent to the regexp
|
||||
/// (useful to prevent recording UI events from being
|
||||
/// captured as part of the recording)
|
||||
- void ignoreObject(
|
||||
- QObject* object, QRegExp commandFilter = QRegExp("*", Qt::CaseInsensitive, QRegExp::Wildcard));
|
||||
+ void ignoreObject(QObject* object, QRegularExpression commandFilter = QRegularExpression(
|
||||
+ "*", QRegularExpression::CaseInsensitiveOption));
|
||||
|
||||
/// start listening to the GUI and translating events
|
||||
void start();
|
||||
diff --git a/pqObjectNaming.h b/pqObjectNaming.h
|
||||
index d31b28d4a4f8275232331af860699796c77c2114..5cef1618d431d26f38cf10d2649e2dc5202f737f 100644
|
||||
--- a/pqObjectNaming.h
|
||||
+++ b/pqObjectNaming.h
|
||||
@@ -38,7 +38,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "QtTestingExport.h"
|
||||
|
||||
class QObject;
|
||||
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
class QStringList;
|
||||
+#endif
|
||||
|
||||
/// Provides functionality to ensuring that Qt objects can be uniquely identified for recording and
|
||||
/// playback of regression tests
|
||||
diff --git a/pqPlayBackEventsDialog.cxx b/pqPlayBackEventsDialog.cxx
|
||||
index d8b3e9547d146fb68dd6c61942b825ae67cd67ec..ff0ebb926c3f49b29f1bce06fa36c4e65a889b0c 100644
|
||||
--- a/pqPlayBackEventsDialog.cxx
|
||||
+++ b/pqPlayBackEventsDialog.cxx
|
||||
@@ -350,7 +350,9 @@ void pqPlayBackEventsDialog::onStarted(const QString& filename)
|
||||
file.open(QIODevice::ReadOnly);
|
||||
this->Implementation->Ui.logBrowser->append(QString("Start file : %1").arg(infoFile.fileName()));
|
||||
QTextStream stream(&file);
|
||||
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
stream.setCodec("UTF-8");
|
||||
+#endif
|
||||
this->Implementation->Ui.currentFileLabel->setText(infoFile.fileName());
|
||||
while (!stream.atEnd())
|
||||
{
|
||||
diff --git a/pqTreeViewEventPlayer.cxx b/pqTreeViewEventPlayer.cxx
|
||||
index 02199925d018adc0df3a85548a7813aee7f21c84..d541a9cc684be11b0d30f1fdf321d872e8f9a78b 100644
|
||||
--- a/pqTreeViewEventPlayer.cxx
|
||||
+++ b/pqTreeViewEventPlayer.cxx
|
||||
@@ -63,8 +63,9 @@ bool pqTreeViewEventPlayer::playEvent(
|
||||
return false;
|
||||
}
|
||||
|
||||
- QRegExp regExp0("^([\\d\\.]+),(\\d+),(\\d+)$");
|
||||
- if (command == "setTreeItemCheckState" && regExp0.indexIn(arguments) != -1)
|
||||
+ QRegularExpression regExp0("^([\\d\\.]+),(\\d+),(\\d+)$");
|
||||
+ QRegularExpressionMatch match = regExp0.match(arguments);
|
||||
+ if (command == "setTreeItemCheckState" && match.hasMatch())
|
||||
{
|
||||
// legacy command recorded from tree widgets.
|
||||
QTreeWidget* treeWidget = qobject_cast<QTreeWidget*>(object);
|
||||
@@ -72,11 +73,14 @@ bool pqTreeViewEventPlayer::playEvent(
|
||||
{
|
||||
return false;
|
||||
}
|
||||
- QString str_index = regExp0.cap(1);
|
||||
- int column = regExp0.cap(2).toInt();
|
||||
- int check_state = regExp0.cap(3).toInt();
|
||||
-
|
||||
+ QString str_index = match.captured(1);
|
||||
+ int column = match.captured(2).toInt();
|
||||
+ int check_state = match.captured(3).toInt();
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
+ QStringList indices = str_index.split(".", Qt::SkipEmptyParts);
|
||||
+#else
|
||||
QStringList indices = str_index.split(".", QString::SkipEmptyParts);
|
||||
+#endif
|
||||
QTreeWidgetItem* cur_item = NULL;
|
||||
Q_FOREACH (QString cur_index, indices)
|
||||
{
|
@ -1,4 +1,13 @@
|
||||
set(VERSION_MAJOR_MINOR 5.11)
|
||||
|
||||
set(plat_feat "")
|
||||
if(VCPKG_TARGET_IS_LINUX)
|
||||
set(plat_feat "tools" VTK_USE_X) # required to build the client
|
||||
endif()
|
||||
if(VCPKG_TARGET_IS_LINUX)
|
||||
set(plat_feat "tools" VTK_USE_COCOA) # required to build the client
|
||||
endif()
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES
|
||||
"cuda" PARAVIEW_USE_CUDA #untested; probably only affects internal VTK build so it does nothing here
|
||||
"all_modules" PARAVIEW_BUILD_ALL_MODULES #untested
|
||||
@ -6,6 +15,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES
|
||||
"vtkm" PARAVIEW_USE_VTKM
|
||||
"python" PARAVIEW_USE_PYTHON
|
||||
"tools" PARAVIEW_BUILD_TOOLS
|
||||
${plat_feat}
|
||||
)
|
||||
|
||||
vcpkg_from_github(
|
||||
@ -19,6 +29,7 @@ vcpkg_from_github(
|
||||
python_include.patch
|
||||
python_wrapper.patch
|
||||
add-tools-option.patch
|
||||
qt6-all.patch
|
||||
)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
@ -47,6 +58,7 @@ vcpkg_from_gitlab(
|
||||
REPO paraview/qttesting
|
||||
REF 08d96e9277bc4c26804fd77ce1b4fa5c791605ae # https://gitlab.kitware.com/paraview/qttesting/-/merge_requests/53 for Qt6
|
||||
SHA512 cb4acdfe1206bd8bae4f70185c8ca1ce555cf983a1d1e97293dac544ab13b039638bfe0d1e448f9589db92b6ed23b9b940157e72d9ec9e3994ea9858ab1722ec
|
||||
PATCHES 53.diff
|
||||
)
|
||||
|
||||
vcpkg_from_gitlab(
|
||||
@ -83,7 +95,6 @@ vcpkg_cmake_configure(
|
||||
-DVTK_MODULE_ENABLE_ParaView_qttesting=YES
|
||||
-DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION:BOOL=OFF
|
||||
-DPARAVIEW_USE_QTHELP:BOOL=OFF
|
||||
|
||||
# A little bit of help in finding the boost headers
|
||||
"-DBoost_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include"
|
||||
|
||||
|
2585
ports/paraview/qt6-all.patch
Normal file
2585
ports/paraview/qt6-all.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "paraview",
|
||||
"version": "5.11.0",
|
||||
"port-version": 1,
|
||||
"description": "VTK-based Data Analysis and Visualization Application",
|
||||
"homepage": "https://www.paraview.org/",
|
||||
"license": "BSD-3-Clause",
|
||||
@ -10,6 +11,7 @@
|
||||
"boost-format",
|
||||
"cgns",
|
||||
"protobuf",
|
||||
"qt5compat",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
@ -81,7 +83,10 @@
|
||||
]
|
||||
},
|
||||
"tools": {
|
||||
"description": "Build paraview tools"
|
||||
"description": "Build paraview tools",
|
||||
"dependencies": [
|
||||
"qtsvg"
|
||||
]
|
||||
},
|
||||
"vtkm": {
|
||||
"description": "enables vtkm for the build of paraview",
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "qt",
|
||||
"version": "6.4.2",
|
||||
"port-version": 1,
|
||||
"description": "Qt",
|
||||
"homepage": "https://www.qt.io/",
|
||||
"license": null,
|
||||
@ -210,13 +211,6 @@
|
||||
],
|
||||
"platform": "windows"
|
||||
},
|
||||
{
|
||||
"name": "qtbase",
|
||||
"features": [
|
||||
"gles2"
|
||||
],
|
||||
"platform": "linux"
|
||||
},
|
||||
{
|
||||
"name": "qtwayland",
|
||||
"features": [
|
||||
|
152
ports/rtabmap/cpp17.patch
Normal file
152
ports/rtabmap/cpp17.patch
Normal file
@ -0,0 +1,152 @@
|
||||
diff --git a/corelib/src/SimpleIni.h b/corelib/src/SimpleIni.h
|
||||
index 3fccf9dc1..e787be813 100644
|
||||
--- a/corelib/src/SimpleIni.h
|
||||
+++ b/corelib/src/SimpleIni.h
|
||||
@@ -324,7 +324,10 @@ public:
|
||||
#endif
|
||||
|
||||
/** Strict less ordering by name of key only */
|
||||
- struct KeyOrder : std::binary_function<Entry, Entry, bool> {
|
||||
+ struct KeyOrder {
|
||||
+ using result_type = bool;
|
||||
+ using first_argument_type = Entry;
|
||||
+ using second_argument_type = Entry;
|
||||
bool operator()(const Entry & lhs, const Entry & rhs) const {
|
||||
const static SI_STRLESS isLess = SI_STRLESS();
|
||||
return isLess(lhs.pItem, rhs.pItem);
|
||||
@@ -332,7 +335,10 @@ public:
|
||||
};
|
||||
|
||||
/** Strict less ordering by order, and then name of key */
|
||||
- struct LoadOrder : std::binary_function<Entry, Entry, bool> {
|
||||
+ struct LoadOrder {
|
||||
+ using result_type = bool;
|
||||
+ using first_argument_type = Entry;
|
||||
+ using second_argument_type = Entry;
|
||||
bool operator()(const Entry & lhs, const Entry & rhs) const {
|
||||
if (lhs.nOrder != rhs.nOrder) {
|
||||
return lhs.nOrder < rhs.nOrder;
|
||||
diff --git a/corelib/src/rtflann/algorithms/dist.h b/corelib/src/rtflann/algorithms/dist.h
|
||||
index a286f1eea..6456eb25b 100644
|
||||
--- a/corelib/src/rtflann/algorithms/dist.h
|
||||
+++ b/corelib/src/rtflann/algorithms/dist.h
|
||||
@@ -517,6 +517,7 @@ struct HammingPopcnt
|
||||
result += __builtin_popcountll(a_final ^ b_final);
|
||||
}
|
||||
#else
|
||||
+ typedef unsigned long long pop_t;
|
||||
HammingLUT lut;
|
||||
result = lut(reinterpret_cast<const unsigned char*> (a),
|
||||
reinterpret_cast<const unsigned char*> (b), size * sizeof(pop_t));
|
||||
diff --git a/corelib/src/rtflann/algorithms/kdtree_index.h b/corelib/src/rtflann/algorithms/kdtree_index.h
|
||||
index c2ab18864..407233770 100644
|
||||
--- a/corelib/src/rtflann/algorithms/kdtree_index.h
|
||||
+++ b/corelib/src/rtflann/algorithms/kdtree_index.h
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <cstring>
|
||||
#include <stdarg.h>
|
||||
#include <cmath>
|
||||
+#include <random>
|
||||
|
||||
#include "rtflann/general.h"
|
||||
#include "rtflann/algorithms/nn_index.h"
|
||||
@@ -675,9 +676,11 @@ protected:
|
||||
|
||||
tree_roots_.resize(trees_);
|
||||
/* Construct the randomized trees. */
|
||||
+ std::random_device rd;
|
||||
+ std::mt19937 g(rd());
|
||||
for (int i = 0; i < trees_; i++) {
|
||||
/* Randomize the order of vectors to allow for unbiased sampling. */
|
||||
- std::random_shuffle(ind.begin(), ind.end());
|
||||
+ std::shuffle(ind.begin(), ind.end(),g);
|
||||
tree_roots_[i] = divideTree(&ind[0], int(size_) );
|
||||
}
|
||||
delete[] mean_;
|
||||
diff --git a/corelib/src/rtflann/util/heap.h b/corelib/src/rtflann/util/heap.h
|
||||
index b104ee3ae..a9b50550c 100644
|
||||
--- a/corelib/src/rtflann/util/heap.h
|
||||
+++ b/corelib/src/rtflann/util/heap.h
|
||||
@@ -115,8 +115,11 @@ public:
|
||||
count = 0;
|
||||
}
|
||||
|
||||
- struct CompareT : public std::binary_function<T,T,bool>
|
||||
+ struct CompareT
|
||||
{
|
||||
+ using result_type = bool;
|
||||
+ using first_argument_type = T;
|
||||
+ using second_argument_type = T;
|
||||
bool operator()(const T& t_1, const T& t_2) const
|
||||
{
|
||||
return t_2 < t_1;
|
||||
diff --git a/corelib/src/rtflann/util/lsh_table.h b/corelib/src/rtflann/util/lsh_table.h
|
||||
index 974bb9e44..5389dc743 100644
|
||||
--- a/corelib/src/rtflann/util/lsh_table.h
|
||||
+++ b/corelib/src/rtflann/util/lsh_table.h
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <limits.h>
|
||||
+#include <random>
|
||||
// TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP
|
||||
#if RTFLANN_USE_UNORDERED_MAP
|
||||
#include <unordered_map>
|
||||
@@ -362,9 +363,11 @@ inline LshTable<unsigned char>::LshTable(unsigned int feature_size, unsigned int
|
||||
mask_ = std::vector<size_t>((size_t)ceil((float)(feature_size * sizeof(char)) / (float)sizeof(size_t)), 0);
|
||||
|
||||
// A bit brutal but fast to code
|
||||
+ std::random_device rd;
|
||||
+ std::mt19937 g(rd());
|
||||
std::vector<size_t> indices(feature_size * CHAR_BIT);
|
||||
for (size_t i = 0; i < feature_size * CHAR_BIT; ++i) indices[i] = i;
|
||||
- std::random_shuffle(indices.begin(), indices.end());
|
||||
+ std::shuffle(indices.begin(), indices.end(),g);
|
||||
|
||||
// Generate a random set of order of subsignature_size_ bits
|
||||
for (unsigned int i = 0; i < key_size_; ++i) {
|
||||
diff --git a/corelib/src/rtflann/util/random.h b/corelib/src/rtflann/util/random.h
|
||||
index 871c9d15f..5d96ac273 100644
|
||||
--- a/corelib/src/rtflann/util/random.h
|
||||
+++ b/corelib/src/rtflann/util/random.h
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <cstdlib>
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
+#include <random>
|
||||
|
||||
#include "rtflann/general.h"
|
||||
|
||||
@@ -75,14 +76,6 @@ inline int rand_int(int high = RAND_MAX, int low = 0)
|
||||
return low + (int) ( double(high-low) * (std::rand() / (RAND_MAX + 1.0)));
|
||||
}
|
||||
|
||||
-
|
||||
-class RandomGenerator
|
||||
-{
|
||||
-public:
|
||||
- ptrdiff_t operator() (ptrdiff_t i) { return rand_int(i); }
|
||||
-};
|
||||
-
|
||||
-
|
||||
/**
|
||||
* Random number generator that returns a distinct number from
|
||||
* the [0,n) interval each time.
|
||||
@@ -110,14 +103,15 @@ public:
|
||||
*/
|
||||
void init(int n)
|
||||
{
|
||||
- static RandomGenerator generator;
|
||||
// create and initialize an array of size n
|
||||
vals_.resize(n);
|
||||
size_ = n;
|
||||
for (int i = 0; i < size_; ++i) vals_[i] = i;
|
||||
|
||||
// shuffle the elements in the array
|
||||
- std::random_shuffle(vals_.begin(), vals_.end(), generator);
|
||||
+ std::random_device rd;
|
||||
+ std::mt19937 g(rd());
|
||||
+ std::shuffle(vals_.begin(), vals_.end(), g);
|
||||
|
||||
counter_ = 0;
|
||||
}
|
@ -10,6 +10,7 @@ vcpkg_from_github(
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
0003-fix-qt.patch
|
||||
cpp17.patch
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "rtabmap",
|
||||
"version": "0.20.23",
|
||||
"port-version": 1,
|
||||
"description": "Real-Time Appearance-Based Mapping",
|
||||
"homepage": "https://introlab.github.io/rtabmap/",
|
||||
"license": "BSD-3-Clause",
|
||||
|
@ -112,7 +112,13 @@ list(TRANSFORM VTK_FEATURE_OPTIONS REPLACE "=OFF" "=DONT_WANT")
|
||||
if("qt" IN_LIST FEATURES AND NOT EXISTS "${CURRENT_HOST_INSTALLED_DIR}/tools/Qt5/bin/qmlplugindump${VCPKG_HOST_EXECUTABLE_SUFFIX}")
|
||||
list(APPEND VTK_FEATURE_OPTIONS -DVTK_MODULE_ENABLE_VTK_GUISupportQtQuick=NO)
|
||||
endif()
|
||||
|
||||
if("qt" IN_LIST FEATURES)
|
||||
file(READ "${CURRENT_INSTALLED_DIR}/share/qtbase/vcpkg_abi_info.txt" qtbase_abi_info)
|
||||
if(qtbase_abi_info MATCHES "(^|;)gles2(;|$)")
|
||||
message(FATAL_ERROR "VTK assumes qt to be build with desktop opengl. As such trying to build vtk with qt using GLES will fail.")
|
||||
# This should really be a configure error but using this approach doesn't require patching.
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if("python" IN_LIST FEATURES)
|
||||
set(python_ver "")
|
||||
@ -215,9 +221,10 @@ vcpkg_cmake_configure(
|
||||
${ADDITIONAL_OPTIONS}
|
||||
-DVTK_DEBUG_MODULE_ALL=ON
|
||||
-DVTK_DEBUG_MODULE=ON
|
||||
-DVTK_QT_VERSION=5
|
||||
-DVTK_QT_VERSION=6
|
||||
-DCMAKE_INSTALL_QMLDIR:PATH=qml
|
||||
-DVCPKG_HOST_TRIPLET=${_HOST_TRIPLET}
|
||||
-DCMAKE_FIND_PACKAGE_TARGETS_GLOBAL=ON # Due to Qt6::Platform not being found on Linux platform
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
VTK_MODULE_ENABLE_VTK_PythonContext2D # Guarded by a conditional
|
||||
VTK_MODULE_ENABLE_VTK_GUISupportMFC # only windows
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "vtk",
|
||||
"version-semver": "9.2.0-pv5.11.0",
|
||||
"port-version": 1,
|
||||
"port-version": 2,
|
||||
"description": "Software system for 3D computer graphics, image processing, and visualization",
|
||||
"homepage": "https://github.com/Kitware/VTK",
|
||||
"license": "BSD-3-Clause",
|
||||
@ -198,12 +198,20 @@
|
||||
"qt": {
|
||||
"description": "Qt functionality for VTK",
|
||||
"dependencies": [
|
||||
"qt5-declarative",
|
||||
"qt5-imageformats",
|
||||
"qt5-tools",
|
||||
{
|
||||
"name": "qt5-x11extras",
|
||||
"platform": "linux"
|
||||
"name": "qtbase",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"gui",
|
||||
"opengl",
|
||||
"widgets"
|
||||
]
|
||||
},
|
||||
"qtdeclarative",
|
||||
"qtimageformats",
|
||||
{
|
||||
"name": "qttools",
|
||||
"default-features": false
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -5586,7 +5586,7 @@
|
||||
},
|
||||
"opencv4": {
|
||||
"baseline": "4.7.0",
|
||||
"port-version": 1
|
||||
"port-version": 2
|
||||
},
|
||||
"opendnp3": {
|
||||
"baseline": "3.1.1",
|
||||
@ -5618,7 +5618,7 @@
|
||||
},
|
||||
"openimageio": {
|
||||
"baseline": "2.4.5.0",
|
||||
"port-version": 2
|
||||
"port-version": 3
|
||||
},
|
||||
"openjpeg": {
|
||||
"baseline": "2.5.0",
|
||||
@ -5798,7 +5798,7 @@
|
||||
},
|
||||
"paraview": {
|
||||
"baseline": "5.11.0",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"parmetis": {
|
||||
"baseline": "2022-07-27",
|
||||
@ -6178,7 +6178,7 @@
|
||||
},
|
||||
"qt": {
|
||||
"baseline": "6.4.2",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"qt-advanced-docking-system": {
|
||||
"baseline": "3.8.2",
|
||||
@ -6814,7 +6814,7 @@
|
||||
},
|
||||
"rtabmap": {
|
||||
"baseline": "0.20.23",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"rtaudio": {
|
||||
"baseline": "2021-11-16",
|
||||
@ -8058,7 +8058,7 @@
|
||||
},
|
||||
"vtk": {
|
||||
"baseline": "9.2.0-pv5.11.0",
|
||||
"port-version": 1
|
||||
"port-version": 2
|
||||
},
|
||||
"vtk-dicom": {
|
||||
"baseline": "0.8.14",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "6a62c7557d02936ea929e86836f324d09c787de5",
|
||||
"version": "4.7.0",
|
||||
"port-version": 2
|
||||
},
|
||||
{
|
||||
"git-tree": "677670190cbd9471967b6670cfeffa3507fb158c",
|
||||
"version": "4.7.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "d89c769d1b813eadd08173e4e9d18049ac8c1d23",
|
||||
"version": "2.4.5.0",
|
||||
"port-version": 3
|
||||
},
|
||||
{
|
||||
"git-tree": "f9959dd6e10f7f11261c50108d4399f29d21883a",
|
||||
"version": "2.4.5.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "7076e5d1dc86dc41ca0f3ad6567ffbe06b86166c",
|
||||
"version": "5.11.0",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "2d9618d727ccb99ba7067dc82a21fca3afe402d3",
|
||||
"version": "5.11.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "e87868b5849c0749149e7704d9ea811968bdfef5",
|
||||
"version": "6.4.2",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "15b58195684518c458f733607909afcbec4d7cd9",
|
||||
"version": "6.4.2",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "f9f15f5c198b5b94b443fdcf6dfc69edebcc4d0b",
|
||||
"version": "0.20.23",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "cd9a851bb263675d109cd74a896d766a08a2342a",
|
||||
"version": "0.20.23",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "df558a4d65780495ca4ba4710306eb337f23bf93",
|
||||
"version-semver": "9.2.0-pv5.11.0",
|
||||
"port-version": 2
|
||||
},
|
||||
{
|
||||
"git-tree": "2c7f3430079e884ea0ed88e0696fba5f6a839e5e",
|
||||
"version-semver": "9.2.0-pv5.11.0",
|
||||
|
Loading…
x
Reference in New Issue
Block a user