#pragma once #include "Axis_State_Strategy.hpp" #include "Axis_Builder.h" #include #include #include #include #include namespace renderive { struct Time_Axis_Properties : Axis_Base_Properties { Range_Value::max()> visible_count{100}; Range_Value::max()> tick_label_spacing_px{8}; std::string format = "mm:ss.zzz"; bool newest_at_start{}; }; namespace detail { struct Time_Axis_State : Time_Axis_Properties { int next_tick{}; std::deque> samples; }; class LIB_DECL Time_Axis_Control : public Axis_State_Strategy { public: Time_Axis_Control(::Scene_Base& scene, const Time_Axis_Properties& properties); [[nodiscard]] std::size_t time_point_count() const; int append_time(Time_Of_Day time); [[nodiscard]] Time_Of_Day tick_to_time(int tick) const; private: [[nodiscard]] Range coordinate_range(const Time_Axis_State& state) const noexcept override; [[nodiscard]] double calculate_tick_step(Range range, const Time_Axis_State& state) const override; [[nodiscard]] std::string format_tick_label(double tick, const Time_Axis_State& state) const override; }; } // namespace detail using Time_Axis = Attach_Builder; } // namespace renderive