Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ExampleProjectionGUI.cpp
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003, 2004 (see file CONTACTS for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 
26 /**
27  @example ExampleProjectionGUI.cpp
28  @relates wxProjectionDialog
29  @brief Example for using the ProjectionGUI
30  @ingroup g_examples
31  @author MIP
32 */
33 
34 #include <wx/wx.h>
35 
36 #include <Base/Common/BIASpragma.hh>
37 
38 #include <Gui/wxProjectionDialog.hh>
39 #include <Gui/StringConv.hh>
40 #include <Utils/Param.hh>
41 #include <iostream>
42 #include <vector>
43 #include <string>
44 
45 using namespace BIAS;
46 using namespace std;
47 
48 // classes
49 /** \cond HIDDEN_SYMBOLS */
50 class MyApp : public wxApp
51 {
52 public:
53  virtual bool OnInit();
54 };
55 
56 DECLARE_APP(MyApp)
57 
58 class MyFrame : public wxFrame
59 {
60 public:
61  MyFrame();
62  ~MyFrame();
63  void ShowDialog();
64 
65  BIAS::Projection proj;
66 };
67 
68 
69 // implementation
70 
71 IMPLEMENT_APP(MyApp)
72 
73 bool MyApp::OnInit()
74 {
75  MyFrame *frame = new MyFrame();
76  frame->Show(TRUE);
77  SetTopWindow(frame);
78  frame->ShowDialog();
79  return true;
80 }
81 
82 MyFrame::MyFrame()
83 : wxFrame(NULL, -1, _T("ProjectionGUI"), wxDefaultPosition, wxSize(400,600) )
84 {
85  if(wxTheApp->argc > 1)
86  proj.XMLRead(WxToAscii(wxTheApp->argv[1]));
87  else{
88  BIAS::Pose pose;
89  BIAS::KMatrix K;
90  K[0][0]=K[1][1] = 200;
91  K[0][2]=400;K[1][2]=300;
92  proj.CreatePerspective (pose,K, 800, 600);
93  }
94 
95 }
96 
97 void MyFrame::ShowDialog()
98 {
99  BIAS::wxProjectionDialog dlg(proj,this,-1,wxT("Projection"),true);
100  dlg.ShowModal();
101  dlg.Destroy();
102 }
103 
104 MyFrame::~MyFrame()
105 {
106 }
107 /** \endcond */
Dialog containing a wxProjectionPanel.
Represents 3d pose transformations, parametrized as Euclidean translation and unit quaternion orienta...
Definition: Pose.hh:73
This class hides the underlying projection model, like projection matrix, spherical camera...
Definition: Projection.hh:70
K describes the mapping from world coordinates (wcs) to pixel coordinates (pcs).
Definition: KMatrix.hh:48