CPDetectorConfig.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00011  /*  This is free software; you can redistribute it and/or
00012  *  modify it under the terms of the GNU General Public
00013  *  License as published by the Free Software Foundation; either
00014  *  version 2 of the License, or (at your option) any later version.
00015  *
00016  *  This software is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  *  Lesser General Public License for more details.
00020  *
00021  *  You should have received a copy of the GNU General Public
00022  *  License along with this software; if not, write to the Free Software
00023  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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

Generated on Fri Apr 18 01:25:38 2014 for Hugintrunk by  doxygen 1.3.9.1