[an error occurred while processing this directive]
Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

hugin1/hugin/MaskEditorPanel.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00010 /*  This is free software; you can redistribute it and/or
00011  *  modify it under the terms of the GNU General Public
00012  *  License as published by the Free Software Foundation; either
00013  *  version 2 of the License, or (at your option) any later version.
00014  *
00015  *  This software is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *  Lesser General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public
00021  *  License along with this software; if not, write to the Free Software
00022  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  */
00025 
00026 #ifndef _MaskEditorPanel_H
00027 #define _MaskEditorPanel_H
00028 
00029 
00030 //-----------------------------------------------------------------------------
00031 // Headers
00032 //-----------------------------------------------------------------------------
00033 
00034 #include <PT/Panorama.h>
00035 #include <wx/clrpicker.h>
00036 #include "MaskImageCtrl.h"
00037 #include "ImagesList.h"
00038 
00044 class MaskEditorPanel : public wxPanel, public PT::PanoramaObserver
00045 {
00046 public:
00049     MaskEditorPanel();
00050 
00051     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"));
00052 
00053     void Init(PT::Panorama * pano);
00054 
00057     virtual ~MaskEditorPanel();
00058 
00059     void SetPano(PT::Panorama * panorama)
00060         { m_pano = panorama; };
00062     void setImage(unsigned int imgNr);
00064     void setMask(unsigned int maskNr);
00066     void UpdateMask();
00068     void AddMask();
00070     void SelectMask(unsigned int newMaskNr);
00071 
00075     void panoramaChanged(PT::Panorama &pano);
00076     void panoramaImagesChanged(PT::Panorama &pano, const PT::UIntSet & imgNr);
00077 
00079     void OnImageSelect(wxListEvent &e);
00081     void OnMaskSelect(wxListEvent &e);
00083     void OnMaskTypeChange(wxCommandEvent &e);
00085     void OnMaskAdd(wxCommandEvent &e);
00087     void OnMaskSave(wxCommandEvent &e);
00089     void OnMaskLoad(wxCommandEvent &e);
00091     void OnMaskDelete(wxCommandEvent &e);
00093     void OnZoom(wxCommandEvent & e);
00095     void OnColourChanged(wxColourPickerEvent &e);
00096 
00097 private:
00098 
00102     void UpdateMaskList(bool restoreSelection=false);
00104     unsigned int GetSelectedMask();
00106     void OnColumnWidthChange( wxListEvent & e );
00108     MaskImageCtrl::ImageRotation GetRot(const unsigned int imgNr);
00109 
00110     // GUI controls
00111     MaskImageCtrl *m_editImg;
00112     ImagesListMask *m_imagesListMask;
00113     wxListCtrl *m_maskList;
00114     wxChoice *m_maskType;
00115 
00116     // my data
00117     PT::Panorama * m_pano;
00118     // current masks vector
00119     HuginBase::MaskPolygonVector m_currentMasks;
00120     // the current images
00121     unsigned int m_ImageNr;
00122     // the current mask
00123     unsigned int m_MaskNr;
00124     // the filename of the current image
00125     std::string m_File;
00126 
00127     DECLARE_EVENT_TABLE();
00128     DECLARE_DYNAMIC_CLASS(MaskEditorPanel)
00129 };
00130 
00132 class MaskEditorPanelXmlHandler : public wxXmlResourceHandler
00133 {
00134     DECLARE_DYNAMIC_CLASS(MaskEditorPanelXmlHandler)
00135 
00136 public:
00137     MaskEditorPanelXmlHandler();
00138     virtual wxObject *DoCreateResource();
00139     virtual bool CanHandle(wxXmlNode *node);
00140 };
00141 
00142 
00143 #endif // _MaskEditorPanel_H

Generated on Mon Sep 20 01:01:26 2010 for Hugintrunk by doxygen 1.3.9.1