29#include <wx/xml/xml.h>
31#include <wx/stdpaths.h>
72 for (
size_t i = 0;
i <
images.size(); ++
i)
90 if (
child->GetName().CmpNoCase(
"camera") == 0)
96 if (
camChild->GetName().CmpNoCase(
"sensor") == 0)
111 if (
child->GetName().CmpNoCase(
"lens") == 0)
115 if (!projection.empty())
117 if (projection.CmpNoCase(
"rectilinear") == 0)
123 if (projection.CmpNoCase(
"fisheye") == 0)
137 if (
lensChild->GetName().CmpNoCase(
"focal") == 0)
160 if (
child->GetName().CmpNoCase(
"pict") == 0)
165#ifdef PAPYWIZARD_USE_ID_CHECK
172 if (!
child->GetAttribute(
"id", &
s))
191 if(!
child->GetAttribute(
"bracket", &
s))
204 if (
posChild->GetName().CmpNoCase(
"position") == 0)
214 if (!
posChild->GetAttribute(
"pitch", &
s))
230 images.
images.push_back(image);
249 if (
xmlFile.GetRoot()->GetName().CmpNoCase(
"papywizard") != 0)
258 if (
child->GetName().CmpNoCase(
"header") == 0)
265 if (
child->GetName().CmpNoCase(
"shoot") == 0)
283 wxXmlResource::Get()->LoadDialog(
this,
parent,
"papywizard_import_dialog");
300 wxConfig::Get()->Write(
"/PapywizardImportCpfind",
m_cpfindParams->GetValue());
350 hugin_utils::HuginMessageBox(wxString::Format(
_(
"The current project does not match with the Papywizard xml file.\nThe Papywizard file \"%s\" contains %lu images, but the Hugin project contains %lu images."), filename.c_str(),
static_cast<unsigned long>(
papyImages.images.size()),
static_cast<unsigned long>(pano.
getNrOfImages())),
361 std::vector<PanoCommand::PanoCommand *> commands;
366 commands.push_back(
new PanoCommand::ChangeImageProjectionCmd(pano, images,
papyImages.projection));
398 std::set<HuginBase::ImageVariableGroup::ImageVariableEnum> variables;
399 variables.insert(HuginBase::ImageVariableGroup::IVE_Yaw);
400 variables.insert(HuginBase::ImageVariableGroup::IVE_Pitch);
401 variables.insert(HuginBase::ImageVariableGroup::IVE_Roll);
402 variables.insert(HuginBase::ImageVariableGroup::IVE_X);
403 variables.insert(HuginBase::ImageVariableGroup::IVE_Y);
404 variables.insert(HuginBase::ImageVariableGroup::IVE_Z);
405 variables.insert(HuginBase::ImageVariableGroup::IVE_TranslationPlaneYaw);
406 variables.insert(HuginBase::ImageVariableGroup::IVE_TranslationPlanePitch);
417 map_get(variables[
i],
"TrX").setValue(0);
418 map_get(variables[
i],
"TrY").setValue(0);
419 map_get(variables[
i],
"TrZ").setValue(0);
420 map_get(variables[
i],
"Tpy").setValue(0);
421 map_get(variables[
i],
"Tpp").setValue(0);
425 variables[
i].erase(
"v");
437 if (
tempDir.Last() != wxFileName::GetPathSeparator())
439 tempDir.Append(wxFileName::GetPathSeparator());
int MyExecuteCommandQueue(HuginQueue::CommandQueue *queue, wxWindow *parent, const wxString &title, const wxString &comment)
execute all commands in queue with redirection of output to frame and allow canceling the queue will ...
read settings from papywizard xml file
static const std::set< ConstImageVariableGroup::ImageVariableEnum > & getLensVariables()
Get the set of lens image variables.
static const std::set< ConstImageVariableGroup::ImageVariableEnum > & getStackVariables()
Get the set of stack image variables.
VariableMapVector getVariables() const
get variables of this panorama
bool WritePTOFile(const std::string &filename, const std::string &prefix="")
write data to given pto file
std::size_t getNrOfImages() const
number of images.
normal command for queue, processing is stopped if an error occurred in program
Change the linking of some variables across parts of an ImageVariableGroup containing some specified ...
Switch the part number of an image.
PanoCommand to combine other PanoCommands.
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
static GlobalCmdHist & getInstance()
Make a new part in a ImageVariableGroup for a set of images, given the variables that make up the gro...
dump the current project and load a new one.
~PapywizardImportDialog()
destructor, save settings
void EnableStack(const bool hasStacks)
const bool LinkStacks() const
void OnCpfindCheck(wxCommandEvent &e)
PapywizardImportDialog(wxWindow *parent)
Constructor, read from xrc ressource.
const bool RunGeocpset() const
wxTextCtrl * m_cpfindParams
const bool RunCpfind() const
const wxString GetCPFindParam() const
class which holds all read settings from a Papywizard xml file
HuginBase::SrcPanoImage::Projection projection
std::vector< PapywizardImage > images
PapywizardSettings()
constructor, initialize some values
bool HasBracketImages() const
std::vector< VariableMap > VariableMapVector
std::set< unsigned int > UIntSet
str wxEscapeFilename(const str &arg)
special escaping routine for CommandQueues
std::vector< NormalCommand * > CommandQueue
wxString GetInternalProgram(const wxString &bindir, const wxString &name)
return path and name of external program, which comes bundled with Hugin
bool ImportPapywizardFile(const wxString &filename, HuginBase::Panorama &pano)
import the settings from given filename into pano
bool ParseShoot(wxXmlNode *root, PapywizardSettings &images)
parse shoot section of papywizard file
bool ParseHeader(wxXmlNode *root, PapywizardSettings &images)
parse header of papywizard file
bool ParsePapywizardFile(const wxString &filename, PapywizardSettings &images)
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
bool stringToDouble(const STR &str_, double &dest)
convert a string to a double, ignore localisation.
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
std::string getPathPrefix(const std::string &filename)
Get the path to a filename.
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
include file for the hugin project
Map::mapped_type & map_get(Map &m, const typename Map::key_type &key)
get a map element.
void fill_set(_Container &c, typename _Container::key_type begin, typename _Container::key_type end)
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.
wxwindows specific panorama commands