Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImagesList.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
26 #ifndef _IMAGESLIST_H
27 #define _IMAGESLIST_H
28 
29 
30 #include "panodata/Panorama.h"
32 //#include "hugin/MainFrame.h"
33 
34 //declare 2 event types to communicate with parent about adding/deleting images
35  wxDECLARE_EVENT(EVT_IMAGE_ADD,wxCommandEvent);
36  wxDECLARE_EVENT(EVT_IMAGE_DEL,wxCommandEvent);
37 
60 class ImagesList: public wxListCtrl, public HuginBase::PanoramaObserver
61 {
62 public:
63  ImagesList();
64 
65  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"));
66 
68 
69  virtual ~ImagesList(void) ;
70 
73  virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet & imgNr);
74  virtual void panoramaChanged(HuginBase::Panorama &pano) {};
75 
83  virtual void CreateItem(unsigned int imgNr);
84 
87  virtual void UpdateItem(unsigned int imgNr);
88 
94  virtual void UpdatePartNumbersForItem(unsigned int imgNr);
95 
101  virtual void RemoveItem(unsigned int imgNr);
102 
107  void SelectSingleImage(unsigned int imgNr);
113  void SelectImageRange(unsigned int imgStart,unsigned int imgEnd);
114 
116  void SelectImages(const HuginBase::UIntSet imgs);
117 
119  void SelectAll();
120 
122  void DeselectAll();
123 
125  const HuginBase::UIntSet & GetSelected() const;
126 
127 protected:
128  // the model
130 
131  // image variable group information
133 
134  // update selected map
135  void OnItemSelected ( wxListEvent & e );
136  // update selected map
137  void OnItemDeselected ( wxListEvent & e );
138  // save the column width when changed
139  void OnColumnWidthChange( wxListEvent & e );
141  void OnChar( wxKeyEvent & e);
142 
144  //void createIcon(wxBitmap & bitmap, unsigned int imgNr, unsigned int size);
145 
147 
148  // image icons.
149  wxImageList *m_smallIcons;
154 
155  // propagate list selections/deselections to client.
158 
159  //for saving column width
161  DECLARE_EVENT_TABLE()
162  DECLARE_DYNAMIC_CLASS(ImagesList)
163 };
164 
167 class ImagesListMask : public ImagesList
168 {
169 public:
170  ImagesListMask();
171 
172  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"));
173 
174  void Init(HuginBase::Panorama * pano);
175 
178  virtual void UpdateItem(unsigned int imgNr);
180  void SetSingleSelect(bool isSingleSelect);
181 
182  DECLARE_DYNAMIC_CLASS(ImagesListMask)
183 };
184 
186 class ImagesListMaskXmlHandler : public wxXmlResourceHandler
187 {
188  DECLARE_DYNAMIC_CLASS(ImagesListMaskXmlHandler)
189 
190  public:
192  virtual wxObject *DoCreateResource();
193  virtual bool CanHandle(wxXmlNode *node);
194 };
195 
196 
197 #endif // _LIST_H
HuginBase::Panorama * pano
Definition: ImagesList.h:129
void OnItemDeselected(wxListEvent &e)
Definition: ImagesList.cpp:367
void SelectImages(const HuginBase::UIntSet imgs)
selects the given images
Definition: ImagesList.cpp:264
virtual void panoramaChanged(HuginBase::Panorama &pano)
Notification about a Panorama change.
Definition: ImagesList.h:74
Somewhere to specify what variables belong to what.
void OnItemSelected(wxListEvent &e)
Definition: ImagesList.cpp:325
int m_distDigits
Definition: ImagesList.h:152
void DeselectAll()
Deselects all images.
Definition: ImagesList.cpp:314
HuginBase::StandardImageVariableGroups * variable_groups
Definition: ImagesList.h:132
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
wxImageList * m_smallIcons
Definition: ImagesList.h:149
virtual ~ImagesList(void)
Definition: ImagesList.cpp:104
Model for a panorama.
Definition: Panorama.h:152
void SelectSingleImage(unsigned int imgNr)
Select an image.
Definition: ImagesList.cpp:252
const HuginBase::UIntSet & GetSelected() const
get the currently selected images
Definition: ImagesList.cpp:181
void OnChar(wxKeyEvent &e)
event handler to capture special key code
Definition: ImagesList.cpp:338
void OnColumnWidthChange(wxListEvent &e)
Definition: ImagesList.cpp:401
int m_iconHeight
Definition: ImagesList.h:150
virtual void UpdateItem(unsigned int imgNr)
update the information in an already existing list item
Definition: ImagesList.cpp:410
virtual void RemoveItem(unsigned int imgNr)
remove an existing list item
Definition: ImagesList.cpp:246
wxDECLARE_EVENT(wxEVT_COMMAND_THUMBNAILTHREAD_UPDATE, wxCommandEvent)
void SelectImageRange(unsigned int imgStart, unsigned int imgEnd)
Select an image range.
Definition: ImagesList.cpp:281
void SelectAll()
Select all images.
Definition: ImagesList.cpp:305
specialized to display the mask aspect of images
Definition: ImagesList.h:167
this handler class will receive change events from the Panorama.
Definition: PanoramaData.h:401
virtual void CreateItem(unsigned int imgNr)
create an list item for imgNr
Definition: ImagesList.cpp:238
int m_pixelDigits
Definition: ImagesList.h:153
virtual void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
receive the update signal and update display accordingly
Definition: ImagesList.cpp:111
virtual void UpdatePartNumbersForItem(unsigned int imgNr)
Update the part numbers (e.g.
Definition: ImagesList.cpp:415
HuginBase::UIntSet selectedItems
create icons for an image
Definition: ImagesList.h:146
int m_degDigits
Definition: ImagesList.h:151
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"))
Definition: ImagesList.cpp:58
wxString m_configClassName
Definition: ImagesList.h:160
multi use list.
Definition: ImagesList.h:60
bool m_notifyParents
Definition: ImagesList.h:156
void Init(HuginBase::Panorama *pano)
Definition: ImagesList.cpp:90
bool m_singleSelect
Definition: ImagesList.h:157