1 #ifndef __creaImageIOWxGimmickView_h_INCLUDED__
2 #define __creaImageIOWxGimmickView_h_INCLUDED__
6 #include <creaImageIOGimmickView.h>
9 #include <wx/splitter.h>
10 #include <wx/toolbar.h>
11 #include <wx/tbarbase.h>
12 #include <wx/notebook.h>
19 //=====================================================================
21 //=====================================================================
22 /// Concrete derivative of GimmickView which implements a wxWidgets-based view
23 class WxGimmickView : public wxPanel, virtual public GimmickView
26 typedef int EventType;
29 WxGimmickView(Gimmick*,
32 const wxPoint& pos, const wxSize& size,
33 int image_type = GIMMICK_3D_IMAGE_SELECTION,
34 int number_of_threads = 0);
35 /// Virtual destructor
36 virtual ~WxGimmickView();
39 /// Creates the tool bar
42 /// Create the tree view for TreeHandler provided
43 /// (overloaded from GimmickView)
44 void CreateTreeView( TreeHandler* );
47 /// The ToolBar and the tools
49 wxToolBarToolBase* mToolAddFile;
50 wxToolBarToolBase* mToolAddDir;
51 wxToolBarToolBase* mToolRemove;
52 wxToolBarToolBase* mToolHelp;
54 wxSplitterWindow* mSplitter;
55 wxPanel* mBottomPanel;
56 wxNotebook* mNotebook;
60 void CreateIconList();
63 // EO class WxGimmickView
64 //=====================================================================
76 //====================================================================
78 //====================================================================
80 /// Returns the size of the current selection
81 virtual int GetSelectionSize() { return 0; }
82 /// Returns true if there is a valid selection
83 virtual bool IsSelectionValid(){ return false; }
84 /// Returns the vector of full filenames of selected images
85 virtual void GetSelectedFiles(std::vector<std::string>&){ return; }
86 /// Returns the vector of images corresponding to selection
87 virtual void GetSelectedImages(std::vector<vtkImageData*>&){ return; }
88 /// Returns the vector of DicomNode corresponding to selection
89 virtual void GetSelectedDicomNodes(std::vector<DicomNode*>&){ return; }
90 /// Returns the DicomNode corresponding to the tree item
91 virtual DicomNode* GetDicomNodeOfItem(const TreeItemId& i);
94 /// Type of list of DicomDatabase
95 typedef std::vector<DicomDatabase*> DicomDatabaseListType;
96 /// Returns the list of DicomDatabase open
97 virtual DicomDatabaseListType& GetDicomDatabaseList()
99 /// Returns the list of DicomDatabase open (const)
100 virtual const DicomDatabaseListType& GetDicomDatabaseList() const
104 ///Opens an existing database, or else, creates a local database.
105 virtual void OpenOrNewDatabase(bool open){ return; }
107 virtual void ShowHelp();
110 ///Gets the extension of the database
111 const std::string& GetDatabaseExtension() { return null; }
112 ///Sets the extension of the database
113 virtual void SetDatabaseExtension(const std::string& ext){ return; }
116 //====================================================================
117 // Preview Display Related
118 //====================================================================
121 ///Shows the image sent as a parameter
123 virtual void ShowImage(vtkImageData* image){ return; }
125 //====================================================================
127 //====================================================================
131 ///Loads or creates a favorites database
132 virtual void LoadOrCreateFavoritesDatabase(){ return; }
134 ///Creates the user settings directory
135 void CreateUserSettingsDirectory(){ return; }
136 ///Obtains the user settings directory
137 const std::string& GetUserSettingsDirectory(){ return null; }
139 //====================================================================
140 // Attribute Display Related
141 //====================================================================
144 ///Shows the Information regarding the node sent as a parameter
146 virtual void ShowInformation(DicomNode*){ return; }
148 //====================================================================
149 // Tree Display Related
150 //====================================================================
153 /// Completely rebuilds the view with
154 /// current DicomDatabaseList
155 virtual void RebuildView(){ return; }
156 /// Recursively updates the part of the view corresponding
157 /// to the DicomDatabase passed
158 /// i.e. creates items for the DicomNode which do not have
159 /// deletes obsolete items (whose DicomNode has been deleted)
160 virtual void UpdateDicomDatabaseView(DicomDatabase*){ return; }
161 /// Recursively updates the part of the view corresponding
162 /// to the DicomNode provided.
163 /// parent is its parent in the tree (where to insert / remove it)
164 virtual void UpdateDicomNodeView(DicomNode* n, const TreeItemId& parent){ return; }
167 ///Type definition of the data regarding the tree
168 typedef WxGimmickTreeItemData TreeItemData;
169 ///Gets the item data of the tree item passed as a parameter
170 TreeItemData* GetItemData(const TreeItemId& id){ return null; }
171 ///Type definition of the data insid a node of the tree
172 typedef WxGimmickDicomNodeData NodeData;
175 //====================================================================
177 //====================================================================
181 int mSelectionMaxImageDimension;
182 int mCurrentSelectionImageSize[4];
184 ///Existent Database List
185 DicomDatabaseListType mDicomDatabaseList;
186 ///Favorites database
187 DicomDatabase* mFavoriteDatabase;
189 ///Path to the database list file
190 std::string mDatabaseListFile;
191 ///Extension of the database
192 std::string mDatabaseExtension;
196 int mFirstDicomDatabaseIconIndex;
199 vtkImageViewer2* mViewer;
201 int mx1,mx2,my1,my2,mz1,mz2;
202 double mspx,mspy,mspz;
205 // Multi-thread image reader
206 MultiThreadImageReader mReader;
207 // map of images name to node
208 std::map<std::string,DicomNode*> mImageFileNameToNode;
211 } // EO namespace creaImageIO
213 #endif // USE_WIDGETS