Update the changelog
[opencv] / apps / StereoGR / StereoGRView.h
1 /*M///////////////////////////////////////////////////////////////////////////////////////\r
2 //\r
3 //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\r
4 //\r
5 //  By downloading, copying, installing or using the software you agree to this license.\r
6 //  If you do not agree to this license, do not download, install,\r
7 //  copy or use the software.\r
8 //\r
9 //\r
10 //                        Intel License Agreement\r
11 //                For Open Source Computer Vision Library\r
12 //\r
13 // Copyright (C) 2000, Intel Corporation, all rights reserved.\r
14 // Third party copyrights are property of their respective owners.\r
15 //\r
16 // Redistribution and use in source and binary forms, with or without modification,\r
17 // are permitted provided that the following conditions are met:\r
18 //\r
19 //   * Redistribution's of source code must retain the above copyright notice,\r
20 //     this list of conditions and the following disclaimer.\r
21 //\r
22 //   * Redistribution's in binary form must reproduce the above copyright notice,\r
23 //     this list of conditions and the following disclaimer in the documentation\r
24 //     and/or other materials provided with the distribution.\r
25 //\r
26 //   * The name of Intel Corporation may not be used to endorse or promote products\r
27 //     derived from this software without specific prior written permission.\r
28 //\r
29 // This software is provided by the copyright holders and contributors "as is" and\r
30 // any express or implied warranties, including, but not limited to, the implied\r
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.\r
32 // In no event shall the Intel Corporation or contributors be liable for any direct,\r
33 // indirect, incidental, special, exemplary, or consequential damages\r
34 // (including, but not limited to, procurement of substitute goods or services;\r
35 // loss of use, data, or profits; or business interruption) however caused\r
36 // and on any theory of liability, whether in contract, strict liability,\r
37 // or tort (including negligence or otherwise) arising in any way out of\r
38 // the use of this software, even if advised of the possibility of such damage.\r
39 //\r
40 //M*/// StereoGRView.h : interface of the CStereoGRView class\r
41 //\r
42 /////////////////////////////////////////////////////////////////////////////\r
43 \r
44 #if !defined(AFX_STEREOGRVIEW_H__0603BB32_3287_4D21_ADCE_7B314B91C460__INCLUDED_)\r
45 #define AFX_STEREOGRVIEW_H__0603BB32_3287_4D21_ADCE_7B314B91C460__INCLUDED_\r
46 \r
47 #if _MSC_VER > 1000\r
48 #pragma once\r
49 #endif // _MSC_VER > 1000\r
50 \r
51 #include "PTGrey.h"\r
52 #include "OpenGLView.h"\r
53 #include "cv.h"\r
54 \r
55 #include <vector>\r
56 using namespace std;\r
57 \r
58 class CStereoGRView : public COpenGLView\r
59 {\r
60 protected: // create from serialization only\r
61         CStereoGRView();\r
62         DECLARE_DYNCREATE(CStereoGRView)\r
63 \r
64 // Attributes\r
65 public:\r
66         CStereoGRDoc* GetDocument();\r
67 \r
68 \r
69 // Operations\r
70 public:\r
71 \r
72     void Update();\r
73 // Overrides\r
74         // ClassWizard generated virtual function overrides\r
75         //{{AFX_VIRTUAL(CStereoGRView)\r
76         public:\r
77         virtual void OnDraw(CDC* pDC);  // overridden to draw this view\r
78         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);\r
79         virtual void OnInitialUpdate();\r
80         protected:\r
81         virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);\r
82         virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);\r
83         virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);\r
84         //}}AFX_VIRTUAL\r
85 \r
86 // Implementation\r
87 public:\r
88         void InitModel();\r
89         void Translate(float val);\r
90         void RotateIncl(float val);\r
91         void RotateAzim(float val);\r
92         void RetrievePointCloud();\r
93         void DrawScene(CDC* pDC = 0);\r
94         void InitMagicCube();\r
95         void OnDrawMagicCube();\r
96         void UpdatePosition();\r
97         void DefaultView();\r
98         void DefaultData();\r
99         BOOL RetrieveUserImage();\r
100         BOOL IsNewData();\r
101         IplImage* GetRecipient();\r
102 //      void SetImage(IplImage* image, BOOL copy = FALSE);\r
103         IplImage* GetImage();\r
104         void UpdateView();\r
105         void UpdateData();\r
106         BOOL RetrieveImage();\r
107         void UpdateParams();\r
108         virtual ~CStereoGRView();\r
109 #ifdef _DEBUG\r
110         virtual void AssertValid() const;\r
111         virtual void Dump(CDumpContext& dc) const;\r
112 #endif\r
113 \r
114 protected:\r
115 \r
116 // Generated message map functions\r
117 protected:\r
118         void OnDrawPointCloud();\r
119         void OnDrawImage(CDC* pDC);\r
120         //{{AFX_MSG(CStereoGRView)\r
121         afx_msg void OnSize(UINT nType, int cx, int cy);\r
122         afx_msg BOOL OnEraseBkgnd(CDC* pDC);\r
123         afx_msg void OnMouseMove(UINT nFlags, CPoint point);\r
124         afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point);\r
125         afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);\r
126         afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);\r
127         //}}AFX_MSG\r
128         DECLARE_MESSAGE_MAP()\r
129 private:\r
130         vector<float> m_points;\r
131         BOOL m_wasInitialized;\r
132         void ScaleTextures(int width, int height, const void** bits, int count);\r
133         void InitTexture(int width, int height);\r
134         void ProcessImage();\r
135         void InitGL();\r
136         HBITMAP m_bitmap;\r
137         int m_pixelSize;\r
138         IplImage* m_recipient;\r
139         IplImage* m_auxImage;\r
140         IplImage* m_image;\r
141 \r
142         void* m_texture[3];\r
143         int m_tex_width;\r
144         int m_tex_height;\r
145         IplImage* m_planes[3];\r
146         float m_dist;\r
147         float m_incl;\r
148         float m_azim;\r
149         float m_distInc;\r
150         float m_inclInc;\r
151         float m_azimInc;\r
152 };\r
153 \r
154 #ifndef _DEBUG  // debug version in StereoGRView.cpp\r
155 inline CStereoGRDoc* CStereoGRView::GetDocument()\r
156    { return (CStereoGRDoc*)m_pDocument; }\r
157 #endif\r
158 \r
159 /////////////////////////////////////////////////////////////////////////////\r
160 \r
161 //{{AFX_INSERT_LOCATION}}\r
162 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.\r
163 \r
164 #endif // !defined(AFX_STEREOGRVIEW_H__0603BB32_3287_4D21_ADCE_7B314B91C460__INCLUDED_)\r