Move the sources to trunk
[opencv] / apps / HMMDemo / MainFrm.h
1 /*M///////////////////////////////////////////////////////////////////////////////////////
2 //
3 //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4 //
5 //  By downloading, copying, installing or using the software you agree to this license.
6 //  If you do not agree to this license, do not download, install,
7 //  copy or use the software.
8 //
9 //
10 //                        Intel License Agreement
11 //                For Open Source Computer Vision Library
12 //
13 // Copyright (C) 2000, Intel Corporation, all rights reserved.
14 // Third party copyrights are property of their respective owners.
15 //
16 // Redistribution and use in source and binary forms, with or without modification,
17 // are permitted provided that the following conditions are met:
18 //
19 //   * Redistribution's of source code must retain the above copyright notice,
20 //     this list of conditions and the following disclaimer.
21 //
22 //   * Redistribution's in binary form must reproduce the above copyright notice,
23 //     this list of conditions and the following disclaimer in the documentation
24 //     and/or other materials provided with the distribution.
25 //
26 //   * The name of Intel Corporation may not be used to endorse or promote products
27 //     derived from this software without specific prior written permission.
28 //
29 // This software is provided by the copyright holders and contributors "as is" and
30 // any express or implied warranties, including, but not limited to, the implied
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
32 // In no event shall the Intel Corporation or contributors be liable for any direct,
33 // indirect, incidental, special, exemplary, or consequential damages
34 // (including, but not limited to, procurement of substitute goods or services;
35 // loss of use, data, or profits; or business interruption) however caused
36 // and on any theory of liability, whether in contract, strict liability,
37 // or tort (including negligence or otherwise) arising in any way out of
38 // the use of this software, even if advised of the possibility of such damage.
39 //
40 //M*/// MainFrm.h : interface of the CMainFrame class
41 //
42 /////////////////////////////////////////////////////////////////////////////
43
44 #if !defined(AFX_MAINFRM_H__08FC8D46_DB62_4573_A129_5B4FE94720E5__INCLUDED_)
45 #define AFX_MAINFRM_H__08FC8D46_DB62_4573_A129_5B4FE94720E5__INCLUDED_
46
47 #if _MSC_VER > 1000
48 #pragma once
49 #endif // _MSC_VER > 1000
50
51 #include "HMMDemoDoc.h"
52 #include "HMMDemoView.h"
53 #include "ImageBaseView.h"
54 //#include "TestImageBaseView.h"
55
56
57 class CMainFrame : public CFrameWnd
58 {
59
60 protected: // create from serialization only
61     CMainFrame();
62     DECLARE_DYNCREATE(CMainFrame)
63
64 // Attributes
65 public:
66
67 // Operations
68 public:
69
70 // Overrides
71     // ClassWizard generated virtual function overrides
72     //{{AFX_VIRTUAL(CMainFrame)
73     public:
74     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
75     protected:
76     virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
77     //}}AFX_VIRTUAL
78
79 // Implementation
80 public:
81     virtual ~CMainFrame();
82
83     CImageBaseView* GetImageBaseView();
84     CHMMDemoView* GetCameraView();
85     CStatusBar* GetStatusBar() { return &m_wndStatusBar; }
86     void SetBusy( BOOL busy ) { m_busy = busy; }
87
88 protected:
89     CStatusBar  m_wndStatusBar;
90     CToolBar    m_wndToolBar;
91     CReBar      m_wndReBar;
92     CSplitterWnd m_wndSplitter;
93     //CDialogBar  m_wndDlgBar;
94
95     BOOL m_busy; 
96
97 // Generated message map functions
98 protected:
99     //{{AFX_MSG(CMainFrame)
100     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
101     afx_msg void OnUpdateCapture(CCmdUI* pCmdUI);
102     afx_msg void OnCapture();
103     afx_msg void OnUpdateCapOptions(CCmdUI* pCmdUI);
104     afx_msg void OnCapOptions();
105     afx_msg void OnUpdateCapFormat(CCmdUI* pCmdUI);
106     afx_msg void OnCapFormat();
107     afx_msg void OnAddObj();
108     afx_msg void OnUpdateAddObj(CCmdUI* pCmdUI);
109     afx_msg void OnRemoveObj();
110     afx_msg void OnUpdateRemoveObj(CCmdUI* pCmdUI);
111     afx_msg void OnZoomIn();
112     afx_msg void OnZoomOut();
113         afx_msg void OnChangeBaseParams();
114         afx_msg void OnTrain();
115         afx_msg void OnUpdateTrain(CCmdUI* pCmdUI); 
116     afx_msg void OnRecognize();
117         afx_msg void OnUpdateRecog(CCmdUI* pCmdUI);
118         afx_msg void OnSelectAll();
119         afx_msg void OnDelHmm();
120         afx_msg void OnAddTest();
121         afx_msg void OnUpdateAddTest(CCmdUI* pCmdUI);
122         afx_msg void OnTestFolder();
123         afx_msg void OnRecobase();
124         afx_msg void OnUpdateRecobase(CCmdUI* pCmdUI);
125         afx_msg void OnSettings();
126         //}}AFX_MSG
127     DECLARE_MESSAGE_MAP()
128 };
129
130
131 inline CHMMDemoView* GetCameraView()
132 {
133     CMainFrame* main_frame = (CMainFrame*)AfxGetMainWnd();
134     return main_frame ? main_frame->GetCameraView() : 0;
135 }
136
137 inline CImageBaseView* GetImageBaseView()
138 {
139     CMainFrame* main_frame = (CMainFrame*)AfxGetMainWnd();
140     return main_frame ? main_frame->GetImageBaseView() : 0;
141 }
142
143 inline CHMMDemoDoc* GetHMMDoc()
144 {
145     CMainFrame* main_frame = (CMainFrame*)AfxGetMainWnd();
146     return main_frame ? ((CHMMDemoDoc*)main_frame->GetActiveDocument()) : 0;
147 }
148
149 /////////////////////////////////////////////////////////////////////////////
150
151 //{{AFX_INSERT_LOCATION}}
152 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
153
154 #endif // !defined(AFX_MAINFRM_H__08FC8D46_DB62_4573_A129_5B4FE94720E5__INCLUDED_)