LensCalFrame.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00002 
00011 /* 
00012  *  This program is free software; you can redistribute it and/or
00013  *  modify it under the terms of the GNU General Public
00014  *  License as published by the Free Software Foundation; either
00015  *  version 2 of the License, or (at your option) any later version.
00016  *
00017  *  This software is distributed in the hope that it will be useful,
00018  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020  *  General Public License for more details.
00021  *
00022  *  You should have received a copy of the GNU General Public
00023  *  License along with this software. If not, see
00024  *  <http://www.gnu.org/licenses/>.
00025  *
00026  */
00027 
00028 #ifndef LENSCALFRAME_H
00029 #define LENSCALFRAME_H
00030 
00031 #include <vector>
00032 #include <set>
00033 
00034 #include "panoinc_WX.h"
00035 #include "panodata/Panorama.h"
00036 #include "lines/FindLines.h"
00037 #include "LensCalTypes.h"
00038 #include "LensCalImageCtrl.h"
00039 
00041 class FileDropTarget : public wxFileDropTarget
00042 {
00043 public:
00044     bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
00045 };
00046 
00050 class LensCalFrame:public wxFrame, public AppBase::ProgressDisplay
00051 {
00052 public:
00053 
00055     explicit LensCalFrame(wxWindow* parent);
00057     virtual ~LensCalFrame();
00058 
00060     const wxString & GetXRCPath();
00061     void AddImages(wxArrayString files);
00062     void UpdateListString(unsigned int index);
00064     void UpdateList(bool restoreSelection);
00065 
00066 protected:
00068     void updateProgressDisplay();
00069 
00070 private:
00071     // event handlers
00072     void OnExit(wxCommandEvent &e);
00073     void OnAddImage(wxCommandEvent &e);
00074     void OnRemoveImage(wxCommandEvent &e);
00075     void OnFindLines(wxCommandEvent &e);
00076     void OnOptimize(wxCommandEvent &e);
00077     void SaveLensToIni();
00078     void OnSaveLens(wxCommandEvent &e);
00079     void OnSaveProject(wxCommandEvent &e);
00080     void OnImageSelected(wxCommandEvent &e);
00081     void OnSelectPreviewContent(wxCommandEvent &e);
00082     void OnReset(wxCommandEvent &e);
00083     void OnShowLines(wxCommandEvent &e);
00084     void OnRefresh(wxCommandEvent &e);
00086     bool ReadInputs(bool readFocalLength,bool readOptions,bool readLensParameter);
00088     void Optimize();
00090     bool displayProgress();
00092     HuginBase::Panorama GetPanorama();
00094     void EnableButtons();
00096     void ParametersToDisplay();
00097 
00098     //link to some controls
00099     wxChoice* m_choice_projection;
00100     wxListBox* m_images_list;
00101     LensCalImageCtrl* m_preview;
00103     std::vector<ImageLineList*> m_images;
00104     //internal values of inputs
00105     HuginBase::SrcPanoImage::Projection m_projection;
00106     double m_focallength;
00107     double m_cropfactor;
00108     double m_edge_scale;
00109     double m_edge_threshold;
00110     unsigned int m_resize_dimension;
00111     double m_minlinelength;
00112     double m_a;
00113     double m_b;
00114     double m_c;
00115     double m_d;
00116     double m_e;
00117 
00118     // progress reporter
00119     double m_progressMax;
00120     double m_progress;
00121     wxString m_progressMsg;
00122 
00123     DECLARE_EVENT_TABLE()
00124 };
00125 
00126 
00127 #endif // LENSCALFRAME_H

Generated on 3 Sep 2015 for Hugintrunk by  doxygen 1.4.7