3dPageCSG.cpp
资源名称:gloop.zip [点击查看]
上传用户:shxiangxiu
上传日期:2007-01-03
资源大小:1101k
文件大小:4k
源码类别:
OpenGL
开发平台:
Visual C++
- /////////////////////////////////////////////////////////////////////////////
- // 3dPageCSG.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
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- //////////////////////////////////////////////////////////////////
- // C3dPageCSG
- IMPLEMENT_DYNCREATE(C3dPageCSG, CPropertyPage)
- /////////////////////////////////////////////////////////////////////////////
- // C3dPageCSG dialog
- C3dPageCSG::C3dPageCSG()
- :CPropertyPage(C3dPageCSG::IDD)
- {
- //{{AFX_DATA_INIT(C3dPageCSG)
- m_szName = _T("");
- m_iCSGType = -1;
- //}}AFX_DATA_INIT
- }
- /////////////////////////////////////////////////////////////////////////////
- // C3dPageCSG Destructor
- C3dPageCSG::~C3dPageCSG()
- {
- }
- void C3dPageCSG::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(C3dPageCSG)
- DDX_Text(pDX, IDC_NAME, m_szName);
- DDX_Radio(pDX, IDC_RADIO_OR, m_iCSGType);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(C3dPageCSG, CDialog)
- //{{AFX_MSG_MAP(C3dPageCSG)
- ON_BN_CLICKED(IDC_RADIO_OR, OnRadioOR)
- ON_BN_CLICKED(IDC_RADIO_AND, OnRadioAND)
- ON_BN_CLICKED(IDC_RADIO_SUB_AB, OnRadioSubAb)
- ON_BN_CLICKED(IDC_RADIO_SUB_BA, OnRadioSubBa)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // C3dPageCSG message handlers
- BOOL C3dPageCSG::OnInitDialog()
- {
- // let the base class do the default work
- CPropertyPage::OnInitDialog();
- // Set our local values to the Objects' values
- m_szName = m_pObject->m_szName;
- if(m_pObject->m_iCSGType == CSG_TYPE_OR)
- m_iCSGType = 0;
- if(m_pObject->m_iCSGType == CSG_TYPE_SUB_AB)
- m_iCSGType = 1;
- if(m_pObject->m_iCSGType == CSG_TYPE_SUB_BA)
- m_iCSGType = 2;
- if(m_pObject->m_iCSGType == CSG_TYPE_AND)
- m_iCSGType = 3;
- // Dialog box is being initialized (FALSE)
- // or data is being retrieved (TRUE).
- UpdateData(FALSE);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void C3dPageCSG::OnSize(UINT nType, int cx, int cy)
- {
- CPropertyPage::OnSize(nType, cx, cy);
- // Get the handle of the CTreeCtrl window and set
- // its size
- // HWND hTree = m_treeCtrl.GetSafeHwnd();
- // if(hTree) {
- // m_treeCtrl.SetWindowPos(NULL, 0, 0,
- // cx, cy, SWP_NOZORDER | SWP_NOACTIVATE);
- // }
- }
- void C3dPageCSG::OnOK()
- {
- // Dialog box is being initialized (FALSE)
- // or data is being retrieved (TRUE).
- UpdateData(TRUE); // Get the dialog data
- // Set the Object data..
- m_pObject->m_szName = m_szName;
- if(m_iCSGType == 0)
- m_pObject->m_iCSGType = CSG_TYPE_OR;
- if(m_iCSGType == 1)
- m_pObject->m_iCSGType = CSG_TYPE_SUB_AB;
- if(m_iCSGType == 2)
- m_pObject->m_iCSGType = CSG_TYPE_SUB_BA;
- if(m_iCSGType == 3)
- m_pObject->m_iCSGType = CSG_TYPE_AND;
- // Force the object to rebuild its' display list
- m_pObject->m_bBuildLists = TRUE;
- CPropertyPage::OnOK();
- }
- void C3dPageCSG::OnRadioOR()
- {
- m_iCSGType = 0;
- }
- void C3dPageCSG::OnRadioAND()
- {
- m_iCSGType = 1;
- }
- void C3dPageCSG::OnRadioSubAb()
- {
- m_iCSGType = 2;
- }
- void C3dPageCSG::OnRadioSubBa()
- {
- m_iCSGType = 3;
- }