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

panel for stacker GUI More...

#include <StackerPanel.h>

Inheritance diagram for StackerPanel:
Inheritance graph

Classes

struct  FileInfo
 

Public Types

typedef std::vector< FileInfo > FileInfoVector
 

Public Member Functions

 ~StackerPanel ()
 destructor, save state and settings
 
bool Create (wxWindow *parent, MyExecPanel *logPanel)
 creates the control and populates all controls with their settings
 
void AddFile (const wxString &filename)
 adds the given file to the list
 
void OnProcessFinished (wxCommandEvent &e)
 call at the end of the enfuse command, to load result back and enable buttons again
 

Protected Member Functions

void OnAddFiles (wxCommandEvent &e)
 event handler
 
void OnAddDirectory (wxCommandEvent &e)
 
void OnRemoveFile (wxCommandEvent &e)
 
void OnFileListChar (wxKeyEvent &e)
 
void OnFileSelectionChanged (wxCommandEvent &e)
 
void OnFileCheckStateChanged (wxListEvent &e)
 
void OnFileColumnHeaderClick (wxListEvent &e)
 
void OnModeChanged (wxCommandEvent &e)
 
void OnGeneratePreview (wxCommandEvent &e)
 
void OnGenerateOutput (wxCommandEvent &e)
 
void OnZoom (wxCommandEvent &e)
 
void OnImageLoaded (HuginBase::ImageCache::EntryPtr entry, std::string filename)
 called when is image is fully loaded to display image in wxStaticBitmap
 

Private Member Functions

void ExecuteStacker ()
 build the command line and execute enfuse command
 
void ExecuteStackerExiftool ()
 build the command line and execute enfuse and exiftool afterwards
 
wxString GetStackerOptions ()
 build string with all stacker options from values in wxPropertyGrid this are the mainly the fusion options without the filesnames

 
wxString GetStackerCommandLine ()
 get the full commandline for enfuse without program, but with files and output options, the output filename is read from m_outputFilename
 
void EnableFileButtons ()
 enable/disable the file(s) remove and create buttons depending on selection of wxListCtrl
 
long GetCheckedItemCount () const
 return the number of check images
 
void EnableOutputButtons (bool enable)
 enable/disable output buttons
 
void CleanUpTempFiles ()
 delete all temporary files, to be called mainly at end
 
void SortList ()
 sort filename list
 
void FillFileList ()
 fill the list from internal file list
 
void AddFileInfo (const long fileIndex)
 

Private Attributes

wxListCtrl * m_fileListCtrl { nullptr }
 
wxChoice * m_modeChoice { nullptr }
 
wxSpinCtrlDouble * m_winsorTrim { nullptr }
 
wxSpinCtrlDouble * m_sigma { nullptr }
 
wxSpinCtrl * m_sigmaMaxIter { nullptr }
 
wxStaticBitmap * m_smallImagePreview { nullptr }
 
FileInfoVector m_files
 
PreviewWindow * m_preview { nullptr }
 
MyExecPanel * m_logWindow { nullptr }
 
HuginBase::ImageCache::RequestPtr m_imgRequest
 
std::string m_selectedImage
 
wxArrayString m_outputFilenames
 
wxArrayString m_tempFiles
 
bool m_cleanupOutput = false
 
long m_sortCol { -1 }
 
bool m_sortAscending { true }
 

Detailed Description

panel for stacker GUI

Definition at line 38 of file StackerPanel.h.

Member Typedef Documentation

◆ FileInfoVector

Definition at line 57 of file StackerPanel.h.

Constructor & Destructor Documentation

◆ ~StackerPanel()

StackerPanel::~StackerPanel ( )

destructor, save state and settings

Definition at line 192 of file StackerPanel.cpp.

References CleanUpTempFiles(), m_fileListCtrl, m_modeChoice, m_sigma, m_sigmaMaxIter, m_sortAscending, m_sortCol, m_winsorTrim, and threshold().

Member Function Documentation

◆ AddFile()

void StackerPanel::AddFile ( const wxString &  filename)

adds the given file to the list

Definition at line 296 of file StackerPanel.cpp.

References AddFileInfo(), EnableOutputButtons(), GetCheckedItemCount(), m_files, and threshold().

Referenced by OnAddDirectory(), OnAddFiles(), and StackerDropTarget::OnDropFiles().

◆ AddFileInfo()

void StackerPanel::AddFileInfo ( const long  fileIndex)
private

Definition at line 858 of file StackerPanel.cpp.

References m_fileListCtrl, m_files, and threshold().

Referenced by AddFile(), and FillFileList().

◆ CleanUpTempFiles()

void StackerPanel::CleanUpTempFiles ( )
private

delete all temporary files, to be called mainly at end

Definition at line 838 of file StackerPanel.cpp.

References m_tempFiles, and threshold().

Referenced by OnProcessFinished(), and ~StackerPanel().

◆ Create()

bool StackerPanel::Create ( wxWindow *  parent,
MyExecPanel *  logPanel 
)

◆ EnableFileButtons()

void StackerPanel::EnableFileButtons ( )
private

enable/disable the file(s) remove and create buttons depending on selection of wxListCtrl

Definition at line 812 of file StackerPanel.cpp.

References m_fileListCtrl, and threshold().

Referenced by Create(), OnFileSelectionChanged(), and OnRemoveFile().

◆ EnableOutputButtons()

void StackerPanel::EnableOutputButtons ( bool  enable)
private

enable/disable output buttons

Definition at line 832 of file StackerPanel.cpp.

References threshold().

Referenced by AddFile(), Create(), ExecuteStacker(), ExecuteStackerExiftool(), OnFileCheckStateChanged(), OnProcessFinished(), and OnRemoveFile().

◆ ExecuteStacker()

void StackerPanel::ExecuteStacker ( )
private

◆ ExecuteStackerExiftool()

void StackerPanel::ExecuteStackerExiftool ( )
private

◆ FillFileList()

void StackerPanel::FillFileList ( )
private

fill the list from internal file list

Definition at line 847 of file StackerPanel.cpp.

References AddFileInfo(), m_fileListCtrl, m_files, SortList(), and threshold().

Referenced by OnRemoveFile().

◆ GetCheckedItemCount()

long StackerPanel::GetCheckedItemCount ( ) const
private

return the number of check images

Definition at line 818 of file StackerPanel.cpp.

References m_fileListCtrl, and threshold().

Referenced by AddFile(), OnFileCheckStateChanged(), and OnRemoveFile().

◆ GetStackerCommandLine()

wxString StackerPanel::GetStackerCommandLine ( )
private

get the full commandline for enfuse without program, but with files and output options, the output filename is read from m_outputFilename

Definition at line 742 of file StackerPanel.cpp.

References HuginQueue::GetConfigTempDir(), GetStackerOptions(), hugin_utils::HuginMessageBox(), m_fileListCtrl, m_files, m_outputFilenames, m_tempFiles, threshold(), and hugin_utils::wxQuoteFilename().

Referenced by ExecuteStacker(), and ExecuteStackerExiftool().

◆ GetStackerOptions()

wxString StackerPanel::GetStackerOptions ( )
private

build string with all stacker options from values in wxPropertyGrid this are the mainly the fusion options without the filesnames

Definition at line 707 of file StackerPanel.cpp.

References m_sigma, m_sigmaMaxIter, m_winsorTrim, and threshold().

Referenced by GetStackerCommandLine().

◆ OnAddDirectory()

void StackerPanel::OnAddDirectory ( wxCommandEvent &  e)
protected

Definition at line 370 of file StackerPanel.cpp.

References AddFile(), m_fileListCtrl, SortList(), and threshold().

Referenced by Create().

◆ OnAddFiles()

void StackerPanel::OnAddFiles ( wxCommandEvent &  e)
protected

event handler

Definition at line 312 of file StackerPanel.cpp.

References AddFile(), GetFileDialogImageFilters(), m_fileListCtrl, SortList(), and threshold().

Referenced by Create().

◆ OnFileCheckStateChanged()

void StackerPanel::OnFileCheckStateChanged ( wxListEvent &  e)
protected

Definition at line 499 of file StackerPanel.cpp.

References EnableOutputButtons(), GetCheckedItemCount(), m_fileListCtrl, and m_files.

Referenced by Create().

◆ OnFileColumnHeaderClick()

void StackerPanel::OnFileColumnHeaderClick ( wxListEvent &  e)
protected

Definition at line 506 of file StackerPanel.cpp.

References m_fileListCtrl, m_sortAscending, m_sortCol, SortList(), and threshold().

Referenced by Create().

◆ OnFileListChar()

void StackerPanel::OnFileListChar ( wxKeyEvent &  e)
protected

Definition at line 419 of file StackerPanel.cpp.

References m_fileListCtrl, and threshold().

Referenced by Create().

◆ OnFileSelectionChanged()

void StackerPanel::OnFileSelectionChanged ( wxCommandEvent &  e)
protected

◆ OnGenerateOutput()

void StackerPanel::OnGenerateOutput ( wxCommandEvent &  e)
protected

◆ OnGeneratePreview()

void StackerPanel::OnGeneratePreview ( wxCommandEvent &  e)
protected

◆ OnImageLoaded()

void StackerPanel::OnImageLoaded ( HuginBase::ImageCache::EntryPtr  entry,
std::string  filename 
)
protected

called when is image is fully loaded to display image in wxStaticBitmap

Definition at line 489 of file StackerPanel.cpp.

References GeneratePreviewSelectedFile(), m_selectedImage, m_smallImagePreview, and threshold().

Referenced by OnFileSelectionChanged().

◆ OnModeChanged()

void StackerPanel::OnModeChanged ( wxCommandEvent &  e)
protected

Definition at line 523 of file StackerPanel.cpp.

References m_modeChoice, m_sigma, m_sigmaMaxIter, m_winsorTrim, and threshold().

Referenced by Create().

◆ OnProcessFinished()

void StackerPanel::OnProcessFinished ( wxCommandEvent &  e)

call at the end of the enfuse command, to load result back and enable buttons again

Definition at line 688 of file StackerPanel.cpp.

References CleanUpTempFiles(), EnableOutputButtons(), m_cleanupOutput, m_outputFilenames, m_preview, PreviewWindow::setImage(), and threshold().

Referenced by ToolboxFrame::OnQueueProgress().

◆ OnRemoveFile()

void StackerPanel::OnRemoveFile ( wxCommandEvent &  e)
protected

◆ OnZoom()

void StackerPanel::OnZoom ( wxCommandEvent &  e)
protected

Definition at line 654 of file StackerPanel.cpp.

References DEBUG_ERROR, m_preview, and PreviewWindow::setScale().

Referenced by Create().

◆ SortList()

void StackerPanel::SortList ( )
private

sort filename list

Definition at line 905 of file StackerPanel.cpp.

References m_fileListCtrl, m_files, m_sortAscending, m_sortCol, and threshold().

Referenced by FillFileList(), OnAddDirectory(), OnAddFiles(), and OnFileColumnHeaderClick().

Member Data Documentation

◆ m_cleanupOutput

bool StackerPanel::m_cleanupOutput = false
private

Definition at line 120 of file StackerPanel.h.

Referenced by OnGenerateOutput(), OnGeneratePreview(), and OnProcessFinished().

◆ m_fileListCtrl

wxListCtrl* StackerPanel::m_fileListCtrl { nullptr }
private

◆ m_files

FileInfoVector StackerPanel::m_files
private

◆ m_imgRequest

HuginBase::ImageCache::RequestPtr StackerPanel::m_imgRequest
private

Definition at line 116 of file StackerPanel.h.

Referenced by OnFileSelectionChanged().

◆ m_logWindow

MyExecPanel* StackerPanel::m_logWindow { nullptr }
private

Definition at line 115 of file StackerPanel.h.

Referenced by Create(), ExecuteStacker(), and ExecuteStackerExiftool().

◆ m_modeChoice

wxChoice* StackerPanel::m_modeChoice { nullptr }
private

Definition at line 108 of file StackerPanel.h.

Referenced by Create(), OnModeChanged(), and ~StackerPanel().

◆ m_outputFilenames

wxArrayString StackerPanel::m_outputFilenames
private

◆ m_preview

PreviewWindow* StackerPanel::m_preview { nullptr }
private

Definition at line 114 of file StackerPanel.h.

Referenced by Create(), OnProcessFinished(), and OnZoom().

◆ m_selectedImage

std::string StackerPanel::m_selectedImage
private

Definition at line 117 of file StackerPanel.h.

Referenced by OnFileSelectionChanged(), and OnImageLoaded().

◆ m_sigma

wxSpinCtrlDouble* StackerPanel::m_sigma { nullptr }
private

Definition at line 110 of file StackerPanel.h.

Referenced by Create(), GetStackerOptions(), OnModeChanged(), and ~StackerPanel().

◆ m_sigmaMaxIter

wxSpinCtrl* StackerPanel::m_sigmaMaxIter { nullptr }
private

Definition at line 111 of file StackerPanel.h.

Referenced by Create(), GetStackerOptions(), OnModeChanged(), and ~StackerPanel().

◆ m_smallImagePreview

wxStaticBitmap* StackerPanel::m_smallImagePreview { nullptr }
private

Definition at line 112 of file StackerPanel.h.

Referenced by Create(), OnFileSelectionChanged(), and OnImageLoaded().

◆ m_sortAscending

bool StackerPanel::m_sortAscending { true }
private

Definition at line 123 of file StackerPanel.h.

Referenced by Create(), OnFileColumnHeaderClick(), SortList(), and ~StackerPanel().

◆ m_sortCol

long StackerPanel::m_sortCol { -1 }
private

Definition at line 122 of file StackerPanel.h.

Referenced by Create(), OnFileColumnHeaderClick(), SortList(), and ~StackerPanel().

◆ m_tempFiles

wxArrayString StackerPanel::m_tempFiles
private

Definition at line 119 of file StackerPanel.h.

Referenced by CleanUpTempFiles(), and GetStackerCommandLine().

◆ m_winsorTrim

wxSpinCtrlDouble* StackerPanel::m_winsorTrim { nullptr }
private

Definition at line 109 of file StackerPanel.h.

Referenced by Create(), GetStackerOptions(), OnModeChanged(), and ~StackerPanel().


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