Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FindPanoDialog.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
10 /* This is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This software is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public
21  * License along with this software. If not, see
22  * <http://www.gnu.org/licenses/>.
23  *
24  */
25 
26 #ifndef _FINDPANODIALOG_H
27 #define _FINDPANODIALOG_H
28 
29 #include <vector>
30 #include "panoinc_WX.h"
31 #include "panoinc.h"
32 #include "BatchFrame.h"
33 
34 extern "C"
35 {
36 #include "tiff.h"
37 #include "tiffio.h"
38 }
39 
40 class PossiblePano;
41 
50 class FindPanoDialog : public wxDialog
51 {
52 public:
54  FindPanoDialog(BatchFrame* batchframe,wxString xrcPrefix);
57 
58 protected:
60  void OnButtonClose(wxCommandEvent& e);
62  void OnButtonChoose(wxCommandEvent& e);
64  void OnButtonStart(wxCommandEvent& e);
66  void OnButtonSend(wxCommandEvent& e);
68  void OnClose(wxCloseEvent& e);
70  void OnSelectPossiblePano(wxCommandEvent &e);
72  void OnListItemRightClick(wxListEvent &e);
74  void OnRemoveImage(wxCommandEvent &e);
76  void OnSplitPanos(wxCommandEvent &e);
78  void OnListMouseMove(wxMouseEvent &e);
79 
80 private:
82  wxButton* m_button_start;
83  wxButton* m_button_choose;
84  wxButton* m_button_send;
85  wxButton* m_button_close;
86  wxTextCtrl* m_textctrl_dir;
87  wxCheckBox* m_cb_subdir;
88  wxStaticText* m_statustext;
89  wxCheckListBox* m_list_pano;
90  wxChoice* m_ch_naming;
91  wxCheckBox* m_cb_createLinks;
92  wxCheckBox* m_cb_loadDistortion;
93  wxCheckBox* m_cb_loadVignetting;
94  wxSpinCtrl* m_sc_minNumberImages;
95  wxSpinCtrl* m_sc_maxTimeDiff;
96  wxImageList* m_thumbs;
97  wxListCtrl* m_thumbsList;
98  wxArrayString m_tooltips;
99  wxChoice* m_ch_blender;
100 
101  std::vector<PossiblePano*> m_panos;
102  wxString m_start_dir;
104  bool m_stopped;
105  TIFFErrorHandler m_oldtiffwarning;
106 
107  void EnableButtons(const bool state);
108  void SearchInDir(wxString dirstring, const bool includeSubdir, const bool loadDistortion, const bool loadVignetting, const size_t minNumberImages, const size_t maxTimeDiff);
109  void CleanUpPanolist();
110  DECLARE_EVENT_TABLE()
111 };
112 
114 {
115  bool operator() (const HuginBase::SrcPanoImage* img1, const HuginBase::SrcPanoImage* img2) const;
116 };
117 
118 typedef std::set<HuginBase::SrcPanoImage*, SortFilename> ImageSet;
119 
121 {
122 public:
125  {
130  };
134  ~PossiblePano();
137  bool BelongsTo(HuginBase::SrcPanoImage* img, const wxTimeSpan max_time_diff);
141  const unsigned int GetImageCount() const
142  {
143  return m_images.size();
144  };
146  const wxString GetItemString(const wxString BasePath) const;
148  const wxString GetFilestring(const wxString BasePath, const bool stripExtension=false) const;
151  wxString GeneratePanorama(NamingConvention nc, bool createLinks, HuginBase::PanoramaOptions::BlendingMechanism defaultBlender);
153  wxString GetCameraName();
155  wxString GetLensName();
157  wxString GetFocalLength();
159  wxString GetStartString();
161  wxString GetDuration();
163  void PopulateListCtrl(wxListCtrl* list, wxImageList* thumbs, wxArrayString& tooltips);
165  void RemoveImage(const unsigned int index);
168  PossiblePano* SplitPano(const unsigned int index);
169 
170 private:
172  const wxDateTime GetDateTime(const HuginBase::SrcPanoImage* img);
174  bool GetNewProjectFilename(NamingConvention nc,const wxString basePath, wxFileName& projectFile);
176  void UpdateDateTimes();
177 
178  std::string m_make;
179  std::string m_camera;
180  std::string m_lens;
181  wxDateTime m_dt_start;
182  wxDateTime m_dt_end;
184  double m_cropfactor;
185  vigra::Size2D m_size;
187 };
188 
189 #endif //_FINDPANODIALOG_H
std::string m_lens
wxString GetFocalLength()
returns the focal length as string
wxChoice * m_ch_naming
bool operator()(const HuginBase::SrcPanoImage *img1, const HuginBase::SrcPanoImage *img2) const
wxSpinCtrl * m_sc_maxTimeDiff
wxDateTime m_dt_start
void AddSrcPanoImage(HuginBase::SrcPanoImage *img)
adds the given SrcPanoImage to this pano-group
~PossiblePano()
destructor, cleans up used variables
void RemoveImage(const unsigned int index)
removes the image at given index
void EnableButtons(const bool state)
wxImageList * m_thumbs
wxButton * m_button_start
include file for the hugin project
wxCheckBox * m_cb_loadDistortion
wxString GetCameraName()
returns the camera name
wxCheckBox * m_cb_createLinks
ImageSet m_images
double m_cropfactor
void OnButtonClose(wxCommandEvent &e)
closes window
wxCheckBox * m_cb_loadVignetting
void UpdateDateTimes()
updates the internal date/time representations
PossiblePano * SplitPano(const unsigned int index)
split pano into 2 subpanos, index is used as first image of second pano
BatchFrame * m_batchframe
wxArrayString m_tooltips
wxDateTime m_dt_end
const wxString GetFilestring(const wxString BasePath, const bool stripExtension=false) const
returns a string with the filename of the first and last file
wxString GetDuration()
returns the duration as string
void PopulateListCtrl(wxListCtrl *list, wxImageList *thumbs, wxArrayString &tooltips)
add all images to wxListCtrl
void SearchInDir(wxString dirstring, const bool includeSubdir, const bool loadDistortion, const bool loadVignetting, const size_t minNumberImages, const size_t maxTimeDiff)
void OnSplitPanos(wxCommandEvent &e)
event handler to split into 2 panos
const unsigned int GetImageCount() const
returns number of images in this group
wxString GetStartString()
return the start date/time as string
void OnListMouseMove(wxMouseEvent &e)
mouse move handler for tooltips
wxCheckBox * m_cb_subdir
wxString GetLensName()
returns the lens name
std::set< HuginBase::SrcPanoImage *, SortFilename > ImageSet
std::string stripExtension(const std::string &basename2)
remove extension of a filename
Definition: utils.cpp:130
TIFFErrorHandler m_oldtiffwarning
void OnSelectPossiblePano(wxCommandEvent &e)
event to populate information on the right
wxStaticText * m_statustext
void OnListItemRightClick(wxListEvent &e)
event handler for context menu
Batch processor for Hugin with GUI.
bool BelongsTo(HuginBase::SrcPanoImage *img, const wxTimeSpan max_time_diff)
return true, if the image could belong to the given PossiblePano, it checks camera maker and model...
wxTextCtrl * m_textctrl_dir
wxButton * m_button_close
NamingConvention
enumeration for different naming conventions, must be match combobox in ressource ...
include file for the hugin project
wxString GeneratePanorama(NamingConvention nc, bool createLinks, HuginBase::PanoramaOptions::BlendingMechanism defaultBlender)
generates the panorama file from this set of images
wxListCtrl * m_thumbsList
vigra::Size2D m_size
double m_focallength
wxString m_start_dir
bool GetNewProjectFilename(NamingConvention nc, const wxString basePath, wxFileName &projectFile)
returns a given filename, which does not already exists
const wxDateTime GetDateTime(const HuginBase::SrcPanoImage *img)
does some reformating date/time format
PossiblePano()
constructor, init values
void OnClose(wxCloseEvent &e)
prevents closing window when running detection
wxSpinCtrl * m_sc_minNumberImages
~FindPanoDialog()
destructor, saves size and position
std::string m_camera
FindPanoDialog(BatchFrame *batchframe, wxString xrcPrefix)
Constructor, read from xrc ressource; restore last uses settings, size and position.
const wxString GetItemString(const wxString BasePath) const
returns a string which contains description of this pano
void OnRemoveImage(wxCommandEvent &e)
event handler to remove selected image from list
Dialog for finding panorama in given directory.
All variables of a source image.
Definition: SrcPanoImage.h:194
wxButton * m_button_choose
wxChoice * m_ch_blender
void OnButtonSend(wxCommandEvent &e)
add selected projects to queue
void OnButtonChoose(wxCommandEvent &e)
select directory with dialog
std::string m_make
wxCheckListBox * m_list_pano
wxButton * m_button_send
void OnButtonStart(wxCommandEvent &e)
start/stops detections
std::vector< PossiblePano * > m_panos