From: <da...@us...> - 2009-09-27 17:45:51
|
Revision: 4500 http://hugin.svn.sourceforge.net/hugin/?rev=4500&view=rev Author: dangelo Date: 2009-09-27 17:45:39 +0000 (Sun, 27 Sep 2009) Log Message: ----------- Added support for the TrX, TrY and TrZ parameters. Modified Paths: -------------- hugin/branches/gsoc2009_layout/src/foreign/vigra/vigra/diff2d.hxx hugin/branches/gsoc2009_layout/src/foreign/vigra/vigra/rational.hxx hugin/branches/gsoc2009_layout/src/hugin1/hugin/ImagesList.cpp hugin/branches/gsoc2009_layout/src/hugin1/hugin/ImagesPanel.cpp hugin/branches/gsoc2009_layout/src/hugin1/hugin/ImagesPanel.h hugin/branches/gsoc2009_layout/src/hugin1/hugin/OptimizePanel.cpp hugin/branches/gsoc2009_layout/src/hugin1/hugin/OptimizePanel.h hugin/branches/gsoc2009_layout/src/hugin1/hugin/ViewState.cpp hugin/branches/gsoc2009_layout/src/hugin1/hugin/xrc/images_panel.xrc hugin/branches/gsoc2009_layout/src/hugin1/hugin/xrc/optimize_panel.xrc hugin/branches/gsoc2009_layout/src/hugin_base/panodata/ImageVariableTranslate.h hugin/branches/gsoc2009_layout/src/hugin_base/panodata/PTScriptParsing.cpp hugin/branches/gsoc2009_layout/src/hugin_base/panodata/Panorama.cpp hugin/branches/gsoc2009_layout/src/hugin_base/panodata/PanoramaVariable.cpp hugin/branches/gsoc2009_layout/src/hugin_base/panodata/SrcPanoImage.cpp hugin/branches/gsoc2009_layout/src/hugin_base/panodata/image_variables.h hugin/branches/gsoc2009_layout/src/hugin_base/panotools/PanoToolsInterface.cpp Modified: hugin/branches/gsoc2009_layout/src/foreign/vigra/vigra/diff2d.hxx =================================================================== --- hugin/branches/gsoc2009_layout/src/foreign/vigra/vigra/diff2d.hxx 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/foreign/vigra/vigra/diff2d.hxx 2009-09-27 17:45:39 UTC (rev 4500) @@ -1131,7 +1131,7 @@ bool contains(Rect2D const &r) const { return r.isEmpty() || - contains(r.upperLeft()) && contains(r.lowerRight()-Diff2D(1,1)); + (contains(r.upperLeft()) && contains(r.lowerRight()-Diff2D(1,1))); } /** Return whether this rectangle overlaps with the given Modified: hugin/branches/gsoc2009_layout/src/foreign/vigra/vigra/rational.hxx =================================================================== --- hugin/branches/gsoc2009_layout/src/foreign/vigra/vigra/rational.hxx 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/foreign/vigra/vigra/rational.hxx 2009-09-27 17:45:39 UTC (rev 4500) @@ -1014,14 +1014,16 @@ // Handle the easy cases. Take advantage of the fact // that the denominator is never negative. - if(l.denominator() == zero) - if(r.denominator() == zero) + if(l.denominator() == zero) { + if(r.denominator() == zero) { // -inf < inf, !(-inf < -inf), !(inf < -inf), !(inf < inf) return l.numerator() < r.numerator(); - else + } else { // -inf < -1, -inf < 0, -inf < 1 // !(inf < -1), !(inf < 0), !(inf < 1) return l.numerator() < zero; + } + } if(r.denominator() == zero) // -1 < inf, 0 < inf, 1 < inf // !(-1 < -inf), !(0 < -inf), !(1 < -inf) Modified: hugin/branches/gsoc2009_layout/src/hugin1/hugin/ImagesList.cpp =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin1/hugin/ImagesList.cpp 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin1/hugin/ImagesList.cpp 2009-09-27 17:45:39 UTC (rev 4500) @@ -356,9 +356,12 @@ InsertColumn( 4, _("yaw (y)"), wxLIST_FORMAT_RIGHT, 60 ); InsertColumn( 5, _("pitch (p)"), wxLIST_FORMAT_RIGHT, 60 ); InsertColumn( 6, _("roll (r)"), wxLIST_FORMAT_RIGHT, 60 ); - InsertColumn( 7, _("Anchor"), wxLIST_FORMAT_RIGHT, 60 ); - InsertColumn( 8, _("# Ctrl Pnts"), wxLIST_FORMAT_RIGHT, 60); - InsertColumn( 9, _("Stack Number"), wxLIST_FORMAT_RIGHT, 60); + InsertColumn( 7, _("X (TrX)"), wxLIST_FORMAT_RIGHT, 60 ); + InsertColumn( 8, _("Y (TrY)"), wxLIST_FORMAT_RIGHT, 60 ); + InsertColumn( 9, _("Z (TrZ)"), wxLIST_FORMAT_RIGHT, 60 ); + InsertColumn( 10, _("Anchor"), wxLIST_FORMAT_RIGHT, 60 ); + InsertColumn( 11, _("# Ctrl Pnts"), wxLIST_FORMAT_RIGHT, 60); + InsertColumn( 12, _("Stack Number"), wxLIST_FORMAT_RIGHT, 60); //get saved width for ( int j=0; j < GetColumnCount() ; j++ ) @@ -391,6 +394,9 @@ SetItem(imgNr, 4, doubleTowxString(img.getYaw(), m_degDigits)); SetItem(imgNr, 5, doubleTowxString(img.getPitch(), m_degDigits)); SetItem(imgNr, 6, doubleTowxString(img.getRoll(), m_degDigits)); + SetItem(imgNr, 7, doubleTowxString(img.getX(), m_distDigits)); + SetItem(imgNr, 8, doubleTowxString(img.getY(), m_distDigits)); + SetItem(imgNr, 9, doubleTowxString(img.getZ(), m_distDigits)); wxChar flags[] = wxT("--"); if (pano->getOptions().optimizeReferenceImage == imgNr) { flags[0]='A'; @@ -398,7 +404,7 @@ if (pano->getOptions().colorReferenceImage == imgNr) { flags[1]='C'; } - SetItem(imgNr,7, wxString(flags, wxConvLocal)); + SetItem(imgNr,10, wxString(flags, wxConvLocal)); // urgh.. slow.. stupid.. traverse control point list for each image.. const CPVector & cps = pano->getCtrlPoints(); int nCP=0; @@ -407,13 +413,13 @@ nCP++; } } - SetItem(imgNr, 8, wxString::Format(wxT("%d"), nCP)); + SetItem(imgNr, 11, wxString::Format(wxT("%d"), nCP)); } void ImagesListImage::UpdatePartNumbersForItem(unsigned int imgNr) { unsigned int stackNumber = variable_groups->getStacks().getPartNumber(imgNr); - SetItem(imgNr, 9, wxString::Format(wxT("%d"), stackNumber)); + SetItem(imgNr, 12, wxString::Format(wxT("%d"), stackNumber)); } IMPLEMENT_DYNAMIC_CLASS(ImagesListImage, ImagesList) Modified: hugin/branches/gsoc2009_layout/src/hugin1/hugin/ImagesPanel.cpp =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin1/hugin/ImagesPanel.cpp 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin1/hugin/ImagesPanel.cpp 2009-09-27 17:45:39 UTC (rev 4500) @@ -63,6 +63,12 @@ ImgPreview * canvas; +#define m_XRCID(str_id) \ + wxXmlResource::GetXRCID(str_id) +#define m_XRCCTRL(window, id, type) \ + ((type*)((window).FindWindow(m_XRCID(id)))) + + //------------------------------------------------------------------------------ #define GET_VAR(val) pano->getVariable(orientationEdit_RefImg).val.getValue() @@ -86,9 +92,12 @@ EVT_BUTTON ( XRCID("images_celeste_button"), ImagesPanel::OnCelesteButton) EVT_BUTTON ( XRCID("images_new_stack"), ImagesPanel::OnNewStack) EVT_BUTTON ( XRCID("images_change_stack"), ImagesPanel::OnChangeStack) - EVT_TEXT_ENTER ( XRCID("images_text_yaw"), ImagesPanel::OnYawTextChanged ) - EVT_TEXT_ENTER ( XRCID("images_text_pitch"), ImagesPanel::OnPitchTextChanged ) - EVT_TEXT_ENTER ( XRCID("images_text_roll"), ImagesPanel::OnRollTextChanged ) + EVT_TEXT_ENTER ( XRCID("images_text_y"), ImagesPanel::OnVarTextChanged ) + EVT_TEXT_ENTER ( XRCID("images_text_p"), ImagesPanel::OnVarTextChanged ) + EVT_TEXT_ENTER ( XRCID("images_text_r"), ImagesPanel::OnVarTextChanged ) + EVT_TEXT_ENTER ( XRCID("images_text_X"), ImagesPanel::OnVarTextChanged ) + EVT_TEXT_ENTER ( XRCID("images_text_Y"), ImagesPanel::OnVarTextChanged ) + EVT_TEXT_ENTER ( XRCID("images_text_Z"), ImagesPanel::OnVarTextChanged ) EVT_CHECKBOX ( XRCID("images_check_link"), ImagesPanel::OnImageLinkChanged ) END_EVENT_TABLE() @@ -146,9 +155,12 @@ DEBUG_ASSERT(m_smallImgCtrl); // converts KILL_FOCUS events to usable TEXT_ENTER events - XRCCTRL(*this, "images_text_yaw", wxTextCtrl)->PushEventHandler(new TextKillFocusHandler(this)); - XRCCTRL(*this, "images_text_roll", wxTextCtrl)->PushEventHandler(new TextKillFocusHandler(this)); - XRCCTRL(*this, "images_text_pitch", wxTextCtrl)->PushEventHandler(new TextKillFocusHandler(this)); + XRCCTRL(*this, "images_text_y", wxTextCtrl)->PushEventHandler(new TextKillFocusHandler(this)); + XRCCTRL(*this, "images_text_r", wxTextCtrl)->PushEventHandler(new TextKillFocusHandler(this)); + XRCCTRL(*this, "images_text_p", wxTextCtrl)->PushEventHandler(new TextKillFocusHandler(this)); + XRCCTRL(*this, "images_text_X", wxTextCtrl)->PushEventHandler(new TextKillFocusHandler(this)); + XRCCTRL(*this, "images_text_Y", wxTextCtrl)->PushEventHandler(new TextKillFocusHandler(this)); + XRCCTRL(*this, "images_text_Z", wxTextCtrl)->PushEventHandler(new TextKillFocusHandler(this)); m_empty.LoadFile(huginApp::Get()->GetXRCPath() + wxT("data/") + wxT("druid.images.128.png"), @@ -180,9 +192,12 @@ { DEBUG_TRACE("dtor"); - XRCCTRL(*this, "images_text_yaw", wxTextCtrl)->PopEventHandler(true); - XRCCTRL(*this, "images_text_roll", wxTextCtrl)->PopEventHandler(true); - XRCCTRL(*this, "images_text_pitch", wxTextCtrl)->PopEventHandler(true); + XRCCTRL(*this, "images_text_y", wxTextCtrl)->PopEventHandler(true); + XRCCTRL(*this, "images_text_r", wxTextCtrl)->PopEventHandler(true); + XRCCTRL(*this, "images_text_p", wxTextCtrl)->PopEventHandler(true); + XRCCTRL(*this, "images_text_X", wxTextCtrl)->PopEventHandler(true); + XRCCTRL(*this, "images_text_Y", wxTextCtrl)->PopEventHandler(true); + XRCCTRL(*this, "images_text_Z", wxTextCtrl)->PopEventHandler(true); /* delete(m_tkf); */ @@ -293,68 +308,43 @@ }; -// Yaw by text -> double -void ImagesPanel::OnYawTextChanged ( wxCommandEvent & e ) +void ImagesPanel::OnVarTextChanged ( wxCommandEvent & e ) { + if ( images_list->GetSelected().size() > 0 ) { - wxString text = XRCCTRL(*this, "images_text_yaw" - , wxTextCtrl) ->GetValue(); - if (text == wxT("")) { - return; - } - DEBUG_INFO ("yaw = " << text ); - double val; - if (!str2double(text, val)) { -// if (!text.ToDouble(&val)) { - wxLogError(_("Value must be numeric.")); - return; - } - ChangePano ( "y" , val ); + std::string varname; + double val; - } -} + + const char vars[] = "rpyXYZ"; + for (const char * var = vars; *var; var++) { + wxString ctrl_name(wxT("images_text_")); + ctrl_name.Append(wxChar(*var)); + if (e.GetId() == wxXmlResource::GetXRCID(ctrl_name)) { -void ImagesPanel::OnPitchTextChanged ( wxCommandEvent & e ) -{ - if ( images_list->GetSelected().size() > 0 ) { - wxString text = XRCCTRL(*this, "images_text_pitch" - , wxTextCtrl) ->GetValue(); - DEBUG_INFO ("pitch = " << text ); - if (text == wxT("")) { - return; - } + wxString text = m_XRCCTRL(*this, ctrl_name, wxTextCtrl)->GetValue(); - double val; - if (!str2double(text, val)) { -// if (!text.ToDouble(&val)) { - wxLogError(_("Value must be numeric.")); - return; - } - ChangePano ( "p" , val ); + // hack to add the T to the x. This should really use SrcPanoImage instead.. + char name[4]; + if (*var > 'Z') { + name[0] = *var; name[1] = 0; + } else { + name[0] = 'T'; name[1]='r'; name[2]=*var; name[3] = 0; + } + if (!str2double(text, val)){ + DEBUG_NOTICE("Value (" << text << ") for var " << name << " must be numeric."); + wxLogError(_("Value must be numeric.")); + return; + } + Variable img_var(name, val); + GlobalCmdHist::getInstance().addCommand( + new PT::SetVariableCmd(*pano, images_list->GetSelected(), img_var)); + } + } } } -void ImagesPanel::OnRollTextChanged ( wxCommandEvent & e ) -{ - if ( images_list->GetSelected().size() > 0 ) { - wxString text = XRCCTRL(*this, "images_text_roll" - , wxTextCtrl) ->GetValue(); - DEBUG_INFO ("roll = " << text ); - if (text == wxT("")) { - return; - } - - double val; - if (!str2double(text, val)) { -// if (!text.ToDouble(&val)) { - wxLogError(_("Value must be numeric.")); - return; - } - ChangePano ( "r" , val ); - } -} - void ImagesPanel::OnImageLinkChanged(wxCommandEvent &e ) { // link or unlink yaw, pitch and roll for selected stacks. @@ -448,9 +438,12 @@ void ImagesPanel::DisableImageCtrls() { // disable controls - XRCCTRL(*this, "images_text_yaw", wxTextCtrl) ->Disable(); - XRCCTRL(*this, "images_text_roll", wxTextCtrl) ->Disable(); - XRCCTRL(*this, "images_text_pitch", wxTextCtrl) ->Disable(); + XRCCTRL(*this, "images_text_y", wxTextCtrl) ->Disable(); + XRCCTRL(*this, "images_text_r", wxTextCtrl) ->Disable(); + XRCCTRL(*this, "images_text_p", wxTextCtrl) ->Disable(); + XRCCTRL(*this, "images_text_X", wxTextCtrl) ->Disable(); + XRCCTRL(*this, "images_text_Y", wxTextCtrl) ->Disable(); + XRCCTRL(*this, "images_text_Z", wxTextCtrl) ->Disable(); XRCCTRL(*this, "images_selected_image", wxStaticBitmap)-> SetBitmap(m_empty); m_optAnchorButton->Disable(); @@ -468,9 +461,12 @@ void ImagesPanel::EnableImageCtrls() { // enable control if not already enabled - if (XRCCTRL(*this, "images_text_yaw", wxTextCtrl)->Enable()) { - XRCCTRL(*this, "images_text_roll", wxTextCtrl) ->Enable(); - XRCCTRL(*this, "images_text_pitch", wxTextCtrl) ->Enable(); + if (XRCCTRL(*this, "images_text_y", wxTextCtrl)->Enable()) { + XRCCTRL(*this, "images_text_r", wxTextCtrl) ->Enable(); + XRCCTRL(*this, "images_text_p", wxTextCtrl) ->Enable(); + XRCCTRL(*this, "images_text_X", wxTextCtrl) ->Enable(); + XRCCTRL(*this, "images_text_Y", wxTextCtrl) ->Enable(); + XRCCTRL(*this, "images_text_Z", wxTextCtrl) ->Enable(); m_moveDownButton->Enable(); m_moveUpButton->Enable(); XRCCTRL(*this, "images_reset_pos", wxButton)->Enable(); @@ -488,13 +484,22 @@ std::string val; val = doubleToString(const_map_get(vars,"y").getValue(),m_degDigits); - XRCCTRL(*this, "images_text_yaw", wxTextCtrl) ->SetValue(wxString(val.c_str(), wxConvLocal)); + XRCCTRL(*this, "images_text_y", wxTextCtrl) ->SetValue(wxString(val.c_str(), wxConvLocal)); val = doubleToString(const_map_get(vars,"p").getValue(),m_degDigits); - XRCCTRL(*this, "images_text_pitch", wxTextCtrl) ->SetValue(wxString(val.c_str(), wxConvLocal)); + XRCCTRL(*this, "images_text_p", wxTextCtrl) ->SetValue(wxString(val.c_str(), wxConvLocal)); val = doubleToString(const_map_get(vars,"r").getValue(),m_degDigits); - XRCCTRL(*this, "images_text_roll", wxTextCtrl) ->SetValue(wxString(val.c_str(), wxConvLocal)); + XRCCTRL(*this, "images_text_r", wxTextCtrl) ->SetValue(wxString(val.c_str(), wxConvLocal)); + + val = doubleToString(const_map_get(vars,"TrX").getValue(),m_degDigits); + XRCCTRL(*this, "images_text_X", wxTextCtrl) ->SetValue(wxString(val.c_str(), wxConvLocal)); + + val = doubleToString(const_map_get(vars,"TrY").getValue(),m_degDigits); + XRCCTRL(*this, "images_text_Y", wxTextCtrl) ->SetValue(wxString(val.c_str(), wxConvLocal)); + + val = doubleToString(const_map_get(vars,"TrZ").getValue(),m_degDigits); + XRCCTRL(*this, "images_text_Z", wxTextCtrl) ->SetValue(wxString(val.c_str(), wxConvLocal)); m_linkCheckBox->SetValue(pano->getImage(imgNr).YawisLinked()); @@ -504,9 +509,12 @@ void ImagesPanel::ClearImgParameters() { - XRCCTRL(*this, "images_text_yaw", wxTextCtrl) ->Clear(); - XRCCTRL(*this, "images_text_roll", wxTextCtrl) ->Clear(); - XRCCTRL(*this, "images_text_pitch", wxTextCtrl) ->Clear(); + XRCCTRL(*this, "images_text_y", wxTextCtrl) ->Clear(); + XRCCTRL(*this, "images_text_r", wxTextCtrl) ->Clear(); + XRCCTRL(*this, "images_text_p", wxTextCtrl) ->Clear(); + XRCCTRL(*this, "images_text_X", wxTextCtrl) ->Clear(); + XRCCTRL(*this, "images_text_Y", wxTextCtrl) ->Clear(); + XRCCTRL(*this, "images_text_Z", wxTextCtrl) ->Clear(); XRCCTRL(*this, "images_selected_image", wxStaticBitmap)-> SetBitmap(m_empty); @@ -631,6 +639,9 @@ vars[i].insert(make_pair("y", Variable("y",0.0))); vars[i].insert(make_pair("p", Variable("p",0.0))); vars[i].insert(make_pair("r", Variable("r",0.0))); + vars[i].insert(make_pair("TrX", Variable("TrX",0.0))); + vars[i].insert(make_pair("TrY", Variable("TrY",0.0))); + vars[i].insert(make_pair("TrZ", Variable("TrZ",0.0))); i++; } GlobalCmdHist::getInstance().addCommand( Modified: hugin/branches/gsoc2009_layout/src/hugin1/hugin/ImagesPanel.h =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin1/hugin/ImagesPanel.h 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin1/hugin/ImagesPanel.h 2009-09-27 17:45:39 UTC (rev 4500) @@ -97,10 +97,7 @@ // Here we select the preview image /** gui -> pano */ - void OnYawTextChanged ( wxCommandEvent & e ); - void OnPitchTextChanged ( wxCommandEvent & e ); - void OnRollTextChanged ( wxCommandEvent & e ); - + void OnVarTextChanged ( wxCommandEvent & e ); void OnImageLinkChanged ( wxCommandEvent & e ); void OnOptAnchorChanged(wxCommandEvent & e); Modified: hugin/branches/gsoc2009_layout/src/hugin1/hugin/OptimizePanel.cpp =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin1/hugin/OptimizePanel.cpp 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin1/hugin/OptimizePanel.cpp 2009-09-27 17:45:39 UTC (rev 4500) @@ -57,11 +57,21 @@ // EVT_BUTTON(XRCID("opt_pitch_equalize"), OptimizePanel::OnEqPitch) EVT_BUTTON(XRCID("opt_roll_select"), OptimizePanel::OnListButton) EVT_BUTTON(XRCID("opt_roll_clear"), OptimizePanel::OnListButton) + EVT_BUTTON(XRCID("opt_x_select"), OptimizePanel::OnListButton) + EVT_BUTTON(XRCID("opt_x_clear"), OptimizePanel::OnListButton) + EVT_BUTTON(XRCID("opt_y_select"), OptimizePanel::OnListButton) + EVT_BUTTON(XRCID("opt_y_clear"), OptimizePanel::OnListButton) + EVT_BUTTON(XRCID("opt_z_select"), OptimizePanel::OnListButton) + EVT_BUTTON(XRCID("opt_z_clear"), OptimizePanel::OnListButton) + EVT_CHOICE(XRCID("optimize_panel_mode"), OptimizePanel::OnChangeMode) // EVT_BUTTON(XRCID("opt_roll_equalize"), OptimizePanel::OnEqRoll) EVT_CHECKLISTBOX(XRCID("optimizer_yaw_list"), OptimizePanel::OnCheckBoxChanged) EVT_CHECKLISTBOX(XRCID("optimizer_pitch_list"), OptimizePanel::OnCheckBoxChanged) EVT_CHECKLISTBOX(XRCID("optimizer_roll_list"), OptimizePanel::OnCheckBoxChanged) + EVT_CHECKLISTBOX(XRCID("optimizer_x_list"), OptimizePanel::OnCheckBoxChanged) + EVT_CHECKLISTBOX(XRCID("optimizer_y_list"), OptimizePanel::OnCheckBoxChanged) + EVT_CHECKLISTBOX(XRCID("optimizer_z_list"), OptimizePanel::OnCheckBoxChanged) EVT_CHECKLISTBOX(XRCID("optimizer_v_list"), OptimizePanel::OnCheckBoxChanged) EVT_CHECKLISTBOX(XRCID("optimizer_a_list"), OptimizePanel::OnCheckBoxChanged) EVT_CHECKLISTBOX(XRCID("optimizer_b_list"), OptimizePanel::OnCheckBoxChanged) @@ -106,6 +116,9 @@ m_yaw_list = XRCCTRL(*this, "optimizer_yaw_list", wxCheckListBox); m_pitch_list = XRCCTRL(*this, "optimizer_pitch_list", wxCheckListBox); m_roll_list = XRCCTRL(*this, "optimizer_roll_list", wxCheckListBox); + m_x_list = XRCCTRL(*this, "optimizer_x_list", wxCheckListBox); + m_y_list = XRCCTRL(*this, "optimizer_y_list", wxCheckListBox); + m_z_list = XRCCTRL(*this, "optimizer_z_list", wxCheckListBox); m_v_list = XRCCTRL(*this, "optimizer_v_list", wxCheckListBox); m_a_list = XRCCTRL(*this, "optimizer_a_list", wxCheckListBox); @@ -184,6 +197,18 @@ SetCheckMark(m_roll_list,true); } else if (e.GetId() == XRCID("opt_roll_clear")) { SetCheckMark(m_roll_list,false); + } else if (e.GetId() == XRCID("opt_x_select")) { + SetCheckMark(m_x_list,true); + } else if (e.GetId() == XRCID("opt_x_clear")) { + SetCheckMark(m_x_list,false); + } else if (e.GetId() == XRCID("opt_y_select")) { + SetCheckMark(m_y_list,true); + } else if (e.GetId() == XRCID("opt_y_clear")) { + SetCheckMark(m_y_list,false); + } else if (e.GetId() == XRCID("opt_z_select")) { + SetCheckMark(m_z_list,true); + } else if (e.GetId() == XRCID("opt_z_clear")) { + SetCheckMark(m_z_list,false); } else { DEBUG_FATAL("An error has occured"); } @@ -277,6 +302,16 @@ imgopt.insert("y"); } + if (m_x_list->IsChecked(i)) { + imgopt.insert("TrX"); + } + if (m_y_list->IsChecked(i)) { + imgopt.insert("TrY"); + } + if (m_z_list->IsChecked(i)) { + imgopt.insert("TrZ"); + } + optvars.push_back(imgopt); } @@ -350,6 +385,9 @@ m_yaw_list->Append(wxString::Format(wxT("%d"),nr)); m_pitch_list->Append(wxString::Format(wxT("%d"),nr)); m_roll_list->Append(wxString::Format(wxT("%d"),nr)); + m_x_list->Append(wxString::Format(wxT("%d"),nr)); + m_y_list->Append(wxString::Format(wxT("%d"),nr)); + m_z_list->Append(wxString::Format(wxT("%d"),nr)); nr++; } @@ -359,6 +397,9 @@ m_yaw_list->Delete(nr-1); m_pitch_list->Delete(nr-1); m_roll_list->Delete(nr-1); + m_x_list->Delete(nr-1); + m_y_list->Delete(nr-1); + m_z_list->Delete(nr-1); nr--; } @@ -382,6 +423,21 @@ m_roll_list->SetString(*it, wxString::Format(wxT("%d (%.3f)"), *it, const_map_get(vars,"r").getValue())); m_roll_list->Check(*it,sel); + + sel = m_x_list->IsChecked(*it); + m_x_list->SetString(*it, wxString::Format(wxT("%d (%.3f)"), + *it, const_map_get(vars,"TrX").getValue())); + m_x_list->Check(*it,sel); + + sel = m_y_list->IsChecked(*it); + m_y_list->SetString(*it, wxString::Format(wxT("%d (%.3f)"), + *it, const_map_get(vars,"TrY").getValue())); + m_y_list->Check(*it,sel); + + sel = m_z_list->IsChecked(*it); + m_z_list->SetString(*it, wxString::Format(wxT("%d (%.3f)"), + *it, const_map_get(vars,"TrZ").getValue())); + m_z_list->Check(*it,sel); } // display lens values if they are linked @@ -475,6 +531,9 @@ m_yaw_list->Check(i,false); m_pitch_list->Check(i,false); m_roll_list->Check(i,false); + m_x_list->Check(i,false); + m_y_list->Check(i,false); + m_z_list->Check(i,false); unsigned int lensNr = variable_groups->getLenses().getPartNumber(i); for(set<string>::const_iterator it = optvec[i].begin(); @@ -489,6 +548,15 @@ if (*it == "r") { m_roll_list->Check(i); } + if (*it == "TrX") { + m_x_list->Check(i); + } + if (*it == "TrY") { + m_y_list->Check(i); + } + if (*it == "TrZ") { + m_z_list->Check(i); + } if (*it == "v") { m_v_list->Check(lensNr); @@ -540,6 +608,10 @@ optvars2.insert("y"); optvars2.insert("p"); optvars2.insert("r"); + // TODO: check tilt mode here, before inserting the parameters. + optvars2.insert("TrX"); + optvars2.insert("TrY"); + optvars2.insert("TrZ"); // remove vertical and horizontal control points CPVector cps = optPano.getCtrlPoints(); @@ -686,6 +758,11 @@ SetCheckMark(m_yaw_list,true); SetCheckMark(m_roll_list,true); SetCheckMark(m_pitch_list,true); + /* + SetCheckMark(m_x_list,true); + SetCheckMark(m_y_list,true); + SetCheckMark(m_z_list,true); + */ SetCheckMark(m_v_list,false); SetCheckMark(m_a_list,false); SetCheckMark(m_b_list,false); @@ -827,6 +904,9 @@ m_yaw_list->Disable(); m_pitch_list->Disable(); m_roll_list->Disable(); + m_x_list->Disable(); + m_y_list->Disable(); + m_z_list->Disable(); m_v_list->Disable(); m_a_list->Disable(); m_b_list->Disable(); @@ -843,6 +923,9 @@ m_yaw_list->Enable(); m_pitch_list->Enable(); m_roll_list->Enable(); + m_x_list->Enable(); + m_y_list->Enable(); + m_z_list->Enable(); m_v_list->Enable(); m_a_list->Enable(); m_b_list->Enable(); Modified: hugin/branches/gsoc2009_layout/src/hugin1/hugin/OptimizePanel.h =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin1/hugin/OptimizePanel.h 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin1/hugin/OptimizePanel.h 2009-09-27 17:45:39 UTC (rev 4500) @@ -92,6 +92,10 @@ wxCheckListBox * m_pitch_list; wxCheckListBox * m_roll_list; + wxCheckListBox * m_x_list; + wxCheckListBox * m_y_list; + wxCheckListBox * m_z_list; + wxCheckListBox * m_v_list; wxCheckListBox * m_a_list; wxCheckListBox * m_b_list; Modified: hugin/branches/gsoc2009_layout/src/hugin1/hugin/ViewState.cpp =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin1/hugin/ViewState.cpp 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin1/hugin/ViewState.cpp 2009-09-27 17:45:39 UTC (rev 4500) @@ -201,6 +201,9 @@ if ( new_img->getRoll() != img->getRoll() || new_img->getPitch() != img->getPitch() || new_img->getYaw() != img->getYaw() + || new_img->getX() != img->getX() + || new_img->getY() != img->getY() + || new_img->getZ() != img->getZ() || new_img->getHFOV() != img->getHFOV() || new_img->getProjection() != img->getProjection() || new_img->getShear() != img->getShear() Modified: hugin/branches/gsoc2009_layout/src/hugin1/hugin/xrc/images_panel.xrc =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin1/hugin/xrc/images_panel.xrc 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin1/hugin/xrc/images_panel.xrc 2009-09-27 17:45:39 UTC (rev 4500) @@ -118,21 +118,21 @@ </object> </object> <flag>wxEXPAND</flag> - </object> - <object class="sizeritem"> - <object class="wxStaticLine"> - <style></style> - </object> - <flag>wxTOP|wxBOTTOM|wxEXPAND</flag> - <border>6</border> - </object> - <object class="sizeritem"> - <object class="wxButton" name="images_celeste_button"> - <label>Run Celeste</label> - <tooltip>Tries to remove control points from clouds</tooltip> - </object> - <flag>wxEXPAND</flag> - </object> + </object> + <object class="sizeritem"> + <object class="wxStaticLine"> + <style></style> + </object> + <flag>wxTOP|wxBOTTOM|wxEXPAND</flag> + <border>6</border> + </object> + <object class="sizeritem"> + <object class="wxButton" name="images_celeste_button"> + <label>Run Celeste</label> + <tooltip>Tries to remove control points from clouds</tooltip> + </object> + <flag>wxEXPAND</flag> + </object> <object class="spacer"> <size>0,10</size> </object> @@ -178,7 +178,7 @@ <flag>wxALIGN_CENTRE_VERTICAL</flag> </object> <object class="sizeritem"> - <object class="wxTextCtrl" name="images_text_yaw"> + <object class="wxTextCtrl" name="images_text_y"> <size>50,-1</size> <style>wxTE_PROCESS_ENTER</style> <tooltip>set yaw for selected image(s)</tooltip> @@ -192,7 +192,7 @@ <flag>wxALIGN_CENTRE_VERTICAL</flag> </object> <object class="sizeritem"> - <object class="wxTextCtrl" name="images_text_pitch"> + <object class="wxTextCtrl" name="images_text_p"> <size>50,-1</size> <style>wxTE_PROCESS_ENTER</style> <tooltip>set pitch for selected image(s)</tooltip> @@ -206,7 +206,7 @@ <flag>wxALIGN_CENTRE_VERTICAL</flag> </object> <object class="sizeritem"> - <object class="wxTextCtrl" name="images_text_roll"> + <object class="wxTextCtrl" name="images_text_r"> <size>50,-1</size> <style>wxTE_PROCESS_ENTER</style> <tooltip>set roll for selected image(s)</tooltip> @@ -222,6 +222,48 @@ <cols>7</cols> <vgap>3</vgap> <hgap>6</hgap> + <object class="sizeritem"> + <object class="wxStaticText"> + <label>X:</label> + </object> + <flag>wxALIGN_CENTRE_VERTICAL</flag> + </object> + <object class="sizeritem"> + <object class="wxTextCtrl" name="images_text_X"> + <size>50,-1</size> + <style>wxTE_PROCESS_ENTER</style> + <tooltip>set yaw for selected image(s)</tooltip> + </object> + <flag>wxALIGN_CENTRE_VERTICAL</flag> + </object> + <object class="sizeritem"> + <object class="wxStaticText"> + <label>Y:</label> + </object> + <flag>wxALIGN_CENTRE_VERTICAL</flag> + </object> + <object class="sizeritem"> + <object class="wxTextCtrl" name="images_text_Y"> + <size>50,-1</size> + <style>wxTE_PROCESS_ENTER</style> + <tooltip>set pitch for selected image(s)</tooltip> + </object> + <flag>wxALIGN_CENTRE_VERTICAL</flag> + </object> + <object class="sizeritem"> + <object class="wxStaticText" name=""> + <label>Z:</label> + </object> + <flag>wxALIGN_CENTRE_VERTICAL</flag> + </object> + <object class="sizeritem"> + <object class="wxTextCtrl" name="images_text_Z"> + <size>50,-1</size> + <style>wxTE_PROCESS_ENTER</style> + <tooltip>set roll for selected image(s)</tooltip> + </object> + <flag>wxALIGN_CENTRE_VERTICAL</flag> + </object> </object> </object> <object class="spacer"> @@ -409,4 +451,4 @@ </object> </object> </object> -</resource> +</resource> \ No newline at end of file Modified: hugin/branches/gsoc2009_layout/src/hugin1/hugin/xrc/optimize_panel.xrc =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin1/hugin/xrc/optimize_panel.xrc 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin1/hugin/xrc/optimize_panel.xrc 2009-09-27 17:45:39 UTC (rev 4500) @@ -136,17 +136,17 @@ <object class="sizeritem"> <object class="wxGridSizer"> <object class="sizeritem"> - <object class="wxButton" name="opt_yaw_select"> - <label>select</label> + <object class="wxBitmapButton" name="opt_yaw_select"> + <bitmap stock_id="wxART_TICK_MARK"></bitmap> </object> - <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_HORIZONTAL</flag> + <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE_HORIZONTAL</flag> <border>3</border> </object> <object class="sizeritem"> - <object class="wxButton" name="opt_yaw_clear"> - <label>clear</label> + <object class="wxBitmapButton" name="opt_yaw_clear"> + <bitmap stock_id="wxART_CROSS_MARK"></bitmap> </object> - <flag>wxRIGHT|wxALIGN_CENTRE_HORIZONTAL</flag> + <flag>wxRIGHT|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE_HORIZONTAL</flag> <border>3</border> </object> <cols>2</cols> @@ -178,17 +178,17 @@ <object class="sizeritem"> <object class="wxGridSizer"> <object class="sizeritem"> - <object class="wxButton" name="opt_pitch_select"> - <label>select</label> + <object class="wxBitmapButton" name="opt_pitch_select"> + <bitmap stock_id="wxART_TICK_MARK"></bitmap> </object> - <flag>wxLEFT|wxRIGHT</flag> + <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE_HORIZONTAL</flag> <border>3</border> </object> <object class="sizeritem"> - <object class="wxButton" name="opt_pitch_clear"> - <label>clear</label> + <object class="wxBitmapButton" name="opt_pitch_clear"> + <bitmap stock_id="wxART_CROSS_MARK"></bitmap> </object> - <flag>wxRIGHT</flag> + <flag>wxRIGHT|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE_HORIZONTAL</flag> <border>3</border> </object> <cols>2</cols> @@ -220,17 +220,17 @@ <object class="sizeritem"> <object class="wxGridSizer"> <object class="sizeritem"> - <object class="wxButton" name="opt_roll_select"> - <label>select</label> + <object class="wxBitmapButton" name="opt_roll_select"> + <bitmap stock_id="wxART_TICK_MARK"></bitmap> </object> - <flag>wxLEFT|wxRIGHT</flag> + <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE_HORIZONTAL</flag> <border>3</border> </object> <object class="sizeritem"> - <object class="wxButton" name="opt_roll_clear"> - <label>clear</label> + <object class="wxBitmapButton" name="opt_roll_clear"> + <bitmap stock_id="wxART_CROSS_MARK"></bitmap> </object> - <flag>wxRIGHT</flag> + <flag>wxRIGHT|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE_HORIZONTAL</flag> <border>3</border> </object> <cols>2</cols> @@ -243,9 +243,135 @@ <option>1</option> <flag>wxEXPAND</flag> </object> - <cols>3</cols> + <cols>6</cols> <rows>1</rows> <hgap>12</hgap> + <object class="sizeritem"> + <object class="wxBoxSizer"> + <orient>wxVERTICAL</orient> + <object class="sizeritem"> + <object class="wxStaticText"> + <label>X:</label> + </object> + </object> + <object class="sizeritem"> + <object class="wxCheckListBox" name="optimizer_x_list"> + <content/> + </object> + <option>1</option> + <flag>wxALL|wxEXPAND</flag> + <border>3</border> + </object> + <object class="sizeritem"> + <object class="wxGridSizer"> + <object class="sizeritem"> + <object class="wxBitmapButton" name="opt_x_select"> + <bitmap stock_id="wxART_TICK_MARK"></bitmap> + </object> + <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE_HORIZONTAL</flag> + <border>3</border> + </object> + <object class="sizeritem"> + <object class="wxBitmapButton" name="opt_x_clear"> + <bitmap stock_id="wxART_CROSS_MARK"></bitmap> + </object> + <flag>wxRIGHT|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE_HORIZONTAL</flag> + <border>3</border> + </object> + <cols>2</cols> + <rows>1</rows> + <hgap>12</hgap> + </object> + <flag>wxALIGN_CENTRE_HORIZONTAL</flag> + </object> + </object> + <option>1</option> + <flag>wxEXPAND</flag> + </object> + <object class="sizeritem"> + <object class="wxBoxSizer"> + <orient>wxVERTICAL</orient> + <object class="sizeritem"> + <object class="wxStaticText"> + <label>Y:</label> + </object> + </object> + <object class="sizeritem"> + <object class="wxCheckListBox" name="optimizer_y_list"> + <content/> + </object> + <option>1</option> + <flag>wxALL|wxEXPAND</flag> + <border>3</border> + </object> + <object class="sizeritem"> + <object class="wxGridSizer"> + <object class="sizeritem"> + <object class="wxBitmapButton" name="opt_y_select"> + <bitmap stock_id="wxART_TICK_MARK"></bitmap> + </object> + <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE_HORIZONTAL</flag> + <border>3</border> + </object> + <object class="sizeritem"> + <object class="wxBitmapButton" name="opt_y_clear"> + <bitmap stock_id="wxART_CROSS_MARK"></bitmap> + </object> + <flag>wxRIGHT|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE_HORIZONTAL</flag> + <border>3</border> + </object> + <cols>2</cols> + <rows>1</rows> + <hgap>12</hgap> + </object> + <flag>wxALIGN_CENTRE_HORIZONTAL</flag> + </object> + </object> + <option>1</option> + <flag>wxEXPAND</flag> + </object> + <object class="sizeritem"> + <object class="wxBoxSizer"> + <orient>wxVERTICAL</orient> + <object class="sizeritem"> + <object class="wxStaticText"> + <label>Z:</label> + </object> + </object> + <object class="sizeritem"> + <object class="wxCheckListBox" name="optimizer_z_list"> + <content/> + </object> + <option>1</option> + <flag>wxALL|wxEXPAND</flag> + <border>3</border> + </object> + <object class="sizeritem"> + <object class="wxGridSizer"> + <object class="sizeritem"> + <object class="wxBitmapButton" name="opt_z_select"> + <bitmap stock_id="wxART_TICK_MARK"></bitmap> + </object> + <flag>wxLEFT|wxRIGHT|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE_HORIZONTAL</flag> + <border>3</border> + </object> + <object class="sizeritem"> + <object class="wxBitmapButton" name="opt_z_clear"> + <bitmap stock_id="wxART_CROSS_MARK"></bitmap> + </object> + <flag>wxRIGHT|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE_HORIZONTAL</flag> + <border>3</border> + </object> + <cols>2</cols> + <rows>1</rows> + <hgap>12</hgap> + </object> + <flag>wxALIGN_CENTRE_HORIZONTAL</flag> + </object> + </object> + <option>1</option> + <flag>wxEXPAND</flag> + </object> </object> <option>1</option> <flag>wxLEFT|wxEXPAND</flag> Modified: hugin/branches/gsoc2009_layout/src/hugin_base/panodata/ImageVariableTranslate.h =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin_base/panodata/ImageVariableTranslate.h 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin_base/panodata/ImageVariableTranslate.h 2009-09-27 17:45:39 UTC (rev 4500) @@ -293,6 +293,10 @@ typedef PTOVariableConverterSingle<'p'> PTOVariableConverterForPitch; typedef PTOVariableConverterSingle<'y'> PTOVariableConverterForYaw; +typedef PTOVariableConverterSingle<'T','r','X'> PTOVariableConverterForX; +typedef PTOVariableConverterSingle<'T','r','Y'> PTOVariableConverterForY; +typedef PTOVariableConverterSingle<'T','r','Z'> PTOVariableConverterForZ; + typedef PTOVariableConverterSingle<'j'> PTOVariableConverterForStack; typedef PTOVariableConverterVector<double, 3> PTOVariableConverterForRadialDistortion; Modified: hugin/branches/gsoc2009_layout/src/hugin_base/panodata/PTScriptParsing.cpp =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin_base/panodata/PTScriptParsing.cpp 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin_base/panodata/PTScriptParsing.cpp 2009-09-27 17:45:39 UTC (rev 4500) @@ -208,15 +208,15 @@ // cannot use Lens::variableNames here, because r,p,v,j need to be included /// @todo Use information from image_variables.h and ImageVariableTranslate.h instead? -const char * ImgInfo::varnames[] = {"v", "a","b","c", "d","e", "g","t", "r","p","y", "j", - "Va", "Vb", "Vc", "Vd", "Vx", "Vy", - "Eev", "Er", "Eb", - "Ra", "Rb", "Rc", "Rd", "Re", 0}; +const char * ImgInfo::varnames[] = {"v", "a","b","c", "d","e", "g","t", "r","p","y","j","TrX", "TrY", "TrZ", + "Va", "Vb", "Vc", "Vd", "Vx", "Vy", + "Eev", "Er", "Eb", + "Ra", "Rb", "Rc", "Rd", "Re", 0}; -double ImgInfo::defaultValues[] = {51.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 1.0, - 0.0, 0.0, 0.0, 0.0, 0.0}; +double ImgInfo::defaultValues[] = {51.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 1.0, + 0.0, 0.0, 0.0, 0.0, 0.0}; void ImgInfo:: init() Modified: hugin/branches/gsoc2009_layout/src/hugin_base/panodata/Panorama.cpp =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin_base/panodata/Panorama.cpp 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin_base/panodata/Panorama.cpp 2009-09-27 17:45:39 UTC (rev 4500) @@ -57,6 +57,9 @@ m_ptoptimizerVarNames.insert("r"); m_ptoptimizerVarNames.insert("p"); m_ptoptimizerVarNames.insert("y"); + m_ptoptimizerVarNames.insert("TrX"); + m_ptoptimizerVarNames.insert("TrY"); + m_ptoptimizerVarNames.insert("TrZ"); /* settings.setPath("dangelo","PanoAssistant"); @@ -870,6 +873,19 @@ << " roll " << map_get(var, "r").getValue()); // read lens variables + readVar(map_get(var, "TrX"), link, line); + DEBUG_ASSERT(link == -1); + readVar(map_get(var, "TrY"), link, line); + DEBUG_ASSERT(link == -1); + readVar(map_get(var, "TrZ"), link, line); + DEBUG_ASSERT(link == -1); + + DEBUG_DEBUG("X: " << map_get(var, "TrX").getValue() + << " Y " << map_get(var, "TrY").getValue() + << " Z " << map_get(var, "TrZ").getValue()); + // read lens variables + + for (const char **c = Lens::variableNames; *c != 0; ++c) { Variable & curVar = map_get(var, *c); if (!readVar(curVar, link, line)) { Modified: hugin/branches/gsoc2009_layout/src/hugin_base/panodata/PanoramaVariable.cpp =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin_base/panodata/PanoramaVariable.cpp 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin_base/panodata/PanoramaVariable.cpp 2009-09-27 17:45:39 UTC (rev 4500) @@ -50,6 +50,10 @@ vars.insert(std::pair<const char*, Variable>("y",Variable("y",0))); vars.insert(std::pair<const char*, Variable>("r",Variable("r",0))); vars.insert(std::pair<const char*, Variable>("p",Variable("p",0))); + + vars.insert(std::pair<const char*, Variable>("TrX",Variable("TrX",0))); + vars.insert(std::pair<const char*, Variable>("TrY",Variable("TrY",0))); + vars.insert(std::pair<const char*, Variable>("TrZ",Variable("TrZ",0))); vars.insert(std::pair<const char*, Variable>("j",Variable("j",0))); Modified: hugin/branches/gsoc2009_layout/src/hugin_base/panodata/SrcPanoImage.cpp =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin_base/panodata/SrcPanoImage.cpp 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin_base/panodata/SrcPanoImage.cpp 2009-09-27 17:45:39 UTC (rev 4500) @@ -213,7 +213,7 @@ void SrcPanoImage::setVar(const std::string & code, double val) { - DEBUG_TRACE(""); + DEBUG_TRACE("Var:" << code << " value: " << val); assert(code.size() > 0); #define image_variable( name, type, default_value ) \ if (PTOVariableConverterFor##name::checkApplicability(code)) \ Modified: hugin/branches/gsoc2009_layout/src/hugin_base/panodata/image_variables.h =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin_base/panodata/image_variables.h 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin_base/panodata/image_variables.h 2009-09-27 17:45:39 UTC (rev 4500) @@ -80,6 +80,10 @@ image_variable( Pitch, double , 0.0 ) image_variable( Yaw, double, 0.0 ) +image_variable( X, double , 0.0 ) +image_variable( Y, double , 0.0 ) +image_variable( Z, double, 0.0 ) + // stack information // Currently only the link information is used, the value means nothing. image_variable( Stack, double, 0.0 ) Modified: hugin/branches/gsoc2009_layout/src/hugin_base/panotools/PanoToolsInterface.cpp =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin_base/panotools/PanoToolsInterface.cpp 2009-09-27 16:39:28 UTC (rev 4499) +++ hugin/branches/gsoc2009_layout/src/hugin_base/panotools/PanoToolsInterface.cpp 2009-09-27 17:45:39 UTC (rev 4500) @@ -110,6 +110,10 @@ vars.insert(make_pair(std::string("p"), Variable("p", src.getPitch()))); vars.insert(make_pair(std::string("y"), Variable("y", src.getYaw()))); + vars.insert(make_pair(std::string("TrX"), Variable("TrX", src.getX()))); + vars.insert(make_pair(std::string("TrY"), Variable("TrY", src.getY()))); + vars.insert(make_pair(std::string("TrZ"), Variable("TrZ", src.getZ()))); + createInvTransform(src.getSize(), vars, (Lens::LensProjectionFormat) src.getProjection(), @@ -138,6 +142,10 @@ vars.insert(make_pair(std::string("p"), Variable("p", src.getPitch()))); vars.insert(make_pair(std::string("y"), Variable("y", src.getYaw()))); + vars.insert(make_pair(std::string("TrX"), Variable("TrX", src.getX()))); + vars.insert(make_pair(std::string("TrY"), Variable("TrY", src.getY()))); + vars.insert(make_pair(std::string("TrZ"), Variable("TrZ", src.getZ()))); + createTransform(src.getSize(), vars, (Lens::LensProjectionFormat) src.getProjection(), @@ -486,6 +494,10 @@ if (gl.im) { for (int i = 0; i < gl.numIm; i++) { VariableMap vars; + vars.insert(make_pair(std::string("TrX"), Variable("TrX", gl.im[i].cP.trans_x))); + vars.insert(make_pair(std::string("TrY"), Variable("TrY", gl.im[i].cP.trans_y))); + vars.insert(make_pair(std::string("TrZ"), Variable("TrZ", gl.im[i].cP.trans_z))); + vars.insert(make_pair(std::string("v"), Variable("v", gl.im[i].hfov))); vars.insert(make_pair(std::string("y"), Variable("y", gl.im[i].yaw))); vars.insert(make_pair(std::string("r"), Variable("r", gl.im[i].roll))); @@ -649,6 +661,16 @@ p.horizontal = FALSE; p.horizontal_params[0] = p.horizontal_params[1] = p.horizontal_params[2] = 0; } + + p.trans_x = const_map_get(vars,"TrX").getValue(); + p.trans_y = const_map_get(vars,"TrY").getValue(); + p.trans_z = const_map_get(vars,"TrZ").getValue(); + if (p.trans_x != 0 || p.trans_y != 0 || p.trans_z != 0) { + p.trans = TRUE; + } else { + p.trans = FALSE; + } + // FIXME add shear parameters val = const_map_get(vars, "g").getValue(); double val2 = const_map_get(vars, "t").getValue(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |