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

Generated on 1 Aug 2015 for Hugintrunk by  doxygen 1.4.7