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)
set(CMAKE_INSTALL_RPATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
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
## #################################################################
......@@ -62,10 +72,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
endif()
## ###################################################################
## Dependencies - cmake
## ###################################################################
......@@ -77,75 +83,70 @@ include(GenerateExportHeader)
## #################################################################
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
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(dtkFonts 2.0.0 REQUIRED)
find_package(dtkWidgets 2.7.0 REQUIRED)
find_package(dtkCore 2.4.0 REQUIRED)
find_package(dtkFonts 2.1.0 REQUIRED)
find_package(dtkWidgets 2.10.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)
set(OpenGL_GL_PREFERENCE "GLVND")
find_package(OpenGL REQUIRED)
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
## ###################################################################
add_subdirectory(src)
add_subdirectory(app)
add_subdirectory(exp)
#add_subdirectory(app)
#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
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake" @ONLY)
set(${PROJECT_NAME}_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include)
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
"${CMAKE_BINARY_DIR}/install/${PROJECT_NAME}Config.cmake" @ONLY)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${${PROJECT_NAME}_VERSION}
COMPATIBILITY AnyNewerVersion)
## ###################################################################
## Exporting
## ###################################################################
configure_file(${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake.in
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${${PROJECT_NAME}_CMAKE_INSTALL_DIR})
install(FILES
"${CMAKE_BINARY_DIR}/install/${PROJECT_NAME}Config.cmake"
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
install(EXPORT layer-targets
FILE ${PROJECT_NAME}Targets.cmake
DESTINATION ${${PROJECT_NAME}_CMAKE_INSTALL_DIR})
install(EXPORT ${PROJECT_NAME}Depends DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
export(PACKAGE ${PROJECT_NAME})
## ###################################################################
## Beautifying
......@@ -155,6 +156,8 @@ mark_as_advanced(${PROJECT_NAME}_VERSION_MAJOR)
mark_as_advanced(${PROJECT_NAME}_VERSION_MINOR)
mark_as_advanced(${PROJECT_NAME}_VERSION_BUILD)
mark_as_advanced(${PROJECT_NAME}_CMAKE_INSTALL_DIR)
mark_as_advanced(Qt5OpenGL_DIR)
mark_as_advanced(Qt5Concurrent_DIR)
mark_as_advanced(Qt5Core_DIR)
......@@ -170,6 +173,12 @@ mark_as_advanced(Qt5Widgets_DIR)
mark_as_advanced(Qt5Xml_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_BUILD_TYPE)
mark_as_advanced(CMAKE_INSTALL_PREFIX)
......@@ -177,17 +186,5 @@ mark_as_advanced(CMAKE_OSX_ARCHITECTURES)
mark_as_advanced(CMAKE_OSX_DEPLOYMENT_TARGET)
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
......@@ -12,15 +12,7 @@
##
### Code:
set(dtkVisualization_INCLUDE_DIRS
"@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")
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
######################################################################
### 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 @@
##
### Code:
add_subdirectory(dtkVisualization)
add_subdirectory(dtkVisualizationFactory)
add_subdirectory(dtkVisualizationWidgets)
## #################################################################
## Target definition
## #################################################################
set(DTKVISUALIZATION_TARGETS)
set(layer_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(DTKVISUALIZATION_TARGETS ${DTKVISUALIZATION_TARGETS} dtkVisualization)
set(DTKVISUALIZATION_TARGETS ${DTKVISUALIZATION_TARGETS} dtkVisualizationFactory)
set(DTKVISUALIZATION_TARGETS ${DTKVISUALIZATION_TARGETS} dtkVisualizationWidgets)
#add_subdirectory(dtkVisualization)
#add_subdirectory(dtkVisualizationFactory)
add_subdirectory(dtkVisualizationWidgets)
## #################################################################
## 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
......@@ -123,6 +123,13 @@ if(APPLE)
target_link_libraries(${PROJECT_NAME} "-framework OpenGL")
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
## #################################################################
......@@ -150,19 +157,16 @@ set(${PROJECT_NAME}_HEADERS
## ###################################################################
install(FILES ${${PROJECT_NAME}_HEADERS}
DESTINATION include/${PROJECT_NAME}
COMPONENT visualization)
DESTINATION include/${PROJECT_NAME})
## ###################################################################
## Install rules - targets
## ###################################################################
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Depends
RUNTIME DESTINATION bin
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
install(TARGETS ${PROJECT_NAME} EXPORT layer-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT visualization)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
######################################################################
### CMakeLists.txt ends here
......@@ -14,13 +14,13 @@
#pragma once
#include <dtkVisualizationExport>
#include <QtCore>
#include <QtWidgets>
#include <dtkWidgets/dtkWidgetsWidget>
#include <dtkVisualizationExport>
class vtkRenderer;
class vtkRenderWindowInteractor;
class vtkScalarBarActor;
......
......@@ -12,7 +12,7 @@
##
### Code:
project(dtkVisualizationFactory)
project(dtkVisualizationFactory VERSION ${dtkVisualization_VERSION})
## #################################################################
## Sources
......@@ -38,6 +38,13 @@ add_library(${PROJECT_NAME} SHARED
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
## #################################################################
......@@ -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 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 VERSION ${dtkVisualization_VERSION}
SOVERSION ${dtkVisualization_VERSION_MAJOR})
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION}
SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR})
## #################################################################
## Export header file
......@@ -65,20 +72,16 @@ set(${PROJECT_NAME}_HEADERS
## ###################################################################
install(FILES ${${PROJECT_NAME}_HEADERS}
DESTINATION include/${PROJECT_NAME}
COMPONENT visualization-factory)
DESTINATION include/${PROJECT_NAME})
## ###################################################################
## Install rules - targets
## ###################################################################
install(TARGETS ${PROJECT_NAME}
EXPORT dtkVisualizationDepends
RUNTIME DESTINATION bin
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
install(TARGETS ${PROJECT_NAME} EXPORT layer-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT visualization)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
######################################################################
### CMakeLists.txt ends here
......@@ -12,7 +12,7 @@
##
### Code:
project(dtkVisualizationWidgets)
project(dtkVisualizationWidgets VERSION ${dtkVisualization_VERSION})
## #################################################################
## Sources
......@@ -53,16 +53,22 @@ add_library(${PROJECT_NAME} SHARED
${${PROJECT_NAME}_SOURCES_RCC}
${${PROJECT_NAME}_HEADERS})
target_link_libraries(${PROJECT_NAME} Qt5::Core)
target_link_libraries(${PROJECT_NAME} Qt5::OpenGL)
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} PRIVATE Qt5::Gui)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Xml)
target_link_libraries(${PROJECT_NAME} dtkFonts)
target_link_libraries(${PROJECT_NAME} dtkWidgets)
target_link_libraries(${PROJECT_NAME} PRIVATE dtkFonts)
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
......@@ -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 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 VERSION ${dtkVisualization_VERSION}
SOVERSION ${dtkVisualization_VERSION_MAJOR})
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${${PROJECT_NAME}_VERSION}
SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR})
## #################################################################
## Export header file
......@@ -91,19 +97,16 @@ set(${PROJECT_NAME}_HEADERS
## ###################################################################
install(FILES ${${PROJECT_NAME}_HEADERS}
DESTINATION include/${PROJECT_NAME}
COMPONENT visualization)
DESTINATION include/${PROJECT_NAME})
## ###################################################################
## Install rules - targets
## ###################################################################
install(TARGETS ${PROJECT_NAME}
EXPORT dtkVisualizationDepends
RUNTIME DESTINATION bin
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
install(TARGETS ${PROJECT_NAME} EXPORT layer-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT visualization)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
######################################################################
### CMakeLists.txt ends here
......@@ -14,6 +14,8 @@
#include "dtkVisualizationWidgetsActorList.h"
#include <QtWidgets>
#include <vtkActor.h>
#include <vtkActorCollection.h>
#include <vtkRenderer.h>
......@@ -22,6 +24,10 @@
#include <vtkAssembly.h>
#include <vtkProperty.h>
// ///////////////////////////////////////////////////////////////////
// dtkVisualizationWidgetsActorListPrivate
// ///////////////////////////////////////////////////////////////////
class dtkVisualizationWidgetsActorListPrivate : public QTreeWidget
{
public:
......@@ -31,13 +37,16 @@ public:
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->setColumnCount(1);
d->renderer = Q_NULLPTR;
d->renderer = nullptr;
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
......@@ -47,8 +56,6 @@ dtkVisualizationWidgetsActorList::dtkVisualizationWidgetsActorList(QWidget *pare
dtkVisualizationWidgetsActorList::~dtkVisualizationWidgetsActorList(void)
{
// qDeleteAll(d->items);
delete d;
}
......@@ -63,7 +70,7 @@ void dtkVisualizationWidgetsActorList::update(void)
d->clear();
vtkActorCollection *actors = d->renderer->GetActors();
vtkActor *actor = Q_NULLPTR;
vtkActor *actor = nullptr;
for (int i = 0; i < actors->GetNumberOfItems(); i++)
{
......@@ -74,7 +81,7 @@ void dtkVisualizationWidgetsActorList::update(void)
}
vtkVolumeCollection *volumes = d->renderer->GetVolumes();
vtkVolume *volume = Q_NULLPTR;
vtkVolume *volume = nullptr;
for (int i = 0; i < volumes->GetNumberOfItems(); i++)
{
......
......@@ -14,10 +14,10 @@
#pragma once
#include <QtWidgets>
#include <dtkVisualizationWidgetsExport>
#include <QtWidgets/QFrame>
class vtkRenderer;
class DTKVISUALIZATIONWIDGETS_EXPORT dtkVisualizationWidgetsActorList : public QFrame
......@@ -25,7 +25,7 @@ class DTKVISUALIZATIONWIDGETS_EXPORT dtkVisualizationWidgetsActorList : public Q
Q_OBJECT
public:
dtkVisualizationWidgetsActorList(QWidget *parent = Q_NULLPTR);
dtkVisualizationWidgetsActorList(QWidget *parent = nullptr);
~dtkVisualizationWidgetsActorList(void);
public slots:
......
......@@ -14,9 +14,10 @@
#include "dtkVisualizationWidgetsClutEditor.h"
#include <QtXml>
#include <dtkFonts/dtkFontAwesome>
#include <dtkFonts/dtkFontAwesome.h>
#include <QtWidgets>
#include <QtXml>
#include <vtkColorTransferFunction.h>
#include <vtkLookupTable.h>
......@@ -41,7 +42,7 @@ QPointF dtkVisualizationWidgetsClutEditorMapInv(QPointF vertex, qreal min, qreal
class dtkVisualizationWidgetsClutEditorInterpolator
{
public:
virtual ~dtkVisualizationWidgetsClutEditorInterpolator(void) {}
virtual ~dtkVisualizationWidgetsClutEditorInterpolator(void) = default;
public:
void setStart(dtkVisualizationWidgetsClutEditorVertex *vertex);
......
......@@ -14,11 +14,14 @@
#pragma once
#include <QtCore>
#include <QtGui>
#include <QtWidgets>
#include <dtkVisualizationWidgetsExport>
#include <dtkVisualizationWidgetsExport.h>
#include <QtCore/QObject>
#include <QtWidgets/QGraphicsItem>
#include <QtWidgets/QGraphicsScene>
#include <QtWidgets/QGraphicsView>
#include <QtWidgets/QWidget>
// /////////////////////////////////////////////////////////////////
// dtkVisualizationWidgetsClutEditorVertex
......@@ -27,13 +30,14 @@
class DTKVISUALIZATIONWIDGETS_EXPORT dtkVisualizationWidgetsClutEditorVertex : public QObject, public QGraphicsItem
{
Q_OBJECT
Q_INTERFACES(QGraphicsItem)
public:
dtkVisualizationWidgetsClutEditorVertex(int x, int y, QColor color = Qt::yellow, QGraphicsItem *parent = 0);
dtkVisualizationWidgetsClutEditorVertex(QPointF point, QColor color = Qt::yellow, QGraphicsItem *parent = 0);
dtkVisualizationWidgetsClutEditorVertex(int x, int y, QColor color = Qt::yellow, QGraphicsItem *parent = nullptr);
dtkVisualizationWidgetsClutEditorVertex(QPointF point, QColor color = Qt::yellow, QGraphicsItem *parent = nullptr);
~dtkVisualizationWidgetsClutEditorVertex(void);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);
QRectF boundingRect(void) const;
QPoint position(void) const;
......@@ -56,14 +60,12 @@ private:
// dtkVisualizationWidgetsClutEditorScene
// /////////////////////////////////////////////////////////////////
class dtkVisualizationWidgetsClutEditorScenePrivate;
class DTKVISUALIZATIONWIDGETS_EXPORT dtkVisualizationWidgetsClutEditorScene : public QGraphicsScene
{
Q_OBJECT
public:
dtkVisualizationWidgetsClutEditorScene(QObject *parent = 0);
dtkVisualizationWidgetsClutEditorScene(QObject *parent = nullptr);
~dtkVisualizationWidgetsClutEditorScene(void);
void addItem(QGraphicsItem *item);
......@@ -78,23 +80,21 @@ protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
private:
dtkVisualizationWidgetsClutEditorScenePrivate *d;
class dtkVisualizationWidgetsClutEditorScenePrivate *d;
};
// /////////////////////////////////////////////////////////////////
// dtkVisualizationWidgetsClutEditorView
// /////////////////////////////////////////////////////////////////
class dtkVisualizationWidgetsClutEditorViewPrivate;
class DTKVISUALIZATIONWIDGETS_EXPORT dtkVisualizationWidgetsClutEditorView : public QGraphicsView
{
public:
dtkVisualizationWidgetsClutEditorView(QWidget *parent = 0);
dtkVisualizationWidgetsClutEditorView(QWidget *parent = nullptr);
~dtkVisualizationWidgetsClutEditorView(void);
private:
dtkVisualizationWidgetsClutEditorViewPrivate *d;
class dtkVisualizationWidgetsClutEditorViewPrivate *d;
};
// /////////////////////////////////////////////////////////////////
......@@ -115,10 +115,10 @@ public:
};
public:
typedef QList<int> Histogram;
using Histogram = QList<int>;
public:
dtkVisualizationWidgetsClutEditor(QWidget *parent = 0);
dtkVisualizationWidgetsClutEditor(QWidget *parent = nullptr);
~dtkVisualizationWidgetsClutEditor(void);
void *colorTransferFunction(void);
......
#include "dtkVisualizationWidgetsColorMapEditor.h"
#include <cmath>
#include <QtGui>
#include <QtWidgets>
#include <QtXml>
// /////////////////////////////////////////////////////////////////
......@@ -10,7 +13,7 @@
class dtkVisualizationWidgetsColorMapTable : public QWidget
{
public:
dtkVisualizationWidgetsColorMapTable(QWidget *parent = 0);
dtkVisualizationWidgetsColorMapTable(QWidget *parent = nullptr);
~dtkVisualizationWidgetsColorMapTable(void);
void addColorPoint(double value, const QColor& color);
......@@ -95,7 +98,8 @@ void dtkVisualizationWidgetsColorMapTable::paintEvent(QPaintEvent* event)
// StackedComboBox
// /////////////////////////////////////////////////////////////////
class StackedComboBox : public QComboBox {
class StackedComboBox : public QComboBox
{
public:
StackedComboBox(QWidget *parent);
......@@ -233,7 +237,7 @@ dtkVisualizationWidgetsColorMapEditor::~dtkVisualizationWidgetsColorMapEditor(vo
{
delete d;
d = NULL;
d = nullptr;
}
void dtkVisualizationWidgetsColorMapEditor::enterEvent(QEvent *e)
......
#pragma once
#include <QtCore>
#include <QtGui>
#include <QtWidgets>
#include <dtkVisualizationWidgetsExport>
#include <dtkVisualizationWidgetsExport.h>
#include <QtWidgets/QWidget>
// /////////////////////////////////////////////////////////////////
// dtkVisualizationWidgetsColorMapEditor
......@@ -15,7 +13,7 @@ class DTKVISUALIZATIONWIDGETS_EXPORT dtkVisualizationWidgetsColorMapEditor : pub
Q_OBJECT
public:
dtkVisualizationWidgetsColorMapEditor(QWidget *parent = 0);
dtkVisualizationWidgetsColorMapEditor(QWidget *parent = nullptr);
~dtkVisualizationWidgetsColorMapEditor(void);
const QString& name(void) const;
......