]> Creatis software - creaImageIO.git/blob - src/creaImageIOTreeView.h
#3185 creaImageIO Feature New Normal - Clean code
[creaImageIO.git] / src / creaImageIOTreeView.h
1 /*
2 # ---------------------------------------------------------------------
3 #
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
5 #                        pour la Santé)
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 #
10 #  This software is governed by the CeCILL-B license under French law and 
11 #  abiding by the rules of distribution of free software. You can  use, 
12 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
13 #  license as circulated by CEA, CNRS and INRIA at the following URL 
14 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
15 #  or in the file LICENSE.txt.
16 #
17 #  As a counterpart to the access to the source code and  rights to copy,
18 #  modify and redistribute granted by the license, users are provided only
19 #  with a limited warranty  and the software's author,  the holder of the
20 #  economic rights,  and the successive licensors  have only  limited
21 #  liability. 
22 #
23 #  The fact that you are presently reading this means that you have had
24 #  knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------
26 */
27
28
29 #ifndef __creaImageIOTreeView_h_INCLUDED__
30 #define __creaImageIOTreeView_h_INCLUDED__
31
32 #include <creaImageIOTreeHandler.h>
33 #include <creaImageIOTimestampDatabaseHandler.h>
34 #include <creaImageIOSystem.h>
35 #include <vtkImageData.h>
36
37 namespace creaImageIO
38 {
39
40   class GimmickView;
41
42   /**
43    * \ingroup View
44    */
45         
46   //=====================================================================
47
48   //=====================================================================
49   /// Abstract class that handles the view of a Tree through its TreeHandler
50   class TreeView
51     {
52     public:
53       /// Ctor
54       TreeView(TreeHandler*,GimmickView*);
55       /// Virtual destructor
56       virtual ~TreeView();
57
58       
59       /// Updates the view of a level given the selected items of upper level
60       virtual void UpdateLevel( int ) 
61       { GimmickError("INTERNAL ERROR : TreeView::UpdateLevel not overloaded");}
62
63           ///Removes selected nodes
64           virtual void RemoveSelected(std::string &i_save )
65           { GimmickError("INTERNAL ERROR : TreeView::RemoveSelected not overloaded");}
66
67           ///Validates the selected images
68       virtual void ValidateSelectedImages()
69           { GimmickError("INTERNAL ERROR : TreeView::ValidateSelected not overloaded");}
70           
71           ///Returns the last selected level
72           virtual unsigned int GetLastSelectedLevel(){GimmickError("INTERNAL ERROR : TreeView::GetLastSelectedLevel not overloaded");}
73
74           ///Returns the maximum number of levels
75           virtual int GetNumberOfLevels(){ GimmickError("INTERNAL ERROR : TreeView::GetLevels not overloaded"); }
76           ///Gets the current selections filenames
77           virtual void GetSelectedAsString(std::vector<std::string>&s){ GimmickError("INTERNAL ERROR : TreeView::GetSelectedAsString not overloaded"); }
78
79           /// Gets the user selected data from the level passed as a parameter
80       virtual const std::vector<tree::Node*>& GetSelected(int level){ GimmickError("INTERNAL ERROR : TreeView::GetSelected not overloaded"); }
81
82           /// Gets the next nodes on the list, be it up(true) or down(false).
83       virtual void GetNodes(std::vector<tree::Node*>& nodes, bool direction){ GimmickError("INTERNAL ERROR : TreeView::GetNodes not overloaded"); }
84
85           /// Gets the attributes that are being shown and the ones that have been blocked on a specific level
86           virtual void GetAttributes(std::vector<std::string>& areShown, std::vector<std::string>& notShown, int level){ GimmickError("INTERNAL ERROR : TreeView::GetAttributes not overloaded"); }
87           
88           ///Sets the non visible attributes and refreshes the GUI
89           virtual void SetNonVisibleAttributes(const std::vector<std::string>& notShown, int level){ GimmickError("INTERNAL ERROR : TreeView::SetNonVisibleAttributes not overloaded"); }
90
91           ///Creates a new listctrl
92           virtual void CreateCtrl(std::vector<std::string>& notShown, int nlevel){ GimmickError("INTERNAL ERROR : TreeView::CreateCtrl not overloaded"); }
93
94     protected:
95       TreeHandler* GetTreeHandler() { return mTreeHandler; }
96           GimmickView* GetGimmickView() { return mGimmickView; }
97          
98     private:
99       /// The TreeHandler with which it corresponds
100       TreeHandler* mTreeHandler;
101           /// The GimmickView which holds the TreeView
102       GimmickView* mGimmickView;  
103
104   };
105     // EO class TreeView
106     //=====================================================================
107   
108   
109 } // EO namespace creaImageIO
110
111 // EOF
112 #endif