47 lines
1.8 KiB
C++
47 lines
1.8 KiB
C++
#pragma once
|
|
#include "Hover_Tooltip.h"
|
|
#include "Plottable.h"
|
|
#include "../axis/Axis.h"
|
|
#include <memory_resource>
|
|
#include <span>
|
|
namespace renderive {
|
|
struct Waterfall_Properties : Hover_Tooltip_Properties {
|
|
Range frequency_range{0.0, 10.0};
|
|
Range power_range{0.0, 10.0};
|
|
Nonnegative_Count frequency_bin_count;
|
|
bool visible_range_only{true};
|
|
Image_Interpolation_Mode interpolation_mode = Image_Interpolation_Mode::Nearest;
|
|
Color_Map color_map;
|
|
};
|
|
namespace detail {
|
|
class LIB_DECL Waterfall_Control : public Plottable_State<Waterfall_Properties>, public Event_Handler {
|
|
public:
|
|
Waterfall_Control(Plot_Core& plot, const Waterfall_Properties& properties, std::shared_ptr<Frequency_Axis> frequency_axis, std::shared_ptr<Time_Axis> time_axis);
|
|
~Waterfall_Control() override;
|
|
void append_row(int tick, std::span<const double> values);
|
|
void append_row(int tick, std::pmr::vector<double>&& values);
|
|
void append_row(Time_Of_Day time, std::span<const double> values);
|
|
void append_row(Time_Of_Day time, std::pmr::vector<double>&& values);
|
|
template <class Values>
|
|
void append_row(int tick, const Values& values) {
|
|
append_row(tick, std::span<const double>(values.data(), values.size()));
|
|
}
|
|
template <class Values>
|
|
void append_row(Time_Of_Day time, const Values& values) {
|
|
append_row(time, std::span<const double>(values.data(), values.size()));
|
|
}
|
|
[[nodiscard]] std::size_t row_count() const;
|
|
[[nodiscard]] std::size_t stored_point_count() const;
|
|
[[nodiscard]] std::size_t rendered_cell_count() const;
|
|
void handle_event(const Event& event) override;
|
|
protected:
|
|
void paint(Painter& painter) override;
|
|
private:
|
|
struct Impl;
|
|
std::unique_ptr<Impl> impl_;
|
|
void publish() override;
|
|
};
|
|
}
|
|
using Waterfall = detail::Attach_Plottable<detail::Waterfall_Control, Waterfall_Properties>;
|
|
}
|