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 
00047 // forward declaration, to prevent include of class
00048 namespace wxGraphTools
00049 {
00050 class GraphPopupWindow;
00051 };
00052 
00056 class LensCalFrame:public wxFrame, public AppBase::ProgressDisplay
00057 {
00058 public:
00059 
00061     explicit LensCalFrame(wxWindow* parent);
00063     virtual ~LensCalFrame();
00064 
00066     const wxString & GetXRCPath();
00067     void AddImages(wxArrayString files);
00068     void UpdateListString(unsigned int index);
00070     void UpdateList(bool restoreSelection);
00071 
00072 protected:
00074     void updateProgressDisplay();
00075 
00076 private:
00077     // event handlers
00078     void OnExit(wxCommandEvent &e);
00079     void OnAddImage(wxCommandEvent &e);
00080     void OnRemoveImage(wxCommandEvent &e);
00081     void OnFindLines(wxCommandEvent &e);
00082     void OnOptimize(wxCommandEvent &e);
00084     void OnShowDistortionGraph(wxCommandEvent &e);
00085     void SaveLensToIni();
00086     void OnSaveLens(wxCommandEvent &e);
00087     void OnSaveProject(wxCommandEvent &e);
00088     void OnImageSelected(wxCommandEvent &e);
00089     void OnSelectPreviewContent(wxCommandEvent &e);
00090     void OnReset(wxCommandEvent &e);
00091     void OnShowLines(wxCommandEvent &e);
00092     void OnRefresh(wxCommandEvent &e);
00094     bool ReadInputs(bool readFocalLength,bool readOptions,bool readLensParameter);
00096     void Optimize();
00098     bool displayProgress();
00100     HuginBase::Panorama GetPanorama();
00102     void EnableButtons();
00104     void ParametersToDisplay();
00105 
00106     //link to some controls
00107     wxChoice* m_choice_projection;
00108     wxListBox* m_images_list;
00109     LensCalImageCtrl* m_preview;
00111     std::vector<ImageLineList*> m_images;
00112     //internal values of inputs
00113     HuginBase::SrcPanoImage::Projection m_projection;
00114     double m_focallength;
00115     double m_cropfactor;
00116     double m_edge_scale;
00117     double m_edge_threshold;
00118     unsigned int m_resize_dimension;
00119     double m_minlinelength;
00120     double m_a;
00121     double m_b;
00122     double m_c;
00123     double m_d;
00124     double m_e;
00125 
00126     // progress reporter
00127     double m_progressMax;
00128     double m_progress;
00129     wxString m_progressMsg;
00130     // popup window
00131     wxGraphTools::GraphPopupWindow* m_popup = nullptr;
00132 
00133     DECLARE_EVENT_TABLE()
00134 };
00135 
00136 
00137 #endif // LENSCALFRAME_H

Generated on 11 Dec 2017 for Hugintrunk by  doxygen 1.4.7