00001
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _CPDETECTORCONFIG_H
00028 #define _CPDETECTORCONFIG_H
00029
00030 #include <hugin_shared.h>
00031 #include "panoinc.h"
00032 #include "panoinc_WX.h"
00033
00034 #include <wx/dynarray.h>
00035
00036 enum CPDetectorType
00037 {
00038 CPDetector_AutoPano=0,
00039 CPDetector_AutoPanoSift=1,
00040 CPDetector_AutoPanoSiftStack=2,
00041 CPDetector_AutoPanoSiftMultiRow=3,
00042 CPDetector_AutoPanoSiftMultiRowStack=4,
00043 CPDetector_AutoPanoSiftPreAlign=5
00044 };
00045
00047 class ICPIMPEX CPDetectorSetting
00048 {
00049 public:
00051 CPDetectorSetting();
00053 virtual ~CPDetectorSetting() {};
00056 bool Read(wxConfigBase* config, wxString path);
00058 void Write(wxConfigBase* config, wxString path);
00060 const wxString GetCPDetectorDesc() {return desc; };
00062 void SetCPDetectorDesc(wxString new_desc) { desc=new_desc; };
00064 const CPDetectorType GetType() {return type; };
00066 void SetType(CPDetectorType new_type) { type=new_type;};
00068 const wxString GetProg() {return prog; };
00070 void SetProg(wxString new_prog) { prog=new_prog; };
00072 const wxString GetArgs() {return args; };
00074 void SetArgs(wxString new_args) { args=new_args; };
00076 const wxString GetArgsCleanup() {return args_cleanup; };
00078 void SetArgsCleanup(wxString new_args) { args_cleanup=new_args; };
00080 const wxString GetProgMatcher() {return prog_matcher; };
00082 void SetProgMatcher(wxString new_prog) { prog_matcher=new_prog; };
00084 const wxString GetArgsMatcher() {return args_matcher; };
00086 void SetArgsMatcher(wxString new_args) { args_matcher=new_args; };
00088 const wxString GetProgStack() {return prog_stack; };
00090 void SetProgStack(wxString new_prog) { prog_stack=new_prog; };
00092 const wxString GetArgsStack() {return args_stack; };
00094 void SetArgsStack(wxString new_args) { args_stack=new_args; };
00096 const bool GetOption() { return option; }
00098 void SetOption(bool new_option) { option=new_option; };
00100 const bool IsTwoStepDetector() { return !prog_matcher.IsEmpty(); };
00102 static const bool IsCleanupPossible(CPDetectorType _type);
00103 const bool IsCleanupPossible() { return IsCleanupPossible(type); };
00105 static const bool ContainsStacks(CPDetectorType _type);
00106 const bool ContainsStacks() { return ContainsStacks(type); };
00107 private:
00108 void CheckValues();
00109 CPDetectorType type;
00110 wxString desc;
00111 wxString prog;
00112 wxString args;
00113 wxString args_cleanup;
00114 wxString prog_matcher;
00115 wxString args_matcher;
00116 wxString prog_stack;
00117 wxString args_stack;
00118 bool option;
00119 };
00120
00121 #if _WINDOWS && defined Hugin_shared
00122 WX_DECLARE_USER_EXPORTED_OBJARRAY(CPDetectorSetting,ArraySettings,ICPIMPEX);
00123 #else
00124 WX_DECLARE_OBJARRAY(CPDetectorSetting,ArraySettings);
00125 #endif
00126
00128 class ICPIMPEX CPDetectorConfig
00129 {
00130 public:
00132 CPDetectorConfig() {};
00134 virtual ~CPDetectorConfig() {};
00139 void Read(wxConfigBase* config=wxConfigBase::Get(),wxString loadFromFile=wxEmptyString);
00141 void Write(wxConfigBase* config=wxConfigBase::Get());
00143 void ReadFromFile(wxString filename);
00145 void WriteToFile(wxString filename);
00147 void ResetToDefault();
00152 void FillControl(wxControlWithItems *control, bool select_default = false, bool show_default = false);
00154 unsigned int GetCount() { return settings.GetCount(); };
00156 void Swap(int index);
00158 unsigned int GetDefaultGenerator() { return default_generator; };
00160 void SetDefaultGenerator(unsigned int new_default_generator);
00162 ArraySettings settings;
00163 private:
00164 unsigned int default_generator;
00165 void ReadIndex(wxConfigBase* config, int i);
00166 void WriteIndex(wxConfigBase* config, int i);
00167 };
00168
00169 #endif