Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

TeFaultFormation Class Reference

#include <TeFaultFormation.h>

Inheritance diagram for TeFaultFormation:

TeGenerator List of all members.

Detailed Description

Generator that computes heightmap values using fault formation algorithm.

This generator implements fault-formation algorithm. This algorithm is designated to generate heightmap values. Generated values are stored in the TeHeightMap object.

The algorithm works as follows:


Public Member Functions

 TeFaultFormation ()
virtual void setDefaults ()
virtual void updateParams ()
virtual void generate ()
virtual SbBool genStep ()

Public Attributes

unsigned int seed
int numFaults
float minDelta
float maxDelta

Private Attributes

unsigned int _seed
int _numFaults
float _minDelta
float _maxDelta


Constructor & Destructor Documentation

TeFaultFormation::TeFaultFormation  ) 
 

Constructor.

Sets default generator parameters and resets the step counter.


Member Function Documentation

void TeFaultFormation::generate  )  [virtual]
 

In-One-Step generation.

The whole generation will be done in one function call.

Calling updateParams() should be the first thing done here. It calls original TeHeightMap::generate_FaultFormation() method.

Implements TeGenerator.

SbBool TeFaultFormation::genStep  )  [virtual]
 

One step of the generation algorithm.

Calling updateParams() should be the first thing done in the first run. reset() and TeHeightMap::resetFlags() should be called before returning TRUE.

Returns:
TRUE if generation finished and object is ready, FALSE otherwise.

Todo:
Generation should be controlled by stepNum attribute. This one should be dynamically updated according to system performance.

Implements TeGenerator.

void TeFaultFormation::setDefaults  )  [virtual]
 

Sets default generator parameters.

Implements TeGenerator.

void TeFaultFormation::updateParams  )  [virtual]
 

Updates private parameters to fit theirs public images.

I call this "delayed setting". It ensures, that correct attributes are used for the current task (the private ones). When the task is done, private attributes are updated to match the public ones and then will be used for the next task.

User doesn't need to worry about this, because this method is called internally from generate() and genStep() functions.

See also:
seed, numFaults, minDelta, maxDelta

Implements TeGenerator.


Member Data Documentation

float TeFaultFormation::_maxDelta [private]
 

Private attribute used by generator.

See also:
maxDelta

float TeFaultFormation::_minDelta [private]
 

Private attribute used by generator.

See also:
minDelta

int TeFaultFormation::_numFaults [private]
 

Private attribute used by generator.

See also:
numFaults

unsigned int TeFaultFormation::_seed [private]
 

Private attribute used by generator.

See also:
seed

float TeFaultFormation::maxDelta
 

Maximal value used to modify heightmap values in one iteration.

This value will be used in the first iteration. Other values will be interpolated according to minDelta attribute and iteration number.

Set this one to modify its private image.

See also:
updateParams()

float TeFaultFormation::minDelta
 

Minimal value used to modify heightmap values in one iteration.

This value will be used in the last iteration. Other values will be interpolated according to maxDelta attribute and iteration number.

Set this one to modify its private image.

See also:
updateParams()

int TeFaultFormation::numFaults
 

Number of faults used to generate the heightmap.

Set this one to modify its private image.

See also:
updateParams()

unsigned int TeFaultFormation::seed
 

Random number generator seed.

Set this one to modify its private image.

See also:
updateParams()


Generated on Sun May 8 16:45:06 2005 for TerrainEngine by Doxygen 1.4.1