Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CPListFrame.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
24 #ifndef _CPLISTFRAME_H
25 #define _CPLISTFRAME_H
26 
27 #include <wx/xrc/xh_listc.h>
28 #include <vector>
29 
30 class MainFrame;
31 
33 struct CPListItem
34 {
35  size_t globalIndex;
36  size_t localNumber;
37 };
38 
43 class CPListCtrl : public wxListView, public HuginBase::PanoramaObserver
44 {
45 public:
46  CPListCtrl();
47  ~CPListCtrl();
48  bool Create(wxWindow *parent,
49  wxWindowID id = wxID_ANY,
50  const wxPoint& pos = wxDefaultPosition,
51  const wxSize& size = wxDefaultSize,
52  long style = wxLC_REPORT | wxLC_VIRTUAL,
53  const wxValidator& validator = wxDefaultValidator,
54  const wxString& name = wxListCtrlNameStr);
55 
56  void Init(HuginBase::Panorama* pano);
57  virtual void panoramaChanged(HuginBase::Panorama &pano);
58  virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet& changed) {};
60  void DeleteSelected();
64  void SelectAll();
65 protected:
67  virtual wxString OnGetItemText(long item, long column) const;
69  virtual int OnGetItemImage(long item) const;
71  void OnCPListSelectionChanged(wxListEvent & e);
73  void OnCPListHeaderClick(wxListEvent & e);
75  void OnColumnWidthChange(wxListEvent & e);
77  void OnChar(wxKeyEvent& e);
78 private:
79  void UpdateInternalCPList();
80  void SortInternalList(bool isAscending);
81 
83  // current sorting column
84  int m_sortCol;
86  bool m_onlyActiveImages = false;
87  std::vector<CPListItem> m_internalCPList;
88  std::map<std::string, int> m_localIds;
89 
90  DECLARE_EVENT_TABLE()
91  DECLARE_DYNAMIC_CLASS(CPListCtrl)
92 };
93 
95 class CPListCtrlXmlHandler : public wxListCtrlXmlHandler
96 {
97  DECLARE_DYNAMIC_CLASS(CPListCtrlXmlHandler)
98 
99 public:
103  virtual wxObject *DoCreateResource();
105  virtual bool CanHandle(wxXmlNode *node);
106 };
107 
108 class CPListFrame : public wxFrame
109 {
110 public:
113  CPListFrame(wxFrame* parent, HuginBase::Panorama & pano);
114 
117  virtual ~CPListFrame();
118 
119 protected:
120  void OnDeleteButton(wxCommandEvent & e);
121  void OnSelectButton(wxCommandEvent & e);
122  void OnClose(wxCloseEvent& event);
123 private:
126  // needed for receiving events.
127  DECLARE_EVENT_TABLE();
128 };
129 
130 
131 
132 #endif // _CPLISTFRAME_H
void OnColumnWidthChange(wxListEvent &e)
column width changed
void DeleteSelected()
Delete the selected points.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxLC_REPORT|wxLC_VIRTUAL, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxListCtrlNameStr)
Definition: CPListFrame.cpp:90
void UpdateInternalCPList()
helper class for virtual listview control
Definition: CPListFrame.h:33
virtual int OnGetItemImage(long item) const
show no images
std::vector< CPListItem > m_internalCPList
Definition: CPListFrame.h:87
int m_sortCol
Definition: CPListFrame.h:84
virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &changed)
notifies about changes to images
Definition: CPListFrame.h:58
void Init(HuginBase::Panorama *pano)
void SortInternalList(bool isAscending)
virtual wxString OnGetItemText(long item, long column) const
create labels for virtual list control
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
void OnChar(wxKeyEvent &e)
handle keystrokes
The main window frame.
Definition: MainFrame.h:83
Model for a panorama.
Definition: Panorama.h:152
void SelectAll()
select all items
List all control points of this project.
Definition: CPListFrame.h:43
HuginBase::Panorama * m_pano
Definition: CPListFrame.h:82
xrc handler for CPImagesComboBox
Definition: CPListFrame.h:95
void OnCPListSelectionChanged(wxListEvent &e)
selection event handler
size_t globalIndex
Definition: CPListFrame.h:35
bool m_sortAscend
Definition: CPListFrame.h:85
void SelectDistanceThreshold(double threshold)
select all cp with the given error bigger than the threshold
void OnCPListHeaderClick(wxListEvent &e)
sort criterium changed
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
CPListCtrl * m_list
Definition: CPListFrame.h:124
this handler class will receive change events from the Panorama.
Definition: PanoramaData.h:401
size_t localNumber
Definition: CPListFrame.h:36
std::map< std::string, int > m_localIds
Definition: CPListFrame.h:88
bool m_onlyActiveImages
Definition: CPListFrame.h:86
virtual void panoramaChanged(HuginBase::Panorama &pano)
Notification about a Panorama change.
HuginBase::Panorama & m_pano
Definition: CPListFrame.h:125