logic: removed namespace splitting from GraphController
Namespace splitting is now handled in active token id retrieval from the Storage, so that namespace nodes are not added to the Graph at all and complexity in the GraphController is reduced.
This commit is contained in:
@@ -54,6 +54,21 @@ void HierarchyCache::HierarchyNode::addChildIdsRecursive(std::vector<Id>* nodeId
|
||||
}
|
||||
}
|
||||
|
||||
void HierarchyCache::HierarchyNode::addVisibleNodeIdsRecursive(std::vector<Id>* nodeIds) const
|
||||
{
|
||||
if (isVisible())
|
||||
{
|
||||
nodeIds->push_back(getNodeId());
|
||||
}
|
||||
else
|
||||
{
|
||||
for (const HierarchyNode* child : m_children)
|
||||
{
|
||||
child->addVisibleNodeIdsRecursive(nodeIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool HierarchyCache::HierarchyNode::isVisible() const
|
||||
{
|
||||
return m_isVisible;
|
||||
@@ -65,7 +80,6 @@ void HierarchyCache::HierarchyNode::setIsVisible(bool isVisible)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void HierarchyCache::clear()
|
||||
{
|
||||
m_nodes.clear();
|
||||
@@ -108,6 +122,19 @@ void HierarchyCache::addAllChildIdsForNodeId(Id nodeId, std::vector<Id>* nodeIds
|
||||
}
|
||||
}
|
||||
|
||||
void HierarchyCache::addFirstVisibleChildIdsForNodeId(Id nodeId, std::vector<Id>* nodeIds) const
|
||||
{
|
||||
HierarchyNode* node = getNode(nodeId);
|
||||
if (node)
|
||||
{
|
||||
node->addVisibleNodeIdsRecursive(nodeIds);
|
||||
}
|
||||
else
|
||||
{
|
||||
nodeIds->push_back(nodeId);
|
||||
}
|
||||
}
|
||||
|
||||
HierarchyCache::HierarchyNode* HierarchyCache::getNode(Id nodeId) const
|
||||
{
|
||||
std::map<Id, std::shared_ptr<HierarchyNode>>::const_iterator it = m_nodes.find(nodeId);
|
||||
|
||||
Reference in New Issue
Block a user