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

ECS component that manages excluded intervals for function plotting. More...

#include <wDiscontinuityComponent.hpp>

Inheritance diagram for wEngine::DiscontinuityComponent:
Inheritance graph

Public Member Functions

 DiscontinuityComponent ()=default
virtual ~DiscontinuityComponent ()=default
const std::vector< std::pair< double, double > > & getExcludedIntervals () const
 Gives read-only access to the list of excluded intervals.
void addExcludedInterval (double min, double max)
 Adds an excluded interval to the list.
void clearExcludedIntervals ()
 Removes all excluded intervals.
bool isInExcludedInterval (double x) const
 Checks if a value falls into one of the excluded intervals.
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

ECS component that manages excluded intervals for function plotting.

This component allows the user to explicitly define intervals of the domain where a function should not be drawn (e.g., around asymptotes or undefined values). During rendering, points falling inside these intervals are skipped to avoid unwanted connections across discontinuities.

Author
Wilfried Koch

Constructor & Destructor Documentation

◆ DiscontinuityComponent()

wEngine::DiscontinuityComponent::DiscontinuityComponent ( )
default

◆ ~DiscontinuityComponent()

virtual wEngine::DiscontinuityComponent::~DiscontinuityComponent ( )
virtualdefault

Member Function Documentation

◆ getExcludedIntervals()

const std::vector< std::pair< double, double > > & wEngine::DiscontinuityComponent::getExcludedIntervals ( ) const
nodiscard

Gives read-only access to the list of excluded intervals.

Returns
A constant reference to the vector of (min, max) pairs.

◆ addExcludedInterval()

void wEngine::DiscontinuityComponent::addExcludedInterval ( double min,
double max )

Adds an excluded interval to the list.

Parameters
minLower bound of the interval.
maxUpper bound of the interval.
Exceptions
std::invalid_argumentif min >= max.

◆ clearExcludedIntervals()

void wEngine::DiscontinuityComponent::clearExcludedIntervals ( )

Removes all excluded intervals.

◆ isInExcludedInterval()

bool wEngine::DiscontinuityComponent::isInExcludedInterval ( double x) const
nodiscard

Checks if a value falls into one of the excluded intervals.

Parameters
xValue to test.
Returns
True if x is inside any excluded interval, false otherwise.

◆ debugPrint()

void wEngine::DiscontinuityComponent::debugPrint ( ) const

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