27#include "hugin_config.h"
62#include <wx/stdpaths.h>
65#include <wx/taskbarbutton.h>
87 for (
unsigned i=0;
i <
comp.size();
i++) {
89 HuginGraph::ImageGraph::Components::value_type::const_iterator
it =
comp[
i].begin();
92 unsigned int imgNr = *
it;
95 if (
it !=
comp[
i].end() && *
it == imgNr + 1)
98 while (
it !=
comp[
i].end() && *
it == imgNr + 1)
119 if (
i + 1 !=
comp.size())
128#if defined USE_GDKBACKEND_X11
132#warning Using Hugin with hard coded GDK_BACKEND=x11
139 char backend[]=
"GDK_BACKEND=x11";
152#if wxUSE_ON_FATAL_EXCEPTION
179 DEBUG_TRACE(
"=========================== huginApp::OnInit() begin ===================");
187 config->SetRecordDefaults(
false);
194#if defined __WXMSW__ && wxCHECK_VERSION(3,3,0)
201 wxSystemOptions::SetOption(
"mac.listctrl.always_use_generic", 1);
230#elif defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
259#elif defined UNIX_SELF_CONTAINED_BUNDLE
280 if ( ! wxFile::Exists(
m_xrcPrefix +
"/main_frame.xrc") ) {
303 locale.AddCatalog(
"hugin");
309 wxXmlResource::Get()->InitAllHandlers();
312 #ifdef _INCLUDE_UI_RESOURCES
328 wxXmlResource::Get()->AddHandler(
new wxcode::wxTreeListCtrlXmlHandler());
334 wxXmlResource::Get()->Load(
m_xrcPrefix +
"cp_list_frame.xrc");
335 wxXmlResource::Get()->Load(
m_xrcPrefix +
"preview_frame.xrc");
336 wxXmlResource::Get()->Load(
m_xrcPrefix +
"edit_script_dialog.xrc");
337 wxXmlResource::Get()->Load(
m_xrcPrefix +
"main_menu.xrc");
338 wxXmlResource::Get()->Load(
m_xrcPrefix +
"main_tool.xrc");
339 wxXmlResource::Get()->Load(
m_xrcPrefix +
"about.xrc");
340 wxXmlResource::Get()->Load(
m_xrcPrefix +
"pref_dialog.xrc");
341 wxXmlResource::Get()->Load(
m_xrcPrefix +
"cpdetector_dialog.xrc");
342 wxXmlResource::Get()->Load(
m_xrcPrefix +
"reset_dialog.xrc");
343 wxXmlResource::Get()->Load(
m_xrcPrefix +
"optimize_photo_panel.xrc");
344 wxXmlResource::Get()->Load(
m_xrcPrefix +
"cp_editor_panel.xrc");
345 wxXmlResource::Get()->Load(
m_xrcPrefix +
"images_panel.xrc");
346 wxXmlResource::Get()->Load(
m_xrcPrefix +
"main_frame.xrc");
347 wxXmlResource::Get()->Load(
m_xrcPrefix +
"optimize_panel.xrc");
348 wxXmlResource::Get()->Load(
m_xrcPrefix +
"pano_panel.xrc");
349 wxXmlResource::Get()->Load(
m_xrcPrefix +
"mask_editor_panel.xrc");
350 wxXmlResource::Get()->Load(
m_xrcPrefix +
"lensdb_dialogs.xrc");
351 wxXmlResource::Get()->Load(
m_xrcPrefix +
"image_variable_dlg.xrc");
352 wxXmlResource::Get()->Load(
m_xrcPrefix +
"dlg_warning.xrc");
353 wxXmlResource::Get()->Load(
m_xrcPrefix +
"import_raw_dialog.xrc");
371 frame->SendSizeEvent();
373#if wxUSE_TASKBARBUTTON
376 exeFile.SetName(
"PTBatcherGUI");
379 _(
"Opens PTBatcherGUI, the batch processor for Hugin's project files"),
382 exeFile.SetName(
"calibrate_lens_gui");
385 _(
"Opens Calibrate_lens_gui, a simple GUI for lens calibration"),
388 exeFile.SetName(
"Hugin_toolbox");
391 _(
"Opens Hugin_toolbox, a GUI for several small helper programs"),
396 #pragma message("Warning: huginApp.cpp - wxWidgets is compiled without support for taskbar buttons. Some features have therefore disabled.")
398 #warning "Warning: huginApp.cpp - wxWidgets is compiled without support for taskbar buttons. Some features have therefore disabled."
409#if defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
419 wxLogError(wxString::Format(
"Could not find help directory in the bundle",
strFile.c_str()));
449#if (defined __WXMSW__)
455#elif (defined __WXMAC__) && (defined MAC_SELF_CONTAINED_BUNDLE)
502 if (file.GetExt().CmpNoCase(
"pto") == 0 ||
503 file.GetExt().CmpNoCase(
"pts") == 0 ||
504 file.GetExt().CmpNoCase(
"ptp") == 0 )
506 if(file.IsRelative())
507 file.MakeAbsolute(
cwd);
513 std::vector<std::string>
filesv;
516 for (
int i=1;
i< argc;
i++)
532 file.MakeAbsolute(
dir.GetName());
536 if (file.IsRelative())
538 file.MakeAbsolute(
cwd);
549 config->Write(
"/actualPath", file.GetPath());
564 config->Write(
"/actualPath", file.GetPath());
576 std::vector<PanoCommand::PanoCommand*>
cmds;
588 message->SetOKLabel(
_(
"Convert anyway."));
596 if (
dlg.CheckRawFiles())
618 int nValue =
config->Read(
"/MainFrame/ShowStartTip", 1l);
623 wxCommandEvent
dummy;
628 DEBUG_TRACE(
"=========================== huginApp::OnInit() end ===================");
635 delete wxHelpProvider::Set(
NULL);
673#if wxUSE_ON_FATAL_EXCEPTION
674void huginApp::OnFatalException()
Definition of dialog for numeric transforms.
Definition of HTMLWindow class which supports opening external links in default web browser.
declaration of main image tree control
class to access Hugins camera and lens database
int main(int argc, char *argv[])
void registerPTWXDlgFcn()
Definition of dialog and functions to import RAW images to project file.
xrc handler for CPImagesComboBox
xrc handler for CPImagesComboBox
xrc handler for HTMLWindow
static void Clean()
cleanup the static LensDB instance, must be called at the end of the program
std::vector< HuginBase::UIntSet > Components
stores the components of the graph
void LoadProjectFile(const wxString &filename)
void OnTipOfDay(wxCommandEvent &e)
const GuiLevel GetGuiLevel() const
wxHelpController & GetHelpController()
GLPreviewFrame * getGLPreview()
xrc handler for handling mask editor panel
xrc handler for mask editor
center panorama horizontically
PanoCommand to combine other PanoCommands.
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
void clear()
Erases all the undo/redo history.
distributes all images above the sphere, for the assistant
static GlobalCmdHist & getInstance()
add image(s) to a panorama
start a new project, reset options to values in preferences
The application class for hugin.
static MainFrame * getMainFrame()
cmsHPROFILE m_monitorProfile
bool OnInit() override
pseudo constructor.
int OnExit() override
just for testing purposes
wxString m_workDir
temporary working directory
static huginApp * Get()
hack.. kind of a pseudo singleton...
wxString m_monitorProfileName
wxLocale locale
locale for internationalisation
wxIMPLEMENT_APP(huginApp)
bool checkVersion(wxString v1, wxString v2)
wxString Components2Str(const HuginGraph::ImageGraph::Components &comp)
functions for interaction with the hugin configuration file
#define DEBUG_ASSERT(cond)
void GetMonitorProfile(wxString &profileName, cmsHPROFILE &profile)
retrieve monitor profile from system
int alphanum_comp(const std::string &l, const std::string &r)
Compare l and r with the same semantics as strcmp(), but with the "Alphanum Algorithm" which produces...
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
std::unique_ptr< wxMessageDialogBase > MessageDialog
MessageDialog GetMessageDialog(const wxString &message, const wxString &caption, int style, wxWindow *parent)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
include file for the hugin project
include file for the hugin project
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