Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
wxPanoCommand.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
26 #ifndef _WXPANOCOMMAND__H
27 #define _WXPANOCOMMAND__H
28 
30 #include "PanoCommand.h"
31 #include "hugin_shared.h"
32 #include "hugin/config_defaults.h"
33 #include "base_wx/platform.h"
34 
35 namespace PanoCommand
36 {
37 
38  struct FileIsNewer
39  {
40 
41  bool operator()(const std::string & file1, const std::string & file2)
42  {
43  // lets hope the operating system caches files stats.
44  return wxFileModificationTime(wxString(file1.c_str(), HUGIN_CONV_FILENAME)) < wxFileModificationTime(wxString(file2.c_str(), HUGIN_CONV_FILENAME));
45  };
46 
47  };
48 
51  {
52  public:
53  wxAddImagesCmd(HuginBase::Panorama & pano, const std::vector<std::string> & newfiles, const int preferredLensType=-1)
54  : PanoCommand(pano), files(newfiles), m_preferredLensType(preferredLensType)
55  { };
56  virtual bool processPanorama(HuginBase::Panorama& pano);
57  virtual std::string getName() const { return "add images"; };
58  private:
59  std::vector<std::string> files;
61  };
62 
67  {
68  public:
69  wxLoadPTProjectCmd(HuginBase::Panorama & p, const std::string& filename, const std::string& prefix = "", const bool markAsOptimized = false, const bool clearDirty = true)
70  : PanoCommand(p), filename(filename), prefix(prefix), markAsOptimized(markAsOptimized)
71  {
72  m_clearDirty = clearDirty;
73  };
74  virtual bool processPanorama(HuginBase::Panorama& pano);
75  virtual std::string getName() const { return "load project"; };
76  private:
77  const std::string filename;
78  const std::string prefix;
79  const bool markAsOptimized;
80  };
81 
86  {
87  public:
88  explicit wxNewProjectCmd(HuginBase::Panorama & p) : PanoCommand(p) { m_clearDirty = true; };
89  virtual bool processPanorama(HuginBase::Panorama& pano);
90  virtual std::string getName() const { return "new project"; };
91  };
92 
97  {
98  public:
99  wxApplyTemplateCmd(HuginBase::Panorama & p, std::istream & i)
100  : PanoCommand(p), in(i)
101  { };
102  virtual bool processPanorama(HuginBase::Panorama& pano);
103  virtual std::string getName() const { return "apply template"; };
104  private:
105  std::istream & in;
106  };
107 
110  {
111  public:
112  wxAddCtrlPointGridCmd(HuginBase::Panorama & p, unsigned int i1, unsigned int i2, double scale, double threshold)
113  : PanoCommand(p), img1(i1), img2(i2), dx(0), dy(0), scale(scale), cornerThreshold(threshold)
114  { }
115  virtual bool processPanorama(HuginBase::Panorama& pano);
116 
117  virtual std::string getName() const { return "add control point"; };
118  private:
119  unsigned int img1, img2, dx, dy;
120  double scale;
122  };
123 
125 #ifdef HUGIN_HSI
126  class WXIMPEX PythonScriptPanoCmd : public PanoCommand
127  {
128  public:
129  PythonScriptPanoCmd(HuginBase::Panorama & pano, const std::string & scriptFile)
130  : PanoCommand(pano), m_scriptFile(scriptFile)
131  { };
132  virtual bool processPanorama(HuginBase::Panorama& pano);
133  virtual std::string getName() const { return "python script"; };
134  private:
135  std::string m_scriptFile;
136  };
137 #endif
138 
139 } // namespace PanoCommand
140 
141 #endif // _WXPANOCOMMAND__H
Base class for all panorama commands.
Definition: Command.h:38
implementation of huginApp Class
start a new project, reset options to values in preferences
Definition: wxPanoCommand.h:85
wxAddCtrlPointGridCmd(HuginBase::Panorama &p, unsigned int i1, unsigned int i2, double scale, double threshold)
#define HUGIN_CONV_FILENAME
Definition: platform.h:40
virtual std::string getName() const
returns the name of the command
Definition: wxPanoCommand.h:90
virtual std::string getName() const
returns the name of the command
Definition: wxPanoCommand.h:57
apply a template to a panorama object
Definition: wxPanoCommand.h:96
wxAddImagesCmd(HuginBase::Panorama &pano, const std::vector< std::string > &newfiles, const int preferredLensType=-1)
Definition: wxPanoCommand.h:53
Model for a panorama.
Definition: Panorama.h:152
wxLoadPTProjectCmd(HuginBase::Panorama &p, const std::string &filename, const std::string &prefix="", const bool markAsOptimized=false, const bool clearDirty=true)
Definition: wxPanoCommand.h:69
#define WXIMPEX
Definition: hugin_shared.h:40
virtual std::string getName() const
returns the name of the command
Definition: wxPanoCommand.h:75
Utility calls into PanoTools using CPP interface.
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition: threshold.h:41
add image(s) to a panorama
Definition: wxPanoCommand.h:50
dump the current project and load a new one.
Definition: wxPanoCommand.h:66
bool operator()(const std::string &file1, const std::string &file2)
Definition: wxPanoCommand.h:41
wxNewProjectCmd(HuginBase::Panorama &p)
Definition: wxPanoCommand.h:88
wxApplyTemplateCmd(HuginBase::Panorama &p, std::istream &i)
Definition: wxPanoCommand.h:99