1 // Viewer3dApp.cpp : Defines the class behaviors for the application.
5 #include "Viewer3dApp.h"
7 #include <OCC_MainFrame.h>
8 #include <OCC_3dChildFrame.h>
9 #include "Viewer3dDoc.h"
10 #include "Viewer3dView.h"
12 /////////////////////////////////////////////////////////////////////////////
15 BEGIN_MESSAGE_MAP(CViewer3dApp, CWinApp)
16 //{{AFX_MSG_MAP(CViewer3dApp)
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!
21 // Standard file based document commands
22 ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
23 ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
26 /////////////////////////////////////////////////////////////////////////////
27 // CViewer3dApp construction
29 CViewer3dApp::CViewer3dApp() : OCC_App()
31 SampleName = "Viewer3d"; //for about dialog
32 SetSamplePath (L"..\\..\\03_Viewer3d");
35 /////////////////////////////////////////////////////////////////////////////
36 // The one and only CViewer3dApp object
40 /////////////////////////////////////////////////////////////////////////////
41 // CViewer3dApp initialization
43 BOOL CViewer3dApp::InitInstance()
45 AfxEnableControlContainer();
47 // Standard initialization
48 // If you are not using these features and wish to reduce the size
49 // of your final executable, you should remove from the following
50 // the specific initialization routines you do not need.
52 // Change the registry key under which our settings are stored.
53 // You should modify this string to be something appropriate
54 // such as the name of your company or organization.
55 SetRegistryKey(_T("Local AppWizard-Generated Applications"));
57 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.
62 CMultiDocTemplate* pDocTemplate;
63 pDocTemplate = new CMultiDocTemplate(
65 RUNTIME_CLASS(CViewer3dDoc),
66 RUNTIME_CLASS(OCC_3dChildFrame), // custom MDI child frame
67 RUNTIME_CLASS(CViewer3dView));
68 AddDocTemplate(pDocTemplate);
70 // create main MDI Frame window
71 OCC_MainFrame* pMainFrame = new OCC_MainFrame(with_AIS_TB);
72 if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
74 m_pMainWnd = pMainFrame;
76 // Parse command line for standard shell commands, DDE, file open
77 CCommandLineInfo cmdInfo;
78 ParseCommandLine(cmdInfo);
80 // Dispatch commands specified on the command line
81 if (!ProcessShellCommand(cmdInfo))
84 // The main window has been initialized, so show and update it.
85 pMainFrame->ShowWindow(m_nCmdShow);
86 pMainFrame->UpdateWindow();
92 /////////////////////////////////////////////////////////////////////////////
93 // CViewer3dApp commands