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);
00071 
00072 private:
00073     BatchFrame* m_batchframe;
00074     wxButton* m_button_start;
00075     wxButton* m_button_choose;
00076     wxButton* m_button_send;
00077     wxButton* m_button_close;
00078     wxTextCtrl* m_textctrl_dir;
00079     wxCheckBox* m_cb_subdir;
00080     wxStaticText* m_statustext;
00081     wxCheckListBox* m_list_pano;
00082     wxChoice* m_ch_naming;
00083     wxCheckBox* m_cb_createLinks;
00084     wxCheckBox* m_cb_loadDistortion;
00085     wxCheckBox* m_cb_loadVignetting;
00086     wxSpinCtrl* m_sc_minNumberImages;
00087     wxSpinCtrl* m_sc_maxTimeDiff;
00088     wxImageList* m_thumbs;
00089     wxChoice* m_ch_blender;
00090 
00091     std::vector<PossiblePano*> m_panos;
00092     wxString m_start_dir;
00093     bool m_isRunning;
00094     bool m_stopped;
00095     TIFFErrorHandler m_oldtiffwarning;
00096 
00097     void EnableButtons(const bool state);
00098     void SearchInDir(wxString dirstring, const bool includeSubdir, const bool loadDistortion, const bool loadVignetting, const size_t minNumberImages, const size_t maxTimeDiff);
00099     void CleanUpPanolist();
00100     DECLARE_EVENT_TABLE()
00101 };
00102 
00103 struct SortFilename
00104 {
00105     bool operator() (const SrcPanoImage* img1, const SrcPanoImage* img2);
00106 };
00107 
00108 typedef set<SrcPanoImage*,SortFilename> ImageSet;
00109 
00110 class PossiblePano
00111 {
00112 public:
00114     enum NamingConvention
00115     {
00116         NAMING_PANO=0,
00117         NAMING_FIRST_LAST=1,
00118         NAMING_FOLDER=2,
00119         NAMING_TEMPLATE=3
00120     };
00122     PossiblePano() : m_focallength(0) {};
00124     ~PossiblePano();
00127     bool BelongsTo(SrcPanoImage* img,const wxTimeSpan max_time_diff);
00129     void AddSrcPanoImage(SrcPanoImage* img);
00131     const unsigned int GetImageCount() const
00132     {
00133         return m_images.size();
00134     };
00136     const wxString GetItemString(const wxString BasePath) const;
00138     const wxString GetFilestring(const wxString BasePath, const bool stripExtension=false) const;
00141     wxString GeneratePanorama(NamingConvention nc, bool createLinks, HuginBase::PanoramaOptions::BlendingMechanism defaultBlender);
00143     wxString GetCameraName();
00145     wxString GetLensName();
00147     wxString GetFocalLength();
00149     wxString GetStartString();
00151     wxString GetDuration();
00153     void PopulateListCtrl(wxListCtrl* list, wxImageList* thumbs);
00154 
00155 private:
00157     const wxDateTime GetDateTime(const SrcPanoImage* img);
00159     bool GetNewProjectFilename(NamingConvention nc,const wxString basePath, wxFileName& projectFile);
00160 
00161     std::string m_make;
00162     std::string m_camera;
00163     std::string m_lens;
00164     wxDateTime m_dt_start;
00165     wxDateTime m_dt_end;
00166     double m_focallength;
00167     vigra::Size2D m_size;
00168     ImageSet m_images;
00169 };
00170 
00171 #endif //_FINDPANODIALOG_H

Generated on 30 Aug 2015 for Hugintrunk by  doxygen 1.4.7