]> Creatis software - creaImageIO.git/blob - src2/creaImageIOTreeView.h
4f61518eda7e672922402dd7f3a241c22c469a1b
[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           
50     protected:
51       TreeHandler* GetTreeHandler() { return mTreeHandler; }
52           ///Gets the maximum dimension allowed for selections
53           int GetMaxDimension(){ return mSelectionMaxDimension; }
54           ///Gets the minimum dimension allowed for selections
55           int GetMinDimension(){ return mSelectionMinDimension; }
56          
57     private:
58       /// The TreeHandler with which it corresponds
59       TreeHandler* mTreeHandler;
60           //The selection's maximum dimension
61           int mSelectionMaxDimension;
62           //The selection's minimum dimension
63           int mSelectionMinDimension;
64           };
65     // EO class TreeView
66     //=====================================================================
67   
68   
69 } // EO namespace creaImageIO
70
71 // EOF
72 #endif