28#include <hugin_config.h>
34#include <wx/cmdline.h>
36#include <wx/stdpaths.h>
58#define APP wxAppConsole
72#elif defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
74#elif defined UNIX_SELF_CONTAINED_BUNDLE
102 return APP::OnInit();
143 oldCwd = wxFileName::GetCwd();
161 if (commands->empty())
163 std::cout <<
"ERROR: Queue is empty." << std::endl;
169 m_threads = wxConfigBase::Get()->Read(
"/output/NumberOfThreads", 0l);
188 std::cout <<
_(
"Removing temporary files") << std::endl;
198 wxFileName::SetCwd(
oldCwd);
207 parser.AddSwitch(
"a",
"assistant",
_(
"execute assistant"));
208 parser.AddSwitch(
"s",
"stitching",
_(
"execute stitching with given project"));
213 parser.AddSwitch(
"d",
"dry-run",
_(
"only print commands"));
297 std::cerr <<
"ERROR: Switch --assistant or --stitching is required." << std::endl;
302 std::cerr <<
"ERROR: Switches --assistant and --stitching are mutually excluse." << std::endl;
create a CommandQueue for running the assistant using CLI tools
basic classes and function for queuing commands in wxWidgets
interface of CommandQueue creating for stitching engine
bool ReadPTOFile(const std::string &filename, const std::string &prefix="")
read pto file from the given filename into Panorama object it does some checks on the file and issues...
wxString m_utilsBinDir
path to utils
wxString m_userAssistant
input file for user defined assistant
bool m_runAssistant
flag, if assistant should started
bool m_dryRun
flag, if commands should only be printed
virtual void OnInitCmdLine(wxCmdLineParser &parser)
set the parameters for the command line parser
long m_threads
number of threads used for assistant or stitching
wxString m_userOutput
input file for userdefined output
bool m_runStitching
flag, if stitching should started
virtual bool OnCmdLineParsed(wxCmdLineParser &parser)
processes the command line parameters
virtual int OnRun()
the main procedure of Executor app
wxLocale m_locale
locale for internationalisation
wxString m_prefix
stitching prefix
virtual bool OnInit()
init translation settings
wxString m_input
input project file
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
CommandQueue * GetAssistantCommandQueueUserDefined(const HuginBase::Panorama &pano, const wxString &ExePath, const wxString &project, const wxString &assistantSetting, wxArrayString &tempFilesDelete, std::ostream &errStream)
generates the command queue for running the assistant
wxString GetQuotedFilenamesString(const wxArrayString &files)
return a wxString with all files in files quoted
bool RunCommandsQueue(CommandQueue *queue, size_t threads, bool dryRun)
execute the given, set environment variable OMP_NUM_THREADS to threads (ignored for 0) after running ...
CommandQueue * GetStitchingCommandQueueUserOutput(const HuginBase::Panorama &pano, const wxString &ExePath, const wxString &project, const wxString &prefix, const wxString &outputSettings, wxString &statusText, wxArrayString &outputFiles, wxArrayString &tempFilesDelete, std::ostream &errStream)
generates the command queue for stitching a pano, the commands are parsed from the given executor out...
std::vector< NormalCommand * > CommandQueue
CommandQueue * GetStitchingCommandQueue(const HuginBase::Panorama &pano, const wxString &ExePath, const wxString &project, const wxString &prefix, wxString &statusText, wxArrayString &outputFiles, wxArrayString &tempFilesDelete, std::ostream &errStream)
generates the command queue for stitching a pano it will also generate the necessary exiftool argfile...
CommandQueue * GetAssistantCommandQueue(const HuginBase::Panorama &pano, const wxString &ExePath, const wxString &project)
generates the command queue for running the assistant
std::string GetDataDir()
returns the full path to the data directory
std::string GetUserAppDataDir()
returns the directory for user specific Hugin settings, e.g.
std::string getPathPrefix(const std::string &filename)
Get the path to a filename.
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.