summaryrefslogtreecommitdiffstats
path: root/src/dotcallgraph.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-10-19 18:44:40 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-10-20 11:51:24 (GMT)
commitd03e8d9411ab3e983fc3413c147fba1a5e5c9dad (patch)
treed834ff826fdf72e526b3bac2772006583535766c /src/dotcallgraph.cpp
parent33b0f4d25dff25b0e50d62eff68155106e88d58d (diff)
downloadDoxygen-d03e8d9411ab3e983fc3413c147fba1a5e5c9dad.zip
Doxygen-d03e8d9411ab3e983fc3413c147fba1a5e5c9dad.tar.gz
Doxygen-d03e8d9411ab3e983fc3413c147fba1a5e5c9dad.tar.bz2
Refactoring: modernize TooltipManager class and source reference lists
- Tooltips are now collected per file instead of globally - Source reference lists now use STL containers
Diffstat (limited to 'src/dotcallgraph.cpp')
-rw-r--r--src/dotcallgraph.cpp66
1 files changed, 30 insertions, 36 deletions
diff --git a/src/dotcallgraph.cpp b/src/dotcallgraph.cpp
index 5e13f8e..ef89627 100644
--- a/src/dotcallgraph.cpp
+++ b/src/dotcallgraph.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
*
-* Copyright (C) 1997-2019 by Dimitri van Heesch.
+* Copyright (C) 1997-2020 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
@@ -34,51 +34,45 @@ static QCString getUniqueId(const MemberDef *md)
void DotCallGraph::buildGraph(DotNode *n,const MemberDef *md,int distance)
{
- MemberSDict *refs = m_inverse ? md->getReferencedByMembers() : md->getReferencesMembers();
- if (refs)
+ auto refs = m_inverse ? md->getReferencedByMembers() : md->getReferencesMembers();
+ for (const auto &rmd : refs)
{
- refs->sort();
- MemberSDict::Iterator mri(*refs);
- MemberDef *rmd;
- for (;(rmd=mri.current());++mri)
+ if (rmd->showInCallGraph())
{
- if (rmd->showInCallGraph())
+ QCString uniqueId = getUniqueId(rmd);
+ DotNode *bn = m_usedNodes->find(uniqueId);
+ if (bn) // file is already a node in the graph
{
- QCString uniqueId = getUniqueId(rmd);
- DotNode *bn = m_usedNodes->find(uniqueId);
- if (bn) // file is already a node in the graph
+ n->addChild(bn,0,0,0);
+ bn->addParent(n);
+ bn->setDistance(distance);
+ }
+ else
+ {
+ QCString name;
+ if (HIDE_SCOPE_NAMES)
{
- n->addChild(bn,0,0,0);
- bn->addParent(n);
- bn->setDistance(distance);
+ name = rmd->getOuterScope()==m_scope ?
+ rmd->name() : rmd->qualifiedName();
}
else
{
- QCString name;
- if (HIDE_SCOPE_NAMES)
- {
- name = rmd->getOuterScope()==m_scope ?
- rmd->name() : rmd->qualifiedName();
- }
- else
- {
- name = rmd->qualifiedName();
- }
- QCString tooltip = rmd->briefDescriptionAsTooltip();
- bn = new DotNode(
+ name = rmd->qualifiedName();
+ }
+ QCString tooltip = rmd->briefDescriptionAsTooltip();
+ bn = new DotNode(
getNextNodeNumber(),
linkToText(rmd->getLanguage(),name,FALSE),
tooltip,
uniqueId,
0 //distance
- );
- n->addChild(bn,0,0,0);
- bn->addParent(n);
- bn->setDistance(distance);
- m_usedNodes->insert(uniqueId,bn);
+ );
+ n->addChild(bn,0,0,0);
+ bn->addParent(n);
+ bn->setDistance(distance);
+ m_usedNodes->insert(uniqueId,bn);
- buildGraph(bn,rmd,distance+1);
- }
+ buildGraph(bn,rmd,distance+1);
}
}
}
@@ -121,9 +115,9 @@ void DotCallGraph::determineTruncatedNodes(QList<DotNode> &queue)
const DotNode *dn;
for (li.toFirst();(dn=li.current());++li)
{
- if (!dn->isVisible())
+ if (!dn->isVisible())
truncated = TRUE;
- else
+ else
queue.append(dn);
}
}
@@ -198,7 +192,7 @@ QCString DotCallGraph::getMapLabel() const
}
QCString DotCallGraph::writeGraph(
- FTextStream &out,
+ FTextStream &out,
GraphOutputFormat graphFormat,
EmbeddedOutputFormat textFormat,
const char *path,