Commit 7631538d authored by KLOCZKO Thibaud's avatar KLOCZKO Thibaud

Make Widget layer working.

parent 696fcfdf
...@@ -41,6 +41,16 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) ...@@ -41,6 +41,16 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_INSTALL_RPATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") set(CMAKE_INSTALL_RPATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
## ###################################################################
## Default build type (RelWithDebInfo)
## ###################################################################
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
## ################################################################# ## #################################################################
## Install prefix ## Install prefix
## ################################################################# ## #################################################################
...@@ -62,10 +72,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS "ON") ...@@ -62,10 +72,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
endif()
## ################################################################### ## ###################################################################
## Dependencies - cmake ## Dependencies - cmake
## ################################################################### ## ###################################################################
...@@ -77,75 +83,70 @@ include(GenerateExportHeader) ...@@ -77,75 +83,70 @@ include(GenerateExportHeader)
## ################################################################# ## #################################################################
find_package(VTK REQUIRED) find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
find_package(Qt5 COMPONENTS Core Widgets OpenGL Xml Multimedia MultimediaWidgets WebSockets REQUIRED) find_package(Qt5 COMPONENTS Core Widgets OpenGL Xml Multimedia MultimediaWidgets WebSockets REQUIRED)
include_directories(${Qt5Multimedia_PRIVATE_INCLUDE_DIRS}) #include_directories(${Qt5Multimedia_PRIVATE_INCLUDE_DIRS})
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(dtkCore 2.3.0 REQUIRED) find_package(dtkCore 2.4.0 REQUIRED)
find_package(dtkFonts 2.0.0 REQUIRED) find_package(dtkFonts 2.1.0 REQUIRED)
find_package(dtkWidgets 2.7.0 REQUIRED) find_package(dtkWidgets 2.10.0 REQUIRED)
find_package(dtkThemes 2.0.0 REQUIRED) find_package(dtkThemes 2.0.0 REQUIRED)
find_package(dtkLog 2.1.0 REQUIRED) find_package(dtkLog 2.2.0 REQUIRED)
if(WIN32) if(WIN32)
set(OpenGL_GL_PREFERENCE "GLVND") set(OpenGL_GL_PREFERENCE "GLVND")
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
endif(WIN32) endif(WIN32)
if(MSVC)
add_definitions("/wd4068")
endif(MSVC)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include(${VTK_USE_FILE})
include_directories(${dtkCore_INCLUDE_DIRS})
include_directories(${dtkLog_INCLUDE_DIRS})
include_directories(${dtkFonts_INCLUDE_DIRS})
include_directories(${dtkThemes_INCLUDE_DIRS})
include_directories(${dtkWidgets_INCLUDE_DIRS})
## #################################################################
## Dependencies - internal
## #################################################################
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR}/src/dtkVisualization)
include_directories(${CMAKE_SOURCE_DIR}/src/dtkVisualizationFactory)
include_directories(${CMAKE_SOURCE_DIR}/src/dtkVisualizationWidgets)
## ################################################################### ## ###################################################################
## Input ## Input
## ################################################################### ## ###################################################################
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(app) #add_subdirectory(app)
add_subdirectory(exp) #add_subdirectory(exp)
## ################################################################### ## ###################################################################
## Exporting ## Export configuration
## ################################################################### ## ###################################################################
export(PACKAGE ${PROJECT_NAME}) include(CMakePackageConfigHelpers)
set(${PROJECT_NAME}_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE
STRING "install path for ${PROJECT_NAME}Config.cmake")
set(${PROJECT_NAME}_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src)
configure_package_config_file(cmake/${PROJECT_NAME}Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION "${${PROJECT_NAME}_CMAKE_INSTALL_DIR}"
PATH_VARS ${PROJECT_NAME}_INCLUDE_DIRS)
configure_file(${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in set(${PROJECT_NAME}_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include)
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake" @ONLY) configure_package_config_file(cmake/${PROJECT_NAME}Config.cmake.in
${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION "${${PROJECT_NAME}_CMAKE_INSTALL_DIR}"
PATH_VARS ${PROJECT_NAME}_INCLUDE_DIRS)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.install.cmake.in write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
"${CMAKE_BINARY_DIR}/install/${PROJECT_NAME}Config.cmake" @ONLY) VERSION ${${PROJECT_NAME}_VERSION}
COMPATIBILITY AnyNewerVersion)
## ###################################################################
## Exporting
## ###################################################################
configure_file(${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake.in install(FILES ${CMAKE_CURRENT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" @ONLY) ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${${PROJECT_NAME}_CMAKE_INSTALL_DIR})
install(FILES install(EXPORT layer-targets
"${CMAKE_BINARY_DIR}/install/${PROJECT_NAME}Config.cmake" FILE ${PROJECT_NAME}Targets.cmake
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION ${${PROJECT_NAME}_CMAKE_INSTALL_DIR})
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
install(EXPORT ${PROJECT_NAME}Depends DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) export(PACKAGE ${PROJECT_NAME})
## ################################################################### ## ###################################################################
## Beautifying ## Beautifying
...@@ -155,6 +156,8 @@ mark_as_advanced(${PROJECT_NAME}_VERSION_MAJOR) ...@@ -155,6 +156,8 @@ mark_as_advanced(${PROJECT_NAME}_VERSION_MAJOR)
mark_as_advanced(${PROJECT_NAME}_VERSION_MINOR) mark_as_advanced(${PROJECT_NAME}_VERSION_MINOR)
mark_as_advanced(${PROJECT_NAME}_VERSION_BUILD) mark_as_advanced(${PROJECT_NAME}_VERSION_BUILD)
mark_as_advanced(${PROJECT_NAME}_CMAKE_INSTALL_DIR)
mark_as_advanced(Qt5OpenGL_DIR) mark_as_advanced(Qt5OpenGL_DIR)
mark_as_advanced(Qt5Concurrent_DIR) mark_as_advanced(Qt5Concurrent_DIR)
mark_as_advanced(Qt5Core_DIR) mark_as_advanced(Qt5Core_DIR)
...@@ -170,6 +173,12 @@ mark_as_advanced(Qt5Widgets_DIR) ...@@ -170,6 +173,12 @@ mark_as_advanced(Qt5Widgets_DIR)
mark_as_advanced(Qt5Xml_DIR) mark_as_advanced(Qt5Xml_DIR)
mark_as_advanced(Qt5Sql_DIR) mark_as_advanced(Qt5Sql_DIR)
mark_as_advanced(dtkCore_DIR)
mark_as_advanced(dtkFonts_DIR)
mark_as_advanced(dtkLog_DIR)
mark_as_advanced(dtkThemes_DIR)
mark_as_advanced(dtkWidgets_DIR)
mark_as_advanced(CMAKE_AR) mark_as_advanced(CMAKE_AR)
mark_as_advanced(CMAKE_BUILD_TYPE) mark_as_advanced(CMAKE_BUILD_TYPE)
mark_as_advanced(CMAKE_INSTALL_PREFIX) mark_as_advanced(CMAKE_INSTALL_PREFIX)
...@@ -177,17 +186,5 @@ mark_as_advanced(CMAKE_OSX_ARCHITECTURES) ...@@ -177,17 +186,5 @@ mark_as_advanced(CMAKE_OSX_ARCHITECTURES)
mark_as_advanced(CMAKE_OSX_DEPLOYMENT_TARGET) mark_as_advanced(CMAKE_OSX_DEPLOYMENT_TARGET)
mark_as_advanced(CMAKE_OSX_SYSROOT) mark_as_advanced(CMAKE_OSX_SYSROOT)
## ###################################################################
## Packaging
## ###################################################################
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_VERSION_MAJOR "${${PROJECT_NAME}_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${${PROJECT_NAME}_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${${PROJECT_NAME}_VERSION_PATCH}")
include(CPack)
###################################################################### ######################################################################
### CMakeLists.txt ends here ### CMakeLists.txt ends here
...@@ -12,15 +12,7 @@ ...@@ -12,15 +12,7 @@
## ##
### Code: ### Code:
set(dtkVisualization_INCLUDE_DIRS include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
"@CMAKE_CURRENT_SOURCE_DIR@/src"
"@CMAKE_CURRENT_SOURCE_DIR@/src/dtkVisualization"
"@CMAKE_CURRENT_SOURCE_DIR@/src/dtkVisualizationFactory"
"@CMAKE_CURRENT_SOURCE_DIR@/src/dtkVisualizationFonts"
"@CMAKE_CURRENT_SOURCE_DIR@/src/dtkVisualizationWidgets"
"@CMAKE_CURRENT_BINARY_DIR@")
include("@CMAKE_BINARY_DIR@/dtkVisualizationDepends.cmake")
###################################################################### ######################################################################
### dtkVisualizationConfig.cmake.in ends here ### dtkVisualizationConfig.cmake.in ends here
## Version: $Id$
##
######################################################################
##
### Commentary:
##
######################################################################
##
### Change Log:
##
######################################################################
##
### Code:
set(dtkVisualization_INCLUDE_DIRS
"@CMAKE_INSTALL_PREFIX@/include"
"@CMAKE_INSTALL_PREFIX@/include/dtkVisualization"
"@CMAKE_INSTALL_PREFIX@/include/dtkVisualizationFactory"
"@CMAKE_INSTALL_PREFIX@/include/dtkVisualizationFonts"
"@CMAKE_INSTALL_PREFIX@/include/dtkVisualizationWidgets")
include("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake/dtkVisualization/dtkVisualizationDepends.cmake")
######################################################################
### dtkVisualizationConfig.install.cmake.in ends here
## Version: $Id$
##
######################################################################
##
### Commentary:
##
######################################################################
##
### Change Log:
##
######################################################################
##
### Code:
set(PACKAGE_VERSION "@dtkVisualization_VERSION@")
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
######################################################################
### dtkVisualizationConfigVersion.cmake.in ends here
...@@ -12,25 +12,18 @@ ...@@ -12,25 +12,18 @@
## ##
### Code: ### Code:
add_subdirectory(dtkVisualization) set(layer_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(dtkVisualizationFactory)
add_subdirectory(dtkVisualizationWidgets)
## #################################################################
## Target definition
## #################################################################
set(DTKVISUALIZATION_TARGETS)
set(DTKVISUALIZATION_TARGETS ${DTKVISUALIZATION_TARGETS} dtkVisualization) #add_subdirectory(dtkVisualization)
set(DTKVISUALIZATION_TARGETS ${DTKVISUALIZATION_TARGETS} dtkVisualizationFactory) #add_subdirectory(dtkVisualizationFactory)
set(DTKVISUALIZATION_TARGETS ${DTKVISUALIZATION_TARGETS} dtkVisualizationWidgets) add_subdirectory(dtkVisualizationWidgets)
## ################################################################# ## #################################################################
## Target export ## Target export
## ################################################################# ## #################################################################
export(TARGETS ${DTKVISUALIZATION_TARGETS} FILE "${CMAKE_BINARY_DIR}/dtkVisualizationDepends.cmake") export(EXPORT layer-targets
FILE "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Targets.cmake")
###################################################################### ######################################################################
### CMakeLists.txt ends here ### CMakeLists.txt ends here
...@@ -123,6 +123,13 @@ if(APPLE) ...@@ -123,6 +123,13 @@ if(APPLE)
target_link_libraries(${PROJECT_NAME} "-framework OpenGL") target_link_libraries(${PROJECT_NAME} "-framework OpenGL")
endif(APPLE) endif(APPLE)
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${layer_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
$<INSTALL_INTERFACE:include>)
## ################################################################# ## #################################################################
## Target properties ## Target properties
## ################################################################# ## #################################################################
...@@ -150,19 +157,16 @@ set(${PROJECT_NAME}_HEADERS ...@@ -150,19 +157,16 @@ set(${PROJECT_NAME}_HEADERS
## ################################################################### ## ###################################################################
install(FILES ${${PROJECT_NAME}_HEADERS} install(FILES ${${PROJECT_NAME}_HEADERS}
DESTINATION include/${PROJECT_NAME} DESTINATION include/${PROJECT_NAME})
COMPONENT visualization)
## ################################################################### ## ###################################################################
## Install rules - targets ## Install rules - targets
## ################################################################### ## ###################################################################
install(TARGETS ${PROJECT_NAME} install(TARGETS ${PROJECT_NAME} EXPORT layer-targets
EXPORT ${PROJECT_NAME}Depends
RUNTIME DESTINATION bin
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT visualization) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
###################################################################### ######################################################################
### CMakeLists.txt ends here ### CMakeLists.txt ends here
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
#pragma once #pragma once
#include <dtkVisualizationExport>
#include <QtCore> #include <QtCore>
#include <QtWidgets> #include <QtWidgets>
#include <dtkWidgets/dtkWidgetsWidget> #include <dtkWidgets/dtkWidgetsWidget>
#include <dtkVisualizationExport>
class vtkRenderer; class vtkRenderer;
class vtkRenderWindowInteractor; class vtkRenderWindowInteractor;
class vtkScalarBarActor; class vtkScalarBarActor;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
## ##
### Code: ### Code:
project(dtkVisualizationFactory) project(dtkVisualizationFactory VERSION ${dtkVisualization_VERSION})
## ################################################################# ## #################################################################
## Sources ## Sources
...@@ -38,6 +38,13 @@ add_library(${PROJECT_NAME} SHARED ...@@ -38,6 +38,13 @@ add_library(${PROJECT_NAME} SHARED
target_link_libraries(${PROJECT_NAME} ${VTK_LIBRARIES}) target_link_libraries(${PROJECT_NAME} ${VTK_LIBRARIES})
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${layer_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
$<INSTALL_INTERFACE:include>)
## ################################################################# ## #################################################################
## Target properties ## Target properties
## ################################################################# ## #################################################################
...@@ -45,8 +52,8 @@ target_link_libraries(${PROJECT_NAME} ${VTK_LIBRARIES}) ...@@ -45,8 +52,8 @@ target_link_libraries(${PROJECT_NAME} ${VTK_LIBRARIES})
set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_RPATH 0) set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_RPATH 0)
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${dtkVisualization_VERSION} set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION}
SOVERSION ${dtkVisualization_VERSION_MAJOR}) SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR})
## ################################################################# ## #################################################################
## Export header file ## Export header file
...@@ -65,20 +72,16 @@ set(${PROJECT_NAME}_HEADERS ...@@ -65,20 +72,16 @@ set(${PROJECT_NAME}_HEADERS
## ################################################################### ## ###################################################################
install(FILES ${${PROJECT_NAME}_HEADERS} install(FILES ${${PROJECT_NAME}_HEADERS}
DESTINATION include/${PROJECT_NAME} DESTINATION include/${PROJECT_NAME})
COMPONENT visualization-factory)
## ################################################################### ## ###################################################################
## Install rules - targets ## Install rules - targets
## ################################################################### ## ###################################################################
install(TARGETS ${PROJECT_NAME} EXPORT layer-targets
install(TARGETS ${PROJECT_NAME}
EXPORT dtkVisualizationDepends
RUNTIME DESTINATION bin
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT visualization) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
###################################################################### ######################################################################
### CMakeLists.txt ends here ### CMakeLists.txt ends here
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
## ##
### Code: ### Code:
project(dtkVisualizationWidgets) project(dtkVisualizationWidgets VERSION ${dtkVisualization_VERSION})
## ################################################################# ## #################################################################
## Sources ## Sources
...@@ -53,16 +53,22 @@ add_library(${PROJECT_NAME} SHARED ...@@ -53,16 +53,22 @@ add_library(${PROJECT_NAME} SHARED
${${PROJECT_NAME}_SOURCES_RCC} ${${PROJECT_NAME}_SOURCES_RCC}
${${PROJECT_NAME}_HEADERS}) ${${PROJECT_NAME}_HEADERS})
target_link_libraries(${PROJECT_NAME} Qt5::Core) target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Gui)
target_link_libraries(${PROJECT_NAME} Qt5::OpenGL) target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Xml)
target_link_libraries(${PROJECT_NAME} Qt5::Multimedia)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} Qt5::Xml)
target_link_libraries(${PROJECT_NAME} dtkFonts) target_link_libraries(${PROJECT_NAME} PRIVATE dtkFonts)
target_link_libraries(${PROJECT_NAME} dtkWidgets)
target_link_libraries(${PROJECT_NAME} ${VTK_LIBRARIES}) target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Core)
target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} PRIVATE ${VTK_LIBRARIES})
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${layer_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
$<INSTALL_INTERFACE:include>)
## ################################################################# ## #################################################################
## Target properties ## Target properties
...@@ -71,8 +77,8 @@ target_link_libraries(${PROJECT_NAME} ${VTK_LIBRARIES}) ...@@ -71,8 +77,8 @@ target_link_libraries(${PROJECT_NAME} ${VTK_LIBRARIES})
set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_RPATH 0) set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_RPATH 0)
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${dtkVisualization_VERSION} set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION}
SOVERSION ${dtkVisualization_VERSION_MAJOR}) SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR})
## ################################################################# ## #################################################################
## Export header file ## Export header file
...@@ -91,19 +97,16 @@ set(${PROJECT_NAME}_HEADERS ...@@ -91,19 +97,16 @@ set(${PROJECT_NAME}_HEADERS
## ################################################################### ## ###################################################################
install(FILES ${${PROJECT_NAME}_HEADERS} install(FILES ${${PROJECT_NAME}_HEADERS}
DESTINATION include/${PROJECT_NAME} DESTINATION include/${PROJECT_NAME})
COMPONENT visualization)
## ################################################################### ## ###################################################################
## Install rules - targets ## Install rules - targets
## ################################################################### ## ###################################################################
install(TARGETS ${PROJECT_NAME} install(TARGETS ${PROJECT_NAME} EXPORT layer-targets
EXPORT dtkVisualizationDepends
RUNTIME DESTINATION bin
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT visualization) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
###################################################################### ######################################################################
### CMakeLists.txt ends here ### CMakeLists.txt ends here
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#include "dtkVisualizationWidgetsActorList.h" #include "dtkVisualizationWidgetsActorList.h"
#include <QtWidgets>
#include <vtkActor.h> #include <vtkActor.h>
#include <vtkActorCollection.h> #include <vtkActorCollection.h>
#include <vtkRenderer.h> #include <vtkRenderer.h>
...@@ -22,6 +24,10 @@ ...@@ -22,6 +24,10 @@
#include <vtkAssembly.h> #include <vtkAssembly.h>
#include <vtkProperty.h> #include <vtkProperty.h>
// ///////////////////////////////////////////////////////////////////
// dtkVisualizationWidgetsActorListPrivate
// ///////////////////////////////////////////////////////////////////
class dtkVisualizationWidgetsActorListPrivate : public QTreeWidget class dtkVisualizationWidgetsActorListPrivate : public QTreeWidget
{ {
public: public:
...@@ -31,13 +37,16 @@ public: ...@@ -31,13 +37,16 @@ public:
QList<QTreeWidgetItem *> items; QList<QTreeWidgetItem *> items;
}; };
dtkVisualizationWidgetsActorList::dtkVisualizationWidgetsActorList(QWidget *parent) : QFrame(parent) // ///////////////////////////////////////////////////////////////////
// dtkVisualizationWidgetsActorList
// ///////////////////////////////////////////////////////////////////
dtkVisualizationWidgetsActorList::dtkVisualizationWidgetsActorList(QWidget *parent) : QFrame(parent), d(new dtkVisualizationWidgetsActorListPrivate)
{ {
d = new dtkVisualizationWidgetsActorListPrivate;
d->header()->setVisible(false); d->header()->setVisible(false);
d->setColumnCount(1); d->setColumnCount(1);
d->renderer = Q_NULLPTR; d->renderer = nullptr;
QVBoxLayout *layout = new QVBoxLayout(this); QVBoxLayout *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
...@@ -47,8 +56,6 @@ dtkVisualizationWidgetsActorList::dtkVisualizationWidgetsActorList(QWidget *pare ...@@ -47,8 +56,6 @@ dtkVisualizationWidgetsActorList::dtkVisualizationWidgetsActorList(QWidget *pare
dtkVisualizationWidgetsActorList::~dtkVisualizationWidgetsActorList(void) dtkVisualizationWidgetsActorList::~dtkVisualizationWidgetsActorList(void)
{ {
// qDeleteAll(d->items);
delete d; delete d;
} }
...@@ -63,7 +70,7 @@ void dtkVisualizationWidgetsActorList::update(void) ...@@ -63,7 +70,7 @@ void dtkVisualizationWidgetsActorList::update(void)
d->clear(); d->clear();
vtkActorCollection *actors = d->renderer->GetActors(); vtkActorCollection *actors = d->renderer->GetActors();
vtkActor *actor = Q_NULLPTR; vtkActor *actor = nullptr;
for (int i = 0; i < actors->GetNumberOfItems(); i++) for (int i = 0; i < actors->GetNumberOfItems(); i++)
{ {
...@@ -74,7 +81,7 @@ void dtkVisualizationWidgetsActorList::update(void) ...@@ -74,7 +81,7 @@ void dtkVisualizationWidgetsActorList::update(void)
} }
vtkVolumeCollection *volumes = d->renderer->GetVolumes(); vtkVolumeCollection *volumes = d->renderer->GetVolumes();
vtkVolume *volume = Q_NULLPTR; vtkVolume *volume = nullptr;
for (int i = 0; i < volumes->GetNumberOfItems(); i++) for (int i = 0; i < volumes->GetNumberOfItems(); i++)
{ {
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
#pragma once #pragma once
#include <QtWidgets>
#include <dtkVisualizationWidgetsExport> #include <dtkVisualizationWidgetsExport>
#include <QtWidgets/QFrame>
class vtkRenderer; class vtkRenderer;
class DTKVISUALIZATIONWIDGETS_EXPORT dtkVisualizationWidgetsActorList : public QFrame class DTKVISUALIZATIONWIDGETS_EXPORT dtkVisualizationWidgetsActorList : public QFrame
...@@ -25,7 +25,7 @@ class DTKVISUALIZATIONWIDGETS_EXPORT dtkVisualizationWidgetsActorList : public Q ...@@ -25,7 +25,7 @@ class DTKVISUALIZATIONWIDGETS_EXPORT dtkVisualizationWidgetsActorList : public Q
Q_OBJECT Q_OBJECT
public: public:
dtkVisualizationWidgetsActorList(QWidget *parent = Q_NULLPTR); dtkVisualizationWidgetsActorList(QWidget *parent = nullptr);
~dtkVisualizationWidgetsActorList(void); ~dtkVisualizationWidgetsActorList(void);
public slots: public slots:
......
...@@ -14,9 +14,10 @@ ...@@ -14,9 +14,10 @@
#include "dtkVisualizationWidgetsClutEditor.h" #include "dtkVisualizationWidgetsClutEditor.h"
#include <QtXml> #include <dtkFonts/dtkFontAwesome>
#include <dtkFonts/dtkFontAwesome.h> #include <QtWidgets>
#include <QtXml>