Files
Renderive/render_2D/plottable/Frequency_Trace.h
T
2026-08-12 00:06:44 +08:00

27 lines
987 B
C++

#pragma once
#include "Plottable.h"
#include "../axis/Axis.h"
namespace renderive {
struct Frequency_Trace_Properties {
Pen pen{Color::yellow()};
};
namespace detail {
class LIB_DECL Frequency_Trace_Control : public Plottable_State<Frequency_Trace_Properties> {
public:
Frequency_Trace_Control(Plot_Core& plot, const Frequency_Trace_Properties& properties, std::shared_ptr<Time_Axis> time_axis, std::shared_ptr<Axis> value_axis);
~Frequency_Trace_Control() override;
void append_sample(int tick, double value);
void append_sample(Time_Of_Day time, double value);
[[nodiscard]] std::size_t sample_count() const;
[[nodiscard]] std::size_t rendered_point_count() const;
protected:
void paint(Painter& painter, const Render_State_View& state) override;
private:
struct Impl;
std::unique_ptr<Impl> impl_;
void publish() override;
};
}
using Frequency_Trace = detail::Attach_Plottable<detail::Frequency_Trace_Control, Frequency_Trace_Properties>;
}