[1fab1b]: src / hugin1 / hugin / PanoPanel.h  Maximize  Restore  History

Download this file

230 lines (182 with data), 7.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
// -*- c-basic-offset: 4 -*-
/** @file PanoPanel.h
*
* @author Kai-Uwe Behrmann <web@tiscali.de>
*
* Completely rewritten by Pablo d'Angelo <pablo.dangelo@web.de>
*
* $Id$
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef _PANOPANEL_H
#define _PANOPANEL_H
#include "hugin/MainFrame.h"
//using namespace PT;
class PanoDialog;
class wxSpinCtrl;
class wxTextCtrl;
class wxChoice;
class wxComboBox;
/** Define the pano edit panel
*
* - it is for the settings of the final panorama.
* Maybe here goes the preview to.
*/
class PanoPanel: public wxPanel, public PT::PanoramaObserver
{
public:
PanoPanel();
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"));
void Init(PT::Panorama * pano);
virtual ~PanoPanel(void) ;
/** this is called whenever the panorama has changed.
*
* This function must now update all the gui representations
* of the panorama to display the new state.
*
* Functions that change the panororama must not update
* the GUI directly. The GUI should always be updated
* to reflect the current panorama state in this function.
*
* This avoids unnessecary close coupling between the
* controller and the view (even if they sometimes
* are in the same object). See model view controller
* pattern.
*
* @todo react on different update signals more special
*/
virtual void panoramaChanged(PT::Panorama &pano);
// void panoramaImageChanged(PT::Panorama &pano, const PT::UIntSet & imgNr);
/** set the image */
// TODO remove
// void previewSingleChanged(wxCommandEvent & e);
/** stitching using hugin_stitch_project */
void DoStitch();
/** stitching with PTBatcherGUI */
void DoSendToBatch();
private:
/// the supported stitching engines
enum StitchingEngine { NONA=0, PTSTITCHER };
/// the supported defaults
enum StitchingPresets { PROFILE_CUSTOM =0 , PROFILE_JPEG=0,
PROFILE_DRAFT_JPEG, PROFILE_TIFF,
PROFILE_LAYER_TIFF, PROFILE_LAYER_PSD };
// apply changes from the model
bool StackCheck (PT::Panorama & pano);
void UpdateDisplay(const PT::PanoramaOptions & opt, const bool hasStacks);
void SetStitcher(PanoramaOptions::Remapper stitcher);
// apply changes to the model. (gui values -> Panorama)
void QuickModeChanged(wxCommandEvent & e);
void ApplyQuickMode(int preset);
void HFOVChanged(wxCommandEvent & e);
void HFOVChangedSpin(wxSpinEvent & e);
void VFOVChanged(wxCommandEvent & e );
void VFOVChangedSpin(wxSpinEvent & e);
void ProjectionChanged(wxCommandEvent & e);
void OnOutputFilesChanged(wxCommandEvent & e);
void RemapperChanged(wxCommandEvent & e);
void OnRemapperOptions(wxCommandEvent & e);
void FusionChanged(wxCommandEvent & e);
void OnFusionOptions(wxCommandEvent & e);
void HDRMergeChanged(wxCommandEvent & e);
void OnHDRMergeOptions(wxCommandEvent & e);
void BlenderChanged(wxCommandEvent & e);
void OnBlenderOptions(wxCommandEvent & e);
// File format options
void FileFormatChanged(wxCommandEvent & e);
void HDRFileFormatChanged(wxCommandEvent & e);
void OnJPEGQualityText(wxCommandEvent & e);
void OnNormalTIFFCompression(wxCommandEvent & e);
void OnHDRTIFFCompression(wxCommandEvent & e);
void OnHDRFileFormatOpts(wxCommandEvent & e);
void WidthChanged(wxCommandEvent & e);
void HeightChanged(wxCommandEvent & e);
void ROIChanged(wxCommandEvent & e);
// TODO remove
// void DoPreview(wxCommandEvent & e);
void DoCalcFOV(wxCommandEvent & e);
void DoCalcMosaicPanoFOV(wxCommandEvent & e);
void OnDoStitch(wxCommandEvent & e);
/** set the highest sensible width
*/
void DoCalcOptimalWidth(wxCommandEvent & e);
/** set the largest rectangle for crop ROI
*/
void DoCalcOptimalROI(wxCommandEvent & e);
/** enable/disable control influenced by quick mode */
void EnableControls(bool enable);
/** Check the canvas size isn't overly huge, or the user knows what they are doing.
* The canvas size can become too big if, for example, the field of view is
* more than 180 degrees, then you select rectilinear proection, then press
* "Calculate optimal size", or stitch a wide stereographic image using the
* assistant tab.
* If the canvas size is unreasonable, this function will display a warning.
* The user has the option to continue.
* @return true if the canvas size is reasonable, or the user presses
* "continue anyway" on the warning, false if the stitch should be aborted
*/
bool CheckGoodSize();
// the model
Panorama * pano;
// don't listen to input on gui elements during
// updating the gui from the model, to prevent recursion,
// because the gui might report changes as well.
bool updatesDisabled;
PanoramaOptions m_oldOpt;
double m_oldVFOV;
bool m_keepViewOnResize;
bool m_hasStacks;
// controls of this frame
wxStaticText * m_mosaicPanoText;
wxChoice * m_ProjectionChoice;
wxTextCtrl * m_HFOVText;
wxTextCtrl * m_VFOVText;
wxTextCtrl * m_WidthTxt;
wxTextCtrl * m_HeightTxt;
wxTextCtrl * m_ROILeftTxt;
wxTextCtrl * m_ROIRightTxt;
wxTextCtrl * m_ROITopTxt;
wxTextCtrl * m_ROIBottomTxt;
wxChoice * m_RemapperChoice;
wxChoice * m_FusionChoice;
wxChoice * m_HDRMergeChoice;
wxChoice * m_BlenderChoice;
wxButton * m_StitchButton;
wxButton * m_CalcHFOVButton;
wxButton * m_CalcOptWidthButton;
wxButton * m_CalcOptROIButton;
wxChoice * m_FileFormatChoice;
wxStaticText* m_FileFormatOptionsLabel;
wxTextCtrl * m_FileFormatJPEGQualityText;
wxChoice * m_FileFormatTIFFCompChoice;
wxChoice * m_HDRFileFormatChoice;
wxStaticText* m_HDRFileFormatLabelTIFFCompression;
wxChoice * m_FileFormatHDRTIFFCompChoice;
wxScrolledWindow *m_pano_ctrls;
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(PanoPanel)
};
/** xrc handler */
class PanoPanelXmlHandler : public wxXmlResourceHandler
{
DECLARE_DYNAMIC_CLASS(PanoPanelXmlHandler)
public:
PanoPanelXmlHandler();
virtual wxObject *DoCreateResource();
virtual bool CanHandle(wxXmlNode *node);
};
#endif // _PANOPANEL_H

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks