Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImagesPanel.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
24 #ifndef _IMAGESPANEL_H
25 #define _IMAGESPANEL_H
26 
27 #include "hugin/MainFrame.h"
28 
29 #include "base_wx/wxImageCache.h"
30 
31 // forward declarations, to save the #include statements
32 class ImagesTreeCtrl;
33 
40 class ImagesPanel: public wxPanel, public HuginBase::PanoramaObserver
41 {
42 public:
43  ImagesPanel();
44 
45  bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = wxT("panel"));
46 
47  void Init(HuginBase::Panorama * pano);
48 
49  ~ImagesPanel();
50 
67 // virtual void panoramaChanged(HuginBase::Panorama &pano);
69  virtual void panoramaChanged(HuginBase::Panorama & pano);
70  virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet & imgNr);
75 
77  void SetGuiLevel(GuiLevel newGuiLevel);
79  wxString GetCurrentOptimizerString();
81  void RunCPGenerator(CPDetectorSetting &setting, const HuginBase::UIntSet& img);
83  void RunCPGenerator(const HuginBase::UIntSet& img);
85  const wxString GetSelectedCPGenerator();
86 protected:
88  void OnOptimizeButton(wxCommandEvent &e);
90  void OnPhotometricOptimizeButton(wxCommandEvent &e);
91 
92 private:
93  // a window event
94  void OnSize(wxSizeEvent & e);
95 
98 
100  void CPGenerate(wxCommandEvent & e);
104  void OnSelectionChanged(wxTreeEvent & e);
105 
107  void OnLensTypeChanged(wxCommandEvent & e);
109  void OnFocalLengthChanged(wxCommandEvent & e);
111  void OnCropFactorChanged(wxCommandEvent & e);
113  void OnMinimumOverlapChanged(wxCommandEvent & e);
115  void OnMaxEvDiffChanged(wxCommandEvent& e);
116 
118  void OnGroupModeChanged(wxCommandEvent & e);
120  void OnDisplayModeChanged(wxCommandEvent & e);
122  void OnOptimizerSwitchChanged(wxCommandEvent &e);
124  void OnPhotometricOptimizerSwitchChanged(wxCommandEvent &e);
126  void FillGroupChoice();
128  void FillOptimizerChoice();
129 
130  void DisableImageCtrls();
131  void EnableImageCtrls();
132 
134  void ShowImage(unsigned int imgNr);
135  void UpdatePreviewImage();
136 
138  wxBitmap m_empty;
139 
142 
146  wxStaticBitmap * m_smallImgCtrl;
148  wxChoice *m_lenstype;
150  wxChoice *m_optChoice;
152  wxChoice *m_optPhotoChoice;
154  wxTextCtrl *m_focallength;
156  wxTextCtrl *m_cropfactor;
158  wxTextCtrl *m_overlap;
160  wxTextCtrl *m_maxEv;
161  size_t m_showImgNr;
162 
163  wxButton * m_matchingButton;
165  //storing for different cp detector settings
167 
170 
171  DECLARE_EVENT_TABLE()
172  DECLARE_DYNAMIC_CLASS(ImagesPanel)
173 };
174 
176 class ImagesPanelXmlHandler : public wxXmlResourceHandler
177 {
178  DECLARE_DYNAMIC_CLASS(ImagesPanelXmlHandler)
179 
180 public:
182  virtual wxObject *DoCreateResource();
183  virtual bool CanHandle(wxXmlNode *node);
184 };
185 
186 #endif // _IMAGESPANEL_H
void UpdatePreviewImage()
virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
notifies about changes to images
wxTextCtrl * m_focallength
the text input control for focal length
Definition: ImagesPanel.h:154
wxStaticBitmap * m_smallImgCtrl
pointer to the preview image control
Definition: ImagesPanel.h:146
wxChoice * m_CPDetectorChoice
Definition: ImagesPanel.h:164
void RunCPGenerator(CPDetectorSetting &setting, const HuginBase::UIntSet &img)
run the cp generator with the given setting on selected images
wxChoice * m_lenstype
pointer to lens type selector
Definition: ImagesPanel.h:148
size_t m_showImgNr
Definition: ImagesPanel.h:161
void OnPhotometricOptimizerSwitchChanged(wxCommandEvent &e)
event handler, when photometric optimizer master switch was changed
HuginBase::Panorama * m_pano
the model
Definition: ImagesPanel.h:97
void ShowImage(unsigned int imgNr)
show a bigger thumbnail
void OnDisplayModeChanged(wxCommandEvent &e)
event handler when display mode (which information should be shown) was changed
void EnableImageCtrls()
void OnLensTypeChanged(wxCommandEvent &e)
updates the lens type for the selected images
wxBitmap m_empty
bitmap with default image
Definition: ImagesPanel.h:138
ImagesTreeCtrl * m_images_tree
pointer to the main control
Definition: ImagesPanel.h:144
void OnOptimizeButton(wxCommandEvent &e)
event handler for geometric optimizer
Hugin's first panel.
Definition: ImagesPanel.h:40
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
ArraySettings settings
array which stores the different autopano settings
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxT("panel"))
Definition: ImagesPanel.cpp:79
Model for a panorama.
Definition: Panorama.h:152
void OnMaxEvDiffChanged(wxCommandEvent &e)
updates the max ev difference
class, which stores all settings of one cp detector
void CPGenerate(wxCommandEvent &e)
control point detection event handler
wxTextCtrl * m_maxEv
the text input control for max ev difference
Definition: ImagesPanel.h:160
GuiLevel m_guiLevel
Definition: ImagesPanel.h:168
std::shared_ptr< Request > RequestPtr
Reference counted request for an image to load.
Definition: ImageCache.h:151
void FillGroupChoice()
fills the grouping wxChoice with values depending on GuiLevel
void Init(HuginBase::Panorama *pano)
wxTextCtrl * m_cropfactor
the text input control for crop factor
Definition: ImagesPanel.h:156
void OnSelectionChanged(wxTreeEvent &e)
change displayed variables if the selection has changed.
void ReloadCPDetectorSettings()
Reloads the cp detector settings from config, necessary after edit preferences.
wxTextCtrl * m_overlap
the text input control for minimum overlap
Definition: ImagesPanel.h:158
void OnMinimumOverlapChanged(wxCommandEvent &e)
updates the minimum overlap
void OnCropFactorChanged(wxCommandEvent &e)
updates the crop factor for the selected images
void OnOptimizerSwitchChanged(wxCommandEvent &e)
event handler, when optimizer master switch was changed
void OnPhotometricOptimizeButton(wxCommandEvent &e)
event handler for photometric optimizer
HuginBase::ImageCache::RequestPtr thumbnail_request
Request for thumbnail image.
Definition: ImagesPanel.h:141
this handler class will receive change events from the Panorama.
Definition: PanoramaData.h:401
wxChoice * m_optPhotoChoice
pointer to photometric optimizer switch selector
Definition: ImagesPanel.h:152
the main images tree control, used on images and optimizer tabs
Definition: ImagesTree.h:36
unsigned int GetDefaultGenerator()
return index of default generator (this one is used for assistent)
CPDetectorConfig cpdetector_config
Definition: ImagesPanel.h:166
void OnFocalLengthChanged(wxCommandEvent &e)
updates the focal length for the selected images
void OnGroupModeChanged(wxCommandEvent &e)
event handler when grouping selection was changed
CPDetectorSetting & GetDefaultSetting()
returns the default cp detector settings
Definition: ImagesPanel.h:74
wxString GetCurrentOptimizerString()
return the currently selected optimizer setting as string from the drop down list box ...
wxButton * m_matchingButton
Definition: ImagesPanel.h:163
GuiLevel
Definition: GuiLevel.h:31
virtual void panoramaChanged(HuginBase::Panorama &pano)
this is called whenever the panorama has changed.
void OnSize(wxSizeEvent &e)
wxChoice * m_optChoice
pointer to optimizer switch selector
Definition: ImagesPanel.h:150
void SetGuiLevel(GuiLevel newGuiLevel)
sets the GuiLevel for all controls on this panel
class for storing settings of different control point generators
void DisableImageCtrls()
const wxString GetSelectedCPGenerator()
return the currently selected cp generator description
void FillOptimizerChoice()
fills the optmizer wxChoices with values depending on GuiLevel