📄 tegenerator.h
字号:
#ifndef TE_GENERATOR_H#define TE_GENERATOR_H/*****************************************************************************\ * * TeGenerator.h * * TeGenerator abstract 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. *\*****************************************************************************//** * TeGenerator abstract class header file. * * \file TeGenerator.h * \author Martin Havl龛ek (martyn AT seznam.cz) */#include "TeHeightMap.h"/** * Abstract class meant to be a parent to all generators. * * This abstract class defines interface for derived classes. * * Generators can be used in two different ways with same results. * One way is to use generate() method to gain result in single function * call. The other way is to call genStep() several times and obtain * the result in the near future. The fact that result is ready to use * is identified by the TRUE value returned by this method. In case that * task is not done yet this function returns FALSE. * * Typical usage of some generator should look like this: * \li Create the generator object (if you didn't do this before). Note, that * TeGenerator class is abstract, so you have to choose from derived * classes. * \li Create the TeHeightMap object to store results (or choose the one * already created). * \li Call setHMap() method with address of the heightmap as a parameter. * \li You can also modify generator parameters to whatever you desire. * The default or the last time used parameters will be used if you * step this point. * \li Call generate() method once OR genStep() method several times (task * finish is indicated by returning TRUE). * \li The result is in the heightmap object. */class TeGenerator {protected: /** Pointer to the heightmap. */ TeHeightMap *hmap; /** Number of steps required to complete task. */ int stepNum; /** Current step counter. */ int step; // interface for derived classes /** Pure virtual function, see derived classes for more information. */ virtual void updateParams() = 0;public: void reset(); void setHMap(TeHeightMap *m); // interface for derived classes /** Pure virtual function, see derived classes for more information. */ virtual void setDefaults() = 0; /** Pure virtual function, see derived classes for more information. */ virtual void generate() = 0; /** Pure virtual function, see derived classes for more information. */ virtual SbBool genStep() = 0;};#endif /* TE_GENERATOR_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -