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 "vigra/impex.hxx"
00032 #include "hugin/config_defaults.h"
00033 #include "base_wx/platform.h"
00034 
00035 namespace PT {
00036 
00037 struct FileIsNewer: public std::binary_function<const std::string &, const std::string &, bool>
00038 {
00039 
00040     bool operator()(const std::string & file1, const std::string & file2)
00041     {
00042         // lets hope the operating system caches files stats.
00043         return wxFileModificationTime(wxString(file1.c_str(),HUGIN_CONV_FILENAME)) < wxFileModificationTime(wxString(file2.c_str(),HUGIN_CONV_FILENAME));
00044     };
00045 
00046 };
00047 
00049 class wxAddImagesCmd : public PanoCommand
00050 {
00051 public:
00052     wxAddImagesCmd(Panorama & pano, const std::vector<std::string> & newfiles)
00053     : PanoCommand(pano), files(newfiles)
00054     { };
00055 
00056     virtual bool processPanorama(Panorama& pano);
00057 
00058     virtual std::string getName() const
00059         {
00060             return "add images";
00061         }
00062 private:
00063     std::vector<std::string> files;
00064 };
00065 
00066 
00067 
00071 class wxLoadPTProjectCmd : public PanoCommand
00072 {
00073 public:
00074     wxLoadPTProjectCmd(Panorama & p, const std::string filename, const std::string prefix = "", const bool markAsOptimized=false, const bool clearDirty=true)
00075         : PanoCommand(p),
00076           filename(filename),
00077           prefix(prefix),
00078           markAsOptimized(markAsOptimized)
00079     { m_clearDirty=clearDirty; };
00080 
00081     virtual bool processPanorama(Panorama& pano);
00082 
00083     virtual std::string getName() const
00084     {
00085         return "load project";
00086     }
00087 private:
00088     const std::string filename;
00089     const std::string prefix;
00090     const bool markAsOptimized;
00091 };
00092 
00096 class wxNewProjectCmd : public PanoCommand
00097 {
00098 public:
00099     wxNewProjectCmd(Panorama & p) : PanoCommand(p) { m_clearDirty=true; };
00100 
00101     virtual bool processPanorama(Panorama& pano);
00102 
00103     virtual std::string getName() const
00104     {
00105         return "new project";
00106     }
00107 };
00108 
00109 
00113 class wxApplyTemplateCmd : public PanoCommand
00114 {
00115 public:
00116     wxApplyTemplateCmd(Panorama & p, std::istream & i)
00117         : PanoCommand(p),
00118           in(i)
00119     { };
00120 
00121     virtual bool processPanorama(Panorama& pano);
00122 
00123     virtual std::string getName() const
00124     {
00125         return "apply template";
00126     }
00127 private:
00128     std::istream & in;
00129 };
00130 
00131     //=========================================================================
00132     //=========================================================================
00133 
00134 
00136     class wxAddCtrlPointGridCmd : public PanoCommand
00137     {
00138     public:
00139         wxAddCtrlPointGridCmd(Panorama & p, unsigned int i1,
00140                             unsigned int i2, double scale, double threshold)
00141             : PanoCommand(p), img1(i1), img2(i2), scale(scale), cornerThreshold(threshold)
00142             { }
00143 
00144         virtual bool processPanorama(Panorama& pano);
00145 
00146         virtual std::string getName() const
00147             {
00148                 return "add control point";
00149             }
00150     private:
00151         unsigned int img1,img2,dx,dy;
00152         double scale;
00153         double cornerThreshold;
00154     };
00155 
00157 #ifdef HUGIN_HSI
00158     class PythonScriptPanoCmd : public PanoCommand
00159     {
00160     public:
00161         PythonScriptPanoCmd(Panorama & pano, const std::string & scriptFile)
00162             : PanoCommand(pano), m_scriptFile(scriptFile)
00163             { };
00164 
00165         virtual bool processPanorama(Panorama& pano);
00166         
00167         virtual std::string getName() const
00168             {
00169                 return "python script";
00170             }
00171     private:
00172         std::string m_scriptFile;
00173     };
00174 #endif
00175 
00176 
00177 } // namespace PT
00178 
00179 #endif // _WXPANOCOMMAND__H

Generated on 25 Oct 2014 for Hugintrunk by  doxygen 1.4.7