ImagesPanel Class Reference

Hugin's first panel. More...

#include <ImagesPanel.h>

Inheritance diagram for ImagesPanel:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ImagesPanel ()
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxT("panel"))
void Init (HuginBase::Panorama *pano)
 ~ImagesPanel ()
virtual void panoramaChanged (HuginBase::Panorama &pano)
 receives notification about panorama changes
virtual void panoramaImagesChanged (HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
 notifies about changes to images
void ReloadCPDetectorSettings ()
 Reloads the cp detector settings from config, necessary after edit preferences.
CPDetectorSettingGetDefaultSetting ()
 returns the default cp detector settings
void SetGuiLevel (GuiLevel newGuiLevel)
 sets the GuiLevel for all controls on this panel
wxString GetCurrentOptimizerString ()
 return the currently selected optimizer setting as string from the drop down list box
void RunCPGenerator (CPDetectorSetting &setting, const HuginBase::UIntSet &img)
 run the cp generator with the given setting on selected images
void RunCPGenerator (const HuginBase::UIntSet &img)
 runs the currently selected cp generator on given images
const wxString GetSelectedCPGenerator ()
 return the currently selected cp generator description

Protected Member Functions

void OnOptimizeButton (wxCommandEvent &e)
 event handler for geometric optimizer
void OnPhotometricOptimizeButton (wxCommandEvent &e)
 event handler for photometric optimizer

Private Member Functions

void OnSize (wxSizeEvent &e)
void CPGenerate (wxCommandEvent &e)
 control point detection event handler
void OnSelectionChanged (wxTreeEvent &e)
 change displayed variables if the selection has changed.
void OnLensTypeChanged (wxCommandEvent &e)
 updates the lens type for the selected images
void OnFocalLengthChanged (wxCommandEvent &e)
 updates the focal length for the selected images
void OnCropFactorChanged (wxCommandEvent &e)
 updates the crop factor for the selected images
void OnMinimumOverlapChanged (wxCommandEvent &e)
 updates the minimum overlap
void OnMaxEvDiffChanged (wxCommandEvent &e)
 updates the max ev difference
void OnGroupModeChanged (wxCommandEvent &e)
 event handler when grouping selection was changed
void OnDisplayModeChanged (wxCommandEvent &e)
 event handler when display mode (which information should be shown) was changed
void OnOptimizerSwitchChanged (wxCommandEvent &e)
 event handler, when optimizer master switch was changed
void OnPhotometricOptimizerSwitchChanged (wxCommandEvent &e)
 event handler, when photometric optimizer master switch was changed
void FillGroupChoice ()
 fills the grouping wxChoice with values depending on GuiLevel
void FillOptimizerChoice ()
 fills the optmizer wxChoices with values depending on GuiLevel
void DisableImageCtrls ()
void EnableImageCtrls ()
void ShowImage (unsigned int imgNr)
 show a bigger thumbnail
void UpdatePreviewImage ()

Private Attributes

Panoramam_pano
 the model
wxBitmap m_empty
 bitmap with default image
HuginBase::ImageCache::RequestPtr thumbnail_request
 Request for thumbnail image.
ImagesTreeCtrlm_images_tree
 pointer to the main control
wxStaticBitmap * m_smallImgCtrl
 pointer to the preview image control
wxChoice * m_lenstype
 pointer to lens type selector
wxChoice * m_optChoice
 pointer to optimizer switch selector
wxChoice * m_optPhotoChoice
 pointer to photometric optimizer switch selector
wxTextCtrl * m_focallength
 the text input control for focal length
wxTextCtrl * m_cropfactor
 the text input control for crop factor
wxTextCtrl * m_overlap
 the text input control for minimum overlap
wxTextCtrl * m_maxEv
 the text input control for max ev difference
size_t m_showImgNr
wxButton * m_matchingButton
wxChoice * m_CPDetectorChoice
CPDetectorConfig cpdetector_config
GuiLevel m_guiLevel
int m_degDigits

Detailed Description

Hugin's first panel.

This Panel is for loading of images into Panorama. Here one can set first values vor the camera orientation and link these parameters for the optimization.

Definition at line 42 of file ImagesPanel.h.


Constructor & Destructor Documentation

ImagesPanel::ImagesPanel (  ) 

ImagesPanel::~ImagesPanel (  ) 

Definition at line 186 of file ImagesPanel.cpp.

References DEBUG_TRACE, DeleteClientData(), m_cropfactor, m_focallength, m_maxEv, m_optChoice, m_optPhotoChoice, m_overlap, m_pano, and HuginBase::Panorama::removeObserver().


Member Function Documentation

void ImagesPanel::CPGenerate ( wxCommandEvent &  e  )  [private]

control point detection event handler

Definition at line 292 of file ImagesPanel.cpp.

References cpdetector_config, fill_set(), HuginBase::Panorama::getNrOfImages(), ImagesTreeCtrl::GetSelectedImages(), m_CPDetectorChoice, m_images_tree, m_pano, RunCPGenerator(), and CPDetectorConfig::settings.

bool ImagesPanel::Create ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxTAB_TRAVERSAL,
const wxString &  name = wxT("panel") 
)

Definition at line 89 of file ImagesPanel.cpp.

References cpdetector_config, DEBUG_ASSERT, DEBUG_TRACE, CPDetectorConfig::FillControl(), FillGroupChoice(), FillLensProjectionList(), FillOptimizerChoice(), huginApp::Get(), m_CPDetectorChoice, m_cropfactor, m_degDigits, m_empty, m_focallength, m_images_tree, m_lenstype, m_matchingButton, m_maxEv, m_optChoice, m_optPhotoChoice, m_overlap, m_showImgNr, m_smallImgCtrl, OnSelectionChanged(), CPDetectorConfig::Read(), and CPDetectorConfig::Write().

void ImagesPanel::DisableImageCtrls (  )  [private]

Definition at line 435 of file ImagesPanel.cpp.

References m_cropfactor, m_empty, m_focallength, m_lenstype, and m_smallImgCtrl.

Referenced by OnSelectionChanged(), and panoramaImagesChanged().

void ImagesPanel::EnableImageCtrls (  )  [private]

Definition at line 446 of file ImagesPanel.cpp.

References m_cropfactor, m_focallength, and m_lenstype.

Referenced by OnSelectionChanged().

void ImagesPanel::FillGroupChoice (  )  [private]

fills the grouping wxChoice with values depending on GuiLevel

Definition at line 689 of file ImagesPanel.cpp.

References DeleteClientData(), ImagesTreeCtrl::GROUP_LENS, ImagesTreeCtrl::GROUP_NONE, ImagesTreeCtrl::GROUP_OUTPUTLAYERS, ImagesTreeCtrl::GROUP_OUTPUTSTACK, ImagesTreeCtrl::GROUP_STACK, GUI_ADVANCED, GUI_EXPERT, GUI_SIMPLE, m_guiLevel, and OnGroupModeChanged().

Referenced by Create(), and SetGuiLevel().

void ImagesPanel::FillOptimizerChoice (  )  [private]

fills the optmizer wxChoices with values depending on GuiLevel

Definition at line 725 of file ImagesPanel.cpp.

References DeleteClientData(), GUI_EXPERT, GUI_SIMPLE, m_guiLevel, m_optChoice, m_optPhotoChoice, HuginBase::OPT_ALL, HuginBase::OPT_BARREL, HuginBase::OPT_EXPOSURE, HuginBase::OPT_PAIR, HuginBase::OPT_POSITION, HuginBase::OPT_RESPONSE, HuginBase::OPT_TRANSLATION, HuginBase::OPT_VIEW, HuginBase::OPT_VIGNETTING, and HuginBase::OPT_WHITEBALANCE.

Referenced by Create(), and SetGuiLevel().

wxString ImagesPanel::GetCurrentOptimizerString (  ) 

return the currently selected optimizer setting as string from the drop down list box

Definition at line 797 of file ImagesPanel.cpp.

References m_optChoice.

Referenced by MainFrame::GetCurrentOptimizerString().

CPDetectorSetting& ImagesPanel::GetDefaultSetting (  )  [inline]

returns the default cp detector settings

Definition at line 76 of file ImagesPanel.h.

References cpdetector_config, CPDetectorConfig::GetDefaultGenerator(), and CPDetectorConfig::settings.

Referenced by MainFrame::GetDefaultSetting().

const wxString ImagesPanel::GetSelectedCPGenerator (  ) 

return the currently selected cp generator description

Definition at line 354 of file ImagesPanel.cpp.

References cpdetector_config, m_CPDetectorChoice, and CPDetectorConfig::settings.

Referenced by MainFrame::GetSelectedCPGenerator().

void ImagesPanel::Init ( HuginBase::Panorama pano  ) 

Definition at line 167 of file ImagesPanel.cpp.

References HuginBase::Panorama::addObserver(), ImagesTreeCtrl::Init(), m_images_tree, and m_pano.

void ImagesPanel::OnCropFactorChanged ( wxCommandEvent &  e  )  [private]

updates the crop factor for the selected images

Definition at line 595 of file ImagesPanel.cpp.

References CommandHistory::addCommand(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getNrOfImages(), ImagesTreeCtrl::GetSelectedImages(), m_cropfactor, m_images_tree, m_pano, and str2double().

void ImagesPanel::OnDisplayModeChanged ( wxCommandEvent &  e  )  [private]

event handler when display mode (which information should be shown) was changed

Definition at line 817 of file ImagesPanel.cpp.

References m_images_tree, and ImagesTreeCtrl::SetDisplayMode().

void ImagesPanel::OnFocalLengthChanged ( wxCommandEvent &  e  )  [private]

updates the focal length for the selected images

Definition at line 544 of file ImagesPanel.cpp.

References CommandHistory::addCommand(), HuginBase::SrcPanoImage::calcHFOV(), HuginBase::Panorama::getImage(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getNrOfImages(), ImagesTreeCtrl::GetSelectedImages(), m_focallength, m_images_tree, m_pano, OnSelectionChanged(), and str2double().

void ImagesPanel::OnGroupModeChanged ( wxCommandEvent &  e  )  [private]

event handler when grouping selection was changed

Definition at line 802 of file ImagesPanel.cpp.

References ImagesTreeCtrl::GROUP_OUTPUTLAYERS, ImagesTreeCtrl::GROUP_OUTPUTSTACK, m_images_tree, m_maxEv, m_overlap, and ImagesTreeCtrl::SetGroupMode().

Referenced by FillGroupChoice().

void ImagesPanel::OnLensTypeChanged ( wxCommandEvent &  e  )  [private]

updates the lens type for the selected images

Definition at line 527 of file ImagesPanel.cpp.

References CommandHistory::addCommand(), PT::calcFocalLength(), HuginBase::Panorama::getImage(), PanoCommand::GlobalCmdHist::getInstance(), ImagesTreeCtrl::GetSelectedImages(), GetSelectedValue(), m_images_tree, m_lenstype, m_pano, and HuginBase::BaseSrcPanoImage::Projection.

void ImagesPanel::OnMaxEvDiffChanged ( wxCommandEvent &  e  )  [private]

updates the max ev difference

Definition at line 659 of file ImagesPanel.cpp.

References CommandHistory::addCommand(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptions(), m_maxEv, m_pano, HuginBase::PanoramaOptions::outputLayersExposureDiff, and str2double().

void ImagesPanel::OnMinimumOverlapChanged ( wxCommandEvent &  e  )  [private]

updates the minimum overlap

Definition at line 625 of file ImagesPanel.cpp.

References CommandHistory::addCommand(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptions(), m_overlap, m_pano, HuginBase::PanoramaOptions::outputStacksMinOverlap, and str2double().

void ImagesPanel::OnOptimizeButton ( wxCommandEvent &  e  )  [protected]

event handler for geometric optimizer

Definition at line 869 of file ImagesPanel.cpp.

References MainFrame::Get(), and MainFrame::OnOptimize().

void ImagesPanel::OnOptimizerSwitchChanged ( wxCommandEvent &  e  )  [private]

event handler, when optimizer master switch was changed

Definition at line 823 of file ImagesPanel.cpp.

References CommandHistory::addCommand(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptimizerSwitch(), m_optChoice, and m_pano.

void ImagesPanel::OnPhotometricOptimizeButton ( wxCommandEvent &  e  )  [protected]

event handler for photometric optimizer

Definition at line 874 of file ImagesPanel.cpp.

References MainFrame::Get(), and MainFrame::OnPhotometricOptimize().

void ImagesPanel::OnPhotometricOptimizerSwitchChanged ( wxCommandEvent &  e  )  [private]

event handler, when photometric optimizer master switch was changed

Definition at line 834 of file ImagesPanel.cpp.

References CommandHistory::addCommand(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getPhotometricOptimizerSwitch(), m_optPhotoChoice, and m_pano.

void ImagesPanel::OnSelectionChanged ( wxTreeEvent &  e  )  [private]

change displayed variables if the selection has changed.

Definition at line 359 of file ImagesPanel.cpp.

References PT::calcFocalLength(), DEBUG_DEBUG, DisableImageCtrls(), hugin_utils::doubleTowxString(), EnableImageCtrls(), HuginBase::Panorama::getImage(), ImagesTreeCtrl::GetSelectedImages(), m_cropfactor, m_degDigits, m_empty, m_focallength, m_images_tree, m_lenstype, m_pano, m_smallImgCtrl, Projection, SelectListValue(), and ShowImage().

Referenced by Create(), OnFocalLengthChanged(), and panoramaImagesChanged().

void ImagesPanel::OnSize ( wxSizeEvent &  e  )  [private]

Definition at line 206 of file ImagesPanel.cpp.

References DEBUG_INFO, and UpdatePreviewImage().

void ImagesPanel::panoramaChanged ( HuginBase::Panorama pano  )  [virtual]

receives notification about panorama changes

Implements HuginBase::PanoramaObserver.

Definition at line 216 of file ImagesPanel.cpp.

References CommandHistory::addCommand(), hugin_utils::doubleTowxString(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptimizerSwitch(), HuginBase::Panorama::getOptions(), HuginBase::Panorama::getPhotometricOptimizerSwitch(), m_maxEv, m_optChoice, m_optPhotoChoice, m_overlap, m_pano, HuginBase::PanoramaOptions::outputLayersExposureDiff, and HuginBase::PanoramaOptions::outputStacksMinOverlap.

Referenced by SetGuiLevel().

void ImagesPanel::panoramaImagesChanged ( HuginBase::Panorama pano,
const HuginBase::UIntSet imgNr 
) [virtual]

notifies about changes to images

Images might have been added/removed. to find out how many images are still there, use Panorama::getNrOfImages.

Parameters:
pano the panorama object that changed
changed set of changed images

Implements HuginBase::PanoramaObserver.

Definition at line 266 of file ImagesPanel.cpp.

References DEBUG_DEBUG, DEBUG_TRACE, DisableImageCtrls(), HuginBase::Panorama::getNrOfImages(), ImagesTreeCtrl::GetSelectedImages(), m_images_tree, m_matchingButton, and OnSelectionChanged().

void ImagesPanel::ReloadCPDetectorSettings (  ) 

Reloads the cp detector settings from config, necessary after edit preferences.

Definition at line 518 of file ImagesPanel.cpp.

References cpdetector_config, CPDetectorConfig::FillControl(), m_CPDetectorChoice, and CPDetectorConfig::Read().

Referenced by MainFrame::OnShowPrefs().

void ImagesPanel::RunCPGenerator ( const HuginBase::UIntSet img  ) 

runs the currently selected cp generator on given images

Definition at line 311 of file ImagesPanel.cpp.

References cpdetector_config, m_CPDetectorChoice, RunCPGenerator(), and CPDetectorConfig::settings.

void ImagesPanel::RunCPGenerator ( CPDetectorSetting setting,
const HuginBase::UIntSet img 
)

run the cp generator with the given setting on selected images

Definition at line 316 of file ImagesPanel.cpp.

References CommandHistory::addCommand(), AutoCtrlPointCreator::automatch(), PanoCommand::GlobalCmdHist::getInstance(), HUGIN_ASS_NCONTROLPOINTS, and m_pano.

Referenced by CPGenerate(), MainFrame::RunCPGenerator(), and RunCPGenerator().

void ImagesPanel::SetGuiLevel ( GuiLevel  newGuiLevel  ) 

sets the GuiLevel for all controls on this panel

Definition at line 845 of file ImagesPanel.cpp.

References FillGroupChoice(), FillOptimizerChoice(), GUI_ADVANCED, GUI_EXPERT, GUI_SIMPLE, m_guiLevel, m_images_tree, m_pano, panoramaChanged(), and ImagesTreeCtrl::SetGuiLevel().

Referenced by MainFrame::SetGuiLevel().

void ImagesPanel::ShowImage ( unsigned int  imgNr  )  [private]

show a bigger thumbnail

Definition at line 454 of file ImagesPanel.cpp.

References m_showImgNr, and UpdatePreviewImage().

Referenced by OnSelectionChanged().

void ImagesPanel::UpdatePreviewImage (  )  [private]

Definition at line 460 of file ImagesPanel.cpp.

References HuginBase::Color::CorrectImage(), huginApp::Get(), HuginBase::Panorama::getImage(), huginApp::GetMonitorProfile(), HuginBase::Panorama::getNrOfImages(), huginApp::HasMonitorProfile(), imageCacheEntry2wxImage(), m_pano, m_showImgNr, m_smallImgCtrl, and thumbnail_request.

Referenced by OnSize(), and ShowImage().


Member Data Documentation

CPDetectorConfig ImagesPanel::cpdetector_config [private]

Definition at line 168 of file ImagesPanel.h.

Referenced by CPGenerate(), Create(), GetDefaultSetting(), GetSelectedCPGenerator(), ReloadCPDetectorSettings(), and RunCPGenerator().

wxChoice* ImagesPanel::m_CPDetectorChoice [private]

Definition at line 166 of file ImagesPanel.h.

Referenced by CPGenerate(), Create(), GetSelectedCPGenerator(), ReloadCPDetectorSettings(), and RunCPGenerator().

wxTextCtrl* ImagesPanel::m_cropfactor [private]

the text input control for crop factor

Definition at line 158 of file ImagesPanel.h.

Referenced by Create(), DisableImageCtrls(), EnableImageCtrls(), OnCropFactorChanged(), OnSelectionChanged(), and ~ImagesPanel().

int ImagesPanel::m_degDigits [private]

Definition at line 171 of file ImagesPanel.h.

Referenced by Create(), and OnSelectionChanged().

wxBitmap ImagesPanel::m_empty [private]

bitmap with default image

Definition at line 140 of file ImagesPanel.h.

Referenced by Create(), DisableImageCtrls(), and OnSelectionChanged().

wxTextCtrl* ImagesPanel::m_focallength [private]

the text input control for focal length

Definition at line 156 of file ImagesPanel.h.

Referenced by Create(), DisableImageCtrls(), EnableImageCtrls(), OnFocalLengthChanged(), OnSelectionChanged(), and ~ImagesPanel().

GuiLevel ImagesPanel::m_guiLevel [private]

Definition at line 170 of file ImagesPanel.h.

Referenced by FillGroupChoice(), FillOptimizerChoice(), and SetGuiLevel().

ImagesTreeCtrl* ImagesPanel::m_images_tree [private]

pointer to the main control

Definition at line 146 of file ImagesPanel.h.

Referenced by CPGenerate(), Create(), Init(), OnCropFactorChanged(), OnDisplayModeChanged(), OnFocalLengthChanged(), OnGroupModeChanged(), OnLensTypeChanged(), OnSelectionChanged(), panoramaImagesChanged(), and SetGuiLevel().

wxChoice* ImagesPanel::m_lenstype [private]

pointer to lens type selector

Definition at line 150 of file ImagesPanel.h.

Referenced by Create(), DisableImageCtrls(), EnableImageCtrls(), OnLensTypeChanged(), and OnSelectionChanged().

wxButton* ImagesPanel::m_matchingButton [private]

Definition at line 165 of file ImagesPanel.h.

Referenced by Create(), and panoramaImagesChanged().

wxTextCtrl* ImagesPanel::m_maxEv [private]

the text input control for max ev difference

Definition at line 162 of file ImagesPanel.h.

Referenced by Create(), OnGroupModeChanged(), OnMaxEvDiffChanged(), panoramaChanged(), and ~ImagesPanel().

wxChoice* ImagesPanel::m_optChoice [private]

pointer to optimizer switch selector

Definition at line 152 of file ImagesPanel.h.

Referenced by Create(), FillOptimizerChoice(), GetCurrentOptimizerString(), OnOptimizerSwitchChanged(), panoramaChanged(), and ~ImagesPanel().

wxChoice* ImagesPanel::m_optPhotoChoice [private]

pointer to photometric optimizer switch selector

Definition at line 154 of file ImagesPanel.h.

Referenced by Create(), FillOptimizerChoice(), OnPhotometricOptimizerSwitchChanged(), panoramaChanged(), and ~ImagesPanel().

wxTextCtrl* ImagesPanel::m_overlap [private]

the text input control for minimum overlap

Definition at line 160 of file ImagesPanel.h.

Referenced by Create(), OnGroupModeChanged(), OnMinimumOverlapChanged(), panoramaChanged(), and ~ImagesPanel().

Panorama* ImagesPanel::m_pano [private]

the model

Definition at line 99 of file ImagesPanel.h.

Referenced by CPGenerate(), Init(), OnCropFactorChanged(), OnFocalLengthChanged(), OnLensTypeChanged(), OnMaxEvDiffChanged(), OnMinimumOverlapChanged(), OnOptimizerSwitchChanged(), OnPhotometricOptimizerSwitchChanged(), OnSelectionChanged(), panoramaChanged(), RunCPGenerator(), SetGuiLevel(), UpdatePreviewImage(), and ~ImagesPanel().

size_t ImagesPanel::m_showImgNr [private]

Definition at line 163 of file ImagesPanel.h.

Referenced by Create(), ShowImage(), and UpdatePreviewImage().

wxStaticBitmap* ImagesPanel::m_smallImgCtrl [private]

pointer to the preview image control

Definition at line 148 of file ImagesPanel.h.

Referenced by Create(), DisableImageCtrls(), OnSelectionChanged(), and UpdatePreviewImage().

HuginBase::ImageCache::RequestPtr ImagesPanel::thumbnail_request [private]

Request for thumbnail image.

Definition at line 143 of file ImagesPanel.h.

Referenced by UpdatePreviewImage().


The documentation for this class was generated from the following files:
Generated on 29 Aug 2015 for Hugintrunk by  doxygen 1.4.7