CPoint3DCloud.cpp
上传用户:yanweivga
上传日期:2008-02-19
资源大小:1056k
文件大小:4k
源码类别:

OpenGL

开发平台:

Visual C++

  1. // CPoint3DCloud.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "CPoint3DCloud.h"
  5. #include "MainFrm.h"
  6. #include "CPoint3DCloudDoc.h"
  7. #include "CPoint3DCloudView.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CCPoint3DCloudApp
  15. BEGIN_MESSAGE_MAP(CCPoint3DCloudApp, CWinApp)
  16. //{{AFX_MSG_MAP(CCPoint3DCloudApp)
  17. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  18. // NOTE - the ClassWizard will add and remove mapping macros here.
  19. //    DO NOT EDIT what you see in these blocks of generated code!
  20. //}}AFX_MSG_MAP
  21. // Standard file based document commands
  22. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  23. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  24. // Standard print setup command
  25. ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  26. END_MESSAGE_MAP()
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CCPoint3DCloudApp construction
  29. CCPoint3DCloudApp::CCPoint3DCloudApp()
  30. {
  31. // TODO: add construction code here,
  32. // Place all significant initialization in InitInstance
  33. }
  34. /////////////////////////////////////////////////////////////////////////////
  35. // The one and only CCPoint3DCloudApp object
  36. CCPoint3DCloudApp theApp;
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CCPoint3DCloudApp initialization
  39. BOOL CCPoint3DCloudApp::InitInstance()
  40. {
  41. AfxEnableControlContainer();
  42. // Standard initialization
  43. // If you are not using these features and wish to reduce the size
  44. //  of your final executable, you should remove from the following
  45. //  the specific initialization routines you do not need.
  46. #ifdef _AFXDLL
  47. Enable3dControls(); // Call this when using MFC in a shared DLL
  48. #else
  49. Enable3dControlsStatic(); // Call this when linking to MFC statically
  50. #endif
  51. // Change the registry key under which our settings are stored.
  52. // TODO: You should modify this string to be something appropriate
  53. // such as the name of your company or organization.
  54. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  55. LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  56. // Register the application's document templates.  Document templates
  57. //  serve as the connection between documents, frame windows and views.
  58. CSingleDocTemplate* pDocTemplate;
  59. pDocTemplate = new CSingleDocTemplate(
  60. IDR_MAINFRAME,
  61. RUNTIME_CLASS(CCPoint3DCloudDoc),
  62. RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  63. RUNTIME_CLASS(CCPoint3DCloudView));
  64. AddDocTemplate(pDocTemplate);
  65. // Enable DDE Execute open
  66. EnableShellOpen();
  67. RegisterShellFileTypes(TRUE);
  68. // Parse command line for standard shell commands, DDE, file open
  69. CCommandLineInfo cmdInfo;
  70. ParseCommandLine(cmdInfo);
  71. // Dispatch commands specified on the command line
  72. if (!ProcessShellCommand(cmdInfo))
  73. return FALSE;
  74. // The one and only window has been initialized, so show and update it.SW_SHOW
  75. m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
  76. m_pMainWnd->UpdateWindow();
  77. // Enable drag/drop open
  78. m_pMainWnd->DragAcceptFiles();
  79. return TRUE;
  80. }
  81. /////////////////////////////////////////////////////////////////////////////
  82. // CAboutDlg dialog used for App About
  83. class CAboutDlg : public CDialog
  84. {
  85. public:
  86. CAboutDlg();
  87. // Dialog Data
  88. //{{AFX_DATA(CAboutDlg)
  89. enum { IDD = IDD_ABOUTBOX };
  90. //}}AFX_DATA
  91. // ClassWizard generated virtual function overrides
  92. //{{AFX_VIRTUAL(CAboutDlg)
  93. protected:
  94. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  95. //}}AFX_VIRTUAL
  96. // Implementation
  97. protected:
  98. //{{AFX_MSG(CAboutDlg)
  99. // No message handlers
  100. //}}AFX_MSG
  101. DECLARE_MESSAGE_MAP()
  102. };
  103. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  104. {
  105. //{{AFX_DATA_INIT(CAboutDlg)
  106. //}}AFX_DATA_INIT
  107. }
  108. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  109. {
  110. CDialog::DoDataExchange(pDX);
  111. //{{AFX_DATA_MAP(CAboutDlg)
  112. //}}AFX_DATA_MAP
  113. }
  114. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  115. //{{AFX_MSG_MAP(CAboutDlg)
  116. // No message handlers
  117. //}}AFX_MSG_MAP
  118. END_MESSAGE_MAP()
  119. // App command to run the dialog
  120. void CCPoint3DCloudApp::OnAppAbout()
  121. {
  122. CAboutDlg aboutDlg;
  123. aboutDlg.DoModal();
  124. }
  125. /////////////////////////////////////////////////////////////////////////////
  126. // CCPoint3DCloudApp message handlers