59 lines
2.6 KiB
C++
59 lines
2.6 KiB
C++
#pragma once
|
|
#include "Hover_Tooltip.h"
|
|
#include "Plottable.h"
|
|
#include "../axis/Axis.h"
|
|
#include "../renderable/Render_Partition.h"
|
|
#include <renderive/renderable/Render_Frame_Completion.hpp>
|
|
#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;
|
|
Render_Partition_Mode partition_mode{Render_Partition_Mode::Automatic};
|
|
Positive_Count partition_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 ::Render_Frame_Completion {
|
|
public:
|
|
Waterfall_Control(const Waterfall_Properties& properties, renderive_Owner<Frequency_Axis> frequency_axis, renderive_Owner<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 prepare_frame(const Prepare_Render_Context& context) override;
|
|
void paint(Painter& painter, const Paint_Render_Context& context) override;
|
|
void build_prepare_graph(Renderable_Graph_Builder& builder) override;
|
|
void build_paint_graph(Renderable_Graph_Builder& builder) override;
|
|
private:
|
|
struct Impl;
|
|
void prepare_render_frame(const Render_State_View& state, int graph_partition_count);
|
|
void paint_render_frame(Painter& painter, const Render_State_View& state);
|
|
void render_frame_completed(std::uint64_t target_interval_ns) override;
|
|
void render_partition(int partition_index);
|
|
void publish() override;
|
|
};
|
|
}
|
|
using Waterfall = detail::Attach_Plottable<detail::Waterfall_Control, Waterfall_Properties>;
|
|
}
|