wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
Loading...
Searching...
No Matches
wEngine::LineStyleComponent Class Reference

ESC component that defines the style of a line (solid, dotted, dashed). More...

#include <wLineStyleComponent.hpp>

Inheritance diagram for wEngine::LineStyleComponent:
Inheritance graph

Public Types

enum class  LineStyle { Solid , Dotted , Dashed }
 Available styles for line rendering. More...

Public Member Functions

 LineStyleComponent (LineStyle style=LineStyle::Solid)
 Constructs a LineStyleComponent with an optional style.
virtual ~LineStyleComponent ()=default
LineStyle getStyle () const
 Returns the current line style.
void setStyle (LineStyle style)
 Sets the current line style.
float getDashLength () const
 Returns the dash length (used for Dashed style).
void setDashLength (float dashLength)
 Sets the dash length.
float getGapLength () const
 Returns the gap length (used for Dotted and Dashed styles).
void setGapLength (float gapLength)
 Sets the gap length.
void debugPrint () const
Public Member Functions inherited from wEngine::Component
virtual ~Component ()=default
virtual void enable ()
virtual void disable ()
bool isEnabled () const
 Checks whether the component is currently active.
void setParent (Entity *parent)
 Sets the parent entity of this component.
EntitygetParent () const
 Returns the parent entity of this component.

Additional Inherited Members

Protected Member Functions inherited from wEngine::Component
 Component ()
 Protected constructor to restrict instantiation to derived classes.

Detailed Description

ESC component that defines the style of a line (solid, dotted, dashed).

This component controls how lines are drawn in the rendering pipeline. For dotted and dashed styles, both dash length and gap length can be configured.

Author
Wilfried Koch

Member Enumeration Documentation

◆ LineStyle

Available styles for line rendering.

Enumerator
Solid 
Dotted 
Dashed 

Constructor & Destructor Documentation

◆ LineStyleComponent()

wEngine::LineStyleComponent::LineStyleComponent ( LineStyle style = LineStyle::Solid)

Constructs a LineStyleComponent with an optional style.

Parameters
styleLine style to use (default: Solid).

◆ ~LineStyleComponent()

virtual wEngine::LineStyleComponent::~LineStyleComponent ( )
virtualdefault

Member Function Documentation

◆ getStyle()

LineStyleComponent::LineStyle wEngine::LineStyleComponent::getStyle ( ) const
nodiscard

Returns the current line style.

Returns
The style as LineStyle.

◆ setStyle()

void wEngine::LineStyleComponent::setStyle ( LineStyle style)

Sets the current line style.

Parameters
styleNew line style to apply.

◆ getDashLength()

float wEngine::LineStyleComponent::getDashLength ( ) const
nodiscard

Returns the dash length (used for Dashed style).

Returns
Dash length in pixels.

◆ setDashLength()

void wEngine::LineStyleComponent::setDashLength ( float dashLength)

Sets the dash length.

Parameters
dashLengthDash length in pixels.
Exceptions
std::invalid_argumentif dashLength <= 0.

◆ getGapLength()

float wEngine::LineStyleComponent::getGapLength ( ) const
nodiscard

Returns the gap length (used for Dotted and Dashed styles).

Returns
Gap length in pixels.

◆ setGapLength()

void wEngine::LineStyleComponent::setGapLength ( float gapLength)

Sets the gap length.

Parameters
gapLengthGap length in pixels.
Exceptions
std::invalid_argumentif gapLength < 0.

◆ debugPrint()

void wEngine::LineStyleComponent::debugPrint ( ) const

The documentation for this class was generated from the following files: