OpenWalnut  1.5.0dev
Classes | Public Member Functions | Private Attributes | List of all members
WTuringPatternCreator Class Reference

Creates a pattern of evenly spaced dots via simulating a chemical reaction. More...

#include <WTuringPatternCreator.h>

+ Collaboration diagram for WTuringPatternCreator:

Classes

class  PatternThread
 A thread calculating the reaction for a certain part of the domain. More...
 

Public Member Functions

 WTuringPatternCreator (std::shared_ptr< WProgress > const progress, std::size_t numThreads=boost::thread::hardware_concurrency())
 Constructor. More...
 
 ~WTuringPatternCreator ()
 Destructor. More...
 
std::shared_ptr< std::vector< float > > create (std::size_t sizeX, std::size_t sizeY, std::size_t sizeZ)
 Creates the 3D pattern and writes it into a vector of floats. More...
 
void setSpotSize (float size)
 Sets the spotsize parameter. More...
 
void setSpotIrregularity (float irr)
 Sets the spot irregularity parameter. More...
 
void setNumIterations (std::size_t iter)
 Sets the number of iterations for the chemical simulation that creates the pattern. More...
 

Private Attributes

std::size_t m_numThreads
 The number of threads to use. More...
 
float m_numIterations
 The number of iterations for the simulation. More...
 
float m_spotIrregularity
 The spot irregularity parameter. More...
 
float m_spotSize
 The spot size parameter. More...
 
std::shared_ptr< WProgressm_progress
 The progress to increment. More...
 

Detailed Description

Creates a pattern of evenly spaced dots via simulating a chemical reaction.

The pattern is created on a regular 3D grid.

Definition at line 43 of file WTuringPatternCreator.h.

Constructor & Destructor Documentation

◆ WTuringPatternCreator()

WTuringPatternCreator::WTuringPatternCreator ( std::shared_ptr< WProgress > const  progress,
std::size_t  numThreads = boost::thread::hardware_concurrency() 
)

Constructor.

Parameters
progressThe progress indicator to use.
numThreadsThe number of threads to use.

Definition at line 34 of file WTuringPatternCreator.cpp.

◆ ~WTuringPatternCreator()

WTuringPatternCreator::~WTuringPatternCreator ( )

Destructor.

Definition at line 44 of file WTuringPatternCreator.cpp.

Member Function Documentation

◆ create()

std::shared_ptr< std::vector< float > > WTuringPatternCreator::create ( std::size_t  sizeX,
std::size_t  sizeY,
std::size_t  sizeZ 
)

Creates the 3D pattern and writes it into a vector of floats.

This vector can simply be added to a valueset.

Parameters
sizeXThe size of the grid in x-direction.
sizeYThe size of the grid in y-direction.
sizeZThe size of the grid in z-direction.
Returns
The vector containing the pattern data.

Definition at line 69 of file WTuringPatternCreator.cpp.

References m_numIterations, m_numThreads, m_progress, m_spotIrregularity, and m_spotSize.

◆ setNumIterations()

void WTuringPatternCreator::setNumIterations ( std::size_t  iter)

Sets the number of iterations for the chemical simulation that creates the pattern.

Parameters
iterThe number of iterations.

Definition at line 48 of file WTuringPatternCreator.cpp.

References m_numIterations.

◆ setSpotIrregularity()

void WTuringPatternCreator::setSpotIrregularity ( float  irr)

Sets the spot irregularity parameter.

Parameters
irrA value between 0 and 1.

Definition at line 55 of file WTuringPatternCreator.cpp.

References m_spotIrregularity.

◆ setSpotSize()

void WTuringPatternCreator::setSpotSize ( float  size)

Sets the spotsize parameter.

Parameters
sizeA value between 0 and 1.

Definition at line 62 of file WTuringPatternCreator.cpp.

References m_spotSize.

Member Data Documentation

◆ m_numIterations

float WTuringPatternCreator::m_numIterations
private

The number of iterations for the simulation.

Definition at line 223 of file WTuringPatternCreator.h.

Referenced by create(), and setNumIterations().

◆ m_numThreads

std::size_t WTuringPatternCreator::m_numThreads
private

The number of threads to use.

Definition at line 220 of file WTuringPatternCreator.h.

Referenced by create().

◆ m_progress

std::shared_ptr< WProgress > WTuringPatternCreator::m_progress
private

The progress to increment.

Definition at line 232 of file WTuringPatternCreator.h.

Referenced by create().

◆ m_spotIrregularity

float WTuringPatternCreator::m_spotIrregularity
private

The spot irregularity parameter.

Definition at line 226 of file WTuringPatternCreator.h.

Referenced by create(), and setSpotIrregularity().

◆ m_spotSize

float WTuringPatternCreator::m_spotSize
private

The spot size parameter.

Definition at line 229 of file WTuringPatternCreator.h.

Referenced by create(), and setSpotSize().


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