Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages
hugin1/hugin/CPDetectorConfig.h
Go to the documentation of this file.00001 // -*- c-basic-offset: 4 -*- 00013 /* This is free software; you can redistribute it and/or 00014 * modify it under the terms of the GNU General Public 00015 * License as published by the Free Software Foundation; either 00016 * version 2 of the License, or (at your option) any later version. 00017 * 00018 * This software is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00021 * Lesser General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU General Public 00024 * License along with this software; if not, write to the Free Software 00025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00026 * 00027 */ 00028 00029 #ifndef _CPDETECTORCONFIG_H 00030 #define _CPDETECTORCONFIG_H 00031 00032 #include "panoinc.h" 00033 #include "panoinc_WX.h" 00034 00035 #include <wx/dynarray.h> 00036 #include <wx/choicebk.h> 00037 00038 enum CPDetectorType 00039 { 00040 CPDetector_AutoPano=0, 00041 CPDetector_AutoPanoSift=1, 00042 CPDetector_AutoPanoSiftStack=2, 00043 CPDetector_AutoPanoSiftMultiRow=3, 00044 CPDetector_AutoPanoSiftMultiRowStack=4, 00045 CPDetector_AutoPanoSiftPreAlign=5 00046 }; 00047 00049 class CPDetectorSetting 00050 { 00051 public: 00054 CPDetectorSetting(int new_type = -1); 00056 virtual ~CPDetectorSetting() {}; 00058 void Read(wxConfigBase* config, wxString path); 00060 void Write(wxConfigBase* config, wxString path); 00062 const wxString GetCPDetectorDesc() {return desc; }; 00064 void SetCPDetectorDesc(wxString new_desc) { desc=new_desc; }; 00066 const CPDetectorType GetType() {return type; }; 00068 void SetType(CPDetectorType new_type) { type=new_type;}; 00070 const wxString GetProg() {return prog; }; 00072 void SetProg(wxString new_prog) { prog=new_prog; }; 00074 const wxString GetArgs() {return args; }; 00076 void SetArgs(wxString new_args) { args=new_args; }; 00078 const wxString GetProgMatcher() {return prog_matcher; }; 00080 void SetProgMatcher(wxString new_prog) { prog_matcher=new_prog; }; 00082 const wxString GetArgsMatcher() {return args_matcher; }; 00084 void SetArgsMatcher(wxString new_args) { args_matcher=new_args; }; 00086 const wxString GetProgStack() {return prog_stack; }; 00088 void SetProgStack(wxString new_prog) { prog_stack=new_prog; }; 00090 const wxString GetArgsStack() {return args_stack; }; 00092 void SetArgsStack(wxString new_args) { args_stack=new_args; }; 00094 const bool GetOption() { return option; } 00096 void SetOption(bool new_option) { option=new_option; }; 00098 const bool IsTwoStepDetector() { return !prog_matcher.IsEmpty(); }; 00099 private: 00100 void CheckValues(); 00101 CPDetectorType type; 00102 wxString desc; 00103 wxString prog; 00104 wxString args; 00105 wxString prog_matcher; 00106 wxString args_matcher; 00107 wxString prog_stack; 00108 wxString args_stack; 00109 bool option; 00110 }; 00111 00112 WX_DECLARE_OBJARRAY(CPDetectorSetting,ArraySettings); 00113 00115 class CPDetectorConfig 00116 { 00117 public: 00119 CPDetectorConfig() {}; 00121 virtual ~CPDetectorConfig() {}; 00123 void Read(wxConfigBase* config=wxConfigBase::Get()); 00125 void Write(wxConfigBase* config=wxConfigBase::Get()); 00127 void ResetToDefault(); 00132 void FillControl(wxControlWithItems *control, bool select_default = false, bool show_default = false); 00134 unsigned int GetCount() { return settings.GetCount(); }; 00136 void Swap(int index); 00138 unsigned int GetDefaultGenerator() { return default_generator; }; 00140 void SetDefaultGenerator(unsigned int new_default_generator); 00142 ArraySettings settings; 00143 private: 00144 unsigned int default_generator; 00145 void ReadIndex(wxConfigBase* config, int i); 00146 void WriteIndex(wxConfigBase* config, int i); 00147 }; 00148 00150 class CPDetectorDialog : public wxDialog 00151 { 00152 public: 00154 CPDetectorDialog(wxWindow* parent); 00156 virtual ~CPDetectorDialog(); 00160 void UpdateFields(CPDetectorConfig* cpdet_config,int index); 00164 void UpdateSettings(CPDetectorConfig* cpdet_config,int index); 00165 protected: 00167 void OnOk(wxCommandEvent & e); 00169 void OnSelectPath(wxCommandEvent &e); 00171 void OnSelectPathDescriptor(wxCommandEvent &e); 00173 void OnSelectPathMatcher(wxCommandEvent &e); 00175 void OnSelectPathStack(wxCommandEvent &e); 00177 void OnTypeChange(wxCommandEvent &e); 00179 void OnStepChanging(wxChoicebookEvent &e); 00181 bool ShowFileDialog(wxString & prog); 00182 private: 00183 wxTextCtrl *m_edit_desc; 00184 wxTextCtrl *m_edit_prog; 00185 wxTextCtrl *m_edit_args; 00186 wxTextCtrl *m_edit_prog_descriptor; 00187 wxTextCtrl *m_edit_args_descriptor; 00188 wxTextCtrl *m_edit_prog_matcher; 00189 wxTextCtrl *m_edit_args_matcher; 00190 wxTextCtrl *m_edit_prog_stack; 00191 wxTextCtrl *m_edit_args_stack; 00192 wxCheckBox *m_check_option; 00193 wxChoice *m_cpdetector_type; 00194 wxChoicebook * m_choice_step; 00195 bool twoStepAllowed; 00196 00197 void ChangeType(); 00198 DECLARE_EVENT_TABLE(); 00199 }; 00200 00201 #endif
1.3.9.1