C# Class LibNoise.Builder.NoiseMapBuilder

Abstract base class for a noise-map builder A builder class builds a noise map by filling it with coherent-noise values generated from the surface of a three-dimensional mathematical object. Each builder class defines a specific three-dimensional surface, such as a cylinder, sphere, or plane. A builder class describes these input values using a coordinate system applicable for the mathematical object (e.g., a latitude/longitude coordinate system for the spherical noise-map builder.) It then "flattens" these coordinates onto a plane so that it can write the coherent-noise values into a two-dimensional noise map. Building the Noise Map To build the noise map, perform the following steps: - Pass the bounding coordinates to the SetBounds() method. - Pass the noise map size, in points, to the SetDestSize() method. - Pass a NoiseMap object to the SetDestNoiseMap() method. - Pass a noise module (derived from Noise.Module) to the SetSourceModule() method. - Call the Build() method. You may also pass a callback function to the SetCallback() method. The Build() method calls this callback function each time it fills a row of the noise map with coherent-noise values. This callback function has a single integer parameter that contains a count of the rows that have been completed. It returns void. Note that SetBounds() is not defined in the abstract base class; it is only defined in the derived classes. This is because each model uses a different coordinate system.
Datei anzeigen Open project: everbytes/LibNoise Class Usage Examples

Protected Properties

Property Type Description
PCallBack NoiseMapBuilderCallback
PFilter IBuilderFilter
PHeight int
PNoiseMap IMap2D
PSourceModule IModule
PWidth int

Public Methods

Method Description
Build ( ) : void

Builds the noise map. @pre SetBounds() was previously called. @pre NoiseMap was previously defined. @pre a SourceModule was previously defined. @pre The width and height values specified by SetSize() are positive. @pre The width and height values specified by SetSize() do not exceed the maximum possible width and height for the noise map. @post The original contents of the destination noise map is destroyed. @throw noise::ArgumentException See the preconditions. If this method is successful, the destination noise map contains the coherent-noise values from the noise module specified by the SourceModule.

SetSize ( int width, int height ) : void

Sets the new size for the destination noise map. This method does not change the size of the destination noise map until the Build() method is called. @pre The width and height values are positive. @throw ArgumentException See the preconditions.

Method Details

Build() public abstract method

Builds the noise map. @pre SetBounds() was previously called. @pre NoiseMap was previously defined. @pre a SourceModule was previously defined. @pre The width and height values specified by SetSize() are positive. @pre The width and height values specified by SetSize() do not exceed the maximum possible width and height for the noise map. @post The original contents of the destination noise map is destroyed. @throw noise::ArgumentException See the preconditions. If this method is successful, the destination noise map contains the coherent-noise values from the noise module specified by the SourceModule.
public abstract Build ( ) : void
return void

SetSize() public method

Sets the new size for the destination noise map. This method does not change the size of the destination noise map until the Build() method is called. @pre The width and height values are positive. @throw ArgumentException See the preconditions.
public SetSize ( int width, int height ) : void
width int width The new width for the destination noise map.
height int height The new height for the destination noise map.
return void

Property Details

PCallBack protected_oe property

The callback function that Build() calls each time it fills a row of the noise map with coherent-noise values.
protected NoiseMapBuilderCallback PCallBack
return NoiseMapBuilderCallback

PFilter protected_oe property

Filter.
protected IBuilderFilter PFilter
return IBuilderFilter

PHeight protected_oe property

The height of the map.
protected int PHeight
return int

PNoiseMap protected_oe property

The destination noise map that will contain the coherent-noise values.
protected IMap2D PNoiseMap
return IMap2D

PSourceModule protected_oe property

The source input module.
protected IModule PSourceModule
return IModule

PWidth protected_oe property

The width of the map.
protected int PWidth
return int