From: Pablo d'A. <da...@us...> - 2006-11-30 07:36:52
|
Update of /cvsroot/hugin/hugin/src/hugin In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv4280/src/hugin Modified Files: MainFrame.cpp PanoPanel.cpp PreviewFrame.cpp Log Message: added numerical transform and improved boost detection Index: MainFrame.cpp =================================================================== RCS file: /cvsroot/hugin/hugin/src/hugin/MainFrame.cpp,v retrieving revision 1.181 retrieving revision 1.182 diff -u -d -r1.181 -r1.182 --- MainFrame.cpp 11 Nov 2006 21:29:25 -0000 1.181 +++ MainFrame.cpp 30 Nov 2006 07:36:48 -0000 1.182 @@ -475,12 +475,16 @@ wxConfigBase *config = wxConfig::Get(); progs.PTStitcher = config->Read(wxT("/PanoTools/PTStitcherExe"),wxT(HUGIN_PT_STITCHER_EXE)).mb_str(); progs.enblend = config->Read(wxT("/Enblend/EnblendExe"),wxT(HUGIN_ENBLEND_EXE)).mb_str(); + wxString t = huginApp::Get()->GetXRCPath(); + std::string mkPath = (const char *) t.mb_str(); + mkPath.append("data/"); createMakefile(pano, prefix, "test", pano.getOptions(), all, progs, + mkPath, makefile); } SetStatusText(wxString::Format(_("saved project %s"), m_filename.c_str()),0); Index: PanoPanel.cpp =================================================================== RCS file: /cvsroot/hugin/hugin/src/hugin/PanoPanel.cpp,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- PanoPanel.cpp 11 Nov 2006 21:29:25 -0000 1.100 +++ PanoPanel.cpp 30 Nov 2006 07:36:48 -0000 1.101 @@ -563,7 +563,7 @@ PT::PanoImage img = pano.getImage(i); PT::ImageOptions iopt = img.getOptions(); // get hfov - double v = const_map_get(pano.getImageVariables(i),"v").getValue(); + //double v = const_map_get(pano.getImageVariables(i),"v").getValue(); double s = calcOptimalPanoScale(pano.getSrcImage(i), opt); if (scale < s) { scale = s; Index: PreviewFrame.cpp =================================================================== RCS file: /cvsroot/hugin/hugin/src/hugin/PreviewFrame.cpp,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- PreviewFrame.cpp 18 Aug 2006 12:51:34 -0000 1.61 +++ PreviewFrame.cpp 30 Nov 2006 07:36:48 -0000 1.62 @@ -64,6 +64,7 @@ EVT_TOOL(XRCID("preview_update_tool"), PreviewFrame::OnUpdate) EVT_TOOL(XRCID("preview_show_all_tool"), PreviewFrame::OnShowAll) EVT_TOOL(XRCID("preview_show_none_tool"), PreviewFrame::OnShowNone) + EVT_TOOL(XRCID("preview_num_transform"), PreviewFrame::OnNumTransform) EVT_CHOICE(ID_BLEND_CHOICE, PreviewFrame::OnBlendChoice) EVT_CHOICE(ID_PROJECTION_CHOICE, PreviewFrame::OnProjectionChoice) #ifdef USE_TOGGLE_BUTTON @@ -451,6 +452,14 @@ if (m_druid) m_druid->Update(m_pano); } +void PreviewFrame::updatePano() +{ + if (!m_ToolBar->GetToolState(XRCID("preview_auto_update_tool"))) { + m_PreviewPanel->ForceUpdate(); + } + if (m_druid) m_druid->Update(m_pano); +} + void PreviewFrame::OnFitPano(wxCommandEvent & e) { DEBUG_TRACE(""); @@ -466,8 +475,7 @@ ); DEBUG_INFO ( "new fov: [" << opt.getHFOV() << " "<< opt.getVFOV() << "] => height: " << opt.getHeight() ); - m_PreviewPanel->ForceUpdate(); - if (m_druid) m_druid->Update(m_pano); + updatePano(); } void PreviewFrame::OnShowAll(wxCommandEvent & e) @@ -494,6 +502,40 @@ ); } +void PreviewFrame::OnNumTransform(wxCommandEvent & e) +{ + wxDialog dlg; + wxXmlResource::Get()->LoadDialog(&dlg, this, wxT("dlg_numtrans")); + if (dlg.ShowModal() == wxID_OK ) { + wxString text = XRCCTRL(dlg, "numtrans_yaw", wxTextCtrl)->GetValue(); + double y; + if (!str2double(text, y)) { + wxLogError(_("Yaw value must be numeric.")); + return; + } + text = XRCCTRL(dlg, "numtrans_pitch", wxTextCtrl)->GetValue(); + double p; + if (!str2double(text, p)) { + wxLogError(_("Pitch value must be numeric.")); + return; + } + text = XRCCTRL(dlg, "numtrans_roll", wxTextCtrl)->GetValue(); + double r; + if (!str2double(text, r)) { + wxLogError(_("Roll value must be numeric.")); + return; + } + GlobalCmdHist::getInstance().addCommand( + new PT::RotatePanoCmd(m_pano, y, p, r) + ); + // update preview panel + updatePano(); + + } else { + DEBUG_DEBUG("Numerical transform canceled"); + } +} + void PreviewFrame::OnChangeFOV(wxScrollEvent & e) { DEBUG_TRACE(""); @@ -545,7 +587,7 @@ new PT::SetPanoOptionsCmd( m_pano, opt ) ); DEBUG_DEBUG ("Projection changed: " << lt); - m_PreviewPanel->ForceUpdate(); + updatePano(); } else { DEBUG_WARN("wxChoice event from unknown object received"); |