30 #include "hugin_config.h"
32 #if !defined HAVE_EPOXY || !HAVE_EPOXY
38 #include <wx/msgdlg.h>
71 #include <pano13/queryfeature.h>
94 #include <wx/progdlg.h>
95 #include <wx/infobar.h>
125 #define PF_STYLE (wxMAXIMIZE_BOX | wxMINIMIZE_BOX | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN)
137 wxAuiFloatingFrame(parent, (wxAuiManager*)owner_mgr, pane, id, style)
155 wxAuiFloatingFrame::OnMoveFinished();
168 wxSizeEvent
event = wxSizeEvent(wxSize());
175 : wxFrame(frame,-1, _(
"Fast Panorama preview"), wxDefaultPosition, wxDefaultSize,
209 int widths[3] = {-3, 150, 150};
210 SetStatusWidths(3, widths);
211 SetStatusText(wxEmptyString,1);
212 SetStatusText(wxEmptyString,2);
213 wxConfigBase * cfg = wxConfigBase::Get();
215 wxPanel *tool_panel = wxXmlResource::Get()->LoadPanel(
this,
"mode_panel");
216 XRCCTRL(*
this,
"preview_center_tool",wxButton)->SetBitmapMargins(0,5);
217 XRCCTRL(*
this,
"preview_fit_pano_tool",wxButton)->SetBitmapMargins(0,5);
218 XRCCTRL(*
this,
"preview_straighten_pano_tool",wxButton)->SetBitmapMargins(0,5);
219 XRCCTRL(*
this,
"preview_fit_pano_tool2",wxButton)->SetBitmapMargins(0,5);
220 XRCCTRL(*
this,
"preview_autocrop_tool",wxButton)->SetBitmapMargins(0,5);
221 XRCCTRL(*
this,
"preview_stack_autocrop_tool",wxButton)->SetBitmapMargins(0,5);
222 XRCCTRL(*
this,
"preview_autocrop_outside_tool", wxButton)->SetBitmapMargins(0, 5);
239 wxApp::s_macExitMenuItemId = XRCID(
"action_exit_preview");
241 wxMenuBar* simpleMenu=wxXmlResource::Get()->LoadMenuBar(
this,
"preview_simple_menu");
248 SetMenuBar(simpleMenu);
254 XRCCTRL(*
this,
"preview_background", wxColourPickerCtrl)->Refresh();
255 XRCCTRL(*
this,
"preview_background", wxColourPickerCtrl)->Update();
259 wxPanel * toggle_panel =
new wxPanel(
this);
261 bool overview_hidden;
262 cfg->Read(
"/GLPreviewFrame/overview_hidden", &overview_hidden,
false);
263 GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->Check(!overview_hidden);
266 new wxStaticBox(toggle_panel, -1, _(
"displayed images")),
270 m_ButtonPanel =
new wxScrolledWindow(toggle_panel, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
277 wxPanel *panel =
new wxPanel(toggle_panel);
278 wxBitmapBundle bitmapBundle=wxBitmapBundle::FromSVGFile(
huginApp::Get()->GetXRCPath() +
"data/preview_show_all.svg", wxSize(32, 32));
285 long mode = cfg->Read(
"/GLPreviewFrame/SelectAllMode", 0l);
312 bitmapBundle=wxBitmapBundle::FromSVGFile(
huginApp::Get()->GetXRCPath() +
"data/preview_show_none.svg", wxSize(32, 32));
313 wxButton* select_none =
new wxButton(panel,
ID_SHOW_NONE, _(
"None"));
314 select_none->SetBitmap(bitmapBundle, wxLEFT);
315 select_none->SetBitmapMargins(5,0);
318 wxBoxSizer *sizer =
new wxBoxSizer(wxHORIZONTAL);
319 sizer->Add(
m_selectAllButton,0,wxALIGN_CENTER_VERTICAL | wxLEFT | wxTOP | wxBOTTOM,5);
320 sizer->Add(select_none,0,wxALIGN_CENTER_VERTICAL | wxRIGHT | wxTOP | wxBOTTOM,5);
321 panel->SetSizer(sizer);
325 m_topsizer->Add(tool_panel, 0, wxEXPAND | wxALL, 2);
326 m_topsizer->Add(toggle_panel, 0, wxEXPAND | wxBOTTOM, 5);
334 wxPanel * vis_panel =
new wxPanel(
this);
336 wxPanel * preview_panel =
new wxPanel(vis_panel);
337 wxPanel * overview_panel =
new wxPanel(vis_panel);
340 int args[] = {WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0};
348 overview_hidden=
false;
354 m_mgr->SetManagedWindow(vis_panel);
355 vis_panel->SetMinSize(wxSize(200,150));
358 wxFlexGridSizer * flexSizer =
new wxFlexGridSizer(2,0,5,5);
359 flexSizer->AddGrowableCol(0);
360 flexSizer->AddGrowableRow(0);
363 wxBoxSizer * overview_sizer =
new wxBoxSizer(wxVERTICAL);
374 wxDefaultPosition, wxDefaultSize,
375 wxSL_VERTICAL | wxSL_AUTOTICKS,
381 m_VFOVSlider->SetToolTip(_(
"drag to change the vertical field of view"));
382 m_VFOVSlider->Bind(wxEVT_SCROLL_CHANGED, [
this](wxScrollEvent& e) {
389 m_VFOVSlider->Bind(wxEVT_SCROLL_THUMBRELEASE, [
this](wxScrollEvent& e) {
396 m_VFOVSlider->Bind(wxEVT_SCROLL_THUMBTRACK, [
this](wxScrollEvent& e) {
412 wxDefaultPosition, wxDefaultSize,
413 wxSL_HORIZONTAL | wxSL_AUTOTICKS,
420 m_HFOVSlider->SetToolTip(_(
"drag to change the horizontal field of view"));
421 m_HFOVSlider->Bind(wxEVT_SCROLL_CHANGED, [
this](wxScrollEvent& e) {
428 m_HFOVSlider->Bind(wxEVT_SCROLL_THUMBRELEASE, [
this](wxScrollEvent& e) {
435 m_HFOVSlider->Bind(wxEVT_SCROLL_THUMBTRACK, [
this](wxScrollEvent& e) {
447 m_HFOVText = XRCCTRL(*
this,
"pano_text_hfov" ,wxTextCtrl);
451 m_VFOVText = XRCCTRL(*
this,
"pano_text_vfov" ,wxTextCtrl);
456 m_ROILeftTxt = XRCCTRL(*
this,
"pano_val_roi_left", wxTextCtrl);
461 m_ROIRightTxt = XRCCTRL(*
this,
"pano_val_roi_right", wxTextCtrl);
466 m_ROITopTxt = XRCCTRL(*
this,
"pano_val_roi_top", wxTextCtrl);
471 m_ROIBottomTxt = XRCCTRL(*
this,
"pano_val_roi_bottom", wxTextCtrl);
479 int guide=cfg->Read(
"/GLPreviewFrame/guide",0l);
499 cfg->Read(
"/GLPreviewFrame/showPreviewGrid",&showGrid,
true);
500 GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->Check(showGrid);
502 preview_panel->SetSizer(flexSizer);
503 overview_panel->SetSizer(overview_sizer);
505 m_mgr->AddPane(preview_panel,
510 ).CaptionVisible(
false
511 ).Caption(_(
"Preview")
518 m_mgr->AddPane(overview_panel,
524 ).Caption(_(
"Overview")
525 ).FloatingSize(100,100
526 ).FloatingPosition(500,500
530 ).Show(!overview_hidden
549 for (
auto& lensType : lensInfoVector)
552 const int lensId = lensType.id;
553 Bind(wxEVT_MENU, [
this, lensId](wxCommandEvent&) {
LoadImages(lensId); }, lensTypeId);
592 int nP = panoProjectionFormatCount();
593 for(
int n=0; n < nP; n++) {
594 pano_projection_features proj;
595 if (panoProjectionFeaturesQuery(n, &proj)) {
596 wxString str2(proj.name, wxConvLocal);
617 cfg->Read(
"/GLPreviewFrame/individualDragMode", &individualDrag,
false);
681 wxArtProvider::GetBitmap(wxART_REDO));
682 resetProjButton->SetToolTip(_(
"Resets the projection's parameters to their default values."));
684 m_projParamSizer->Add(resetProjButton, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5);
690 for (
int i=0; i < PANO_PROJECTION_MAX_PARMS; i++) {
692 wxBoxSizer* paramBoxSizer =
new wxBoxSizer(wxVERTICAL);
699 wxDefaultPosition, wxSize(35,-1), wxTE_PROCESS_ENTER);
717 wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL ,
732 wxIconBundle myIcons(
huginApp::Get()->GetXRCPath() +
"data/hugin.ico",wxBITMAP_TYPE_ICO);
735 wxIcon myIcon(
huginApp::Get()->GetXRCPath() +
"data/hugin.png",wxBITMAP_TYPE_PNG);
745 this->SetBackgroundColour(
m_GLPreview->GetBackgroundColour());
749 m_degDigits = wxConfigBase::Get()->Read(
"/General/DegreeFractionalDigitsEdit",3);
760 Bind(wxEVT_MENU_CLOSE, [
this](wxMenuEvent& e) {
m_GLPreview->Refresh(); e.Skip();});
798 if (cfg->Read(
"/GLPreviewFrame/isShown", 0l) != 0)
800 #if defined __WXMSW__ || defined __WXMAC__
809 #if defined __WXMAC__
824 wxString OpenGLLayout=wxConfig::Get()->Read(
"/GLPreviewFrame/OpenGLLayout");
825 if(!OpenGLLayout.IsEmpty())
827 m_mgr->LoadPerspective(OpenGLLayout,
true);
829 if(!GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked())
831 wxAuiPaneInfo &inf =
m_mgr->GetPane(
"overview");
849 wxConfigBase * cfg = wxConfigBase::Get();
853 if ( (!this->IsIconized()) && (! this->IsMaximized()) && this->IsShown()) {
854 cfg->Write(
"/GLPreviewFrame/isShown", 1l);
856 cfg->Write(
"/GLPreviewFrame/isShown", 0l);
860 cfg->Write(
"/GLPreviewFrame/OpenGLLayout",
m_mgr->SavePerspective());
861 cfg->Write(
"/GLPreviewFrame/overview_hidden", !(GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked()));
862 cfg->Write(
"/GLPreviewFrame/showPreviewGrid", GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->IsChecked());
920 for (
int i=0; i < PANO_PROJECTION_MAX_PARMS; i++)
1037 if (opts.
getROI().area() > 0)
1040 wxString labelAspectRatio;
1043 labelAspectRatio = wxString::Format(
"%d:%d", opts.
getROI().width() / commonDivisor, opts.
getROI().height() / commonDivisor);
1047 const float ratio = 1.0f * opts.
getROI().width() / opts.
getROI().height();
1050 labelAspectRatio=wxString::Format(
"%.2f:1", ratio);
1054 labelAspectRatio=wxString::Format(
"1:%.2f", 1.0f / ratio);
1057 XRCCTRL(*
this,
"crop_aspect_label", wxStaticText)->SetLabel(labelAspectRatio);
1069 XRCCTRL(*
this,
"ass_status_text", wxStaticText)->
SetLabel(_(
"No images loaded."));
1073 bool enableCreate =
false;
1078 if (img.getYaw() != 0.0 || img.getPitch() != 0.0 || img.getRoll() != 0.0)
1080 enableCreate =
true;
1086 if (lastCmd ==
"add images" || lastCmd ==
"add and distribute images")
1088 enableCreate =
false;
1095 enableCreate =
true;
1099 enableCreate =
true;
1103 enableCreate =
true;
1114 wxString alignMsg = wxString::Format(_(
"%lu images are connected by %lu control points.\n"), (
unsigned long int) pano.
getNrOfImages(), (
unsigned long int) pano.
getCtrlPoints().size());
1121 if (comps.size() > 1)
1123 alignMsg += wxString::Format(_(
"%lu unconnected image groups found: %s\n"), static_cast<unsigned long int>(comps.size()),
Components2Str(comps).c_str());
1129 alignMsg += _(
"Images or control points have changed, new alignment is needed.");
1140 alignMsg = alignMsg + wxString::Format(_(
"Mean error after optimization: %.1f pixel, max: %.1f"), mean, max);
1145 wxStaticText* statusCtrl = XRCCTRL(*
this,
"ass_status_text", wxStaticText);
1146 statusCtrl->SetLabel(alignMsg);
1147 statusCtrl->InvalidateBestSize();
1155 XRCCTRL(*
this,
"ass_status_text", wxStaticText)->SetLabel(_(
"One image loaded."));
1166 wxString projection;
1192 bool relayout =
false;
1200 for (i=0; i < nParam; i++) {
1201 const pano_projection_parameter * pp = & (opts.
m_projFeatures.parm[i]);
1202 wxString str2(pp->name, wxConvLocal);
1203 str2 = wxGetTranslation(str2);
1207 for(;i < PANO_PROJECTION_MAX_PARMS; i++) {
1221 assert((
int) params.size() == nParam);
1222 for (
int i=0; i < nParam; i++) {
1232 SetStatusText(wxString::Format(
"%.1f x %.1f", opts.
getHFOV(), opts.
getVFOV()),2);
1237 m_HFOVText->ChangeValue(wxString(val.c_str(), wxConvLocal));
1239 m_VFOVText->ChangeValue(wxString(val.c_str(), wxConvLocal));
1244 XRCCTRL(*
this,
"preview_autocrop_tool",wxButton)->Enable(activeImgs);
1245 XRCCTRL(*
this,
"preview_stack_autocrop_tool",wxButton)->Enable(activeImgs);
1264 GetMenuBar()->Enable(XRCID(
"action_optimize"), nrImages > 0);
1269 for (
int i=nrButtons-1; i>=(int)nrImages; i--)
1312 if ( nrImages >= nrButtons ) {
1313 for(HuginBase::UIntSet::const_iterator it = changed.begin(); it != changed.end(); ++it){
1314 if (*it >= nrButtons) {
1320 wxBoxSizer * siz =
new wxBoxSizer(wxVERTICAL);
1322 wxToggleButton * but =
new wxToggleButton(pan,
1324 wxString::Format(
" %d ",*it),
1325 wxDefaultPosition, wxDefaultSize,
1329 wxCheckBox *butcheck =
new wxCheckBox(pan, wxID_ANY, wxEmptyString);
1331 #if defined __WXMSW__ || defined __WXMAC__
1335 siz->Add(butcheck, 0, wxALIGN_CENTRE_HORIZONTAL | wxFIXED_MINSIZE, 0);
1336 siz->Add(but,0,wxLEFT | wxRIGHT | wxBOTTOM , 5);
1338 siz->Add(but,0,wxALL ,0);
1339 siz->Add(butcheck, 0, wxALL | wxFIXED_MINSIZE, 0);
1349 but->PushEventHandler(event_handler);
1359 butcheck->PushEventHandler(group_event_handler);
1362 but->SetValue(
true);
1377 for (
unsigned i=0; i < nrImages; i++) {
1421 bool toggle_on = GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked();
1422 wxAuiPaneInfo &inf =
m_mgr->GetPane(
"overview");
1425 if (!inf.IsShown() && toggle_on ) {
1430 if (inf.IsFloating() && inf.IsShown()) {
1449 if (GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked()) {
1469 if (GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked()) {
1490 bool toggle_on = GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked();
1491 wxAuiPaneInfo &inf =
m_mgr->GetPane(
"overview");
1493 if (inf.IsShown() && !toggle_on) {
1497 }
else if (!(inf.IsShown() && toggle_on)) {
1499 #if defined __WXMSW__ || defined __WXMAC__
1512 if(GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->IsChecked())
1534 if (event.CanVeto())
1544 if (event.CanVeto())
1560 void PreviewFrame::OnProjectionChanged()
1566 case PanoramaOptions::RECTILINEAR: Ip = _(
"Rectilinear");
break;
1567 case PanoramaOptions::CYLINDRICAL: Ip = _(
"Cylindrical");
break;
1568 case PanoramaOptions::EQUIRECTANGULAR: Ip = _(
"Equirectangular");
break;
1570 opt.projectionFormat = (PanoramaOptions::ProjectionFormat) lt;
1574 DEBUG_DEBUG (
"Projection changed: " << lt <<
":" << Ip )
1637 for (
size_t i = 0; i < stackedImg.size(); ++i)
1642 displayedImgs.insert(*(stackedImg[i].rbegin()));
1645 displayedImgs.insert(*(stackedImg[i].begin()));
1649 displayedImgs.insert(stackedImg[i][stackedImg[i].size() / 2]);
1689 text = XRCCTRL(*
this,
"input_yaw",wxTextCtrl)->GetValue();
1696 text = XRCCTRL(*
this,
"input_pitch",wxTextCtrl)->GetValue();
1703 text = XRCCTRL(*
this,
"input_roll",wxTextCtrl)->GetValue();
1717 text = XRCCTRL(*
this,
"input_x",wxTextCtrl)->GetValue();
1724 text = XRCCTRL(*
this,
"input_y",wxTextCtrl)->GetValue();
1731 text = XRCCTRL(*
this,
"input_z",wxTextCtrl)->GetValue();
1750 DEBUG_INFO (
"target exposure = " << text.mb_str(wxConvLocal) );
1752 if (text != wxEmptyString) {
1754 wxLogError(_(
"Value must be numeric."));
1787 if (!text.IsEmpty())
1792 wxLogError(_(
"Value must be numeric."));
1797 wxLogError(_(
"Value for range compression is outside of valid range."));
1816 for (
int i = 0; i < nParam; i++) {
1819 DEBUG_INFO (
"param " << i <<
": = " << text.mb_str(wxConvLocal) );
1821 if (text != wxEmptyString) {
1823 wxLogError(_(
"Value must be numeric."));
1850 for (
int i = 0; i < nParam; i++)
1855 para[i] = e.GetInt();
1870 for (
int i = 0; i < nParam; i++)
1875 para[i] = e.GetInt();
1921 if (
hugin_utils::HuginMessageBox(_(
"The mosaic/plane mode works only correct for a remapping plane of yaw=0 and pitch=0.\nBut your project has non-zero Tpy and Tpp parameters.\nShould the Tpy and Tpp parameters reset to zero?"),
1922 _(
"Hugin"), wxYES_NO | wxICON_QUESTION,
this) == wxYES)
1956 for (
size_t i = 0 ; i < nr; i++)
1972 for (
size_t i = 0 ; i < nr ; i++)
1975 img.setTranslationPlaneYaw(0);
1976 img.setTranslationPlanePitch(0);
2012 if (
hugin_utils::HuginMessageBox(_(
"The mosaic/plane mode works only correct for a remapping plane of yaw=0 and pitch=0.\nBut your project has non-zero Tpy and Tpp parameters.\nShould the Tpy and Tpp parameters reset to zero?"),
2013 _(
"Hugin"), wxYES_NO | wxICON_QUESTION,
this) == wxYES)
2066 bool normalMode=index==0 || index==1;
2067 XRCCTRL(*
this,
"label_yaw",wxStaticText)->Show(normalMode);
2068 XRCCTRL(*
this,
"input_yaw",wxTextCtrl)->Show(normalMode);
2069 XRCCTRL(*
this,
"label_pitch",wxStaticText)->Show(normalMode);
2070 XRCCTRL(*
this,
"input_pitch",wxTextCtrl)->Show(normalMode);
2071 XRCCTRL(*
this,
"label_roll",wxStaticText)->Show(normalMode);
2072 XRCCTRL(*
this,
"input_roll",wxTextCtrl)->Show(normalMode);
2073 XRCCTRL(*
this,
"label_x",wxStaticText)->Show(!normalMode);
2074 XRCCTRL(*
this,
"input_x",wxTextCtrl)->Show(!normalMode);
2075 XRCCTRL(*
this,
"label_y",wxStaticText)->Show(!normalMode);
2076 XRCCTRL(*
this,
"input_y",wxTextCtrl)->Show(!normalMode);
2077 XRCCTRL(*
this,
"label_z",wxStaticText)->Show(!normalMode);
2078 XRCCTRL(*
this,
"input_z",wxTextCtrl)->Show(!normalMode);
2080 XRCCTRL(*
this,
"apply_num_transform",wxButton)->GetParent()->Layout();
2150 SetStatusText(message, 0);
2181 if(GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->IsChecked())
2210 if(GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->IsChecked())
2247 SetStatusText(wxEmptyString, 0);
2278 SetStatusText(wxEmptyString, 0);
2297 std::set<Tool*>::iterator i;
2298 for (i = tools.begin(); i != tools.end(); ++i)
2319 XRCCTRL(*
this,
"preview_control_point_tool",wxCheckBox)->SetValue(
false);
2329 unsigned char green,
2334 #if defined __WXMSW__ || defined __WXMAC__
2335 if (red || green || blue)
2349 if (red || green || blue)
2353 m_ToggleButtons[image_nr]->SetBackgroundColour(wxColour(red, green, blue));
2374 for (
unsigned image = 0; image < nr_images; image++)
2376 #if defined __WXMSW__ || defined __WXMAC__
2391 SetStatusText(wxEmptyString, 0);
2394 if (!XRCCTRL(*
this,
"preview_control_point_tool", wxCheckBox)->GetValue())
2419 wxCommandEvent e(wxEVT_TOGGLEBUTTON);
2427 SetStatusText(wxEmptyString, 0);
2439 if (!XRCCTRL(*
this,
"preview_control_point_tool", wxCheckBox)->GetValue())
2449 unsigned int image_number_in,
2450 wxToggleButton* identify_button_in,
2471 std::vector<PreviewIdentifyTool**>::iterator it;
2487 std::vector<PreviewIdentifyTool**>::iterator it;
2489 (*(*it))->StopShowingImages();
2502 wxMouseEvent null_event;
2503 if (e.IsChecked()) {
2523 : image_number(image_number), frame(frame_in), m_pano(m_pano)
2540 std::vector<PreviewIdentifyTool**>::iterator it;
2553 std::vector<PreviewIdentifyTool**>::iterator it;
2555 (*(*it))->StopShowingImages();
2563 wxMouseEvent null_event;
2564 if (e.IsChecked()) {
2592 if (update_check_box) {
2598 if (update_check_box) {
2604 std::vector<wxCheckBox*>::iterator it;
2605 unsigned int nr = 0;
2615 std::vector<wxCheckBox*>::iterator it;
2617 (*it)->SetValue(
false);
2623 std::vector<wxCheckBox*>::iterator it;
2626 (*it)->Show(isShown);
2641 unsigned int oldMode = wxConfigBase::Get()->Read(
"/GLPreviewFrame/blendMode", 0l);
2659 vigra::Rect2D newROI;
2671 if(!newROI.isEmpty())
2689 vigra::Rect2D newROI;
2697 if (stackImgs.size()<activeImages.size())
2699 cropPano.setStacks(stackImgs);
2702 if (cropPano.hasRunSuccessfully())
2704 newROI = cropPano.getResultOptimalROI();
2709 if(!newROI.isEmpty())
2727 vigra::Rect2D newROI;
2739 if (!newROI.isEmpty())
2751 ShowFullScreen(!IsFullScreen(), wxFULLSCREEN_NOBORDER | wxFULLSCREEN_NOCAPTION);
2758 SetStatusText(wxEmptyString, 0);
2780 XRCCTRL(*
this,
"preview_control_point_tool",wxCheckBox)->SetValue(
false);
2808 std::vector<wxCheckBox*>::iterator it;
2821 wxScrollEvent dummy;
2858 std::vector<wxCheckBox*>::iterator it;
2893 long left, right, top, bottom;
2895 wxLogError(_(
"Top needs to be an integer bigger than 0"));
2899 wxLogError(_(
"left needs to be an integer bigger than 0"));
2903 wxLogError(_(
"right needs to be an integer bigger than 0"));
2907 wxLogError(_(
"bottom needs to be an integer bigger than 0"));
2910 opt.
setROI(vigra::Rect2D(left, top, right, bottom));
2912 if(opt.
getROI().width()<1) {
2913 wxLogError(_(
"left boundary must be smaller than right"));
2918 if(opt.
getROI().height()<1) {
2919 wxLogError(_(
"top boundary must be smaller than bottom"));
2940 if (dlg.ShowModal() == wxID_OK)
2945 int left = opt.
getROI().left();
2946 int top = opt.
getROI().top();
2947 int width = opt.
getROI().width();
2948 int height = opt.
getROI().height();
2949 const int newHeight = 1.0 * width / aspectRatio;
2950 if (newHeight > height)
2952 const int newWidth = 1.0 * height * aspectRatio;
2953 left = left + (width - newWidth) / 2.0;
2958 top = top + (height - newHeight) / 2.0;
2962 opt.
setROI(vigra::Rect2D(left, top, left + width, top + height));
2973 DEBUG_INFO (
"HFOV = " << text.mb_str(wxConvLocal) );
2974 if (text == wxEmptyString) {
2980 wxLogError(_(
"Value must be numeric."));
2985 wxLogError(wxString::Format(
2986 _(
"Invalid HFOV value. Maximum HFOV for this projection is %lf."),
3004 DEBUG_INFO (
"VFOV = " << text.mb_str(wxConvLocal) );
3005 if (text == wxEmptyString) {
3011 wxLogError(_(
"Value must be numeric."));
3016 wxLogError(wxString::Format(
3017 _(
"Invalid VFOV value. Maximum VFOV for this projection is %lf."),
3034 double scale_factor=XRCCTRL(*
this,
"layout_scale_slider",wxSlider)->GetValue();
3047 double maxfov = hfov > vfov ? hfov : vfov;
3050 bool rectilinear_option =
false;
3053 if (maxfov > 120.0) {
3055 message = _(
"With a wide field of view, panoramas with rectilinear projection get very stretched towards the edges.\n");
3057 message += _(
"Since the field of view is only very wide in the horizontal direction, try a cylindrical projection instead.");
3059 message += _(
"For a very wide panorama, try equirectangular projection instead.");
3062 message += _(
"You could also try Panini projection.");
3067 message = _(
"With a wide vertical field of view, panoramas with cylindrical projection get very stretched at the top and bottom.\nAn equirectangular projection would fit the same content in less vertical space.");
3068 }
else rectilinear_option =
true;
3071 if (vfov < 110.0 && hfov > 120.0)
3073 message = _(
"Since the vertical field of view is not too wide, you could try setting the panorama projection to cylindrical.\nCylindrical projection preserves vertical lines, unlike equirectangular.");
3074 }
else rectilinear_option =
true;
3077 if (maxfov < 280.0) {
3078 rectilinear_option =
true;
3079 message = _(
"Stereographic projection is conformal, unlike this Fisheye panorama projection.\nA conformal projection preserves angles around a point, which often makes it easier on the eye.");
3083 if (maxfov > 300.0) {
3084 message = _(
"Panoramas with stereographic projection and a very wide field of view stretch the image around the edges a lot.\nThe Fisheye panorama projection compresses it, so you can fit in a wide field of view and still have a reasonable coverage of the middle.");
3085 }
else rectilinear_option =
true;
3088 rectilinear_option =
true;
3090 if (rectilinear_option && maxfov < 110.0) {
3091 message = _(
"Setting the panorama to rectilinear projection would keep the straight lines straight.");
3093 if (message.IsEmpty()) {
3097 m_infoBar->ShowMessage(message, wxICON_INFORMATION);
3112 hugin_utils::HuginMessageBox(_(
"You have hidden the infobar, which shows hints about selection of projection.\nIf you want to see the bar again, activate the bar in the preferences again."),
3113 _(
"Hugin"), wxOK | wxICON_INFORMATION,
this);
3114 wxConfigBase* cfg=wxConfigBase::Get();
3115 cfg->Write(
"/GLPreviewFrame/ShowProjectionHints",
false);
3140 wxConfigBase* cfg=wxConfigBase::Get();
3141 cfg->Write(
"/GLPreviewFrame/PreviewBackground", c);
3157 int selection=e.GetSelection();
3170 if(old_selection==wxNOT_FOUND)
3195 wxCommandEvent dummy;
3218 wxApp::s_macExitMenuItemId = XRCID(
"action_exit_preview");
3222 GetMenuBar()->Remove(0);
3230 wxApp::s_macExitMenuItemId = XRCID(
"action_exit_hugin");
3234 GetMenuBar()->Remove(0);
3237 SetTitle(_(
"Fast Panorama preview"));
3244 GetMenuBar()->FindItem(XRCID(
"action_gui_simple"))->Check();
3247 GetMenuBar()->FindItem(XRCID(
"action_gui_advanced"))->Check();
3250 GetMenuBar()->FindItem(XRCID(
"action_gui_expert"))->Check();
3292 if (wxConfig::Get()->Read(
"/ShowFisheyeCropHint", 1l) == 1)
3296 wxXmlResource::Get()->LoadDialog(&dlg, NULL,
"fisheye_show_crop_dlg");
3297 if (dlg.ShowModal() == wxID_OK)
3301 if (XRCCTRL(dlg,
"fisheye_crop_dont_ask_checkbox", wxCheckBox)->IsChecked())
3303 wxConfig::Get()->Write(
"/ShowFisheyeCropHint", 0l);
3328 const long autoAlign = wxConfigBase::Get()->Read(
"/Assistant/autoAlign",
HUGIN_ASS_AUTO_ALIGN);
3332 wxCommandEvent dummy;
3337 std::vector<PanoCommand::PanoCommand*> cmds;
3338 cmds.push_back(cmd);
3339 if(distributeImages)
3345 combinedCmd->
setName(
"add and distribute images");
3352 HuginBase::FileMetaData::const_iterator pos = metaData.find(
"readProjectionFromDB");
3353 if(!(pos != metaData.end() && pos->second ==
"true"))
3370 if(dlg.ShowModal()==wxID_OK)
3375 wxCommandEvent dummy;
3386 long afterEditCPAction = wxConfig::Get()->Read(
"/EditCPAfterAction", 0l);
3388 if (afterEditCPAction == 0)
3391 wxXmlResource::Get()->LoadDialog(&dlg,
this,
"edit_cp_optimize_dialog");
3392 XRCCTRL(dlg,
"edit_cp_text1", wxStaticText)->SetLabel(wxString::Format(_(
"%lu control points were removed from the panorama.\n\nShould the panorama now be re-optimized?"), static_cast<unsigned long int>(
edit_cp_tool->
GetFoundCPs().size())));
3393 XRCCTRL(dlg,
"edit_cp_text2", wxStaticText)->SetLabel(wxString::Format(_(
"Current selected optimizer strategy is \"%s\"."),
MainFrame::Get()->GetCurrentOptimizerString().c_str()));
3395 optimize = (dlg.ShowModal() == wxID_OK);
3396 if (XRCCTRL(dlg,
"edit_cp_dont_show_again_checkbox", wxCheckBox)->GetValue())
3400 wxConfig::Get()->Write(
"/EditCPAfterAction", 1l);
3404 wxConfig::Get()->Write(
"/EditCPAfterAction", 2l);
3410 optimize = (afterEditCPAction == 1);
3415 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"action_optimize"));
3422 #define MAX_DIMENSION 1600
3443 hugin_utils::HuginMessageBox(_(
"The selected region contains no active image.\nPlease select a region which is covered by at least 2 images."),
3444 _(
"Hugin"), wxOK | wxICON_INFORMATION,
this);
3447 if (imgs.size() < 2)
3449 hugin_utils::HuginMessageBox(_(
"The selected region is only covered by a single image.\nCan't create control points for a single image."),
3450 _(
"Hugin"), wxOK | wxICON_INFORMATION,
this);
3455 if (
hugin_utils::HuginMessageBox(_(
"The selected rectangle is very big.\nThis function is only intended for smaller areas. Otherwise unwanted side effect can appear.\n\nProceed anyway?"),
3456 _(
"Hugin"), wxYES_NO | wxICON_INFORMATION,
this) == wxNO)
3479 for (HuginBase::UIntSet::const_iterator it = imgs.begin(); it != imgs.end(); ++it)
3481 const size_t imgNr = *it;
3482 if (!progress.updateDisplayValue(_(
"Remap image to panorama projection...")))
3487 findStruct.
imgNr = imgNr;
3494 srcImg.setExposureValue(0);
3497 if (!progress.updateDisplay())
3505 cpInfos.push_back(findStruct);
3507 if (cpInfos.size() > 1)
3511 unsigned gridx =
hugin_utils::roundi(sqrt((
double)roi.width() / (double)roi.height() * 25));
3521 while (roi.width() / gridx < 20 && gridx > 1)
3525 while (roi.height() / gridy < 20 && gridy > 1)
3530 const long templWidth = 20;
3532 const long sWidth = 100;
3534 for (
size_t img1 = 0; img1 < cpInfos.size() - 1; ++img1)
3536 if (!progress.updateDisplayValue(_(
"Matching interest points...")))
3540 vigra::Size2D size(cpInfos[img1].image.width(), cpInfos[img1].image.height());
3542 std::vector<vigra::Rect2D> rects;
3543 for (
unsigned party = 0; party < gridy; party++)
3545 for (
unsigned partx = 0; partx < gridx; partx++)
3547 vigra::Rect2D rect(partx*size.x / gridx, party*size.y / gridy,
3548 (partx + 1)*size.x / gridx, (party + 1)*size.y / gridy);
3549 rect &= vigra::Rect2D(size);
3550 if (rect.width()>0 && rect.height()>0)
3552 rects.push_back(rect);
3557 if (!progress.updateDisplay())
3562 #pragma omp parallel for schedule(dynamic)
3563 for (
int i = 0; i < rects.size(); ++i)
3566 vigra::Rect2D rect(rects[i]);
3570 MapPoints validPoints;
3571 for (MapPoints::const_iterator it = points.begin(); it != points.end(); ++it)
3573 if (cpInfos[img1].mask(it->second.x, it->second.y)>0)
3575 validPoints.insert(*it);
3579 if (!validPoints.empty())
3582 for (
size_t img2 = img1 + 1; img2 < cpInfos.size(); ++img2)
3586 for (MapPoints::const_reverse_iterator it = validPoints.rbegin(); it != validPoints.rend(); ++it)
3594 if (cpInfos[img2].mask(it->second.x, it->second.y) == 0)
3600 cpInfos[img2].image, vigra::RGBToGrayAccessor<vigra::RGBValue<vigra::UInt8> >(), it->second, sWidth);
3617 cpInfos[img1].image.resize(0, 0);
3618 cpInfos[img1].mask.resize(0, 0);
3622 for (
size_t i = 0; i < tempCps.size(); ++i)
3655 if (!progress.updateDisplayValue(_(
"Checking results...")))
3662 if (!invalidCP.empty())
3664 for (HuginBase::UIntSet::const_reverse_iterator it = invalidCP.rbegin(); it != invalidCP.rend(); ++it)
3666 cps.erase(cps.begin() + *it);
3670 if (!progress.updateDisplayValue())
3676 long afterEditCPAction = wxConfig::Get()->Read(
"/EditCPAfterAction", 0l);
3678 if (afterEditCPAction == 0)
3683 wxXmlResource::Get()->LoadDialog(&dlg,
this,
"edit_cp_optimize_dialog");
3684 XRCCTRL(dlg,
"edit_cp_text1", wxStaticText)->SetLabel(wxString::Format(_(
"%lu control points were added to the panorama.\n\nShould the panorama now be re-optimized?"), static_cast<unsigned long int>(cps.size())));
3685 XRCCTRL(dlg,
"edit_cp_text2", wxStaticText)->SetLabel(wxString::Format(_(
"Current selected optimizer strategy is \"%s\"."),
MainFrame::Get()->GetCurrentOptimizerString().c_str()));
3687 optimize = (dlg.ShowModal() == wxID_OK);
3688 if (XRCCTRL(dlg,
"edit_cp_dont_show_again_checkbox", wxCheckBox)->GetValue())
3692 wxConfig::Get()->Write(
"/EditCPAfterAction", 1l);
3696 wxConfig::Get()->Write(
"/EditCPAfterAction", 2l);
3702 optimize = (afterEditCPAction == 1);
3707 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"action_optimize"));
3720 wxConfig::Get()->Write(
"/GLPreviewFrame/SelectAllMode", 0l);
3726 wxConfig::Get()->Write(
"/GLPreviewFrame/SelectAllMode", 1l);
3732 wxConfig::Get()->Write(
"/GLPreviewFrame/SelectAllMode", 2l);
3738 wxConfig::Get()->Write(
"/GLPreviewFrame/SelectAllMode", 3l);
3744 wxConfig::Get()->Write(
"/GLPreviewFrame/SelectAllKeepSelection",
true);
3750 wxConfig::Get()->Write(
"/GLPreviewFrame/SelectAllKeepSelection",
false);
HuginBase::UIntSet GetDragGroupImages()
AlphaImage m_mask
corresponding alpha channel
Base class for all panorama commands.
wxTextCtrl * m_rangeCompressionTextCtrl
PlaneOverviewCameraTool * plane_overview_camera_tool
SelectAllMode m_selectAllMode
HuginBase::Panorama & m_pano
int gcd(int a, int b)
function to calculate greated common divisor using Euclidean algorithm both arguments should be >=0 ...
PanoramaOptions::ProjectionFormat getProjection() const
#define HUGIN_SHOW_PROJECTION_HINTS
void OnRangeCompressionDecrease(wxSpinEvent &e)
std::vector< UIntSet > getHDRStacks(const PanoramaData &pano, UIntSet allImgs, PanoramaOptions opts)
returns vector of set of output stacks
wxSpinButton * m_exposureSpinBut
update variables of a group of images
declaration of functions to handle stacks and layers
std::vector< wxToggleButton * > m_ToggleButtons
void OnRemoveCP(wxCommandEvent &e)
handler to remove cp
PreviewCropTool * crop_tool
void OnControlPoint(wxCommandEvent &e)
PreviewDifferenceTool * panosphere_difference_tool
double outputRangeCompression
void OnCreate(wxCommandEvent &e)
wxGLContext * GetContext()
PreviewIdentifyTool * identify_tool
void SetStatusMessage(wxString message)
The OpenGL preview frame.
virtual PanoCommand::PanoCommand * GetCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
returns the appropriate PanoCommand::PanoCommand to be inserted into GlobalCmdHistory, checks if operation is enabled
void setHeight(unsigned int h)
set panorama height
void OnIdentify(wxCommandEvent &e)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
pano_projection_features m_projFeatures
wxChoice * m_DragModeChoice
wxColour GetPreviewBackgroundColor()
void OnShowAll(wxCommandEvent &e)
void StorePositionAndSize()
store position and size of window in wxConfig
#define HUGIN_PREVIEW_BACKGROUND
virtual double getResultMean()
void setPanoImage(const SrcPanoImage &src, const PanoramaOptions &dest, vigra::Rect2D roi)
static double calcMeanExposure(const PanoramaData &pano)
bool str2double(const wxString &s, double &d)
void AddUserDefinedAssistant(int id, const wxString &desc, const wxString &help)
adds the given user defined assistant to SplitButton menu
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
SrcPanoImage getSrcImage(unsigned imgNr) const
get a description of a source image
PreviewDragTool * drag_tool
GLwxAuiFloatingFrame * CreateFloatingFrame(wxWindow *parent, const wxAuiPaneInfo &p)
std::vector< ImageToogleButtonEventHandler * > toogle_button_event_handlers
PanosphereOverviewCameraTool * panosphere_overview_camera_tool
void OnColorPicker(wxCommandEvent &e)
event handler when starting color picker
center panorama horizontically
void ClearDragGroupImages(bool update_check_box=true)
bool isCircularCrop() const
returns true, if projection requires cicular crop
bool fovCalcSupported(ProjectionFormat f) const
true, if FOV calcuations are supported for projection f
bool removeObserver(PanoramaObserver *observer)
remove a panorama observer.
void ToggleImageInDragGroup(unsigned int image_nr, bool update_check_box=true)
void OnVFOVChanged(wxCommandEvent &e)
virtual void SetLayoutScale(double scale)
wxPanel * m_overviewCommandPanel
void OnOverviewToggle(wxCommandEvent &e)
wxTextCtrl * m_ROIRightTxt
void SetPhotometricCorrect(bool state)
SplitButton * m_createButton
CorrelationResult PointFineTune(const IMAGET &templImg, ACCESSORT access_t, vigra::Diff2D templPos, int templSize, const IMAGES &searchImg, ACCESSORS access_s, vigra::Diff2D searchPos, int sWidth)
fine tune a point with normalized cross correlation
void OnDecreaseExposure(wxSpinEvent &e)
wxBitmapButton * m_defaultExposureBut
void RunAssistant(wxWindow *mainWin, const wxString &userdefinedAssistant=wxEmptyString)
void registerPTWXDlgFcn()
void OnSwitchPreviewGrid(wxCommandEvent &e)
event handler for switch on/off grid on preview
unsigned int getHeight() const
get panorama height
void SetActive(bool active)
UIntSet getImagesinROI(const PanoramaData &pano, const UIntSet activeImages)
returns set of images which are visible in output ROI
void OnShowMainFrame(wxCommandEvent &e)
event handler to show main frame
void Resized(wxSizeEvent &e)
double getMaxHFOV() const
get maximum possible hfov with current projection
wxColour m_preview_background_color
virtual void setName(const std::string &newName)
sets the name for the command
PreviewLayoutLinesTool * m_plane_layoutLinesTool
std::vector< wxCheckBox * > m_GroupToggleButtons
void AddImageToDragGroup(unsigned int image_nr, bool update_check_box=true)
void deregisterPTWXDlgFcn()
Dialog for setting output parameters for simple user interface.
wxChoice * m_ProjectionChoice
std::size_t getNrOfCtrlPoints() const
number of control points
bool set_contains(const _Container &c, const typename _Container::key_type &key)
#define DEBUG_ASSERT(cond)
PreviewIdentifyTool * plane_overview_identify_tool
void OnSelectDarkestMenu(wxCommandEvent &e)
HuginBase::ImageCache::ImageCacheRGB8Ptr ImageCacheRGB8Ptr
void setProjectionParameters(const std::vector< double > ¶ms)
set the optional parameters (they need to be of the correct size)
PreviewPanoMaskTool * pano_mask_tool
simple class that forward the drop to the mainframe
include file for the hugin project
int non_layout_blend_mode
void ForceRequireRedraw()
wxNotebook * m_tool_notebook
void InitPreviews()
init previews
virtual void run()
runs the algorithm.
Panorama getSubset(const UIntSet &imgs) const
get a subset of the panorama
const CPVector & getCtrlPoints() const
get all control point of this Panorama
PreviewControlPointTool * preview_control_point_tool
std::vector< wxPanel * > m_ToggleButtonPanel
void UpdateRoiDisplay(const HuginBase::PanoramaOptions opts)
update display of ROI
void OnPhotometric(wxCommandEvent &e)
wxTextCtrl * m_ROILeftTxt
remove several control points
represents a control point
PreviewDifferenceTool * plane_difference_tool
Definition of PanoOperation class.
void CleanButtonColours()
void findInterestPointsPartial(vigra::triple< ImageIter, ImageIter, ImageAcc > img, const vigra::Rect2D &rect, double scale, unsigned nPoints, std::multimap< double, vigra::Diff2D > &points)
void RemoveImageFromDragGroup(unsigned int image_nr, bool update_check_box=true)
wxChoice * m_GuideChoiceCrop
PanosphereOverviewOutlinesTool * overview_outlines_tool
std::vector< HuginBase::UIntSet > Components
stores the components of the graph
std::string doubleToString(double d, int digits)
convert a double to a string, suitable for display within a GUI.
static huginApp * Get()
hack.. kind of a pseudo singleton...
PanosphereSphereTool * panosphere_sphere_tool
void FillBlendChoice()
fills the blend wxChoice with all valid blend modes and restore the last used one ...
void OnActivate(wxActivateEvent &evt)
wxChoice * m_GuideChoiceDrag
PanoCommand to combine other PanoCommands.
Panorama duplicate() const
duplicate the panorama
wxStaticBoxSizer * m_ToggleButtonSizer
void OnSetCropAspect(wxCommandEvent &e)
event handler to set fixed aspect ratio of crop
void OnAutocropOutside(wxCommandEvent &e)
static hugin_omp::Lock cpLock
std::set< unsigned int > UIntSet
GLwxAuiFloatingFrame(wxWindow *parent, GLwxAuiManager *owner_mgr, const wxAuiPaneInfo &pane, wxWindowID id=wxID_ANY, long style=wxRESIZE_BORDER|wxSYSTEM_MENU|wxCAPTION|wxFRAME_FLOAT_ON_PARENT|wxCLIP_CHILDREN)
void OnRemoveImage(wxCommandEvent &e)
void OnDefaultExposure(wxCommandEvent &e)
bool individualDragging()
void OnOverviewModeChoice(wxCommandEvent &e)
algorithms for remove control points by statistic method
void OnProjParameterChanged(wxCommandEvent &e)
HuginBase::PanoramaOptions GetNewPanoramaOptions()
void LoadOpenGLLayout()
loads the layout of the OpenGL windows and restores it
wxChoice * m_ProjectionChoice
const vigra::Rect2D & getROI() const
void SetMode(OverviewMode mode)
wxSpinButton * m_rangeCompressionSpinBut
void OnHFOVChanged(wxCommandEvent &e)
void OnExposureChanged(wxCommandEvent &e)
wxMenu * m_filemenuSimple
wxBoxSizer * m_ButtonSizer
virtual ~GLPreviewFrame()
dtor.
PreviewLayoutLinesTool * m_panosphere_layoutLinesTool
void OnStackAutocrop(wxCommandEvent &e)
GLwxAuiManager * m_mgr
The dock manager.
void MakePreviewTools(PreviewToolHelper *helper)
void SetMode(int newMode)
virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &changed)
notifies about changes to images
VariableMapVector getVariables() const
get variables of this panorama
void OnFullScreen(wxCommandEvent &e)
event handler for full screen
void OnSelectMedianMenu(wxCommandEvent &e)
std::vector< wxSlider * > m_projParamSlider
wxScrolledWindow * m_ButtonPanel
void OnLayoutScaleChange(wxCommandEvent &e)
event handler for change scale of layout mode
void resetProjectionParameters()
sets the optional parameters to their default values
void SetDragGroupImages(HuginBase::UIntSet imageDragGroup_in, bool update_check_box=true)
std::size_t getNrOfImages() const
number of images.
static MainFrame * Get()
hack.. kind of a pseudo singleton...
remove an image from a panorama
Definition of PanoOutputDialog class.
void AddUserDefinedSequence(int id, const wxString &desc, const wxString &help)
adds the given user defined output sequence to SplitButton menu
void SetGuiLevel(GuiLevel newLevel)
sets the gui level
void setCtrlPoints(const CPVector &points)
set all control points (Ippei: Is this supposed to be 'add' method?)
SplitButton * m_selectAllButton
float pow(float a, double b)
void redrawPreview()
Display an updated version of the preview images.
void remapImage(vigra::triple< ImgIter, ImgIter, ImgAccessor > srcImg, vigra_ext::Interpolator interpol, AppBase::ProgressDisplay *progress, bool singleThreaded=false)
remap a image without alpha channel
PreviewIdentifyTool * panosphere_overview_identify_tool
virtual vigra::Rect2D getResultOptimalROI()
return the ROI structure?, for now area
void OnSelectKeepSelection(wxCommandEvent &e)
wxMenu * m_filemenuAdvanced
RemapImage m_image
remapped image
double getMaxVFOV() const
get maximum possible vfov with current projection
Definition of dialog for selecting and editing aspect ratios of crop.
virtual double getResultMax()
virtual double getResultHeight()
std::vector< FindStruct > FindVector
PanoOperation to add several user selected images to the panorama.
PlaneOverviewOutlinesTool * plane_overview_outlines_tool
std::vector< wxTextCtrl * > m_projParamTextCtrl
Maximum of correlation, position and value.
std::string getLastCommandName() const
returns the name of the last command
wxInfoBar * m_infoBar
Bar for context sensitive projection information.
void OnToolModeChanging(wxNotebookEvent &e)
event handler for blocking changing mode when panorama contains no images
wxToggleButton * m_editCP_togglebutton
wxwindows specific panorama commands
std::map< std::string, std::string > FileMetaData
typedef for general map for storing metadata in files
SplitButton * m_loadImagesButton
std::vector< HuginBase::UIntVector > getSortedStacks(const HuginBase::Panorama *pano)
returns vector of UIntVector with image numbers of each stack sorted by exposure
PreviewControlPointTool * plane_control_point_tool
distributes all images above the sphere, for the assistant
wxPanel * m_projection_panel
void OnRangeCompressionChanged(wxCommandEvent &e)
void SetShowProjectionHints(bool new_value)
set status if projection hints should be shown or not
void UpdateIdentifyTools(std::set< unsigned int > new_image_set)
static GlobalCmdHist & getInstance()
PanosphereOverviewToolHelper * panosphere_overview_helper
virtual void SetLayoutMode(bool state)
std::multimap< double, vigra::Diff2D > MapPoints
void MakePanosphereOverviewTools(PanosphereOverviewToolHelper *helper)
void ShowMaskEditor(size_t imgNr, bool switchToCropMode=false)
opens the mask/crop editor with the given image selected
std::vector< ImageGroupButtonEventHandler * > toggle_group_button_event_handlers
wxToggleButton * m_identify_togglebutton
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
void OnProjectionChoice(wxCommandEvent &e)
PreviewControlPointTool * panosphere_control_point_tool
PanosphereOverviewProjectionGridTool * overview_projection_grid
bool stringToDouble(const STR &str_, double &dest)
convert a string to a double, ignore localisation.
double GetSelectedAspectRatio() const
returns the selected aspect ratio
VisualizationState * m_visualization_state
void EnableGroupCheckboxes(bool isShown)
changes the visibility of the group check boxes
void OnSelectMode(wxNotebookEvent &e)
event handler for selection of new mode
void setROI(const vigra::Rect2D &val)
vigra::triple< typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::ImageConstAccessor > srcImageRange(const ROIImage< Image, Mask > &img)
helper function for ROIImages
void ShowFisheyeCropHint()
void DragChoiceLayout(int index)
void OnSelectBrightestMenu(wxCommandEvent &e)
straighten panorama horizontically
UIntSet getActiveImages() const
get active images
void MakePlaneOverviewTools(PlaneOverviewToolHelper *helper)
#define HUGIN_ASS_AUTO_ALIGN
OverviewDragTool * overview_drag_tool
GLOverview * m_GLOverview
bool m_selectKeepSelection
GLPreviewFrame(wxFrame *frame, HuginBase::Panorama &pano)
ctor.
void OnCenterHorizontally(wxCommandEvent &e)
virtual void SetLayoutScale(double scale)
void OnROIChanged(wxCommandEvent &e)
event handler for changed roi
wxChoice * m_BlendModeChoice
wxBoxSizer * m_projParamSizer
void OnLoadImages(wxCommandEvent &e)
void ShowProjectionWarnings()
Tell the user anything suspicious about the projection choice.
void OnUserExit(wxCommandEvent &e)
user wants to quit program
void setHFOV(double h, bool keepView=true)
set the horizontal field of view.
void OnGuideChanged(wxCommandEvent &e)
event handler when user selects different guide
void OnShowNone(wxCommandEvent &e)
void addObserver(PanoramaObserver *o)
add a panorama observer.
void OnDoStitch(wxCommandEvent &e)
void OnChangeProjectionParam(wxScrollEvent &e)
unsigned int getWidth() const
include file for the hugin project
virtual void SetLayoutMode(bool state)
const PanoramaOptions & getOptions() const
returns the options for this panorama
void OnSelectAllMenu(wxCommandEvent &e)
handle all options of select all context menu
void OnSelectResetSelection(wxCommandEvent &e)
Handle EVT_KILL_FOCUS and convert it to a EVT_TEXT_ENTER event.
virtual double getResultHorizontalFOV()
virtual vigra::Rect2D getResultOptimalROI()
returns the found crop rect
void OnResetCrop(wxCommandEvent &e)
event handler to reset crop area
UIntSet getCPoutsideLimit(Panorama pano, double n, bool skipOptimisation, bool includeLineCp)
optimises the whole panorama and removes all control points with error > mean+n*sigma ...
PreviewToolHelper * preview_helper
wxTextCtrl * m_ROIBottomTxt
Components GetComponents()
find all connected components
subclass for a floating frame of the dock manager
SplitButton * m_alignButton
const std::vector< double > & getProjectionParameters() const
Get the optional projection parameters.
void OnIncreaseExposure(wxSpinEvent &e)
void OnTrackChangeProjectionParam(wxScrollEvent &e)
bool UpdateOverviewMode(int newMode)
updates the mode of the overview window
wxToggleButton * m_colorpicker_togglebutton
void OnRangeCompressionIncrease(wxSpinEvent &e)
bool m_showProjectionHints
void SetOptions(const HuginBase::PanoramaOptions *new_opts)
void OnCreateCP(wxCommandEvent &e)
handler for creating cp in pano space
void OnPreviewBackgroundColorChanged(wxColourPickerEvent &e)
event handler when user changes background color
void SetViewerBackground(wxColour col)
void OnImageContextMenu(wxContextMenuEvent &e)
show context menu on image buttons
void OnDragChoice(wxCommandEvent &e)
hugin_utils::FDiff2D maxpos
PreviewColorPickerTool * color_picker_tool
std::vector< ControlPoint > CPVector
wxFileHistory * GetFileHistory()
void updateBlendMode()
Update tools and GUI elements according to blend mode choice.
bool HasNonZeroTranslationPlaneParameters()
check, if panorama has non-zero translation plane parameters
void OnEditCPTool(wxCommandEvent &e)
event handler when starting edit cp tool
PlaneOverviewToolHelper * plane_overview_helper
PreviewEditCPTool * edit_cp_tool
void OnBlendChoice(wxCommandEvent &e)
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
wxTextCtrl * m_exposureTextCtrl
void OnShowEvent(wxShowEvent &e)
void OnAutocrop(wxCommandEvent &e)
bool needsOptimization()
true if control points or lens variables have been changed after the last optimisation ...
std::vector< wxStaticText * > m_projParamNamesLabel
PreviewProjectionGridTool * preview_projection_grid
void fill_set(_Container &c, typename _Container::key_type begin, typename _Container::key_type end)
update global white balance
customized subclass of the dock manager, created just for the purpose to create a workaround for the ...
void KeyDown(wxKeyEvent &e)
ProjectionFormat
Projection of final panorama.
HuginBase::Panorama & m_pano
void setSrcImage(unsigned int nr, const SrcPanoImage &img)
set input image parameters
PreviewGuideTool * preview_guide_tool
void ResetTranslationPlaneParameters()
resets all translation plane parameters to zero
virtual void panoramaChanged(HuginBase::Panorama &pano)
Notification about a Panorama change.
add multiple control points
wxChoice * m_GuideChoiceProj
PreviewCameraTool * camera_tool
void OnStraighten(wxCommandEvent &e)
All variables of a source image.
void setProjection(ProjectionFormat f)
set the Projection format and adjust the hfov/vfov if nessecary
static ViewState * m_view_state
PreviewLayoutLinesTool * m_preview_layoutLinesTool
void SetZoomLevel(const float new_zoom)
vigra::Size2D getSize() const
get size of output image
void UpdateGlobalWhiteBalance(double redFactor, double blueFactor)
updates the global white balance
void SetImageButtonColour(unsigned int image_nr, unsigned char red, unsigned char green, unsigned char blue)
void ResetPreviewZoom()
reset zoom level for preview window
void OnClose(wxCloseEvent &e)
struct to hold a image state for stitching
wxString Components2Str(const HuginGraph::ImageGraph::Components &comp)
HuginBase::UIntSet imageDragGroup
void OnNumTransform(wxCommandEvent &e)
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
void OnAlign(wxCommandEvent &e)
virtual bool hasRunSuccessfully()
wxChoice * m_OverviewModeChoice
PreviewDifferenceTool * difference_tool
void OnHideProjectionHints(wxCommandEvent &e)
event handler when user hides the infobar
void OnProjParameterReset(wxCommandEvent &e)
event handler for reset projection parameters
void TurnOffTools(std::set< Tool * > tools)
void LoadImages(int preferredLensType)
void KeyUp(wxKeyEvent &e)
void setWidth(unsigned int w, bool keepView=true)
set panorama width keep the HFOV, if keepView=true
double outputExposureValue
void OnFitPano(wxCommandEvent &e)
class to work with images graphs created from a HuginBase::Panorama class it creates a graph based on...