Skip to content

Commit

Permalink
fixes pcl example.
Browse files Browse the repository at this point in the history
  • Loading branch information
dabulla committed Oct 10, 2017
1 parent c0e1881 commit 417ac3f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -13,8 +13,8 @@ find_package(Qt53DQuick REQUIRED)
find_package(Qt53DRender REQUIRED)
find_package(Qt53DQuickRender REQUIRED)

set(WITH_PCL TRUE CACHE BOOL "Enable pcl")
set(WITH_LAS TRUE CACHE BOOL "Enable las")
set(WITH_PCL ON CACHE BOOL "Enable pcl")
set(WITH_LAS OFF CACHE BOOL "Enable las")

if(WITH_PCL)
find_package(PCL REQUIRED COMPONENTS common io)
Expand Down
13 changes: 12 additions & 1 deletion example/CMakeLists.txt
Expand Up @@ -37,7 +37,18 @@ add_executable(Qt3DPointcloudRenderer_example ${SOURCE} ${RESOURCES_RCC} ${QML}

target_link_libraries(Qt3DPointcloudRenderer_example Qt3DPointcloudRenderer)

qt5_use_modules(Qt3DPointcloudRenderer_example Gui Widgets Qml Quick 3DCore 3DInput 3DLogic 3DQuick 3DRender 3DQuickInput 3DQuickRender)
qt5_use_modules(Qt3DPointcloudRenderer_example
Gui
Widgets
Qml
Quick
3DCore
3DInput
3DLogic
3DQuick
3DRender
3DQuickInput
3DQuickRender)

execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
Expand Down
2 changes: 1 addition & 1 deletion include/qpointcloud.h
Expand Up @@ -62,7 +62,7 @@ class QPointcloud : public QObject
const QList<QPointfield *> &getFields();

#if WITH_PCL
pcl::PCLPointCloud2* pointcloud() const;
pcl::PCLPointCloud2* pointcloud();
void setPointcloud(const pcl::PCLPointCloud2 &copy);
#endif
#if WITH_LAS
Expand Down
6 changes: 5 additions & 1 deletion src/qpointcloud.cpp
Expand Up @@ -343,8 +343,12 @@ const QList<QPointfield *> &QPointcloud::getFields()
}

#if WITH_PCL
pcl::PCLPointCloud2 *QPointcloud::pointcloud() const
pcl::PCLPointCloud2 *QPointcloud::pointcloud()
{
if(nullptr == m_priv->m_pointcloud)
{
m_priv->m_pointcloud = new pcl::PCLPointCloud2();
}
return m_priv->m_pointcloud;
}

Expand Down
1 change: 1 addition & 0 deletions src/qpointcloudreader.cpp
Expand Up @@ -22,6 +22,7 @@ void QPointCloudReader::setFilename(QString filename)
{
if (m_filename == filename)
return;

if(filename.endsWith(".pcd", Qt::CaseInsensitive))
{
pcl::PCDReader reader;
Expand Down

0 comments on commit 417ac3f

Please sign in to comment.