Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages
hugin1/hugin/wxPanoCommand.h
Go to the documentation of this file.00001 // -*- c-basic-offset: 4 -*- 00026 #ifndef _WXPANOCOMMAND__H 00027 #define _WXPANOCOMMAND__H 00028 00029 #include "PT/PanoToolsUtils.h" 00030 #include "PT/PanoCommand.h" 00031 #include "common/stl_utils.h" 00032 #include "vigra/impex.hxx" 00033 #include "hugin/LensPanel.h" 00034 #include "hugin/config_defaults.h" 00035 #include "base_wx/platform.h" 00036 00037 namespace PT { 00038 00039 struct FileIsNewer: public std::binary_function<const std::string &, const std::string &, bool> 00040 { 00041 00042 bool operator()(const std::string & file1, const std::string & file2) 00043 { 00044 // lets hope the operating system caches files stats. 00045 return wxFileModificationTime(wxString(file1.c_str(),HUGIN_CONV_FILENAME)) < wxFileModificationTime(wxString(file2.c_str(),HUGIN_CONV_FILENAME)); 00046 }; 00047 00048 }; 00049 00051 class wxAddImagesCmd : public PanoCommand 00052 { 00053 public: 00054 wxAddImagesCmd(Panorama & pano, const std::vector<std::string> & newfiles) 00055 : PanoCommand(pano), files(newfiles) 00056 { }; 00057 00058 virtual void execute(); 00059 00060 virtual std::string getName() const 00061 { 00062 return "add images"; 00063 } 00064 private: 00065 std::vector<std::string> files; 00066 }; 00067 00068 00069 00073 class wxLoadPTProjectCmd : public PanoCommand 00074 { 00075 public: 00076 wxLoadPTProjectCmd(Panorama & p, const std::string filename, const std::string prefix = "") 00077 : PanoCommand(p), 00078 filename(filename), 00079 prefix(prefix) 00080 { }; 00081 00082 virtual void execute(); 00083 00084 virtual std::string getName() const 00085 { 00086 return "load project"; 00087 } 00088 private: 00089 const std::string filename; 00090 const std::string prefix; 00091 }; 00092 00093 00097 class wxApplyTemplateCmd : public PanoCommand 00098 { 00099 public: 00100 wxApplyTemplateCmd(Panorama & p, std::istream & i) 00101 : PanoCommand(p), 00102 in(i) 00103 { }; 00104 00105 virtual void execute(); 00106 00107 virtual std::string getName() const 00108 { 00109 return "apply template"; 00110 } 00111 private: 00112 std::istream & in; 00113 }; 00114 00115 //========================================================================= 00116 //========================================================================= 00117 00118 00120 class wxAddCtrlPointGridCmd : public PanoCommand 00121 { 00122 public: 00123 wxAddCtrlPointGridCmd(Panorama & p, unsigned int i1, 00124 unsigned int i2, double scale, double threshold) 00125 : PanoCommand(p), img1(i1), img2(i2), scale(scale), cornerThreshold(threshold) 00126 { } 00127 00128 virtual void execute(); 00129 00130 virtual std::string getName() const 00131 { 00132 return "add control point"; 00133 } 00134 private: 00135 unsigned int img1,img2,dx,dy; 00136 double scale; 00137 double cornerThreshold; 00138 }; 00139 00140 00141 } // namespace PT 00142 00143 #endif // _WXPANOCOMMAND__H
1.3.9.1