1 #ifndef __creaImageIOWxGimmickView_h_INCLUDED__
2 #define __creaImageIOWxGimmickView_h_INCLUDED__
6 #include <creaImageIOGimmickView.h>
15 //=====================================================================
17 //=====================================================================
18 /// Concrete derivative of GimmickView which implements a wxWidgets-based view
19 class WxGimmickView : public wxPanel, virtual public GimmickView
22 typedef int EventType;
25 WxGimmickView(Gimmick*,
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();
40 // EO class WxGimmickView
41 //=====================================================================
53 //====================================================================
55 //====================================================================
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);
71 /// Type of list of DicomDatabase
72 typedef std::vector<DicomDatabase*> DicomDatabaseListType;
73 /// Returns the list of DicomDatabase open
74 virtual DicomDatabaseListType& GetDicomDatabaseList()
76 /// Returns the list of DicomDatabase open (const)
77 virtual const DicomDatabaseListType& GetDicomDatabaseList() const
81 ///Opens an existing database, or else, creates a local database.
82 virtual void OpenOrNewDatabase(bool open){ return; }
84 virtual void ShowHelp();
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; }
93 //====================================================================
94 // Preview Display Related
95 //====================================================================
98 ///Shows the image sent as a parameter
100 virtual void ShowImage(vtkImageData* image){ return; }
102 //====================================================================
104 //====================================================================
108 ///Loads or creates a favorites database
109 virtual void LoadOrCreateFavoritesDatabase(){ return; }
111 ///Creates the user settings directory
112 void CreateUserSettingsDirectory(){ return; }
113 ///Obtains the user settings directory
114 const std::string& GetUserSettingsDirectory(){ return null; }
116 //====================================================================
117 // Attribute Display Related
118 //====================================================================
121 ///Shows the Information regarding the node sent as a parameter
123 virtual void ShowInformation(DicomNode*){ return; }
125 //====================================================================
126 // Tree Display Related
127 //====================================================================
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; }
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;
152 //====================================================================
154 //====================================================================
158 int mSelectionMaxImageDimension;
159 int mCurrentSelectionImageSize[4];
161 ///Existent Database List
162 DicomDatabaseListType mDicomDatabaseList;
163 ///Favorites database
164 DicomDatabase* mFavoriteDatabase;
166 ///Path to the database list file
167 std::string mDatabaseListFile;
168 ///Extension of the database
169 std::string mDatabaseExtension;
173 int mFirstDicomDatabaseIconIndex;
176 vtkImageViewer2* mViewer;
178 int mx1,mx2,my1,my2,mz1,mz2;
179 double mspx,mspy,mspz;
182 // Multi-thread image reader
183 MultiThreadImageReader mReader;
184 // map of images name to node
185 std::map<std::string,DicomNode*> mImageFileNameToNode;
188 } // EO namespace creaImageIO
190 #endif // USE_WIDGETS