LensTools.cpp File Reference

some helper classes for working with lenses More...

#include "panoinc_WX.h"
#include <wx/msgdlg.h>
#include "panoinc.h"
#include "LensTools.h"
#include <algorithm>
#include "panodata/ImageVariableTranslate.h"
#include "panodata/StandardImageVariableGroups.h"
#include "base_wx/PanoCommand.h"
#include "panodata/image_variables.h"

Include dependency graph for LensTools.cpp:

Go to the source code of this file.

Defines

#define image_variable(name, type, default_value)

Functions

void FillLensProjectionList (wxControlWithItems *list)
 Fills a wxControlWithItem with all input projection formats, the client data contains the associated projection number.
void FillBlenderList (wxControlWithItems *list)
 Fills a wxControlWithItem with all possible blender options, the client data contains the associated blender mod from PanoramaOptions.
void SelectListValue (wxControlWithItems *list, size_t newValue)
 Selects the given value (stored in the client data) in the given list item.
size_t GetSelectedValue (wxControlWithItems *list)
 Returns the client value of the selected item from list.
wxString getProjectionString (const HuginBase::SrcPanoImage &img)
 Returns translated projection for given image.
wxString getResponseString (const HuginBase::SrcPanoImage &img)
 Returns translated response type for given SrcPanoImage.
void SaveLensParameters (const wxString filename, HuginBase::Panorama *pano, unsigned int imgNr)
 save the lens parameters of the image to a lens file named filename
bool LoadLensParametersChoose (wxWindow *parent, HuginBase::Lens &lens, bool &cropped, bool &autoCenterCrop, vigra::Rect2D &cropRect)
 load lens parameters from lens ini file
void SaveLensParametersToIni (wxWindow *parent, HuginBase::Panorama *pano, const HuginBase::UIntSet images)
 saves the lens parameters to ini files, provides all necessary dialogs
bool CheckLensStacks (HuginBase::Panorama *pano, bool allowCancel)
 check, if lens and stacks are correctly linked shows message box with short information if not


Detailed Description

some helper classes for working with lenses

Author:
T. Modes

Definition in file LensTools.cpp.


Define Documentation

#define image_variable ( name,
type,
default_value   ) 

Value:

if (HuginBase::PTOVariableConverterFor##name::checkApplicability(it->second.getName()))\
            {\
                if(it->second.isLinked())\
                    linkedVariables.insert(HuginBase::ImageVariableGroup::IVE_##name);\
                else\
                    unlinkedVariables.insert(HuginBase::ImageVariableGroup::IVE_##name);\
            }


Function Documentation

bool CheckLensStacks ( HuginBase::Panorama pano,
bool  allowCancel 
)

check, if lens and stacks are correctly linked shows message box with short information if not

Parameters:
pano Panorama which should be checked
allowCancel if true the message box contains also a Cancel button, if false there is only ok button
Returns:
true, if all conditions are satisfied, false if user selected cancel in dialog box

Definition at line 423 of file LensTools.cpp.

References flags, HuginBase::Panorama::getImage(), and HuginBase::Panorama::getNrOfImages().

Referenced by OptimizePanel::OnOptimizeButton(), and PanoCommand::wxLoadPTProjectCmd::processPanorama().

void FillBlenderList ( wxControlWithItems *  list  ) 

Fills a wxControlWithItem with all possible blender options, the client data contains the associated blender mod from PanoramaOptions.

Definition at line 52 of file LensTools.cpp.

References HuginBase::PanoramaOptions::ENBLEND_BLEND, and HuginBase::PanoramaOptions::INTERNAL_BLEND.

Referenced by PanoPanel::Create(), FindPanoDialog::FindPanoDialog(), and PreferencesDialog::PreferencesDialog().

void FillLensProjectionList ( wxControlWithItems *  list  ) 

Fills a wxControlWithItem with all input projection formats, the client data contains the associated projection number.

Definition at line 37 of file LensTools.cpp.

References HuginBase::BaseSrcPanoImage::CIRCULAR_FISHEYE, HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, HuginBase::BaseSrcPanoImage::FISHEYE_EQUISOLID, HuginBase::BaseSrcPanoImage::FISHEYE_ORTHOGRAPHIC, HuginBase::BaseSrcPanoImage::FISHEYE_STEREOGRAPHIC, HuginBase::BaseSrcPanoImage::FISHEYE_THOBY, HuginBase::BaseSrcPanoImage::FULL_FRAME_FISHEYE, HuginBase::BaseSrcPanoImage::PANORAMIC, and HuginBase::BaseSrcPanoImage::RECTILINEAR.

Referenced by ImagesPanel::Create(), EVT_BUTTON(), GLPreviewFrame::GLPreviewFrame(), and LensCalFrame::LensCalFrame().

wxString getProjectionString ( const HuginBase::SrcPanoImage img  ) 

Returns translated projection for given image.

Definition at line 78 of file LensTools.cpp.

References HuginBase::BaseSrcPanoImage::CIRCULAR_FISHEYE, HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, HuginBase::BaseSrcPanoImage::FISHEYE_EQUISOLID, HuginBase::BaseSrcPanoImage::FISHEYE_ORTHOGRAPHIC, HuginBase::BaseSrcPanoImage::FISHEYE_STEREOGRAPHIC, HuginBase::BaseSrcPanoImage::FISHEYE_THOBY, HuginBase::BaseSrcPanoImage::FULL_FRAME_FISHEYE, HuginBase::BaseSrcPanoImage::PANORAMIC, and HuginBase::BaseSrcPanoImage::RECTILINEAR.

Referenced by HuginQueue::detail::PrintDetailInfo(), ImagesTreeCtrl::UpdateGroupText(), and ImagesTreeCtrl::UpdateImageText().

wxString getResponseString ( const HuginBase::SrcPanoImage img  ) 

Returns translated response type for given SrcPanoImage.

Definition at line 96 of file LensTools.cpp.

References HuginBase::BaseSrcPanoImage::RESPONSE_EMOR, and HuginBase::BaseSrcPanoImage::RESPONSE_LINEAR.

Referenced by HuginQueue::detail::PrintDetailInfo(), ImagesTreeCtrl::UpdateGroupText(), and ImagesTreeCtrl::UpdateImageText().

size_t GetSelectedValue ( wxControlWithItems *  list  ) 

Returns the client value of the selected item from list.

Definition at line 73 of file LensTools.cpp.

Referenced by PanoPanel::BlenderChanged(), FindPanoDialog::OnButtonSend(), ImagesPanel::OnLensTypeChanged(), GLPreviewFrame::OnLensTypeChanged(), HFOVDialog::OnTypeChanged(), LensCalFrame::ReadInputs(), PreferencesDialog::UpdateConfigData(), and FindPanoDialog::~FindPanoDialog().

bool LoadLensParametersChoose ( wxWindow *  parent,
HuginBase::Lens lens,
bool &  cropped,
bool &  autoCenterCrop,
vigra::Rect2D &  cropRect 
)

load lens parameters from lens ini file

Parameters:
parent parent window, for showing messageboxes
lens lens, for reading projection and lensparameters
cropped read if cropped enabled
autoCenterCrop read if automatic center crop
cropRect read crop rect
Returns:
true if lens parameters were sucessful read

Definition at line 258 of file LensTools.cpp.

References cerr, DEBUG_DEBUG, HuginBase::Lens::getImageSize(), vigra_ext::EMoR::h, map_get(), HuginBase::Lens::setCropFactor(), HuginBase::Lens::setProjection(), HuginBase::Lens::variableNames, and HuginBase::Lens::variables.

Referenced by HFOVDialog::OnLoadLensParameters().

void SaveLensParameters ( const wxString  filename,
HuginBase::Panorama pano,
unsigned int  imgNr 
)

save the lens parameters of the image to a lens file named filename

Definition at line 111 of file LensTools.cpp.

Referenced by PanoOperation::SaveLensOperation::GetInternalCommand(), LensCalFrame::OnSaveLens(), SaveLensParametersToIni(), and LensCalFrame::SaveLensToIni().

void SaveLensParametersToIni ( wxWindow *  parent,
HuginBase::Panorama pano,
const HuginBase::UIntSet  images 
)

saves the lens parameters to ini files, provides all necessary dialogs

Definition at line 383 of file LensTools.cpp.

References SaveLensParameters().

Referenced by PanoOperation::SaveLensOperation::GetInternalCommand().

void SelectListValue ( wxControlWithItems *  list,
size_t  newValue 
)

Selects the given value (stored in the client data) in the given list item.

Definition at line 60 of file LensTools.cpp.

Referenced by LensCalFrame::AddImages(), EVT_BUTTON(), FindPanoDialog::FindPanoDialog(), HFOVDialog::OnLoadLensParameters(), ImagesPanel::OnSelectionChanged(), GLPreviewFrame::panoramaChanged(), PanoPanel::UpdateDisplay(), and PreferencesDialog::UpdateDisplayData().


Generated on 2 Sep 2015 for Hugintrunk by  doxygen 1.4.7