Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LensCalFrame.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
11 /*
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This software is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public
23  * License along with this software. If not, see
24  * <http://www.gnu.org/licenses/>.
25  *
26  */
27 
28 #ifndef LENSCALFRAME_H
29 #define LENSCALFRAME_H
30 
31 #include <vector>
32 #include <set>
33 
34 #include "panoinc_WX.h"
35 #include "panodata/Panorama.h"
36 #include "lines/FindLines.h"
37 #include "LensCalTypes.h"
38 #include "LensCalImageCtrl.h"
39 
41 class FileDropTarget : public wxFileDropTarget
42 {
43 public:
44  bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
45 };
46 
47 // forward declaration, to prevent include of class
48 namespace wxGraphTools
49 {
50 class GraphPopupWindow;
51 };
52 
56 class LensCalFrame:public wxFrame, public AppBase::ProgressDisplay
57 {
58 public:
59 
61  explicit LensCalFrame(wxWindow* parent);
63  virtual ~LensCalFrame();
64 
66  const wxString & GetXRCPath();
67  void AddImages(wxArrayString files);
68  void UpdateListString(unsigned int index);
70  void UpdateList(bool restoreSelection);
71 
72 protected:
74  void updateProgressDisplay();
75 
76 private:
77  // event handlers
78  void OnExit(wxCommandEvent &e);
79  void OnAddImage(wxCommandEvent &e);
80  void OnRemoveImage(wxCommandEvent &e);
81  void OnFindLines(wxCommandEvent &e);
82  void OnOptimize(wxCommandEvent &e);
84  void OnShowDistortionGraph(wxCommandEvent &e);
85  void SaveLensToIni();
86  void OnSaveLens(wxCommandEvent &e);
87  void OnSaveProject(wxCommandEvent &e);
88  void OnImageSelected(wxCommandEvent &e);
89  void OnSelectPreviewContent(wxCommandEvent &e);
90  void OnReset(wxCommandEvent &e);
91  void OnShowLines(wxCommandEvent &e);
92  void OnRefresh(wxCommandEvent &e);
94  bool ReadInputs(bool readFocalLength,bool readOptions,bool readLensParameter);
96  void Optimize();
98  bool displayProgress();
102  void EnableButtons();
104  void ParametersToDisplay();
105 
106  //link to some controls
108  wxListBox* m_images_list;
111  std::vector<ImageLineList*> m_images;
112  //internal values of inputs
115  double m_cropfactor;
116  double m_edge_scale;
118  unsigned int m_resize_dimension;
120  double m_a;
121  double m_b;
122  double m_c;
123  double m_d;
124  double m_e;
125 
126  // progress reporter
128  double m_progress;
129  wxString m_progressMsg;
130  // popup window
132 
133  DECLARE_EVENT_TABLE()
134 };
135 
136 
137 #endif // LENSCALFRAME_H
LensCalImageCtrl * m_preview
Definition: LensCalFrame.h:109
image previewer for lens calibration GUI
declaration of functions for finding lines
The main window frame.
Definition: LensCalFrame.h:56
double m_focallength
Definition: LensCalFrame.h:114
wxChoice * m_choice_projection
Definition: LensCalFrame.h:107
void OnSelectPreviewContent(wxCommandEvent &e)
simple popup to show graph
Definition: GraphTools.h:38
void OnSaveLens(wxCommandEvent &e)
void SaveLensToIni()
simple class that forward the drop to the mainframe
Definition: LensCalFrame.h:41
virtual ~LensCalFrame()
destructor
bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &filenames)
file drag and drop handler method
void OnRefresh(wxCommandEvent &e)
Model for a panorama.
Definition: Panorama.h:152
bool displayProgress()
update progress display
void Optimize()
do the optimization
LensCalFrame(wxWindow *parent)
constructor
void OnShowLines(wxCommandEvent &e)
void OnShowDistortionGraph(wxCommandEvent &e)
show distortion graph
unsigned int m_resize_dimension
Definition: LensCalFrame.h:118
void updateProgressDisplay()
called when a progress message should be displayed
void OnAddImage(wxCommandEvent &e)
void OnImageSelected(wxCommandEvent &e)
void EnableButtons()
enable all buttons and menu items depending on number of active images
void UpdateListString(unsigned int index)
HuginBase::SrcPanoImage::Projection m_projection
Definition: LensCalFrame.h:113
double m_progressMax
Definition: LensCalFrame.h:127
wxGraphTools::GraphPopupWindow * m_popup
Definition: LensCalFrame.h:131
void OnReset(wxCommandEvent &e)
declaration of preview for lens calibration gui
wxString m_progressMsg
Definition: LensCalFrame.h:129
void OnOptimize(wxCommandEvent &e)
bool ReadInputs(bool readFocalLength, bool readOptions, bool readLensParameter)
reads all input values into internal values
void OnFindLines(wxCommandEvent &e)
include file for the hugin project
const wxString & GetXRCPath()
get the path to the xrc directory
double m_progress
Definition: LensCalFrame.h:128
void OnExit(wxCommandEvent &e)
double m_edge_scale
Definition: LensCalFrame.h:116
wxListBox * m_images_list
Definition: LensCalFrame.h:108
std::vector< ImageLineList * > m_images
list of all detected lines
Definition: LensCalFrame.h:111
declaration of helper class for LensCal
HuginBase::Panorama GetPanorama()
return panorama object with all images
double m_minlinelength
Definition: LensCalFrame.h:119
void ParametersToDisplay()
set all parameter input wxTextField to internal values
void OnRemoveImage(wxCommandEvent &e)
double m_edge_threshold
Definition: LensCalFrame.h:117
void UpdateList(bool restoreSelection)
updates the list box with current values
double m_cropfactor
Definition: LensCalFrame.h:115
void OnSaveProject(wxCommandEvent &e)
void AddImages(wxArrayString files)