C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
PCallBack NoiseMapBuilderCallback
PFilter IBuilderFilter
PHeight int
PNoiseMap IMap2D
PSourceModule IModule
PWidth int

Открытые методы

Метод Описание
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.

Описание методов

Build() публичный абстрактный Метод

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
Результат void

SetSize() публичный Метод

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.
Результат void

Описание свойств

PCallBack защищенное свойство

The callback function that Build() calls each time it fills a row of the noise map with coherent-noise values.
protected NoiseMapBuilderCallback PCallBack
Результат NoiseMapBuilderCallback

PFilter защищенное свойство

Filter.
protected IBuilderFilter PFilter
Результат IBuilderFilter

PHeight защищенное свойство

The height of the map.
protected int PHeight
Результат int

PNoiseMap защищенное свойство

The destination noise map that will contain the coherent-noise values.
protected IMap2D PNoiseMap
Результат IMap2D

PSourceModule защищенное свойство

The source input module.
protected IModule PSourceModule
Результат IModule

PWidth защищенное свойство

The width of the map.
protected int PWidth
Результат int