Files
Renderive/render_2D/plottable/Frequency_Trace.h
T
2026-08-13 00:35:00 +08:00

29 lines
1.1 KiB
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(::Scene_Base& scene, 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 prepare_frame(const Render_State_View& state,
const Scene_Render_Context& context) override;
void paint(Painter& painter, const Scene_Render_Context& context) 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>;
}