Hugintrunk
0.1
|
Hugin's first panel. More...
#include <ImagesPanel.h>
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) |
this is called whenever the panorama has changed. More... | |
virtual void | panoramaImagesChanged (HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr) |
notifies about changes to images More... | |
void | ReloadCPDetectorSettings () |
Reloads the cp detector settings from config, necessary after edit preferences. More... | |
CPDetectorSetting & | GetDefaultSetting () |
returns the default cp detector settings More... | |
void | SetGuiLevel (GuiLevel newGuiLevel) |
sets the GuiLevel for all controls on this panel More... | |
wxString | GetCurrentOptimizerString () |
return the currently selected optimizer setting as string from the drop down list box More... | |
void | RunCPGenerator (CPDetectorSetting &setting, const HuginBase::UIntSet &img) |
run the cp generator with the given setting on selected images More... | |
void | RunCPGenerator (const HuginBase::UIntSet &img) |
runs the currently selected cp generator on given images More... | |
const wxString | GetSelectedCPGenerator () |
return the currently selected cp generator description More... | |
Public Member Functions inherited from HuginBase::PanoramaObserver | |
virtual | ~PanoramaObserver () |
Protected Member Functions | |
void | OnOptimizeButton (wxCommandEvent &e) |
event handler for geometric optimizer More... | |
void | OnPhotometricOptimizeButton (wxCommandEvent &e) |
event handler for photometric optimizer More... | |
Private Member Functions | |
void | OnSize (wxSizeEvent &e) |
void | CPGenerate (wxCommandEvent &e) |
control point detection event handler More... | |
void | OnSelectionChanged (wxTreeEvent &e) |
change displayed variables if the selection has changed. More... | |
void | OnLensTypeChanged (wxCommandEvent &e) |
updates the lens type for the selected images More... | |
void | OnFocalLengthChanged (wxCommandEvent &e) |
updates the focal length for the selected images More... | |
void | OnCropFactorChanged (wxCommandEvent &e) |
updates the crop factor for the selected images More... | |
void | OnMinimumOverlapChanged (wxCommandEvent &e) |
updates the minimum overlap More... | |
void | OnMaxEvDiffChanged (wxCommandEvent &e) |
updates the max ev difference More... | |
void | OnGroupModeChanged (wxCommandEvent &e) |
event handler when grouping selection was changed More... | |
void | OnDisplayModeChanged (wxCommandEvent &e) |
event handler when display mode (which information should be shown) was changed More... | |
void | OnOptimizerSwitchChanged (wxCommandEvent &e) |
event handler, when optimizer master switch was changed More... | |
void | OnPhotometricOptimizerSwitchChanged (wxCommandEvent &e) |
event handler, when photometric optimizer master switch was changed More... | |
void | FillGroupChoice () |
fills the grouping wxChoice with values depending on GuiLevel More... | |
void | FillOptimizerChoice () |
fills the optmizer wxChoices with values depending on GuiLevel More... | |
void | DisableImageCtrls () |
void | EnableImageCtrls () |
void | ShowImage (unsigned int imgNr) |
show a bigger thumbnail More... | |
void | UpdatePreviewImage () |
Private Attributes | |
HuginBase::Panorama * | m_pano |
the model More... | |
wxBitmap | m_empty |
bitmap with default image More... | |
HuginBase::ImageCache::RequestPtr | thumbnail_request |
Request for thumbnail image. More... | |
ImagesTreeCtrl * | m_images_tree |
pointer to the main control More... | |
wxStaticBitmap * | m_smallImgCtrl |
pointer to the preview image control More... | |
wxChoice * | m_lenstype |
pointer to lens type selector More... | |
wxChoice * | m_optChoice |
pointer to optimizer switch selector More... | |
wxChoice * | m_optPhotoChoice |
pointer to photometric optimizer switch selector More... | |
wxTextCtrl * | m_focallength |
the text input control for focal length More... | |
wxTextCtrl * | m_cropfactor |
the text input control for crop factor More... | |
wxTextCtrl * | m_overlap |
the text input control for minimum overlap More... | |
wxTextCtrl * | m_maxEv |
the text input control for max ev difference More... | |
size_t | m_showImgNr |
wxButton * | m_matchingButton |
wxChoice * | m_CPDetectorChoice |
CPDetectorConfig | cpdetector_config |
GuiLevel | m_guiLevel |
int | m_degDigits |
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 40 of file ImagesPanel.h.
ImagesPanel::ImagesPanel | ( | ) |
Definition at line 73 of file ImagesPanel.cpp.
References GUI_SIMPLE.
ImagesPanel::~ImagesPanel | ( | ) |
Definition at line 184 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().
|
private |
control point detection event handler
run control point detector on selected images, and add control points
Definition at line 290 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 79 of file ImagesPanel.cpp.
References cpdetector_config, DEBUG_ASSERT, DEBUG_TRACE, CPDetectorConfig::FillControl(), FillGroupChoice(), FillLensProjectionList(), FillOptimizerChoice(), huginApp::Get(), GetDataPath(), 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(), wxcode::wxTreeListCtrl::SetFocus(), and CPDetectorConfig::Write().
|
private |
Definition at line 430 of file ImagesPanel.cpp.
References m_cropfactor, m_empty, m_focallength, m_lenstype, and m_smallImgCtrl.
Referenced by OnSelectionChanged(), and panoramaImagesChanged().
|
private |
Definition at line 441 of file ImagesPanel.cpp.
References m_cropfactor, m_focallength, and m_lenstype.
Referenced by OnSelectionChanged().
|
private |
fills the grouping wxChoice with values depending on GuiLevel
Definition at line 713 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().
|
private |
fills the optmizer wxChoices with values depending on GuiLevel
Definition at line 749 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 821 of file ImagesPanel.cpp.
References m_optChoice.
Referenced by MainFrame::GetCurrentOptimizerString().
|
inline |
returns the default cp detector settings
Definition at line 74 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 348 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 165 of file ImagesPanel.cpp.
References HuginBase::Panorama::addObserver(), ImagesTreeCtrl::Init(), m_images_tree, and m_pano.
Referenced by MainFrame::MainFrame().
|
private |
updates the crop factor for the selected images
Definition at line 619 of file ImagesPanel.cpp.
References PanoCommand::CommandHistory::addCommand(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getNrOfImages(), ImagesTreeCtrl::GetSelectedImages(), m_cropfactor, m_images_tree, m_pano, and hugin_utils::str2double().
|
private |
event handler when display mode (which information should be shown) was changed
Definition at line 841 of file ImagesPanel.cpp.
References m_images_tree, and ImagesTreeCtrl::SetDisplayMode().
|
private |
updates the focal length for the selected images
Definition at line 568 of file ImagesPanel.cpp.
References PanoCommand::CommandHistory::addCommand(), HuginBase::SrcPanoImage::calcHFOV(), HuginBase::BaseSrcPanoImage::FISHEYE_ORTHOGRAPHIC, HuginBase::Panorama::getImage(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getNrOfImages(), ImagesTreeCtrl::GetSelectedImages(), m_focallength, m_images_tree, m_pano, OnSelectionChanged(), and hugin_utils::str2double().
|
private |
event handler when grouping selection was changed
Definition at line 826 of file ImagesPanel.cpp.
References ImagesTreeCtrl::GROUP_OUTPUTLAYERS, ImagesTreeCtrl::GROUP_OUTPUTSTACK, m_images_tree, m_maxEv, m_overlap, and ImagesTreeCtrl::SetGroupMode().
Referenced by FillGroupChoice().
|
private |
updates the lens type for the selected images
Definition at line 532 of file ImagesPanel.cpp.
References PanoCommand::CommandHistory::addCommand(), HuginBase::SrcPanoImage::calcFocalLength(), HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, HuginBase::BaseSrcPanoImage::FULL_FRAME_FISHEYE, MainFrame::Get(), HuginBase::Panorama::getImage(), PanoCommand::GlobalCmdHist::getInstance(), ImagesTreeCtrl::GetSelectedImages(), GetSelectedValue(), m_images_tree, m_lenstype, m_pano, HuginBase::BaseSrcPanoImage::PANORAMIC, HuginBase::BaseSrcPanoImage::RECTILINEAR, and MainFrame::ShowMaskEditor().
|
private |
updates the max ev difference
Definition at line 683 of file ImagesPanel.cpp.
References PanoCommand::CommandHistory::addCommand(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptions(), m_maxEv, m_pano, HuginBase::PanoramaOptions::outputLayersExposureDiff, and hugin_utils::str2double().
|
private |
updates the minimum overlap
Definition at line 649 of file ImagesPanel.cpp.
References PanoCommand::CommandHistory::addCommand(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptions(), m_overlap, m_pano, HuginBase::PanoramaOptions::outputStacksMinOverlap, and hugin_utils::str2double().
|
protected |
event handler for geometric optimizer
Definition at line 893 of file ImagesPanel.cpp.
References MainFrame::Get(), and MainFrame::OnOptimize().
|
private |
event handler, when optimizer master switch was changed
Definition at line 847 of file ImagesPanel.cpp.
References PanoCommand::CommandHistory::addCommand(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptimizerSwitch(), m_optChoice, and m_pano.
|
protected |
event handler for photometric optimizer
Definition at line 898 of file ImagesPanel.cpp.
References MainFrame::Get(), and MainFrame::OnPhotometricOptimize().
|
private |
event handler, when photometric optimizer master switch was changed
Definition at line 858 of file ImagesPanel.cpp.
References PanoCommand::CommandHistory::addCommand(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getPhotometricOptimizerSwitch(), m_optPhotoChoice, and m_pano.
|
private |
change displayed variables if the selection has changed.
Definition at line 353 of file ImagesPanel.cpp.
References HuginBase::SrcPanoImage::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, SelectListValue(), and ShowImage().
Referenced by Create(), OnFocalLengthChanged(), and panoramaImagesChanged().
|
private |
Definition at line 204 of file ImagesPanel.cpp.
References DEBUG_INFO, and UpdatePreviewImage().
|
virtual |
this is called whenever the panorama has changed.
This function must now update all the gui representations of the panorama to display the new state.
Functions that change the panororama must not update the GUI directly. The GUI should always be updated to reflect the current panorama state in this function.
This avoids unnessecary close coupling between the controller and the view (even if they sometimes are in the same object). See model view controller pattern.
receives notification about panorama changes
Implements HuginBase::PanoramaObserver.
Definition at line 214 of file ImagesPanel.cpp.
References PanoCommand::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().
|
virtual |
notifies about changes to images
Images might have been added/removed. to find out how many images are still there, use Panorama::getNrOfImages.
pano | the panorama object that changed |
changed | set of changed images |
Implements HuginBase::PanoramaObserver.
Definition at line 264 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 523 of file ImagesPanel.cpp.
References cpdetector_config, CPDetectorConfig::FillControl(), m_CPDetectorChoice, and CPDetectorConfig::Read().
Referenced by MainFrame::OnShowPrefs().
void ImagesPanel::RunCPGenerator | ( | CPDetectorSetting & | setting, |
const HuginBase::UIntSet & | img | ||
) |
run the cp generator with the given setting on selected images
Definition at line 314 of file ImagesPanel.cpp.
References PanoCommand::CommandHistory::addCommand(), AutoCtrlPointCreator::automatch(), PanoCommand::GlobalCmdHist::getInstance(), HUGIN_ASS_NCONTROLPOINTS, and m_pano.
Referenced by CPGenerate(), RunCPGenerator(), and MainFrame::RunCPGenerator().
void ImagesPanel::RunCPGenerator | ( | const HuginBase::UIntSet & | img | ) |
runs the currently selected cp generator on given images
Definition at line 309 of file ImagesPanel.cpp.
References cpdetector_config, m_CPDetectorChoice, RunCPGenerator(), and CPDetectorConfig::settings.
void ImagesPanel::SetGuiLevel | ( | GuiLevel | newGuiLevel | ) |
sets the GuiLevel for all controls on this panel
Definition at line 869 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().
|
private |
show a bigger thumbnail
Definition at line 449 of file ImagesPanel.cpp.
References m_showImgNr, and UpdatePreviewImage().
Referenced by OnSelectionChanged().
|
private |
Definition at line 455 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, celeste::max(), and thumbnail_request.
Referenced by OnSize(), and ShowImage().
|
private |
Definition at line 166 of file ImagesPanel.h.
Referenced by CPGenerate(), Create(), GetDefaultSetting(), GetSelectedCPGenerator(), ReloadCPDetectorSettings(), and RunCPGenerator().
|
private |
Definition at line 164 of file ImagesPanel.h.
Referenced by CPGenerate(), Create(), GetSelectedCPGenerator(), ReloadCPDetectorSettings(), and RunCPGenerator().
|
private |
the text input control for crop factor
Definition at line 156 of file ImagesPanel.h.
Referenced by Create(), DisableImageCtrls(), EnableImageCtrls(), OnCropFactorChanged(), OnSelectionChanged(), and ~ImagesPanel().
|
private |
Definition at line 169 of file ImagesPanel.h.
Referenced by Create(), and OnSelectionChanged().
|
private |
bitmap with default image
Definition at line 138 of file ImagesPanel.h.
Referenced by Create(), DisableImageCtrls(), and OnSelectionChanged().
|
private |
the text input control for focal length
Definition at line 154 of file ImagesPanel.h.
Referenced by Create(), DisableImageCtrls(), EnableImageCtrls(), OnFocalLengthChanged(), OnSelectionChanged(), and ~ImagesPanel().
|
private |
Definition at line 168 of file ImagesPanel.h.
Referenced by FillGroupChoice(), FillOptimizerChoice(), and SetGuiLevel().
|
private |
pointer to the main control
Definition at line 144 of file ImagesPanel.h.
Referenced by CPGenerate(), Create(), Init(), OnCropFactorChanged(), OnDisplayModeChanged(), OnFocalLengthChanged(), OnGroupModeChanged(), OnLensTypeChanged(), OnSelectionChanged(), panoramaImagesChanged(), and SetGuiLevel().
|
private |
pointer to lens type selector
Definition at line 148 of file ImagesPanel.h.
Referenced by Create(), DisableImageCtrls(), EnableImageCtrls(), OnLensTypeChanged(), and OnSelectionChanged().
|
private |
Definition at line 163 of file ImagesPanel.h.
Referenced by Create(), and panoramaImagesChanged().
|
private |
the text input control for max ev difference
Definition at line 160 of file ImagesPanel.h.
Referenced by Create(), OnGroupModeChanged(), OnMaxEvDiffChanged(), panoramaChanged(), and ~ImagesPanel().
|
private |
pointer to optimizer switch selector
Definition at line 150 of file ImagesPanel.h.
Referenced by Create(), FillOptimizerChoice(), GetCurrentOptimizerString(), OnOptimizerSwitchChanged(), panoramaChanged(), and ~ImagesPanel().
|
private |
pointer to photometric optimizer switch selector
Definition at line 152 of file ImagesPanel.h.
Referenced by Create(), FillOptimizerChoice(), OnPhotometricOptimizerSwitchChanged(), panoramaChanged(), and ~ImagesPanel().
|
private |
the text input control for minimum overlap
Definition at line 158 of file ImagesPanel.h.
Referenced by Create(), OnGroupModeChanged(), OnMinimumOverlapChanged(), panoramaChanged(), and ~ImagesPanel().
|
private |
the model
Definition at line 97 of file ImagesPanel.h.
Referenced by CPGenerate(), Init(), OnCropFactorChanged(), OnFocalLengthChanged(), OnLensTypeChanged(), OnMaxEvDiffChanged(), OnMinimumOverlapChanged(), OnOptimizerSwitchChanged(), OnPhotometricOptimizerSwitchChanged(), OnSelectionChanged(), panoramaChanged(), RunCPGenerator(), SetGuiLevel(), UpdatePreviewImage(), and ~ImagesPanel().
|
private |
Definition at line 161 of file ImagesPanel.h.
Referenced by Create(), ShowImage(), and UpdatePreviewImage().
|
private |
pointer to the preview image control
Definition at line 146 of file ImagesPanel.h.
Referenced by Create(), DisableImageCtrls(), OnSelectionChanged(), and UpdatePreviewImage().
|
private |
Request for thumbnail image.
Definition at line 141 of file ImagesPanel.h.
Referenced by UpdatePreviewImage().