diff --git a/CMakeExternals/GenerateDefaultCMakeBuildSystem.cmake b/CMakeExternals/GenerateDefaultCMakeBuildSystem.cmake deleted file mode 100644 index 0aa7d7df91..0000000000 --- a/CMakeExternals/GenerateDefaultCMakeBuildSystem.cmake +++ /dev/null @@ -1,49 +0,0 @@ -set(ProjConfig.cmake.in " -set(${proj}_LIBRARIES @${proj}_LIBRARIES@) - -if(NOT TARGET ${proj_target}) - include(\"\${CMAKE_CURRENT_LIST_DIR}/${proj}Targets.cmake\") -endif() -") - -set(ProjConfigVersion.cmake.in " -# The created file sets PACKAGE_VERSION_EXACT if the current version string and -# the requested version string are exactly the same and it sets -# PACKAGE_VERSION_COMPATIBLE if the current version major number == requested version major number -# and the current version minor number >= requested version minor number - -set(PACKAGE_VERSION_MAJOR @${proj}_MAJOR_VERSION@) -set(PACKAGE_VERSION_MINOR @${proj}_MINOR_VERSION@) -set(PACKAGE_VERSION_PATCH @${proj}_PATCH_VERSION@) -set(PACKAGE_VERSION \"@${proj}_VERSION@\") - -if(PACKAGE_VERSION VERSION_EQUAL PACKAGE_FIND_VERSION) - set(PACKAGE_VERSION_EXACT TRUE) -else() - set(PACKAGE_VERSION_EXACT FALSE) - if(NOT PACKAGE_VERSION_MAJOR EQUAL PACKAGE_FIND_VERSION_MAJOR) - set(PACKAGE_VERSION_COMPATIBLE FALSE) - elseif(PACKAGE_VERSION_MINOR LESS PACKAGE_FIND_VERSION_MINOR) - set(PACKAGE_VERSION_COMPATIBLE FALSE) - else() - set(PACKAGE_VERSION_CcOMPATIBLE TRUE) - endif() -endif() - -# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if(\"\${CMAKE_SIZEOF_VOID_P}\" STREQUAL \"\" OR \"@CMAKE_SIZEOF_VOID_P@\" STREQUAL \"\") - return() -endif() - -# check that the installed version has the same 32/64bit-ness as the one which is currently searching: -if(NOT \"\${CMAKE_SIZEOF_VOID_P}\" STREQUAL \"@CMAKE_SIZEOF_VOID_P@\") - math(EXPR installedBits \"@CMAKE_SIZEOF_VOID_P@ * 8\") - set(PACKAGE_VERSION \"\${PACKAGE_VERSION} (\${installedBits}bit)\") - set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif() -") - -configure_file(${CMAKE_CURRENT_LIST_DIR}/${proj}CMakeLists.txt "${CMAKE_CURRENT_BINARY_DIR}/CMakeLists.txt" COPYONLY) - -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${proj}Config.cmake.in "${ProjConfig.cmake.in}") -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${proj}ConfigVersion.cmake.in "${ProjConfigVersion.cmake.in}") diff --git a/CMakeExternals/Qwt.cmake b/CMakeExternals/Qwt.cmake index e14f51089a..319d941763 100644 --- a/CMakeExternals/Qwt.cmake +++ b/CMakeExternals/Qwt.cmake @@ -1,61 +1,57 @@ #----------------------------------------------------------------------------- # Qwt #----------------------------------------------------------------------------- if(MITK_USE_Qwt) # Sanity checks if(DEFINED Qwt_DIR AND NOT EXISTS ${Qwt_DIR}) message(FATAL_ERROR "Qwt_DIR variable is defined but corresponds to non-existing directory") endif() set(proj Qwt) set(proj_DEPENDENCIES ) set(${proj}_DEPENDS ${proj}) if(NOT DEFINED ${proj}_DIR) - set(patch_cmd ${CMAKE_COMMAND} -Dproj:STRING=${proj} -Dproj_target:STRING=qwt -P ${CMAKE_CURRENT_LIST_DIR}/GenerateDefaultCMakeBuildSystem.cmake) - set(qt54patch_cmd ${CMAKE_COMMAND} -DTEMPLATE_FILE:FILEPATH=${MITK_SOURCE_DIR}/CMakeExternals/EmptyFileForPatching.dummy -P ${MITK_SOURCE_DIR}/CMakeExternals/PatchQwt-6.1.0.cmake) - set(additional_cmake_args "-DQt5Svg_DIR:PATH=${Qt5Svg_DIR}" "-DQt5OpenGL_DIR:PATH=${Qt5OpenGL_DIR}" "-DQt5PrintSupport_DIR:PATH=${Qt5PrintSupport_DIR}" "-DQt5Concurrent_DIR:PATH=${Qt5Concurrent_DIR}" "-DQt5Designer_DIR:PATH=${Qt5_DIR}Designer" ) if(CTEST_USE_LAUNCHERS) list(APPEND additional_cmake_args "-DCMAKE_PROJECT_${proj}_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake" ) endif() ExternalProject_Add(${proj} LIST_SEPARATOR ${sep} - URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/qwt-6.1.5.tar.bz2 - URL_MD5 d65582f99312796ed42c3be3208ed3db - PATCH_COMMAND ${CMAKE_COMMAND} -Dproj=${proj} -Dproj_target:STRING=qwt -P ${CMAKE_CURRENT_LIST_DIR}/GenerateDefaultCMakeBuildSystem.cmake + GIT_REPOSITORY https://github.com/MITK/Qwt.git + GIT_TAG v6.2.0-patched CMAKE_GENERATOR ${gen} CMAKE_GENERATOR_PLATFORM ${gen_platform} CMAKE_ARGS ${ep_common_args} ${additional_cmake_args} - ${qt_project_args} CMAKE_CACHE_ARGS + -DQWT_BUILD_DESIGNER_PLUGIN:BOOL=OFF ${ep_common_cache_args} CMAKE_CACHE_DEFAULT_ARGS ${ep_common_cache_default_args} DEPENDS ${proj_DEPENDENCIES} ) set(${proj}_DIR ${ep_prefix}) mitkFunctionInstallExternalCMakeProject(${proj}) else() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") endif() endif() diff --git a/CMakeExternals/QwtCMakeLists.txt b/CMakeExternals/QwtCMakeLists.txt deleted file mode 100644 index 5c91a4acac..0000000000 --- a/CMakeExternals/QwtCMakeLists.txt +++ /dev/null @@ -1,264 +0,0 @@ -cmake_minimum_required(VERSION 3.18) - -project(Qwt) - -set(${PROJECT_NAME}_MAJOR_VERSION 6) -set(${PROJECT_NAME}_MINOR_VERSION 1) -set(${PROJECT_NAME}_PATCH_VERSION 0) -set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_VERSION}) - -set(QWT_MOC_HEADERS - - # General - qwt_dyngrid_layout.h - qwt_magnifier.h - qwt_panner.h - qwt_picker.h - qwt_text_label.h - - # QwtPlot - qwt_abstract_legend.h - qwt_legend.h - qwt_legend_label.h - qwt_plot.h - qwt_plot_renderer.h - qwt_plot_canvas.h - qwt_plot_panner.h - qwt_plot_picker.h - qwt_plot_zoomer.h - qwt_plot_magnifier.h - qwt_sampling_thread.h - qwt_scale_widget.h - - # QwtOpenGL - qwt_plot_glcanvas.h - - # QwtWidgets - qwt_abstract_slider.h - qwt_abstract_scale.h - qwt_analog_clock.h - qwt_compass.h - qwt_counter.h - qwt_dial.h - qwt_knob.h - qwt_slider.h - qwt_thermo.h - qwt_wheel.h -) - -set(QWT_SOURCES - - # General - qwt_abstract_scale_draw.cpp - qwt_clipper.cpp - qwt_color_map.cpp - qwt_column_symbol.cpp - qwt_date.cpp - qwt_date_scale_draw.cpp - qwt_date_scale_engine.cpp - qwt_dyngrid_layout.cpp - qwt_event_pattern.cpp - qwt_graphic.cpp - qwt_interval.cpp - qwt_interval_symbol.cpp - qwt_math.cpp - qwt_magnifier.cpp - qwt_null_paintdevice.cpp - qwt_painter.cpp - qwt_painter_command.cpp - qwt_panner.cpp - qwt_picker.cpp - qwt_picker_machine.cpp - qwt_pixel_matrix.cpp - qwt_point_3d.cpp - qwt_point_polar.cpp - qwt_round_scale_draw.cpp - qwt_scale_div.cpp - qwt_scale_draw.cpp - qwt_scale_map.cpp - qwt_spline.cpp - qwt_scale_engine.cpp - qwt_symbol.cpp - qwt_system_clock.cpp - qwt_text_engine.cpp - qwt_text_label.cpp - qwt_text.cpp - qwt_transform.cpp - qwt_widget_overlay.cpp - - # QwtPlot - qwt_curve_fitter.cpp - qwt_abstract_legend.cpp - qwt_legend.cpp - qwt_legend_data.cpp - qwt_legend_label.cpp - qwt_plot.cpp - qwt_plot_renderer.cpp - qwt_plot_xml.cpp - qwt_plot_axis.cpp - qwt_plot_curve.cpp - qwt_plot_dict.cpp - qwt_plot_directpainter.cpp - qwt_plot_grid.cpp - qwt_plot_histogram.cpp - qwt_plot_item.cpp - qwt_plot_abstract_barchart.cpp - qwt_plot_barchart.cpp - qwt_plot_multi_barchart.cpp - qwt_plot_intervalcurve.cpp - qwt_plot_zoneitem.cpp - qwt_plot_tradingcurve.cpp - qwt_plot_spectrogram.cpp - qwt_plot_spectrocurve.cpp - qwt_plot_scaleitem.cpp - qwt_plot_legenditem.cpp - qwt_plot_seriesitem.cpp - qwt_plot_shapeitem.cpp - qwt_plot_marker.cpp - qwt_plot_textlabel.cpp - qwt_plot_layout.cpp - qwt_plot_canvas.cpp - qwt_plot_panner.cpp - qwt_plot_rasteritem.cpp - qwt_plot_picker.cpp - qwt_plot_zoomer.cpp - qwt_plot_magnifier.cpp - qwt_plot_rescaler.cpp - qwt_point_mapper.cpp - qwt_raster_data.cpp - qwt_matrix_raster_data.cpp - qwt_sampling_thread.cpp - qwt_series_data.cpp - qwt_point_data.cpp - qwt_scale_widget.cpp - - # QwtSvg - qwt_plot_svgitem.cpp - - # QwtOpenGL - qwt_plot_glcanvas.cpp - - # QwtWidgets - qwt_abstract_slider.cpp - qwt_abstract_scale.cpp - qwt_arrow_button.cpp - qwt_analog_clock.cpp - qwt_compass.cpp - qwt_compass_rose.cpp - qwt_counter.cpp - qwt_dial.cpp - qwt_dial_needle.cpp - qwt_knob.cpp - qwt_slider.cpp - qwt_thermo.cpp - qwt_wheel.cpp - -) - -set(_qwt_moc_headers ) -foreach(_header ${QWT_MOC_HEADERS}) - list(APPEND _qwt_moc_headers src/${_header}) -endforeach() - -set(_qwt_sources ) -foreach(_source ${QWT_SOURCES}) - list(APPEND _qwt_sources src/${_source}) -endforeach() - -find_package(Qt5Svg REQUIRED) -find_package(Qt5OpenGL REQUIRED) -find_package(Qt5PrintSupport REQUIRED) -find_package(Qt5Concurrent REQUIRED) - -qt5_wrap_cpp(_qwt_sources ${_qwt_moc_headers}) - -add_library(qwt SHARED ${_qwt_sources}) -target_link_libraries(qwt PUBLIC Qt5::Svg Qt5::OpenGL Qt5::PrintSupport Qt5::Concurrent) - -target_compile_definitions(qwt PUBLIC QWT_DLL PRIVATE QWT_MAKEDLL) -set_target_properties(qwt PROPERTIES - SOVERSION ${${PROJECT_NAME}_VERSION} -) - - -# Build the designer plug-in - -option(QWT_BUILD_DESIGNER_PLUGIN "Build the Qt Designer plugin" ON) - if (QWT_BUILD_DESIGNER_PLUGIN) - - include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) - - set(_qwt_designer_sources - designer/qwt_designer_plotdialog.cpp - designer/qwt_designer_plugin.cpp - ) - - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/plugins/designer) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/plugins/designer) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/plugins/designer) - - find_package(Qt5Designer REQUIRED) - include_directories(${Qt5Designer_INCLUDE_DIRS}) - qt5_wrap_cpp(_qwt_designer_sources - designer/qwt_designer_plugin.h - designer/qwt_designer_plotdialog.h - ) - qt5_add_resources(_qwt_designer_sources designer/qwt_designer_plugin.qrc) - - add_library(qwt_designer_plugin SHARED ${_qwt_designer_sources}) - target_link_libraries(qwt_designer_plugin qwt Qt5::Designer) - - set_target_properties(qwt_designer_plugin PROPERTIES - SOVERSION ${${PROJECT_NAME}_VERSION} - COMPILE_DEFINITIONS QWT_DLL) -endif() - -set(${PROJECT_NAME}_LIBRARIES qwt) - -# Install support - -if (QWT_BUILD_DESIGNER_PLUGIN) - install(TARGETS qwt_designer_plugin - RUNTIME DESTINATION plugins/designer - LIBRARY DESTINATION plugins/designer - ) -endif() - -install(TARGETS ${${PROJECT_NAME}_LIBRARIES} EXPORT ${PROJECT_NAME}_TARGETS - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/${PROJECT_NAME} -) -install(DIRECTORY src/ - DESTINATION include/${PROJECT_NAME} - FILES_MATCHING PATTERN "*.h" -) - -# Config files - -configure_file( - ${PROJECT_NAME}Config.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake - @ONLY -) -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}ConfigVersion.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake - @ONLY -) - -export(EXPORT ${PROJECT_NAME}_TARGETS - FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake -) - -set(config_package_location lib/cmake/${PROJECT_NAME}) -install(EXPORT ${PROJECT_NAME}_TARGETS - FILE ${PROJECT_NAME}Targets.cmake - DESTINATION ${config_package_location} -) -install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" - DESTINATION ${config_package_location} -) diff --git a/Modules/QtWidgetsExt/include/QmitkHistogram.h b/Modules/QtWidgetsExt/include/QmitkHistogram.h index 6a0138af17..8becdc7e9d 100644 --- a/Modules/QtWidgetsExt/include/QmitkHistogram.h +++ b/Modules/QtWidgetsExt/include/QmitkHistogram.h @@ -1,57 +1,58 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef QMITKHISTOGRAM_H #define QMITKHISTOGRAM_H #include #include #include #include +#include /** \brief Used to create a histogram that can be shown in a Qwt Plot. See QmitkHistogramWidget for an example of its usage. */ class QmitkHistogram : public QwtPlotItem { public: explicit QmitkHistogram(const QString &title = QString::null); explicit QmitkHistogram(const QwtText &title); ~QmitkHistogram() override; void setData(const QwtIntervalSeriesData &data); const QwtIntervalSeriesData &data() const; void setColor(const QColor &); QColor color() const; QRectF boundingRect() const override; void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const override; void setBaseline(double reference); double baseline() const; protected: virtual void drawBar(QPainter *, Qt::Orientation o, const QRect &) const; private: void init(); class HistogramData; HistogramData *m_Data; }; #endif diff --git a/Modules/QtWidgetsExt/include/QmitkPlotWidget.h b/Modules/QtWidgetsExt/include/QmitkPlotWidget.h index d8849416c1..caf0e86ab5 100644 --- a/Modules/QtWidgetsExt/include/QmitkPlotWidget.h +++ b/Modules/QtWidgetsExt/include/QmitkPlotWidget.h @@ -1,300 +1,301 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef _QmitkPlotWidget_H_ #define _QmitkPlotWidget_H_ #include "MitkQtWidgetsExtExports.h" #include "mitkCommon.h" #include #include #include #include #include #include +#include #include #include /** * Provides a convenient interface for plotting curves using qwt. * Designed for qwt version 5.2.1. * Can be used with a QmitkPlotDialog, which provides a "Close" button. * @see QmitkPlotDialog * * To plot data do the following: * 1. Create two QmitkPlotWidget::DataVector Objects and fill them * with corresponding x/y values. DataVectors are simple stl-vectors * of type std::vector. Please note that the xValues * vector and the yValues vector MUST have the same size. * 2. Instantiate the widget for example like that: * QmitkPlotWidget* widget = new QmitkPlotWidget( this, "widget" ); * widget->SetAxisTitle( QwtPlot::xBottom, "My x asis [mm]" ); * widget->SetAxisTitle( QwtPlot::yLeft, "My y axis [mm]" ); * int curveId = widget->InsertCurve( "My sophisticated data" ); * widget->SetCurveData( curveId, xValues, yValues ); * widget->SetCurvePen( curveId, QPen( red ) ); * widget->SetCurveTitle( curveId, "My curve description" ); * widget->Replot(); * 3. You can modify the behavior of the plot by directly referencing * the QwtPlot instance using the method GetPlot(). * @see QwtPlot * @deprecatedSince{2018_04} Use QmitkChartWidget instead */ class MITKQTWIDGETSEXT_EXPORT QmitkPlotWidget : public QWidget { private: Q_OBJECT public: /** * represents the data type used for scalar values stored * in data arrays. This type is provided by qwt and may not * be changed. */ typedef double ScalarType; /** * This type may be used to store a set of scalar values * representing either x or y coordinates of the data * points that should be rendered. */ typedef std::vector DataVector; /** * convenience type used to store pairs representing x/y coordinates * that should be rendered as a curve by the plot widget */ typedef std::vector> XYDataVector; /** * Standard qt constructor */ QmitkPlotWidget(QWidget *parent = nullptr, const char *title = nullptr, const char *name = nullptr, Qt::WindowFlags f = nullptr); /** * Virtual destructor */ ~QmitkPlotWidget() override; /** * Returns the instance of the plot-widget. This may be used * to modify any detail of the appearance of the plot. */ QwtPlot *GetPlot(); /** * Set the title using (formatted) QwtText object */ void SetPlotTitle(const QwtText &qwt_title); /** * Set plain text title, using default formatting */ void SetPlotTitle(const char *title); /** * Inserts a new curve into the plot-window. * @param title the name of the curve * @param color * @returns the id of the curve. Use this id to * refer to the curve, if you want to modify or add data. */ unsigned int InsertCurve(const char *title, QColor color = QColor(Qt::black)); /** * Sets the title of the given axis. For the set of available axes * @see QwtPlot::Axis. * @param axis the axis for which the description should be set. * @param title the name of the axis. */ void SetAxisTitle(int axis, const char *title); /** * Sets the data for a previously added curve. Data is provided as two vectors of double. * The first vector represents the x coordinates, the second vector represents the y coordinates. * @param curveId the id of the curve for which data should be added. * @param xValues the x coordinates of the points that define the curve * @param yValues the y coordinates of the points that define the curve * @returns whether data was added successfully or not */ bool SetCurveData(unsigned int curveId, const DataVector &xValues, const DataVector &yValues); /** * @brief Sets the data with errors for a previously added curve. * * @param curveId the id of the curve for which data should be added. * @param xValues the x coordinates of the points that define the curve * @param yValues the y coordinates of the points that define the curve * @param yLowerError the magnitude (>0) of the error in the lesser direction of y * @param yUpperError the magnitude (>0) of the error in the larger direction of y * @returns whether data was added successfully or not */ bool SetCurveData(unsigned int curveId, const DataVector &xValues, const DataVector &yValues, const DataVector &yLowerError, const DataVector &yUpperError); /** * @brief Sets the data with errors for a previously added curve. * * @param curveId the id of the curve for which data should be added. * @param xValues the x coordinates of the points that define the curve * @param yValues the y coordinates of the points that define the curve * @param xLowerError the magnitude (>0) of the error in the lesser direction of x * @param xUpperError the magnitude (>0) of the error in the larger direction of x * @param yLowerError the magnitude (>0) of the error in the lesser direction of y * @param yUpperError the magnitude (>0) of the error in the larger direction of y * @returns whether data was added successfully or not */ bool SetCurveData(unsigned int curveId, const DataVector &xValues, const DataVector &yValues, const DataVector &xLowerError, const DataVector &xUpperError, const DataVector &yLowerError, const DataVector &yUpperError); /** * Sets the data for a previously added curve. Data is provided as a vectors of pairs. * The pairs represent x/y coordinates of the points that define the curve. * @param curveId the id of the curve for which data should be added. * @param data the coordinates of the points that define the curve * @returns whether data was added successfully or not */ bool SetCurveData(unsigned int curveId, const XYDataVector &data); /** * Defines how a curve should be drawn. For drawing a curve, a QPen is used. * @param curveId the id of the curve for which appearance should be changed * @param pen a QPen (@see QPen) defining the line style */ void SetCurvePen(unsigned int curveId, const QPen &pen); /** * Assign a brush, which defines the fill pattern of shapes drawn by a QPainter. * In case of brush.style() != QBrush::NoBrush and * style() != QwtPlotCurve::Sticks * the area between the curve and the baseline will be filled. * In case !brush.color().isValid() the area will be filled by pen.color(). * The fill algorithm simply connects the first and the last curve point to the * baseline. So the curve data has to be sorted (ascending or descending). * @param curveId the id of the curve for which appearance should be changed * @param brush a QBrush (@see QBrush) defining the line style */ void SetCurveBrush(unsigned int curveId, const QBrush &brush); /** * Sets the style how the line is drawn for the curve; like, plain line, * or with the data points marked with a symbol; * @param curveId * @param style A QwtPlotCurve::CurveStyle */ void SetCurveStyle(unsigned int curveId, const QwtPlotCurve::CurveStyle style); /** * Sets the style data points are drawn for the curve; like, a line, * or dots; * @param curveId * @param symbol A QwtSymbol */ void SetCurveSymbol(unsigned int curveId, QwtSymbol *symbol); void SetCurveAntialiasingOn(unsigned int curveId); void SetCurveAntialiasingOff(unsigned int curveId); /** * Sets the title of the given curve. The title will be shown in the legend of * the QwtPlot. * @param curveId the id of the curve for which the title should be set * @param title the description of the curve that will be shown in the legend. */ void SetCurveTitle(unsigned int curveId, const char *title); /** * Defines how a curves errors should be drawn. For drawing a QPen is used. * @param curveId the id of the curve for which error appearance should be changed * @param pen a QPen (@see QPen) defining the line style */ void SetErrorPen(unsigned int curveId, const QPen &pen); /** * Defines the style of errors, symbols or as a curve. * @param curveId the id of the curve for which error appearance should be changed * @param drawSmybols true - draw symbols, false - draw curve */ void SetErrorStyleSymbols(unsigned int curveId, bool drawSmybols); /** * Sets the legend of the plot * */ void SetLegend(QwtLegend *legend, QwtPlot::LegendPosition pos = QwtPlot::RightLegend, double ratio = -1); /** * Set a curve's legend attribute * @param curveId the id of the curve * @param attribute the legend attribute to be set */ void SetLegendAttribute(unsigned int curveId, const QwtPlotCurve::LegendAttribute &attribute); /** * Triggers a replot of the curve. Replot should be called once after * setting new data. */ void Replot(); /** * Resets the plot into an empty state */ void Clear(); protected: /** * Converts the given values into a raw double* array. * A new array is allocated via new and must be deleted[] by the caller. */ double *ConvertToRawArray(const DataVector &values); /** * Converts the given values into a raw double* array. * A new array is allocated via new and must be deleted[] by the caller. * @param values the x/y values to convert to an array * @param component defines if the x values (0) or the y values(1) should * be converted. Other values than 0 and 1 will not be accepted. */ double *ConvertToRawArray(const XYDataVector &values, unsigned int component); /** * Adds an error interval curve. * * All errors should be absolutes. The magnitude will be used. * * @param curveId Which curve should the error curve be added to * @param lessError Error in the negative direction (value - lessError) * @param moreError Error in the positive direction (value + lessError) * @param isXError Should the error bars be drawn horizontally */ bool AddErrorIntervalCurve(unsigned int curveId, const DataVector &lessError, const DataVector &moreError, bool isXError); QwtPlot *m_Plot; std::vector> m_PlotCurveVector; }; #endif