]> Creatis software - creaImageIO.git/blob - src2/creaImageIOWxGimmickView.h
*** empty log message ***
[creaImageIO.git] / src2 / creaImageIOWxGimmickView.h
1 #ifndef __creaImageIOWxGimmickView_h_INCLUDED__
2 #define __creaImageIOWxGimmickView_h_INCLUDED__
3
4 #ifdef USE_WXWIDGETS
5
6 #include <creaImageIOGimmickView.h>
7 #include <creaWx.h>
8
9
10 namespace creaImageIO
11 {
12   /**
13    * \ingroup View
14    */
15   //=====================================================================
16   
17   //=====================================================================
18   /// Concrete derivative of GimmickView which implements a wxWidgets-based view
19   class WxGimmickView : public wxPanel, virtual public GimmickView
20     {
21     public:
22       typedef int EventType;
23
24       /// Ctor
25       WxGimmickView(Gimmick*, 
26                     wxWindow *parent, 
27                     const wxWindowID id,
28                     const wxPoint& pos, const wxSize& size,
29                     int image_type = GIMMICK_3D_IMAGE_SELECTION,
30                     int number_of_threads = 0);
31       /// Virtual destructor
32       virtual ~WxGimmickView();
33
34
35   
36
37     private:
38       
39     };
40     // EO class WxGimmickView
41     //=====================================================================
42   
43
44   /*
45
46
47
48
49
50
51
52
53         //====================================================================
54         // General
55         //====================================================================
56
57     /// Returns the size of the current selection
58     virtual int GetSelectionSize() { return 0; } 
59     /// Returns true if there is a valid selection
60     virtual bool IsSelectionValid(){ return false; }
61     /// Returns the vector of full filenames of selected images
62     virtual void GetSelectedFiles(std::vector<std::string>&){ return; }
63     /// Returns the vector of images corresponding to selection
64     virtual void GetSelectedImages(std::vector<vtkImageData*>&){ return; }
65     /// Returns the vector of DicomNode corresponding to selection
66     virtual void GetSelectedDicomNodes(std::vector<DicomNode*>&){ return; }
67    /// Returns the DicomNode corresponding to the tree item
68     virtual DicomNode* GetDicomNodeOfItem(const TreeItemId& i);
69
70         
71         /// Type of list of DicomDatabase
72     typedef std::vector<DicomDatabase*> DicomDatabaseListType;
73     /// Returns the list of DicomDatabase open
74     virtual DicomDatabaseListType& GetDicomDatabaseList() 
75     { return null; }
76     /// Returns the list of DicomDatabase open (const)
77     virtual const DicomDatabaseListType& GetDicomDatabaseList() const 
78     { return null; }
79
80         protected:
81         ///Opens an existing database, or else, creates a local database.
82     virtual void OpenOrNewDatabase(bool open){ return; }
83         ///Shows the help
84         virtual void ShowHelp();
85
86         private:
87         ///Gets the extension of the database
88         const std::string& GetDatabaseExtension() { return null; }
89         ///Sets the extension of the database
90     virtual void SetDatabaseExtension(const std::string& ext){ return; }
91
92
93         //====================================================================
94     // Preview Display Related
95         //====================================================================
96
97
98     ///Shows the image sent as a parameter
99         private:
100          virtual void ShowImage(vtkImageData* image){ return; }
101
102         //====================================================================
103     // Favorites Related
104         //====================================================================
105
106
107         public:
108         ///Loads or creates a favorites database
109     virtual void LoadOrCreateFavoritesDatabase(){ return; }
110         private:
111         ///Creates the user settings directory
112     void CreateUserSettingsDirectory(){ return; }
113         ///Obtains the user settings directory
114         const std::string& GetUserSettingsDirectory(){ return null; }
115
116         //====================================================================  
117         // Attribute Display Related
118         //====================================================================
119
120
121         ///Shows the Information regarding the node sent as a parameter
122         private:
123      virtual void ShowInformation(DicomNode*){ return; }
124    
125         //====================================================================
126     // Tree Display Related
127     //====================================================================
128
129         protected:
130     /// Completely rebuilds the view with 
131     /// current DicomDatabaseList
132     virtual void RebuildView(){ return; }
133         /// Recursively updates the part of the view corresponding 
134     /// to the DicomDatabase passed
135     /// i.e. creates items for the DicomNode which do not have
136     ///      deletes obsolete items (whose DicomNode has been deleted)
137     virtual void UpdateDicomDatabaseView(DicomDatabase*){ return; }
138     /// Recursively updates the part of the view corresponding 
139     /// to the DicomNode provided.
140     /// parent is its parent in the tree (where to insert / remove it)
141         virtual void UpdateDicomNodeView(DicomNode* n, const TreeItemId& parent){ return; }
142     
143         private:
144         ///Type definition of the data regarding the tree
145     typedef WxGimmickTreeItemData TreeItemData;
146         ///Gets the item data of the tree item passed as a parameter
147     TreeItemData* GetItemData(const TreeItemId& id){ return null; }
148     ///Type definition of the data insid a node of the tree
149     typedef WxGimmickDicomNodeData NodeData;
150
151
152         //====================================================================
153     // Class Attributes
154     //====================================================================
155
156         
157         int mSelectionType;
158     int mSelectionMaxImageDimension;
159     int mCurrentSelectionImageSize[4];
160
161         ///Existent Database List
162     DicomDatabaseListType mDicomDatabaseList;
163         ///Favorites database
164     DicomDatabase* mFavoriteDatabase;
165
166         ///Path to the database list file
167     std::string mDatabaseListFile;
168         ///Extension of the database
169     std::string mDatabaseExtension;
170
171     bool mJustStarted;
172
173     int  mFirstDicomDatabaseIconIndex;
174
175    // Previewer
176     vtkImageViewer2* mViewer;
177     
178     int mx1,mx2,my1,my2,mz1,mz2;
179     double mspx,mspy,mspz;
180   
181     // Image preview :
182     // Multi-thread image reader
183     MultiThreadImageReader mReader;
184     // map of images name to node
185     std::map<std::string,DicomNode*> mImageFileNameToNode;
186   */
187  
188 } // EO namespace creaImageIO
189
190 #endif // USE_WIDGETS
191 // EOF
192 #endif