Stratified2DRandom Class Reference

#include <c4d_tools.h>

Detailed Description

A class to generate stratified 2D random numbers.

Public Member Functions

Bool Init (Int32 initial_value, Bool reset)
 
void GetNext (Float *xx, Float *yy)
 

Static Public Member Functions

static Stratified2DRandomAlloc ()
 
static void Free (Stratified2DRandom *&rnd)
 

Private Member Functions

 Stratified2DRandom ()
 
 ~Stratified2DRandom ()
 

Constructor & Destructor Documentation

◆ Stratified2DRandom()

Stratified2DRandom ( )
private

◆ ~Stratified2DRandom()

~Stratified2DRandom ( )
private

Member Function Documentation

◆ Alloc()

static Stratified2DRandom* Alloc ( )
static

Allocates a generator. Destroy the allocated generator with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Returns
The allocated generator, or nullptr if the allocation failed.

◆ Free()

static void Free ( Stratified2DRandom *&  rnd)
static

Destructs generators allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.

Parameters
[in,out]rndThe generator to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ Init()

Bool Init ( Int32  initial_value,
Bool  reset 
)

Initializes the generator.

Parameters
[in]initial_valueInitial value.
[in]resettrue if the generator should be reset, otherwise false.
Returns
true if successful, otherwise false.

◆ GetNext()

void GetNext ( Float xx,
Float yy 
)

Gets the next random value pair.

Parameters
[in]xxAssigned the first random value.
[in]yyAssigned the second random value.