00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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);
00069
00070 private:
00071 BatchFrame* m_batchframe;
00072 wxButton* m_button_start;
00073 wxButton* m_button_choose;
00074 wxButton* m_button_send;
00075 wxButton* m_button_close;
00076 wxTextCtrl* m_textctrl_dir;
00077 wxCheckBox* m_cb_subdir;
00078 wxStaticText* m_statustext;
00079 wxCheckListBox* m_list_pano;
00080 wxChoice* m_ch_naming;
00081 wxCheckBox* m_cb_createLinks;
00082 wxCheckBox* m_cb_loadDistortion;
00083 wxCheckBox* m_cb_loadVignetting;
00084 wxSpinCtrl* m_sc_minNumberImages;
00085 wxSpinCtrl* m_sc_maxTimeDiff;
00086
00087 std::vector<PossiblePano*> m_panos;
00088 wxString m_start_dir;
00089 bool m_isRunning;
00090 bool m_stopped;
00091 TIFFErrorHandler m_oldtiffwarning;
00092
00093 void EnableButtons(const bool state);
00094 void SearchInDir(wxString dirstring, const bool includeSubdir, const bool loadDistortion, const bool loadVignetting, const size_t minNumberImages, const size_t maxTimeDiff);
00095 void CleanUpPanolist();
00096 DECLARE_EVENT_TABLE()
00097 };
00098
00099 struct SortFilename
00100 {
00101 bool operator() (const SrcPanoImage* img1, const SrcPanoImage* img2);
00102 };
00103
00104 typedef set<SrcPanoImage*,SortFilename> ImageSet;
00105
00106 class PossiblePano
00107 {
00108 public:
00110 enum NamingConvention
00111 {
00112 NAMING_PANO=0,
00113 NAMING_FIRST_LAST=1,
00114 NAMING_FOLDER=2,
00115 NAMING_TEMPLATE=3
00116 };
00118 ~PossiblePano();
00121 bool BelongsTo(SrcPanoImage* img,const wxTimeSpan max_time_diff);
00123 void AddSrcPanoImage(SrcPanoImage* img);
00125 const unsigned int GetImageCount() const
00126 {
00127 return m_images.size();
00128 };
00130 const wxString GetItemString(const wxString BasePath) const;
00132 const wxString GetFilestring(const wxString BasePath, const bool stripExtension=false) const;
00135 wxString GeneratePanorama(NamingConvention nc, bool createLinks);
00136
00137 private:
00139 const wxDateTime GetDateTime(const SrcPanoImage* img);
00141 bool GetNewProjectFilename(NamingConvention nc,const wxString basePath, wxFileName& projectFile);
00143 bool IsStacked();
00145 double GetMaxExposureDifference();
00146
00147 std::string m_make;
00148 std::string m_camera;
00149 std::string m_lens;
00150 wxDateTime m_dt_start;
00151 wxDateTime m_dt_end;
00152 double m_focallength;
00153 vigra::Size2D m_size;
00154 ImageSet m_images;
00155 };
00156
00157 #endif //_FINDPANODIALOG_H