3dPageTorus.cpp
资源名称:gloop.zip [点击查看]
上传用户:shxiangxiu
上传日期:2007-01-03
资源大小:1101k
文件大小:3k
源码类别:
OpenGL
开发平台:
Visual C++
- /////////////////////////////////////////////////////////////////////////////
- // 3dPageTorus.cpp : implementation file
- //
- // glOOP (OpenGL Object Oriented Programming library)
- // Copyright (c) Craig Fahrnbach 1997, 1998
- //
- // OpenGL is a registered trademark of Silicon Graphics
- //
- //
- // This program is provided for educational and personal use only and
- // is provided without guarantee or warrantee expressed or implied.
- //
- // Commercial use is strickly prohibited without written permission
- // from ImageWare Development.
- //
- // This program is -not- in the public domain.
- //
- /////////////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "glOOP.h"
- #include "3dObjectDialog.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
- //////////////////////////////////////////////////////////////////
- // C3dObjectTorus
- IMPLEMENT_DYNCREATE(C3dPageTorus, CPropertyPage)
- /////////////////////////////////////////////////////////////////////////////
- // C3dPageTorus dialog construction
- C3dPageTorus::C3dPageTorus()
- : CPropertyPage(C3dPageTorus::IDD)
- {
- //{{AFX_DATA_INIT(C3dPageTorus)
- m_fMajorRadius = 0.0f;
- m_fMinorRadius = 0.0f;
- m_iMinorSeg = 0;
- m_iMajorSeg = 0;
- m_szName = _T("");
- //}}AFX_DATA_INIT
- }
- /////////////////////////////////////////////////////////////////////////////
- // C3dPageTorus Destructor
- C3dPageTorus::~C3dPageTorus()
- {
- }
- void C3dPageTorus::DoDataExchange(CDataExchange* pDX)
- {
- CPropertyPage::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(C3dPageTorus)
- DDX_Text(pDX, IDC_MAJOR_RADIUS, m_fMajorRadius);
- DDX_Text(pDX, IDC_MINOR_RADIUS, m_fMinorRadius);
- DDX_Text(pDX, IDC_MINOR_SEGMENTS, m_iMinorSeg);
- DDX_Text(pDX, IDC_MAJOR_SEGMENTS, m_iMajorSeg);
- DDX_Text(pDX, IDC_NAME, m_szName);
- DDV_MaxChars(pDX, m_szName, 40);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(C3dPageTorus, CPropertyPage)
- //{{AFX_MSG_MAP(C3dPageTorus)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // C3dPageTorus message handlers
- BOOL C3dPageTorus::OnInitDialog()
- {
- // Set our local values to the Objects' values
- m_szName = m_pObject->m_szName;
- m_fMajorRadius = m_pObject->m_fMajorRadius;
- m_fMinorRadius = m_pObject->m_fMinorRadius;
- m_iMajorSeg = m_pObject->m_iNumMajor;
- m_iMinorSeg = m_pObject->m_iNumMinor;
- CPropertyPage::OnInitDialog(); // let the base class do the default work
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void C3dPageTorus::OnOK()
- {
- // Dialog box is being initialized (FALSE)
- // or data is being retrieved (TRUE).
- UpdateData(TRUE);
- // Set our Objects' values to the local values
- m_pObject->m_szName = m_szName;
- m_pObject->m_fMajorRadius = m_fMajorRadius;
- m_pObject->m_fMinorRadius = m_fMinorRadius;
- m_pObject->m_iNumMajor = m_iMajorSeg;
- m_pObject->m_iNumMinor = m_iMinorSeg;
- // Force the object to rebuild its' display list
- m_pObject->m_bBuildLists = TRUE;
- CPropertyPage::OnOK();
- }