PreviewFrame Class Reference

The image preview frame. More...

#include <PreviewFrame.h>

Inheritance diagram for PreviewFrame:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PreviewFrame (wxFrame *frame, HuginBase::Panorama &pano)
 ctor.
virtual ~PreviewFrame ()
 dtor.
void panoramaChanged (HuginBase::Panorama &pano)
 Notification about a Panorama change.
void panoramaImagesChanged (HuginBase::Panorama &pano, const HuginBase::UIntSet &changed)
 notifies about changes to images
void OnUpdate (wxCommandEvent &event)
void updateProgressDisplay ()
 update the display

Protected Member Functions

void OnClose (wxCloseEvent &e)
void OnChangeDisplayedImgs (wxCommandEvent &e)
void OnAutoPreviewToggle (wxCommandEvent &e)
void OnCenterHorizontally (wxCommandEvent &e)
void OnFitPano (wxCommandEvent &e)
void OnStraighten (wxCommandEvent &e)
void OnShowAll (wxCommandEvent &e)
void OnShowNone (wxCommandEvent &e)
void OnNumTransform (wxCommandEvent &e)
void OnChangeFOV (wxScrollEvent &e)
void OnTextCtrlChanged (wxCommandEvent &e)
void OnDefaultExposure (wxCommandEvent &e)
void OnDecreaseExposure (wxSpinEvent &e)
void OnIncreaseExposure (wxSpinEvent &e)
void OnProjParameterReset (wxCommandEvent &e)
 event handler for reset projection parameters
void OnBlendChoice (wxCommandEvent &e)
void OnProjectionChoice (wxCommandEvent &e)
void OnOutputChoice (wxCommandEvent &e)
void OnFullScreen (wxCommandEvent &e)
 event handler for full screen
void OnUndo (wxCommandEvent &e)
 event handler for undo
void OnRedo (wxCommandEvent &e)
 event handler for redo
void updatePano ()

Private Attributes

HuginBase::Panoramam_pano
PreviewPanelm_PreviewPanel
wxToolBar * m_ToolBar
wxSlider * m_HFOVSlider
wxSlider * m_VFOVSlider
wxChoice * m_BlendModeChoice
wxChoice * m_ProjectionChoice
wxChoice * m_outputModeChoice
wxTextCtrl * m_exposureTextCtrl
wxBitmapButton * m_defaultExposureBut
wxSpinButton * m_exposureSpinBut
wxString m_choices [3]
int m_oldProjFormat
wxScrolledWindow * m_ButtonPanel
wxBoxSizer * m_ButtonSizer
wxStaticBoxSizer * m_ToggleButtonSizer
wxBoxSizer * m_topsizer
wxStaticBoxSizer * m_projParamSizer
std::vector< wxStaticText * > m_projParamNamesLabel
std::vector< wxTextCtrl * > m_projParamTextCtrl
std::vector< wxSlider * > m_projParamSlider
std::vector< wxCheckBox * > m_ToggleButtons

Detailed Description

The image preview frame.

Contains the ImagePreviewPanel and various controls for it.

it is not created with XRC, because it is highly dynamic, buttons have to be added etc.

Definition at line 40 of file PreviewFrame.h.


Constructor & Destructor Documentation

PreviewFrame::PreviewFrame ( wxFrame *  frame,
HuginBase::Panorama pano 
)

ctor.

Definition at line 123 of file PreviewFrame.cpp.

References HuginBase::Panorama::addObserver(), PreviewPanel::Create(), DEBUG_ASSERT, DEBUG_TRACE, huginApp::Get(), ID_EXPOSURE_TEXT, PreviewPanel::Init(), m_BlendModeChoice, m_ButtonPanel, m_ButtonSizer, m_choices, m_defaultExposureBut, m_exposureSpinBut, m_exposureTextCtrl, m_HFOVSlider, m_oldProjFormat, m_outputModeChoice, m_pano, m_PreviewPanel, m_ProjectionChoice, m_projParamNamesLabel, m_projParamSizer, m_projParamSlider, m_projParamTextCtrl, m_ToggleButtonSizer, m_ToolBar, m_topsizer, m_VFOVSlider, PROJ_PARAM_NAMES_ID, PROJ_PARAM_SLIDER_ID, PROJ_PARAM_VAL_ID, RestoreFramePosition(), PreviewPanel::SetAutoUpdate(), and PreviewPanel::SetBlendMode().

PreviewFrame::~PreviewFrame (  )  [virtual]

dtor.

Definition at line 408 of file PreviewFrame.cpp.

References DEBUG_TRACE, m_BlendModeChoice, m_pano, m_projParamTextCtrl, m_ToolBar, HuginBase::Panorama::removeObserver(), and StoreFramePosition().


Member Function Documentation

void PreviewFrame::OnAutoPreviewToggle ( wxCommandEvent &  e  )  [protected]

Definition at line 628 of file PreviewFrame.cpp.

References PreviewPanel::ForceUpdate(), m_PreviewPanel, and PreviewPanel::SetAutoUpdate().

void PreviewFrame::OnBlendChoice ( wxCommandEvent &  e  )  [protected]

Definition at line 855 of file PreviewFrame.cpp.

References PreviewPanel::BLEND_COPY, PreviewPanel::BLEND_DIFFERENCE, DEBUG_WARN, m_BlendModeChoice, m_PreviewPanel, and PreviewPanel::SetBlendMode().

void PreviewFrame::OnCenterHorizontally ( wxCommandEvent &  e  )  [protected]

Definition at line 658 of file PreviewFrame.cpp.

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

void PreviewFrame::OnChangeDisplayedImgs ( wxCommandEvent &  e  )  [protected]

Definition at line 433 of file PreviewFrame.cpp.

References CommandHistory::addCommand(), DEBUG_DEBUG, DEBUG_ERROR, HuginBase::Panorama::getActiveImages(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getNrOfImages(), ID_TOGGLE_BUT, m_pano, and m_ToggleButtons.

void PreviewFrame::OnChangeFOV ( wxScrollEvent &  e  )  [protected]

Definition at line 824 of file PreviewFrame.cpp.

References CommandHistory::addCommand(), DEBUG_DEBUG, DEBUG_TRACE, PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptions(), HuginBase::PanoramaOptions::getProjectionParameters(), m_HFOVSlider, m_pano, HuginBase::PanoramaOptions::m_projFeatures, m_projParamSlider, m_VFOVSlider, HuginBase::PanoramaOptions::setHFOV(), HuginBase::PanoramaOptions::setProjectionParameters(), and HuginBase::PanoramaOptions::setVFOV().

void PreviewFrame::OnClose ( wxCloseEvent &  e  )  [protected]

Definition at line 614 of file PreviewFrame.cpp.

References DEBUG_DEBUG, and DEBUG_TRACE.

void PreviewFrame::OnDecreaseExposure ( wxSpinEvent &  e  )  [protected]

Definition at line 897 of file PreviewFrame.cpp.

References CommandHistory::addCommand(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptions(), m_pano, HuginBase::PanoramaOptions::outputExposureValue, and updatePano().

void PreviewFrame::OnDefaultExposure ( wxCommandEvent &  e  )  [protected]

Definition at line 875 of file PreviewFrame.cpp.

References CommandHistory::addCommand(), HuginBase::CalculateMeanExposure::calcMeanExposure(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getNrOfImages(), HuginBase::Panorama::getOptions(), m_pano, HuginBase::PanoramaOptions::outputExposureValue, and updatePano().

void PreviewFrame::OnFitPano ( wxCommandEvent &  e  )  [protected]

Definition at line 688 of file PreviewFrame.cpp.

References CommandHistory::addCommand(), DEBUG_INFO, DEBUG_TRACE, HuginBase::Panorama::getActiveImages(), HuginBase::PanoramaOptions::getHeight(), HuginBase::PanoramaOptions::getHFOV(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptions(), HuginBase::CalculateFitPanorama::getResultHeight(), HuginBase::CalculateFitPanorama::getResultHorizontalFOV(), HuginBase::PanoramaOptions::getVFOV(), m_pano, hugin_utils::roundi(), HuginBase::PanoramaAlgorithm::run(), HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setHFOV(), and updatePano().

void PreviewFrame::OnFullScreen ( wxCommandEvent &  e  )  [protected]

event handler for full screen

Definition at line 962 of file PreviewFrame.cpp.

References PreviewPanel::ForceUpdate(), and m_PreviewPanel.

void PreviewFrame::OnIncreaseExposure ( wxSpinEvent &  e  )  [protected]

Definition at line 887 of file PreviewFrame.cpp.

References CommandHistory::addCommand(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptions(), m_pano, HuginBase::PanoramaOptions::outputExposureValue, and updatePano().

void PreviewFrame::OnNumTransform ( wxCommandEvent &  e  )  [protected]

Definition at line 737 of file PreviewFrame.cpp.

References CommandHistory::addCommand(), DEBUG_DEBUG, PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getNrOfImages(), m_pano, str2double(), and updatePano().

void PreviewFrame::OnOutputChoice ( wxCommandEvent &  e  )  [protected]

Definition at line 925 of file PreviewFrame.cpp.

References CommandHistory::addCommand(), DEBUG_WARN, PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptions(), m_outputModeChoice, m_pano, HuginBase::PanoramaOptions::outputMode, and updatePano().

void PreviewFrame::OnProjectionChoice ( wxCommandEvent &  e  )  [protected]

Definition at line 907 of file PreviewFrame.cpp.

References CommandHistory::addCommand(), DEBUG_DEBUG, DEBUG_WARN, PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptions(), m_pano, m_ProjectionChoice, HuginBase::PanoramaOptions::setProjection(), and updatePano().

void PreviewFrame::OnProjParameterReset ( wxCommandEvent &  e  )  [protected]

event handler for reset projection parameters

Definition at line 815 of file PreviewFrame.cpp.

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

void PreviewFrame::OnRedo ( wxCommandEvent &  e  )  [protected]

event handler for redo

Definition at line 985 of file PreviewFrame.cpp.

References PanoCommand::GlobalCmdHist::getInstance().

void PreviewFrame::OnShowAll ( wxCommandEvent &  e  )  [protected]

Definition at line 707 of file PreviewFrame.cpp.

References CommandHistory::addCommand(), DEBUG_ASSERT, PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getNrOfImages(), m_pano, m_ToggleButtons, and updatePano().

void PreviewFrame::OnShowNone ( wxCommandEvent &  e  )  [protected]

Definition at line 722 of file PreviewFrame.cpp.

References CommandHistory::addCommand(), DEBUG_ASSERT, PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getNrOfImages(), m_pano, m_ToggleButtons, and updatePano().

void PreviewFrame::OnStraighten ( wxCommandEvent &  e  )  [protected]

Definition at line 667 of file PreviewFrame.cpp.

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

void PreviewFrame::OnTextCtrlChanged ( wxCommandEvent &  e  )  [protected]

Definition at line 773 of file PreviewFrame.cpp.

References CommandHistory::addCommand(), DEBUG_INFO, PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptions(), HuginBase::PanoramaOptions::getProjectionParameters(), m_exposureTextCtrl, m_pano, HuginBase::PanoramaOptions::m_projFeatures, m_projParamTextCtrl, HuginBase::PanoramaOptions::outputExposureValue, HuginBase::PanoramaOptions::setProjectionParameters(), str2double(), and updatePano().

void PreviewFrame::OnUndo ( wxCommandEvent &  e  )  [protected]

event handler for undo

Definition at line 972 of file PreviewFrame.cpp.

References PanoCommand::GlobalCmdHist::getInstance().

void PreviewFrame::OnUpdate ( wxCommandEvent &  event  ) 

Definition at line 676 of file PreviewFrame.cpp.

References PreviewPanel::ForceUpdate(), and m_PreviewPanel.

Referenced by MainFrame::LoadProjectFile(), MainFrame::OnMergeProject(), MainFrame::OnNewProject(), and MainFrame::OnTogglePreviewFrame().

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

Notification about a Panorama change.

This function will always be called, even when the change could be handled by panoramaImageAdded() or other notify functions.

This allows lazy observers to just listen to panoramaChanged().

Implements HuginBase::PanoramaObserver.

Definition at line 454 of file PreviewFrame.cpp.

References DEBUG_DEBUG, hugin_utils::doubleToString(), HuginBase::PanoramaOptions::fovCalcSupported(), HuginBase::Panorama::getActiveImages(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::Panorama::getNrOfImages(), HuginBase::Panorama::getOptions(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getProjectionParameters(), HuginBase::PanoramaOptions::getVFOV(), m_exposureTextCtrl, m_HFOVSlider, m_oldProjFormat, m_outputModeChoice, m_ProjectionChoice, HuginBase::PanoramaOptions::m_projFeatures, m_projParamNamesLabel, m_projParamSizer, m_projParamSlider, m_projParamTextCtrl, m_ToolBar, m_topsizer, m_VFOVSlider, HuginBase::PanoramaOptions::OUTPUT_HDR, HuginBase::PanoramaOptions::outputExposureValue, HuginBase::PanoramaOptions::outputMode, hugin_utils::roundi(), and updatePano().

void PreviewFrame::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:
pano the panorama object that changed
changed set of changed images

Implements HuginBase::PanoramaObserver.

void PreviewFrame::updatePano (  )  [protected]

Definition at line 681 of file PreviewFrame.cpp.

References PreviewPanel::ForceUpdate(), m_PreviewPanel, and m_ToolBar.

Referenced by OnDecreaseExposure(), OnDefaultExposure(), OnFitPano(), OnIncreaseExposure(), OnNumTransform(), OnOutputChoice(), OnProjectionChoice(), OnShowAll(), OnShowNone(), OnTextCtrlChanged(), and panoramaChanged().

void PreviewFrame::updateProgressDisplay (  )  [virtual]

update the display

Implements AppBase::ProgressDisplay.

Definition at line 943 of file PreviewFrame.cpp.

References HUGIN_CONV_FILENAME, AppBase::ProgressDisplay::m_filename, and AppBase::ProgressDisplay::m_message.


Member Data Documentation

wxChoice* PreviewFrame::m_BlendModeChoice [private]

Definition at line 97 of file PreviewFrame.h.

Referenced by OnBlendChoice(), PreviewFrame(), and ~PreviewFrame().

wxScrolledWindow* PreviewFrame::m_ButtonPanel [private]

Definition at line 110 of file PreviewFrame.h.

Referenced by PreviewFrame().

wxBoxSizer* PreviewFrame::m_ButtonSizer [private]

Definition at line 111 of file PreviewFrame.h.

Referenced by PreviewFrame().

wxString PreviewFrame::m_choices[3] [private]

Definition at line 104 of file PreviewFrame.h.

Referenced by PreviewFrame().

wxBitmapButton* PreviewFrame::m_defaultExposureBut [private]

Definition at line 101 of file PreviewFrame.h.

Referenced by PreviewFrame().

wxSpinButton* PreviewFrame::m_exposureSpinBut [private]

Definition at line 102 of file PreviewFrame.h.

Referenced by PreviewFrame().

wxTextCtrl* PreviewFrame::m_exposureTextCtrl [private]

Definition at line 100 of file PreviewFrame.h.

Referenced by OnTextCtrlChanged(), panoramaChanged(), and PreviewFrame().

wxSlider* PreviewFrame::m_HFOVSlider [private]

Definition at line 95 of file PreviewFrame.h.

Referenced by OnChangeFOV(), panoramaChanged(), and PreviewFrame().

int PreviewFrame::m_oldProjFormat [private]

Definition at line 105 of file PreviewFrame.h.

Referenced by panoramaChanged(), and PreviewFrame().

wxChoice* PreviewFrame::m_outputModeChoice [private]

Definition at line 99 of file PreviewFrame.h.

Referenced by OnOutputChoice(), panoramaChanged(), and PreviewFrame().

HuginBase::Panorama& PreviewFrame::m_pano [private]

Definition at line 91 of file PreviewFrame.h.

Referenced by OnCenterHorizontally(), OnChangeDisplayedImgs(), OnChangeFOV(), OnDecreaseExposure(), OnDefaultExposure(), OnFitPano(), OnIncreaseExposure(), OnNumTransform(), OnOutputChoice(), OnProjectionChoice(), OnProjParameterReset(), OnShowAll(), OnShowNone(), OnStraighten(), OnTextCtrlChanged(), PreviewFrame(), and ~PreviewFrame().

PreviewPanel* PreviewFrame::m_PreviewPanel [private]

Definition at line 93 of file PreviewFrame.h.

Referenced by OnAutoPreviewToggle(), OnBlendChoice(), OnFullScreen(), OnUpdate(), PreviewFrame(), and updatePano().

wxChoice* PreviewFrame::m_ProjectionChoice [private]

Definition at line 98 of file PreviewFrame.h.

Referenced by OnProjectionChoice(), panoramaChanged(), and PreviewFrame().

std::vector<wxStaticText *> PreviewFrame::m_projParamNamesLabel [private]

Definition at line 116 of file PreviewFrame.h.

Referenced by panoramaChanged(), and PreviewFrame().

wxStaticBoxSizer* PreviewFrame::m_projParamSizer [private]

Definition at line 115 of file PreviewFrame.h.

Referenced by panoramaChanged(), and PreviewFrame().

std::vector<wxSlider *> PreviewFrame::m_projParamSlider [private]

Definition at line 118 of file PreviewFrame.h.

Referenced by OnChangeFOV(), panoramaChanged(), and PreviewFrame().

std::vector<wxTextCtrl *> PreviewFrame::m_projParamTextCtrl [private]

Definition at line 117 of file PreviewFrame.h.

Referenced by OnTextCtrlChanged(), panoramaChanged(), PreviewFrame(), and ~PreviewFrame().

std::vector<wxCheckBox *> PreviewFrame::m_ToggleButtons [private]

Definition at line 123 of file PreviewFrame.h.

Referenced by OnChangeDisplayedImgs(), OnShowAll(), and OnShowNone().

wxStaticBoxSizer* PreviewFrame::m_ToggleButtonSizer [private]

Definition at line 112 of file PreviewFrame.h.

Referenced by PreviewFrame().

wxToolBar* PreviewFrame::m_ToolBar [private]

Definition at line 94 of file PreviewFrame.h.

Referenced by panoramaChanged(), PreviewFrame(), updatePano(), and ~PreviewFrame().

wxBoxSizer* PreviewFrame::m_topsizer [private]

Definition at line 114 of file PreviewFrame.h.

Referenced by panoramaChanged(), and PreviewFrame().

wxSlider* PreviewFrame::m_VFOVSlider [private]

Definition at line 96 of file PreviewFrame.h.

Referenced by OnChangeFOV(), panoramaChanged(), and PreviewFrame().


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