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

Field function class. More...

#include <functions.hpp>

Inheritance diagram for hmap::FieldFunction:
Collaboration diagram for hmap::FieldFunction:

Public Member Functions

 FieldFunction (std::unique_ptr< Function > p_base)
 Construct a new FieldFunction object.
 
 FieldFunction (std::unique_ptr< Function > p_base, std::vector< float > xr, std::vector< float > yr, std::vector< float > zr)
 Construct a new FieldFunction object with given vectors.
 
void set_xr (std::vector< float > new_xr)
 Set the x coordinates representing the centers of the primitive.
 
void set_yr (std::vector< float > new_yr)
 Set the y coordinates representing the centers of the primitive.
 
void set_zr (std::vector< float > new_zr)
 Set the z coordinates used to scale the primitive in x and y directions, and also to scale the primitive amplitude if requested.
 
- Public Member Functions inherited from hmap::Function
 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.
 

Protected Attributes

std::vector< float > xr
 
std::vector< float > yr
 
std::vector< float > zr
 

Detailed Description

Field function class.

Constructor & Destructor Documentation

◆ FieldFunction() [1/2]

hmap::FieldFunction::FieldFunction ( std::unique_ptr< Function p_base)

Construct a new FieldFunction object.

Parameters
p_baseUnique pointer to the base function.

◆ FieldFunction() [2/2]

hmap::FieldFunction::FieldFunction ( std::unique_ptr< Function p_base,
std::vector< float >  xr,
std::vector< float >  yr,
std::vector< float >  zr 
)

Construct a new FieldFunction object with given vectors.

Parameters
p_baseUnique pointer to the base function.
xrVector of x coordinates representing the centers of the primitive.
yrVector of y coordinates representing the centers of the primitive.
zrVector of z coordinates used to scale the primitive in x and y directions, and also to scale the primitive amplitude if requested.

Member Function Documentation

◆ set_xr()

void hmap::FieldFunction::set_xr ( std::vector< float >  new_xr)
inline

Set the x coordinates representing the centers of the primitive.

Parameters
new_xrNew vector of x coordinates.

◆ set_yr()

void hmap::FieldFunction::set_yr ( std::vector< float >  new_yr)
inline

Set the y coordinates representing the centers of the primitive.

Parameters
new_yrNew vector of y coordinates.

◆ set_zr()

void hmap::FieldFunction::set_zr ( std::vector< float >  new_zr)
inline

Set the z coordinates used to scale the primitive in x and y directions, and also to scale the primitive amplitude if requested.

Parameters
new_zrNew vector of z coordinates.

Member Data Documentation

◆ xr

std::vector<float> hmap::FieldFunction::xr
protected

Vector of x coordinates representing the centers of the primitive.

◆ yr

std::vector<float> hmap::FieldFunction::yr
protected

Vector of y coordinates representing the centers of the primitive.

◆ zr

std::vector<float> hmap::FieldFunction::zr
protected

Vector of z coordinates used to scale the primitive in x and y directions, and to scale the primitive amplitude if requested.


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