FindPanoDialog.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00010 /*  This is free software; you can redistribute it and/or
00011  *  modify it under the terms of the GNU General Public
00012  *  License as published by the Free Software Foundation; either
00013  *  version 2 of the License, or (at your option) any later version.
00014  *
00015  *  This software is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *  Lesser General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public
00021  *  License along with this software. If not, see
00022  *  <http://www.gnu.org/licenses/>.
00023  *
00024  */
00025 
00026 #ifndef _FINDPANODIALOG_H
00027 #define _FINDPANODIALOG_H
00028 
00029 #include <vector>
00030 #include "panoinc_WX.h"
00031 #include "panoinc.h"
00032 #include "BatchFrame.h"
00033 
00034 extern "C"
00035 {
00036 #include "tiff.h"
00037 #include "tiffio.h"
00038 }
00039 
00040 class PossiblePano;
00041 
00050 class FindPanoDialog : public wxDialog
00051 {
00052 public:
00054     FindPanoDialog(BatchFrame* batchframe,wxString xrcPrefix);
00056     ~FindPanoDialog();
00057 
00058 protected:
00060     void OnButtonClose(wxCommandEvent& e);
00062     void OnButtonChoose(wxCommandEvent& e);
00064     void OnButtonStart(wxCommandEvent& e);
00066     void OnButtonSend(wxCommandEvent& e);
00068     void OnClose(wxCloseEvent& e);
00070     void OnSelectPossiblePano(wxCommandEvent &e);
00072     void OnListItemRightClick(wxListEvent &e);
00074     void OnRemoveImage(wxCommandEvent &e);
00076     void OnSplitPanos(wxCommandEvent &e);
00077 
00078 private:
00079     BatchFrame* m_batchframe;
00080     wxButton* m_button_start;
00081     wxButton* m_button_choose;
00082     wxButton* m_button_send;
00083     wxButton* m_button_close;
00084     wxTextCtrl* m_textctrl_dir;
00085     wxCheckBox* m_cb_subdir;
00086     wxStaticText* m_statustext;
00087     wxCheckListBox* m_list_pano;
00088     wxChoice* m_ch_naming;
00089     wxCheckBox* m_cb_createLinks;
00090     wxCheckBox* m_cb_loadDistortion;
00091     wxCheckBox* m_cb_loadVignetting;
00092     wxSpinCtrl* m_sc_minNumberImages;
00093     wxSpinCtrl* m_sc_maxTimeDiff;
00094     wxImageList* m_thumbs;
00095     wxListCtrl* m_thumbsList;
00096     wxChoice* m_ch_blender;
00097 
00098     std::vector<PossiblePano*> m_panos;
00099     wxString m_start_dir;
00100     bool m_isRunning;
00101     bool m_stopped;
00102     TIFFErrorHandler m_oldtiffwarning;
00103 
00104     void EnableButtons(const bool state);
00105     void SearchInDir(wxString dirstring, const bool includeSubdir, const bool loadDistortion, const bool loadVignetting, const size_t minNumberImages, const size_t maxTimeDiff);
00106     void CleanUpPanolist();
00107     DECLARE_EVENT_TABLE()
00108 };
00109 
00110 struct SortFilename
00111 {
00112     bool operator() (const HuginBase::SrcPanoImage* img1, const HuginBase::SrcPanoImage* img2);
00113 };
00114 
00115 typedef std::set<HuginBase::SrcPanoImage*, SortFilename> ImageSet;
00116 
00117 class PossiblePano
00118 {
00119 public:
00121     enum NamingConvention
00122     {
00123         NAMING_PANO=0,
00124         NAMING_FIRST_LAST=1,
00125         NAMING_FOLDER=2,
00126         NAMING_TEMPLATE=3
00127     };
00129     PossiblePano() : m_focallength(0) {};
00131     ~PossiblePano();
00134     bool BelongsTo(HuginBase::SrcPanoImage* img, const wxTimeSpan max_time_diff);
00136     void AddSrcPanoImage(HuginBase::SrcPanoImage* img);
00138     const unsigned int GetImageCount() const
00139     {
00140         return m_images.size();
00141     };
00143     const wxString GetItemString(const wxString BasePath) const;
00145     const wxString GetFilestring(const wxString BasePath, const bool stripExtension=false) const;
00148     wxString GeneratePanorama(NamingConvention nc, bool createLinks, HuginBase::PanoramaOptions::BlendingMechanism defaultBlender);
00150     wxString GetCameraName();
00152     wxString GetLensName();
00154     wxString GetFocalLength();
00156     wxString GetStartString();
00158     wxString GetDuration();
00160     void PopulateListCtrl(wxListCtrl* list, wxImageList* thumbs);
00162     void RemoveImage(const unsigned int index);
00165     PossiblePano* SplitPano(const unsigned int index);
00166 
00167 private:
00169     const wxDateTime GetDateTime(const HuginBase::SrcPanoImage* img);
00171     bool GetNewProjectFilename(NamingConvention nc,const wxString basePath, wxFileName& projectFile);
00173     void UpdateDateTimes();
00174 
00175     std::string m_make;
00176     std::string m_camera;
00177     std::string m_lens;
00178     wxDateTime m_dt_start;
00179     wxDateTime m_dt_end;
00180     double m_focallength;
00181     vigra::Size2D m_size;
00182     ImageSet m_images;
00183 };
00184 
00185 #endif //_FINDPANODIALOG_H

Generated on 4 Dec 2016 for Hugintrunk by  doxygen 1.4.7