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

Download this file

158 lines (115 with data), 4.4 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
// -*- c-basic-offset: 4 -*-
/** @file OptimizePanel.h
*
* @author 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 _OPTIMIZE_PANEL_H
#define _OPTIMIZE_PANEL_H
#include <PT/Panorama.h>
#include <wx/xrc/xmlres.h>
#include <panodata/StandardImageVariableGroups.h>
class wxCheckListBox;
class wxCheckBox;
class wxStaticText;
class wxBoxSizer;
/** run the optimizer. this is tied into the wxWindows hugin
*
* it will emit an event that
*/
class OptimizePanel : public wxPanel, public PT::PanoramaObserver
{
public:
OptimizePanel();
/** Delayed creation */
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"));
virtual ~OptimizePanel();
void Init(PT::Panorama * pano);
/** receives notification about panorama changes */
virtual void panoramaChanged(PT::Panorama & pano);
/** receives notification about panorama changes */
virtual void panoramaImagesChanged(PT::Panorama &pano, const PT::UIntSet & imgNr);
/** return currently selected OptimizeVector
*
* @return OptimizeVector that contains the settings from
* the GUI
*/
PT::OptimizeVector getOptimizeVector();
/** updates the display to fit the settings in optimize vector */
void setOptimizeVector(const PT::OptimizeVector & optvec);
/** run the optimizer */
void OnOptimizeButton(wxCommandEvent & e);
/** updates the display to custom mode **/
void setModeCustom();
protected:
void OnClose(wxCloseEvent& e);
// Select/Clear button handler
void OnListButton(wxCommandEvent & e);
// helper function for wxCheckListBox
void SetCheckMark(wxCheckListBox * l, int check);
// Dev: hides all mosaic optimization controls (spin/tilt/rotate labels, checkbox lists,
// selectors) from optimizer panel
void HideMosaicOptControls();
// Dev: show all mosaic optimization controls (spin/tilt/rotate labels, checkbox lists,
// selectors) from optimizer panel
void ShowMosaicOptControls();
// called whenever the optimize mode changes
void OnChangeMode(wxCommandEvent & e);
// called whenever a checkbox state changes
void OnCheckBoxChanged(wxCommandEvent & e);
void runOptimizer(const PT::UIntSet & img);
bool AskApplyResult(const PT::Panorama & pano);
wxStaticText * m_optPanelMosaicModeText;
wxCheckListBox * m_yaw_list;
wxCheckListBox * m_pitch_list;
wxCheckListBox * m_roll_list;
// Dev: spin, tilt, rotate for mosaic alignment
wxCheckListBox * m_spin_list;
wxCheckListBox * m_tilt_list;
wxCheckListBox * m_rot_list;
wxBoxSizer * m_mosaic_params_sizer;
wxCheckListBox * m_x_list;
wxCheckListBox * m_y_list;
wxCheckListBox * m_z_list;
wxCheckListBox * m_v_list;
wxCheckListBox * m_a_list;
wxCheckListBox * m_b_list;
wxCheckListBox * m_c_list;
wxCheckListBox * m_d_list;
wxCheckListBox * m_e_list;
wxCheckBox * m_only_active_images_cb;
wxCheckBox * m_edit_cb;
wxChoice * m_mode_cb;
wxScrolledWindow *m_opt_ctrls;
PT::Panorama * m_pano;
HuginBase::StandardImageVariableGroups *variable_groups;
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(OptimizePanel)
};
/** xrc handler */
class OptimizePanelXmlHandler : public wxXmlResourceHandler
{
DECLARE_DYNAMIC_CLASS(OptimizePanelXmlHandler)
public:
OptimizePanelXmlHandler();
virtual wxObject *DoCreateResource();
virtual bool CanHandle(wxXmlNode *node);
};
#endif // _WXPANOCOMMAND_H