wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
Loading...
Searching...
No Matches
wDiscontinuityComponent.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_DISCONTINUITY_COMPONENT_HPP
9#define W_DISCONTINUITY_COMPONENT_HPP
10
12
13#include <vector>
14#include <utility>
15#include <stdexcept>
16
17namespace wEngine
18{
19
34 {
35 public:
36 /*
37 * @brief Default constructor.
38 */
40
41 /*
42 * @brief Virtual destructor.
43 */
44 virtual ~DiscontinuityComponent( ) = default;
45
50 [[nodiscard]] const std::vector< std::pair< double,double > >& getExcludedIntervals( ) const;
51
58 void addExcludedInterval( double min, double max );
59
64
70 [[nodiscard]] bool isInExcludedInterval( double x ) const;
71
72 /*
73 * @brief Outputs the excluded intervals to the console for debugging.
74 */
75 void debugPrint( ) const;
76 private:
77 std::vector< std::pair< double, double > > mExcludedIntervals;
78 };
79
80}//End of namespace wEngine
81
82#endif
Component()
Protected constructor to restrict instantiation to derived classes.
Definition wComponent.cpp:17
const std::vector< std::pair< double, double > > & getExcludedIntervals() const
Gives read-only access to the list of excluded intervals.
Definition wDiscontinuityComponent.cpp:17
virtual ~DiscontinuityComponent()=default
bool isInExcludedInterval(double x) const
Checks if a value falls into one of the excluded intervals.
Definition wDiscontinuityComponent.cpp:42
void clearExcludedIntervals()
Removes all excluded intervals.
Definition wDiscontinuityComponent.cpp:37
void addExcludedInterval(double min, double max)
Adds an excluded interval to the list.
Definition wDiscontinuityComponent.cpp:28
void debugPrint() const
Definition wDiscontinuityComponent.cpp:60
Definition wColorComponent.cpp:9