Hugin trunk 0.1
Loading...
Searching...
No Matches
ProjectArray.cpp
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
2
27#ifdef _WIN32
28#include "wx/msw/wrapwin.h"
29#endif
30#include "ProjectArray.h"
31#include <wx/arrimpl.cpp>
32#include "base_wx/huginConfig.h"
33#include <fstream>
34
36
55
66
68{
69 switch(status)
70 {
71 case WAITING:
72 return _("Waiting");
73 case RUNNING:
74 return _("In progress");
75 case FINISHED:
76 return _("Complete");
77 case FAILED:
78 return _("Failed");
79 case MISSING:
80 return _("File missing");
81 case PAUSED:
82 return _("Paused");
83 default:
84 return _T("");
85 }
86}
87
89{
91 std::ifstream prjfile((const char*)projectFile.mb_str(HUGIN_CONV_FILENAME));
92 if (prjfile.good())
93 {
95 wxFileName::SplitPath(projectFile, &pathToPTO, NULL, NULL);
96 pathToPTO.Append("/");
97
99 int ptoVersion = 0;
100 if (newPano.loadPTScript(prjfile, ptoVersion, (const char*)pathToPTO.mb_str(HUGIN_CONV_FILENAME)))
101 {
102 pano.setMemento(newPano);
103 if (ptoVersion < 2)
104 {
106 // no options stored in file, use default arguments in config
107 opts.enblendOptions = wxConfigBase::Get()->Read("/Enblend/Args", wxEmptyString).mb_str(wxConvLocal);
108 opts.enfuseOptions = wxConfigBase::Get()->Read("/Enfuse/Args", wxEmptyString).mb_str(wxConvLocal);
109 pano.setOptions(opts);
110 }
111 // set default prefix, if not given
112 if (prefix.IsEmpty())
113 {
116 prefix = prefixFilename.GetFullPath();
117 };
118 // if project contains at least 2 images and no control points add to assistant queue
119 // a single image project is assumed as target for reprojection/remapping
120 if (pano.getNrOfImages() > 1 && pano.getNrOfCtrlPoints() == 0)
121 {
122 isAligned = false;
123 };
124 };
125 };
126 // get options
127 return pano.getOptions();
128}
129
131{
132 wxFileName file(path);
133 if(file.FileExists())
134 {
135 file.GetTimes(NULL,&modDate,NULL);
136 }
138}
139
140WX_DEFINE_OBJARRAY(ProjectArray); //define the array in ProjectArray.h
WX_DEFINE_OBJARRAY(ProjectArray)
Batch processor for Hugin.
Memento class for a Panorama object.
Definition Panorama.h:50
bool loadPTScript(std::istream &i, int &ptoVersion, const std::string &prefix="")
load a Hugin file
Panorama image options.
Model for a panorama.
Definition Panorama.h:153
const PanoramaOptions & getOptions() const
returns the options for this panorama
Definition Panorama.h:481
void setMemento(const PanoramaMemento &memento)
set the internal state
std::size_t getNrOfCtrlPoints() const
number of control points
Definition Panorama.h:306
void setOptions(const PanoramaOptions &opt)
set new output settings This is not used directly for optimizing/stiching, but it can be feed into ru...
std::size_t getNrOfImages() const
number of images.
Definition Panorama.h:205
Target target
wxString userDefindSequence
wxDateTime modDate
wxString path
bool skip
bool isAligned
static long idGenerator
Project(wxString pth, wxString pfx, wxString newUserDefinedSequence=wxEmptyString, Project::Target newTarget=STITCHING)
HuginBase::PanoramaOptions options
HuginBase::PanoramaOptions ReadOptions(wxString projectFile)
Status status
wxString GetStatusText()
wxString prefix
void ResetOptions()
#define HUGIN_CONV_FILENAME
Definition platform.h:40
wxString getDefaultOutputName(const wxString projectname, const HuginBase::Panorama &pano, const wxString filenameTemplate)
gets the default output prefix, based on filename and images in project the setting is read from the ...
functions for interaction with the hugin configuration file
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