3DEDITOR.CPP
Upload User: nthssl
Upload Date: 2022-04-05
Package Size: 25357k
Code Size: 5k
Category:

OpenCV

Development Platform:

Visual C++

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