Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for QT5 / VTK 6.x #1217

Merged
merged 2 commits into from
May 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,17 @@ endif(WITH_CUDA)

option(WITH_QT "Build QT Front-End" TRUE)
if(WITH_QT)
# Find Qt4
find_package(Qt4)
if (QT4_FOUND)
include("${QT_USE_FILE}")
endif (QT4_FOUND)

# Find QT5
if(NOT QT4_FOUND)
include(cmake/pcl_find_qt5.cmake)
endif(NOT QT4_FOUND)
set(PCL_QT_VERSION 5 CACHE STRING "Which QT version to use")
if("${PCL_QT_VERSION}" STREQUAL "4")
find_package(Qt4)
if (QT4_FOUND)
include("${QT_USE_FILE}")
endif (QT4_FOUND)
elseif("${PCL_QT_VERSION}" STREQUAL "5")
include(cmake/pcl_find_qt5.cmake)
else()
message(SEND_ERROR "PCL_QT_VERSION must be 4 or 5")
endif()
endif(WITH_QT)

# Find VTK
Expand All @@ -371,9 +372,7 @@ if(WITH_VTK AND NOT ANDROID)
if (PCL_SHARED_LIBS OR
(NOT (PCL_SHARED_LIBS) AND NOT (VTK_BUILD_SHARED_LIBS)))
set(VTK_FOUND TRUE)
find_library (QVTK_LIBRARY_DEBUG NAMES "@QVTK_LIBRARY_DEBUG_NAME@")
find_library (QVTK_LIBRARY_RELEASE NAMES "@QVTK_LIBRARY_RELEASE_NAME@")
set(QVTK_LIBRARY optimized ${QVTK_LIBRARY_RELEASE} debug ${QVTK_LIBRARY_DEBUG})
find_package (QVTK)
if (${VTK_MAJOR_VERSION} VERSION_LESS "6.0")
message(STATUS "VTK found (include: ${VTK_INCLUDE_DIRS}, lib: ${VTK_LIBRARY_DIRS})")
link_directories(${VTK_LIBRARY_DIRS})
Expand Down
1 change: 1 addition & 0 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,4 @@ if(build)
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/impl" ${impl_incs})

endif(build)

5 changes: 5 additions & 0 deletions apps/cloud_composer/include/pcl/apps/cloud_composer/qt.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
#include <QThread>
#include <QMessageBox>
#include <QPair>
#include <QStyledItemDelegate>
#include <QUndoGroup>
#include <QFileDialog>
#include <QAction>
#include <QGridLayout>


#endif // CLOUD_COMPOSER_QT_H_
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ namespace pcl
getToolName () const { return "MergeCloudTool";}

};

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ namespace pcl
}
}

Q_DECLARE_METATYPE (pcl::cloud_composer::ToolFactory*);

Q_DECLARE_INTERFACE(pcl::cloud_composer::ToolFactory,
"cloud_composer.ToolFactory/1.0")

#endif //TOOL_FACTORY_H_
#endif //TOOL_FACTORY_H_
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ namespace pcl
}

Q_DECLARE_METATYPE (pcl::cloud_composer::ToolBoxModel);
Q_DECLARE_METATYPE (pcl::cloud_composer::ToolFactory*);
Q_DECLARE_METATYPE (QStandardItemModel*);

#endif //TOOLBOX_MODEL_H_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ namespace pcl
{
Q_OBJECT
Q_INTERFACES (pcl::cloud_composer::ToolFactory)
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif
public:
SplitItemTool*
createTool (PropertiesModel* parameter_model, QObject* parent = 0)
Expand Down Expand Up @@ -107,4 +110,4 @@ namespace pcl



#endif //EUCLIDEAN_CLUSTERING_H_
#endif //EUCLIDEAN_CLUSTERING_H_
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ namespace pcl
{
Q_OBJECT
Q_INTERFACES (pcl::cloud_composer::ToolFactory)
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif
public:
NewItemTool*
createTool (PropertiesModel* parameter_model, QObject* parent = 0)
Expand Down Expand Up @@ -110,4 +113,4 @@ namespace pcl



#endif //FPFH_ESTIMATION_H_
#endif //FPFH_ESTIMATION_H_
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ namespace pcl
{
Q_OBJECT
Q_INTERFACES (pcl::cloud_composer::ToolFactory)
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif
public:
NewItemTool*
createTool (PropertiesModel* parameter_model, QObject* parent = 0)
Expand Down Expand Up @@ -107,4 +110,4 @@ namespace pcl



#endif //NORMAL_ESTIMATION_H_
#endif //NORMAL_ESTIMATION_H_
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
{
Q_OBJECT
Q_INTERFACES (pcl::cloud_composer::ToolFactory)
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif
public:
SplitItemTool*
createTool (PropertiesModel* parameter_model, QObject* parent = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ namespace pcl
{
Q_OBJECT
Q_INTERFACES (pcl::cloud_composer::ToolFactory)
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif
public:
ModifyItemTool*
createTool (PropertiesModel* parameter_model, QObject* parent = 0)
Expand Down Expand Up @@ -107,4 +110,4 @@ namespace pcl



#endif //SANITIZE_CLOUD_H_
#endif //SANITIZE_CLOUD_H_
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ namespace pcl
{
Q_OBJECT
Q_INTERFACES (pcl::cloud_composer::ToolFactory)
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif
public:
ModifyItemTool*
createTool (PropertiesModel* parameter_model, QObject* parent = 0)
Expand Down Expand Up @@ -107,4 +110,4 @@ namespace pcl



#endif //STATISTICAL_OUTLIER_REMOVAL_H_
#endif //STATISTICAL_OUTLIER_REMOVAL_H_
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
{
Q_OBJECT
Q_INTERFACES (pcl::cloud_composer::ToolFactory)
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif
public:
SplitItemTool*
createTool (PropertiesModel* parameter_model, QObject* parent = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ namespace pcl
{
Q_OBJECT
Q_INTERFACES (pcl::cloud_composer::ToolFactory)
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif
public:
ModifyItemTool*
createTool (PropertiesModel* parameter_model, QObject* parent = 0)
Expand Down Expand Up @@ -107,4 +110,4 @@ namespace pcl



#endif //VOXEL_GRID_DOWNSAMPLE_H_
#endif //VOXEL_GRID_DOWNSAMPLE_H_
6 changes: 5 additions & 1 deletion apps/cloud_composer/tools/euclidean_clustering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
#include <pcl/kdtree/kdtree.h>
#include <pcl/segmentation/extract_clusters.h>

Q_EXPORT_PLUGIN2(cloud_composer_euclidean_clustering_tool, pcl::cloud_composer::EuclideanClusteringToolFactory)
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(cloud_composer_euclidean_clustering_tool, pcl::cloud_composer::EuclideanClusteringToolFactory)
#else
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif

pcl::cloud_composer::EuclideanClusteringTool::EuclideanClusteringTool (PropertiesModel* parameter_model, QObject* parent)
: SplitItemTool (parameter_model, parent)
Expand Down
8 changes: 5 additions & 3 deletions apps/cloud_composer/tools/fpfh_estimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
#include <pcl/filters/filter.h>



Q_EXPORT_PLUGIN2(cloud_composer_fpfh_estimation_tool, pcl::cloud_composer::FPFHEstimationToolFactory)

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(cloud_composer_fpfh_estimation_tool, pcl::cloud_composer::FPFHEstimationToolFactory)
#else
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif

pcl::cloud_composer::FPFHEstimationTool::FPFHEstimationTool (PropertiesModel* parameter_model, QObject* parent)
: NewItemTool (parameter_model, parent)
Expand Down
8 changes: 5 additions & 3 deletions apps/cloud_composer/tools/normal_estimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
#include <pcl/features/normal_3d.h>
#include <pcl/point_types.h>


Q_EXPORT_PLUGIN2(cloud_composer_normal_estimation_tool, pcl::cloud_composer::NormalEstimationToolFactory)

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(cloud_composer_normal_estimation_tool, pcl::cloud_composer::NormalEstimationToolFactory)
#else
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif

pcl::cloud_composer::NormalEstimationTool::NormalEstimationTool (PropertiesModel* parameter_model, QObject* parent)
: NewItemTool (parameter_model, parent)
Expand Down
8 changes: 6 additions & 2 deletions apps/cloud_composer/tools/organized_segmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

#include <pcl/apps/cloud_composer/tools/impl/organized_segmentation.hpp>

Q_EXPORT_PLUGIN2(cloud_composer_organized_segmentation_tool, pcl::cloud_composer::OrganizedSegmentationToolFactory)
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(cloud_composer_organized_segmentation_tool, pcl::cloud_composer::OrganizedSegmentationToolFactory)
#else
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif

pcl::cloud_composer::OrganizedSegmentationTool::OrganizedSegmentationTool (PropertiesModel* parameter_model, QObject* parent)
: SplitItemTool (parameter_model, parent)
Expand Down Expand Up @@ -60,4 +64,4 @@ pcl::cloud_composer::OrganizedSegmentationToolFactory::createToolParameterModel


return parameter_model;
}
}
8 changes: 5 additions & 3 deletions apps/cloud_composer/tools/sanitize_cloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
#include <pcl/filters/passthrough.h>



Q_EXPORT_PLUGIN2(cloud_composer_sanitize_cloud_tool, pcl::cloud_composer::SanitizeCloudToolFactory)

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(cloud_composer_sanitize_cloud_tool, pcl::cloud_composer::SanitizeCloudToolFactory)
#else
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif

pcl::cloud_composer::SanitizeCloudTool::SanitizeCloudTool (PropertiesModel* parameter_model, QObject* parent)
: ModifyItemTool (parameter_model, parent)
Expand Down
8 changes: 5 additions & 3 deletions apps/cloud_composer/tools/statistical_outlier_removal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
#include <pcl/filters/statistical_outlier_removal.h>
#include <pcl/point_types.h>


Q_EXPORT_PLUGIN2(cloud_composer_statistical_outlier_removal_tool, pcl::cloud_composer::StatisticalOutlierRemovalToolFactory)

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(cloud_composer_statistical_outlier_removal_tool, pcl::cloud_composer::StatisticalOutlierRemovalToolFactory)
#else
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif

pcl::cloud_composer::StatisticalOutlierRemovalTool::StatisticalOutlierRemovalTool (PropertiesModel* parameter_model, QObject* parent)
: ModifyItemTool (parameter_model, parent)
Expand Down
8 changes: 6 additions & 2 deletions apps/cloud_composer/tools/supervoxels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

#include <pcl/apps/cloud_composer/tools/impl/supervoxels.hpp>

Q_EXPORT_PLUGIN2(cloud_composer_voxel_superpixels_tool, pcl::cloud_composer::SupervoxelsToolFactory)
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(cloud_composer_voxel_superpixels_tool, pcl::cloud_composer::SupervoxelsToolFactory)
#else
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif

pcl::cloud_composer::SupervoxelsTool::SupervoxelsTool (PropertiesModel* parameter_model, QObject* parent)
: SplitItemTool (parameter_model, parent)
Expand Down Expand Up @@ -58,4 +62,4 @@ pcl::cloud_composer::SupervoxelsToolFactory::createToolParameterModel (QObject*
parameter_model->addProperty ("Spatial Weight", 0.4, Qt::ItemIsEditable | Qt::ItemIsEnabled);

return parameter_model;
}
}
8 changes: 5 additions & 3 deletions apps/cloud_composer/tools/voxel_grid_downsample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
#include <pcl/point_types.h>



Q_EXPORT_PLUGIN2(cloud_composer_voxel_grid_downsample_tool, pcl::cloud_composer::VoxelGridDownsampleToolFactory)

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(cloud_composer_voxel_grid_downsample_tool, pcl::cloud_composer::VoxelGridDownsampleToolFactory)
#else
Q_PLUGIN_METADATA(IID "cloud_composer.ToolFactory/1.0")
#endif

pcl::cloud_composer::VoxelGridDownsampleTool::VoxelGridDownsampleTool (PropertiesModel* parameter_model, QObject* parent)
: ModifyItemTool (parameter_model, parent)
Expand Down
2 changes: 1 addition & 1 deletion apps/modeler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PCL_ADD_DOC("${SUBSUBSYS_NAME}")
if(build)
include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include")

# Set Qt files and resources here
# Set Qt files and resources here
set(uis main_window.ui)
set(moc_incs "include/pcl/${SUBSYS_NAME}/${SUBSUBSYS_NAME}/main_window.h"
"include/pcl/${SUBSYS_NAME}/${SUBSUBSYS_NAME}/scene_tree.h"
Expand Down
2 changes: 1 addition & 1 deletion apps/optronic_viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if(build)

include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include")

# Set Qt files and resources here
# Set Qt files and resources here
# set(uis main_window.ui)
set(moc_incs "include/pcl/${SUBSYS_NAME}/${SUBSUBSYS_NAME}/main_window.h"
"include/pcl/${SUBSYS_NAME}/${SUBSUBSYS_NAME}/filter_window.h"
Expand Down