A portable, open-source, coherent noise-generating library for C++

Main Page | Modules | Class Hierarchy | Class List | File List | Class Members

# noise::module::Cylinders Class Reference
[Generator Modules]

`#include <cylinders.h>`

Inheritance diagram for noise::module::Cylinders:

List of all members.

## Detailed Description

Noise module that outputs concentric cylinders.

This noise module outputs concentric cylinders centered on the origin. These cylinders are oriented along the y axis similar to the concentric rings of a tree. Each cylinder extends infinitely along the y axis.

The first cylinder has a radius of 1.0. Each subsequent cylinder has a radius that is 1.0 unit larger than the previous cylinder.

The output value from this noise module is determined by the distance between the input value and the the nearest cylinder surface. The input values that are located on a cylinder surface are given the output value 1.0 and the input values that are equidistant from two cylinder surfaces are given the output value -1.0.

An application can change the frequency of the concentric cylinders. Increasing the frequency reduces the distances between cylinders. To specify the frequency, call the SetFrequency() method.

This noise module, modified with some low-frequency, low-power turbulence, is useful for generating wood-like textures.

This noise module does not require any source modules.

## Public Member Functions

| Cylinders ()
| Constructor.
double | GetFrequency () const
| Returns the frequency of the concentric cylinders.
virtual int | GetSourceModuleCount () const
| Returns the number of source modules required by this noise module.
virtual double | GetValue (double x, double y, double z) const
| Generates an output value given the coordinates of the specified input value.
void | SetFrequency (double frequency)
| Sets the frequenct of the concentric cylinders.

## Protected Attributes

double | m_frequency
| Frequency of the concentric cylinders.

## Constructor & Destructor Documentation

Cylinders::Cylinders | ( |  | ) |

| Constructor. The default frequency is set to noise::module::DEFAULT_CYLINDERS_FREQUENCY.

## Member Function Documentation

double noise::module::Cylinders::GetFrequency | ( |  | ) | const`[inline]`

Returns the frequency of the concentric cylinders.

Returns:
  The frequency of the concentric cylinders.

Increasing the frequency increases the density of the concentric cylinders, reducing the distances between them.

virtual int noise::module::Cylinders::GetSourceModuleCount | ( |  | ) | const`[inline, virtual]`

Returns the number of source modules required by this noise module.

Returns:
  The number of source modules required by this noise module.

Implements noise::module::Module.

double Cylinders::GetValue | ( | double | x,
|  | double | y,
|  | double | z
| ) | const`[virtual]`

Generates an output value given the coordinates of the specified input value.

Parameters:

  | x | The x coordinate of the input value.
  | y | The y coordinate of the input value.
  | z | The z coordinate of the input value.

Returns:
  The output value.

Precondition:
  All source modules required by this noise module have been passed to the SetSourceModule() method.

Before an application can call this method, it must first connect all required source modules via the SetSourceModule() method. If these source modules are not connected to this noise module, this method raises a debug assertion.

To determine the number of source modules required by this noise module, call the GetSourceModuleCount() method.

Implements noise::module::Module.

void noise::module::Cylinders::SetFrequency | ( | double | frequency | ) | `[inline]`

Sets the frequenct of the concentric cylinders.

Parameters:

  | frequency | The frequency of the concentric cylinders.

Increasing the frequency increases the density of the concentric cylinders, reducing the distances between them.

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

- cylinders.h
- cylinders.cpp