www.pudn.com > SurfWareNew06.3.5(LYW).rar > CreateModel.cpp


// CreateModel.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "surfware.h" 
#include "CreateModel.h" 
#include "MainFrm.h" 
#include "include/PredefineData.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CCreateModel dialog 
 
 
CCreateModel::CCreateModel(CWnd* pParent /*=NULL*/) 
	: CDialog(CCreateModel::IDD, pParent) 
{ 
 
} 
 
 
void CCreateModel::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CCreateModel) 
	DDX_Control(pDX, IDC_CREATE_MD_1, m_SphereBtn); 
	DDX_Control(pDX, IDC_CREATE_MD_2, m_ConeBtn); 
	DDX_Control(pDX, IDC_CREATE_MD_3, m_BoxBtn); 
	DDX_Control(pDX, IDC_CREATE_MD_4, m_TeapotBtn); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CCreateModel, CDialog) 
	//{{AFX_MSG_MAP(CCreateModel) 
	ON_BN_CLICKED(IDC_CREATE_MD_4, OnCreateTeapot) 
	ON_BN_CLICKED(IDC_CREATE_MD_3, OnCreateBox) 
	ON_BN_CLICKED(IDC_CREATE_MD_1, OnCreateSphere) 
	ON_BN_CLICKED(IDC_CREATE_MD_2, OnCreateCone) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CCreateModel message handlers 
BOOL CCreateModel::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
 
	SetPublicAttribs(); 
	 
	SET_DLG_POS; 
 
 
	static ButtonInfoType ButtonInfo[]= 
	{ 
		{&this->m_SphereBtn,	IDI_LEFTPANNEL_SPHERE,OPT_CR_MD_SPHERE}, 
		{&this->m_ConeBtn,		IDI_LEFTPANNEL_CONE,OPT_CR_MD_CONE}, 
		{&this->m_BoxBtn,		IDI_LEFTPANNEL_BOX,OPT_CR_MD_BOX}, 
		{&this->m_TeapotBtn,	IDI_LEFTPANNEL_TEAPOT,OPT_CR_MD_TEAPORT}, 
	}; 
	 
	btn=sizeof(ButtonInfo)/sizeof(ButtonInfoType); 
 
	SetButtons(ButtonInfo); 
	 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
void CCreateModel::OnCreateTeapot()  
{ 
	CreateModel(OPT_CR_MD_TEAPORT); 
} 
 
void CCreateModel::OnCreateBox()  
{ 
	CreateModel(OPT_CR_MD_BOX); 
} 
 
void CCreateModel::OnCreateSphere()  
{ 
	CreateModel(OPT_CR_MD_SPHERE); 
} 
 
void CCreateModel::OnCreateCone()  
{ 
	CreateModel(OPT_CR_MD_CONE); 
}