ImagesPanel.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00024 #ifndef _IMAGESPANEL_H
00025 #define _IMAGESPANEL_H
00026 
00027 #include "hugin/MainFrame.h"
00028 
00029 #include "base_wx/wxImageCache.h"
00030 
00031 using namespace HuginBase;
00032 
00033 // forward declarations, to save the #include statements
00034 class ImagesTreeCtrl;
00035 
00042 class ImagesPanel: public wxPanel, public HuginBase::PanoramaObserver
00043 {
00044 public:
00045     ImagesPanel();
00046 
00047     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"));
00048 
00049     void Init(HuginBase::Panorama * pano);
00050 
00051     ~ImagesPanel();
00052 
00069 //    virtual void panoramaChanged(HuginBase::Panorama &pano);
00071     virtual void panoramaChanged(HuginBase::Panorama & pano);
00072     virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet & imgNr);
00074     void ReloadCPDetectorSettings();
00076     CPDetectorSetting& GetDefaultSetting() { return cpdetector_config.settings.Item(cpdetector_config.GetDefaultGenerator());};
00077 
00079     void SetGuiLevel(GuiLevel newGuiLevel);
00081     wxString GetCurrentOptimizerString();
00083     void RunCPGenerator(CPDetectorSetting &setting, const HuginBase::UIntSet& img);
00085     void RunCPGenerator(const HuginBase::UIntSet& img);
00087     const wxString GetSelectedCPGenerator();
00088 protected:
00090     void OnOptimizeButton(wxCommandEvent &e);
00092     void OnPhotometricOptimizeButton(wxCommandEvent &e);
00093 
00094 private:
00095     // a window event
00096     void OnSize(wxSizeEvent & e);
00097 
00099     Panorama * m_pano;
00100 
00102     void CPGenerate(wxCommandEvent & e);
00106     void OnSelectionChanged(wxTreeEvent & e);
00107 
00109     void OnLensTypeChanged(wxCommandEvent & e);
00111     void OnFocalLengthChanged(wxCommandEvent & e);
00113     void OnCropFactorChanged(wxCommandEvent & e);
00115     void OnMinimumOverlapChanged(wxCommandEvent & e);
00117     void OnMaxEvDiffChanged(wxCommandEvent& e);
00118 
00120     void OnGroupModeChanged(wxCommandEvent & e);
00122     void OnDisplayModeChanged(wxCommandEvent & e);
00124     void OnOptimizerSwitchChanged(wxCommandEvent &e);
00126     void OnPhotometricOptimizerSwitchChanged(wxCommandEvent &e);
00128     void FillGroupChoice();
00130     void FillOptimizerChoice();
00131 
00132     void DisableImageCtrls();
00133     void EnableImageCtrls();
00134 
00136     void ShowImage(unsigned int imgNr);
00137     void UpdatePreviewImage();
00138 
00140     wxBitmap m_empty;
00141     
00143     HuginBase::ImageCache::RequestPtr thumbnail_request;
00144 
00146     ImagesTreeCtrl* m_images_tree;
00148     wxStaticBitmap * m_smallImgCtrl;
00150     wxChoice *m_lenstype;
00152     wxChoice *m_optChoice;
00154     wxChoice *m_optPhotoChoice;
00156     wxTextCtrl *m_focallength;
00158     wxTextCtrl *m_cropfactor;
00160     wxTextCtrl *m_overlap;
00162     wxTextCtrl *m_maxEv;
00163     size_t m_showImgNr;
00164 
00165     wxButton * m_matchingButton;
00166     wxChoice *m_CPDetectorChoice;
00167     //storing for different cp detector settings
00168     CPDetectorConfig cpdetector_config;
00169 
00170     GuiLevel m_guiLevel;
00171     int m_degDigits;
00172 
00173     DECLARE_EVENT_TABLE()
00174     DECLARE_DYNAMIC_CLASS(ImagesPanel)
00175 };
00176 
00178 class ImagesPanelXmlHandler : public wxXmlResourceHandler
00179 {
00180     DECLARE_DYNAMIC_CLASS(ImagesPanelXmlHandler)
00181 
00182 public:
00183     ImagesPanelXmlHandler();
00184     virtual wxObject *DoCreateResource();
00185     virtual bool CanHandle(wxXmlNode *node);
00186 };
00187 
00188 #endif // _IMAGESPANEL_H

Generated on 1 Aug 2015 for Hugintrunk by  doxygen 1.4.7