29 #include "wx/msw/wrapwin.h"
34 #include "hugin_config.h"
39 #if defined MAC_SELF_CONTAINED_BUNDLE
42 #include <CoreFoundation/CFBundle.h>
49 EVT_BUTTON(XRCID("prefs_cpdetector_program_select"),
CPDetectorDialog::OnSelectPath)
50 EVT_BUTTON(XRCID("prefs_cpdetector_program_descriptor_select"),
CPDetectorDialog::OnSelectPathDescriptor)
51 EVT_BUTTON(XRCID("prefs_cpdetector_program_matcher_select"),
CPDetectorDialog::OnSelectPathMatcher)
52 EVT_BUTTON(XRCID("prefs_cpdetector_program_stack_select"),
CPDetectorDialog::OnSelectPathStack)
54 EVT_CHOICEBOOK_PAGE_CHANGING(XRCID("choicebook_steps"),
CPDetectorDialog::OnStepChanging)
59 wxXmlResource::Get()->LoadDialog(
this, parent, wxT(
"cpdetector_dialog"));
61 wxIconBundle myIcons(
huginApp::Get()->GetXRCPath() + wxT(
"data/hugin.ico"),wxBITMAP_TYPE_ICO);
64 wxIcon myIcon(
huginApp::Get()->GetXRCPath() + wxT(
"data/hugin.png"),wxBITMAP_TYPE_PNG);
72 m_edit_desc = XRCCTRL(*
this,
"prefs_cpdetector_desc", wxTextCtrl);
73 m_edit_prog = XRCCTRL(*
this,
"prefs_cpdetector_program", wxTextCtrl);
74 m_edit_args = XRCCTRL(*
this,
"prefs_cpdetector_args", wxTextCtrl);
75 m_label_args_cleanup = XRCCTRL(*
this,
"prefs_cpdetector_args_label_cleanup", wxStaticText);
76 m_edit_args_cleanup = XRCCTRL(*
this,
"prefs_cpdetector_args_cleanup", wxTextCtrl);
77 m_edit_prog_descriptor = XRCCTRL(*
this,
"prefs_cpdetector_program_descriptor", wxTextCtrl);
78 m_edit_args_descriptor = XRCCTRL(*
this,
"prefs_cpdetector_args_descriptor", wxTextCtrl);
79 m_edit_prog_matcher = XRCCTRL(*
this,
"prefs_cpdetector_program_matcher", wxTextCtrl);
80 m_edit_args_matcher = XRCCTRL(*
this,
"prefs_cpdetector_args_matcher", wxTextCtrl);
81 m_edit_prog_stack = XRCCTRL(*
this,
"prefs_cpdetector_program_stack", wxTextCtrl);
82 m_edit_args_stack = XRCCTRL(*
this,
"prefs_cpdetector_args_stack", wxTextCtrl);
83 m_check_option = XRCCTRL(*
this,
"prefs_cpdetector_option", wxCheckBox);
84 m_cpdetector_type = XRCCTRL(*
this,
"prefs_cpdetector_type", wxChoice);
85 m_choice_step = XRCCTRL(*
this,
"choicebook_steps", wxChoicebook);
87 m_edit_prog->AutoCompleteFileNames();
88 m_edit_prog_descriptor->AutoCompleteFileNames();
89 m_edit_prog_matcher->AutoCompleteFileNames();
90 m_edit_prog_stack->AutoCompleteFileNames();
91 m_cpdetector_type->SetSelection(1);
105 wxMessageBox(_(
"Autopano from http://autopano.kolor.com is not available for OS X"),
106 _(
"Using Autopano-Sift instead"),wxOK|wxICON_EXCLAMATION,
this);
111 valid=valid && (
m_edit_desc->GetValue().Trim().Len()>0);
115 valid=valid && (
m_edit_prog->GetValue().Trim().Len()>0);
116 valid=valid && (
m_edit_args->GetValue().Trim().Len()>0);
130 this->EndModal(wxOK);
132 wxMessageBox(_(
"At least one input field is empty.\nPlease check your inputs."),
133 _(
"Warning"),wxOK | wxICON_ERROR,
this);
140 if(cpdet_config->
settings[index].IsTwoStepDetector())
153 if(cpdet_config->
settings[index].IsCleanupPossible())
158 if(cpdet_config->
settings[index].ContainsStacks())
176 if(cpdet_config->
settings[index].IsCleanupPossible())
182 cpdet_config->
settings[index].SetArgsCleanup(wxEmptyString);
192 if(cpdet_config->
settings[index].ContainsStacks())
199 cpdet_config->
settings[index].SetProgStack(wxEmptyString);
200 cpdet_config->
settings[index].SetArgsStack(wxEmptyString);
227 m_check_option->SetLabel(_(
"Try to connect all overlapping images."));
230 XRCCTRL(*
this,
"prefs_cpdetector_no_option",wxStaticText)->Show(
false);
233 m_check_option->SetLabel(_(
"Only work on image pairs without control points."));
236 XRCCTRL(*
this,
"prefs_cpdetector_no_option",wxStaticText)->Show(
false);
239 XRCCTRL(*
this,
"prefs_cpdetector_no_option",wxStaticText)->Show(
true);
257 wxFileName executable(prog);
258 #ifdef MAC_SELF_CONTAINED_BUNDLE
259 wxString autopanoPath = MacGetPathToUserAppSupportAutoPanoFolder();
261 wxFileDialog dlg(
this,_(
"Select control point detector program"),
262 #ifdef MAC_SELF_CONTAINED_BUNDLE
265 executable.GetPath(),
267 executable.GetFullName(),
269 _(
"Executables (*.exe,*.vbs,*.cmd, *.bat)|*.exe;*.vbs;*.cmd;*.bat"),
273 wxFD_OPEN, wxDefaultPosition);
274 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
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
static huginApp * Get()
hack.. kind of a pseudo singleton...
dialog for input settings of one autopano generator
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
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Store window size and position in configfile/registry.
wxTextCtrl * m_edit_args_descriptor
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Restore window size and position from 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()