Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Тихомиров Ю. Программирование трёхмерной графики / Files / Texture / TextureView
.h// TextureView.h : header file
//
#include "DibGL.h"
#include "OpenGLView.h"
class CTextureDoc;
class CTextureDlg;
/////////////////////////////////////////////////////////////////////////////
// CTextureView view
class CTextureView : public COpenGLView
{
protected:
CTextureView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CTextureView)
// Attributes
protected:
int m_iHeight ;
int m_iWidth ;
void* m_pBits ;
GLenum m_PixelFormat ;
GLfloat m_radius1;
GLfloat m_radius2;
GLfloat m_angle1;
GLfloat m_angle2;
GLfloat m_slices;
GLfloat m_stacks;
GLfloat m_height;
GLUquadricObj *m_quadObj;
public:
CTextureDoc* GetDocument();
int GetWidth() {return m_iWidth;}
int GetHeight() {return m_iHeight;}
enum {
plate = 1,
cube,
cone,
cylinder,
sphere,
pyramid
} m_Object;
CTextureDlg *m_pDlg;
// Operations
public:
void ChangeSettings();
BOOL TexMapScalePow2();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTextureView)
public:
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CTextureView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
void BuildList(GLdouble size);
void OutputGlError(char* label);
//{{AFX_MSG(CTextureView)
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnOpenBmp();
afx_msg void OnCustomize();
afx_msg void OnCylinder();
afx_msg void OnCone();
afx_msg void OnCube();
afx_msg void OnPlate();
afx_msg void OnSphere();
afx_msg void OnPyramid();
afx_msg void OnUpdatePlate(CCmdUI* pCmdUI);
afx_msg void OnUpdateCylinder(CCmdUI* pCmdUI);
afx_msg void OnUpdateCone(CCmdUI* pCmdUI);
afx_msg void OnUpdateCube(CCmdUI* pCmdUI);
afx_msg void OnUpdateSphere(CCmdUI* pCmdUI);
afx_msg void OnUpdatePyramid(CCmdUI* pCmdUI);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnPlay();
afx_msg void OnUpdatePlay(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
void CleanUp();
void Translate(CDibGL& aDib);
private:
BOOL m_play;
void DrawScene();
void BuildSphere(GLdouble size);
void BuildCylinder(GLdouble size);
void BuildCone(GLdouble size);
void BuildCube(GLdouble size);
void BuildPlate(GLdouble size);
void BuildPyramid(GLdouble size);
};
#ifndef _DEBUG // debug version in TextureView.cpp
inline CTextureDoc* CTextureView::GetDocument()
{ return (CTextureDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
Соседние файлы в папке Texture