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 // TODO remove
00076 //    void previewSingleChanged(wxCommandEvent & e);
00077 
00078 
00080     void DoStitch();
00082     void DoSendToBatch();
00084     void DoUserDefinedStitch();
00085 
00086     void SetGuiLevel(GuiLevel newGuiLevel);
00087 
00088  private:
00089 
00091     enum StitchingEngine { NONA=0, PTSTITCHER };
00092 
00094     enum StitchingPresets { PROFILE_CUSTOM =0 , PROFILE_JPEG=0,
00095                             PROFILE_DRAFT_JPEG, PROFILE_TIFF,
00096                             PROFILE_LAYER_TIFF, PROFILE_LAYER_PSD };
00097 
00098 
00099     // apply changes from the model
00100     bool StackCheck (HuginBase::Panorama & pano);
00101     void UpdateDisplay(const HuginBase::PanoramaOptions & opt, const bool hasStacks);
00102     void SetStitcher(HuginBase::PanoramaOptions::Remapper stitcher);
00103 
00104     // apply changes to the model. (gui values -> Panorama)
00105     void QuickModeChanged(wxCommandEvent & e);
00106     void ApplyQuickMode(int preset);
00107 
00108     void HFOVChanged(wxCommandEvent & e);
00109     void HFOVChangedSpin(wxSpinEvent & e);
00110     void VFOVChanged(wxCommandEvent & e );
00111     void VFOVChangedSpin(wxSpinEvent & e);
00112     void ProjectionChanged(wxCommandEvent & e);
00113 
00114     void OnOutputFilesChanged(wxCommandEvent & e);
00115     void RemapperChanged(wxCommandEvent & e);
00116     void OnRemapperOptions(wxCommandEvent & e);
00117 
00118     void FusionChanged(wxCommandEvent & e);
00119     void OnFusionOptions(wxCommandEvent & e);
00120 
00121     void HDRMergeChanged(wxCommandEvent & e);
00122     void OnHDRMergeOptions(wxCommandEvent & e);
00123 
00124     void BlenderChanged(wxCommandEvent & e);
00125     void OnBlenderOptions(wxCommandEvent & e);
00126 
00127     // File format options
00128     void FileFormatChanged(wxCommandEvent & e);
00129     void HDRFileFormatChanged(wxCommandEvent & e);
00130     void OnJPEGQualityText(wxCommandEvent & e);
00131     void OnNormalTIFFCompression(wxCommandEvent & e);
00132     void OnHDRTIFFCompression(wxCommandEvent & e);
00133 
00134     void OnHDRFileFormatOpts(wxCommandEvent & e);
00135 
00136 
00137     void WidthChanged(wxCommandEvent & e);
00138     void HeightChanged(wxCommandEvent & e);
00139     void ROIChanged(wxCommandEvent & e);
00140 
00141 // TODO remove
00142 //    void DoPreview(wxCommandEvent & e);
00143     void DoCalcFOV(wxCommandEvent & e);
00144     void OnDoStitch(wxCommandEvent & e);
00145 
00148     void DoCalcOptimalWidth(wxCommandEvent & e);
00149     
00152     void DoCalcOptimalROI(wxCommandEvent & e);    
00153 
00155     void EnableControls(bool enable);
00156     
00167     bool CheckGoodSize();
00169     bool CheckHasImages();
00171     bool CheckFreeSpace(const wxString& folder);
00172 
00173     // the model
00174     HuginBase::Panorama * pano;
00175     //current gui level
00176     GuiLevel m_guiLevel;
00177 
00178     // don't listen to input on gui elements during
00179     // updating the gui from the model, to prevent recursion,
00180     // because the gui might report changes as well.
00181     bool updatesDisabled;
00182     HuginBase::PanoramaOptions m_oldOpt;
00183     double m_oldVFOV;
00184 
00185     bool m_keepViewOnResize;
00186     bool m_hasStacks;
00187 
00188     // controls of this frame
00189     wxChoice    * m_ProjectionChoice;
00190     wxTextCtrl  * m_HFOVText;
00191     wxTextCtrl  * m_VFOVText;
00192 
00193     wxTextCtrl  * m_WidthTxt;
00194     wxTextCtrl  * m_HeightTxt;
00195     wxTextCtrl  * m_ROILeftTxt;
00196     wxTextCtrl  * m_ROIRightTxt;
00197     wxTextCtrl  * m_ROITopTxt;
00198     wxTextCtrl  * m_ROIBottomTxt;
00199     wxChoice    * m_RemapperChoice;
00200     wxChoice    * m_FusionChoice;
00201     wxChoice    * m_HDRMergeChoice;
00202     wxChoice    * m_BlenderChoice;
00203     wxButton    * m_StitchButton;
00204     wxButton    * m_CalcHFOVButton;
00205     wxButton    * m_CalcOptWidthButton;
00206     wxButton    * m_CalcOptROIButton;
00207 
00208     wxChoice    * m_FileFormatChoice;
00209     wxStaticText* m_FileFormatOptionsLabel;
00210     wxTextCtrl  * m_FileFormatJPEGQualityText;
00211     wxChoice    * m_FileFormatTIFFCompChoice;
00212 
00213     wxChoice    * m_HDRFileFormatChoice;
00214     wxStaticText* m_HDRFileFormatLabelTIFFCompression;
00215     wxChoice    * m_FileFormatHDRTIFFCompChoice;
00216 
00217     wxScrolledWindow *m_pano_ctrls;
00218 
00219     DECLARE_EVENT_TABLE()
00220     DECLARE_DYNAMIC_CLASS(PanoPanel)
00221 };
00222 
00224 class PanoPanelXmlHandler : public wxXmlResourceHandler
00225 {
00226     DECLARE_DYNAMIC_CLASS(PanoPanelXmlHandler)
00227 
00228 public:
00229     PanoPanelXmlHandler();
00230     virtual wxObject *DoCreateResource();
00231     virtual bool CanHandle(wxXmlNode *node);
00232 };
00233 
00234 #endif // _PANOPANEL_H

Generated on 3 May 2016 for Hugintrunk by  doxygen 1.4.7