Hugin trunk 0.1
Loading...
Searching...
No Matches
ResetDialog.cpp
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
2
11/* This is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
15 *
16 * This software is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public
22 * License along with this software. If not, see
23 * <http://www.gnu.org/licenses/>.
24 *
25 */
26
27#include "hugin/ResetDialog.h"
28#include "base_wx/wxPlatform.h"
29#include "base_wx/wxutils.h"
30#include "panoinc.h"
31
32#include "hugin/huginApp.h"
33
35{
36 // load our children. some children might need special
37 // initialization. this will be done later.
38 wxXmlResource::Get()->LoadDialog(this, parent, "reset_dialog");
39
40 //set parameters
41 wxConfigBase * cfg = wxConfigBase::Get();
42 bool check;
43 cfg->Read("/ResetDialog/ResetPosition",&check,true);
44 XRCCTRL(*this,"reset_pos",wxCheckBox)->SetValue(check);
45 cfg->Read("/ResetDialog/ResetTranslation", &check, true);
46 wxCheckBox* reset_translation=XRCCTRL(*this,"reset_translation",wxCheckBox);
47 reset_translation->SetValue(check);
49 {
50 reset_translation->Hide();
51 };
52 cfg->Read("/ResetDialog/ResetFOV",&check,true);
53 XRCCTRL(*this,"reset_fov",wxCheckBox)->SetValue(check);
54 cfg->Read("/ResetDialog/ResetLens",&check,true);
55 XRCCTRL(*this,"reset_lens",wxCheckBox)->SetValue(check);
56 cfg->Read("/ResetDialog/ResetExposure",&check,true);
57 wxCheckBox* checkbox = XRCCTRL(*this, "reset_exposure", wxCheckBox);
58 checkbox->SetValue(check);
60 int exp_param;
61 cfg->Read("/ResetDialog/ResetExposureParam",&exp_param,0);
62 XRCCTRL(*this,"combo_exposure",wxComboBox)->Select(exp_param);
63 wxCommandEvent dummy;
65 cfg->Read("/ResetDialog/ResetColor",&check,true);
66 checkbox = XRCCTRL(*this, "reset_color", wxCheckBox);
67 checkbox->SetValue(check);
69 cfg->Read("/ResetDialog/ResetColorParam",&exp_param,0);
71 XRCCTRL(*this,"combo_color",wxComboBox)->Select(exp_param);
72 cfg->Read("/ResetDialog/ResetVignetting",&check,true);
73 XRCCTRL(*this,"reset_vignetting",wxCheckBox)->SetValue(check);
74 cfg->Read("/ResetDialog/ResetResponse",&check,true);
75 XRCCTRL(*this,"reset_response",wxCheckBox)->SetValue(check);
76 GetSizer()->Fit(this);
77 //position
78 hugin_utils::RestoreFramePositionOnly(this, "ResetDialog");
80};
81
83{
84 XRCCTRL(*this,"reset_exposure",wxCheckBox)->Show(false);
85 XRCCTRL(*this,"combo_exposure",wxComboBox)->Show(false);
86 XRCCTRL(*this,"reset_color",wxCheckBox)->Show(false);
87 XRCCTRL(*this,"combo_color",wxComboBox)->Show(false);
88 XRCCTRL(*this,"reset_vignetting",wxCheckBox)->Show(false);
89 XRCCTRL(*this,"reset_response",wxCheckBox)->Show(false);
90 GetSizer()->Fit(this);
91};
92
94{
95 XRCCTRL(*this,"reset_pos",wxCheckBox)->Show(false);
96 XRCCTRL(*this,"reset_translation",wxCheckBox)->Show(false);
97 XRCCTRL(*this,"reset_fov",wxCheckBox)->Show(false);
98 XRCCTRL(*this,"reset_lens",wxCheckBox)->Show(false);
99 GetSizer()->Fit(this);
100};
101
102void ResetDialog::OnOk(wxCommandEvent & e)
103{
104 wxConfigBase * cfg = wxConfigBase::Get();
105 hugin_utils::StoreFramePositionOnly(this, "ResetDialog");
106 cfg->Write("/ResetDialog/ResetPosition",GetResetPos());
107 cfg->Write("/ResetDialog/ResetTranslation", GetResetTranslation());
108 cfg->Write("/ResetDialog/ResetFOV",GetResetFOV());
109 cfg->Write("/ResetDialog/ResetLens",GetResetLens());
110 cfg->Write("/ResetDialog/ResetExposure",GetResetExposure());
111 int exp_param;
112 exp_param=XRCCTRL(*this,"combo_exposure",wxComboBox)->GetSelection();
113 cfg->Write("/ResetDialog/ResetExposureParam",exp_param);
114 cfg->Write("/ResetDialog/ResetColor",GetResetColor());
115 exp_param=XRCCTRL(*this,"combo_color",wxComboBox)->GetSelection();
116 cfg->Write("/ResetDialog/ResetColorParam", exp_param);
117 cfg->Write("/ResetDialog/ResetVignetting",GetResetVignetting());
118 cfg->Write("/ResetDialog/ResetResponse",GetResetResponse());
119 cfg->Flush();
120 e.Skip();
121};
122
123void ResetDialog::OnSelectExposure(wxCommandEvent & e)
124{
125 XRCCTRL(*this,"combo_exposure",wxComboBox)->Enable(XRCCTRL(*this, "reset_exposure", wxCheckBox)->GetValue());
126};
127
128void ResetDialog::OnSelectColor(wxCommandEvent & e)
129{
130 XRCCTRL(*this,"combo_color",wxComboBox)->Enable(XRCCTRL(*this, "reset_color", wxCheckBox)->GetValue());
131};
132
134{
135 return XRCCTRL(*this, "reset_pos", wxCheckBox)->GetValue();
136};
137
139{
140 return XRCCTRL(*this, "reset_translation", wxCheckBox)->GetValue();
141};
142
144{
145 return XRCCTRL(*this, "reset_fov", wxCheckBox)->GetValue();
146};
147
149{
150 return XRCCTRL(*this, "reset_lens", wxCheckBox)->GetValue();
151};
152
154{
155 return XRCCTRL(*this, "reset_exposure", wxCheckBox)->GetValue();
156};
157
159{
160 if(!GetResetExposure())
161 return false;
162 return XRCCTRL(*this, "combo_exposure", wxComboBox)->GetSelection()==0;
163};
164
166{
167 return XRCCTRL(*this, "reset_color", wxCheckBox)->GetValue();
168};
169
171{
172 if(!GetResetColor())
173 return false;
174 return XRCCTRL(*this, "combo_color", wxComboBox)->GetSelection()==0;
175};
176
178{
179 return XRCCTRL(*this, "reset_vignetting", wxCheckBox)->GetValue();
180};
181
183{
184 return XRCCTRL(*this, "reset_response", wxCheckBox)->GetValue();
185};
GuiLevel
Definition GuiLevel.h:32
@ GUI_EXPERT
Definition GuiLevel.h:35
Definition of ResetDialog class.
bool GetResetExposureToExif()
Return TRUE, when user selected "Reset exposure to EXIF", Return FALSE, when user selected "Reset exp...
void LimitToPhotometric()
limits the displayed parameters to photometric parameters
bool GetResetResponse()
Return TRUE, when user selected "Reset Camera Response".
void OnSelectColor(wxCommandEvent &e)
Method for enabling/disable combobox to select reset color to EXIF or ONE depending on state of "Rese...
bool GetResetTranslation()
Return TRUE, when user selected "Reset translation".
void OnSelectExposure(wxCommandEvent &e)
Method for enabling/disable combobox to select reset exposure to EXIF or ZERO depending on state of "...
bool GetResetLens()
Return TRUE, when user selected "Reset lens".
void OnOk(wxCommandEvent &e)
Saves current state of all checkboxes when closing dialog with Ok.
void LimitToGeometric()
limits the displayed parameters to geometric parameters
bool GetResetExposure()
Return TRUE, when user selected "Reset exposure".
bool GetResetPos()
Return TRUE, when user selected "Reset position".
bool GetResetFOV()
Return TRUE, when user selected "Reset FOV".
bool GetResetColor()
Return TRUE, when user selected "Reset color".
bool GetResetColorToExif()
Return TRUE, when user selected "Reset color to EXIF", Return FALSE, when user selected "Reset color ...
ResetDialog(wxWindow *parent, GuiLevel guiLevel)
Constructor, read from xrc ressource; restore last uses settings, size and position.
bool GetResetVignetting()
Return TRUE, when user selected "Reset vignetting".
void StoreFramePositionOnly(wxTopLevelWindow *frame, const wxString &basename)
Definition wxutils.cpp:163
void RestoreFramePositionOnly(wxTopLevelWindow *frame, const wxString &basename)
Definition wxutils.cpp:143
include file for the hugin project
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41
platform/compiler specific stuff.