📄 scene.h
字号:
//Version 1.1c
//Code by Phil.Z
//Date 2007-12-28
#ifndef SCENE_H_
#define SCENE_H_
#include "Figure.h"
class Scene
{
public:
Scene(CWnd *pWnd);
~Scene();
void SetParam(float *initList);
void InitGLScene();
void ResizeGLScene(float width,float height);
void DrawGLScene();
bool NewFigure(int FigureClass,float *initList);
bool DeleteSelFigure();
void SetSceneLight(bool bLight);
void SetSceneLight(int LightParam,float * value);
void SetSceneBkColor(float * value);
void SetSceneRot(int RotCrood,float * value);
void SetDistance(float StepDistance);
void SetPick(int xMousePos,int yMousePos);
void SetInsertMode();
void WinPosToGLPos(float GLPos[],CPoint WinPos);
float GetDistance() const;
void Move(unsigned int Direction); //Move scene camera
bool IsCurSelected();
void MoveCurFigure(int Coord,int OP,int value);
void RotateCurFigure(int Coord,int OP,int value);
private:
struct FigureNode
{
Figure * figure;
FigureNode * next;
FigureNode * prior;
};
typedef FigureNode FigureList;
public:
FigureList * m_pFigure;
private:
FigureNode * m_pCurFigure;
CWnd *m_pWnd;
float m_afBkColor[4];
bool m_bLight;
float m_afLightColor[8];
float m_afLightPos[4];
float m_fXRot;
float m_fYRot;
float m_fWalkDistance;
float m_fXPos;
float m_fZPos;
void UpdateLightState();
public:
void Display();
enum //常量
{
F2D_POINT, F2D_LINE, F2D_RECT, F2D_CIRCLE, //NewFigure
F3D_CUBE, F3D_SPHERE, F3D_DISK, F3D_CYLINDER,
LP_AMBIENT, LP_DIFFUSE, LP_POSITION, //SetSceneLight
RC_XROT, RC_YROT, RC_XANDY, //SetSceneRot
MV_FORWARD, MV_BACK, MV_LEFT, MV_RIGHT, //Move
FP_XPOS, FP_YPOS, FP_ZPOS,
FR_XROT, FR_YROT, FR_ZROT,
OP_ADD, OP_MINUS //预留直接赋值位置
};
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -