📄 mytree.h
字号:
/*
* Copyleft (c) 2008 Lauming chen, SooChow University.
*
*
*
*/
#ifndef _3D_MyTree_
#define _3D_MyTree_
#include "Branch.h"
#include "Leaf.h"
#include "Enviroment.h"
class MyTree {
public :
MyTree();
MyTree( int maxBranchDepth, float maxBranchLength, float baseBranchRadius, float twist, float expand, int slices, float leafSize );
~MyTree();
void randomGenerate();
void draw();
void rebuild();
void showGrowProcess();
void drawBase();
void drawBranches( int stacks, float radius, float length, float twist );
void drawLeftBranch( float baseRadius, float topRadius, float length, int depth, int twist );
void drawRightBranch( float baseRadius, float topRadius, float length, int depth, int twist );
void setMaxBranchDepth( int depth );
void setMaxBranchLength( float length );
void setMaxBaseLength( float length );
void setBaseBranchRadius( float radius );
void setLeftBranchTwist( float twist );
void setLeftBranchExpand( float expand );
void setRightBranchTwist( float twist );
void setRightBranchExpand( float expand );
void setBranchSlices( int slices );
void setLeafSize( float size );
void setLeafVisible( bool visible );
void setLeafShakeble( bool shakeble );
void pauseGrow();
void playGrow();
int getMaxBranchDepth();
float getLeftBranchTwist();
float getLeftBranchExpand();
float getRightBranchTwist();
float getRightBranchExpand();
int getBranchSlices();
float getMaxBaseLength();
float getMaxBranchLangth();
float getBaseBranchRadius();
float getLeafSize();
bool isLeafVisible();
bool isLeafShakeble();
bool isGrowUp();
bool isGrowing();
private :
int maxBranchDepth;
int currentBranchDepth;
float maxBranchLength;
float currentBranchLength;
float maxBaseLength;
float currentBaseLength;
float baseBranchRadius;
float currentBranchRadius;
float leafSize;
bool growUp;
bool pause;
Branch* leftBranch;
Branch* rightBranch;
Leaf* leaf;
Enviroment enviroment;
int count;
};
#endif // _3D_MyTree_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -