]> Creatis software - creaImageIO.git/blob - src2/creaImageIOTreeView.h
Added validation function (visible in ok button being enabled or not)
[creaImageIO.git] / src2 / creaImageIOTreeView.h
1 #ifndef __creaImageIOTreeView_h_INCLUDED__
2 #define __creaImageIOTreeView_h_INCLUDED__
3
4 #include <creaImageIOTreeHandler.h>
5 #include <creaImageIOSystem.h>
6 #include <vtkImageData.h>
7
8 namespace creaImageIO
9 {
10   /**
11    * \ingroup View
12    */
13         
14   //=====================================================================
15   
16   //=====================================================================
17   /// Abstract class that handles the view of a Tree through its TreeHandler
18   class TreeView
19     {
20     public:
21       /// Ctor
22       TreeView(TreeHandler*);
23       /// Virtual destructor
24       virtual ~TreeView();
25
26       
27       /// Updates the view of a level given the selected items of upper level
28       virtual void UpdateLevel( int ) 
29       { GimmickError("INTERNAL ERROR : TreeView::UpdateLevel not overloaded");}
30
31           ///Removes selected nodes on given level
32           virtual void RemoveSelected( int )
33           { GimmickError("INTERNAL ERROR : TreeView::RemoveSelected not overloaded");}
34
35           ///Validates the selected images
36       virtual void ValidateSelectedImages()
37           { GimmickError("INTERNAL ERROR : TreeView::ValidateSelected not overloaded");}
38           ///Returns the selected data as vtkImageData
39           vtkImageData* GetSelectedImage(int dim)
40           { GimmickError("INTERNAL ERROR : TreeView::GetSelectedImage not overloaded");}
41     ///Returns the selected data as a vector of vtkImageData (4D)
42           virtual void GetSelectedImages(std::vector<vtkImageData*>& s, int dim)
43           { GimmickError("INTERNAL ERROR : TreeView::GetSelectedImages not overloaded");}
44
45           ///Sets the maximum dimension allowed for selections
46           void SetMaxDimension(int maxdim){ mSelectionMaxDimension=maxdim; }
47           ///Sets the minimum dimension allowed for selections
48           void SetMinDimension(int mindim){ mSelectionMinDimension=mindim; }
49           ///Sets the output dimension desired for selections
50           void SetOutputDimension(int outdim){ mOutputDimension=outdim; }
51     
52     protected:
53       TreeHandler* GetTreeHandler() { return mTreeHandler; }
54           ///Gets the maximum dimension allowed for selections
55           int GetMaxDimension(){ return mSelectionMaxDimension; }
56           ///Gets the minimum dimension allowed for selections
57           int GetMinDimension(){ return mSelectionMinDimension; }
58           ///Gets the output dimension desired for selections
59           int GetOutputDimension(){ return mOutputDimension; }
60
61     private:
62       /// The TreeHandler with which it corresponds
63       TreeHandler* mTreeHandler;
64           //The selection's maximum dimension
65           int mSelectionMaxDimension;
66           //The selection's minimum dimension
67           int mSelectionMinDimension;
68           //The user desired output dimension
69           int mOutputDimension;
70     };
71     // EO class TreeView
72     //=====================================================================
73   
74   
75 } // EO namespace creaImageIO
76
77 // EOF
78 #endif