]> Creatis software - creaImageIO.git/blob - src/creaImageIOWxGimmickReaderDialog.h
thread bug correction
[creaImageIO.git] / src / creaImageIOWxGimmickReaderDialog.h
1 #ifndef __creaImageIOWxGimmickReaderDialog_h_INCLUDED__
2 #define __creaImageIOWxGimmickReaderDialog_h_INCLUDED__
3
4 #ifdef USE_WXWIDGETS
5
6 #include <creaImageIOWxGimmickView.h>
7 #include "creaImageIOSystem.h"
8 #include <creaWx.h>
9 #include "wx/wx.h"
10 namespace creaImageIO
11 {
12   /**
13    * \ingroup GUI
14    */
15
16   //=====================================================================
17  //=====================================================================
18   class CREAIMAGEIO_EXPORT  WxGimmickReaderDialog : public wxDialog
19   {
20   public:
21     WxGimmickReaderDialog();
22     WxGimmickReaderDialog(wxWindow *parent,
23                           const wxWindowID id,
24                           const std::string i_namedescp , 
25                           const std::string i_namedb ,
26                           wxString title,
27                           const wxPoint& pos,
28                           const wxSize& size,
29                           int image_min_dim = GIMMICK_2D_IMAGE_SELECTION,
30                           int image_max_dim = GIMMICK_3D_IMAGE_SELECTION,
31                           int output_dim = NATIVE,
32                           int threads = 0);
33
34     boost::shared_ptr<Gimmick> GetGimmick() { return mGimmick; }
35     //    typedef WxGimmick ViewType;
36     typedef WxGimmickView::EventType EventType;
37
38     ~WxGimmickReaderDialog();
39
40         //===============================================================================================
41         //Image Selection
42         //===============================================================================================
43
44     void GetSelectedImages(std::vector<vtkImageData*>& s, int dim)
45     { mView->GetSelectedImages(s, dim); }
46
47     void GetSelectedImagesInVector(std::vector<vtkImageData*>& s, int dim)
48     { mView->GetSelectedImagesInVector(s, dim); }
49
50         // ----get selected files in an Output structure-------
51         // out: vector structure output  < <img, info>, ... >
52         // i_attr: list of dicom tags to extract 
53         // mult: information of one file or multiple files
54         // outmodel: xml-filename that specifies images order..(todo) 
55         void getSelected(std::vector<OutStrGimmick> &outG,std::vector< std::string> i_attr, bool mult, const std::string outmodel)
56         {
57                 mView->getSelectedFiles(outG, i_attr, mult, outmodel);
58         }
59
60     void GetSelectedFiles(std::vector<std::string>& s) 
61     { mView->GetSelectedFiles(s); }
62
63     void OnSelChanged(EventType& event);
64     void OnContextualMenu(EventType& event);
65     void OnMenuTest(wxCommandEvent& event);
66     void OnValid(bool valid);
67     void OnExit(){ mView->StopPlayer(); }
68         void deleteMessage();
69     // void OnButtonOk(wxCommandEvent& event);
70     // void OnButtonCancel(wxCommandEvent& event);
71         void stopReading()
72         {
73                 mView->stopReader();
74         }
75
76   private :
77
78     boost::shared_ptr<Gimmick>   mGimmick;
79     WxGimmickView* mView;
80
81     wxButton* mOkButton;
82     wxButton* mCancelButton;
83         wxBoxSizer *mtopsizer;
84
85     enum 
86       {
87         TVID = 1
88         //      OKID = 2,
89         //      CANCELID = 3
90       };
91
92   }; // class WxGimmickReaderDialog
93   //=====================================================================
94         
95 } // EO namespace creaImageIO
96
97
98 #endif // USE_WIDGETS
99 // EOF
100 #endif