📄 tefaultformation.h
字号:
#ifndef TE_FAULT_FORMATION_H#define TE_FAULT_FORMATION_H/*****************************************************************************\ * * TeFaultFormation.h * * TeFaultFormation generator class * * Author: Martin Havl龛ek (xhavli15 AT stud.fit.vutbr.cz) * Contributors: * * ---------------------------------------------------------------------------- * * THIS SOFTWARE IS NOT COPYRIGHTED * * This source code is offered for use in the public domain. * You may use, modify or distribute it freely. * * This source code is distributed in the hope that it will be useful but * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * DISCLAIMED. This includes but is not limited to warranties of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * If you find the source code useful, authors will kindly welcome * if you give them credit and keep their names with their source code. *\*****************************************************************************//** * TeFaultFormation generator class header file. * * \file TeFaultFormation.h * \author Martin Havl龛ek (martyn AT seznam.cz) */#include "generators/TeGenerator.h"/** * 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: * \li Two points in the heightmap are selected. These points define the fault * vector. The selection is done randomly (the generator is initialized * with TeFaultFormation::seed as random seed). * \li According to current iteration number, TeFaultFormation::minDelta and * TeFaultFormation::maxDelta, the height of the fault is computed. * \li All values in one half-plane specified by the fault are increased * by computed value. Rest of values is left unchanged. * \li This cycle is done TeFaultFormation::numFaults -times. */class TeFaultFormation : public TeGenerator {private: /** Private attribute used by generator. \sa seed */ unsigned int _seed; /** Private attribute used by generator. \sa numFaults */ int _numFaults; /** Private attribute used by generator. \sa minDelta */ float _minDelta; /** Private attribute used by generator. \sa maxDelta */ float _maxDelta;public: /** * Random number generator seed. * * Set this one to modify its private image. * * \sa updateParams() */ unsigned int seed; /** * Number of faults used to generate the heightmap. * * Set this one to modify its private image. * * \sa updateParams() */ int numFaults; /** * 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. * * \sa updateParams() */ float minDelta; /** * 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. * * \sa updateParams() */ float maxDelta; TeFaultFormation(); virtual void setDefaults(); virtual void updateParams(); virtual void generate(); virtual SbBool genStep();};#endif /* TE_FAULT_FORMATION_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -