NCBI C++ ToolKit
|
Search Toolkit Book for CTreeModelNode
Base class for nodes in the tree. More...
#include <gui/widgets/phylo_tree/tree_model.hpp>
Public Types | |
typedef TData | TValueType |
typedef size_t | TTreeIdx |
typedef vector< TTreeIdx > | TNodeList |
typedef TNodeList::iterator | TNodeList_I |
typedef TNodeList::const_iterator | TNodeList_CI |
typedef TNodeList::reverse_iterator | TNodeList_RI |
typedef TNodeList::const_reverse_iterator | TNodeList_CRI |
Public Member Functions | |
CTreeModelNode () | |
Construct an empty node (null parent) More... | |
void | SetParent (TTreeIdx parent_idx) |
Set index of nodes parent. More... | |
TTreeIdx | GetParent () const |
Get node's parent. More... | |
void | RemoveParent () |
Set the parent index to Null() e.g. for root node. More... | |
bool | HasParent () const |
Check if the node has a parent. More... | |
void | AddChild (TTreeIdx child_idx) |
Add a child node. More... | |
void | RemoveChild (TTreeIdx child_idx) |
Remove child node if it is a child of this node. More... | |
bool | HasChild (TTreeIdx child_idx) const |
Check if another node is a child of this node. More... | |
bool | IsLeaf () const |
Report whether this is a leaf node. More... | |
TNodeList & | GetChildren () |
Return the indices of this node's child nodes. More... | |
const TNodeList & | GetChildren () const |
TNodeList_CI | SubNodeBegin () const |
Return const iterator to first subnode index. More... | |
TNodeList_I | SubNodeBegin () |
Return iterator to first subnode index. More... | |
TNodeList_CI | SubNodeEnd () const |
Return const iterator to end of subnode list. More... | |
TNodeList_I | SubNodeEnd () |
Return iterator to end of subnode list. More... | |
TNodeList_CRI | SubNodeRBegin () const |
Return const reverse iterator to (reverse) of begin of subnode array. More... | |
TNodeList_RI | SubNodeRBegin () |
Return reverse iterator to (reverse) begin of subnode array. More... | |
TNodeList_CRI | SubNodeREnd () const |
Return const reverse iterator to (reverse) end of subnode array. More... | |
TNodeList_RI | SubNodeREnd () |
Return reverse iterator to (reverse) end of subnode array. More... | |
void | ClearConnections () |
Remove connections to parent and children of this node. More... | |
void | SetValue (const TData &data) |
Set the value-object for the node. More... | |
TData & | GetValue () |
Return the value object for the node. More... | |
const TData & | GetValue () const |
TData & | operator* () |
Return the value object for the node using de-referenceing semantics. More... | |
const TData & | operator* () const |
TData * | operator-> () |
const TData * | operator-> () const |
Static Public Member Functions | |
static TTreeIdx | Null () |
Static function that returns the null value. More... | |
Protected Attributes | |
TTreeIdx | m_ParentNode |
Index of parent node to this node. ==Null() if this is the root node. More... | |
vector< TTreeIdx > | m_ChildNodes |
Indices of all the children of this node. More... | |
TData | m_Data |
Data object. More... | |
Base class for nodes in the tree.
Takes a data template parameter to allow additional storage.
Definition at line 56 of file tree_model.hpp.
typedef vector<TTreeIdx> CTreeModelNode< TData >::TNodeList |
Definition at line 62 of file tree_model.hpp.
typedef TNodeList::const_iterator CTreeModelNode< TData >::TNodeList_CI |
Definition at line 64 of file tree_model.hpp.
typedef TNodeList::const_reverse_iterator CTreeModelNode< TData >::TNodeList_CRI |
Definition at line 66 of file tree_model.hpp.
typedef TNodeList::iterator CTreeModelNode< TData >::TNodeList_I |
Definition at line 63 of file tree_model.hpp.
typedef TNodeList::reverse_iterator CTreeModelNode< TData >::TNodeList_RI |
Definition at line 65 of file tree_model.hpp.
typedef size_t CTreeModelNode< TData >::TTreeIdx |
Definition at line 60 of file tree_model.hpp.
typedef TData CTreeModelNode< TData >::TValueType |
Definition at line 59 of file tree_model.hpp.
|
inline |
Construct an empty node (null parent)
Definition at line 71 of file tree_model.hpp.
void CTreeModelNode< TData >::AddChild | ( | TTreeIdx | child_idx | ) |
Add a child node.
child_idx | index of parent node in the array |
Definition at line 640 of file tree_model.hpp.
References LOG_POST.
Referenced by IPhyloTreeFilter::x_OnStep().
|
inline |
Remove connections to parent and children of this node.
Definition at line 154 of file tree_model.hpp.
Referenced by visitor_copy_subtree::operator()(), visitor_paste_subtree::operator()(), and CPhyloTreeDataSource::Remove().
|
inline |
Return the indices of this node's child nodes.
Definition at line 126 of file tree_model.hpp.
Referenced by CPhyloTreeDataSource::NewNode(), CDrawCircularTreeVbo::operator()(), CDrawSplineTreeVbo::operator()(), CDrawPseudoSplineTreeVbo::operator()(), CCalcSlantedTree::operator()(), CPhyloTreeFilter_Export::x_Allowed(), CPhyloTreeMaxDirectChildDist::x_OnStep(), and CPhyloTreeMaxChildDist::x_OnStep().
|
inline |
Definition at line 127 of file tree_model.hpp.
|
inline |
Get node's parent.
Definition at line 82 of file tree_model.hpp.
Referenced by CPhyloTreeDataSource::CollapseSelected(), CPhyloTree::GetCollapsedParentIdx(), CPhyloTree::GetExplicitlySelectedAndNotCollapsed(), CPhyloTree::GetSelState(), CPhyloTree::IsVisible(), CPhyloTreeDataSource::MoveNode(), CPhyloTreeDataSource::NewNode(), CPhyloTreeWidget::OnUpdateCollapseSelected(), CPhyloTreeWidget::OnZoomToSubtree(), visitor_copy_subtree::operator()(), visitor_paste_subtree::operator()(), CDrawCircularTreeVbo::operator()(), CCalcRadialTree::operator()(), CDrawRadialTreeVbo::operator()(), CDrawSplineTreeVbo::operator()(), CDrawPseudoSplineTreeVbo::operator()(), CCalcSlantedTree::operator()(), CDrawSlantedTreeVbo::operator()(), CPhyloTreeDataSource::Remove(), CPhyloTreeDataSource::RemoveSelected(), CPhyloTreeDataSource::ReRootMidpoint(), CPhyloTree::x_CommonNodeSearch(), CPhyloTree::x_GetParentState(), IPhyloTreeRender::x_RenderCircularVbo(), IPhyloTreeRender::x_RenderLineVbo(), IPhyloTreeRender::x_RenderPseudoSplineVbo(), IPhyloTreeRender::x_RenderSplineVbo(), and CPhyloTree::x_SelectParents().
|
inline |
Return the value object for the node.
Definition at line 159 of file tree_model.hpp.
Referenced by CTreeGraphicsModel::EnableCircularLabelTrimming(), CTreeQueryExec::EvalNext(), CPhyloTreeDataSource::ExecuteStringQuery(), IPhyloTreeRender::GetDefaultNodeSize(), IPhyloTreeRender::GetEdgeColor(), CPhyloCircularCladogram::GetNodeLabelDist(), IPhyloTreeRender::GetNodeLabelDist(), IPhyloTreeRender::GetNodeLayoutSize(), CPhyloTreeWidget::IterateSelection(), CPhyloTreeDataSource::NewNode(), CPhyloTreeWidget::OnExportSelection(), visitor_copy_subtree::operator()(), visitor_paste_subtree::operator()(), CVisitorAccumulateProperty::operator()(), CCalcCircularTree::operator()(), CCalcBoundary::operator()(), CCalcRadialTree::operator()(), CDrawRadialTreeVbo::operator()(), CCalcRectangularTree::operator()(), CCalcSlantedTree::operator()(), CDrawSlantedTreeVbo::operator()(), NodeIdxSort::operator()(), CPhyloTreeWidget::RedrawDataSource(), CPhyloTreeDataSource::Remove(), CPhyloTreeDataSource::ReRoot(), CPhyloTreeDataSource::ReRootEdge(), CPhyloTreeDataSource::ReRootMidpoint(), CPhyloTreeWidget::SendEditEvent(), CPhyloSelectionSetMgr::SetSelectionSetProperty(), IPhyloTreeRender::TTHH_NeedTooltip(), IPhyloTreeRender::x_AddCollapsedGeomNode(), IPhyloTreeRender::x_AddCollapsedTextureNode(), CPhyloTree::x_ConvertUpstream(), CPhyloTreeLabel::x_GenerateAutoLabel(), CPhyloTreeMaxDirectChildDist::x_OnStep(), CPhyloTreeMaxChildDist::x_OnStep(), CPhyloTreeDistFromRoot::x_OnStep(), CPhyloTreeMidpointDist::x_OnStep(), IPhyloTreeFilter::x_OnStep(), and IPhyloTreeRender::x_RenderNodeVbo().
|
inline |
Definition at line 160 of file tree_model.hpp.
bool CTreeModelNode< TData >::HasChild | ( | TTreeIdx | child_idx | ) | const |
Check if another node is a child of this node.
child_idx | index of node to be checked |
Definition at line 665 of file tree_model.hpp.
Referenced by IPhyloTreeFilter::x_OnStep().
|
inline |
Check if the node has a parent.
Definition at line 90 of file tree_model.hpp.
Referenced by CPhyloTree::GetSelState(), CPhyloTreeWidget::OnUpdateEdit(), CCalcCircularTree::operator()(), CInitPSNodes::operator()(), CCalcRadialTree::operator()(), CDrawRadialTreeVbo::operator()(), CDrawSlantedTreeVbo::operator()(), CPhyloTreeDataSource::ReRootMidpoint(), CPhyloTreeLabel::x_GenerateAutoLabel(), CPhyloTree::x_GetParentState(), CPhyloTreeMaxDirectChildDist::x_OnStep(), CPhyloTreeMaxChildDist::x_OnStep(), CPhyloTreeDistFromRoot::x_OnStep(), and CPhyloTree::x_SelectParents().
|
inline |
Report whether this is a leaf node.
Definition at line 121 of file tree_model.hpp.
Referenced by CPhyloTreeDataSource::Clusterize(), IPhyloTreeRender::GetNodeSize(), CPhyloTree::GetSelState(), CPhyloTreeWidget::OnExportSelection(), CInitPSNodes::operator()(), CTreeQueryExec::x_EvalAdvance(), CPhyloTreeLabel::x_GenerateAutoLabel(), CPhyloTreePriorityNode::x_OnStep(), CPhyloTreeMaxDirectChildDist::x_OnStep(), CPhyloTreeMaxChildDist::x_OnStep(), CPhyloTreeDistFromRoot::x_OnStep(), CPhyloTreeMidpointDist::x_OnStep(), and IPhyloTreeFilter::x_OnStep().
|
static |
Static function that returns the null value.
NULL_TREE_IDX can also be used as the null value.
Definition at line 636 of file tree_model.hpp.
References NULL_TREE_IDX.
Referenced by CTreeModelNode< CPhyloNodeData >::ClearConnections(), CTreeModelNode< CPhyloNodeData >::HasParent(), and CTreeModelNode< CPhyloNodeData >::RemoveParent().
|
inline |
Return the value object for the node using de-referenceing semantics.
Definition at line 163 of file tree_model.hpp.
|
inline |
Definition at line 164 of file tree_model.hpp.
|
inline |
Definition at line 166 of file tree_model.hpp.
|
inline |
Definition at line 167 of file tree_model.hpp.
void CTreeModelNode< TData >::RemoveChild | ( | TTreeIdx | child_idx | ) |
Remove child node if it is a child of this node.
child_idx | index of child node to be removed |
Definition at line 653 of file tree_model.hpp.
Referenced by IPhyloTreeFilter::x_OnStep().
|
inline |
Set the parent index to Null() e.g. for root node.
Definition at line 85 of file tree_model.hpp.
|
inline |
Set index of nodes parent.
parent_idx | index of parent node in the array |
Definition at line 77 of file tree_model.hpp.
Referenced by CPhyloTreeDataSource::NewNode(), CPhyloTreeDataSource::ReRoot(), and IPhyloTreeFilter::x_OnStep().
|
inline |
Set the value-object for the node.
Definition at line 157 of file tree_model.hpp.
|
inline |
Return iterator to first subnode index.
Definition at line 133 of file tree_model.hpp.
|
inline |
Return const iterator to first subnode index.
Definition at line 130 of file tree_model.hpp.
Referenced by CPhyloTreeDataSource::MoveNode(), CPhyloTreeDataSource::NewNode(), CCalcRectangularTree::operator()(), CPhyloTreeDataSource::Remove(), CPhyloTree::x_CommonNodeSearch(), CPhyloTree::x_GetChildState(), CPhyloTree::x_PropagateCommonState(), CPhyloTree::x_SelectChildren(), and CPhyloTree::x_SelectParents().
|
inline |
Return iterator to end of subnode list.
Definition at line 139 of file tree_model.hpp.
|
inline |
Return const iterator to end of subnode list.
Definition at line 136 of file tree_model.hpp.
Referenced by CPhyloTreeDataSource::MoveNode(), CCalcRectangularTree::operator()(), CPhyloTreeDataSource::Remove(), CPhyloTree::x_CommonNodeSearch(), CTreeQueryExec::x_EvalAdvance(), CPhyloTree::x_GetChildState(), CPhyloTree::x_PropagateCommonState(), CPhyloTree::x_SelectChildren(), and CPhyloTree::x_SelectParents().
|
inline |
Return reverse iterator to (reverse) begin of subnode array.
Definition at line 145 of file tree_model.hpp.
|
inline |
Return const reverse iterator to (reverse) of begin of subnode array.
Definition at line 142 of file tree_model.hpp.
|
inline |
Return reverse iterator to (reverse) end of subnode array.
Definition at line 151 of file tree_model.hpp.
|
inline |
Return const reverse iterator to (reverse) end of subnode array.
Definition at line 148 of file tree_model.hpp.
|
protected |
Indices of all the children of this node.
Definition at line 173 of file tree_model.hpp.
Referenced by CTreeModelNode< CPhyloNodeData >::ClearConnections(), CTreeModelNode< CPhyloNodeData >::GetChildren(), CTreeModelNode< CPhyloNodeData >::IsLeaf(), CTreeModelNode< CPhyloNodeData >::SubNodeBegin(), CTreeModelNode< CPhyloNodeData >::SubNodeEnd(), CTreeModelNode< CPhyloNodeData >::SubNodeRBegin(), and CTreeModelNode< CPhyloNodeData >::SubNodeREnd().
|
protected |
Data object.
Definition at line 175 of file tree_model.hpp.
Referenced by CTreeModelNode< CPhyloNodeData >::GetValue(), CTreeModelNode< CPhyloNodeData >::operator*(), CTreeModelNode< CPhyloNodeData >::operator->(), and CTreeModelNode< CPhyloNodeData >::SetValue().
|
protected |
Index of parent node to this node. ==Null() if this is the root node.
Definition at line 171 of file tree_model.hpp.
Referenced by CTreeModelNode< CPhyloNodeData >::ClearConnections(), CTreeModelNode< CPhyloNodeData >::GetParent(), CTreeModelNode< CPhyloNodeData >::HasParent(), CTreeModelNode< CPhyloNodeData >::RemoveParent(), and CTreeModelNode< CPhyloNodeData >::SetParent().