PreviewPanel Class Reference

A preview panel that renders the pictures using the panotools library. More...

#include <PreviewPanel.h>

Inheritance diagram for PreviewPanel:

Inheritance graph
[legend]
List of all members.

Public Types

enum  BlendMode { BLEND_COPY, BLEND_DIFFERENCE }

Public Member Functions

 PreviewPanel ()
 ctor.
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 (PreviewFrame *parent, PT::Panorama *pano)
virtual ~PreviewPanel ()
 dtor.
void panoramaChanged (PT::Panorama &pano)
void panoramaImagesChanged (PT::Panorama &pano, const PT::UIntSet &imgNr)
void SetAutoUpdate (bool enabled)
void ForceUpdate ()
void SetBlendMode (BlendMode b)

Private Types

typedef PT::RemappedPanoImage<
vigra::BRGBImage, vigra::BImage > 
RemappedImage

Private Member Functions

void DrawPreview (wxDC &dc)
void updatePreview ()
void mapPreviewImage (unsigned int imgNr)
void OnResize (wxSizeEvent &e)
 recalculate panorama to fit the panel
void OnDraw (wxPaintEvent &event)
void OnMouse (wxMouseEvent &e)
void mousePressRMBEvent (wxMouseEvent &e)
void mousePressLMBEvent (wxMouseEvent &e)
void OnUpdatePreview (wxCommandEvent &e)
void DrawOutline (const std::vector< hugin_utils::FDiff2D > &points, wxDC &dc, int offX, int offY)
void mouse2erect (int xm, int ym, double &xd, double &yd)

Private Attributes

PT::Panoramapano
 the model
bool m_autoPreview
vigra::Diff2D m_panoImgSize
wxBitmap * m_panoBitmap
PT::UIntSet m_dirtyImgs
PT::PanoramaOptions opts
PTools::Transform * m_pano2erect
SmallRemappedImageCache m_remapCache
BlendMode m_blendMode
PreviewFrameparentWindow
wxCursor * m_cursor
bool m_state_rendering
bool m_rerender
bool m_imgsDirty

Detailed Description

A preview panel that renders the pictures using the panotools library.

Lets hope this works out fine..

Definition at line 40 of file PreviewPanel.h.


Member Typedef Documentation

typedef PT::RemappedPanoImage<vigra::BRGBImage, vigra::BImage> PreviewPanel::RemappedImage [private]
 

Definition at line 42 of file PreviewPanel.h.


Member Enumeration Documentation

enum PreviewPanel::BlendMode
 

Enumeration values:
BLEND_COPY 
BLEND_DIFFERENCE 

Definition at line 69 of file PreviewPanel.h.


Constructor & Destructor Documentation

PreviewPanel::PreviewPanel  ) 
 

ctor.

Definition at line 68 of file PreviewPanel.cpp.

PreviewPanel::~PreviewPanel  )  [virtual]
 

dtor.

Definition at line 109 of file PreviewPanel.cpp.

References DEBUG_TRACE, vigra_ext::ThreadManager::get(), pano, and HuginBase::Panorama::removeObserver().


Member Function Documentation

bool PreviewPanel::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 77 of file PreviewPanel.cpp.

References DEBUG_DEBUG, DEBUG_TRACE, huginApp::Get(), huginApp::GetXRCPath(), m_cursor, and m_state_rendering.

void PreviewPanel::DrawOutline const std::vector< hugin_utils::FDiff2D > &  points,
wxDC &  dc,
int  offX,
int  offY
[private]
 

Definition at line 802 of file PreviewPanel.cpp.

References m_panoImgSize, and hugin_utils::roundi().

Referenced by DrawPreview().

void PreviewPanel::DrawPreview wxDC &  dc  )  [private]
 

Definition at line 528 of file PreviewPanel.cpp.

References DEBUG_DEBUG, DEBUG_TRACE, DrawOutline(), HuginBase::Panorama::getOptions(), HuginBase::PanoramaOptions::getROI(), HuginBase::PanoramaOptions::getSize(), m_panoBitmap, m_panoImgSize, celeste::min(), and pano.

Referenced by OnDraw(), and updatePreview().

void PreviewPanel::ForceUpdate  ) 
 

Definition at line 213 of file PreviewPanel.cpp.

References updatePreview().

Referenced by mousePressLMBEvent(), mousePressRMBEvent(), PreviewFrame::OnAutoPreviewToggle(), PreviewFrame::OnFullScreen(), OnResize(), PreviewFrame::OnUpdate(), panoramaChanged(), and PreviewFrame::updatePano().

void PreviewPanel::Init PreviewFrame parent,
PT::Panorama pano
 

Definition at line 101 of file PreviewPanel.cpp.

References HuginBase::Panorama::addObserver(), pano, and parentWindow.

void PreviewPanel::mapPreviewImage unsigned int  imgNr  )  [private]
 

void PreviewPanel::mouse2erect int  xm,
int  ym,
double &  xd,
double &  yd
[private]
 

Definition at line 783 of file PreviewPanel.cpp.

References m_pano2erect, and m_panoImgSize.

Referenced by mousePressLMBEvent(), mousePressRMBEvent(), and OnMouse().

void PreviewPanel::mousePressLMBEvent wxMouseEvent &  e  )  [private]
 

Definition at line 701 of file PreviewPanel.cpp.

References CommandHistory::addCommand(), DEBUG_DEBUG, DEG_TO_RAD, ForceUpdate(), GlobalCmdHist::getInstance(), Matrix3::GetRotationPT(), mouse2erect(), pano, RAD_TO_DEG, and Matrix3::SetRotationPT().

void PreviewPanel::mousePressRMBEvent wxMouseEvent &  e  )  [private]
 

Definition at line 729 of file PreviewPanel.cpp.

References CommandHistory::addCommand(), DEBUG_DEBUG, DEG_TO_RAD, ForceUpdate(), GlobalCmdHist::getInstance(), mouse2erect(), pano, and RAD_TO_DEG.

void PreviewPanel::OnDraw wxPaintEvent &  event  )  [private]
 

Definition at line 682 of file PreviewPanel.cpp.

References DrawPreview().

void PreviewPanel::OnMouse wxMouseEvent &  e  )  [private]
 

Definition at line 755 of file PreviewPanel.cpp.

References mouse2erect(), and parentWindow.

void PreviewPanel::OnResize wxSizeEvent &  e  )  [private]
 

recalculate panorama to fit the panel

Definition at line 688 of file PreviewPanel.cpp.

References DEBUG_TRACE, ForceUpdate(), m_panoImgSize, and m_remapCache.

void PreviewPanel::OnUpdatePreview wxCommandEvent &  e  )  [private]
 

void PreviewPanel::panoramaChanged PT::Panorama pano  ) 
 

Definition at line 124 of file PreviewPanel.cpp.

References DEBUG_DEBUG, ForceUpdate(), HuginBase::PanoramaOptions::getHFOV(), HuginBase::Panorama::getOptions(), HuginBase::PanoramaOptions::getProjection(), HuginBase::PanoramaOptions::getProjectionParameters(), HuginBase::PanoramaOptions::getVFOV(), m_autoPreview, m_imgsDirty, m_remapCache, opts, HuginBase::PanoramaOptions::outputExposureValue, and updatePreview().

void PreviewPanel::panoramaImagesChanged PT::Panorama pano,
const PT::UIntSet imgNr
 

Definition at line 173 of file PreviewPanel.cpp.

References DEBUG_TRACE, and m_imgsDirty.

void PreviewPanel::SetAutoUpdate bool  enabled  ) 
 

Definition at line 218 of file PreviewPanel.cpp.

References m_autoPreview, and updatePreview().

Referenced by PreviewFrame::OnAutoPreviewToggle().

void PreviewPanel::SetBlendMode BlendMode  b  ) 
 

Definition at line 207 of file PreviewPanel.cpp.

References m_blendMode, and updatePreview().

Referenced by PreviewFrame::OnBlendChoice().

void PreviewPanel::updatePreview  )  [private]
 

Definition at line 247 of file PreviewPanel.cpp.

References vigra_ext::applyMapping(), BLEND_COPY, BLEND_DIFFERENCE, vigra_ext::EMoR::createEMoRLUT(), vigra_ext::createGammaLUT(), DEBUG_DEBUG, DEBUG_ERROR, DEBUG_INFO, DEBUG_TRACE, vigra_ext::destImage(), vigra_ext::destImageRange(), DrawPreview(), vigra_ext::ThreadManager::get(), HuginBase::Panorama::getActiveImages(), HuginBase::PanoramaOptions::getHeight(), HuginBase::Panorama::getOptions(), HuginBase::PanoramaOptions::getSize(), HuginBase::Panorama::getSrcImage(), HuginBase::PanoramaOptions::getWidth(), HUGIN_IMGCACHE_MAPPING_FLOAT, HuginBase::PanoramaOptions::interpolator, m_pano2erect, m_panoBitmap, m_panoImgSize, m_remapCache, m_rerender, m_state_rendering, celeste::max(), opts, HuginBase::PanoramaOptions::outputExposureValue, HuginBase::PanoramaOptions::outputMode, pano, parentWindow, vigra_ext::pow(), HuginBase::PanoramaOptions::remapUsingGPU, HuginBase::SrcPanoImage::resize(), hugin_utils::round(), HuginBase::PanoramaOptions::setHeight(), HuginBase::BaseSrcPanoImage::setHFOV(), vigra_ext::ThreadManager::setNThreads(), HuginBase::BaseSrcPanoImage::setProjection(), HuginBase::PanoramaOptions::setROI(), HuginBase::SrcPanoImage::setSize(), HuginBase::PanoramaOptions::setWidth(), vigra_ext::srcImage(), vigra_ext::srcImageRange(), HuginBase::Nona::SimpleStitcher< ImageType, AlphaType >::stitch(), HuginBase::Nona::ReduceStitcher< ImageType, AlphaType >::stitch(), and vigra_ext::transformImage().

Referenced by ForceUpdate(), panoramaChanged(), SetAutoUpdate(), and SetBlendMode().


Member Data Documentation

bool PreviewPanel::m_autoPreview [private]
 

Definition at line 98 of file PreviewPanel.h.

Referenced by panoramaChanged(), and SetAutoUpdate().

BlendMode PreviewPanel::m_blendMode [private]
 

Definition at line 116 of file PreviewPanel.h.

Referenced by SetBlendMode().

wxCursor* PreviewPanel::m_cursor [private]
 

Definition at line 119 of file PreviewPanel.h.

Referenced by Create().

PT::UIntSet PreviewPanel::m_dirtyImgs [private]
 

Definition at line 105 of file PreviewPanel.h.

bool PreviewPanel::m_imgsDirty [private]
 

Definition at line 123 of file PreviewPanel.h.

Referenced by panoramaChanged(), and panoramaImagesChanged().

PTools::Transform* PreviewPanel::m_pano2erect [private]
 

Definition at line 111 of file PreviewPanel.h.

Referenced by mouse2erect(), and updatePreview().

wxBitmap* PreviewPanel::m_panoBitmap [private]
 

Definition at line 102 of file PreviewPanel.h.

Referenced by DrawPreview(), and updatePreview().

vigra::Diff2D PreviewPanel::m_panoImgSize [private]
 

Definition at line 100 of file PreviewPanel.h.

Referenced by DrawOutline(), DrawPreview(), mouse2erect(), OnResize(), and updatePreview().

SmallRemappedImageCache PreviewPanel::m_remapCache [private]
 

Definition at line 114 of file PreviewPanel.h.

Referenced by OnResize(), panoramaChanged(), and updatePreview().

bool PreviewPanel::m_rerender [private]
 

Definition at line 122 of file PreviewPanel.h.

Referenced by updatePreview().

bool PreviewPanel::m_state_rendering [private]
 

Definition at line 121 of file PreviewPanel.h.

Referenced by Create(), and updatePreview().

PT::PanoramaOptions PreviewPanel::opts [private]
 

Definition at line 108 of file PreviewPanel.h.

Referenced by panoramaChanged(), and updatePreview().

PT::Panorama* PreviewPanel::pano [private]
 

the model

Definition at line 96 of file PreviewPanel.h.

Referenced by DrawPreview(), Init(), mousePressLMBEvent(), mousePressRMBEvent(), updatePreview(), and ~PreviewPanel().

PreviewFrame* PreviewPanel::parentWindow [private]
 

Definition at line 118 of file PreviewPanel.h.

Referenced by Init(), OnMouse(), and updatePreview().


The documentation for this class was generated from the following files:
Generated on Thu Aug 28 01:25:48 2014 for Hugintrunk by  doxygen 1.3.9.1