X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreaImageIOWxGimmick.h;h=75e969ef453c2ebcecb61cfd4032284716770526;hb=ecd7eb9aca5b98c06f3ce9072b3f73fe71f1e4b0;hp=9673b5cca0f4086415ff0857d705a68691f15f75;hpb=46d6077cd663d529fb3f083001e9fee330da7fb8;p=creaImageIO.git diff --git a/src/creaImageIOWxGimmick.h b/src/creaImageIOWxGimmick.h index 9673b5c..75e969e 100644 --- a/src/creaImageIOWxGimmick.h +++ b/src/creaImageIOWxGimmick.h @@ -46,58 +46,96 @@ namespace creaImageIO public MultiThreadImageReaderUser { public: - + /// Ctor WxGimmick(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, int image_type = GIMMICK_3D_IMAGE_SELECTION, int number_of_threads = 0); - + /// Dtor virtual ~WxGimmick(); + /// Returns the size of the current selection int GetSelectionSize() { return mTreeListCtrl->GetSelectionSize(); } + /// Returns true if there is a valid selection bool IsSelectionValid(); + /// Returns the vector of full filenames of selected images void GetSelectedFiles(std::vector&); + /// Returns the vector of images corresponding to selection void GetSelectedImages(std::vector&); + /// Returns the vector of DicomNode corresponding to selection void GetSelectedDicomNodes(std::vector&); + /// Returns the vector of wxTreeItemId corresponding to selection void GetSelectedItems(std::vector&); + + /// Returns the DicomNode corresponding to the tree item DicomNode* GetDicomNodeOfItem(const wxTreeItemId& i); + /// Stores the first id of user menu static const int UserMenuFirstId; + /// The class storing WxGimmick settings typedef WxGimmickSettings Settings; + /// Returns the settings (const) const Settings& GetSettings() const { return mSettings; } + /// Returns the settings Settings& GetSettings() { return mSettings; } + + /// The type of event sent by WxGimmick typedef WxGimmickEvent EventType; + /// The type of list of DicomDatabase typedef std::vector DicomDatabaseListType; + /// Returns the list of DicomDatabase open DicomDatabaseListType& GetDicomDatabaseList() { return mDicomDatabaseList; } + /// Returns the list of DicomDatabase open (const) const DicomDatabaseListType& GetDicomDatabaseList() const { return mDicomDatabaseList; } + /// Returns the wxTreeListCtrl of the main view wxTreeListCtrl* GetTreeListCtrl() { return mTreeListCtrl; } + /// Returns the wxTreeListCtrl of the main view (const) const wxTreeListCtrl* GetTreeListCtrl() const { return mTreeListCtrl; } + /// void SetConfigurationFile(const std::string& filename) { mConfigurationFile = filename;} void LoadConfiguration(); void SaveConfiguration(); void SetSaveConfigurationOnClose(bool v) { mSaveConfigurationOnClose = v; } - + void LoadOrCreateFavoritesDatabase(); protected: + + /// Completely rebuilds the view (i.e. the wxTreeListCtrl) with + /// current DicomDatabaseList void RebuildView(); + /// Recursively updates the part of the view corresponding + /// to the DicomDatabase passed + /// i.e. creates items for the DicomNode which do not have + /// deletes obsolete items (whose DicomNode has been deleted) void UpdateDicomDatabaseView(DicomDatabase*); + /// Recursively updates the part of the view corresponding + /// to the DicomNode provided. + /// parent is its parent in the tree (where to insert / remove it) void UpdateDicomNodeView(DicomNode* n, const wxTreeItemId& parent); + /// Recursively deletes void DeleteObsoleteChildren(wxTreeItemId& id); + /// Create the column titles of the children of the item wxTreeItemId CreateChildrenColumnsTitles(wxTreeItemId& item, DicomNode::Type t); + /// void UpdateColumnsTitles(wxTreeItemId& item, DicomNode::Type t); + /// void UpdateColumns(wxTreeItemId& item, bool only_first = false); + + + + /// General entry point for void OpenOrNewDatabase(bool open); void InsertDicomDatabase(wxTreeItemId& id, DicomDatabase* r); @@ -118,6 +156,7 @@ namespace creaImageIO int mCurrentSelectionImageSize[4]; DicomDatabaseListType mDicomDatabaseList; + DicomDatabase* mFavoriteDatabase; wxTreeListCtrl* mTreeListCtrl; wxTreeItemId mTreeRootId; @@ -239,6 +278,7 @@ namespace creaImageIO void OnPopUpAddFile(wxCommandEvent& event); void OnPopUpAddRawFile(wxCommandEvent& event); void OnPopUpAddDirectory(wxCommandEvent& event); + void OnPopUpAddToFavorites(wxCommandEvent& event); void OnPopUpRemove(wxCommandEvent& event); void OnPopUpSettings(wxCommandEvent& event); void OnPopUpAbout(wxCommandEvent& event);