wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
Loading...
Searching...
No Matches
wNotchIntervalComponent.hpp
Go to the documentation of this file.
1/*
2+---------------------------------------------------------------------------------------------------------------------------------------------------+
3Created by Wilfried Koch.
4Copyright @ 2025 Wilfried Koch. All rights reserved.
5+---------------------------------------------------------------------------------------------------------------------------------------------------+
6*/
7
8#ifndef W_NOTCH_INTERVAL_COMPONENT_HPP
9#define W_NOTCH_INTERVAL_COMPONENT_HPP
10
12
13#pragma GCC diagnostic push
14#pragma GCC diagnostic ignored "-Wfloat-equal"
15#pragma GCC diagnostic ignored "-Wswitch-default"
16#include <SFML/Graphics.hpp>
17#pragma GCC diagnostic pop
18
19namespace wEngine
20{
21
36 {
37 public:
43 NotchIntervalComponent( float interval = 1.0f );
44
45 /*
46 * @brief Virtual destructor.
47 */
48 virtual ~NotchIntervalComponent( ) = default;
49
54 [[nodiscard]] float getInterval( ) const;
55
61 void setInterval( float newInterval );
62
66 void debugPrint( ) const;
67
68 private:
69 float mInterval;
70
76 void validateInterval( float value ) const;
77 };
78
79}// End of namespace wEngine
80
81#endif
Component()
Protected constructor to restrict instantiation to derived classes.
Definition wComponent.cpp:17
void setInterval(float newInterval)
Sets a new interval between notches.
Definition wNotchIntervalComponent.cpp:37
float getInterval() const
Returns the current spacing between notches.
Definition wNotchIntervalComponent.cpp:32
NotchIntervalComponent(float interval=1.0f)
Constructs a NotchIntervalComponent with a given interval.
Definition wNotchIntervalComponent.cpp:20
virtual ~NotchIntervalComponent()=default
void debugPrint() const
Outputs the current interval to standard output for debugging.
Definition wNotchIntervalComponent.cpp:49
Definition wColorComponent.cpp:9