@@ -0,0 +1,40 | |||||
|
1 | #ifndef SCIQLOP_QCPCOLORMAPITERATOR_H | |||
|
2 | #define SCIQLOP_QCPCOLORMAPITERATOR_H | |||
|
3 | ||||
|
4 | #include <iterator> | |||
|
5 | ||||
|
6 | class QCPColorMapData; | |||
|
7 | ||||
|
8 | /** | |||
|
9 | * Forward iterator for @sa QCPColorMap | |||
|
10 | */ | |||
|
11 | class QCPColorMapIterator { | |||
|
12 | public: | |||
|
13 | using iterator_category = std::forward_iterator_tag; | |||
|
14 | using value_type = double; | |||
|
15 | using difference_type = std::ptrdiff_t; | |||
|
16 | using pointer = const value_type *; | |||
|
17 | using reference = value_type; | |||
|
18 | ||||
|
19 | explicit QCPColorMapIterator(QCPColorMapData *data, bool begin); | |||
|
20 | virtual ~QCPColorMapIterator() noexcept = default; | |||
|
21 | ||||
|
22 | QCPColorMapIterator &operator++(); | |||
|
23 | QCPColorMapIterator operator++(int); | |||
|
24 | ||||
|
25 | pointer operator->() const; | |||
|
26 | reference operator*() const; | |||
|
27 | ||||
|
28 | bool operator==(const QCPColorMapIterator &other); | |||
|
29 | bool operator!=(const QCPColorMapIterator &other); | |||
|
30 | ||||
|
31 | private: | |||
|
32 | void updateValue(); | |||
|
33 | ||||
|
34 | QCPColorMapData *m_Data; ///< Data iterated | |||
|
35 | int m_KeyIndex; ///< Current iteration key index | |||
|
36 | int m_ValueIndex; ///< Current iteration value index | |||
|
37 | double m_Value; ///< Current iteration value | |||
|
38 | }; | |||
|
39 | ||||
|
40 | #endif // SCIQLOP_QCPCOLORMAPITERATOR_H |
@@ -0,0 +1,58 | |||||
|
1 | #include "Visualization/QCPColorMapIterator.h" | |||
|
2 | ||||
|
3 | #include <Visualization/qcustomplot.h> | |||
|
4 | ||||
|
5 | QCPColorMapIterator::QCPColorMapIterator(QCPColorMapData *data, bool begin) | |||
|
6 | : m_Data{data}, m_KeyIndex{begin ? 0 : data->keySize()}, m_ValueIndex{0} | |||
|
7 | { | |||
|
8 | updateValue(); | |||
|
9 | } | |||
|
10 | ||||
|
11 | QCPColorMapIterator &QCPColorMapIterator::operator++() | |||
|
12 | { | |||
|
13 | // Increments indexes | |||
|
14 | ++m_ValueIndex; | |||
|
15 | if (m_ValueIndex == m_Data->valueSize()) { | |||
|
16 | ++m_KeyIndex; | |||
|
17 | m_ValueIndex = 0; | |||
|
18 | } | |||
|
19 | ||||
|
20 | // Updates value | |||
|
21 | updateValue(); | |||
|
22 | ||||
|
23 | return *this; | |||
|
24 | } | |||
|
25 | ||||
|
26 | QCPColorMapIterator QCPColorMapIterator::operator++(int) | |||
|
27 | { | |||
|
28 | auto result = *this; | |||
|
29 | this->operator++(); | |||
|
30 | return result; | |||
|
31 | } | |||
|
32 | ||||
|
33 | QCPColorMapIterator::pointer QCPColorMapIterator::operator->() const | |||
|
34 | { | |||
|
35 | return &m_Value; | |||
|
36 | } | |||
|
37 | ||||
|
38 | QCPColorMapIterator::reference QCPColorMapIterator::operator*() const | |||
|
39 | { | |||
|
40 | return m_Value; | |||
|
41 | } | |||
|
42 | ||||
|
43 | bool QCPColorMapIterator::operator==(const QCPColorMapIterator &other) | |||
|
44 | { | |||
|
45 | return std::tie(m_Data, m_KeyIndex, m_ValueIndex) | |||
|
46 | == std::tie(other.m_Data, other.m_KeyIndex, other.m_ValueIndex); | |||
|
47 | } | |||
|
48 | ||||
|
49 | bool QCPColorMapIterator::operator!=(const QCPColorMapIterator &other) | |||
|
50 | { | |||
|
51 | return !(*this == other); | |||
|
52 | } | |||
|
53 | ||||
|
54 | void QCPColorMapIterator::updateValue() | |||
|
55 | { | |||
|
56 | m_Value = m_KeyIndex != m_Data->keySize() ? m_Data->cell(m_KeyIndex, m_ValueIndex) | |||
|
57 | : std::numeric_limits<double>::quiet_NaN(); | |||
|
58 | } |
@@ -1,100 +1,101 | |||||
1 |
|
1 | |||
2 | gui_moc_headers = [ |
|
2 | gui_moc_headers = [ | |
3 | 'include/DataSource/DataSourceWidget.h', |
|
3 | 'include/DataSource/DataSourceWidget.h', | |
4 | 'include/Settings/SqpSettingsDialog.h', |
|
4 | 'include/Settings/SqpSettingsDialog.h', | |
5 | 'include/Settings/SqpSettingsGeneralWidget.h', |
|
5 | 'include/Settings/SqpSettingsGeneralWidget.h', | |
6 | 'include/SidePane/SqpSidePane.h', |
|
6 | 'include/SidePane/SqpSidePane.h', | |
7 | 'include/SqpApplication.h', |
|
7 | 'include/SqpApplication.h', | |
8 | 'include/DragAndDrop/DragDropScroller.h', |
|
8 | 'include/DragAndDrop/DragDropScroller.h', | |
9 | 'include/DragAndDrop/DragDropTabSwitcher.h', |
|
9 | 'include/DragAndDrop/DragDropTabSwitcher.h', | |
10 | 'include/TimeWidget/TimeWidget.h', |
|
10 | 'include/TimeWidget/TimeWidget.h', | |
11 | 'include/Variable/VariableInspectorWidget.h', |
|
11 | 'include/Variable/VariableInspectorWidget.h', | |
12 | 'include/Variable/RenameVariableDialog.h', |
|
12 | 'include/Variable/RenameVariableDialog.h', | |
13 | 'include/Visualization/qcustomplot.h', |
|
13 | 'include/Visualization/qcustomplot.h', | |
14 | 'include/Visualization/VisualizationGraphWidget.h', |
|
14 | 'include/Visualization/VisualizationGraphWidget.h', | |
15 | 'include/Visualization/VisualizationTabWidget.h', |
|
15 | 'include/Visualization/VisualizationTabWidget.h', | |
16 | 'include/Visualization/VisualizationWidget.h', |
|
16 | 'include/Visualization/VisualizationWidget.h', | |
17 | 'include/Visualization/VisualizationZoneWidget.h', |
|
17 | 'include/Visualization/VisualizationZoneWidget.h', | |
18 | 'include/Visualization/VisualizationDragDropContainer.h', |
|
18 | 'include/Visualization/VisualizationDragDropContainer.h', | |
19 | 'include/Visualization/VisualizationDragWidget.h', |
|
19 | 'include/Visualization/VisualizationDragWidget.h', | |
20 | 'include/Visualization/ColorScaleEditor.h' |
|
20 | 'include/Visualization/ColorScaleEditor.h' | |
21 | ] |
|
21 | ] | |
22 |
|
22 | |||
23 | gui_ui_files = [ |
|
23 | gui_ui_files = [ | |
24 | 'ui/DataSource/DataSourceWidget.ui', |
|
24 | 'ui/DataSource/DataSourceWidget.ui', | |
25 | 'ui/Settings/SqpSettingsDialog.ui', |
|
25 | 'ui/Settings/SqpSettingsDialog.ui', | |
26 | 'ui/Settings/SqpSettingsGeneralWidget.ui', |
|
26 | 'ui/Settings/SqpSettingsGeneralWidget.ui', | |
27 | 'ui/SidePane/SqpSidePane.ui', |
|
27 | 'ui/SidePane/SqpSidePane.ui', | |
28 | 'ui/TimeWidget/TimeWidget.ui', |
|
28 | 'ui/TimeWidget/TimeWidget.ui', | |
29 | 'ui/Variable/VariableInspectorWidget.ui', |
|
29 | 'ui/Variable/VariableInspectorWidget.ui', | |
30 | 'ui/Variable/RenameVariableDialog.ui', |
|
30 | 'ui/Variable/RenameVariableDialog.ui', | |
31 | 'ui/Variable/VariableMenuHeaderWidget.ui', |
|
31 | 'ui/Variable/VariableMenuHeaderWidget.ui', | |
32 | 'ui/Visualization/VisualizationGraphWidget.ui', |
|
32 | 'ui/Visualization/VisualizationGraphWidget.ui', | |
33 | 'ui/Visualization/VisualizationTabWidget.ui', |
|
33 | 'ui/Visualization/VisualizationTabWidget.ui', | |
34 | 'ui/Visualization/VisualizationWidget.ui', |
|
34 | 'ui/Visualization/VisualizationWidget.ui', | |
35 | 'ui/Visualization/VisualizationZoneWidget.ui', |
|
35 | 'ui/Visualization/VisualizationZoneWidget.ui', | |
36 | 'ui/Visualization/ColorScaleEditor.ui' |
|
36 | 'ui/Visualization/ColorScaleEditor.ui' | |
37 | ] |
|
37 | ] | |
38 |
|
38 | |||
39 | gui_qresources = ['resources/sqpguiresources.qrc'] |
|
39 | gui_qresources = ['resources/sqpguiresources.qrc'] | |
40 |
|
40 | |||
41 | gui_moc_files = qt5.preprocess(moc_headers : gui_moc_headers, |
|
41 | gui_moc_files = qt5.preprocess(moc_headers : gui_moc_headers, | |
42 | ui_files : gui_ui_files, |
|
42 | ui_files : gui_ui_files, | |
43 | qresources : gui_qresources) |
|
43 | qresources : gui_qresources) | |
44 |
|
44 | |||
45 | gui_sources = [ |
|
45 | gui_sources = [ | |
46 | 'src/SqpApplication.cpp', |
|
46 | 'src/SqpApplication.cpp', | |
47 | 'src/DragAndDrop/DragDropHelper.cpp', |
|
47 | 'src/DragAndDrop/DragDropHelper.cpp', | |
48 | 'src/DragAndDrop/DragDropScroller.cpp', |
|
48 | 'src/DragAndDrop/DragDropScroller.cpp', | |
49 | 'src/DragAndDrop/DragDropTabSwitcher.cpp', |
|
49 | 'src/DragAndDrop/DragDropTabSwitcher.cpp', | |
50 | 'src/Common/ColorUtils.cpp', |
|
50 | 'src/Common/ColorUtils.cpp', | |
51 | 'src/Common/VisualizationDef.cpp', |
|
51 | 'src/Common/VisualizationDef.cpp', | |
52 | 'src/DataSource/DataSourceTreeWidgetItem.cpp', |
|
52 | 'src/DataSource/DataSourceTreeWidgetItem.cpp', | |
53 | 'src/DataSource/DataSourceTreeWidgetHelper.cpp', |
|
53 | 'src/DataSource/DataSourceTreeWidgetHelper.cpp', | |
54 | 'src/DataSource/DataSourceWidget.cpp', |
|
54 | 'src/DataSource/DataSourceWidget.cpp', | |
55 | 'src/DataSource/DataSourceTreeWidget.cpp', |
|
55 | 'src/DataSource/DataSourceTreeWidget.cpp', | |
56 | 'src/Settings/SqpSettingsDialog.cpp', |
|
56 | 'src/Settings/SqpSettingsDialog.cpp', | |
57 | 'src/Settings/SqpSettingsGeneralWidget.cpp', |
|
57 | 'src/Settings/SqpSettingsGeneralWidget.cpp', | |
58 | 'src/SidePane/SqpSidePane.cpp', |
|
58 | 'src/SidePane/SqpSidePane.cpp', | |
59 | 'src/TimeWidget/TimeWidget.cpp', |
|
59 | 'src/TimeWidget/TimeWidget.cpp', | |
60 | 'src/Variable/VariableInspectorWidget.cpp', |
|
60 | 'src/Variable/VariableInspectorWidget.cpp', | |
61 | 'src/Variable/VariableInspectorTableView.cpp', |
|
61 | 'src/Variable/VariableInspectorTableView.cpp', | |
62 | 'src/Variable/VariableMenuHeaderWidget.cpp', |
|
62 | 'src/Variable/VariableMenuHeaderWidget.cpp', | |
63 | 'src/Variable/RenameVariableDialog.cpp', |
|
63 | 'src/Variable/RenameVariableDialog.cpp', | |
64 | 'src/Visualization/VisualizationGraphHelper.cpp', |
|
64 | 'src/Visualization/VisualizationGraphHelper.cpp', | |
65 | 'src/Visualization/VisualizationGraphRenderingDelegate.cpp', |
|
65 | 'src/Visualization/VisualizationGraphRenderingDelegate.cpp', | |
66 | 'src/Visualization/VisualizationGraphWidget.cpp', |
|
66 | 'src/Visualization/VisualizationGraphWidget.cpp', | |
67 | 'src/Visualization/VisualizationTabWidget.cpp', |
|
67 | 'src/Visualization/VisualizationTabWidget.cpp', | |
68 | 'src/Visualization/VisualizationWidget.cpp', |
|
68 | 'src/Visualization/VisualizationWidget.cpp', | |
69 | 'src/Visualization/VisualizationZoneWidget.cpp', |
|
69 | 'src/Visualization/VisualizationZoneWidget.cpp', | |
70 | 'src/Visualization/qcustomplot.cpp', |
|
70 | 'src/Visualization/qcustomplot.cpp', | |
71 | 'src/Visualization/QCustomPlotSynchronizer.cpp', |
|
71 | 'src/Visualization/QCustomPlotSynchronizer.cpp', | |
72 | 'src/Visualization/operations/FindVariableOperation.cpp', |
|
72 | 'src/Visualization/operations/FindVariableOperation.cpp', | |
73 | 'src/Visualization/operations/GenerateVariableMenuOperation.cpp', |
|
73 | 'src/Visualization/operations/GenerateVariableMenuOperation.cpp', | |
74 | 'src/Visualization/operations/MenuBuilder.cpp', |
|
74 | 'src/Visualization/operations/MenuBuilder.cpp', | |
75 | 'src/Visualization/operations/RemoveVariableOperation.cpp', |
|
75 | 'src/Visualization/operations/RemoveVariableOperation.cpp', | |
76 | 'src/Visualization/operations/RescaleAxeOperation.cpp', |
|
76 | 'src/Visualization/operations/RescaleAxeOperation.cpp', | |
77 | 'src/Visualization/VisualizationDragDropContainer.cpp', |
|
77 | 'src/Visualization/VisualizationDragDropContainer.cpp', | |
78 | 'src/Visualization/VisualizationDragWidget.cpp', |
|
78 | 'src/Visualization/VisualizationDragWidget.cpp', | |
79 | 'src/Visualization/AxisRenderingUtils.cpp', |
|
79 | 'src/Visualization/AxisRenderingUtils.cpp', | |
80 | 'src/Visualization/PlottablesRenderingUtils.cpp', |
|
80 | 'src/Visualization/PlottablesRenderingUtils.cpp', | |
81 | 'src/Visualization/MacScrollBarStyle.cpp', |
|
81 | 'src/Visualization/MacScrollBarStyle.cpp', | |
82 | 'src/Visualization/VisualizationCursorItem.cpp', |
|
82 | 'src/Visualization/VisualizationCursorItem.cpp', | |
83 | 'src/Visualization/ColorScaleEditor.cpp', |
|
83 | 'src/Visualization/ColorScaleEditor.cpp', | |
84 | 'src/Visualization/SqpColorScale.cpp' |
|
84 | 'src/Visualization/SqpColorScale.cpp', | |
|
85 | 'src/Visualization/QCPColorMapIterator.cpp' | |||
85 | ] |
|
86 | ] | |
86 |
|
87 | |||
87 | gui_inc = include_directories(['include']) |
|
88 | gui_inc = include_directories(['include']) | |
88 |
|
89 | |||
89 | sciqlop_gui_lib = library('sciqlopgui', |
|
90 | sciqlop_gui_lib = library('sciqlopgui', | |
90 | gui_sources, |
|
91 | gui_sources, | |
91 | gui_moc_files, |
|
92 | gui_moc_files, | |
92 | include_directories : [gui_inc], |
|
93 | include_directories : [gui_inc], | |
93 | dependencies : [ qt5printsupport, qt5gui, qt5widgets, qt5svg, sciqlop_core], |
|
94 | dependencies : [ qt5printsupport, qt5gui, qt5widgets, qt5svg, sciqlop_core], | |
94 | install : true |
|
95 | install : true | |
95 | ) |
|
96 | ) | |
96 |
|
97 | |||
97 | sciqlop_gui = declare_dependency(link_with : sciqlop_gui_lib, |
|
98 | sciqlop_gui = declare_dependency(link_with : sciqlop_gui_lib, | |
98 | include_directories : gui_inc, |
|
99 | include_directories : gui_inc, | |
99 | dependencies : [qt5printsupport, qt5gui, qt5widgets, qt5svg, sciqlop_core]) |
|
100 | dependencies : [qt5printsupport, qt5gui, qt5widgets, qt5svg, sciqlop_core]) | |
100 |
|
101 |
@@ -1,9 +1,22 | |||||
1 | \.h:\d+:.IPSIS_S04.*found: ui |
|
1 | \.h:\d+:.IPSIS_S04.*found: ui | |
2 | qcustomplot\.h:\d+:.IPSIS |
|
2 | qcustomplot\.h:\d+:.IPSIS | |
3 | qcustomplot\.cpp:\d+:.IPSIS |
|
3 | qcustomplot\.cpp:\d+:.IPSIS | |
4 |
|
4 | |||
5 | # Ignore false positive relative to App macro |
|
5 | # Ignore false positive relative to App macro | |
6 | SqpApplication\.h:\d+:.IPSIS_S03.*found: sqpApp |
|
6 | SqpApplication\.h:\d+:.IPSIS_S03.*found: sqpApp | |
7 | SqpApplication\.h:\d+:.IPSIS_S04_VARIABLE.*found: sqpApp |
|
7 | SqpApplication\.h:\d+:.IPSIS_S04_VARIABLE.*found: sqpApp | |
8 |
|
8 | |||
|
9 | # Ignore false positive relative to iterators | |||
|
10 | QCPColorMapIterator\.h:\d+:.*IPSIS_S04_VARIABLE.*found: (forward_iterator_tag) | |||
|
11 | QCPColorMapIterator\.h:\d+:.*IPSIS_S04_VARIABLE.*found: (ptrdiff_t) | |||
|
12 | QCPColorMapIterator\.h:\d+:.*IPSIS_S04_VARIABLE.*found: (value_type) | |||
|
13 | QCPColorMapIterator\.h:\d+:.*IPSIS_S06.*found: (iterator_category) | |||
|
14 | QCPColorMapIterator\.h:\d+:.*IPSIS_S06.*found: (forward_iterator_tag) | |||
|
15 | QCPColorMapIterator\.h:\d+:.*IPSIS_S06.*found: (value_type) | |||
|
16 | QCPColorMapIterator\.h:\d+:.*IPSIS_S06.*found: (difference_type) | |||
|
17 | QCPColorMapIterator\.h:\d+:.*IPSIS_S06.*found: (ptrdiff_t) | |||
|
18 | QCPColorMapIterator\.h:\d+:.*IPSIS_S06.*found: (pointer) | |||
|
19 | QCPColorMapIterator\.h:\d+:.*IPSIS_S06.*found: (reference) | |||
|
20 | QCPColorMapIterator\.h:\d+:.*IPSIS_S06.*found: (value_type) | |||
|
21 | ||||
9 |
|
22 |
General Comments 0
You need to be logged in to leave comments.
Login now