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 PT::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(PT::Panorama * pano);
00053 
00054     virtual ~PanoPanel(void) ;
00055 
00072     virtual void panoramaChanged(PT::Panorama &pano);
00073 //    void panoramaImageChanged(PT::Panorama &pano, const PT::UIntSet & imgNr);
00074 
00076 // TODO remove
00077 //    void previewSingleChanged(wxCommandEvent & e);
00078 
00079 
00081     void DoStitch();
00083     void DoSendToBatch();
00084 
00085     void SetGuiLevel(GuiLevel newGuiLevel);
00086 
00087  private:
00088 
00090     enum StitchingEngine { NONA=0, PTSTITCHER };
00091 
00093     enum StitchingPresets { PROFILE_CUSTOM =0 , PROFILE_JPEG=0,
00094                             PROFILE_DRAFT_JPEG, PROFILE_TIFF,
00095                             PROFILE_LAYER_TIFF, PROFILE_LAYER_PSD };
00096 
00097 
00098     // apply changes from the model
00099     bool StackCheck (PT::Panorama & pano);
00100     void UpdateDisplay(const PT::PanoramaOptions & opt, const bool hasStacks);
00101     void SetStitcher(PanoramaOptions::Remapper stitcher);
00102 
00103     // apply changes to the model. (gui values -> Panorama)
00104     void QuickModeChanged(wxCommandEvent & e);
00105     void ApplyQuickMode(int preset);
00106 
00107     void HFOVChanged(wxCommandEvent & e);
00108     void HFOVChangedSpin(wxSpinEvent & e);
00109     void VFOVChanged(wxCommandEvent & e );
00110     void VFOVChangedSpin(wxSpinEvent & e);
00111     void ProjectionChanged(wxCommandEvent & e);
00112 
00113     void OnOutputFilesChanged(wxCommandEvent & e);
00114     void RemapperChanged(wxCommandEvent & e);
00115     void OnRemapperOptions(wxCommandEvent & e);
00116 
00117     void FusionChanged(wxCommandEvent & e);
00118     void OnFusionOptions(wxCommandEvent & e);
00119 
00120     void HDRMergeChanged(wxCommandEvent & e);
00121     void OnHDRMergeOptions(wxCommandEvent & e);
00122 
00123     void BlenderChanged(wxCommandEvent & e);
00124     void OnBlenderOptions(wxCommandEvent & e);
00125 
00126     // File format options
00127     void FileFormatChanged(wxCommandEvent & e);
00128     void HDRFileFormatChanged(wxCommandEvent & e);
00129     void OnJPEGQualityText(wxCommandEvent & e);
00130     void OnNormalTIFFCompression(wxCommandEvent & e);
00131     void OnHDRTIFFCompression(wxCommandEvent & e);
00132 
00133     void OnHDRFileFormatOpts(wxCommandEvent & e);
00134 
00135 
00136     void WidthChanged(wxCommandEvent & e);
00137     void HeightChanged(wxCommandEvent & e);
00138     void ROIChanged(wxCommandEvent & e);
00139 
00140 // TODO remove
00141 //    void DoPreview(wxCommandEvent & e);
00142     void DoCalcFOV(wxCommandEvent & e);
00143     void OnDoStitch(wxCommandEvent & e);
00144 
00147     void DoCalcOptimalWidth(wxCommandEvent & e);
00148     
00151     void DoCalcOptimalROI(wxCommandEvent & e);    
00152 
00154     void EnableControls(bool enable);
00155     
00166     bool CheckGoodSize();
00167 
00168     // the model
00169     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     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 Sat Sep 20 01:25:36 2014 for Hugintrunk by  doxygen 1.3.9.1