##// END OF EJS Templates
Implements spectrograms display (1)...
Alexandre Leroux -
r905:aa0c1de0bcf6
parent child
Show More
@@ -383,6 +383,10 public:
383 383 return std::make_pair(minIt, maxIt);
384 384 }
385 385
386 /// @return the y-axis associated to the data series
387 /// @todo pass getter as protected and use iterators to access the y-axis data
388 OptionalAxis yAxis() const { return m_YAxis; }
389
386 390 // /////// //
387 391 // Mutexes //
388 392 // /////// //
@@ -438,9 +442,6 protected:
438 442 // necessary to call the sort method here ('other' is sorted)
439 443 }
440 444
441 /// @return the y-axis associated to the data series
442 OptionalAxis yAxis() const { return m_YAxis; }
443
444 445 /// Assignment operator
445 446 template <int D>
446 447 DataSeries &operator=(DataSeries<D> other)
@@ -4,6 +4,7
4 4 #include <Common/ColorUtils.h>
5 5
6 6 #include <Data/ScalarSeries.h>
7 #include <Data/SpectrogramSeries.h>
7 8 #include <Data/VectorSeries.h>
8 9
9 10 #include <Variable/Variable.h>
@@ -68,6 +69,24 struct PlottablesCreator<T,
68 69 };
69 70
70 71 /**
72 * Specialization of PlottablesCreator for spectrograms
73 * @sa SpectrogramSeries
74 */
75 template <typename T>
76 struct PlottablesCreator<T,
77 typename std::enable_if_t<std::is_base_of<SpectrogramSeries, T>::value> > {
78 static PlottablesMap createPlottables(T &dataSeries, QCustomPlot &plot)
79 {
80 PlottablesMap result{};
81 result.insert({0, new QCPColorMap{plot.xAxis, plot.yAxis}});
82
83 plot.replot();
84
85 return result;
86 }
87 };
88
89 /**
71 90 * Struct used to update plottables, depending on the type of the data series from which to update
72 91 * them
73 92 * @tparam T the data series' type
@@ -200,6 +219,9 std::unique_ptr<IPlottablesHelper> createHelper(std::shared_ptr<IDataSeries> dat
200 219 if (auto scalarSeries = std::dynamic_pointer_cast<ScalarSeries>(dataSeries)) {
201 220 return std::make_unique<PlottablesHelper<ScalarSeries> >(*scalarSeries);
202 221 }
222 else if (auto spectrogramSeries = std::dynamic_pointer_cast<SpectrogramSeries>(dataSeries)) {
223 return std::make_unique<PlottablesHelper<SpectrogramSeries> >(*spectrogramSeries);
224 }
203 225 else if (auto vectorSeries = std::dynamic_pointer_cast<VectorSeries>(dataSeries)) {
204 226 return std::make_unique<PlottablesHelper<VectorSeries> >(*vectorSeries);
205 227 }
General Comments 0
You need to be logged in to leave comments. Login now