Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PreviewPanel.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
24 #ifndef _PREVIEWPANEL_H
25 #define _PREVIEWPANEL_H
26 
27 #include <vector>
28 
29 #include <base_wx/wxImageCache.h>
30 
31 #include <vigra_ext/ROIImage.h>
32 
33 class wxImage;
34 class PreviewFrame;
35 
40 class PreviewPanel : public wxPanel, public HuginBase::PanoramaObserver
41 {
43 public:
44 
47  PreviewPanel();
48 
49  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"));
50 
51  void Init(PreviewFrame *parent, HuginBase::Panorama * pano );
52 
55  virtual ~PreviewPanel();
56 
59 
60  void SetAutoUpdate(bool enabled);
61 
62  // forces an update of all images.
63  void ForceUpdate();
64 
65  // select which images should be shown.
66 // void SetDisplayedImages(const HuginBase::UIntSet &images);
67 
68  // blending modes available
70 
71  void SetBlendMode(BlendMode b);
72 
73 private:
74 
75  // draw the preview directly onto the canvas
76  void DrawPreview(wxDC & dc);
77 
78  // remaps the images, called automatically if autopreview is enabled.
79  void updatePreview();
80 
81  void mapPreviewImage(unsigned int imgNr);
82 
84  void OnResize(wxSizeEvent & e);
85  void OnDraw(wxPaintEvent & event);
86  void OnMouse(wxMouseEvent & e);
87  void mousePressRMBEvent(wxMouseEvent & e);
88  void mousePressLMBEvent(wxMouseEvent & e);
89 
90  void OnUpdatePreview(wxCommandEvent & e);
91  void DrawOutline(const std::vector<hugin_utils::FDiff2D> & points, wxDC & dc, int offX, int offY);
92 
93  void mouse2erect(int xm, int ym, double &xd, double & yd);
94 
97 
99 
100  vigra::Diff2D m_panoImgSize;
101 
102  wxBitmap * m_panoBitmap;
103  // currently updating the preview.
104 
106 
107  // panorama options
109 
110  // transformation for current preview coordinates into equirect coordinates
112 
113  // cache for remapped images
115 
117 
119  wxCursor * m_cursor;
120 
124 
125  DECLARE_EVENT_TABLE()
126  DECLARE_DYNAMIC_CLASS(PreviewPanel)
127 };
128 
130 class PreviewPanelXmlHandler : public wxXmlResourceHandler
131 {
132  DECLARE_DYNAMIC_CLASS(PreviewPanelXmlHandler)
133 
134  public:
136  virtual wxObject *DoCreateResource();
137  virtual bool CanHandle(wxXmlNode *node);
138 };
139 
140 #endif // _PREVIEWPANEL_H
HuginBase::UIntSet m_dirtyImgs
Definition: PreviewPanel.h:105
PreviewFrame * parentWindow
Definition: PreviewPanel.h:118
HuginBase::PanoramaOptions opts
Definition: PreviewPanel.h:108
wxCursor * m_cursor
Definition: PreviewPanel.h:119
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"))
bool m_state_rendering
Definition: PreviewPanel.h:121
PreviewPanel()
ctor.
void mapPreviewImage(unsigned int imgNr)
bool m_autoPreview
Definition: PreviewPanel.h:98
void updatePreview()
class to cache remapped images, loaded from the hugin small image cache.
virtual ~PreviewPanel()
dtor.
void OnUpdatePreview(wxCommandEvent &e)
void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
notifies about changes to images
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
void mouse2erect(int xm, int ym, double &xd, double &yd)
void Init(PreviewFrame *parent, HuginBase::Panorama *pano)
Model for a panorama.
Definition: Panorama.h:152
void mousePressLMBEvent(wxMouseEvent &e)
void mousePressRMBEvent(wxMouseEvent &e)
HuginBase::Panorama * pano
the model
Definition: PreviewPanel.h:96
void SetAutoUpdate(bool enabled)
void DrawOutline(const std::vector< hugin_utils::FDiff2D > &points, wxDC &dc, int offX, int offY)
void OnResize(wxSizeEvent &e)
recalculate panorama to fit the panel
void SetBlendMode(BlendMode b)
void OnMouse(wxMouseEvent &e)
SmallRemappedImageCache m_remapCache
Definition: PreviewPanel.h:114
The image preview frame.
Definition: PreviewFrame.h:40
HuginBase::PTools::Transform * m_pano2erect
Definition: PreviewPanel.h:111
this handler class will receive change events from the Panorama.
Definition: PanoramaData.h:401
HuginBase::Nona::RemappedPanoImage< vigra::BRGBImage, vigra::BImage > RemappedImage
Definition: PreviewPanel.h:42
Holds transformations for Image -&gt; Pano and the other way.
void OnDraw(wxPaintEvent &event)
A preview panel that renders the pictures using the panotools library.
Definition: PreviewPanel.h:40
void ForceUpdate()
Panorama image options.
wxBitmap * m_panoBitmap
Definition: PreviewPanel.h:102
void panoramaChanged(HuginBase::Panorama &pano)
Notification about a Panorama change.
struct to hold a image state for stitching
void DrawPreview(wxDC &dc)
BlendMode m_blendMode
Definition: PreviewPanel.h:116
vigra::Diff2D m_panoImgSize
Definition: PreviewPanel.h:100