PanoPanel.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00026 #ifndef _PANOPANEL_H
00027 #define _PANOPANEL_H
00028 
00029 #include "hugin/MainFrame.h"
00030 #include "GuiLevel.h"
00031 
00032 class PanoDialog;
00033 class wxSpinCtrl;
00034 class wxTextCtrl;
00035 class wxChoice;
00036 class wxComboBox;
00037 
00043 class PanoPanel: public wxPanel, public HuginBase::PanoramaObserver
00044 {
00045 public:
00046 
00047     PanoPanel();
00048 
00049     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"));
00050 
00051     void Init(HuginBase::Panorama * pano);
00052 
00053     virtual ~PanoPanel(void) ;
00054 
00071     virtual void panoramaChanged(HuginBase::Panorama &pano);
00072     virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet & imgNr) {};
00073 
00075     void DoStitch();
00077     void DoSendToBatch();
00079     void DoUserDefinedStitch(const wxString& settings = wxString());
00080 
00081     void SetGuiLevel(GuiLevel newGuiLevel);
00082 
00083  private:
00084 
00086     enum StitchingEngine { NONA=0, PTSTITCHER };
00087 
00089     enum StitchingPresets { PROFILE_CUSTOM =0 , PROFILE_JPEG=0,
00090                             PROFILE_DRAFT_JPEG, PROFILE_TIFF,
00091                             PROFILE_LAYER_TIFF, PROFILE_LAYER_PSD };
00092 
00093 
00094     // apply changes from the model
00095     bool StackCheck (HuginBase::Panorama & pano);
00096     void UpdateDisplay(const HuginBase::PanoramaOptions & opt, const bool hasStacks);
00097     void SetStitcher(HuginBase::PanoramaOptions::Remapper stitcher);
00098 
00099     // apply changes to the model. (gui values -> Panorama)
00100     void QuickModeChanged(wxCommandEvent & e);
00101     void ApplyQuickMode(int preset);
00102 
00103     void HFOVChanged(wxCommandEvent & e);
00104     void HFOVChangedSpin(wxSpinEvent & e);
00105     void VFOVChanged(wxCommandEvent & e );
00106     void VFOVChangedSpin(wxSpinEvent & e);
00107     void ProjectionChanged(wxCommandEvent & e);
00108 
00109     void OnOutputFilesChanged(wxCommandEvent & e);
00110     void RemapperChanged(wxCommandEvent & e);
00111     void OnRemapperOptions(wxCommandEvent & e);
00112 
00113     void FusionChanged(wxCommandEvent & e);
00114     void OnFusionOptions(wxCommandEvent & e);
00115 
00116     void HDRMergeChanged(wxCommandEvent & e);
00117     void OnHDRMergeOptions(wxCommandEvent & e);
00118 
00119     void BlenderChanged(wxCommandEvent & e);
00120     void OnBlenderOptions(wxCommandEvent & e);
00121 
00122     // File format options
00123     void FileFormatChanged(wxCommandEvent & e);
00124     void HDRFileFormatChanged(wxCommandEvent & e);
00125     void OnJPEGQualityText(wxCommandEvent & e);
00126     void OnNormalTIFFCompression(wxCommandEvent & e);
00127     void OnHDRTIFFCompression(wxCommandEvent & e);
00128 
00129     void OnHDRFileFormatOpts(wxCommandEvent & e);
00130 
00131 
00132     void WidthChanged(wxCommandEvent & e);
00133     void HeightChanged(wxCommandEvent & e);
00134     void ROIChanged(wxCommandEvent & e);
00135 
00136 // TODO remove
00137 //    void DoPreview(wxCommandEvent & e);
00138     void DoCalcFOV(wxCommandEvent & e);
00139     void OnDoStitch(wxCommandEvent & e);
00140 
00143     void DoCalcOptimalWidth(wxCommandEvent & e);
00144     
00147     void DoCalcOptimalROI(wxCommandEvent & e);    
00148 
00150     void EnableControls(bool enable);
00151     
00162     bool CheckGoodSize();
00164     bool CheckHasImages();
00166     bool CheckFreeSpace(const wxString& folder);
00167 
00168     // the model
00169     HuginBase::Panorama * pano;
00170     //current gui level
00171     GuiLevel m_guiLevel;
00172 
00173     // don't listen to input on gui elements during
00174     // updating the gui from the model, to prevent recursion,
00175     // because the gui might report changes as well.
00176     bool updatesDisabled;
00177     HuginBase::PanoramaOptions m_oldOpt;
00178     double m_oldVFOV;
00179 
00180     bool m_keepViewOnResize;
00181     bool m_hasStacks;
00182 
00183     // controls of this frame
00184     wxChoice    * m_ProjectionChoice;
00185     wxTextCtrl  * m_HFOVText;
00186     wxTextCtrl  * m_VFOVText;
00187 
00188     wxTextCtrl  * m_WidthTxt;
00189     wxTextCtrl  * m_HeightTxt;
00190     wxTextCtrl  * m_ROILeftTxt;
00191     wxTextCtrl  * m_ROIRightTxt;
00192     wxTextCtrl  * m_ROITopTxt;
00193     wxTextCtrl  * m_ROIBottomTxt;
00194     wxChoice    * m_RemapperChoice;
00195     wxChoice    * m_FusionChoice;
00196     wxChoice    * m_HDRMergeChoice;
00197     wxChoice    * m_BlenderChoice;
00198     wxButton    * m_StitchButton;
00199     wxButton    * m_CalcHFOVButton;
00200     wxButton    * m_CalcOptWidthButton;
00201     wxButton    * m_CalcOptROIButton;
00202 
00203     wxChoice    * m_FileFormatChoice;
00204     wxStaticText* m_FileFormatOptionsLabel;
00205     wxTextCtrl  * m_FileFormatJPEGQualityText;
00206     wxChoice    * m_FileFormatTIFFCompChoice;
00207 
00208     wxChoice    * m_HDRFileFormatChoice;
00209     wxStaticText* m_HDRFileFormatLabelTIFFCompression;
00210     wxChoice    * m_FileFormatHDRTIFFCompChoice;
00211 
00212     wxScrolledWindow *m_pano_ctrls;
00213 
00214     DECLARE_EVENT_TABLE()
00215     DECLARE_DYNAMIC_CLASS(PanoPanel)
00216 };
00217 
00219 class PanoPanelXmlHandler : public wxXmlResourceHandler
00220 {
00221     DECLARE_DYNAMIC_CLASS(PanoPanelXmlHandler)
00222 
00223 public:
00224     PanoPanelXmlHandler();
00225     virtual wxObject *DoCreateResource();
00226     virtual bool CanHandle(wxXmlNode *node);
00227 };
00228 
00229 #endif // _PANOPANEL_H

Generated on 10 Dec 2016 for Hugintrunk by  doxygen 1.4.7