1 #ifndef __creaImageIOWxTreeView_h_INCLUDED__
2 #define __creaImageIOWxTreeView_h_INCLUDED__
6 #include <creaImageIOTreeView.h>
9 #include <wx/listctrl.h>
10 #include <wx/splitter.h>
18 //=====================================================================
20 //=====================================================================
21 /// Abstract class that handles the view of a Tree through its TreeHandler
22 class WxTreeView : public wxPanel, virtual public TreeView
26 WxTreeView(TreeHandler*, wxWindow* parent, const wxWindowID id);
27 /// Virtual destructor
28 virtual ~WxTreeView();
31 /// Updates the view of a level given the selected items of upper level
32 virtual void UpdateLevel( int );
34 ///Removes selected nodes on given level
35 virtual void RemoveSelected( int );
37 /// Callback for selection change
38 void OnSelectedChanged(wxListEvent& event);
40 /// Callback for column click
41 void OnColClick(wxListEvent& event);
44 /// The struct holding the data for one level
45 /// Holds the wx control and other data
46 /// such as the vector of attribute keys corresponding to the columns
51 wxSplitterWindow* wxSplitter;
52 std::vector<std::string> key;
54 /// The vector of levels : one for each level of the tree
55 std::vector<LevelType> mLevelList;
57 /// return the wxListCtrl of one level
58 wxListCtrl* GetCtrl(int l) { return mLevelList[l].wxCtrl; }
59 /// return the wxSplitter of one level
60 wxSplitterWindow* GetSplitter(int l) { return mLevelList[l].wxSplitter; }
61 /// Gets the user selected data from the level passed as a parameter
62 std::vector<tree::Node*> GetSelected(int level);
63 ///Validates the selected images
64 void ValidateSelectedImages();
65 ///Returns the selected data as vtkImageData
66 vtkImageData* GetSelectedImage(int dim);
67 ///Returns the selected data as vtkImageData
68 void GetSelectedImages(std::vector<vtkImageData*>& s, int dim);
70 // Updates the view of a level given the selected items of upper level
72 virtual void RecursiveUpdateLevel( int );
78 // EO class WxTreeView
79 //=====================================================================
83 } // EO namespace creaImageIO