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 = "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, const bool readSetting = true);
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  wxButton* GetStitchButton() const { return m_StitchButton; };
86 
87  private:
88 
91 
96 
97 
98  // apply changes from the model
99  bool StackCheck (HuginBase::Panorama & pano);
100  void UpdateDisplay(const HuginBase::PanoramaOptions & opt, const bool hasStacks);
102 
103  // apply changes to the model. (gui values -> Panorama)
104  void QuickModeChanged(wxCommandEvent & e);
105  void ApplyQuickMode(int preset);
106 
107  void HFOVChanged(wxCommandEvent & e);
108  void HFOVChangedSpin(wxSpinEvent & e);
109  void VFOVChanged(wxCommandEvent & e );
110  void VFOVChangedSpin(wxSpinEvent & e);
111  void ProjectionChanged(wxCommandEvent & e);
112 
113  void OnOutputFilesChanged(wxCommandEvent & e);
114  void RemapperChanged(wxCommandEvent & e);
115  void OnRemapperOptions(wxCommandEvent & e);
116 
117  void FusionChanged(wxCommandEvent & e);
118  void OnFusionOptions(wxCommandEvent & e);
119 
120  void HDRMergeChanged(wxCommandEvent & e);
121  void OnHDRMergeOptions(wxCommandEvent & e);
122 
123  void BlenderChanged(wxCommandEvent & e);
124  void OnBlenderOptions(wxCommandEvent & e);
125 
126  void OnEdgeFillChanged(wxCommandEvent& e);
127  void OnEdgeFillOptions(wxCommandEvent& e);
128 
129  // File format options
130  void FileFormatChanged(wxCommandEvent & e);
131  void HDRFileFormatChanged(wxCommandEvent & e);
132  void OnJPEGQualityText(wxCommandEvent & e);
133  void OnNormalTIFFCompression(wxCommandEvent & e);
134  void OnHDRTIFFCompression(wxCommandEvent & e);
135 
136  void OnHDRFileFormatOpts(wxCommandEvent & e);
137 
138 
139  void WidthChanged(wxCommandEvent & e);
140  void HeightChanged(wxCommandEvent & e);
141  void ROIChanged(wxCommandEvent & e);
142 
143 // TODO remove
144 // void DoPreview(wxCommandEvent & e);
145  void DoCalcFOV(wxCommandEvent & e);
146  void OnDoStitch(wxCommandEvent & e);
147 
150  void DoCalcOptimalWidth(wxCommandEvent & e);
151 
154  void DoCalcOptimalROI(wxCommandEvent & e);
155 
157  void EnableControls(bool enable);
158 
169  bool CheckGoodSize();
171  bool CheckHasImages();
173  bool CheckFreeSpace(const wxString& folder);
174 
175  // the model
177  //current gui level
179 
180  // don't listen to input on gui elements during
181  // updating the gui from the model, to prevent recursion,
182  // because the gui might report changes as well.
185  double m_oldVFOV;
186 
189 
190  // controls of this frame
191  wxChoice * m_ProjectionChoice;
192  wxTextCtrl * m_HFOVText;
193  wxTextCtrl * m_VFOVText;
194 
195  wxTextCtrl * m_WidthTxt;
196  wxTextCtrl * m_HeightTxt;
197  wxTextCtrl * m_ROILeftTxt;
198  wxTextCtrl * m_ROIRightTxt;
199  wxTextCtrl * m_ROITopTxt;
200  wxTextCtrl * m_ROIBottomTxt;
201  wxChoice * m_RemapperChoice;
202  wxChoice * m_FusionChoice;
203  wxChoice * m_HDRMergeChoice;
204  wxChoice * m_BlenderChoice;
205  wxChoice * m_edgeFillChoice;
206  wxButton * m_StitchButton;
207  wxButton * m_CalcHFOVButton;
209  wxButton * m_CalcOptROIButton;
210 
211  wxChoice * m_FileFormatChoice;
215 
219 
220  wxScrolledWindow *m_pano_ctrls;
221 
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:1619
void OnBlenderOptions(wxCommandEvent &e)
Definition: PanoPanel.cpp:863
void BlenderChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:853
declaration of helper for work with different GuiLevels
void HeightChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:738
void OnNormalTIFFCompression(wxCommandEvent &e)
Definition: PanoPanel.cpp:1477
bool CheckFreeSpace(const wxString &folder)
check if there is enough free disk space
Definition: PanoPanel.cpp:1630
void EnableControls(bool enable)
enable/disable control influenced by quick mode
Definition: PanoPanel.cpp:797
wxTextCtrl * m_ROITopTxt
Definition: PanoPanel.h:199
void DoCalcFOV(wxCommandEvent &e)
Definition: PanoPanel.cpp:1000
void ProjectionChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:620
void ROIChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:755
virtual ~PanoPanel(void)
Definition: PanoPanel.cpp:258
virtual wxObject * DoCreateResource()
Definition: PanoPanel.cpp:1671
void OnFusionOptions(wxCommandEvent &e)
Definition: PanoPanel.cpp:955
void OnEdgeFillChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:918
wxTextCtrl * m_VFOVText
Definition: PanoPanel.h:193
void UpdateDisplay(const HuginBase::PanoramaOptions &opt, const bool hasStacks)
Definition: PanoPanel.cpp:347
wxButton * m_CalcOptWidthButton
Definition: PanoPanel.h:208
StitchingPresets
the supported defaults
Definition: PanoPanel.h:93
HuginBase::Panorama * pano
Definition: PanoPanel.h:176
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
Definition: PanoPanel.cpp:72
void OnHDRFileFormatOpts(wxCommandEvent &e)
void DoUserDefinedStitch(const wxString &settings=wxString())
stitching with user defined file
Definition: PanoPanel.cpp:1331
wxScrolledWindow * m_pano_ctrls
Definition: PanoPanel.h:220
void SetGuiLevel(GuiLevel newGuiLevel)
Definition: PanoPanel.cpp:1657
void OnRemapperOptions(wxCommandEvent &e)
Definition: PanoPanel.cpp:826
void QuickModeChanged(wxCommandEvent &e)
void VFOVChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:669
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
wxStaticText * m_FileFormatOptionsLabel
Definition: PanoPanel.h:212
void Init(HuginBase::Panorama *pano)
Definition: PanoPanel.cpp:250
wxTextCtrl * m_ROIBottomTxt
Definition: PanoPanel.h:200
wxButton * GetStitchButton() const
Definition: PanoPanel.h:85
Model for a panorama.
Definition: Panorama.h:152
double m_oldVFOV
Definition: PanoPanel.h:185
wxTextCtrl * m_WidthTxt
Definition: PanoPanel.h:195
void RemapperChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:809
wxTextCtrl * m_ROILeftTxt
Definition: PanoPanel.h:197
wxChoice * m_BlenderChoice
Definition: PanoPanel.h:204
wxChoice * m_edgeFillChoice
Definition: PanoPanel.h:205
wxTextCtrl * m_FileFormatJPEGQualityText
Definition: PanoPanel.h:213
wxChoice * m_FusionChoice
Definition: PanoPanel.h:202
virtual void panoramaChanged(HuginBase::Panorama &pano)
this is called whenever the panorama has changed.
Definition: PanoPanel.cpp:278
wxChoice * m_RemapperChoice
Definition: PanoPanel.h:201
wxTextCtrl * m_HeightTxt
Definition: PanoPanel.h:196
wxTextCtrl * m_HFOVText
Definition: PanoPanel.h:192
void OnHDRTIFFCompression(wxCommandEvent &e)
Definition: PanoPanel.cpp:1504
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:933
void FileFormatChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:1413
void FusionChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:949
void HFOVChangedSpin(wxSpinEvent &e)
wxChoice * m_HDRMergeChoice
Definition: PanoPanel.h:203
wxChoice * m_FileFormatHDRTIFFCompChoice
Definition: PanoPanel.h:218
bool m_keepViewOnResize
Definition: PanoPanel.h:187
void WidthChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:721
wxChoice * m_ProjectionChoice
Definition: PanoPanel.h:191
StitchingEngine
the supported stitching engines
Definition: PanoPanel.h:90
void OnJPEGQualityText(wxCommandEvent &e)
Definition: PanoPanel.cpp:1463
wxButton * m_CalcHFOVButton
Definition: PanoPanel.h:207
wxButton * m_CalcOptROIButton
Definition: PanoPanel.h:209
void HFOVChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:637
void ApplyQuickMode(int preset)
bool updatesDisabled
Definition: PanoPanel.h:183
this handler class will receive change events from the Panorama.
Definition: PanoramaData.h:401
wxChoice * m_FileFormatTIFFCompChoice
Definition: PanoPanel.h:214
void DoStitch(const wxString &userDefinedSetting=wxEmptyString, const bool readSetting=true)
stitching using hugin_stitch_project
Definition: PanoPanel.cpp:1075
wxButton * m_StitchButton
Definition: PanoPanel.h:206
wxStaticText * m_HDRFileFormatLabelTIFFCompression
Definition: PanoPanel.h:217
void DoCalcOptimalROI(wxCommandEvent &e)
set the largest rectangle for crop ROI
Definition: PanoPanel.cpp:1045
xrc handler
Definition: PanoPanel.h:226
void DoCalcOptimalWidth(wxCommandEvent &e)
set the highest sensible width
Definition: PanoPanel.cpp:1022
void HDRFileFormatChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:1441
void DoSendToBatch(const wxString &userDefinedSetting=wxEmptyString)
stitching with PTBatcherGUI
Definition: PanoPanel.cpp:1196
wxChoice * m_FileFormatChoice
Definition: PanoPanel.h:211
void DoStitchOrSendBatch(const wxString &userDefinedSetting=wxEmptyString)
general stitching command, selects PTBatcherGUI or hugin_stitch_project depending on the settings in ...
Definition: PanoPanel.cpp:1378
GuiLevel m_guiLevel
Definition: PanoPanel.h:178
bool CheckGoodSize()
Check the canvas size isn&#39;t overly huge, or the user knows what they are doing.
Definition: PanoPanel.cpp:1559
Define the pano edit panel.
Definition: PanoPanel.h:43
void OnHDRMergeOptions(wxCommandEvent &e)
Definition: PanoPanel.cpp:980
virtual bool CanHandle(wxXmlNode *node)
Definition: PanoPanel.cpp:1686
GuiLevel
Definition: GuiLevel.h:31
void VFOVChangedSpin(wxSpinEvent &e)
void SetStitcher(HuginBase::PanoramaOptions::Remapper stitcher)
bool m_hasStacks
Definition: PanoPanel.h:188
void HDRMergeChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:974
Panorama image options.
wxChoice * m_HDRFileFormatChoice
Definition: PanoPanel.h:216
void OnOutputFilesChanged(wxCommandEvent &e)
Definition: PanoPanel.cpp:1527
HuginBase::PanoramaOptions m_oldOpt
Definition: PanoPanel.h:184
void OnDoStitch(wxCommandEvent &e)
Definition: PanoPanel.cpp:1408
bool StackCheck(HuginBase::Panorama &pano)
Definition: PanoPanel.cpp:297
wxTextCtrl * m_ROIRightTxt
Definition: PanoPanel.h:198