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 #include <wx/filepicker.h>
34 
35 extern "C"
36 {
37 #include "tiff.h"
38 #include "tiffio.h"
39 }
40 
41 class PossiblePano;
42 
51 class FindPanoDialog : public wxDialog
52 {
53 public:
55  FindPanoDialog(BatchFrame* batchframe,wxString xrcPrefix);
58 
59 protected:
61  void OnButtonClose(wxCommandEvent& e);
63  void OnButtonStart(wxCommandEvent& e);
65  void OnButtonSend(wxCommandEvent& e);
67  void OnClose(wxCloseEvent& e);
69  void OnSelectPossiblePano(wxCommandEvent &e);
71  void OnListItemRightClick(wxListEvent &e);
73  void OnRemoveImage(wxCommandEvent &e);
75  void OnSplitPanos(wxCommandEvent &e);
77  void OnListMouseMove(wxMouseEvent &e);
78 
79 private:
81  wxButton* m_button_start;
82  wxButton* m_button_send;
83  wxButton* m_button_close;
84  wxDirPickerCtrl* m_dirPicker;
85  wxCheckBox* m_cb_subdir;
86  wxStaticText* m_statustext;
87  wxCheckListBox* m_list_pano;
88  wxChoice* m_ch_naming;
89  wxCheckBox* m_cb_createLinks;
90  wxCheckBox* m_cb_loadDistortion;
91  wxCheckBox* m_cb_loadVignetting;
92  wxSpinCtrl* m_sc_minNumberImages;
93  wxSpinCtrl* m_sc_maxTimeDiff;
94  wxImageList* m_thumbs;
95  wxListCtrl* m_thumbsList;
96  wxArrayString m_tooltips;
97  wxChoice* m_ch_blender;
98 
99  std::vector<PossiblePano*> m_panos;
100  wxString m_start_dir;
102  bool m_stopped;
103  TIFFErrorHandler m_oldtiffwarning;
104 
105  void EnableButtons(const bool state);
106  void SearchInDir(wxString dirstring, const bool includeSubdir, const bool loadDistortion, const bool loadVignetting, const size_t minNumberImages, const size_t maxTimeDiff);
107  void CleanUpPanolist();
108 };
109 
111 {
112  bool operator() (const HuginBase::SrcPanoImage* img1, const HuginBase::SrcPanoImage* img2) const;
113 };
114 
115 typedef std::set<HuginBase::SrcPanoImage*, SortFilename> ImageSet;
116 
118 {
119 public:
122  {
127  };
131  ~PossiblePano();
134  bool BelongsTo(HuginBase::SrcPanoImage* img, const wxTimeSpan max_time_diff);
138  const unsigned int GetImageCount() const
139  {
140  return m_images.size();
141  };
143  const wxString GetItemString(const wxString BasePath) const;
145  const wxString GetFilestring(const wxString BasePath, const bool stripExtension=false) const;
148  wxString GeneratePanorama(NamingConvention nc, bool createLinks, HuginBase::PanoramaOptions::BlendingMechanism defaultBlender);
150  wxString GetCameraName();
152  wxString GetLensName();
154  wxString GetFocalLength();
156  wxString GetStartString();
158  wxString GetDuration();
160  void PopulateListCtrl(wxListCtrl* list, wxImageList* thumbs, wxArrayString& tooltips);
162  void RemoveImage(const unsigned int index);
165  PossiblePano* SplitPano(const unsigned int index);
166 
167 private:
169  const wxDateTime GetDateTime(const HuginBase::SrcPanoImage* img);
171  bool GetNewProjectFilename(NamingConvention nc,const wxString basePath, wxFileName& projectFile);
173  void UpdateDateTimes();
174 
175  std::string m_make;
176  std::string m_camera;
177  std::string m_lens;
178  wxDateTime m_dt_start;
179  wxDateTime m_dt_end;
181  double m_cropfactor;
182  vigra::Size2D m_size;
184 };
185 
186 #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...
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
wxDirPickerCtrl * m_dirPicker
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
wxChoice * m_ch_blender
void OnButtonSend(wxCommandEvent &e)
add selected projects to queue
std::string m_make
wxCheckListBox * m_list_pano
wxButton * m_button_send
void OnButtonStart(wxCommandEvent &e)
start/stops detections
std::vector< PossiblePano * > m_panos