Index: src/hugin1/hugin/CMakeLists.txt
===================================================================
--- src/hugin1/hugin/CMakeLists.txt	(Revision 3678)
+++ src/hugin1/hugin/CMakeLists.txt	(Arbeitskopie)
@@ -27,7 +27,7 @@
 ImagesPanel.cpp CommandHistory.cpp PanoPanel.cpp NonaOptionsDialog.cpp
 PreviewFrame.cpp PreviewPanel.cpp GLPreviewFrame.cpp GLViewer.cpp GLRenderer.cpp
 CropPanel.cpp OptimizePhotometricPanel.cpp OptimizePanel.cpp CPListFrame.cpp
-TextKillFocusHandler.cpp PanoDruid.cpp PreferencesDialog.cpp
+TextKillFocusHandler.cpp PanoDruid.cpp PreferencesDialog.cpp ResetDialog.cpp
 LocalizedFileTipProvider.cpp  wxPanoCommand.cpp AssistantPanel.cpp
 HFOVDialog.cpp TextureManager.cpp MeshRemapper.cpp VertexCoordRemapper.cpp
 TexCoordRemapper.cpp ChoosyRemapper.cpp MeshManager.cpp ViewState.cpp
Index: src/hugin1/hugin/huginApp.cpp
===================================================================
--- src/hugin1/hugin/huginApp.cpp	(Revision 3678)
+++ src/hugin1/hugin/huginApp.cpp	(Arbeitskopie)
@@ -236,6 +236,7 @@
     wxXmlResource::Get()->Load(m_xrcPrefix + wxT("help.xrc"));
     wxXmlResource::Get()->Load(m_xrcPrefix + wxT("keyboard_help.xrc"));
     wxXmlResource::Get()->Load(m_xrcPrefix + wxT("pref_dialog.xrc"));
+    wxXmlResource::Get()->Load(m_xrcPrefix + wxT("reset_dialog.xrc"));
     wxXmlResource::Get()->Load(m_xrcPrefix + wxT("vig_corr_dlg.xrc"));
     wxXmlResource::Get()->Load(m_xrcPrefix + wxT("optimize_photo_panel.xrc"));
     wxXmlResource::Get()->Load(m_xrcPrefix + wxT("cp_editor_panel.xrc"));
Index: src/hugin1/hugin/LensPanel.cpp
===================================================================
--- src/hugin1/hugin/LensPanel.cpp	(Revision 3678)
+++ src/hugin1/hugin/LensPanel.cpp	(Arbeitskopie)
@@ -49,6 +49,7 @@
 #include "hugin/TextKillFocusHandler.h"
 #include "hugin/wxPanoCommand.h"
 //#include "hugin/VigCorrDialog.h"
+#include "hugin/ResetDialog.h"
 
 
 using namespace PT;
@@ -104,6 +105,7 @@
     EVT_BUTTON ( XRCID("lens_button_load"), LensPanel::OnLoadLensParameters )
     EVT_BUTTON ( XRCID("lens_button_newlens"), LensPanel::OnNewLens )
     EVT_BUTTON ( XRCID("lens_button_changelens"), LensPanel::OnChangeLens )
+    EVT_BUTTON ( XRCID("lens_button_reset"), LensPanel::OnReset )
     EVT_CHECKBOX ( XRCID("lens_inherit_v"), LensPanel::OnVarInheritChanged )
     EVT_CHECKBOX ( XRCID("lens_inherit_a"), LensPanel::OnVarInheritChanged )
     EVT_CHECKBOX ( XRCID("lens_inherit_b"), LensPanel::OnVarInheritChanged )
@@ -353,6 +355,10 @@
     } else if (m_selectedImages.size() == 0) {
         UpdateLensDisplay();
     }
+    if(pano.getNrOfImages()>0)
+        XRCCTRL(*this, "lens_button_reset", wxButton)->Enable();
+    else
+        XRCCTRL(*this, "lens_button_reset", wxButton)->Disable();
 }
 
 
@@ -1112,6 +1118,103 @@
     }
 }
 
+void LensPanel::OnReset(wxCommandEvent & e)
+{
+  ResetDialog reset_dlg(this);
+  if(reset_dlg.ShowModal()==wxID_OK)
+  {
+     //reset 
+    UIntSet selImg = images_list->GetSelected();
+    if ( selImg.size() < 1) {
+        // add all images.
+        selImg.clear();
+        unsigned int nImg = pano->getNrOfImages();
+        for (unsigned int i=0; i < nImg; i++) {
+            selImg.insert(i);
+        }
+    }
+
+    if (selImg.size() == 0) {
+        return;
+    }
+    VariableMapVector vars;
+    for(UIntSet::const_iterator it = selImg.begin(); it != selImg.end(); it++)
+    {
+        unsigned int imgNr = *it;
+        VariableMap ImgVars=pano->getImageVariables(imgNr);
+        if(reset_dlg.GetResetPos())
+        {
+            map_get(ImgVars,"y").setValue(0);
+            map_get(ImgVars,"p").setValue(0);
+            map_get(ImgVars,"r").setValue(0);
+        };
+        double cropFactor = 0;
+        double focalLength = 0;
+        double eV = 0;
+        SrcPanoImage srcImg = pano->getSrcImage(imgNr);
+        if(reset_dlg.GetResetFOV() || reset_dlg.GetResetExposure())
+            srcImg.readEXIF(focalLength,cropFactor,eV,false);
+        if(reset_dlg.GetResetFOV())
+        {
+            if(focalLength!=0&&cropFactor!=0)
+            {
+                double newHFOV=calcHFOV(srcImg.getProjection(),focalLength,cropFactor,srcImg.getSize());
+                if(newHFOV!=0)
+                    map_get(ImgVars,"v").setValue(newHFOV);
+            };
+        };
+        if(reset_dlg.GetResetLens())
+        {
+            map_get(ImgVars,"a").setValue(0);
+            map_get(ImgVars,"b").setValue(0);
+            map_get(ImgVars,"c").setValue(0);
+            map_get(ImgVars,"d").setValue(0);
+            map_get(ImgVars,"e").setValue(0);
+            map_get(ImgVars,"g").setValue(0);
+            map_get(ImgVars,"t").setValue(0);
+        };
+        if(reset_dlg.GetResetExposure())
+        {
+            if(reset_dlg.GetResetExposureToExif())
+            {
+                //reset to exif value
+                if(eV!=0)
+                    map_get(ImgVars,"Eev").setValue(eV);
+            }
+            else
+            {
+                //reset to zero
+                map_get(ImgVars,"Eev").setValue(0);
+            };
+        };
+        if(reset_dlg.GetResetColor())
+        {
+            map_get(ImgVars,"Er").setValue(1);
+            map_get(ImgVars,"Eb").setValue(1);
+        };
+        if(reset_dlg.GetResetVignetting())
+        {
+            map_get(ImgVars,"Vb").setValue(0);
+            map_get(ImgVars,"Vc").setValue(0);
+            map_get(ImgVars,"Vd").setValue(0);
+            map_get(ImgVars,"Vx").setValue(0);
+            map_get(ImgVars,"Vy").setValue(0);
+
+        };
+        if(reset_dlg.GetResetResponse())
+        {
+            map_get(ImgVars,"Ra").setValue(0);
+            map_get(ImgVars,"Rb").setValue(0);
+            map_get(ImgVars,"Rc").setValue(0);
+            map_get(ImgVars,"Rd").setValue(0);
+            map_get(ImgVars,"Re").setValue(0);
+        };
+        vars.push_back(ImgVars);    
+    };
+    GlobalCmdHist::getInstance().addCommand(new PT::UpdateImagesVariablesCmd(*pano, selImg,vars));
+  }
+};
+
 const char *LensPanel::m_varNames[] = { "v", "a", "b", "c", "d", "e", "g", "t",
                                   "Eev", "Er", "Eb", 
                                   "Vb", "Vc", "Vd", "Vx", "Vy",
Index: src/hugin1/hugin/LensPanel.h
===================================================================
--- src/hugin1/hugin/LensPanel.h	(Revision 3678)
+++ src/hugin1/hugin/LensPanel.h	(Arbeitskopie)
@@ -115,6 +115,10 @@
      */
     void OnNewLens(wxCommandEvent & e);
 
+    /** reset lens parameters
+     */
+    void OnReset(wxCommandEvent & e);
+
     /** catches changes to the list selection */
     void ListSelectionChanged(wxListEvent& e);
 
Index: src/hugin1/hugin/ResetDialog.cpp
===================================================================
--- src/hugin1/hugin/ResetDialog.cpp	(Revision 0)
+++ src/hugin1/hugin/ResetDialog.cpp	(Revision 0)
@@ -0,0 +1,124 @@
+#include "hugin/ResetDialog.h"
+#include "common/wxPlatform.h"
+
+#include "hugin/huginApp.h"
+
+BEGIN_EVENT_TABLE(ResetDialog,wxDialog)
+    EVT_BUTTON(wxID_OK, ResetDialog::OnOk)
+    EVT_CHECKBOX(XRCID("reset_exposure"), ResetDialog::OnSelectExposure)
+END_EVENT_TABLE()
+
+ResetDialog::ResetDialog(wxWindow *parent)
+{
+    // load our children. some children might need special
+    // initialization. this will be done later.
+    wxXmlResource::Get()->LoadDialog(this, parent, wxT("reset_dialog"));
+
+#ifdef __WXMSW__
+    wxIcon myIcon(MainFrame::Get()->GetXRCPath() + wxT("data/icon.ico"),wxBITMAP_TYPE_ICO);
+#else
+    wxIcon myIcon(MainFrame::Get()->GetXRCPath() + wxT("data/icon.png"),wxBITMAP_TYPE_PNG);
+#endif
+    SetIcon(myIcon);
+    //set parameters
+    wxConfigBase * cfg = wxConfigBase::Get();
+    bool check;
+    cfg->Read(wxT("/ResetDialog/ResetPosition"),&check,true);
+    XRCCTRL(*this,"reset_pos",wxCheckBox)->SetValue(check);
+    cfg->Read(wxT("/ResetDialog/ResetFOV"),&check,true);
+    XRCCTRL(*this,"reset_fov",wxCheckBox)->SetValue(check);
+    cfg->Read(wxT("/ResetDialog/ResetLens"),&check,true);
+    XRCCTRL(*this,"reset_lens",wxCheckBox)->SetValue(check);
+    cfg->Read(wxT("/ResetDialog/ResetExposure"),&check,true);
+    XRCCTRL(*this,"reset_exposure",wxCheckBox)->SetValue(check);
+    int exp_param;
+    cfg->Read(wxT("/ResetDialog/ResetExposureParam"),&exp_param,0);
+    XRCCTRL(*this,"combo_exposure",wxComboBox)->Select(exp_param);
+    cfg->Read(wxT("/ResetDialog/ResetColor"),&check,true);
+    XRCCTRL(*this,"reset_color",wxCheckBox)->SetValue(check);
+    cfg->Read(wxT("/ResetDialog/ResetVignetting"),&check,true);
+    XRCCTRL(*this,"reset_vignetting",wxCheckBox)->SetValue(check);
+    cfg->Read(wxT("/ResetDialog/ResetResponse"),&check,true);
+    XRCCTRL(*this,"reset_response",wxCheckBox)->SetValue(check);
+    //position
+    int x = cfg->Read(wxT("/ResetDialog/positionX"),-1l);
+    int y = cfg->Read(wxT("/ResetDialog/positionY"),-1l);
+    if ( y >= 0 && x >= 0) 
+    {
+        this->Move(x, y);
+    } 
+    else 
+    {
+        this->Move(0, 44);
+    };
+};
+
+void ResetDialog::OnOk(wxCommandEvent & e)
+{
+    wxConfigBase * cfg = wxConfigBase::Get();
+    wxPoint ps = this->GetPosition();
+    cfg->Write(wxT("/ResetDialog/positionX"), ps.x);
+    cfg->Write(wxT("/ResetDialog/positionY"), ps.y);
+    cfg->Write(wxT("/ResetDialog/ResetPosition"),GetResetPos());
+    cfg->Write(wxT("/ResetDialog/ResetFOV"),GetResetFOV());
+    cfg->Write(wxT("/ResetDialog/ResetLens"),GetResetLens());
+    cfg->Write(wxT("/ResetDialog/ResetExposure"),GetResetExposure());
+    int exp_param;
+    exp_param=XRCCTRL(*this,"combo_exposure",wxComboBox)->GetSelection();
+    cfg->Write(wxT("/ResetDialog/ResetExposureParam"),exp_param);
+    cfg->Write(wxT("/ResetDialog/ResetColor"),GetResetColor());
+    cfg->Write(wxT("/ResetDialog/ResetVignetting"),GetResetVignetting());
+    cfg->Write(wxT("/ResetDialog/ResetResponse"),GetResetResponse());
+    cfg->Flush();
+    e.Skip();
+};
+
+void ResetDialog::OnSelectExposure(wxCommandEvent & e)
+{
+    if(XRCCTRL(*this, "reset_exposure", wxCheckBox)->GetValue())
+        XRCCTRL(*this,"combo_exposure",wxComboBox)->Enable();
+    else
+        XRCCTRL(*this,"combo_exposure",wxComboBox)->Disable();
+};
+
+bool ResetDialog::GetResetPos()
+{
+    return XRCCTRL(*this, "reset_pos", wxCheckBox)->GetValue();
+};
+
+bool ResetDialog::GetResetFOV()
+{
+    return XRCCTRL(*this, "reset_fov", wxCheckBox)->GetValue();
+};
+
+bool ResetDialog::GetResetLens()
+{
+    return XRCCTRL(*this, "reset_lens", wxCheckBox)->GetValue();
+};
+
+bool ResetDialog::GetResetExposure()
+{
+    return XRCCTRL(*this, "reset_exposure", wxCheckBox)->GetValue();
+};
+
+bool ResetDialog::GetResetExposureToExif()
+{
+    if(!GetResetExposure())
+        return false;
+    return XRCCTRL(*this, "combo_exposure", wxComboBox)->GetSelection()==0;
+};
+
+bool ResetDialog::GetResetColor()
+{
+    return XRCCTRL(*this, "reset_color", wxCheckBox)->GetValue();
+};
+
+bool ResetDialog::GetResetVignetting()
+{
+    return XRCCTRL(*this, "reset_vignetting", wxCheckBox)->GetValue();
+};
+
+bool ResetDialog::GetResetResponse()
+{
+    return XRCCTRL(*this, "reset_response", wxCheckBox)->GetValue();
+};
Index: src/hugin1/hugin/ResetDialog.h
===================================================================
--- src/hugin1/hugin/ResetDialog.h	(Revision 0)
+++ src/hugin1/hugin/ResetDialog.h	(Revision 0)
@@ -0,0 +1,48 @@
+// -*- c-basic-offset: 4 -*-
+/** @file ResetDialog.h
+ *
+ *
+ *  This is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This software is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this software; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef _RESETDIALOG_H
+#define _RESETDIALOG_H
+
+#include "panoinc_WX.h"
+
+class ResetDialog : public wxDialog
+{
+public:
+    // ctor.
+    ResetDialog(wxWindow *parent);
+	bool GetResetPos();
+	bool GetResetFOV();
+	bool GetResetLens();
+	bool GetResetExposure();
+	bool GetResetExposureToExif();
+	bool GetResetColor();
+	bool GetResetVignetting();
+	bool GetResetResponse();
+
+protected:
+	void OnSelectExposure(wxCommandEvent & e);
+	void OnOk(wxCommandEvent & e);
+
+private:
+    DECLARE_EVENT_TABLE()
+};
+
+#endif //_RESETDIALOG_H
Index: src/hugin1/hugin/xrc/CMakeLists.txt
===================================================================
--- src/hugin1/hugin/xrc/CMakeLists.txt	(Revision 3678)
+++ src/hugin1/hugin/xrc/CMakeLists.txt	(Arbeitskopie)
@@ -13,6 +13,7 @@
     help.xrc
     keyboard_help.xrc
     pref_dialog.xrc
+    reset_dialog.xrc
     vig_corr_dlg.xrc
     optimize_photo_panel.xrc
     cp_editor_panel.xrc
Index: src/hugin1/hugin/xrc/lens_panel.xrc
===================================================================
--- src/hugin1/hugin/xrc/lens_panel.xrc	(Revision 3678)
+++ src/hugin1/hugin/xrc/lens_panel.xrc	(Arbeitskopie)
@@ -69,9 +69,21 @@
                         <label>Change lens...</label>
                         <tooltip>change lens of selected images</tooltip>
                       </object>
-                      <flag>wxEXPAND|wxTOP</flag>
+                      <flag>wxTOP|wxBOTTOM|wxEXPAND</flag>
                       <border>5</border>
                     </object>
+                    <object class="sizeritem">
+                      <object class="wxStaticLine"/>
+                      <flag>wxTOP|wxBOTTOM|wxEXPAND</flag>
+                      <border>3</border>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxButton" name="lens_button_reset">
+                        <label>Reset...</label>
+                      </object>
+                      <flag>wxTOP|wxEXPAND</flag>
+                      <border>5</border>
+                    </object>
                   </object>
                   <flag>wxALL</flag>
                   <border>6</border>
Index: src/hugin1/hugin/xrc/reset_dialog.xrc
===================================================================
--- src/hugin1/hugin/xrc/reset_dialog.xrc	(Revision 0)
+++ src/hugin1/hugin/xrc/reset_dialog.xrc	(Revision 0)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="cp1252"?>
+<resource>
+  <object class="wxDialog" name="reset_dialog">
+    <title>Reset values</title>
+    <style>wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxTAB_TRAVERSAL</style>
+    <object class="wxBoxSizer">
+      <orient>wxVERTICAL</orient>
+      <object class="sizeritem">
+        <object class="wxStaticBoxSizer">
+          <label>Reset</label>
+          <orient>wxVERTICAL</orient>
+          <object class="sizeritem">
+            <object class="wxCheckBox" name="reset_pos">
+              <label>Image Orientation</label>
+              <checked>1</checked>
+            </object>
+            <flag>wxALL|wxEXPAND</flag>
+            <border>5</border>
+          </object>
+          <object class="sizeritem">
+            <object class="wxCheckBox" name="reset_fov">
+              <label>Field of View</label>
+            </object>
+            <flag>wxALL|wxEXPAND</flag>
+            <border>5</border>
+          </object>
+          <object class="sizeritem">
+            <object class="wxCheckBox" name="reset_lens">
+              <label>Lens parameters</label>
+              <checked>1</checked>
+            </object>
+            <flag>wxALL|wxEXPAND</flag>
+            <border>5</border>
+          </object>
+          <object class="sizeritem">
+            <object class="wxBoxSizer">
+              <orient>wxHORIZONTAL</orient>
+              <object class="sizeritem">
+                <object class="wxCheckBox" name="reset_exposure">
+                  <label>Exposure</label>
+                  <checked>1</checked>
+                </object>
+                <flag>wxALL|wxEXPAND|wxALIGN_CENTRE_VERTICAL</flag>
+                <border>0</border>
+              </object>
+              <object class="spacer">
+                <size>10</size>
+                <flag>wxEXPAND</flag>
+              </object>
+              <object class="sizeritem">
+                <object class="wxComboBox" name="combo_exposure">
+                  <content>
+                    <item>to EXIF values</item>
+                    <item>to zero (no exposure correction)</item>
+                  </content>
+                  <selection>0</selection>
+                  <style>wxCB_READONLY</style>
+                </object>
+                <flag>wxALL|wxEXPAND|wxALIGN_CENTRE_HORIZONTAL</flag>
+                <border>0</border>
+              </object>
+            </object>
+            <flag>wxALL|wxEXPAND|wxALIGN_CENTRE_VERTICAL</flag>
+            <border>5</border>
+          </object>
+          <object class="sizeritem">
+            <object class="wxCheckBox" name="reset_color">
+              <label>Color</label>
+              <checked>1</checked>
+            </object>
+            <flag>wxALL|wxEXPAND</flag>
+            <border>5</border>
+          </object>
+          <object class="sizeritem">
+            <object class="wxCheckBox" name="reset_vignetting">
+              <label>Vignetting</label>
+              <checked>1</checked>
+            </object>
+            <flag>wxALL|wxEXPAND</flag>
+            <border>5</border>
+          </object>
+          <object class="sizeritem">
+            <object class="wxCheckBox" name="reset_response">
+              <label>Camera Response</label>
+              <checked>1</checked>
+            </object>
+            <flag>wxALL|wxEXPAND</flag>
+            <border>5</border>
+          </object>
+        </object>
+        <flag>wxALL|wxEXPAND</flag>
+        <border>5</border>
+      </object>
+      <object class="sizeritem">
+        <object class="wxBoxSizer">
+          <orient>wxHORIZONTAL</orient>
+          <object class="sizeritem">
+            <object class="wxButton" name="wxID_OK">
+              <label>OK</label>
+              <default>1</default>
+            </object>
+            <flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag>
+            <border>5</border>
+          </object>
+          <object class="sizeritem">
+            <object class="wxButton" name="wxID_CANCEL">
+              <label>Cancel</label>
+            </object>
+            <flag>wxALL|wxEXPAND|wxALIGN_CENTRE|wxALIGN_CENTRE_VERTICAL</flag>
+            <border>5</border>
+          </object>
+        </object>
+        <flag>wxALIGN_CENTRE_HORIZONTAL</flag>
+      </object>
+    </object>
+  </object>
+</resource>
\ No newline at end of file
Index: src/hugin_base/panodata/SrcPanoImage.cpp
===================================================================
--- src/hugin_base/panodata/SrcPanoImage.cpp	(Revision 3678)
+++ src/hugin_base/panodata/SrcPanoImage.cpp	(Arbeitskopie)
@@ -333,12 +333,18 @@
 
 bool SrcPanoImage::readEXIF(double & focalLength, double & cropFactor, bool applyEXIFValues)
 {
+    double eV=0;
+    return readEXIF(focalLength,cropFactor,eV,applyEXIFValues);
+};
+
+bool SrcPanoImage::readEXIF(double & focalLength, double & cropFactor, double & eV, bool applyEXIFValues)
+{
     std::string filename = getFilename();
     std::string ext = hugin_utils::getExtension(filename);
     std::transform(ext.begin(), ext.end(), ext.begin(), (int(*)(int)) toupper);
 
     double roll = 0;
-    double eV = 0;
+    //double eV = 0;
     float isoSpeed = 0;
     float photoFNumber = 0;
     float exposureTime = 0;
Index: src/hugin_base/panodata/SrcPanoImage.h
===================================================================
--- src/hugin_base/panodata/SrcPanoImage.h	(Revision 3678)
+++ src/hugin_base/panodata/SrcPanoImage.h	(Arbeitskopie)
@@ -369,6 +369,7 @@
     *  settings where provided, they will be used for computation of the HFOV.
     */
     bool readEXIF(double & focalLength, double & cropFactor, bool applyEXIF=false);
+    bool readEXIF(double & focalLength, double & cropFactor, double & eV, bool applyEXIF=false);
     
     /** calculate hfov of an image given focal length, image size and crop factor */
     static double calcHFOV(SrcPanoImage::Projection proj, double fl, double crop, vigra::Size2D imageSize);
