|
KiCad PCB EDA Suite
|
#include <rc_item.h>
Public Member Functions | |
| const wxDataViewCtrl * | GetView () const |
| RC_TREE_MODEL (EDA_DRAW_FRAME *aParentFrame, wxDataViewCtrl *aView) | |
| ~RC_TREE_MODEL () | |
| RC_TREE_MODEL (const RC_TREE_MODEL &)=delete | |
| RC_TREE_MODEL & | operator= (const RC_TREE_MODEL &)=delete |
| void | Update (std::shared_ptr< RC_ITEMS_PROVIDER > aProvider, int aSeverities) |
| void | EnableHyperlinks (bool aEnable) |
| Render [label](url) markup as clickable links. | |
| void | ExpandAll () |
| void | PrevMarker () |
| void | NextMarker () |
| void | SelectMarker (const MARKER_BASE *aMarker) |
| void | CenterMarker (const MARKER_BASE *aMarker) |
| bool | IsContainer (wxDataViewItem const &aItem) const override |
| wxDataViewItem | GetParent (wxDataViewItem const &aItem) const override |
| unsigned int | GetChildren (wxDataViewItem const &aItem, wxDataViewItemArray &aChildren) const override |
| bool | HasContainerColumns (wxDataViewItem const &aItem) const override |
| bool | HasValue (const wxDataViewItem &item, unsigned col) const override |
| void | GetValue (wxVariant &aVariant, wxDataViewItem const &aItem, unsigned int aCol) const override |
| Called by the wxDataView to fetch an item's value. | |
| bool | SetValue (wxVariant const &aVariant, wxDataViewItem const &aItem, unsigned int aCol) override |
| Called by the wxDataView to edit an item's content. | |
| bool | GetAttr (wxDataViewItem const &aItem, unsigned int aCol, wxDataViewItemAttr &aAttr) const override |
| Called by the wxDataView to fetch an item's formatting. | |
| void | ValueChanged (RC_TREE_NODE *aNode) |
| void | DeleteCurrentItem (bool aDeep) |
| void | DeleteItems (bool aCurrentOnly, bool aIncludeExclusions, bool aDeep) |
| Delete the current item or all items. | |
Static Public Member Functions | |
| static wxDataViewItem | ToItem (RC_TREE_NODE const *aNode) |
| static RC_TREE_NODE * | ToNode (wxDataViewItem aItem) |
| static KIID | ToUUID (wxDataViewItem aItem) |
Protected Member Functions | |
| RC_TREE_NODE * | createNode (RC_TREE_NODE *aParent, const std::shared_ptr< RC_ITEM > &aRcItem, RC_TREE_NODE::NODE_TYPE aType) |
| void | retireNodeTree (RC_TREE_NODE *aNode) |
| void | deleteNodeTree (RC_TREE_NODE *aNode) |
| void | clearTree () |
| Retire and destroy every node in the tree. | |
| void | rebuildTree (std::shared_ptr< RC_ITEMS_PROVIDER > aProvider, int aSeverities) |
| Repopulate the node tree from aProvider. | |
| void | rebuildModel (std::shared_ptr< RC_ITEMS_PROVIDER > aProvider, int aSeverities) |
| void | onViewSize (wxSizeEvent &aEvent) |
Protected Attributes | |
| EDA_DRAW_FRAME * | m_editFrame |
| wxDataViewCtrl * | m_view |
| int | m_severities |
| bool | m_enableHyperlinks = false |
| wxDataViewColumn * | m_hyperlinkColumn = nullptr |
| std::shared_ptr< RC_ITEMS_PROVIDER > | m_rcItemsProvider |
| std::deque< RC_TREE_NODE::HANDLE > | m_handles |
| Stable wx item IDs. | |
| std::vector< RC_TREE_NODE * > | m_tree |
| RC_TREE_MODEL::RC_TREE_MODEL | ( | EDA_DRAW_FRAME * | aParentFrame, |
| wxDataViewCtrl * | aView ) |
Definition at line 253 of file rc_item.cpp.
References m_editFrame, m_rcItemsProvider, m_severities, and m_view.
Referenced by ERC_TREE_MODEL::ERC_TREE_MODEL(), operator=(), RC_TREE_MODEL(), and TEST_RC_TREE_MODEL::TEST_RC_TREE_MODEL().
| RC_TREE_MODEL::~RC_TREE_MODEL | ( | ) |
Definition at line 309 of file rc_item.cpp.
References clearTree().
|
delete |
References RC_TREE_MODEL().
| void RC_TREE_MODEL::CenterMarker | ( | const MARKER_BASE * | aMarker | ) |
Definition at line 859 of file rc_item.cpp.
|
protected |
Retire and destroy every node in the tree.
Retired handles are kept alive so that stale wxDataViewItems resolve to nullptr.
Definition at line 297 of file rc_item.cpp.
References deleteNodeTree(), m_tree, and retireNodeTree().
Referenced by rebuildTree(), and ~RC_TREE_MODEL().
|
protected |
Definition at line 262 of file rc_item.cpp.
References RC_TREE_NODE::m_Handle, m_handles, and RC_TREE_NODE::HANDLE::m_Node.
Referenced by TEST_RC_TREE_MODEL::AddItemlessMarker(), TEST_RC_TREE_MODEL::AddMarkerWithMainItem(), rebuildTree(), and ValueChanged().
| void RC_TREE_MODEL::DeleteCurrentItem | ( | bool | aDeep | ) |
Definition at line 674 of file rc_item.cpp.
References DeleteItems().
Referenced by DIALOG_DRC::OnDRCItemRClick().
| void RC_TREE_MODEL::DeleteItems | ( | bool | aCurrentOnly, |
| bool | aIncludeExclusions, | ||
| bool | aDeep ) |
Delete the current item or all items.
If all, aIncludeExclusions determines whether or not exclusions are also deleted.
Definition at line 680 of file rc_item.cpp.
References deleteNodeTree(), MARKER_BASE::GetSeverity(), RC_TREE_NODE::m_RcItem, m_rcItemsProvider, m_tree, m_view, retireNodeTree(), RPT_SEVERITY_EXCLUSION, ToItem(), and ToNode().
Referenced by DeleteCurrentItem().
|
protected |
Definition at line 288 of file rc_item.cpp.
Referenced by clearTree(), DeleteItems(), TEST_RC_TREE_MODEL::DetachTopLevel(), and ValueChanged().
| void RC_TREE_MODEL::EnableHyperlinks | ( | bool | aEnable | ) |
Render [label](url) markup as clickable links.
Must be called before any rows are added.
Definition at line 431 of file rc_item.cpp.
References m_enableHyperlinks, m_hyperlinkColumn, m_view, and onViewSize().
Referenced by DIALOG_DRC::DIALOG_DRC().
| void RC_TREE_MODEL::ExpandAll | ( | ) |
Definition at line 456 of file rc_item.cpp.
References m_tree, m_view, and ToItem().
Referenced by rebuildModel().
|
override |
Called by the wxDataView to fetch an item's formatting.
Return true if the item has non-default attributes.
Definition at line 578 of file rc_item.cpp.
References KIGFX::COLOR4D::GetBrightness(), RC_ITEM::GetParent(), MARKER_BASE::GetSeverity(), RC_TREE_NODE::m_RcItem, m_tree, RC_TREE_NODE::m_Type, m_view, RC_TREE_NODE::MARKER, RPT_SEVERITY_EXCLUSION, and ToNode().
|
override |
Definition at line 484 of file rc_item.cpp.
References RC_TREE_NODE::m_Children, m_tree, ToItem(), and ToNode().
|
override |
Definition at line 477 of file rc_item.cpp.
References RC_TREE_NODE::m_Parent, ToItem(), and ToNode().
|
override |
Called by the wxDataView to fetch an item's value.
Definition at line 500 of file rc_item.cpp.
References _, RC_TREE_NODE::AUX_ITEM, RC_TREE_NODE::AUX_ITEM2, RC_TREE_NODE::AUX_ITEM3, RC_TREE_NODE::COMMENT, MARKER_BASE::GetComment(), EDA_ITEM::GetItemDescription(), MARKER_BASE::GetMarkerType(), MARKER_BASE::GetSeverity(), m_editFrame, RC_TREE_NODE::m_RcItem, m_tree, RC_TREE_NODE::m_Type, m_view, RC_TREE_NODE::MAIN_ITEM, RC_TREE_NODE::MARKER, MARKER_BASE::MARKER_DRAWING_SHEET, RPT_SEVERITY_EXCLUSION, RPT_SEVERITY_WARNING, and ToNode().
|
inline |
|
inlineoverride |
|
inlineoverride |
|
override |
Definition at line 463 of file rc_item.cpp.
References RC_TREE_NODE::m_Type, RC_TREE_NODE::MARKER, and ToNode().
| void RC_TREE_MODEL::NextMarker | ( | ) |
Definition at line 816 of file rc_item.cpp.
References RC_TREE_NODE::m_Parent, m_tree, RC_TREE_NODE::m_Type, m_view, RC_TREE_NODE::MARKER, ToItem(), and ToNode().
|
protected |
Definition at line 447 of file rc_item.cpp.
References m_hyperlinkColumn, and m_view.
Referenced by EnableHyperlinks().
|
delete |
References RC_TREE_MODEL().
| void RC_TREE_MODEL::PrevMarker | ( | ) |
Definition at line 795 of file rc_item.cpp.
References RC_TREE_NODE::m_Parent, m_tree, RC_TREE_NODE::m_Type, m_view, RC_TREE_NODE::MARKER, ToItem(), and ToNode().
|
protected |
Definition at line 361 of file rc_item.cpp.
References ExpandAll(), m_enableHyperlinks, RC_TREE_NODE::m_RcItem, m_tree, m_view, rebuildTree(), ToItem(), ToNode(), and WX_DATAVIEW_WINDOW_PADDING.
Referenced by Update().
|
protected |
Repopulate the node tree from aProvider.
Touches no wxWidgets state.
Definition at line 315 of file rc_item.cpp.
References RC_TREE_NODE::AUX_ITEM, RC_TREE_NODE::AUX_ITEM2, RC_TREE_NODE::AUX_ITEM3, clearTree(), RC_TREE_NODE::COMMENT, createNode(), RC_TREE_NODE::m_Children, m_rcItemsProvider, m_severities, m_tree, RC_TREE_NODE::MAIN_ITEM, RC_TREE_NODE::MARKER, and niluuid.
Referenced by rebuildModel().
|
protected |
Definition at line 275 of file rc_item.cpp.
References RC_TREE_NODE::m_Children, RC_TREE_NODE::m_Handle, RC_TREE_NODE::HANDLE::m_Node, and retireNodeTree().
Referenced by clearTree(), DeleteItems(), TEST_RC_TREE_MODEL::DetachTopLevel(), retireNodeTree(), and ValueChanged().
| void RC_TREE_MODEL::SelectMarker | ( | const MARKER_BASE * | aMarker | ) |
Definition at line 844 of file rc_item.cpp.
|
inlineoverride |
|
inlinestatic |
Definition at line 262 of file rc_item.h.
References RC_TREE_NODE::m_Handle.
Referenced by BOOST_AUTO_TEST_CASE(), CenterMarker(), DeleteItems(), ExpandAll(), GetChildren(), GetParent(), NextMarker(), PrevMarker(), rebuildModel(), SelectMarker(), and ValueChanged().
|
inlinestatic |
Definition at line 267 of file rc_item.h.
References RC_TREE_NODE::HANDLE::m_Node.
Referenced by DeleteItems(), DIALOG_DRC::ExcludeMarker(), DIALOG_ERC::ExcludeMarker(), GetAttr(), GetChildren(), GetParent(), ERC_TREE_MODEL::GetValue(), GetValue(), IsContainer(), NextMarker(), DIALOG_DRC::OnDRCItemRClick(), DIALOG_DRC::OnDRCItemSelected(), DIALOG_ERC::OnERCItemRClick(), DIALOG_ERC::OnERCItemSelected(), DIALOG_FOOTPRINT_CHECKER::OnSelectItem(), PrevMarker(), rebuildModel(), and ToUUID().
|
static |
Definition at line 223 of file rc_item.cpp.
References RC_TREE_NODE::AUX_ITEM, RC_TREE_NODE::AUX_ITEM2, RC_TREE_NODE::AUX_ITEM3, RC_TREE_NODE::COMMENT, RC_TREE_NODE::m_RcItem, RC_TREE_NODE::m_Type, RC_TREE_NODE::MAIN_ITEM, RC_TREE_NODE::MARKER, niluuid, and ToNode().
Referenced by BOOST_AUTO_TEST_CASE(), DIALOG_DRC::OnDRCItemSelected(), DIALOG_ERC::OnERCItemSelected(), DIALOG_CLEANUP_GRAPHICS::OnSelectItem(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnSelectItem(), and DIALOG_FOOTPRINT_CHECKER::OnSelectItem().
| void RC_TREE_MODEL::Update | ( | std::shared_ptr< RC_ITEMS_PROVIDER > | aProvider, |
| int | aSeverities ) |
Definition at line 425 of file rc_item.cpp.
References rebuildModel().
Referenced by DIALOG_DRC::OnDRCItemRClick(), and DIALOG_ERC::OnERCItemRClick().
| void RC_TREE_MODEL::ValueChanged | ( | RC_TREE_NODE * | aNode | ) |
Definition at line 623 of file rc_item.cpp.
References RC_TREE_NODE::COMMENT, createNode(), deleteNodeTree(), MARKER_BASE::GetComment(), MARKER_BASE::IsExcluded(), RC_TREE_NODE::m_Children, RC_TREE_NODE::m_Parent, RC_TREE_NODE::m_RcItem, RC_TREE_NODE::m_Type, RC_TREE_NODE::MARKER, retireNodeTree(), ToItem(), and ValueChanged().
Referenced by DIALOG_DRC::OnDRCItemRClick(), DIALOG_ERC::OnERCItemRClick(), and ValueChanged().
|
protected |
Definition at line 369 of file rc_item.h.
Referenced by ERC_TREE_MODEL::GetValue(), GetValue(), and RC_TREE_MODEL().
|
protected |
Definition at line 372 of file rc_item.h.
Referenced by EnableHyperlinks(), and rebuildModel().
|
protected |
Stable wx item IDs.
Handles are retired but never freed before the model dies because wxDataViewCtrl hands back item IDs long after the rows they named were destroyed; the deque keeps existing handle addresses valid as more are appended.
Definition at line 379 of file rc_item.h.
Referenced by createNode().
|
protected |
Definition at line 373 of file rc_item.h.
Referenced by EnableHyperlinks(), and onViewSize().
|
protected |
Definition at line 374 of file rc_item.h.
Referenced by DeleteItems(), RC_TREE_MODEL(), and rebuildTree().
|
protected |
Definition at line 371 of file rc_item.h.
Referenced by RC_TREE_MODEL(), and rebuildTree().
|
protected |
Definition at line 380 of file rc_item.h.
Referenced by TEST_RC_TREE_MODEL::AddItemlessMarker(), TEST_RC_TREE_MODEL::AddMarkerWithMainItem(), CenterMarker(), clearTree(), DeleteItems(), TEST_RC_TREE_MODEL::DetachTopLevel(), ExpandAll(), GetAttr(), GetChildren(), GetValue(), HasValue(), NextMarker(), PrevMarker(), rebuildModel(), rebuildTree(), and SelectMarker().
|
protected |
Definition at line 370 of file rc_item.h.
Referenced by CenterMarker(), DeleteItems(), EnableHyperlinks(), ExpandAll(), GetAttr(), GetValue(), GetView(), NextMarker(), onViewSize(), PrevMarker(), RC_TREE_MODEL(), rebuildModel(), and SelectMarker().