28 lines
1.0 KiB
C++
28 lines
1.0 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 Prepare_Render_Context& context) override;
|
|
void paint(Painter& painter, const Paint_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>;
|
|
}
|