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, write to the Free Software
00024  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 "PT/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::MultiProgressDisplay
00051 {
00052 public:
00053 
00055     LensCalFrame(wxWindow* parent);
00057     virtual ~LensCalFrame();
00058 
00060     const wxString & GetXRCPath();
00061     // functions to handle progress message in statusbar
00062     void resetProgress(double max);
00063     bool increaseProgress(double delta);
00064     bool increaseProgress(double delta, const std::string & msg);
00065     void setMessage(const std::string & msg);
00066     void AddImages(wxArrayString files);
00067     void UpdateListString(unsigned int index);
00069     void UpdateList(bool restoreSelection);
00070 
00071 protected:
00073     void updateProgressDisplay();
00074 
00075 private:
00076     // event handlers
00077     void OnExit(wxCommandEvent &e);
00078     void OnAddImage(wxCommandEvent &e);
00079     void OnRemoveImage(wxCommandEvent &e);
00080     void OnFindLines(wxCommandEvent &e);
00081     void OnOptimize(wxCommandEvent &e);
00082     void SaveLensToIni();
00083     void OnSaveLens(wxCommandEvent &e);
00084     void OnSaveProject(wxCommandEvent &e);
00085     void OnImageSelected(wxCommandEvent &e);
00086     void OnSelectPreviewContent(wxCommandEvent &e);
00087     void OnReset(wxCommandEvent &e);
00088     void OnShowLines(wxCommandEvent &e);
00089     void OnRefresh(wxCommandEvent &e);
00091     bool ReadInputs(bool readFocalLength,bool readOptions,bool readLensParameter);
00093     void Optimize();
00095     bool displayProgress();
00097     HuginBase::Panorama GetPanorama();
00099     void EnableButtons();
00101     void ParametersToDisplay();
00102 
00103     //link to some controls
00104     wxChoice* m_choice_projection;
00105     wxListBox* m_images_list;
00106     LensCalImageCtrl* m_preview;
00108     std::vector<ImageLineList*> m_images;
00109     //internal values of inputs
00110     HuginBase::SrcPanoImage::Projection m_projection;
00111     double m_focallength;
00112     double m_cropfactor;
00113     double m_edge_scale;
00114     double m_edge_threshold;
00115     unsigned int m_resize_dimension;
00116     double m_minlinelength;
00117     double m_a;
00118     double m_b;
00119     double m_c;
00120     double m_d;
00121     double m_e;
00122 
00123     // progress reporter
00124     double m_progressMax;
00125     double m_progress;
00126     wxString m_progressMsg;
00127 
00128     DECLARE_EVENT_TABLE()
00129 };
00130 
00131 
00132 #endif // LENSCALFRAME_H

Generated on 5 Dec 2014 for Hugintrunk by  doxygen 1.4.7