Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CPImagesComboBox.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
12 /* This is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This software is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public
23  * License along with this software. If not, see
24  * <http://www.gnu.org/licenses/>.
25  *
26  */
27 
28 #ifndef _CPIMAGESCOMBOBOX_H
29 #define _CPIMAGESCOMBOBOX_H
30 
31 // standard wx include
32 #include "panoinc.h"
33 #include "panoinc_WX.h"
34 #include "wx/odcombo.h"
35 #include "wx/xrc/xh_odcombo.h"
36 
38 class CPImagesComboBox : public wxOwnerDrawnComboBox
39 {
40 public:
42  virtual void OnDrawItem(wxDC& dc,
43  const wxRect& rect,
44  int item,
45  int WXUNUSED(flags)) const;
49  void SetRefImage(HuginBase::Panorama * pano, unsigned int newRefImg)
50  {
51  refImage=newRefImg;
52  CalcCPDistance(pano);
53  };
55  const unsigned int GetRefImage()
56  {
57  return refImage;
58  };
59 protected:
61  void OnMouseWheel(wxMouseEvent & e);
63  void OnKeyDown(wxKeyEvent & e);
64 private:
65  unsigned int refImage;
66  std::vector<double> CPConnection;
67  std::vector<unsigned int> CPCount;
68  void Init();
69  void SelectNext(int step = 1);
70  void SelectPrev(int step = 1);
71  void NotifyParent();
72 
73  DECLARE_EVENT_TABLE()
74  DECLARE_DYNAMIC_CLASS(CPImagesComboBox)
75 };
76 
78 class CPImagesComboBoxXmlHandler : public wxOwnerDrawnComboBoxXmlHandler
79 {
80  DECLARE_DYNAMIC_CLASS(CPImagesComboBoxXmlHandler)
81 
82 public:
86  virtual wxObject *DoCreateResource();
88  virtual bool CanHandle(wxXmlNode *node);
89 };
90 
91 #endif
void CalcCPDistance(HuginBase::Panorama *pano)
Get maximum CP distance for all images pairs containing the reference image.
void SelectPrev(int step=1)
std::vector< double > CPConnection
void OnKeyDown(wxKeyEvent &e)
Key handler to mimic wxChoice behavior.
include file for the hugin project
Owner Drawn ComboBox for showing connected images on CP tab.
virtual void OnDrawItem(wxDC &dc, const wxRect &rect, int item, int WXUNUSED(flags)) const
Paint method for drawing text and indication bar of combo box.
Model for a panorama.
Definition: Panorama.h:152
void OnMouseWheel(wxMouseEvent &e)
Mouse wheel handler to mimic wxChoice behavior.
xrc handler for CPImagesComboBox
include file for the hugin project
const unsigned int GetRefImage()
Returns the reference image number.
static uint16_t flags
std::vector< unsigned int > CPCount
unsigned int refImage
void SelectNext(int step=1)
void SetRefImage(HuginBase::Panorama *pano, unsigned int newRefImg)
Set new reference image.