From: <hug...@li...> - 2011-09-30 08:26:08
|
branch: details: http://hugin.hg.sourceforge.net/hgweb/hugin/hugin/hgrepo/h/hu/hugin/hugin/rev/7f2451ca3084 changeset: 5601:7f2451ca3084 user: tmodes date: Fri Sep 30 10:17:45 2011 +0200 description: Show guide lines also on projection tab diffstat: src/hugin1/hugin/GLPreviewFrame.cpp | 21 ++++++-- src/hugin1/hugin/GLPreviewFrame.h | 3 +- src/hugin1/hugin/xrc/preview_frame.xrc | 74 +++++++++++++++++++++++++++++++++- 3 files changed, 89 insertions(+), 9 deletions(-) diffs (192 lines): diff -r 9e17754888ab -r 7f2451ca3084 src/hugin1/hugin/GLPreviewFrame.cpp --- a/src/hugin1/hugin/GLPreviewFrame.cpp Thu Sep 29 23:41:55 2011 +0100 +++ b/src/hugin1/hugin/GLPreviewFrame.cpp Fri Sep 30 10:17:45 2011 +0200 @@ -140,7 +140,8 @@ EVT_CHOICE(XRCID("drag_mode_choice"), GLPreviewFrame::OnDragChoice) EVT_CHOICE(XRCID("projection_choice"), GLPreviewFrame::OnProjectionChoice) EVT_CHOICE(XRCID("overview_mode_choice"), GLPreviewFrame::OnOverviewModeChoice) - EVT_CHOICE(XRCID("preview_guide_choice"), GLPreviewFrame::OnGuideChanged) + EVT_CHOICE(XRCID("preview_guide_choice_crop"), GLPreviewFrame::OnGuideChanged) + EVT_CHOICE(XRCID("preview_guide_choice_proj"), GLPreviewFrame::OnGuideChanged) EVT_TOGGLEBUTTON(XRCID("overview_toggle"), GLPreviewFrame::OnOverviewToggle) EVT_CHECKBOX(XRCID("preview_show_grid"), GLPreviewFrame::OnSwitchPreviewGrid) #ifndef __WXMAC__ @@ -496,9 +497,11 @@ DEBUG_ASSERT(m_ROIBottomTxt); m_ROIBottomTxt->PushEventHandler(new TextKillFocusHandler(this)); - m_GuideChoice = XRCCTRL(*this, "preview_guide_choice", wxChoice); + m_GuideChoiceCrop = XRCCTRL(*this, "preview_guide_choice_crop", wxChoice); + m_GuideChoiceProj = XRCCTRL(*this, "preview_guide_choice_proj", wxChoice); int guide=cfg->Read(wxT("/GLPreviewFrame/guide"),0l); - m_GuideChoice->SetSelection(guide); + m_GuideChoiceCrop->SetSelection(guide); + m_GuideChoiceProj->SetSelection(guide); flexSizer->Add(m_HFOVSlider, 0, wxEXPAND); @@ -755,7 +758,7 @@ cfg->Write(wxT("/GLPreviewFrame/overview_hidden"), !(m_OverviewToggle->GetValue())); cfg->Write(wxT("/GLPreviewFrame/showPreviewGrid"), m_previewGrid->GetValue()); cfg->Write(wxT("/GLPreviewFrame/individualDragMode"), individualDragging()); - cfg->Write(wxT("/GLPreviewFrame/guide"),m_GuideChoice->GetSelection()); + cfg->Write(wxT("/GLPreviewFrame/guide"),m_GuideChoiceProj->GetSelection()); // delete all of the tools. When the preview is never used we never get an // OpenGL context and therefore don't create the tools. @@ -1878,7 +1881,7 @@ preview_helper->ActivateTool(preview_projection_grid); }; preview_guide_tool = new PreviewGuideTool(preview_helper); - preview_guide_tool->SetGuideStyle((PreviewGuideTool::Guides)m_GuideChoice->GetSelection()); + preview_guide_tool->SetGuideStyle((PreviewGuideTool::Guides)m_GuideChoiceProj->GetSelection()); // activate tools that are always active. preview_helper->ActivateTool(pano_mask_tool); @@ -2393,6 +2396,7 @@ updateBlendMode(); break; case mode_projection: + preview_helper->DeactivateTool(preview_guide_tool); break; case mode_drag: preview_helper->DeactivateTool(drag_tool); @@ -2434,6 +2438,7 @@ OnLayoutScaleChange(dummy); break; case mode_projection: + preview_helper->ActivateTool(preview_guide_tool); break; case mode_drag: TurnOffTools(preview_helper->ActivateTool(drag_tool)); @@ -2723,7 +2728,11 @@ { if(preview_guide_tool) { - preview_guide_tool->SetGuideStyle((PreviewGuideTool::Guides)m_GuideChoice->GetSelection()); + int selection=e.GetSelection(); + preview_guide_tool->SetGuideStyle((PreviewGuideTool::Guides)selection); + //synchronize wxChoice in projection and crop tab + m_GuideChoiceCrop->SetSelection(selection); + m_GuideChoiceProj->SetSelection(selection); redrawPreview(); }; }; diff -r 9e17754888ab -r 7f2451ca3084 src/hugin1/hugin/GLPreviewFrame.h --- a/src/hugin1/hugin/GLPreviewFrame.h Thu Sep 29 23:41:55 2011 +0100 +++ b/src/hugin1/hugin/GLPreviewFrame.h Fri Sep 30 10:17:45 2011 +0200 @@ -360,7 +360,8 @@ wxChoice * m_DragModeChoice; wxChoice * m_ProjectionChoice; wxChoice * m_OverviewModeChoice; - wxChoice * m_GuideChoice; + wxChoice * m_GuideChoiceCrop; + wxChoice * m_GuideChoiceProj; // No HDR display yet. // wxChoice * m_outputModeChoice; wxTextCtrl * m_exposureTextCtrl; diff -r 9e17754888ab -r 7f2451ca3084 src/hugin1/hugin/xrc/preview_frame.xrc --- a/src/hugin1/hugin/xrc/preview_frame.xrc Thu Sep 29 23:41:55 2011 +0100 +++ b/src/hugin1/hugin/xrc/preview_frame.xrc Fri Sep 30 10:17:45 2011 +0200 @@ -519,6 +519,41 @@ <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_VERTICAL</flag> <border>5</border> </object> + <object class="sizeritem"> + <object class="wxStaticLine"> + <size>2,-1</size> + </object> + <flag>wxEXPAND|wxALIGN_CENTRE_VERTICAL</flag> + </object> + <object class="sizeritem"> + <object class="wxBoxSizer"> + <object class="sizeritem"> + <object class="wxStaticText"> + <label>Guides:</label> + </object> + <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_VERTICAL</flag> + <border>5</border> + </object> + <object class="sizeritem"> + <object class="wxChoice" name="preview_guide_choice_proj"> + <content> + <item>None</item> + <item>Rule of third</item> + <item>Golden ratio</item> + <item>Diagonal</item> + <item>Golden triangle (down)</item> + <item>Golden triangle (up)</item> + </content> + <selection>0</selection> + </object> + <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_VERTICAL</flag> + <border>5</border> + </object> + <orient>wxHORIZONTAL</orient> + </object> + <flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag> + <border>5</border> + </object> </object> </object> </object> @@ -714,7 +749,7 @@ <border>5</border> </object> <object class="sizeritem"> - <object class="wxChoice" name="preview_guide_choice"> + <object class="wxChoice" name="preview_guide_choice_crop"> <content> <item>None</item> <item>Rule of third</item> @@ -1177,6 +1212,41 @@ <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_VERTICAL</flag> <border>5</border> </object> + <object class="sizeritem"> + <object class="wxStaticLine"> + <size>2,-1</size> + </object> + <flag>wxEXPAND|wxALIGN_CENTRE_VERTICAL</flag> + </object> + <object class="sizeritem"> + <object class="wxBoxSizer"> + <object class="sizeritem"> + <object class="wxStaticText"> + <label>Guides:</label> + </object> + <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_VERTICAL</flag> + <border>5</border> + </object> + <object class="sizeritem"> + <object class="wxChoice" name="preview_guide_choice_proj"> + <content> + <item>None</item> + <item>Rule of third</item> + <item>Golden ratio</item> + <item>Diagonal</item> + <item>Golden triangle (down)</item> + <item>Golden triangle (up)</item> + </content> + <selection>0</selection> + </object> + <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_VERTICAL</flag> + <border>5</border> + </object> + <orient>wxHORIZONTAL</orient> + </object> + <flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag> + <border>5</border> + </object> </object> </object> </object> @@ -1388,7 +1458,7 @@ <border>5</border> </object> <object class="sizeritem"> - <object class="wxChoice" name="preview_guide_choice"> + <object class="wxChoice" name="preview_guide_choice_crop"> <content> <item>None</item> <item>Rule of third</item> |