Euphoria
eu::core::PoissonWorker Struct Reference

#include <poisson.h>

Public Member Functions

 PoissonWorker (const Rectf &area, Random *random, float r, float bs, int k)
 
std::optional< std::tuple< vec2f, vec2f > > update ()
 
bool can_place_at (const vec2f &potential_sample, const vec2i &potential_sample_pos)
 
std::tuple< bool, vec2ftry_place (int active_index)
 
vec2i c_point_to_index (const vec2f &p) const
 
vec2f get_random_point_in_area () const
 
bool is_done () const
 

Public Attributes

Rectf area
 
Randomrand
 
float r
 
float bounds_check
 
int k
 
float w
 
Table< int > grid
 
std::vector< int > active
 
std::vector< vec2fsamples
 

Detailed Description

Definition at line 20 of file poisson.h.

Constructor & Destructor Documentation

◆ PoissonWorker()

eu::core::PoissonWorker::PoissonWorker ( const Rectf area,
Random random,
float  r,
float  bs,
int  k 
)

Definition at line 23 of file poisson.cc.

Member Function Documentation

◆ c_point_to_index()

vec2i eu::core::PoissonWorker::c_point_to_index ( const vec2f p) const

Definition at line 60 of file poisson.cc.

◆ can_place_at()

bool eu::core::PoissonWorker::can_place_at ( const vec2f potential_sample,
const vec2i potential_sample_pos 
)

Definition at line 65 of file poisson.cc.

◆ get_random_point_in_area()

vec2f eu::core::PoissonWorker::get_random_point_in_area ( ) const

Definition at line 55 of file poisson.cc.

◆ is_done()

bool eu::core::PoissonWorker::is_done ( ) const

Definition at line 126 of file poisson.cc.

◆ try_place()

std::tuple< bool, vec2f > eu::core::PoissonWorker::try_place ( int  active_index)

Definition at line 89 of file poisson.cc.

◆ update()

std::optional< std::tuple< vec2f, vec2f > > eu::core::PoissonWorker::update ( )

Definition at line 133 of file poisson.cc.

Member Data Documentation

◆ active

std::vector<int> eu::core::PoissonWorker::active

Definition at line 30 of file poisson.h.

◆ area

Rectf eu::core::PoissonWorker::area

Definition at line 22 of file poisson.h.

◆ bounds_check

float eu::core::PoissonWorker::bounds_check

Definition at line 25 of file poisson.h.

◆ grid

Table<int> eu::core::PoissonWorker::grid

Definition at line 29 of file poisson.h.

◆ k

int eu::core::PoissonWorker::k

Definition at line 26 of file poisson.h.

◆ r

float eu::core::PoissonWorker::r

Definition at line 24 of file poisson.h.

◆ rand

Random* eu::core::PoissonWorker::rand

Definition at line 23 of file poisson.h.

◆ samples

std::vector<vec2f> eu::core::PoissonWorker::samples

Definition at line 31 of file poisson.h.

◆ w

float eu::core::PoissonWorker::w

Definition at line 28 of file poisson.h.


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