Hugin trunk 0.1
Loading...
Searching...
No Matches
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
38class CPImagesComboBox : public wxOwnerDrawnComboBox
39{
40public:
42 bool Create(wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size,
45 virtual void OnDrawItem(wxDC& dc,
46 const wxRect& rect,
47 int item,
48 int WXUNUSED(flags)) const;
52 void SetRefImage(HuginBase::Panorama * pano, unsigned int newRefImg)
53 {
55 CalcCPDistance(pano);
56 };
58 const unsigned int GetRefImage()
59 {
60 return refImage;
61 };
62protected:
64 void OnMouseWheel(wxMouseEvent & e);
66 void OnKeyDown(wxKeyEvent & e);
67private:
68 unsigned int refImage;
69 std::vector<double> CPConnection;
70 std::vector<unsigned int> CPCount;
71 void Init();
72 void SelectNext(int step = 1);
73 void SelectPrev(int step = 1);
74 void NotifyParent();
75
77};
78
80class CPImagesComboBoxXmlHandler : public wxOwnerDrawnComboBoxXmlHandler
81{
83
84public:
88 virtual wxObject *DoCreateResource();
90 virtual bool CanHandle(wxXmlNode *node);
91};
92
93#endif
xrc handler for CPImagesComboBox
virtual wxObject * DoCreateResource()
Create CPImagesComboBox from resource.
virtual bool CanHandle(wxXmlNode *node)
Internal use to identify right xml handler.
Owner Drawn ComboBox for showing connected images on CP tab.
const unsigned int GetRefImage()
Returns the reference image number
void SetRefImage(HuginBase::Panorama *pano, unsigned int newRefImg)
Set new reference image.
void SelectPrev(int step=1)
void SelectNext(int step=1)
std::vector< double > CPConnection
bool Create(wxWindow *parent, wxWindowID id, const wxString &value, const wxPoint &pos, const wxSize &size, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxASCII_STR(wxComboBoxNameStr))
create control, bind events
std::vector< unsigned int > CPCount
void CalcCPDistance(HuginBase::Panorama *pano)
Get maximum CP distance for all images pairs containing the reference image
void OnMouseWheel(wxMouseEvent &e)
Mouse wheel handler to mimic wxChoice behavior
unsigned int refImage
void OnKeyDown(wxKeyEvent &e)
Key handler to mimic wxChoice behavior
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:153
static uint16_t flags
include file for the hugin project
include file for the hugin project
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41