Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PanoPanel.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
26 #ifndef _PANOPANEL_H
27 #define _PANOPANEL_H
28 
29 #include "hugin/MainFrame.h"
30 #include "GuiLevel.h"
31 
32 class PanoDialog;
33 class wxSpinCtrl;
34 class wxTextCtrl;
35 class wxChoice;
36 class wxComboBox;
37 
43 class PanoPanel: public wxPanel, public HuginBase::PanoramaObserver
44 {
45 public:
46 
47  PanoPanel();
48 
49  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"));
50 
52 
53  virtual ~PanoPanel(void) ;
54 
71  virtual void panoramaChanged(HuginBase::Panorama &pano);
72  virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet & imgNr) {};
73 
75  void DoStitch(const wxString& userDefinedSetting = wxEmptyString);
77  void DoSendToBatch(const wxString& userDefinedSetting = wxEmptyString);
79  void DoUserDefinedStitch(const wxString& settings = wxString());
82  void DoStitchOrSendBatch(const wxString& userDefinedSetting = wxEmptyString);
83 
84  void SetGuiLevel(GuiLevel newGuiLevel);
85 
86  private:
87 
90 
95 
96 
97  // apply changes from the model
98  bool StackCheck (HuginBase::Panorama & pano);
99  void UpdateDisplay(const HuginBase::PanoramaOptions & opt, const bool hasStacks);
101 
102  // apply changes to the model. (gui values -> Panorama)
103  void QuickModeChanged(wxCommandEvent & e);
104  void ApplyQuickMode(int preset);
105 
106  void HFOVChanged(wxCommandEvent & e);
107  void HFOVChangedSpin(wxSpinEvent & e);
108  void VFOVChanged(wxCommandEvent & e );
109  void VFOVChangedSpin(wxSpinEvent & e);
110  void ProjectionChanged(wxCommandEvent & e);
111 
112  void OnOutputFilesChanged(wxCommandEvent & e);
113  void RemapperChanged(wxCommandEvent & e);
114  void OnRemapperOptions(wxCommandEvent & e);
115 
116  void FusionChanged(wxCommandEvent & e);
117  void OnFusionOptions(wxCommandEvent & e);
118 
119  void HDRMergeChanged(wxCommandEvent & e);
120  void OnHDRMergeOptions(wxCommandEvent & e);
121 
122  void BlenderChanged(wxCommandEvent & e);
123  void OnBlenderOptions(wxCommandEvent & e);
124 
125  void OnEdgeFillChanged(wxCommandEvent& e);
126  void OnEdgeFillOptions(wxCommandEvent& e);
127 
128  // File format options
129  void FileFormatChanged(wxCommandEvent & e);
130  void HDRFileFormatChanged(wxCommandEvent & e);
131  void OnJPEGQualityText(wxCommandEvent & e);
132  void OnNormalTIFFCompression(wxCommandEvent & e);
133  void OnHDRTIFFCompression(wxCommandEvent & e);
134 
135  void OnHDRFileFormatOpts(wxCommandEvent & e);
136 
137 
138  void WidthChanged(wxCommandEvent & e);
139  void HeightChanged(wxCommandEvent & e);
140  void ROIChanged(wxCommandEvent & e);
141 
142 // TODO remove
143 // void DoPreview(wxCommandEvent & e);
144  void DoCalcFOV(wxCommandEvent & e);
145  void OnDoStitch(wxCommandEvent & e);
146 
149  void DoCalcOptimalWidth(wxCommandEvent & e);
150 
153  void DoCalcOptimalROI(wxCommandEvent & e);
154 
156  void EnableControls(bool enable);
157 
168  bool CheckGoodSize();
170  bool CheckHasImages();
172  bool CheckFreeSpace(const wxString& folder);
173 
174  // the model
176  //current gui level
178 
179  // don't listen to input on gui elements during
180  // updating the gui from the model, to prevent recursion,
181  // because the gui might report changes as well.
184  double m_oldVFOV;
185 
188 
189  // controls of this frame
190  wxChoice * m_ProjectionChoice;
191  wxTextCtrl * m_HFOVText;
192  wxTextCtrl * m_VFOVText;
193 
194  wxTextCtrl * m_WidthTxt;
195  wxTextCtrl * m_HeightTxt;
196  wxTextCtrl * m_ROILeftTxt;
197  wxTextCtrl * m_ROIRightTxt;
198  wxTextCtrl * m_ROITopTxt;
199  wxTextCtrl * m_ROIBottomTxt;
200  wxChoice * m_RemapperChoice;
201  wxChoice * m_FusionChoice;
202  wxChoice * m_HDRMergeChoice;
203  wxChoice * m_BlenderChoice;
204  wxChoice * m_edgeFillChoice;
205  wxButton * m_StitchButton;
206  wxButton * m_CalcHFOVButton;
208  wxButton * m_CalcOptROIButton;
209 
210  wxChoice * m_FileFormatChoice;
214 
218 
219  wxScrolledWindow *m_pano_ctrls;
220 
221  DECLARE_EVENT_TABLE()
222  DECLARE_DYNAMIC_CLASS(PanoPanel)
223 };
224 
226 class PanoPanelXmlHandler : public wxXmlResourceHandler
227 {
228  DECLARE_DYNAMIC_CLASS(PanoPanelXmlHandler)
229 
230 public:
232  virtual wxObject *DoCreateResource();
233  virtual bool CanHandle(wxXmlNode *node);
234 };
235 
236 #endif // _PANOPANEL_H
bool CheckHasImages()
check if the output contains images at all
Definition: PanoPanel.cpp:1647
void OnBlenderOptions(wxCommandEvent &e)
Definition: PanoPanel.cpp:873
void BlenderChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:863
declaration of helper for work with different GuiLevels
void HeightChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:748
void DoStitch(const wxString &userDefinedSetting=wxEmptyString)
stitching using hugin_stitch_project
Definition: PanoPanel.cpp:1085
void OnNormalTIFFCompression(wxCommandEvent &e)
Definition: PanoPanel.cpp:1494
bool CheckFreeSpace(const wxString &folder)
check if there is enough free disk space
Definition: PanoPanel.cpp:1663
void EnableControls(bool enable)
enable/disable control influenced by quick mode
Definition: PanoPanel.cpp:807
wxTextCtrl * m_ROITopTxt
Definition: PanoPanel.h:198
void DoCalcFOV(wxCommandEvent &e)
Definition: PanoPanel.cpp:1010
void ProjectionChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:630
void ROIChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:765
virtual ~PanoPanel(void)
Definition: PanoPanel.cpp:275
void OnFusionOptions(wxCommandEvent &e)
Definition: PanoPanel.cpp:965
void OnEdgeFillChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:928
wxTextCtrl * m_VFOVText
Definition: PanoPanel.h:192
void UpdateDisplay(const HuginBase::PanoramaOptions &opt, const bool hasStacks)
Definition: PanoPanel.cpp:364
wxButton * m_CalcOptWidthButton
Definition: PanoPanel.h:207
StitchingPresets
the supported defaults
Definition: PanoPanel.h:92
HuginBase::Panorama * pano
Definition: PanoPanel.h:175
void OnHDRFileFormatOpts(wxCommandEvent &e)
void DoUserDefinedStitch(const wxString &settings=wxString())
stitching with user defined file
Definition: PanoPanel.cpp:1350
wxScrolledWindow * m_pano_ctrls
Definition: PanoPanel.h:219
void SetGuiLevel(GuiLevel newGuiLevel)
Definition: PanoPanel.cpp:1696
void OnRemapperOptions(wxCommandEvent &e)
Definition: PanoPanel.cpp:836
void QuickModeChanged(wxCommandEvent &e)
void VFOVChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:679
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
wxStaticText * m_FileFormatOptionsLabel
Definition: PanoPanel.h:211
void Init(HuginBase::Panorama *pano)
Definition: PanoPanel.cpp:267
wxTextCtrl * m_ROIBottomTxt
Definition: PanoPanel.h:199
Model for a panorama.
Definition: Panorama.h:152
double m_oldVFOV
Definition: PanoPanel.h:184
wxTextCtrl * m_WidthTxt
Definition: PanoPanel.h:194
void RemapperChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:819
wxTextCtrl * m_ROILeftTxt
Definition: PanoPanel.h:196
wxChoice * m_BlenderChoice
Definition: PanoPanel.h:203
wxChoice * m_edgeFillChoice
Definition: PanoPanel.h:204
wxTextCtrl * m_FileFormatJPEGQualityText
Definition: PanoPanel.h:212
wxChoice * m_FusionChoice
Definition: PanoPanel.h:201
virtual void panoramaChanged(HuginBase::Panorama &pano)
this is called whenever the panorama has changed.
Definition: PanoPanel.cpp:295
wxChoice * m_RemapperChoice
Definition: PanoPanel.h:200
wxTextCtrl * m_HeightTxt
Definition: PanoPanel.h:195
wxTextCtrl * m_HFOVText
Definition: PanoPanel.h:191
void OnHDRTIFFCompression(wxCommandEvent &e)
Definition: PanoPanel.cpp:1521
virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
notifies about changes to images
Definition: PanoPanel.h:72
void OnEdgeFillOptions(wxCommandEvent &e)
Definition: PanoPanel.cpp:943
void FileFormatChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:1430
void FusionChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:959
void HFOVChangedSpin(wxSpinEvent &e)
wxChoice * m_HDRMergeChoice
Definition: PanoPanel.h:202
wxChoice * m_FileFormatHDRTIFFCompChoice
Definition: PanoPanel.h:217
bool m_keepViewOnResize
Definition: PanoPanel.h:186
void WidthChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:731
wxChoice * m_ProjectionChoice
Definition: PanoPanel.h:190
StitchingEngine
the supported stitching engines
Definition: PanoPanel.h:89
void OnJPEGQualityText(wxCommandEvent &e)
Definition: PanoPanel.cpp:1480
wxButton * m_CalcHFOVButton
Definition: PanoPanel.h:206
wxButton * m_CalcOptROIButton
Definition: PanoPanel.h:208
void HFOVChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:647
void ApplyQuickMode(int preset)
bool updatesDisabled
Definition: PanoPanel.h:182
this handler class will receive change events from the Panorama.
Definition: PanoramaData.h:401
wxChoice * m_FileFormatTIFFCompChoice
Definition: PanoPanel.h:213
wxButton * m_StitchButton
Definition: PanoPanel.h:205
wxStaticText * m_HDRFileFormatLabelTIFFCompression
Definition: PanoPanel.h:216
void DoCalcOptimalROI(wxCommandEvent &e)
set the largest rectangle for crop ROI
Definition: PanoPanel.cpp:1055
xrc handler
Definition: PanoPanel.h:226
void DoCalcOptimalWidth(wxCommandEvent &e)
set the highest sensible width
Definition: PanoPanel.cpp:1032
void HDRFileFormatChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:1458
void DoSendToBatch(const wxString &userDefinedSetting=wxEmptyString)
stitching with PTBatcherGUI
Definition: PanoPanel.cpp:1210
wxChoice * m_FileFormatChoice
Definition: PanoPanel.h:210
void DoStitchOrSendBatch(const wxString &userDefinedSetting=wxEmptyString)
general stitching command, selects PTBatcherGUI or hugin_stitch_project depending on the settings in ...
Definition: PanoPanel.cpp:1397
GuiLevel m_guiLevel
Definition: PanoPanel.h:177
bool CheckGoodSize()
Check the canvas size isn&#39;t overly huge, or the user knows what they are doing.
Definition: PanoPanel.cpp:1576
Define the pano edit panel.
Definition: PanoPanel.h:43
void OnHDRMergeOptions(wxCommandEvent &e)
Definition: PanoPanel.cpp:990
GuiLevel
Definition: GuiLevel.h:31
void VFOVChangedSpin(wxSpinEvent &e)
void SetStitcher(HuginBase::PanoramaOptions::Remapper stitcher)
bool m_hasStacks
Definition: PanoPanel.h:187
void HDRMergeChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:984
Panorama image options.
wxChoice * m_HDRFileFormatChoice
Definition: PanoPanel.h:215
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"))
Definition: PanoPanel.cpp:123
void OnOutputFilesChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:1544
HuginBase::PanoramaOptions m_oldOpt
Definition: PanoPanel.h:183
void OnDoStitch(wxCommandEvent &e)
Definition: PanoPanel.cpp:1425
bool StackCheck(HuginBase::Panorama &pano)
Definition: PanoPanel.cpp:314
wxTextCtrl * m_ROIRightTxt
Definition: PanoPanel.h:197