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

ECS component that defines the thickness of a drawable object. More...

#include <wThicknessComponent.hpp>

Inheritance diagram for wEngine::ThicknessComponent:
Inheritance graph

Public Member Functions

 ThicknessComponent (float thickness=2.0f)
 Constructs the component with an initial positive thickness.
virtual ~ThicknessComponent ()=default
float getThickness () const
 Returns the current thickness.
void setThickness (float newThickness)
 Sets a new thickness value.
void debugPrint () const
 Outputs the current thickness value to the console for debugging.
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

ECS component that defines the thickness of a drawable object.

This component stores a positive float value representing the thickness (in pixels) of lines or shapes (e.g., axes, borders). The value must be strictly positive.

Examples:

  • A thickness of 1.0f draws a thin line.
  • A thickness of 4.0f produces a bold axis.
Exceptions
std::invalid_argumentif the value is zero or negative.

Usage Examples:

  • A thickness of 1.0f draws a thin line.
  • A thickness of 4.0f produces a bold axis.
Author
Wilfried Koch

Constructor & Destructor Documentation

◆ ThicknessComponent()

wEngine::ThicknessComponent::ThicknessComponent ( float thickness = 2.0f)

Constructs the component with an initial positive thickness.

Parameters
thicknessInitial thickness value (default is 2.0f).
Exceptions
std::invalid_argumentif the value is zero or negative.

◆ ~ThicknessComponent()

virtual wEngine::ThicknessComponent::~ThicknessComponent ( )
virtualdefault

Member Function Documentation

◆ getThickness()

float wEngine::ThicknessComponent::getThickness ( ) const
nodiscard

Returns the current thickness.

Returns
A positive float representing the line thickness (in pixels).

◆ setThickness()

void wEngine::ThicknessComponent::setThickness ( float newThickness)

Sets a new thickness value.

Parameters
newThicknessA strictly positive float.
Exceptions
std::invalid_argumentif the value is zero or negative.

◆ debugPrint()

void wEngine::ThicknessComponent::debugPrint ( ) const

Outputs the current thickness value to the console for debugging.


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