#pragma once #include "Plottable.h" #include "../axis/Axis.h" #include #include namespace renderive { struct Sweep_Spectrum_Properties { Range frequency_range{}; Nonnegative_Count bins_per_block; Positive_Count block_count; Pen pen{Color::yellow()}; Pen current_frequency_pen{Color::red(), 2.0}; bool visible_range_only{true}; Line_Interpolation_Mode interpolation_mode = Line_Interpolation_Mode::Linear_Value; }; namespace detail { class LIB_DECL Sweep_Spectrum_Control : public Plottable_State { public: Sweep_Spectrum_Control(const Sweep_Spectrum_Properties& properties, renderive_Owner frequency_axis, renderive_Owner power_axis); ~Sweep_Spectrum_Control() override; void append_block(std::span values); void append_block(std::pmr::vector&& values); template void append_block(const Values& values) { append_block(std::span(values.data(), values.size())); } [[nodiscard]] std::size_t stored_block_count() const; [[nodiscard]] std::size_t stored_point_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_; void publish() override; }; } using Sweep_Spectrum = detail::Attach_Plottable; }