wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
Loading...
Searching...
No Matches
wLineStyleComponent.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_LINE_STYLE_COMPONENT_HPP
9#define W_LINE_STYLE_COMPONENT_HPP
10
12
13namespace wEngine
14{
15
28 {
29 public:
34 enum class LineStyle
35 {
39 };
40
46
47 /*
48 * @brief Virtual destructor.
49 */
50 virtual ~LineStyleComponent( ) = default;
51
56 [[nodiscard]] LineStyle getStyle( ) const;
57
62 void setStyle( LineStyle style );
63
68 [[nodiscard]] float getDashLength( ) const;
69
75 void setDashLength( float dashLength );
76
81 [[nodiscard]] float getGapLength( ) const;
82
88 void setGapLength( float gapLength );
89
90 /*
91 * @brief Outputs the current style and parameters to the console.
92 */
93 void debugPrint( ) const;
94 private:
95 LineStyle mStyle;
96 float mDashLength;
97 float mGapLength;
98 };
99
100}//End of namespace wEngine
101
102#endif
Component()
Protected constructor to restrict instantiation to derived classes.
Definition wComponent.cpp:17
void setStyle(LineStyle style)
Sets the current line style.
Definition wLineStyleComponent.cpp:39
virtual ~LineStyleComponent()=default
void setDashLength(float dashLength)
Sets the dash length.
Definition wLineStyleComponent.cpp:49
float getDashLength() const
Returns the dash length (used for Dashed style).
Definition wLineStyleComponent.cpp:44
LineStyle
Available styles for line rendering.
Definition wLineStyleComponent.hpp:35
@ Dotted
Definition wLineStyleComponent.hpp:37
@ Solid
Definition wLineStyleComponent.hpp:36
@ Dashed
Definition wLineStyleComponent.hpp:38
void debugPrint() const
Definition wLineStyleComponent.cpp:78
LineStyle getStyle() const
Returns the current line style.
Definition wLineStyleComponent.cpp:34
float getGapLength() const
Returns the gap length (used for Dotted and Dashed styles).
Definition wLineStyleComponent.cpp:58
void setGapLength(float gapLength)
Sets the gap length.
Definition wLineStyleComponent.cpp:63
LineStyleComponent(LineStyle style=LineStyle::Solid)
Constructs a LineStyleComponent with an optional style.
Definition wLineStyleComponent.cpp:20
Definition wColorComponent.cpp:9