Core 1.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SphereTile Class Reference

Poisson sphere tiling for importance sampling. More...

#include <sampling.h>

Public Member Functions

 SphereTile (const Random &=Random(239))
 Empty. More...
 
 SphereTile (const double &, const double &, int, const Random &=Random(239))
 Create a poisson sampling in a square domain. More...
 
 ~SphereTile ()
 Empty.
 
void Relaxation ()
 Perform a relaxation step in the Poisson vertex distribution.
 
Vector Vertex (int) const
 Getter on the i-th sample. More...
 
Sphere At (int) const
 Getter on the i-th sample as a sphere. More...
 
const QVector< VectorGetSet () const
 Return the vector containing the samples.
 
int Size () const
 Return the number of samples.
 
Box GetBox () const
 Return the box.
 

Static Public Member Functions

static bool Check (const Vector &, const QVector< Vector > &, double)
 Performs a poisson sphere check on a set of point and a candidate position. More...
 

Protected Member Functions

void Generate (int)
 Generate the poisson sampling of the domain. More...
 

Protected Attributes

double a = 0.0
 Size.
 
double r = 0.0
 Radius.
 
double e = 0.0
 Squared radius with small epsilon tolerance.
 
QVector< Vectorp
 Array of samples.
 
Random random
 Random number generator.
 

Detailed Description

Poisson sphere tiling for importance sampling.

See also
DiscTile

Constructor & Destructor Documentation

◆ SphereTile() [1/2]

SphereTile::SphereTile ( const Random r = Random(239))
explicit

Empty.

Initialize a poisson sphere tiling.

Parameters
rRandom number generator.

◆ SphereTile() [2/2]

SphereTile::SphereTile ( const double &  a,
const double &  r,
int  n,
const Random ra = Random(239) 
)
explicit

Create a poisson sampling in a square domain.

Parameters
aSize of the side of the square.
rRadius of the samples.
nMaximum number of samples in the dart throwing process. Note that the number of samples will be different.
raRandom number generator.

Member Function Documentation

◆ At()

Sphere SphereTile::At ( int  i) const
inline

Getter on the i-th sample as a sphere.

Parameters
iSample index.

◆ Check()

bool SphereTile::Check ( const Vector p,
const QVector< Vector > &  s,
double  r 
)
static

Performs a poisson sphere check on a set of point and a candidate position.

Returns true if the candidate intersects with the distribution, false otherwise.

Parameters
pCandidate position
sSet of point
rPoisson sphere radius.

◆ Generate()

void SphereTile::Generate ( int  n)
protected

Generate the poisson sampling of the domain.

Parameters
nNumber of darts thrown on the domain. Note that the number of generated samples will be less than n.

◆ Vertex()

Vector SphereTile::Vertex ( int  i) const
inline

Getter on the i-th sample.

Parameters
iSample index.