ImagesList.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00026 #ifndef _IMAGESLIST_H
00027 #define _IMAGESLIST_H
00028 
00029 
00030 #include "PT/Panorama.h"
00031 #include <panodata/StandardImageVariableGroups.h>
00032 //#include "hugin/MainFrame.h"
00033 
00034 using namespace PT;
00035 
00036 //declare 2 event types to communicate with parent about adding/deleting images
00037 #if wxCHECK_VERSION(2,9,0)
00038     wxDECLARE_EVENT(EVT_IMAGE_ADD,wxCommandEvent);
00039     wxDECLARE_EVENT(EVT_IMAGE_DEL,wxCommandEvent);
00040 #else
00041 #if _WINDOWS && defined Hugin_shared
00042     DECLARE_LOCAL_EVENT_TYPE(EVT_IMAGE_ADD,-1)
00043     DECLARE_LOCAL_EVENT_TYPE(EVT_IMAGE_DEL,-1)
00044 #else
00045     DECLARE_EVENT_TYPE(EVT_IMAGE_ADD,-1)
00046     DECLARE_EVENT_TYPE(EVT_IMAGE_DEL,-1)
00047 #endif
00048 #endif
00049 
00072 class ImagesList: public wxListCtrl, public PT::PanoramaObserver
00073 {
00074 public:
00075     ImagesList();
00076 
00077     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"));
00078 
00079     void Init(PT::Panorama * pano);
00080    
00081     virtual ~ImagesList(void) ;
00082 
00085     void panoramaImagesChanged(PT::Panorama &pano, const PT::UIntSet & imgNr);
00086 
00094     virtual void CreateItem(unsigned int imgNr);
00095 
00098     virtual void UpdateItem(unsigned int imgNr);
00099     
00105     virtual void UpdatePartNumbersForItem(unsigned int imgNr);
00106     
00112     virtual void RemoveItem(unsigned int imgNr);
00113 
00118     void SelectSingleImage(unsigned int imgNr);
00124     void SelectImageRange(unsigned int imgStart,unsigned int imgEnd);
00125 
00127     void SelectImages(const HuginBase::UIntSet imgs);
00128 
00130     void SelectAll();
00131 
00133     void DeselectAll();
00134 
00136     const UIntSet & GetSelected() const;
00137 
00138 protected:
00139     // the model
00140     Panorama * pano;
00141     
00142     // image variable group information
00143     HuginBase::StandardImageVariableGroups * variable_groups;
00144 
00145     // update selected map
00146     void OnItemSelected ( wxListEvent & e );
00147     // update selected map
00148     void OnItemDeselected ( wxListEvent & e );
00149     // save the column width when changed
00150     void OnColumnWidthChange( wxListEvent & e );
00152     void OnChar( wxKeyEvent & e);
00153 
00155     //void createIcon(wxBitmap & bitmap, unsigned int imgNr, unsigned int size);
00156 
00157     UIntSet selectedItems;
00158 
00159     // image icons.
00160     wxImageList *m_smallIcons;
00161     int m_iconHeight;
00162     int m_degDigits;
00163     int m_distDigits;
00164     int m_pixelDigits;
00165 
00166     // propagate list selections/deselections to client.
00167     bool m_notifyParents;
00168     bool m_singleSelect;
00169 
00170     //for saving column width
00171     wxString m_configClassName;
00172     DECLARE_EVENT_TABLE()
00173     DECLARE_DYNAMIC_CLASS(ImagesList)
00174 };
00175 
00178 class ImagesListMask : public ImagesList
00179 {
00180 public:
00181     ImagesListMask();
00182 
00183     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"));
00184 
00185     void Init(PT::Panorama * pano);
00186 
00189     virtual void UpdateItem(unsigned int imgNr);
00191     void SetSingleSelect(bool isSingleSelect);
00192 
00193     DECLARE_DYNAMIC_CLASS(ImagesListMask)
00194 };
00195 
00197 class ImagesListMaskXmlHandler : public wxXmlResourceHandler
00198 {
00199     DECLARE_DYNAMIC_CLASS(ImagesListMaskXmlHandler)
00200 
00201     public:
00202         ImagesListMaskXmlHandler();
00203         virtual wxObject *DoCreateResource();
00204         virtual bool CanHandle(wxXmlNode *node);
00205 };
00206 
00207 
00208 #endif // _LIST_H

Generated on 25 Oct 2014 for Hugintrunk by  doxygen 1.4.7