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;
51 wxSplitterWindow* mSplitter;
52 wxPanel* mBottomPanel;
53 wxNotebook* mNotebook;
57 void CreateIconList();
60 // EO class WxGimmickView
61 //=====================================================================
73 //====================================================================
75 //====================================================================
77 /// Returns the size of the current selection
78 virtual int GetSelectionSize() { return 0; }
79 /// Returns true if there is a valid selection
80 virtual bool IsSelectionValid(){ return false; }
81 /// Returns the vector of full filenames of selected images
82 virtual void GetSelectedFiles(std::vector<std::string>&){ return; }
83 /// Returns the vector of images corresponding to selection
84 virtual void GetSelectedImages(std::vector<vtkImageData*>&){ return; }
85 /// Returns the vector of DicomNode corresponding to selection
86 virtual void GetSelectedDicomNodes(std::vector<DicomNode*>&){ return; }
87 /// Returns the DicomNode corresponding to the tree item
88 virtual DicomNode* GetDicomNodeOfItem(const TreeItemId& i);
91 /// Type of list of DicomDatabase
92 typedef std::vector<DicomDatabase*> DicomDatabaseListType;
93 /// Returns the list of DicomDatabase open
94 virtual DicomDatabaseListType& GetDicomDatabaseList()
96 /// Returns the list of DicomDatabase open (const)
97 virtual const DicomDatabaseListType& GetDicomDatabaseList() const
101 ///Opens an existing database, or else, creates a local database.
102 virtual void OpenOrNewDatabase(bool open){ return; }
104 virtual void ShowHelp();
107 ///Gets the extension of the database
108 const std::string& GetDatabaseExtension() { return null; }
109 ///Sets the extension of the database
110 virtual void SetDatabaseExtension(const std::string& ext){ return; }
113 //====================================================================
114 // Preview Display Related
115 //====================================================================
118 ///Shows the image sent as a parameter
120 virtual void ShowImage(vtkImageData* image){ return; }
122 //====================================================================
124 //====================================================================
128 ///Loads or creates a favorites database
129 virtual void LoadOrCreateFavoritesDatabase(){ return; }
131 ///Creates the user settings directory
132 void CreateUserSettingsDirectory(){ return; }
133 ///Obtains the user settings directory
134 const std::string& GetUserSettingsDirectory(){ return null; }
136 //====================================================================
137 // Attribute Display Related
138 //====================================================================
141 ///Shows the Information regarding the node sent as a parameter
143 virtual void ShowInformation(DicomNode*){ return; }
145 //====================================================================
146 // Tree Display Related
147 //====================================================================
150 /// Completely rebuilds the view with
151 /// current DicomDatabaseList
152 virtual void RebuildView(){ return; }
153 /// Recursively updates the part of the view corresponding
154 /// to the DicomDatabase passed
155 /// i.e. creates items for the DicomNode which do not have
156 /// deletes obsolete items (whose DicomNode has been deleted)
157 virtual void UpdateDicomDatabaseView(DicomDatabase*){ return; }
158 /// Recursively updates the part of the view corresponding
159 /// to the DicomNode provided.
160 /// parent is its parent in the tree (where to insert / remove it)
161 virtual void UpdateDicomNodeView(DicomNode* n, const TreeItemId& parent){ return; }
164 ///Type definition of the data regarding the tree
165 typedef WxGimmickTreeItemData TreeItemData;
166 ///Gets the item data of the tree item passed as a parameter
167 TreeItemData* GetItemData(const TreeItemId& id){ return null; }
168 ///Type definition of the data insid a node of the tree
169 typedef WxGimmickDicomNodeData NodeData;
172 //====================================================================
174 //====================================================================
178 int mSelectionMaxImageDimension;
179 int mCurrentSelectionImageSize[4];
181 ///Existent Database List
182 DicomDatabaseListType mDicomDatabaseList;
183 ///Favorites database
184 DicomDatabase* mFavoriteDatabase;
186 ///Path to the database list file
187 std::string mDatabaseListFile;
188 ///Extension of the database
189 std::string mDatabaseExtension;
193 int mFirstDicomDatabaseIconIndex;
196 vtkImageViewer2* mViewer;
198 int mx1,mx2,my1,my2,mz1,mz2;
199 double mspx,mspy,mspz;
202 // Multi-thread image reader
203 MultiThreadImageReader mReader;
204 // map of images name to node
205 std::map<std::string,DicomNode*> mImageFileNameToNode;
208 } // EO namespace creaImageIO
210 #endif // USE_WIDGETS