Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
wxProjectionPanel.hh
1 /* This file is part of the BIAS library (Basic ImageAlgorithmS).
2 
3  Copyright (C) 2003-2009 (see file CONTACT for details)
4  Multimediale Systeme der Informationsverarbeitung
5  Institut fuer Informatik
6  Christian-Albrechts-Universitaet Kiel
7 
8  BIAS is free software; you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation; either version 2.1 of the License, or
11  (at your option) any later version.
12 
13  BIAS is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License
19  along with BIAS; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
21 
22 #ifndef __ProjectionGUI_hh__
23 #define __ProjectionGUI_hh__
24 
25 #include <bias_config.h>
26 
27 #ifndef BIAS_HAVE_WXWIDGETS
28 # error BIAS_HAVE_WXWIDGETS not defined but required by ProjectionGUI. Please enable BIAS_HAVE_WXWIDGETS in CMake configure step.
29 #endif
30 
31 #include <wx/wx.h>
32 #include <wx/notebook.h>
33 #include <Geometry/Projection.hh>
34 #include <vector>
35 #include <Gui/wxVectorPanel.hh>
36 #include <Gui/wxMatrixPanel.hh>
37 
38 #include <Base/Math/Vector.hh>
39 #include <Base/Math/Vector2.hh>
40 
41 namespace BIAS {
42 
43 
44  /** @brief Panel for displaying and editing projections.
45  @author jkollmann */
46  class BIASGui_EXPORT wxProjectionPanel : public wxPanel
47  {
48  public:
49  wxProjectionPanel(wxWindow* parent, wxWindowID id = -1,
50  const wxPoint& pos = wxDefaultPosition,
51  const wxSize& size = wxDefaultSize,
52  long style = wxTAB_TRAVERSAL,
53  const wxString& name = wxT("panel"),
54  bool createButtons = true);
55  void SetProjection(const Projection& projection);
56  const Projection& GetProjection() const;
57 
58  private:
59  wxVectorPanel* AddVectorPanel(wxWindow* parent,const wxString& name, wxWindowID id, bool editable);
60  wxMatrixPanel* AddMatrixPanel(wxWindow* parent,const wxString& name, wxWindowID id, bool editable);
61 
62  void UpdateGUI(unsigned int cameraNr);
63 
64  void OnNormalizeQuaternion(wxCommandEvent& event);
65  void OnModified(wxCommandEvent& event);
66  void OnNew(wxCommandEvent& event);
67  void OnLoad(wxCommandEvent& event);
68  void OnSave(wxCommandEvent& event);
69 
70  bool selfModifying_;
71  Projection projection_;
72  wxScrolledWindow* projectionPanel_;
73  wxNotebook* noteBook_;
74 
75  std::vector<wxVectorPanel* > panelCenter_;
76  std::vector<wxVectorPanel* > panelQuaternion_;
77  std::vector<wxMatrixPanel* > panelRMatrix_;
78  std::vector<wxVectorPanel* > panelImageSize_;
79  std::vector<wxVectorPanel* > panelAspectRatio_;
80  std::vector<wxVectorPanel* > panelPrincipal_;
81  std::vector<wxMatrixPanel* > panelKMatrix_;
82  std::vector<wxVectorPanel* > panelFocalLength_;
83  std::vector<wxVectorPanel* > panelUndistortion_;
84  std::vector<wxVectorPanel* > panelRadius_;
85  std::vector<wxScrolledWindow* > notebookPages_;
86  DECLARE_EVENT_TABLE()
87  };
88 } // namespace BIAS
89 
90 #endif // __ProjectionGUI_hh__
Panel for displaying and editing projections.
This class hides the underlying projection model, like projection matrix, spherical camera...
Definition: Projection.hh:70
Panel for displaying and editing vectors.
Panel for displaying and editing matrices.