HighMap library (C++)
Loading...
Searching...
No Matches
hmap::Function Class Reference

A class that wraps a callable entity taking three floats and returning a float. More...

#include <functions.hpp>

Inheritance diagram for hmap::Function:

Public Member Functions

 Function ()
 Default constructor. Initializes the delegate function to a default that returns 0.
 
virtual ~Function ()=default
 Virtual destructor to ensure proper cleanup in derived classes.
 
 Function (HMAP_FCT_XY_TYPE delegate)
 Constructor to initialize with a specific delegate function.
 
HMAP_FCT_XY_TYPE get_delegate () const
 Get the current delegate function.
 
float get_value (float x, float y, float ctrl_param) const
 Call the delegate function with given arguments.
 
void set_delegate (HMAP_FCT_XY_TYPE new_delegate)
 Set a new delegate function.
 

Detailed Description

A class that wraps a callable entity taking three floats and returning a float.

Constructor & Destructor Documentation

◆ Function() [1/2]

hmap::Function::Function ( )
inline

Default constructor. Initializes the delegate function to a default that returns 0.

◆ ~Function()

virtual hmap::Function::~Function ( )
virtualdefault

Virtual destructor to ensure proper cleanup in derived classes.

◆ Function() [2/2]

hmap::Function::Function ( HMAP_FCT_XY_TYPE  delegate)
inlineexplicit

Constructor to initialize with a specific delegate function.

Parameters
delegateThe delegate function to initialize with.

Member Function Documentation

◆ get_delegate()

HMAP_FCT_XY_TYPE hmap::Function::get_delegate ( ) const

Get the current delegate function.

Returns
The current delegate function.

◆ get_value()

float hmap::Function::get_value ( float  x,
float  y,
float  ctrl_param 
) const

Call the delegate function with given arguments.

Parameters
xThe first float parameter.
yThe second float parameter.
ctrl_paramThe third float parameter.
Returns
The result of the delegate function call.

◆ set_delegate()

void hmap::Function::set_delegate ( HMAP_FCT_XY_TYPE  new_delegate)

Set a new delegate function.

Parameters
new_delegateThe new delegate function to set.

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