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";
163#if wxUSE_ON_FATAL_EXCEPTION
191 DEBUG_TRACE(
"=========================== huginApp::OnInit() begin ===================");
193#if defined __WXMSW__ && wxCHECK_VERSION(3,3,0)
206 wxSystemOptions::SetOption(
"mac.listctrl.always_use_generic", 1);
235#elif defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
264#elif defined UNIX_SELF_CONTAINED_BUNDLE
285 if ( ! wxFile::Exists(
m_xrcPrefix +
"/main_frame.xrc") ) {
293 config->SetRecordDefaults(
false);
315 locale.AddCatalog(
"hugin");
321 wxXmlResource::Get()->InitAllHandlers();
324 #ifdef _INCLUDE_UI_RESOURCES
340 wxXmlResource::Get()->AddHandler(
new wxcode::wxTreeListCtrlXmlHandler());
346 wxXmlResource::Get()->Load(
m_xrcPrefix +
"cp_list_frame.xrc");
347 wxXmlResource::Get()->Load(
m_xrcPrefix +
"preview_frame.xrc");
348 wxXmlResource::Get()->Load(
m_xrcPrefix +
"edit_script_dialog.xrc");
349 wxXmlResource::Get()->Load(
m_xrcPrefix +
"main_menu.xrc");
350 wxXmlResource::Get()->Load(
m_xrcPrefix +
"main_tool.xrc");
351 wxXmlResource::Get()->Load(
m_xrcPrefix +
"about.xrc");
352 wxXmlResource::Get()->Load(
m_xrcPrefix +
"pref_dialog.xrc");
353 wxXmlResource::Get()->Load(
m_xrcPrefix +
"cpdetector_dialog.xrc");
354 wxXmlResource::Get()->Load(
m_xrcPrefix +
"reset_dialog.xrc");
355 wxXmlResource::Get()->Load(
m_xrcPrefix +
"optimize_photo_panel.xrc");
356 wxXmlResource::Get()->Load(
m_xrcPrefix +
"cp_editor_panel.xrc");
357 wxXmlResource::Get()->Load(
m_xrcPrefix +
"images_panel.xrc");
358 wxXmlResource::Get()->Load(
m_xrcPrefix +
"main_frame.xrc");
359 wxXmlResource::Get()->Load(
m_xrcPrefix +
"optimize_panel.xrc");
360 wxXmlResource::Get()->Load(
m_xrcPrefix +
"pano_panel.xrc");
361 wxXmlResource::Get()->Load(
m_xrcPrefix +
"mask_editor_panel.xrc");
362 wxXmlResource::Get()->Load(
m_xrcPrefix +
"lensdb_dialogs.xrc");
363 wxXmlResource::Get()->Load(
m_xrcPrefix +
"image_variable_dlg.xrc");
364 wxXmlResource::Get()->Load(
m_xrcPrefix +
"dlg_warning.xrc");
365 wxXmlResource::Get()->Load(
m_xrcPrefix +
"import_raw_dialog.xrc");
383 frame->SendSizeEvent();
385#if wxUSE_TASKBARBUTTON
388 exeFile.SetName(
"PTBatcherGUI");
391 _(
"Opens PTBatcherGUI, the batch processor for Hugin's project files"),
394 exeFile.SetName(
"calibrate_lens_gui");
397 _(
"Opens Calibrate_lens_gui, a simple GUI for lens calibration"),
400 exeFile.SetName(
"Hugin_toolbox");
403 _(
"Opens Hugin_toolbox, a GUI for several small helper programs"),
408 #pragma message("Warning: huginApp.cpp - wxWidgets is compiled without support for taskbar buttons. Some features have therefore disabled.")
410 #warning "Warning: huginApp.cpp - wxWidgets is compiled without support for taskbar buttons. Some features have therefore disabled."
421#if defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
431 wxLogError(wxString::Format(
"Could not find help directory in the bundle",
strFile.c_str()));
461#if (defined __WXMSW__)
467#elif (defined __WXMAC__) && (defined MAC_SELF_CONTAINED_BUNDLE)
514 if (file.GetExt().CmpNoCase(
"pto") == 0 ||
515 file.GetExt().CmpNoCase(
"pts") == 0 ||
516 file.GetExt().CmpNoCase(
"ptp") == 0 )
518 if(file.IsRelative())
519 file.MakeAbsolute(
cwd);
525 std::vector<std::string>
filesv;
528 for (
int i=1;
i< argc;
i++)
544 file.MakeAbsolute(
dir.GetName());
548 if (file.IsRelative())
550 file.MakeAbsolute(
cwd);
561 config->Write(
"/actualPath", file.GetPath());
576 config->Write(
"/actualPath", file.GetPath());
588 std::vector<PanoCommand::PanoCommand*>
cmds;
600 message->SetOKLabel(
_(
"Convert anyway."));
608 if (
dlg.CheckRawFiles())
630 int nValue =
config->Read(
"/MainFrame/ShowStartTip", 1l);
635 wxCommandEvent
dummy;
640 DEBUG_TRACE(
"=========================== huginApp::OnInit() end ===================");
647 delete wxHelpProvider::Set(
NULL);
673 if (
event.entry.get())
675 ImageCache::getInstance().postEvent(
event.request,
event.entry);
680 ImageCache::getInstance().removeRequest(
event.request);
684 frame->GetEventHandler()->AddPendingEvent(e);
712#if wxUSE_ON_FATAL_EXCEPTION
713void 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
std::shared_ptr< Request > RequestPtr
Reference counted request for an image to load.
std::shared_ptr< Entry > EntryPtr
a shared pointer to the entry
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
Event for when a requested image finished loading.
virtual wxEvent * Clone() const
HuginBase::ImageCache::EntryPtr entry
HuginBase::ImageCache::RequestPtr request
ImageReadyEvent(HuginBase::ImageCache::RequestPtr request, HuginBase::ImageCache::EntryPtr entry)
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()
void relayImageLoaded(ImageReadyEvent &event)
Relay image loaded event when the UI thread is ready to process it.
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...
static void imageLoadedAsync(HuginBase::ImageCache::RequestPtr request, HuginBase::ImageCache::EntryPtr entry)
Queue up an image loaded event when an image has just loaded.
wxString m_monitorProfileName
wxLocale locale
locale for internationalisation
wxIMPLEMENT_APP(huginApp)
bool checkVersion(wxString v1, wxString v2)
wxDEFINE_EVENT(EVT_IMAGE_READY, ImageReadyEvent)
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