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

TeLinearFilter Class Reference

#include <TeLinearFilter.h>

Inheritance diagram for TeLinearFilter:

TeGenerator List of all members.

Detailed Description

Generator that performs smoothing of heightmap values.

This generator represents simple linear filter that can be used to smooth values stored in the TeHeightMap object.

In one cycle, the filter goes through the data in all rows and columns in both directions and changes the values according to the neighbours and filtration coefficient TeLinearFilter::coef. This value should be between (0.0f-1.0f). When large - smaller changes, when small - huge filtering will be done.

This cycle will be done TeLinearFilter::times -times.


Public Member Functions

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

Public Attributes

int times
float coef

Private Attributes

int _times
float _coef


Constructor & Destructor Documentation

TeLinearFilter::TeLinearFilter  ) 
 

Constructor.

Sets default generator parameters and resets the step counter.


Member Function Documentation

void TeLinearFilter::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::filter_Linear() method.

Implements TeGenerator.

SbBool TeLinearFilter::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 TeLinearFilter::setDefaults  )  [virtual]
 

Sets default generator parameters.

Implements TeGenerator.

void TeLinearFilter::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:
times, coef

Implements TeGenerator.


Member Data Documentation

float TeLinearFilter::_coef [private]
 

Private attribute used by generator.

See also:
coef

int TeLinearFilter::_times [private]
 

Private attribute used by generator.

See also:
times

float TeLinearFilter::coef
 

Filtration coefficient.

This value should be between (0.0f-1.0f). When large - smaller changes, when small - huge filtering will be done.

Set this one to modify its private image.

See also:
updateParams()

int TeLinearFilter::times
 

How many times the filtration to be performed.

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