creaImageIO_lib
|
Abstract class that handles the view of a Tree through its TreeHandler. More...
#include <creaImageIOWxTreeView.h>
Classes | |
struct | LevelType |
Public Member Functions | |
WxTreeView (TreeHandler *, GimmickView *, wxWindow *parent, const wxWindowID id) | |
Ctor. More... | |
virtual | ~WxTreeView () |
Virtual destructor. More... | |
virtual void | UpdateLevel (int) |
Updates the view of a level given the selected items of upper level. More... | |
virtual void | RemoveSelected (std::string &i_save) |
Removes selected nodes on given level. More... | |
virtual unsigned int | GetLastSelectedLevel () |
Returns the last selected level. More... | |
void | OnItemSelected (wxListEvent &event) |
Callback for item selection. More... | |
void | OnItemDeSelected (wxListEvent &event) |
Callback for item deselection. More... | |
void | OnColClick (wxListEvent &event) |
Callback for column click. More... | |
void | OnPopupSort (wxCommandEvent &event) |
Callback when the user needs the items sorted. More... | |
void | OnPopupFilter (wxCommandEvent &event) |
Callback when the user need the items filtered. More... | |
void | OnLocalCopy (wxCommandEvent &event) |
Callback when the user needs the item copied to the local disk. More... | |
void | OnAnonymizer (wxCommandEvent &event) |
Callback when the user needs the item copied to the local disk. More... | |
void | OnEditField (wxCommandEvent &event) |
Callback when the user needs to edit a field. More... | |
void | OnDumpTags (wxCommandEvent &event) |
Callback when the user needs to display alll dicom tags for a file. More... | |
void | OnExportToStorage (wxCommandEvent &event) |
Callback when the user needs to transfer data from storage to storage. More... | |
void | OnMouseClick (wxMouseEvent &event) |
Callback on mouse click. More... | |
void | OnItemMenu (wxListEvent &event) |
Displays a menu for items. More... | |
void | GetAttributes (std::vector< std::string > &areShown, std::vector< std::string > ¬Shown, int level) |
Gets the attributes that are being shown and the ones that have been blocked on a specific level. More... | |
void | SetNonVisibleAttributes (const std::vector< std::string > ¬Shown, int level) |
Sets the non visible attributes and refreshes the GUI. More... | |
void | CreateCtrl (std::vector< std::string > ¬Shown, int nlevel) |
Creates a new listctrl. More... | |
bool | IsAttributeVisible (const std::string &val, int level) |
Returns true if the attribute passed as a parameter is visible or not. More... | |
virtual void | ValidateSelectedImages () |
Validates the selected images. More... | |
Protected Member Functions | |
TreeHandler * | GetTreeHandler () |
GimmickView * | GetGimmickView () |
Private Types | |
typedef std::map< tree::Node *, wxColour > | ColorMap |
The color map. More... | |
typedef std::pair< tree::Node *, wxColour > | NodeColorPair |
Private Member Functions | |
wxListCtrl * | GetCtrl (int l) |
return the wxListCtrl of one level More... | |
wxSplitterWindow * | GetSplitter (int l) |
return the wxSplitter of one level More... | |
int | GetNumberOfLevels () |
Returns the maximum number of levels. More... | |
const std::vector< tree::Node * > & | GetSelected (int level) |
void | SetSelectedUpToDate (int l, bool v) |
Set the bool SelectedUpToDate for level l. More... | |
bool | GetSelectedUpToDate (int l) |
Get the bool SelectedUpToDate for level l. More... | |
void | ValidateSelectedImages (bool isSelection) |
Validates the selected images. More... | |
void | GetSelectedAsString (std::vector< std::string > &s) |
Gets selected filenames. More... | |
void | GetFilenamesAsString (const std::vector< tree::Node * > &nodes, std::vector< std::string > &s) |
Gets the filenames of the given nodes and returns them on the given vector. Is recursive. More... | |
void | GetNodes (std::vector< tree::Node * > &nodes, bool direction) |
Gets the next nodes on the list, be it up(true) or down(false). More... | |
virtual void | RecursiveUpdateLevel (int) |
Recursive method called upon by UpdateLevel to refresh all windows. More... | |
void | SelectAll (int level) |
Selects all the elements of a level. More... | |
void | UnSelectAll (int level) |
UnSelects all the elements of a level. More... | |
void | OnKeyDown (wxListEvent &event) |
void | SortLevel (int level) |
Sorts the level. More... | |
Private Attributes | |
wxBoxSizer * | msizer |
std::vector< LevelType > | mLevelList |
The vector of levels : one for each level of the tree. More... | |
int | mColumnSelected |
Currently Selected Column. More... | |
long | mLastSelected |
The last selected item on the list (left click) More... | |
long | mLastRightSelected |
The last selected item on the list (right click) More... | |
int | mLastRightLevel |
The last selected level (by right click) More... | |
ColorMap | mColorMap |
std::vector< std::string > | mColorPalette |
Initial color palette. More... | |
wxMenu * | menu |
wxObject * | senderCtrl |
int | mAscendingID |
int | mDescendingID |
int | mFilterID |
unsigned int | mLastLevel |
wxMenu * | menuItem |
wxMenu * | subExportMenu |
int | mAnonymizingID |
int | mLocalCopyID |
int | mEditFieldID |
int | mDumpID |
int | mExportID |
int | mExport2StorageID |
bool | mIgnoreSelectedChanged |
Abstract class that handles the view of a Tree through its TreeHandler.
Definition at line 65 of file creaImageIOWxTreeView.h.
|
private |
The color map.
Definition at line 207 of file creaImageIOWxTreeView.h.
|
private |
Definition at line 208 of file creaImageIOWxTreeView.h.
creaImageIO::WxTreeView::WxTreeView | ( | TreeHandler * | handler, |
GimmickView * | gimmick, | ||
wxWindow * | parent, | ||
const wxWindowID | id | ||
) |
Ctor.
Initialize the first level splitter
Definition at line 122 of file creaImageIOWxTreeView.cpp.
References creaImageIO::tree::Tree::GetAttributeDescriptorList(), creaImageIO::tree::Tree::GetLevelDescriptor(), creaImageIO::tree::LevelDescriptor::GetName(), creaImageIO::tree::Tree::GetNumberOfLevels(), creaImageIO::TreeHandler::GetTree(), GimmickDebugMessage, creaImageIO::WxTreeView::LevelType::key, mAnonymizingID, mAscendingID, mDescendingID, mDumpID, mEditFieldID, menu, menuItem, mFilterID, mIgnoreSelectedChanged, mLastLevel, mLastSelected, mLevelList, mLocalCopyID, msizer, OnAnonymizer(), OnDumpTags(), OnEditField(), OnExportToStorage(), OnLocalCopy(), OnPopupFilter(), OnPopupSort(), creaImageIO::tree::AttributeDescriptor::PRIVATE, creaImageIO::WxTreeView::LevelType::SelectedUpToDate, creaImageIO::WxTreeView::LevelType::SortColumn, subExportMenu, UpdateLevel(), creaImageIO::WxTreeView::LevelType::wxCtrl, and creaImageIO::WxTreeView::LevelType::wxSplitter.
|
virtual |
Virtual destructor.
Destructor.
Definition at line 291 of file creaImageIOWxTreeView.cpp.
References GimmickDebugMessage, menu, and menuItem.
|
virtual |
Creates a new listctrl.
Reimplemented from creaImageIO::TreeView.
Definition at line 1226 of file creaImageIOWxTreeView.cpp.
References creaImageIO::tree::Tree::GetAttributeDescriptorList(), creaImageIO::TreeHandler::GetTree(), creaImageIO::TreeView::GetTreeHandler(), IsAttributeVisible(), mLevelList, creaImageIO::tree::AttributeDescriptor::PRIVATE, and UpdateLevel().
|
virtual |
Gets the attributes that are being shown and the ones that have been blocked on a specific level.
Reimplemented from creaImageIO::TreeView.
Definition at line 1202 of file creaImageIOWxTreeView.cpp.
References creaImageIO::tree::AttributeDescriptor::EDITABLE, creaImageIO::tree::Tree::GetAttributeDescriptorList(), creaImageIO::TreeHandler::GetTree(), creaImageIO::TreeView::GetTreeHandler(), IsAttributeVisible(), and mLevelList.
|
inlineprivate |
return the wxListCtrl of one level
Definition at line 164 of file creaImageIOWxTreeView.h.
References mLevelList.
Referenced by GetNodes(), GetSelected(), OnAnonymizer(), OnColClick(), OnDumpTags(), OnEditField(), OnExportToStorage(), OnItemDeSelected(), OnItemMenu(), OnItemSelected(), OnPopupFilter(), OnPopupSort(), RecursiveUpdateLevel(), SelectAll(), SortLevel(), and UpdateLevel().
|
private |
Gets the filenames of the given nodes and returns them on the given vector. Is recursive.
Definition at line 1180 of file creaImageIOWxTreeView.cpp.
References creaImageIO::TreeView::GetTreeHandler(), creaImageIO::TreeHandler::LoadChildren(), and mLevelList.
Referenced by OnAnonymizer(), OnExportToStorage(), and OnLocalCopy().
|
inlineprotectedinherited |
Definition at line 96 of file creaImageIOTreeView.h.
References creaImageIO::TreeView::mGimmickView.
Referenced by OnAnonymizer(), OnDumpTags(), OnEditField(), OnExportToStorage(), OnItemSelected(), OnKeyDown(), OnLocalCopy(), OnPopupFilter(), RemoveSelected(), and ValidateSelectedImages().
|
inlinevirtual |
Returns the last selected level.
Reimplemented from creaImageIO::TreeView.
Definition at line 82 of file creaImageIOWxTreeView.h.
References mLastLevel.
|
privatevirtual |
Gets the next nodes on the list, be it up(true) or down(false).
Reimplemented from creaImageIO::TreeView.
Definition at line 1113 of file creaImageIOWxTreeView.cpp.
References GetCtrl(), mLastSelected, and mLevelList.
|
inlineprivatevirtual |
Returns the maximum number of levels.
Reimplemented from creaImageIO::TreeView.
Definition at line 168 of file creaImageIOWxTreeView.h.
References mLevelList.
|
privatevirtual |
Gets the user selected data from the level passed as a parameter Updates the vector if necessary
Reimplemented from creaImageIO::TreeView.
Definition at line 304 of file creaImageIOWxTreeView.cpp.
References GetCtrl(), creaImageIO::TreeView::GetTreeHandler(), and mLevelList.
Referenced by GetSelectedAsString(), OnLocalCopy(), RecursiveUpdateLevel(), RemoveSelected(), and ValidateSelectedImages().
|
privatevirtual |
Gets selected filenames.
Reimplemented from creaImageIO::TreeView.
Definition at line 1164 of file creaImageIOWxTreeView.cpp.
References GetSelected(), and mLevelList.
|
inlineprivate |
Get the bool SelectedUpToDate for level l.
Definition at line 175 of file creaImageIOWxTreeView.h.
References mLevelList.
|
inlineprivate |
return the wxSplitter of one level
Definition at line 166 of file creaImageIOWxTreeView.h.
References mLevelList.
Referenced by UpdateLevel().
|
inlineprotectedinherited |
Definition at line 95 of file creaImageIOTreeView.h.
References creaImageIO::TreeView::mTreeHandler.
Referenced by CreateCtrl(), GetAttributes(), GetFilenamesAsString(), GetSelected(), OnDumpTags(), OnEditField(), OnItemDeSelected(), OnItemSelected(), OnLocalCopy(), RecursiveUpdateLevel(), RemoveSelected(), and UpdateLevel().
bool creaImageIO::WxTreeView::IsAttributeVisible | ( | const std::string & | val, |
int | level | ||
) |
Returns true if the attribute passed as a parameter is visible or not.
Definition at line 1274 of file creaImageIOWxTreeView.cpp.
References mLevelList.
Referenced by CreateCtrl(), and GetAttributes().
void creaImageIO::WxTreeView::OnAnonymizer | ( | wxCommandEvent & | event | ) |
Callback when the user needs the item copied to the local disk.
Definition at line 846 of file creaImageIOWxTreeView.cpp.
References creaImageIO::GimmickView::Anonymize(), GetCtrl(), GetFilenamesAsString(), creaImageIO::TreeView::GetGimmickView(), mLastRightLevel, and mLastRightSelected.
Referenced by WxTreeView().
void creaImageIO::WxTreeView::OnColClick | ( | wxListEvent & | event | ) |
Callback for column click.
Definition at line 723 of file creaImageIOWxTreeView.cpp.
References GetCtrl(), mColumnSelected, menu, mLevelList, and senderCtrl.
void creaImageIO::WxTreeView::OnDumpTags | ( | wxCommandEvent & | event | ) |
Callback when the user needs to display alll dicom tags for a file.
Definition at line 947 of file creaImageIOWxTreeView.cpp.
References creaImageIO::GimmickView::DumpTags(), creaImageIO::tree::Node::GetAttribute(), creaImageIO::tree::Tree::GetAttributeDescriptorList(), GetCtrl(), creaImageIO::TreeView::GetGimmickView(), creaImageIO::TreeHandler::GetTree(), creaImageIO::TreeView::GetTreeHandler(), mLastRightLevel, and mLastRightSelected.
Referenced by WxTreeView().
void creaImageIO::WxTreeView::OnEditField | ( | wxCommandEvent & | event | ) |
Callback when the user needs to edit a field.
Definition at line 908 of file creaImageIOWxTreeView.cpp.
References creaImageIO::GimmickView::CreateEditFieldsDialog(), creaImageIO::tree::AttributeDescriptor::EDITABLE, creaImageIO::tree::Tree::GetAttributeDescriptorList(), GetCtrl(), creaImageIO::TreeView::GetGimmickView(), creaImageIO::TreeHandler::GetTree(), creaImageIO::TreeView::GetTreeHandler(), mLastRightLevel, and mLastRightSelected.
Referenced by WxTreeView().
void creaImageIO::WxTreeView::OnExportToStorage | ( | wxCommandEvent & | event | ) |
Callback when the user needs to transfer data from storage to storage.
Definition at line 934 of file creaImageIOWxTreeView.cpp.
References creaImageIO::GimmickView::ExportToStorage(), GetCtrl(), GetFilenamesAsString(), creaImageIO::TreeView::GetGimmickView(), mLastRightLevel, and mLastRightSelected.
Referenced by WxTreeView().
void creaImageIO::WxTreeView::OnItemDeSelected | ( | wxListEvent & | event | ) |
Callback for item deselection.
Definition at line 616 of file creaImageIOWxTreeView.cpp.
References GetCtrl(), creaImageIO::TreeView::GetTreeHandler(), GimmickDebugMessage, mLevelList, OnItemSelected(), and SetSelectedUpToDate().
void creaImageIO::WxTreeView::OnItemMenu | ( | wxListEvent & | event | ) |
Displays a menu for items.
Definition at line 742 of file creaImageIOWxTreeView.cpp.
References GetCtrl(), menuItem, mLastRightLevel, mLastRightSelected, mLevelList, and senderCtrl.
void creaImageIO::WxTreeView::OnItemSelected | ( | wxListEvent & | event | ) |
Callback for item selection.
Definition at line 636 of file creaImageIOWxTreeView.cpp.
References creaImageIO::GimmickView::ClearSelection(), GetCtrl(), creaImageIO::TreeView::GetGimmickView(), creaImageIO::TreeView::GetTreeHandler(), GimmickDebugMessage, mIgnoreSelectedChanged, mLastLevel, mLastSelected, mLevelList, SelectAll(), UpdateLevel(), and creaImageIO::TreeView::ValidateSelectedImages().
Referenced by OnItemDeSelected().
|
private |
Definition at line 1149 of file creaImageIOWxTreeView.cpp.
References creaImageIO::GimmickView::ClearSelection(), creaImageIO::TreeView::GetGimmickView(), and RemoveSelected().
void creaImageIO::WxTreeView::OnLocalCopy | ( | wxCommandEvent & | event | ) |
Callback when the user needs the item copied to the local disk.
Definition at line 861 of file creaImageIOWxTreeView.cpp.
References creaImageIO::GimmickView::CopyFiles(), GetFilenamesAsString(), creaImageIO::TreeView::GetGimmickView(), creaImageIO::tree::Tree::GetLevelDescriptor(), creaImageIO::tree::LevelDescriptor::GetName(), GetSelected(), creaImageIO::TreeHandler::GetTree(), creaImageIO::TreeView::GetTreeHandler(), and mLastLevel.
Referenced by WxTreeView().
void creaImageIO::WxTreeView::OnMouseClick | ( | wxMouseEvent & | event | ) |
Callback on mouse click.
void creaImageIO::WxTreeView::OnPopupFilter | ( | wxCommandEvent & | event | ) |
Callback when the user need the items filtered.
Definition at line 764 of file creaImageIOWxTreeView.cpp.
References creaImageIO::GimmickView::ClearSelection(), creaImageIO::tree::Node::GetAttribute(), GetCtrl(), creaImageIO::TreeView::GetGimmickView(), GimmickDebugMessage, mColumnSelected, mLevelList, senderCtrl, and UpdateLevel().
Referenced by WxTreeView().
void creaImageIO::WxTreeView::OnPopupSort | ( | wxCommandEvent & | event | ) |
Callback when the user needs the items sorted.
Definition at line 823 of file creaImageIOWxTreeView.cpp.
References GetCtrl(), mAscendingID, mColumnSelected, mDescendingID, mLevelList, senderCtrl, and SortLevel().
Referenced by WxTreeView().
|
privatevirtual |
Recursive method called upon by UpdateLevel to refresh all windows.
Updates the view of a level given the selected items of upper level Recursive method
Definition at line 498 of file creaImageIOWxTreeView.cpp.
References GetCtrl(), GetSelected(), creaImageIO::TreeView::GetTreeHandler(), GimmickDebugMessage, creaImageIO::ItemData::id, creaImageIO::TreeHandler::LoadChildren(), mLevelList, creaImageIO::ItemData::node, and SortLevel().
Referenced by UpdateLevel().
|
virtual |
Removes selected nodes on given level.
Removes selected nodes on last selected level.
Reimplemented from creaImageIO::TreeView.
Definition at line 385 of file creaImageIOWxTreeView.cpp.
References creaImageIO::GimmickView::AddIgnoreFile(), creaImageIO::TreeView::GetGimmickView(), creaImageIO::tree::Tree::GetLevelDescriptor(), creaImageIO::tree::LevelDescriptor::GetName(), GetSelected(), creaImageIO::TreeHandler::GetTree(), creaImageIO::TreeView::GetTreeHandler(), GimmickMessage, creaImageIO::RemoveAlertDlg::isChecked(), creaImageIO::TreeHandler::LoadChildren(), mLastLevel, creaImageIO::GimmickView::modifyValidationSignal(), creaImageIO::TreeHandler::Remove(), and UpdateLevel().
Referenced by OnKeyDown().
|
private |
Selects all the elements of a level.
Definition at line 696 of file creaImageIOWxTreeView.cpp.
References GetCtrl(), and mIgnoreSelectedChanged.
Referenced by OnItemSelected().
|
virtual |
Sets the non visible attributes and refreshes the GUI.
Reimplemented from creaImageIO::TreeView.
Definition at line 1220 of file creaImageIOWxTreeView.cpp.
References mLevelList.
|
inlineprivate |
Set the bool SelectedUpToDate for level l.
Definition at line 173 of file creaImageIOWxTreeView.h.
References mLevelList.
Referenced by OnItemDeSelected().
|
private |
Sorts the level.
Definition at line 972 of file creaImageIOWxTreeView.cpp.
References creaImageIO::ItemData::attr, CompareFunctionInts(), CompareFunctionStrings(), creaImageIO::tree::AttributeDescriptor::DecodeType(), creaImageIO::tree::Node::GetAttributeDescriptor(), GetCtrl(), GimmickDebugMessage, mIgnoreSelectedChanged, mLevelList, creaImageIO::ItemData::node, and creaImageIO::ItemData::selected.
Referenced by OnPopupSort(), and RecursiveUpdateLevel().
|
private |
UnSelects all the elements of a level.
|
virtual |
Updates the view of a level given the selected items of upper level.
Updates a level of the view (adds or removes children, etc.)
Reimplemented from creaImageIO::TreeView.
Definition at line 473 of file creaImageIOWxTreeView.cpp.
References GetCtrl(), GetSplitter(), creaImageIO::TreeView::GetTreeHandler(), GimmickDebugMessage, and RecursiveUpdateLevel().
Referenced by CreateCtrl(), OnItemSelected(), OnPopupFilter(), RemoveSelected(), and WxTreeView().
|
inlinevirtualinherited |
Validates the selected images.
Definition at line 68 of file creaImageIOTreeView.h.
References GimmickError.
Referenced by OnItemSelected().
|
private |
Validates the selected images.
Definition at line 1098 of file creaImageIOWxTreeView.cpp.
References creaImageIO::TreeView::GetGimmickView(), GetSelected(), GimmickDebugMessage, mIgnoreSelectedChanged, mLastSelected, mLevelList, and creaImageIO::GimmickView::OnSelectionChange().
|
private |
Definition at line 223 of file creaImageIOWxTreeView.h.
Referenced by WxTreeView().
|
private |
Definition at line 216 of file creaImageIOWxTreeView.h.
Referenced by OnPopupSort(), and WxTreeView().
|
private |
Definition at line 209 of file creaImageIOWxTreeView.h.
|
private |
Initial color palette.
Definition at line 211 of file creaImageIOWxTreeView.h.
|
private |
Currently Selected Column.
Definition at line 197 of file creaImageIOWxTreeView.h.
Referenced by OnColClick(), OnPopupFilter(), and OnPopupSort().
|
private |
Definition at line 217 of file creaImageIOWxTreeView.h.
Referenced by OnPopupSort(), and WxTreeView().
|
private |
Definition at line 226 of file creaImageIOWxTreeView.h.
Referenced by WxTreeView().
|
private |
Definition at line 225 of file creaImageIOWxTreeView.h.
Referenced by WxTreeView().
|
private |
Definition at line 213 of file creaImageIOWxTreeView.h.
Referenced by OnColClick(), WxTreeView(), and ~WxTreeView().
|
private |
Definition at line 221 of file creaImageIOWxTreeView.h.
Referenced by OnItemMenu(), WxTreeView(), and ~WxTreeView().
|
private |
Definition at line 228 of file creaImageIOWxTreeView.h.
|
private |
Definition at line 227 of file creaImageIOWxTreeView.h.
|
private |
Definition at line 218 of file creaImageIOWxTreeView.h.
Referenced by WxTreeView().
|
private |
Definition at line 233 of file creaImageIOWxTreeView.h.
Referenced by OnItemSelected(), SelectAll(), SortLevel(), ValidateSelectedImages(), and WxTreeView().
|
private |
Definition at line 219 of file creaImageIOWxTreeView.h.
Referenced by GetLastSelectedLevel(), OnItemSelected(), OnLocalCopy(), RemoveSelected(), and WxTreeView().
|
private |
The last selected level (by right click)
Definition at line 205 of file creaImageIOWxTreeView.h.
Referenced by OnAnonymizer(), OnDumpTags(), OnEditField(), OnExportToStorage(), and OnItemMenu().
|
private |
The last selected item on the list (right click)
Definition at line 202 of file creaImageIOWxTreeView.h.
Referenced by OnAnonymizer(), OnDumpTags(), OnEditField(), OnExportToStorage(), and OnItemMenu().
|
private |
The last selected item on the list (left click)
Definition at line 199 of file creaImageIOWxTreeView.h.
Referenced by GetNodes(), OnItemSelected(), ValidateSelectedImages(), and WxTreeView().
|
private |
The vector of levels : one for each level of the tree.
Definition at line 161 of file creaImageIOWxTreeView.h.
Referenced by CreateCtrl(), GetAttributes(), GetCtrl(), GetFilenamesAsString(), GetNodes(), GetNumberOfLevels(), GetSelected(), GetSelectedAsString(), GetSelectedUpToDate(), GetSplitter(), IsAttributeVisible(), OnColClick(), OnItemDeSelected(), OnItemMenu(), OnItemSelected(), OnPopupFilter(), OnPopupSort(), RecursiveUpdateLevel(), SetNonVisibleAttributes(), SetSelectedUpToDate(), SortLevel(), ValidateSelectedImages(), and WxTreeView().
|
private |
Definition at line 224 of file creaImageIOWxTreeView.h.
Referenced by WxTreeView().
|
private |
Actual processing of item selection/deselection Called by OnItemSelected and OnItemDeSelected
Definition at line 138 of file creaImageIOWxTreeView.h.
Referenced by WxTreeView().
|
private |
Definition at line 215 of file creaImageIOWxTreeView.h.
Referenced by OnColClick(), OnItemMenu(), OnPopupFilter(), and OnPopupSort().
|
private |
Definition at line 222 of file creaImageIOWxTreeView.h.
Referenced by WxTreeView().