1 // AnimationApp.cpp : Defines the class behaviors for the application.
6 #include "AnimationApp.h"
8 #include <OCC_MainFrame.h>
9 #include <OCC_3dChildFrame.h>
10 #include "AnimationDoc.h"
11 #include "AnimationView3D.h"
12 #include "..\..\Common\res\OCC_Resource.h"
14 BEGIN_MESSAGE_MAP(CAnimationApp, OCC_App)
15 //{{AFX_MSG_MAP(CAnimationApp)
16 ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
17 // NOTE - the ClassWizard will add and remove mapping macros here.
18 // DO NOT EDIT what you see in these blocks of generated code!
20 // Standard file based document commands
23 /////////////////////////////////////////////////////////////////////////////
24 // CAnimationApp construction
26 CAnimationApp::CAnimationApp() : OCC_App()
28 SampleName = "Animation"; //for about dialog
29 SetSamplePath (L"..\\..\\09_Animation");
32 /////////////////////////////////////////////////////////////////////////////
33 // The one and only CAnimationApp object
37 /////////////////////////////////////////////////////////////////////////////
38 // CAnimationApp initialization
40 BOOL CAnimationApp::InitInstance()
42 AfxEnableControlContainer();
44 // Standard initialization
45 // If you are not using these features and wish to reduce the size
46 // of your final executable, you should remove from the following
47 // the specific initialization routines you do not need.
49 // Change the registry key under which our settings are stored.
50 // You should modify this string to be something appropriate
51 // such as the name of your company or organization.
52 // Modified by CasCade :
53 SetRegistryKey(_T("Local CasCade Applications"));
55 LoadStdProfileSettings(); // Load standard INI file options (including MRU)
57 // Register the application's document templates. Document templates
58 // serve as the connection between documents, frame windows and views.
60 CMultiDocTemplate* pDocTemplateForView3d;
61 pDocTemplateForView3d = new CMultiDocTemplate(
63 RUNTIME_CLASS(CAnimationDoc),
64 RUNTIME_CLASS(OCC_3dChildFrame), // custom MDI child frame
65 RUNTIME_CLASS(CAnimationView3D));
66 AddDocTemplate(pDocTemplateForView3d);
69 // create main MDI Frame window
70 OCC_MainFrame* pMainFrame = new OCC_MainFrame;
71 if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
73 m_pMainWnd = pMainFrame;
75 // Parse command line for standard shell commands, DDE, file open
76 CCommandLineInfo cmdInfo;
77 ParseCommandLine(cmdInfo);
79 // Dispatch commands specified on the command line
80 if (!ProcessShellCommand(cmdInfo))
83 // The main window has been initialized, so show and update it.
84 pMainFrame->ShowWindow(m_nCmdShow);
85 pMainFrame->UpdateWindow();
90 void CAnimationApp::OnAppAbout()
92 CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
93 CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
94 CAnimationView3D *pView = (CAnimationView3D *) pChild->GetActiveView();
96 OCC_App::OnAppAbout();