From 32c28372db5080a3304c65f5efa31d8fe7ae468a Mon Sep 17 00:00:00 2001 From: Daniel Girardeau-Montaut Date: Sun, 21 Sep 2025 22:48:31 +0200 Subject: [PATCH] Compilation with Qt6 and Visual Studio 2022 --- CMakeLists.txt | 16 ++++++++-------- FeaturesInterface.cpp | 4 ++-- q3DMASC.cpp | 4 ++-- q3DMASCClassifier.cpp | 4 ++++ q3DMASCCommands.h | 2 +- q3DMASCTools.cpp | 16 ++++++++-------- qTrain3DMASCDialog.cpp | 2 +- 7 files changed, 26 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b6d89f..c82967a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,8 +56,8 @@ if (PLUGIN_STANDARD_3DMASC) ${CloudCompare_SOURCE_DIR}/../common) target_link_libraries( ${PROJECT_NAME} ${OpenCV_LIBS} ) - set( OPENCV_DEP_DLL_FILES ${OpenCV_DIR}/x64/vc15/bin/opencv_world340.dll ) - copy_files("${OPENCV_DEP_DLL_FILES}" "${CLOUDCOMPARE_DEST_FOLDER}") #mind the quotes! + set( OpenCV_WORLD_DLL "" CACHE FILEPATH "Opencv 'World' DLL file path" ) + copy_files("${OpenCV_WORLD_DLL}" "${CLOUDCOMPARE_DEST_FOLDER}" 1) #mind the quotes! #================ # git commit hash @@ -96,12 +96,12 @@ if (PLUGIN_STANDARD_3DMASC) OUTPUT_VARIABLE GIT_COMMIT_HASH_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - message(${PROJECT_NAME} " " GIT_BRANCH_3DMASC " " ${GIT_BRANCH_3DMASC}) - message(${PROJECT_NAME} " " GIT_COMMIT_HASH_3DMASC " " ${GIT_COMMIT_HASH_3DMASC}) - message(${PROJECT_NAME} " " GIT_TAG_3DMASC " " ${GIT_TAG_3DMASC}) - message(${PROJECT_NAME} " " GIT_BRANCH_CC " " ${GIT_BRANCH_CC}) - message(${PROJECT_NAME} " " GIT_COMMIT_HASH_CC " " ${GIT_COMMIT_HASH_CC}) - message(${PROJECT_NAME} " " Q3DMASC_VERSION " " ${Q3DMASC_PLUGIN_VERSION}) + message(VERBOSE ${PROJECT_NAME} " " GIT_BRANCH_3DMASC " " ${GIT_BRANCH_3DMASC}) + message(VERBOSE ${PROJECT_NAME} " " GIT_COMMIT_HASH_3DMASC " " ${GIT_COMMIT_HASH_3DMASC}) + message(VERBOSE ${PROJECT_NAME} " " GIT_TAG_3DMASC " " ${GIT_TAG_3DMASC}) + message(VERBOSE ${PROJECT_NAME} " " GIT_BRANCH_CC " " ${GIT_BRANCH_CC}) + message(VERBOSE ${PROJECT_NAME} " " GIT_COMMIT_HASH_CC " " ${GIT_COMMIT_HASH_CC}) + message(VERBOSE ${PROJECT_NAME} " " Q3DMASC_VERSION " " ${Q3DMASC_PLUGIN_VERSION}) target_compile_definitions(${PROJECT_NAME} PRIVATE GIT_BRANCH_CC="${GIT_BRANCH_CC}" diff --git a/FeaturesInterface.cpp b/FeaturesInterface.cpp index e3fbb28..8f1d901 100644 --- a/FeaturesInterface.cpp +++ b/FeaturesInterface.cpp @@ -160,10 +160,10 @@ bool Feature::SaveSources(const Source::Set& sources, QString filename) } QTextStream stream(&file); - stream << "#Features_SF" << endl; + stream << "#Features_SF" << Qt::endl; for (const Source& s : sources) { - stream << s.type << ":" << s.name << endl; + stream << s.type << ":" << s.name << Qt::endl; } return true; diff --git a/q3DMASC.cpp b/q3DMASC.cpp index 2d97e51..9940b5e 100644 --- a/q3DMASC.cpp +++ b/q3DMASC.cpp @@ -721,12 +721,12 @@ void q3DMASCPlugin::doTrainAction() ccLog::Warning(QString("Can't open file '%1' for writing").arg(filename)); } QTextStream stream(&file); - stream << "# feature importance" << endl; + stream << "# feature importance" << Qt::endl; for (size_t i = 0; i < originalFeatures.size(); ++i) { if (originalFeatures[i].selected) { - stream << originalFeatures[i].feature->toString() << " " << originalFeatures[i].importance << endl; + stream << originalFeatures[i].feature->toString() << " " << originalFeatures[i].importance << Qt::endl; } } } diff --git a/q3DMASCClassifier.cpp b/q3DMASCClassifier.cpp index f9e441c..19cfb63 100644 --- a/q3DMASCClassifier.cpp +++ b/q3DMASCClassifier.cpp @@ -50,6 +50,10 @@ #include #endif +#if defined(CC_WINDOWS) +#include +#endif + using namespace masc; Classifier::Classifier() diff --git a/q3DMASCCommands.h b/q3DMASCCommands.h index 51b6398..e4005fc 100644 --- a/q3DMASCCommands.h +++ b/q3DMASCCommands.h @@ -130,7 +130,7 @@ struct Command3DMASCClassif : public ccCommandLineInterface::Command cmd.arguments().pop_front(); //process the cloud roles description - QStringList tokens = cloudRolesStr.simplified().split(QChar(' '), QString::SkipEmptyParts); + QStringList tokens = cloudRolesStr.simplified().split(QChar(' '), Qt::SkipEmptyParts); masc::Tools::NamedClouds cloudPerRole; QString mainCloudRole; diff --git a/q3DMASCTools.cpp b/q3DMASCTools.cpp index 7d42652..c563f41 100644 --- a/q3DMASCTools.cpp +++ b/q3DMASCTools.cpp @@ -74,8 +74,8 @@ bool Tools::SaveClassifier( QString filename, QTextStream stream(&file); - stream << "# 3DMASC classifier file" << endl; - stream << "classifier: " << yamlFilename << endl; + stream << "# 3DMASC classifier file" << Qt::endl; + stream << "classifier: " << yamlFilename << Qt::endl; //look for all clouds (labels) QList cloudLabels; @@ -91,22 +91,22 @@ bool Tools::SaveClassifier( QString filename, cloudLabels.push_back(corePointsRole); } - stream << "# Clouds (roles)" << endl; + stream << "# Clouds (roles)" << Qt::endl; for (const QString& label : cloudLabels) { - stream << "cloud: " << label << endl; + stream << "cloud: " << label << Qt::endl; } if (!corePointsRole.isEmpty()) { - stream << "# Core points (classified role)" << endl; - stream << "core_points: " << corePointsRole << endl; + stream << "# Core points (classified role)" << Qt::endl; + stream << "core_points: " << corePointsRole << Qt::endl; } - stream << "# Features" << endl; + stream << "# Features" << Qt::endl; for (Feature::Shared f : features) { - stream << "feature: " << f->toString() << endl; + stream << "feature: " << f->toString() << Qt::endl; } return true; diff --git a/qTrain3DMASCDialog.cpp b/qTrain3DMASCDialog.cpp index a3dad70..d31e75d 100644 --- a/qTrain3DMASCDialog.cpp +++ b/qTrain3DMASCDialog.cpp @@ -253,7 +253,7 @@ bool Train3DMASCDialog::openTraceFile() QDir parameterDir = QDir(info.path()); QFileDialog dialog(this); - dialog.setFileMode(QFileDialog::DirectoryOnly); + dialog.setFileMode(QFileDialog::Directory); dialog.setWindowTitle("Choose a valid directory for the traces"); dialog.setDirectory(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation).at(0));