Hugin trunk 0.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ImagesPanel Class Reference

Hugin's first panel. More...

#include <ImagesPanel.h>

Inheritance diagram for ImagesPanel:
Inheritance graph

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="panel")
 
void Init (HuginBase::Panorama *pano)
 
 ~ImagesPanel ()
 
virtual void panoramaChanged (HuginBase::Panorama &pano)
 this is called whenever the panorama has changed.
 
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
 
- Public Member Functions inherited from HuginBase::PanoramaObserver
virtual ~PanoramaObserver ()
 

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

HuginBase::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
 
wxStaticBitmapm_smallImgCtrl
 pointer to the preview image control
 
wxChoicem_lenstype
 pointer to lens type selector
 
wxChoicem_optChoice
 pointer to optimizer switch selector
 
wxChoicem_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
 
wxButtonm_matchingButton
 
wxChoicem_CPDetectorChoice
 
wxChoicem_groupModeChoice
 
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 40 of file ImagesPanel.h.

Constructor & Destructor Documentation

◆ ImagesPanel()

ImagesPanel::ImagesPanel ( )

Definition at line 57 of file ImagesPanel.cpp.

References GUI_SIMPLE, m_guiLevel, and m_pano.

◆ ~ImagesPanel()

ImagesPanel::~ImagesPanel ( )

Member Function Documentation

◆ CPGenerate()

void ImagesPanel::CPGenerate ( wxCommandEvent &  e)
private

control point detection event handler

run control point detector on selected images, and add control points

Definition at line 287 of file ImagesPanel.cpp.

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

Referenced by Create().

◆ Create()

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

◆ DisableImageCtrls()

void ImagesPanel::DisableImageCtrls ( )
private

Definition at line 427 of file ImagesPanel.cpp.

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

Referenced by OnSelectionChanged(), and panoramaImagesChanged().

◆ EnableImageCtrls()

void ImagesPanel::EnableImageCtrls ( )
private

Definition at line 438 of file ImagesPanel.cpp.

References m_cropfactor, m_focallength, and m_lenstype.

Referenced by OnSelectionChanged().

◆ FillGroupChoice()

void ImagesPanel::FillGroupChoice ( )
private

◆ FillOptimizerChoice()

void ImagesPanel::FillOptimizerChoice ( )
private

◆ GetCurrentOptimizerString()

wxString ImagesPanel::GetCurrentOptimizerString ( )

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

Definition at line 805 of file ImagesPanel.cpp.

References m_optChoice.

Referenced by MainFrame::GetCurrentOptimizerString().

◆ GetDefaultSetting()

CPDetectorSetting & ImagesPanel::GetDefaultSetting ( )
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().

◆ GetSelectedCPGenerator()

const wxString ImagesPanel::GetSelectedCPGenerator ( )

return the currently selected cp generator description

Definition at line 345 of file ImagesPanel.cpp.

References cpdetector_config, m_CPDetectorChoice, and CPDetectorConfig::settings.

Referenced by MainFrame::GetSelectedCPGenerator().

◆ Init()

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

◆ OnCropFactorChanged()

void ImagesPanel::OnCropFactorChanged ( wxCommandEvent &  e)
private

◆ OnDisplayModeChanged()

void ImagesPanel::OnDisplayModeChanged ( wxCommandEvent &  e)
private

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

Definition at line 824 of file ImagesPanel.cpp.

References m_images_tree, ImagesTreeCtrl::SetDisplayMode(), and threshold().

Referenced by Create().

◆ OnFocalLengthChanged()

void ImagesPanel::OnFocalLengthChanged ( wxCommandEvent &  e)
private

◆ OnGroupModeChanged()

void ImagesPanel::OnGroupModeChanged ( wxCommandEvent &  e)
private

event handler when grouping selection was changed

Definition at line 810 of file ImagesPanel.cpp.

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

Referenced by Create(), and FillGroupChoice().

◆ OnLensTypeChanged()

void ImagesPanel::OnLensTypeChanged ( wxCommandEvent &  e)
private

◆ OnMaxEvDiffChanged()

void ImagesPanel::OnMaxEvDiffChanged ( wxCommandEvent &  e)
private

◆ OnMinimumOverlapChanged()

void ImagesPanel::OnMinimumOverlapChanged ( wxCommandEvent &  e)
private

◆ OnOptimizeButton()

void ImagesPanel::OnOptimizeButton ( wxCommandEvent &  e)
protected

event handler for geometric optimizer

Definition at line 876 of file ImagesPanel.cpp.

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

Referenced by Create().

◆ OnOptimizerSwitchChanged()

void ImagesPanel::OnOptimizerSwitchChanged ( wxCommandEvent &  e)
private

event handler, when optimizer master switch was changed

Definition at line 830 of file ImagesPanel.cpp.

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

Referenced by Create().

◆ OnPhotometricOptimizeButton()

void ImagesPanel::OnPhotometricOptimizeButton ( wxCommandEvent &  e)
protected

event handler for photometric optimizer

Definition at line 882 of file ImagesPanel.cpp.

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

Referenced by Create().

◆ OnPhotometricOptimizerSwitchChanged()

void ImagesPanel::OnPhotometricOptimizerSwitchChanged ( wxCommandEvent &  e)
private

event handler, when photometric optimizer master switch was changed

Definition at line 841 of file ImagesPanel.cpp.

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

Referenced by Create().

◆ OnSelectionChanged()

void ImagesPanel::OnSelectionChanged ( wxTreeEvent e)
private

◆ OnSize()

void ImagesPanel::OnSize ( wxSizeEvent e)
private

Definition at line 201 of file ImagesPanel.cpp.

References DEBUG_INFO, threshold(), and UpdatePreviewImage().

◆ panoramaChanged()

void ImagesPanel::panoramaChanged ( HuginBase::Panorama pano)
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.

Todo:
react on different update signals more special

receives notification about panorama changes

Implements HuginBase::PanoramaObserver.

Definition at line 211 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, HuginBase::PanoramaOptions::outputStacksMinOverlap, and threshold().

Referenced by SetGuiLevel().

◆ panoramaImagesChanged()

void ImagesPanel::panoramaImagesChanged ( HuginBase::Panorama pano,
const HuginBase::UIntSet changed 
)
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
panothe panorama object that changed
changedset of changed images

Implements HuginBase::PanoramaObserver.

Definition at line 261 of file ImagesPanel.cpp.

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

◆ ReloadCPDetectorSettings()

void ImagesPanel::ReloadCPDetectorSettings ( )

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

Definition at line 524 of file ImagesPanel.cpp.

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

Referenced by MainFrame::OnShowPrefs().

◆ RunCPGenerator() [1/2]

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

runs the currently selected cp generator on given images

Definition at line 306 of file ImagesPanel.cpp.

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

◆ RunCPGenerator() [2/2]

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

◆ SetGuiLevel()

void ImagesPanel::SetGuiLevel ( GuiLevel  newGuiLevel)

sets the GuiLevel for all controls on this panel

Definition at line 852 of file ImagesPanel.cpp.

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

Referenced by MainFrame::SetGuiLevel().

◆ ShowImage()

void ImagesPanel::ShowImage ( unsigned int  imgNr)
private

show a bigger thumbnail

Definition at line 446 of file ImagesPanel.cpp.

References m_showImgNr, and UpdatePreviewImage().

Referenced by OnSelectionChanged().

◆ UpdatePreviewImage()

void ImagesPanel::UpdatePreviewImage ( )
private

Member Data Documentation

◆ cpdetector_config

CPDetectorConfig ImagesPanel::cpdetector_config
private

◆ m_CPDetectorChoice

wxChoice* ImagesPanel::m_CPDetectorChoice
private

◆ m_cropfactor

wxTextCtrl* ImagesPanel::m_cropfactor
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().

◆ m_degDigits

int ImagesPanel::m_degDigits
private

Definition at line 170 of file ImagesPanel.h.

Referenced by Create(), and OnSelectionChanged().

◆ m_empty

wxBitmap ImagesPanel::m_empty
private

bitmap with default image

Definition at line 138 of file ImagesPanel.h.

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

◆ m_focallength

wxTextCtrl* ImagesPanel::m_focallength
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().

◆ m_groupModeChoice

wxChoice* ImagesPanel::m_groupModeChoice
private

Definition at line 165 of file ImagesPanel.h.

Referenced by Create(), FillGroupChoice(), OnGroupModeChanged(), and ~ImagesPanel().

◆ m_guiLevel

GuiLevel ImagesPanel::m_guiLevel
private

Definition at line 169 of file ImagesPanel.h.

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

◆ m_images_tree

ImagesTreeCtrl* ImagesPanel::m_images_tree
private

◆ m_lenstype

wxChoice* ImagesPanel::m_lenstype
private

pointer to lens type selector

Definition at line 148 of file ImagesPanel.h.

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

◆ m_matchingButton

wxButton* ImagesPanel::m_matchingButton
private

Definition at line 163 of file ImagesPanel.h.

Referenced by Create(), and panoramaImagesChanged().

◆ m_maxEv

wxTextCtrl* ImagesPanel::m_maxEv
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().

◆ m_optChoice

wxChoice* ImagesPanel::m_optChoice
private

pointer to optimizer switch selector

Definition at line 150 of file ImagesPanel.h.

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

◆ m_optPhotoChoice

wxChoice* ImagesPanel::m_optPhotoChoice
private

pointer to photometric optimizer switch selector

Definition at line 152 of file ImagesPanel.h.

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

◆ m_overlap

wxTextCtrl* ImagesPanel::m_overlap
private

the text input control for minimum overlap

Definition at line 158 of file ImagesPanel.h.

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

◆ m_pano

HuginBase::Panorama* ImagesPanel::m_pano
private

◆ m_showImgNr

size_t ImagesPanel::m_showImgNr
private

Definition at line 161 of file ImagesPanel.h.

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

◆ m_smallImgCtrl

wxStaticBitmap* ImagesPanel::m_smallImgCtrl
private

pointer to the preview image control

Definition at line 146 of file ImagesPanel.h.

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

◆ thumbnail_request

HuginBase::ImageCache::RequestPtr ImagesPanel::thumbnail_request
private

Request for thumbnail image.

Definition at line 141 of file ImagesPanel.h.

Referenced by UpdatePreviewImage().


The documentation for this class was generated from the following files: