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>
130 EVT_CLOSE(GLPreviewFrame::OnClose)
131 EVT_SHOW(GLPreviewFrame::OnShowEvent)
135 EVT_BUTTON(XRCID("preview_center_tool"), GLPreviewFrame::OnCenterHorizontally)
136 EVT_BUTTON(XRCID("preview_fit_pano_tool"), GLPreviewFrame::OnFitPano)
137 EVT_BUTTON(XRCID("preview_fit_pano_tool2"), GLPreviewFrame::OnFitPano)
138 EVT_BUTTON(XRCID("preview_straighten_pano_tool"), GLPreviewFrame::OnStraighten)
139 EVT_BUTTON(XRCID("apply_num_transform"), GLPreviewFrame::OnNumTransform)
140 EVT_TEXT_ENTER(XRCID("input_yaw"), GLPreviewFrame::OnNumTransform)
141 EVT_TEXT_ENTER(XRCID("input_pitch"), GLPreviewFrame::OnNumTransform)
142 EVT_TEXT_ENTER(XRCID("input_roll"), GLPreviewFrame::OnNumTransform)
143 EVT_TEXT_ENTER(XRCID("input_x"), GLPreviewFrame::OnNumTransform)
144 EVT_TEXT_ENTER(XRCID("input_y"), GLPreviewFrame::OnNumTransform)
145 EVT_TEXT_ENTER(XRCID("input_z"), GLPreviewFrame::OnNumTransform)
148 EVT_CHECKBOX(XRCID("preview_photometric_tool"), GLPreviewFrame::OnPhotometric)
149 EVT_TOGGLEBUTTON(XRCID("preview_identify_toggle_button"), GLPreviewFrame::OnIdentify)
150 EVT_TOGGLEBUTTON(XRCID("preview_color_picker_toggle_button"), GLPreviewFrame::OnColorPicker)
151 EVT_TOGGLEBUTTON(XRCID("preview_edit_cp_toggle_button"), GLPreviewFrame::OnEditCPTool)
152 EVT_CHECKBOX(XRCID("preview_control_point_tool"), GLPreviewFrame::OnControlPoint)
153 EVT_BUTTON(XRCID("preview_autocrop_tool"), GLPreviewFrame::OnAutocrop)
154 EVT_BUTTON(XRCID("preview_stack_autocrop_tool"), GLPreviewFrame::OnStackAutocrop)
155 EVT_BUTTON(XRCID("preview_autocrop_outside_tool"), GLPreviewFrame::OnAutocropOutside)
156 EVT_NOTEBOOK_PAGE_CHANGED(XRCID("mode_toolbar_notebook"), GLPreviewFrame::OnSelectMode)
157 EVT_NOTEBOOK_PAGE_CHANGING(XRCID("mode_toolbar_notebook"), GLPreviewFrame::OnToolModeChanging)
158 EVT_BUTTON(
ID_HIDE_HINTS, GLPreviewFrame::OnHideProjectionHints)
159 EVT_BUTTON(XRCID("exposure_default_button"), GLPreviewFrame::OnDefaultExposure)
160 EVT_SPIN_DOWN(XRCID("exposure_spin"), GLPreviewFrame::OnDecreaseExposure)
161 EVT_SPIN_UP(XRCID("exposure_spin"), GLPreviewFrame::OnIncreaseExposure)
162 EVT_SPIN_DOWN(XRCID("range_compression_spin"), GLPreviewFrame::OnRangeCompressionDecrease)
163 EVT_SPIN_UP(XRCID("range_compression_spin"), GLPreviewFrame::OnRangeCompressionIncrease)
164 EVT_TEXT_ENTER(XRCID("range_compression_text"), GLPreviewFrame::OnRangeCompressionChanged)
165 EVT_CHOICE(XRCID("blend_mode_choice"), GLPreviewFrame::OnBlendChoice)
166 EVT_CHOICE(XRCID("drag_mode_choice"), GLPreviewFrame::OnDragChoice)
167 EVT_CHOICE(XRCID("projection_choice"), GLPreviewFrame::OnProjectionChoice)
168 EVT_CHOICE(XRCID("overview_mode_choice"), GLPreviewFrame::OnOverviewModeChoice)
169 EVT_CHOICE(XRCID("preview_guide_choice_crop"), GLPreviewFrame::OnGuideChanged)
170 EVT_CHOICE(XRCID("preview_guide_choice_drag"), GLPreviewFrame::OnGuideChanged)
171 EVT_CHOICE(XRCID("preview_guide_choice_proj"), GLPreviewFrame::OnGuideChanged)
172 EVT_MENU(XRCID("action_show_overview"), GLPreviewFrame::OnOverviewToggle)
173 EVT_MENU(XRCID("action_show_grid"), GLPreviewFrame::OnSwitchPreviewGrid)
176 EVT_MENU_CLOSE(GLPreviewFrame::OnMenuClose)
179 EVT_SCROLL_CHANGED(GLPreviewFrame::OnChangeFOV)
180 EVT_COMMAND_SCROLL_CHANGED(XRCID("layout_scale_slider"), GLPreviewFrame::OnLayoutScaleChange)
183 EVT_COMMAND_SCROLL(XRCID("layout_scale_slider"), GLPreviewFrame::OnLayoutScaleChange)
184 EVT_SCROLL_CHANGED(GLPreviewFrame::OnChangeFOV)
185 EVT_COMMAND_SCROLL_THUMBTRACK(XRCID("layout_scale_slider"), GLPreviewFrame::OnLayoutScaleChange)
188 EVT_TEXT_ENTER(XRCID("pano_text_hfov"), GLPreviewFrame::OnHFOVChanged )
189 EVT_TEXT_ENTER(XRCID("pano_text_vfov"), GLPreviewFrame::OnVFOVChanged )
190 EVT_TEXT_ENTER(XRCID("pano_val_roi_left"), GLPreviewFrame::OnROIChanged)
191 EVT_TEXT_ENTER(XRCID("pano_val_roi_top"), GLPreviewFrame::OnROIChanged)
192 EVT_TEXT_ENTER(XRCID("pano_val_roi_right"), GLPreviewFrame::OnROIChanged)
193 EVT_TEXT_ENTER(XRCID("pano_val_roi_bottom"), GLPreviewFrame::OnROIChanged)
194 EVT_BUTTON(XRCID("reset_crop_button"), GLPreviewFrame::OnResetCrop)
195 EVT_BUTTON(XRCID("crop_aspect_button"), GLPreviewFrame::OnSetCropAspect)
196 EVT_TEXT_ENTER(XRCID("exposure_text"), GLPreviewFrame::OnExposureChanged)
197 EVT_COMMAND_RANGE(
PROJ_PARAM_VAL_ID,PROJ_PARAM_VAL_ID+PANO_PROJECTION_MAX_PARMS,wxEVT_COMMAND_TEXT_ENTER,GLPreviewFrame::OnProjParameterChanged)
200 EVT_COLOURPICKER_CHANGED(XRCID("preview_background"), GLPreviewFrame::OnPreviewBackgroundColorChanged)
201 EVT_MENU(XRCID("ID_SHOW_FULL_SCREEN_PREVIEW"), GLPreviewFrame::OnFullScreen)
202 EVT_MENU(XRCID("action_show_main_frame"), GLPreviewFrame::OnShowMainFrame)
203 EVT_MENU(XRCID("action_exit_preview"), GLPreviewFrame::OnUserExit)
204 EVT_BUTTON ( XRCID("ass_load_images_button"), GLPreviewFrame::OnLoadImages)
205 EVT_BUTTON ( XRCID("ass_align_button"), GLPreviewFrame::OnAlign)
206 EVT_BUTTON ( XRCID("ass_create_button"), GLPreviewFrame::OnCreate)
208 EVT_MENU(XRCID("selectMenu_selectAll"), GLPreviewFrame::OnSelectAllMenu)
209 EVT_MENU(XRCID("selectMenu_selectMedian"), GLPreviewFrame::OnSelectMedianMenu)
210 EVT_MENU(XRCID("selectMenu_selectBrightest"), GLPreviewFrame::OnSelectDarkestMenu)
211 EVT_MENU(XRCID("selectMenu_selectDarkest"), GLPreviewFrame::OnSelectBrightestMenu)
212 EVT_MENU(XRCID("selectMenu_keepCurrentSelection"), GLPreviewFrame::OnSelectKeepSelection)
213 EVT_MENU(XRCID("selectMenu_resetSelection"), GLPreviewFrame::OnSelectResetSelection)
217 EVT_ENTER_WINDOW(ImageToogleButtonEventHandler::OnEnter)
218 EVT_LEAVE_WINDOW(ImageToogleButtonEventHandler::OnLeave)
219 EVT_TOGGLEBUTTON(-1, ImageToogleButtonEventHandler::OnChange)
223 EVT_ENTER_WINDOW(ImageGroupButtonEventHandler::OnEnter)
224 EVT_LEAVE_WINDOW(ImageGroupButtonEventHandler::OnLeave)
225 EVT_CHECKBOX(-1, ImageGroupButtonEventHandler::OnChange)
228 #define PF_STYLE (wxMAXIMIZE_BOX | wxMINIMIZE_BOX | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN)
241 GLPreviewFrame * frame = ((
GLwxAuiManager*) GetOwnerManager())->getPreviewFrame();
249 GLPreviewFrame * frame = ((
GLwxAuiManager*) GetOwnerManager())->getPreviewFrame();
251 wxAuiFloatingFrame::OnMoveFinished();
264 wxSizeEvent
event = wxSizeEvent(wxSize());
271 : wxFrame(frame,-1, _(
"Fast Panorama preview"), wxDefaultPosition, wxDefaultSize,
305 int widths[3] = {-3, 150, 150};
306 SetStatusWidths(3, widths);
307 SetStatusText(wxT(
""),1);
308 SetStatusText(wxT(
""),2);
309 wxConfigBase * cfg = wxConfigBase::Get();
311 wxPanel *tool_panel = wxXmlResource::Get()->LoadPanel(
this,wxT(
"mode_panel"));
312 XRCCTRL(*
this,
"preview_center_tool",wxButton)->SetBitmapMargins(0,5);
313 XRCCTRL(*
this,
"preview_fit_pano_tool",wxButton)->SetBitmapMargins(0,5);
314 XRCCTRL(*
this,
"preview_straighten_pano_tool",wxButton)->SetBitmapMargins(0,5);
315 XRCCTRL(*
this,
"preview_fit_pano_tool2",wxButton)->SetBitmapMargins(0,5);
316 XRCCTRL(*
this,
"preview_autocrop_tool",wxButton)->SetBitmapMargins(0,5);
317 XRCCTRL(*
this,
"preview_stack_autocrop_tool",wxButton)->SetBitmapMargins(0,5);
318 XRCCTRL(*
this,
"preview_autocrop_outside_tool", wxButton)->SetBitmapMargins(0, 5);
331 wxApp::s_macExitMenuItemId = XRCID(
"action_exit_preview");
333 wxMenuBar* simpleMenu=wxXmlResource::Get()->LoadMenuBar(
this, wxT(
"preview_simple_menu"));
335 m_filemenuAdvanced = wxXmlResource::Get()->LoadMenu(wxT(
"preview_file_menu_advanced"));
340 SetMenuBar(simpleMenu);
346 XRCCTRL(*
this,
"preview_background", wxColourPickerCtrl)->Refresh();
347 XRCCTRL(*
this,
"preview_background", wxColourPickerCtrl)->Update();
351 wxPanel * toggle_panel =
new wxPanel(
this);
353 bool overview_hidden;
354 cfg->Read(wxT(
"/GLPreviewFrame/overview_hidden"), &overview_hidden,
false);
355 GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->Check(!overview_hidden);
358 new wxStaticBox(toggle_panel, -1, _(
"displayed images")),
362 m_ButtonPanel =
new wxScrolledWindow(toggle_panel, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
369 wxPanel *panel =
new wxPanel(toggle_panel);
370 bitmap.LoadFile(
huginApp::Get()->GetXRCPath()+wxT(
"data/preview_show_all.png"),wxBITMAP_TYPE_PNG);
376 long mode = cfg->Read(wxT(
"/GLPreviewFrame/SelectAllMode"), 0l);
403 bitmap.LoadFile(
huginApp::Get()->GetXRCPath()+wxT(
"data/preview_show_none.png"),wxBITMAP_TYPE_PNG);
404 wxButton* select_none =
new wxButton(panel, ID_SHOW_NONE, _(
"None"));
405 select_none->SetBitmap(bitmap,wxLEFT);
406 select_none->SetBitmapMargins(5,0);
408 wxBoxSizer *sizer =
new wxBoxSizer(wxHORIZONTAL);
409 sizer->Add(
m_selectAllButton,0,wxALIGN_CENTER_VERTICAL | wxLEFT | wxTOP | wxBOTTOM,5);
410 sizer->Add(select_none,0,wxALIGN_CENTER_VERTICAL | wxRIGHT | wxTOP | wxBOTTOM,5);
411 panel->SetSizer(sizer);
415 m_topsizer->Add(tool_panel, 0, wxEXPAND | wxALL, 2);
416 m_topsizer->Add(toggle_panel, 0, wxEXPAND | wxBOTTOM, 5);
419 m_infoBar->AddButton(ID_HIDE_HINTS,_(
"Hide"));
424 wxPanel * vis_panel =
new wxPanel(
this);
426 wxPanel * preview_panel =
new wxPanel(vis_panel);
427 wxPanel * overview_panel =
new wxPanel(vis_panel);
430 int args[] = {WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0};
438 overview_hidden=
false;
444 m_mgr->SetManagedWindow(vis_panel);
445 vis_panel->SetMinSize(wxSize(200,150));
448 wxFlexGridSizer * flexSizer =
new wxFlexGridSizer(2,0,5,5);
449 flexSizer->AddGrowableCol(0);
450 flexSizer->AddGrowableRow(0);
453 wxBoxSizer * overview_sizer =
new wxBoxSizer(wxVERTICAL);
464 wxDefaultPosition, wxDefaultSize,
465 wxSL_VERTICAL | wxSL_AUTOTICKS,
471 m_VFOVSlider->SetToolTip(_(
"drag to change the vertical field of view"));
477 wxDefaultPosition, wxDefaultSize,
478 wxSL_HORIZONTAL | wxSL_AUTOTICKS,
485 m_HFOVSlider->SetToolTip(_(
"drag to change the horizontal field of view"));
487 m_HFOVText = XRCCTRL(*
this,
"pano_text_hfov" ,wxTextCtrl);
490 m_VFOVText = XRCCTRL(*
this,
"pano_text_vfov" ,wxTextCtrl);
494 m_ROILeftTxt = XRCCTRL(*
this,
"pano_val_roi_left", wxTextCtrl);
498 m_ROIRightTxt = XRCCTRL(*
this,
"pano_val_roi_right", wxTextCtrl);
502 m_ROITopTxt = XRCCTRL(*
this,
"pano_val_roi_top", wxTextCtrl);
506 m_ROIBottomTxt = XRCCTRL(*
this,
"pano_val_roi_bottom", wxTextCtrl);
513 int guide=cfg->Read(wxT(
"/GLPreviewFrame/guide"),0l);
529 cfg->Read(wxT(
"/GLPreviewFrame/showPreviewGrid"),&showGrid,
true);
530 GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->Check(showGrid);
532 preview_panel->SetSizer(flexSizer);
533 overview_panel->SetSizer(overview_sizer);
535 m_mgr->AddPane(preview_panel,
537 ).Name(wxT(
"preview")
540 ).CaptionVisible(
false
541 ).Caption(_(
"Preview")
548 m_mgr->AddPane(overview_panel,
550 ).Name(wxT(
"overview")
554 ).Caption(_(
"Overview")
555 ).FloatingSize(100,100
556 ).FloatingPosition(500,500
560 ).Show(!overview_hidden
576 for (
auto& lensType : lensInfoVector)
579 const int lensId = lensType.id;
580 Bind(wxEVT_MENU, [
this, lensId](wxCommandEvent&) {
LoadImages(lensId); }, lensTypeId);
613 int nP = panoProjectionFormatCount();
614 for(
int n=0; n < nP; n++) {
615 pano_projection_features proj;
616 if (panoProjectionFeaturesQuery(n, &proj)) {
617 wxString str2(proj.name, wxConvLocal);
636 cfg->Read(wxT(
"/GLPreviewFrame/individualDragMode"), &individualDrag,
false);
691 wxBitmapButton * resetProjButton=
new wxBitmapButton(
m_projection_panel, PROJ_PARAM_RESET_ID,
692 wxArtProvider::GetBitmap(wxART_REDO));
693 resetProjButton->SetToolTip(_(
"Resets the projection's parameters to their default values."));
694 m_projParamSizer->Add(resetProjButton, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 5);
700 for (
int i=0; i < PANO_PROJECTION_MAX_PARMS; i++) {
702 wxBoxSizer* paramBoxSizer =
new wxBoxSizer(wxVERTICAL);
709 wxDefaultPosition, wxSize(35,-1), wxTE_PROCESS_ENTER);
720 wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL ,
735 wxIconBundle myIcons(
huginApp::Get()->GetXRCPath() + wxT(
"data/hugin.ico"),wxBITMAP_TYPE_ICO);
738 wxIcon myIcon(
huginApp::Get()->GetXRCPath() + wxT(
"data/hugin.png"),wxBITMAP_TYPE_PNG);
748 this->SetBackgroundColour(
m_GLPreview->GetBackgroundColour());
752 m_degDigits = wxConfigBase::Get()->Read(wxT(
"/General/DegreeFractionalDigitsEdit"),3);
757 if (cfg->Read(wxT(
"/GLPreviewFrame/isShown"), 0l) != 0)
759 #if defined __WXMSW__ || defined __WXMAC__
768 #if defined __WXMAC__
783 wxString OpenGLLayout=wxConfig::Get()->Read(wxT(
"/GLPreviewFrame/OpenGLLayout"));
784 if(!OpenGLLayout.IsEmpty())
786 m_mgr->LoadPerspective(OpenGLLayout,
true);
788 if(!GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked())
790 wxAuiPaneInfo &inf =
m_mgr->GetPane(wxT(
"overview"));
808 wxConfigBase * cfg = wxConfigBase::Get();
812 if ( (!this->IsIconized()) && (! this->IsMaximized()) && this->IsShown()) {
813 cfg->Write(wxT(
"/GLPreviewFrame/isShown"), 1l);
815 cfg->Write(wxT(
"/GLPreviewFrame/isShown"), 0l);
819 cfg->Write(wxT(
"/GLPreviewFrame/OpenGLLayout"),
m_mgr->SavePerspective());
820 cfg->Write(wxT(
"/GLPreviewFrame/overview_hidden"), !(GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked()));
821 cfg->Write(wxT(
"/GLPreviewFrame/showPreviewGrid"), GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->IsChecked());
879 for (
int i=0; i < PANO_PROJECTION_MAX_PARMS; i++)
996 if (opts.
getROI().area() > 0)
999 wxString labelAspectRatio;
1002 labelAspectRatio = wxString::Format(
"%d:%d", opts.
getROI().width() / commonDivisor, opts.
getROI().height() / commonDivisor);
1006 const float ratio = 1.0f * opts.
getROI().width() / opts.
getROI().height();
1009 labelAspectRatio=wxString::Format(
"%.2f:1", ratio);
1013 labelAspectRatio=wxString::Format(
"1:%.2f", 1.0f / ratio);
1016 XRCCTRL(*
this,
"crop_aspect_label", wxStaticText)->SetLabel(labelAspectRatio);
1028 XRCCTRL(*
this,
"ass_status_text", wxStaticText)->
SetLabel(_(
"No images loaded."));
1032 bool enableCreate =
false;
1037 if (img.getYaw() != 0.0 || img.getPitch() != 0.0 || img.getRoll() != 0.0)
1039 enableCreate =
true;
1045 if (lastCmd ==
"add images" || lastCmd ==
"add and distribute images")
1047 enableCreate =
false;
1054 enableCreate =
true;
1058 enableCreate =
true;
1062 enableCreate =
true;
1073 wxString alignMsg = wxString::Format(_(
"%lu images are connected by %lu control points.\n"), (
unsigned long int) pano.
getNrOfImages(), (
unsigned long int) pano.
getCtrlPoints().size());
1080 if (comps.size() > 1)
1082 alignMsg += wxString::Format(_(
"%lu unconnected image groups found: %s\n"), static_cast<unsigned long int>(comps.size()),
Components2Str(comps).c_str());
1088 alignMsg += _(
"Images or control points have changed, new alignment is needed.");
1099 alignMsg = alignMsg + wxString::Format(_(
"Mean error after optimization: %.1f pixel, max: %.1f"), mean, max);
1104 wxStaticText* statusCtrl = XRCCTRL(*
this,
"ass_status_text", wxStaticText);
1105 statusCtrl->SetLabel(alignMsg);
1106 statusCtrl->InvalidateBestSize();
1114 XRCCTRL(*
this,
"ass_status_text", wxStaticText)->SetLabel(_(
"One image loaded."));
1125 wxString projection;
1151 bool relayout =
false;
1159 for (i=0; i < nParam; i++) {
1160 const pano_projection_parameter * pp = & (opts.
m_projFeatures.parm[i]);
1161 wxString str2(pp->name, wxConvLocal);
1162 str2 = wxGetTranslation(str2);
1166 for(;i < PANO_PROJECTION_MAX_PARMS; i++) {
1180 assert((
int) params.size() == nParam);
1181 for (
int i=0; i < nParam; i++) {
1191 SetStatusText(wxString::Format(wxT(
"%.1f x %.1f"), opts.
getHFOV(), opts.
getVFOV()),2);
1196 m_HFOVText->ChangeValue(wxString(val.c_str(), wxConvLocal));
1198 m_VFOVText->ChangeValue(wxString(val.c_str(), wxConvLocal));
1203 XRCCTRL(*
this,
"preview_autocrop_tool",wxButton)->Enable(activeImgs);
1204 XRCCTRL(*
this,
"preview_stack_autocrop_tool",wxButton)->Enable(activeImgs);
1223 GetMenuBar()->Enable(XRCID(
"action_optimize"), nrImages > 0);
1228 for (
int i=nrButtons-1; i>=(int)nrImages; i--)
1271 if ( nrImages >= nrButtons ) {
1272 for(HuginBase::UIntSet::const_iterator it = changed.begin(); it != changed.end(); ++it){
1273 if (*it >= nrButtons) {
1279 wxBoxSizer * siz =
new wxBoxSizer(wxVERTICAL);
1281 wxToggleButton * but =
new wxToggleButton(pan,
1283 wxString::Format(wxT(
" %d "),*it),
1284 wxDefaultPosition, wxDefaultSize,
1287 wxCheckBox *butcheck =
new wxCheckBox(pan, wxID_ANY, wxT(
""));
1289 #if defined __WXMSW__ || defined __WXMAC__
1293 siz->Add(butcheck, 0, wxALIGN_CENTRE_HORIZONTAL | wxFIXED_MINSIZE, 0);
1294 siz->Add(but,0,wxLEFT | wxRIGHT | wxBOTTOM , 5);
1296 siz->Add(but,0,wxALL ,0);
1297 siz->Add(butcheck, 0, wxALL | wxFIXED_MINSIZE, 0);
1307 but->PushEventHandler(event_handler);
1309 ImageGroupButtonEventHandler * group_event_handler =
new
1310 ImageGroupButtonEventHandler(*it,
this, &
m_pano);
1317 butcheck->PushEventHandler(group_event_handler);
1320 but->SetValue(
true);
1335 for (
unsigned i=0; i < nrImages; i++) {
1379 bool toggle_on = GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked();
1380 wxAuiPaneInfo &inf =
m_mgr->GetPane(wxT(
"overview"));
1383 if (!inf.IsShown() && toggle_on ) {
1388 if (inf.IsFloating() && inf.IsShown()) {
1407 if (GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked()) {
1427 if (GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked()) {
1448 bool toggle_on = GetMenuBar()->FindItem(XRCID(
"action_show_overview"))->IsChecked();
1449 wxAuiPaneInfo &inf =
m_mgr->GetPane(wxT(
"overview"));
1451 if (inf.IsShown() && !toggle_on) {
1455 }
else if (!(inf.IsShown() && toggle_on)) {
1457 #if defined __WXMSW__ || defined __WXMAC__
1470 if(GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->IsChecked())
1492 if (event.CanVeto())
1502 if (event.CanVeto())
1518 void PreviewFrame::OnProjectionChanged()
1524 case PanoramaOptions::RECTILINEAR: Ip = _(
"Rectilinear");
break;
1525 case PanoramaOptions::CYLINDRICAL: Ip = _(
"Cylindrical");
break;
1526 case PanoramaOptions::EQUIRECTANGULAR: Ip = _(
"Equirectangular");
break;
1528 opt.projectionFormat = (PanoramaOptions::ProjectionFormat) lt;
1532 DEBUG_DEBUG (
"Projection changed: " << lt <<
":" << Ip )
1595 for (
size_t i = 0; i < stackedImg.size(); ++i)
1600 displayedImgs.insert(*(stackedImg[i].rbegin()));
1603 displayedImgs.insert(*(stackedImg[i].begin()));
1607 displayedImgs.insert(stackedImg[i][stackedImg[i].size() / 2]);
1647 text = XRCCTRL(*
this,
"input_yaw",wxTextCtrl)->GetValue();
1651 wxMessageBox(_(
"Yaw value must be numeric."),_(
"Warning"),wxOK | wxICON_ERROR,
this);
1654 text = XRCCTRL(*
this,
"input_pitch",wxTextCtrl)->GetValue();
1658 wxMessageBox(_(
"Pitch value must be numeric."),_(
"Warning"),wxOK | wxICON_ERROR,
this);
1661 text = XRCCTRL(*
this,
"input_roll",wxTextCtrl)->GetValue();
1665 wxMessageBox(_(
"Roll value must be numeric."),_(
"Warning"),wxOK | wxICON_ERROR,
this);
1675 text = XRCCTRL(*
this,
"input_x",wxTextCtrl)->GetValue();
1679 wxMessageBox(_(
"X value must be numeric."),_(
"Warning"),wxOK | wxICON_ERROR,
this);
1682 text = XRCCTRL(*
this,
"input_y",wxTextCtrl)->GetValue();
1686 wxMessageBox(_(
"Y value must be numeric."),_(
"Warning"),wxOK | wxICON_ERROR,
this);
1689 text = XRCCTRL(*
this,
"input_z",wxTextCtrl)->GetValue();
1693 wxMessageBox(_(
"Z value must be numeric."),_(
"Warning"),wxOK | wxICON_ERROR,
this);
1708 DEBUG_INFO (
"target exposure = " << text.mb_str(wxConvLocal) );
1710 if (text != wxT(
"")) {
1712 wxLogError(_(
"Value must be numeric."));
1745 if (!text.IsEmpty())
1750 wxLogError(_(
"Value must be numeric."));
1755 wxLogError(_(
"Value for range compression is outside of valid range."));
1774 for (
int i = 0; i < nParam; i++) {
1777 DEBUG_INFO (
"param " << i <<
": = " << text.mb_str(wxConvLocal) );
1779 if (text != wxT(
"")) {
1781 wxLogError(_(
"Value must be numeric."));
1813 DEBUG_DEBUG(
"VFOV changed (slider): " << e.GetInt());
1815 }
else if (e.GetEventObject() == XRCCTRL(*
this,
"layout_scale_slider",wxSlider)) {
1816 DEBUG_DEBUG(
"Layout scale changed (slider): " << e.GetInt());
1821 for (
int i = 0; i < nParam; i++) {
1824 para[i] = e.GetInt();
1847 opt.setVFOV(e.GetInt());
1849 int nParam = opt.m_projFeatures.numberOfParameters;
1850 std::vector<double> para = opt.getProjectionParameters();
1851 for (
int i = 0; i < nParam; i++) {
1854 para[i] = e.GetInt();
1859 opt.setProjectionParameters(para);
1901 if(wxMessageBox(_(
"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?"),
1907 wxYES_NO | wxICON_QUESTION,
this) == wxYES)
1941 for (
size_t i = 0 ; i < nr; i++)
1957 for (
size_t i = 0 ; i < nr ; i++)
1960 img.setTranslationPlaneYaw(0);
1961 img.setTranslationPlanePitch(0);
1997 if(wxMessageBox(_(
"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?"),
2003 wxYES_NO | wxICON_QUESTION,
this) == wxYES)
2056 bool normalMode=index==0 || index==1;
2057 XRCCTRL(*
this,
"label_yaw",wxStaticText)->Show(normalMode);
2058 XRCCTRL(*
this,
"input_yaw",wxTextCtrl)->Show(normalMode);
2059 XRCCTRL(*
this,
"label_pitch",wxStaticText)->Show(normalMode);
2060 XRCCTRL(*
this,
"input_pitch",wxTextCtrl)->Show(normalMode);
2061 XRCCTRL(*
this,
"label_roll",wxStaticText)->Show(normalMode);
2062 XRCCTRL(*
this,
"input_roll",wxTextCtrl)->Show(normalMode);
2063 XRCCTRL(*
this,
"label_x",wxStaticText)->Show(!normalMode);
2064 XRCCTRL(*
this,
"input_x",wxTextCtrl)->Show(!normalMode);
2065 XRCCTRL(*
this,
"label_y",wxStaticText)->Show(!normalMode);
2066 XRCCTRL(*
this,
"input_y",wxTextCtrl)->Show(!normalMode);
2067 XRCCTRL(*
this,
"label_z",wxStaticText)->Show(!normalMode);
2068 XRCCTRL(*
this,
"input_z",wxTextCtrl)->Show(!normalMode);
2070 XRCCTRL(*
this,
"apply_num_transform",wxButton)->GetParent()->Layout();
2140 SetStatusText(message, 0);
2168 if(GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->IsChecked())
2197 if(GetMenuBar()->FindItem(XRCID(
"action_show_grid"))->IsChecked())
2234 SetStatusText(wxT(
""), 0);
2265 SetStatusText(wxT(
""), 0);
2284 std::set<Tool*>::iterator i;
2285 for (i = tools.begin(); i != tools.end(); ++i)
2303 }
else if (*i == preview_control_point_tool)
2306 XRCCTRL(*
this,
"preview_control_point_tool",wxCheckBox)->SetValue(
false);
2316 unsigned char green,
2321 #if defined __WXMSW__ || defined __WXMAC__
2322 if (red || green || blue)
2336 if (red || green || blue)
2340 m_ToggleButtons[image_nr]->SetBackgroundColour(wxColour(red, green, blue));
2361 for (
unsigned image = 0; image < nr_images; image++)
2363 #if defined __WXMSW__ || defined __WXMAC__
2378 SetStatusText(wxT(
""), 0);
2402 wxCommandEvent e(wxEVT_COMMAND_TOOL_CLICKED, XRCID(
"preview_color_picker_tool"));
2404 GetEventHandler()->AddPendingEvent(e);
2410 SetStatusText(wxT(
""), 0);
2422 if (!XRCCTRL(*
this,
"preview_control_point_tool", wxCheckBox)->GetValue())
2432 unsigned int image_number_in,
2433 wxToggleButton* identify_button_in,
2450 std::vector<PreviewIdentifyTool**>::iterator it;
2466 std::vector<PreviewIdentifyTool**>::iterator it;
2468 (*(*it))->StopShowingImages();
2481 wxMouseEvent null_event;
2482 if (e.IsChecked()) {
2502 : image_number(image_number), frame(frame_in), m_pano(m_pano) {}
2514 std::vector<PreviewIdentifyTool**>::iterator it;
2527 std::vector<PreviewIdentifyTool**>::iterator it;
2529 (*(*it))->StopShowingImages();
2537 wxMouseEvent null_event;
2538 if (e.IsChecked()) {
2566 if (update_check_box) {
2572 if (update_check_box) {
2578 std::vector<wxCheckBox*>::iterator it;
2579 unsigned int nr = 0;
2589 std::vector<wxCheckBox*>::iterator it;
2591 (*it)->SetValue(
false);
2597 std::vector<wxCheckBox*>::iterator it;
2600 (*it)->Show(isShown);
2615 unsigned int oldMode = wxConfigBase::Get()->Read(wxT(
"/GLPreviewFrame/blendMode"), 0l);
2633 vigra::Rect2D newROI;
2645 if(!newROI.isEmpty())
2663 vigra::Rect2D newROI;
2671 if (stackImgs.size()<activeImages.size())
2673 cropPano.setStacks(stackImgs);
2676 if (cropPano.hasRunSuccessfully())
2678 newROI = cropPano.getResultOptimalROI();
2683 if(!newROI.isEmpty())
2701 vigra::Rect2D newROI;
2713 if (!newROI.isEmpty())
2725 ShowFullScreen(!IsFullScreen(), wxFULLSCREEN_NOBORDER | wxFULLSCREEN_NOCAPTION);
2732 SetStatusText(wxT(
""), 0);
2754 XRCCTRL(*
this,
"preview_control_point_tool",wxCheckBox)->SetValue(
false);
2782 std::vector<wxCheckBox*>::iterator it;
2795 wxScrollEvent dummy;
2832 std::vector<wxCheckBox*>::iterator it;
2867 long left, right, top, bottom;
2869 wxLogError(_(
"Top needs to be an integer bigger than 0"));
2873 wxLogError(_(
"left needs to be an integer bigger than 0"));
2877 wxLogError(_(
"right needs to be an integer bigger than 0"));
2881 wxLogError(_(
"bottom needs to be an integer bigger than 0"));
2884 opt.
setROI(vigra::Rect2D(left, top, right, bottom));
2886 if(opt.
getROI().width()<1) {
2887 wxLogError(_(
"left boundary must be smaller than right"));
2892 if(opt.
getROI().height()<1) {
2893 wxLogError(_(
"top boundary must be smaller than bottom"));
2914 if (dlg.ShowModal() == wxID_OK)
2919 int left = opt.
getROI().left();
2920 int top = opt.
getROI().top();
2921 int width = opt.
getROI().width();
2922 int height = opt.
getROI().height();
2923 const int newHeight = 1.0 * width / aspectRatio;
2924 if (newHeight > height)
2926 const int newWidth = 1.0 * height * aspectRatio;
2927 left = left + (width - newWidth) / 2.0;
2932 top = top + (height - newHeight) / 2.0;
2936 opt.
setROI(vigra::Rect2D(left, top, left + width, top + height));
2947 DEBUG_INFO (
"HFOV = " << text.mb_str(wxConvLocal) );
2948 if (text == wxT(
"")) {
2954 wxLogError(_(
"Value must be numeric."));
2959 wxLogError(wxString::Format(
2960 _(
"Invalid HFOV value. Maximum HFOV for this projection is %lf."),
2978 DEBUG_INFO (
"VFOV = " << text.mb_str(wxConvLocal) );
2979 if (text == wxT(
"")) {
2985 wxLogError(_(
"Value must be numeric."));
2990 wxLogError(wxString::Format(
2991 _(
"Invalid VFOV value. Maximum VFOV for this projection is %lf."),
3008 double scale_factor=XRCCTRL(*
this,
"layout_scale_slider",wxSlider)->GetValue();
3021 double maxfov = hfov > vfov ? hfov : vfov;
3024 bool rectilinear_option =
false;
3027 if (maxfov > 120.0) {
3029 message = _(
"With a wide field of view, panoramas with rectilinear projection get very stretched towards the edges.\n");
3031 message += _(
"Since the field of view is only very wide in the horizontal direction, try a cylindrical projection instead.");
3033 message += _(
"For a very wide panorama, try equirectangular projection instead.");
3035 message += wxT(
" ");
3036 message += _(
"You could also try Panini projection.");
3041 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.");
3042 }
else rectilinear_option =
true;
3045 if (vfov < 110.0 && hfov > 120.0)
3047 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.");
3048 }
else rectilinear_option =
true;
3051 if (maxfov < 280.0) {
3052 rectilinear_option =
true;
3053 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.");
3057 if (maxfov > 300.0) {
3058 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.");
3059 }
else rectilinear_option =
true;
3062 rectilinear_option =
true;
3064 if (rectilinear_option && maxfov < 110.0) {
3065 message = _(
"Setting the panorama to rectilinear projection would keep the straight lines straight.");
3067 if (message.IsEmpty()) {
3071 m_infoBar->ShowMessage(message, wxICON_INFORMATION);
3086 wxMessageBox(_(
"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."),
3092 wxOK | wxICON_INFORMATION,
this);
3094 wxConfigBase* cfg=wxConfigBase::Get();
3095 cfg->Write(wxT(
"/GLPreviewFrame/ShowProjectionHints"),
false);
3120 wxConfigBase* cfg=wxConfigBase::Get();
3121 cfg->Write(wxT(
"/GLPreviewFrame/PreviewBackground"), c);
3137 int selection=e.GetSelection();
3150 if(old_selection==wxNOT_FOUND)
3175 wxCommandEvent dummy;
3198 wxApp::s_macExitMenuItemId = XRCID(
"action_exit_preview");
3202 GetMenuBar()->Remove(0);
3210 wxApp::s_macExitMenuItemId = XRCID(
"action_exit_hugin");
3214 GetMenuBar()->Remove(0);
3217 SetTitle(_(
"Fast Panorama preview"));
3224 GetMenuBar()->FindItem(XRCID(
"action_gui_simple"))->Check();
3227 GetMenuBar()->FindItem(XRCID(
"action_gui_advanced"))->Check();
3230 GetMenuBar()->FindItem(XRCID(
"action_gui_expert"))->Check();
3272 if (wxConfig::Get()->Read(wxT(
"/ShowFisheyeCropHint"), 1l) == 1)
3276 wxXmlResource::Get()->LoadDialog(&dlg, NULL, wxT(
"fisheye_show_crop_dlg"));
3277 if (dlg.ShowModal() == wxID_OK)
3281 if (XRCCTRL(dlg,
"fisheye_crop_dont_ask_checkbox", wxCheckBox)->IsChecked())
3283 wxConfig::Get()->Write(wxT(
"/ShowFisheyeCropHint"), 0l);
3308 const long autoAlign = wxConfigBase::Get()->Read(wxT(
"/Assistant/autoAlign"),
HUGIN_ASS_AUTO_ALIGN);
3312 wxCommandEvent dummy;
3317 std::vector<PanoCommand::PanoCommand*> cmds;
3318 cmds.push_back(cmd);
3319 if(distributeImages)
3325 combinedCmd->
setName(
"add and distribute images");
3332 HuginBase::FileMetaData::const_iterator pos = metaData.find(
"readProjectionFromDB");
3333 if(!(pos != metaData.end() && pos->second ==
"true"))
3350 if(dlg.ShowModal()==wxID_OK)
3355 wxCommandEvent dummy;
3366 long afterEditCPAction = wxConfig::Get()->Read(wxT(
"/EditCPAfterAction"), 0l);
3368 if (afterEditCPAction == 0)
3371 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"edit_cp_optimize_dialog"));
3372 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())));
3373 XRCCTRL(dlg,
"edit_cp_text2", wxStaticText)->SetLabel(wxString::Format(_(
"Current selected optimizer strategy is \"%s\"."),
MainFrame::Get()->GetCurrentOptimizerString().c_str()));
3375 optimize = (dlg.ShowModal() == wxID_OK);
3376 if (XRCCTRL(dlg,
"edit_cp_dont_show_again_checkbox", wxCheckBox)->GetValue())
3380 wxConfig::Get()->Write(wxT(
"/EditCPAfterAction"), 1l);
3384 wxConfig::Get()->Write(wxT(
"/EditCPAfterAction"), 2l);
3390 optimize = (afterEditCPAction == 1);
3395 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"action_optimize"));
3402 #define MAX_DIMENSION 1600
3423 wxMessageBox(_(
"The selected region contains no active image.\nPlease select a region which is covered by at least 2 images."),
3429 wxOK | wxICON_INFORMATION,
this);
3432 if (imgs.size() < 2)
3434 wxMessageBox(_(
"The selected region is only covered by a single image.\nCan't create control points for a single image."),
3440 wxOK | wxICON_INFORMATION,
this);
3445 if(wxMessageBox(_(
"The selected rectangle is very big.\nThis function is only intended for smaller areas. Otherwise unwanted side effect can appear.\n\nProceed anyway?"),
3451 wxYES_NO | wxICON_INFORMATION,
this) == wxNO)
3474 for (HuginBase::UIntSet::const_iterator it = imgs.begin(); it != imgs.end(); ++it)
3476 const size_t imgNr = *it;
3477 if (!progress.updateDisplayValue(_(
"Remap image to panorama projection...")))
3482 findStruct.
imgNr = imgNr;
3489 srcImg.setExposureValue(0);
3492 if (!progress.updateDisplay())
3500 cpInfos.push_back(findStruct);
3502 if (cpInfos.size() > 1)
3506 unsigned gridx =
hugin_utils::roundi(sqrt((
double)roi.width() / (double)roi.height() * 25));
3516 while (roi.width() / gridx < 20 && gridx > 1)
3520 while (roi.height() / gridy < 20 && gridy > 1)
3525 const long templWidth = 20;
3527 const long sWidth = 100;
3529 for (
size_t img1 = 0; img1 < cpInfos.size() - 1; ++img1)
3531 if (!progress.updateDisplayValue(_(
"Matching interest points...")))
3535 vigra::Size2D size(cpInfos[img1].image.width(), cpInfos[img1].image.height());
3537 std::vector<vigra::Rect2D> rects;
3538 for (
unsigned party = 0; party < gridy; party++)
3540 for (
unsigned partx = 0; partx < gridx; partx++)
3542 vigra::Rect2D rect(partx*size.x / gridx, party*size.y / gridy,
3543 (partx + 1)*size.x / gridx, (party + 1)*size.y / gridy);
3544 rect &= vigra::Rect2D(size);
3545 if (rect.width()>0 && rect.height()>0)
3547 rects.push_back(rect);
3552 if (!progress.updateDisplay())
3557 #pragma omp parallel for schedule(dynamic)
3558 for (
int i = 0; i < rects.size(); ++i)
3561 vigra::Rect2D rect(rects[i]);
3565 MapPoints validPoints;
3566 for (MapPoints::const_iterator it = points.begin(); it != points.end(); ++it)
3568 if (cpInfos[img1].mask(it->second.x, it->second.y)>0)
3570 validPoints.insert(*it);
3574 if (!validPoints.empty())
3577 for (
size_t img2 = img1 + 1; img2 < cpInfos.size(); ++img2)
3581 for (MapPoints::const_reverse_iterator it = validPoints.rbegin(); it != validPoints.rend(); ++it)
3589 if (cpInfos[img2].mask(it->second.x, it->second.y) == 0)
3595 cpInfos[img2].image, vigra::RGBToGrayAccessor<vigra::RGBValue<vigra::UInt8> >(), it->second, sWidth);
3612 cpInfos[img1].image.resize(0, 0);
3613 cpInfos[img1].mask.resize(0, 0);
3617 for (
size_t i = 0; i < tempCps.size(); ++i)
3650 if (!progress.updateDisplayValue(_(
"Checking results...")))
3657 if (!invalidCP.empty())
3659 for (HuginBase::UIntSet::const_reverse_iterator it = invalidCP.rbegin(); it != invalidCP.rend(); ++it)
3661 cps.erase(cps.begin() + *it);
3665 if (!progress.updateDisplayValue())
3671 long afterEditCPAction = wxConfig::Get()->Read(wxT(
"/EditCPAfterAction"), 0l);
3673 if (afterEditCPAction == 0)
3678 wxXmlResource::Get()->LoadDialog(&dlg,
this, wxT(
"edit_cp_optimize_dialog"));
3679 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())));
3680 XRCCTRL(dlg,
"edit_cp_text2", wxStaticText)->SetLabel(wxString::Format(_(
"Current selected optimizer strategy is \"%s\"."),
MainFrame::Get()->GetCurrentOptimizerString().c_str()));
3682 optimize = (dlg.ShowModal() == wxID_OK);
3683 if (XRCCTRL(dlg,
"edit_cp_dont_show_again_checkbox", wxCheckBox)->GetValue())
3687 wxConfig::Get()->Write(wxT(
"/EditCPAfterAction"), 1l);
3691 wxConfig::Get()->Write(wxT(
"/EditCPAfterAction"), 2l);
3697 optimize = (afterEditCPAction == 1);
3702 wxCommandEvent ev(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(
"action_optimize"));
3722 wxConfig::Get()->Write(wxT(
"/GLPreviewFrame/SelectAllMode"), 0l);
3728 wxConfig::Get()->Write(wxT(
"/GLPreviewFrame/SelectAllMode"), 1l);
3734 wxConfig::Get()->Write(wxT(
"/GLPreviewFrame/SelectAllMode"), 2l);
3740 wxConfig::Get()->Write(wxT(
"/GLPreviewFrame/SelectAllMode"), 3l);
3746 wxConfig::Get()->Write(wxT(
"/GLPreviewFrame/SelectAllKeepSelection"),
true);
3752 wxConfig::Get()->Write(wxT(
"/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)
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
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
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 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...
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
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Store window size and position in configfile/registry.
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)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Restore window size and position from configfile/registry.
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
void OnTrackChangeFOV(wxScrollEvent &e)
UIntSet getActiveImages() const
get active images
void MakePlaneOverviewTools(PlaneOverviewToolHelper *helper)
#define HUGIN_ASS_AUTO_ALIGN
void OnLayoutScaleChange(wxScrollEvent &e)
event handler for change scale of layout mode
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)
unsigned int getWidth() const
include file for the hugin project
virtual void SetLayoutMode(bool state)
void OnMenuClose(wxMenuEvent &e)
handle menu close event
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)
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 OnDragChoice(wxCommandEvent &e)
hugin_utils::FDiff2D maxpos
PreviewColorPickerTool * color_picker_tool
void OnChangeFOV(wxScrollEvent &e)
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)
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...