creaImageIOWxDescriptorPanel.h

Go to the documentation of this file.
00001 #ifndef __creaImageIOWxDescriptorPanel_h_INCLUDED__
00002 #define __creaImageIOWxDescriptorPanel_h_INCLUDED__
00003 
00004 #ifdef USE_WXWIDGETS
00005 #include <creaWx.h>
00006 #include <string>
00007 #include <map>
00008 #include <vector>
00009 #include <creaImageIOWxGimmickView.h>
00010 #include <wx/listctrl.h>
00011 #include <wx/statline.h>
00012 
00013 
00014 #define ID_DESCRIPTOR 1500
00015 #define ID_LEVEL_CTRL        ID_DESCRIPTOR+1
00016 #define ID_LEVEL_ADD         ID_DESCRIPTOR+2
00017 #define ID_GR_CTRL               ID_DESCRIPTOR+3
00018 #define ID_EL_CTRL               ID_DESCRIPTOR+4
00019 #define ID_NAME_CTRL         ID_DESCRIPTOR+5
00020 #define ID_ATTRIBUTE_CTRL        ID_DESCRIPTOR+6
00021 #define ID_ATTRIBUTE_ADD         ID_DESCRIPTOR+7
00022 #define ID_REMOVE_ADD            ID_DESCRIPTOR+8
00023 #define ID_DSCP_APPLY            ID_DESCRIPTOR+9
00024 
00025 namespace creaImageIO
00026 {
00027 
00031   //=====================================================================
00032  //=====================================================================
00037 
00038   class WxDescriptorPanel : public wxDialog
00039   {
00040   public:
00041     WxDescriptorPanel();    
00042         WxDescriptorPanel(wxWindow *parent, const std::string path);
00043     ~WxDescriptorPanel();
00044 
00045         // Get file to load Descriptor
00046         const std::string& GetDescriptor(){ return m_DscpFile;}
00047 
00048   private :
00049 
00050     // WxControls
00051         wxTextCtrl *LevelCtrl;  //TextCtrl to enter level's name
00052         wxTextCtrl *GRCtrl;     // TextCtrl to enter DICOM Group value
00053         wxTextCtrl *ELCtrl;     // TextCtrl to enter DICOM element value
00054         wxTextCtrl *ResultCtrl; //TextCtrl to visualize Descriptor
00055         wxComboBox *AttributeCombo; // Combox to choose Attribute values
00056 
00058         void OnAddAttribute(wxCommandEvent& event);
00059 
00061         void onAddAttribute( const std::string &att, const std::string &name_att, std::string level = "");
00062 
00064         void OnAddLevel(wxCommandEvent& event);
00065         
00067         void onAddLevel(const std::string &level);
00068 
00070         void OnDicomAttribute(wxCommandEvent& event);
00071 
00073         void OnRemove(wxCommandEvent& event);
00074 
00076         void OnNew(wxCommandEvent& event);
00077 
00079         void OnLoad(wxCommandEvent& event);
00080 
00082         void OnOK(wxCommandEvent& event);
00083 
00085         void OnApply(wxCommandEvent& event);
00086 
00088         void OnCancel(wxCommandEvent& event);
00089 
00091         void CreateDescriptor(int type);
00092 
00094         bool addLevel(const std::string &name);
00095 
00097         bool addAtribute(const std::string &level, const std::string &name);
00098 
00100         bool RemoveAttribute(const std::string &level, const std::string &name);
00101 
00103         bool RemoveLevel(const std::string &name);
00104 
00106         void createDescriptorFile();
00107         
00109         void loadDescriptor(const std::string i_name);
00110 
00112         std::string findLevel();
00113 
00115         std::string OwnAttribute(const std::string name);
00116 
00118         const std::string saveDescriptor();
00119 
00121         int lv;
00122 
00124         long InsertPt;
00125 
00127         std::string m_DscpFile;
00128 
00130         std::string outDscp; 
00131         
00132         // Vector of attributes
00133         std::vector<std::string> VLevel;
00134 
00135         // map of level, attributes
00136         std::map<std::string, std::vector<std::string> > DscpTree;
00137 
00138         // map of own application attributes
00139         std::map<std::string, std::string> ownatt;
00140 
00141         // List of added level
00142         std::map<int, std::string> lvlist;
00143 
00144         // DB Gimmick path
00145         std::string m_path;
00146 
00147   }; // class WxDescriptorPanel
00148   //=====================================================================
00149 
00150   
00151 } // EO namespace creaImageIO
00152 
00153 
00154 #endif // USE_WIDGETS
00155 // EOF
00156 #endif
00157