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 "panotools/PanoToolsUtils.h"
00030 #include "PanoCommand.h"
00031 #include "hugin_shared.h"
00032 #include "hugin/config_defaults.h"
00033 #include "base_wx/platform.h"
00034 
00035 namespace PanoCommand
00036 {
00037 
00038     struct FileIsNewer : public std::binary_function<const std::string &, const std::string &, bool>
00039     {
00040 
00041         bool operator()(const std::string & file1, const std::string & file2)
00042         {
00043             // lets hope the operating system caches files stats.
00044             return wxFileModificationTime(wxString(file1.c_str(), HUGIN_CONV_FILENAME)) < wxFileModificationTime(wxString(file2.c_str(), HUGIN_CONV_FILENAME));
00045         };
00046 
00047     };
00048 
00050     class WXIMPEX wxAddImagesCmd : public PanoCommand
00051     {
00052     public:
00053         wxAddImagesCmd(HuginBase::Panorama & pano, const std::vector<std::string> & newfiles)
00054             : PanoCommand(pano), files(newfiles)
00055         { };
00056         virtual bool processPanorama(HuginBase::Panorama& pano);
00057         virtual std::string getName() const { return "add images"; };
00058     private:
00059         std::vector<std::string> files;
00060     };
00061 
00065     class WXIMPEX wxLoadPTProjectCmd : public PanoCommand
00066     {
00067     public:
00068         wxLoadPTProjectCmd(HuginBase::Panorama & p, const std::string& filename, const std::string& prefix = "", const bool markAsOptimized = false, const bool clearDirty = true)
00069             : PanoCommand(p), filename(filename), prefix(prefix), markAsOptimized(markAsOptimized)
00070         {
00071             m_clearDirty = clearDirty;
00072         };
00073         virtual bool processPanorama(HuginBase::Panorama& pano);
00074         virtual std::string getName() const { return "load project"; };
00075     private:
00076         const std::string filename;
00077         const std::string prefix;
00078         const bool markAsOptimized;
00079     };
00080 
00084     class WXIMPEX wxNewProjectCmd : public PanoCommand
00085     {
00086     public:
00087         explicit wxNewProjectCmd(HuginBase::Panorama & p) : PanoCommand(p) { m_clearDirty = true; };
00088         virtual bool processPanorama(HuginBase::Panorama& pano);
00089         virtual std::string getName() const { return "new project"; };
00090     };
00091 
00095     class WXIMPEX wxApplyTemplateCmd : public PanoCommand
00096     {
00097     public:
00098         wxApplyTemplateCmd(HuginBase::Panorama & p, std::istream & i)
00099             : PanoCommand(p), in(i)
00100         { };
00101         virtual bool processPanorama(HuginBase::Panorama& pano);
00102         virtual std::string getName() const { return "apply template"; };
00103     private:
00104         std::istream & in;
00105     };
00106 
00108     class WXIMPEX wxAddCtrlPointGridCmd : public PanoCommand
00109     {
00110     public:
00111         wxAddCtrlPointGridCmd(HuginBase::Panorama & p, unsigned int i1, unsigned int i2, double scale, double threshold)
00112             : PanoCommand(p), img1(i1), img2(i2), dx(0), dy(0), scale(scale), cornerThreshold(threshold)
00113         { }
00114         virtual bool processPanorama(HuginBase::Panorama& pano);
00115 
00116         virtual std::string getName() const { return "add control point"; };
00117     private:
00118         unsigned int img1, img2, dx, dy;
00119         double scale;
00120         double cornerThreshold;
00121     };
00122 
00124 #ifdef HUGIN_HSI
00125     class WXIMPEX PythonScriptPanoCmd : public PanoCommand
00126     {
00127     public:
00128         PythonScriptPanoCmd(HuginBase::Panorama & pano, const std::string & scriptFile)
00129             : PanoCommand(pano), m_scriptFile(scriptFile)
00130         { };
00131         virtual bool processPanorama(HuginBase::Panorama& pano);
00132         virtual std::string getName() const { return "python script"; };
00133     private:
00134         std::string m_scriptFile;
00135     };
00136 #endif
00137 
00138 } // namespace PanoCommand
00139 
00140 #endif // _WXPANOCOMMAND__H

Generated on 26 Apr 2018 for Hugintrunk by  doxygen 1.4.7