29 #include "wx/msw/wrapwin.h"
34 #include "hugin_config.h"
40 #if defined MAC_SELF_CONTAINED_BUNDLE
43 #include <CoreFoundation/CFBundle.h>
49 wxXmlResource::Get()->LoadDialog(
this, parent, wxT(
"cpdetector_dialog"));
54 m_edit_desc = XRCCTRL(*
this,
"prefs_cpdetector_desc", wxTextCtrl);
55 m_edit_prog = XRCCTRL(*
this,
"prefs_cpdetector_program", wxTextCtrl);
56 m_edit_args = XRCCTRL(*
this,
"prefs_cpdetector_args", wxTextCtrl);
65 m_check_option = XRCCTRL(*
this,
"prefs_cpdetector_option", wxCheckBox);
67 m_choice_step = XRCCTRL(*
this,
"choicebook_steps", wxChoicebook);
95 wxMessageBox(_(
"Autopano from http://autopano.kolor.com is not available for OS X"),
96 _(
"Using Autopano-Sift instead"),wxOK|wxICON_EXCLAMATION,
this);
101 valid=valid && (
m_edit_desc->GetValue().Trim().Len()>0);
105 valid=valid && (
m_edit_prog->GetValue().Trim().Len()>0);
106 valid=valid && (
m_edit_args->GetValue().Trim().Len()>0);
120 this->EndModal(wxOK);
122 wxMessageBox(_(
"At least one input field is empty.\nPlease check your inputs."),
123 _(
"Warning"),wxOK | wxICON_ERROR,
this);
130 if(cpdet_config->
settings[index].IsTwoStepDetector())
143 if(cpdet_config->
settings[index].IsCleanupPossible())
148 if(cpdet_config->
settings[index].ContainsStacks())
166 if(cpdet_config->
settings[index].IsCleanupPossible())
172 cpdet_config->
settings[index].SetArgsCleanup(wxEmptyString);
182 if(cpdet_config->
settings[index].ContainsStacks())
189 cpdet_config->
settings[index].SetProgStack(wxEmptyString);
190 cpdet_config->
settings[index].SetArgsStack(wxEmptyString);
217 m_check_option->SetLabel(_(
"Try to connect all overlapping images."));
220 XRCCTRL(*
this,
"prefs_cpdetector_no_option",wxStaticText)->Show(
false);
223 m_check_option->SetLabel(_(
"Only work on image pairs without control points."));
226 XRCCTRL(*
this,
"prefs_cpdetector_no_option",wxStaticText)->Show(
false);
229 XRCCTRL(*
this,
"prefs_cpdetector_no_option",wxStaticText)->Show(
true);
247 wxFileName executable(prog);
248 #ifdef MAC_SELF_CONTAINED_BUNDLE
249 wxString autopanoPath = MacGetPathToUserAppSupportAutoPanoFolder();
251 wxFileDialog dlg(
this,_(
"Select control point detector program"),
252 #ifdef MAC_SELF_CONTAINED_BUNDLE
255 executable.GetPath(),
257 executable.GetFullName(),
259 _(
"Executables (*.exe,*.vbs,*.cmd, *.bat)|*.exe;*.vbs;*.cmd;*.bat"),
263 wxFD_OPEN, wxDefaultPosition);
264 if (dlg.ShowModal() == wxID_OK)
void OnSelectPath(wxCommandEvent &e)
select program with file open dialog
void UpdateFields(CPDetectorConfig *cpdet_config, int index)
updates edit fields with values from settings
const bool IsCleanupPossible()
wxTextCtrl * m_edit_args_matcher
CPDetectorDialog(wxWindow *parent)
constructor
wxTextCtrl * m_edit_prog_stack
void OnSelectPathStack(wxCommandEvent &e)
select program for stack with file open dialog
wxChoicebook * m_choice_step
void OnSelectPathMatcher(wxCommandEvent &e)
select program for feature matcher with file open dialog
void OnTypeChange(wxCommandEvent &e)
update dialog, when other cp detector type is changed
wxStaticText * m_label_args_cleanup
void OnStepChanging(wxChoicebookEvent &e)
block selection of two step detector for autopano setting
wxTextCtrl * m_edit_args_stack
ArraySettings settings
array which stores the different autopano settings
virtual ~CPDetectorDialog()
destructor, saves position and size
wxTextCtrl * m_edit_args_cleanup
wxChoice * m_cpdetector_type
wxTextCtrl * m_edit_args_descriptor
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Store window size and position in configfile/registry.
bool ShowFileDialog(wxString &prog)
shows file dialog
wxTextCtrl * m_edit_prog_matcher
wxCheckBox * m_check_option
functions for interaction with the hugin configuration file
wxTextCtrl * m_edit_prog_descriptor
void OnSelectPathDescriptor(wxCommandEvent &e)
select program for feature descriptor with file open dialog
class for storing settings of different control point generators
void UpdateSettings(CPDetectorConfig *cpdet_config, int index)
return inputed settings
void OnOk(wxCommandEvent &e)
check inputs
declaration of CPDetectorDialog class, which are for storing and changing settings of different autop...
const bool ContainsStacks()
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Restore window size and position from configfile/registry.