summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-05-28 19:05:40 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2019-05-28 19:05:40 (GMT)
commitc4cfeab03f71055a6fce5fbb86c6d116cb51b6cb (patch)
tree6f918a6a20fbc0d40975a78cbecfc632d2d538be
parent94a8f6cd0ae9b1faa8bab29f6611b2223230f39f (diff)
parent0e013c9df38e69e13547a2329398ee9e0b32af5b (diff)
downloadDoxygen-c4cfeab03f71055a6fce5fbb86c6d116cb51b6cb.zip
Doxygen-c4cfeab03f71055a6fce5fbb86c6d116cb51b6cb.tar.gz
Doxygen-c4cfeab03f71055a6fce5fbb86c6d116cb51b6cb.tar.bz2
Merge branch 'issue6960_d' of https://github.com/thomas-haller/doxygen into thomas-haller-issue6960_d
-rw-r--r--src/dot.cpp63
-rw-r--r--src/dot.h37
-rw-r--r--src/index.cpp1
-rw-r--r--testing/011/interface_integer.xml12
-rw-r--r--testing/027/struct_car.xml24
-rw-r--r--testing/027/struct_object.xml14
-rw-r--r--testing/027/struct_truck.xml24
-rw-r--r--testing/027/struct_vehicle.xml22
8 files changed, 81 insertions, 116 deletions
diff --git a/src/dot.cpp b/src/dot.cpp
index 101cbc6..1570abc 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -2515,7 +2515,7 @@ void DotGfxHierarchyTable::addHierarchy(DotNode *n,const ClassDef *cd,bool hideS
}
}
QCString tooltip = bClass->briefDescriptionAsTooltip();
- bn = new DotNode(m_curNodeNumber++,
+ bn = new DotNode(getNextNodeNumber(),
bClass->displayName(),
tooltip,
tmp_url.data()
@@ -2576,7 +2576,7 @@ void DotGfxHierarchyTable::addClassList(const ClassSDict *cl)
}
//printf("Inserting root class %s\n",cd->name().data());
QCString tooltip = cd->briefDescriptionAsTooltip();
- DotNode *n = new DotNode(m_curNodeNumber++,
+ DotNode *n = new DotNode(getNextNodeNumber(),
cd->displayName(),
tooltip,
tmp_url.data());
@@ -2596,7 +2596,6 @@ void DotGfxHierarchyTable::addClassList(const ClassSDict *cl)
DotGfxHierarchyTable::DotGfxHierarchyTable(const char *prefix,ClassDef::CompoundType ct)
: m_prefix(prefix)
, m_classType(ct)
- , m_curNodeNumber(1)
{
m_rootNodes = new QList<DotNode>;
m_usedNodes = new QDict<DotNode>(1009);
@@ -2726,7 +2725,7 @@ void DotClassGraph::addClass(const ClassDef *cd,DotNode *n,int prot,
}
}
QCString tooltip = cd->briefDescriptionAsTooltip();
- bn = new DotNode(m_curNodeNumber++,
+ bn = new DotNode(getNextNodeNumber(),
displayName,
tooltip,
tmp_url.data(),
@@ -3019,13 +3018,6 @@ void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int dista
}
}
-int DotClassGraph::m_curNodeNumber = 0;
-
-void DotClassGraph::resetNumbering()
-{
- m_curNodeNumber = 0;
-}
-
DotClassGraph::DotClassGraph(const ClassDef *cd,DotNode::GraphType t)
{
//printf("--------------- DotClassGraph::DotClassGraph `%s'\n",cd->displayName().data());
@@ -3041,7 +3033,7 @@ DotClassGraph::DotClassGraph(const ClassDef *cd,DotNode::GraphType t)
}
QCString className = cd->displayName();
QCString tooltip = cd->briefDescriptionAsTooltip();
- m_startNode = new DotNode(m_curNodeNumber++,
+ m_startNode = new DotNode(getNextNodeNumber(),
className,
tooltip,
tmp_url.data(),
@@ -3429,7 +3421,7 @@ void DotInclDepGraph::buildGraph(DotNode *n,const FileDef *fd,int distance)
tooltip = bfd->briefDescriptionAsTooltip();
}
bn = new DotNode(
- m_curNodeNumber++, // n
+ getNextNodeNumber(),// n
ii->includeName, // label
tooltip, // tip
tmp_url, // url
@@ -3497,13 +3489,6 @@ void DotInclDepGraph::determineTruncatedNodes(QList<DotNode> &queue)
}
}
-int DotInclDepGraph::m_curNodeNumber = 0;
-
-void DotInclDepGraph::resetNumbering()
-{
- m_curNodeNumber = 0;
-}
-
DotInclDepGraph::DotInclDepGraph(const FileDef *fd,bool inverse)
{
m_inverse = inverse;
@@ -3512,7 +3497,7 @@ DotInclDepGraph::DotInclDepGraph(const FileDef *fd,bool inverse)
m_inclByDepFileName = fd->includedByDependencyGraphFileName();
QCString tmp_url=fd->getReference()+"$"+fd->getOutputFileBase();
QCString tooltip = fd->briefDescriptionAsTooltip();
- m_startNode = new DotNode(m_curNodeNumber++,
+ m_startNode = new DotNode(getNextNodeNumber(),
fd->docName(),
tooltip,
tmp_url.data(),
@@ -3718,6 +3703,7 @@ void DotCallGraph::buildGraph(DotNode *n,const MemberDef *md,int distance)
MemberSDict *refs = m_inverse ? md->getReferencedByMembers() : md->getReferencesMembers();
if (refs)
{
+ refs->sort();
MemberSDict::Iterator mri(*refs);
MemberDef *rmd;
for (;(rmd=mri.current());++mri)
@@ -3748,7 +3734,7 @@ void DotCallGraph::buildGraph(DotNode *n,const MemberDef *md,int distance)
}
QCString tooltip = rmd->briefDescriptionAsTooltip();
bn = new DotNode(
- m_curNodeNumber++,
+ getNextNodeNumber(),
linkToText(rmd->getLanguage(),name,FALSE),
tooltip,
uniqueId,
@@ -3815,13 +3801,6 @@ void DotCallGraph::determineTruncatedNodes(QList<DotNode> &queue)
}
}
-int DotCallGraph::m_curNodeNumber = 0;
-
-void DotCallGraph::resetNumbering()
-{
- m_curNodeNumber = 0;
-}
-
DotCallGraph::DotCallGraph(const MemberDef *md,bool inverse)
{
m_inverse = inverse;
@@ -3840,7 +3819,7 @@ DotCallGraph::DotCallGraph(const MemberDef *md,bool inverse)
name = md->qualifiedName();
}
QCString tooltip = md->briefDescriptionAsTooltip();
- m_startNode = new DotNode(m_curNodeNumber++,
+ m_startNode = new DotNode(getNextNodeNumber(),
linkToText(md->getLanguage(),name,FALSE),
tooltip,
uniqueId.data(),
@@ -4355,19 +4334,12 @@ void writeDotImageMapFromFile(FTextStream &t,
//-------------------------------------------------------------
-int DotGroupCollaboration::m_curNodeNumber = 0;
-
-void DotGroupCollaboration::resetNumbering()
-{
- m_curNodeNumber = 0;
-}
-
DotGroupCollaboration::DotGroupCollaboration(const GroupDef* gd)
{
QCString tmp_url = gd->getReference()+"$"+gd->getOutputFileBase();
m_usedNodes = new QDict<DotNode>(1009);
QCString tooltip = gd->briefDescriptionAsTooltip();
- m_rootNode = new DotNode(m_curNodeNumber++, gd->groupTitle(), tooltip, tmp_url, TRUE );
+ m_rootNode = new DotNode(getNextNodeNumber(), gd->groupTitle(), tooltip, tmp_url, TRUE );
m_rootNode->markAsVisible();
m_usedNodes->insert(gd->name(), m_rootNode );
m_edges.setAutoDelete(TRUE);
@@ -4401,7 +4373,7 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd)
{ // add node
tmp_url = d->getReference()+"$"+d->getOutputFileBase();
QCString tooltip = d->briefDescriptionAsTooltip();
- nnode = new DotNode(m_curNodeNumber++, d->groupTitle(), tooltip, tmp_url );
+ nnode = new DotNode(getNextNodeNumber(), d->groupTitle(), tooltip, tmp_url );
nnode->markAsVisible();
m_usedNodes->insert(d->name(), nnode );
}
@@ -4422,7 +4394,7 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd)
{ // add node
tmp_url = def->getReference()+"$"+def->getOutputFileBase();
QCString tooltip = def->briefDescriptionAsTooltip();
- nnode = new DotNode(m_curNodeNumber++, def->groupTitle(), tooltip, tmp_url );
+ nnode = new DotNode(getNextNodeNumber(), def->groupTitle(), tooltip, tmp_url );
nnode->markAsVisible();
m_usedNodes->insert(def->name(), nnode );
}
@@ -4564,7 +4536,7 @@ void DotGroupCollaboration::addCollaborationMember(
{ // add node
tmp_str = d->getReference()+"$"+d->getOutputFileBase();
QCString tooltip = d->briefDescriptionAsTooltip();
- nnode = new DotNode(m_curNodeNumber++, d->groupTitle(), tooltip, tmp_str );
+ nnode = new DotNode(getNextNodeNumber(), d->groupTitle(), tooltip, tmp_str );
nnode->markAsVisible();
m_usedNodes->insert(d->name(), nnode );
}
@@ -4968,12 +4940,3 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
t << "}\n";
}
-
-void resetDotNodeNumbering()
-{
- DotClassGraph::resetNumbering();
- DotInclDepGraph::resetNumbering();
- DotCallGraph::resetNumbering();
- DotGroupCollaboration::resetNumbering();
-}
-
diff --git a/src/dot.h b/src/dot.h
index 7a2505e..69c2dde 100644
--- a/src/dot.h
+++ b/src/dot.h
@@ -153,8 +153,22 @@ class DotNodeList : public QList<DotNode>
int compareValues(const DotNode *n1,const DotNode *n2) const;
};
+/** A dot graph */
+class DotGraph
+{
+public:
+ DotGraph() : m_curNodeNumber(0) {}
+
+protected:
+ int getNextNodeNumber() { return ++m_curNodeNumber; }
+
+private:
+ int m_curNodeNumber;
+
+};
+
/** Represents a graphical class hierarchy */
-class DotGfxHierarchyTable
+class DotGfxHierarchyTable : public DotGraph
{
public:
DotGfxHierarchyTable(const char *prefix="",ClassDef::CompoundType ct=ClassDef::Class);
@@ -171,12 +185,11 @@ class DotGfxHierarchyTable
ClassDef::CompoundType m_classType;
QList<DotNode> *m_rootNodes;
QDict<DotNode> *m_usedNodes;
- int m_curNodeNumber;
DotNodeList *m_rootSubgraphs;
};
/** Representation of a class inheritance or dependency graph */
-class DotClassGraph
+class DotClassGraph : public DotGraph
{
public:
DotClassGraph(const ClassDef *cd,DotNode::GraphType t);
@@ -190,7 +203,6 @@ class DotClassGraph
void writeXML(FTextStream &t);
void writeDocbook(FTextStream &t);
void writeDEF(FTextStream &t);
- static void resetNumbering();
private:
void buildGraph(const ClassDef *cd,DotNode *n,bool base,int distance);
@@ -202,7 +214,6 @@ class DotClassGraph
DotNode * m_startNode;
QDict<DotNode> * m_usedNodes;
- static int m_curNodeNumber;
DotNode::GraphType m_graphType;
QCString m_collabFileName;
QCString m_inheritFileName;
@@ -210,7 +221,7 @@ class DotClassGraph
};
/** Representation of an include dependency graph */
-class DotInclDepGraph
+class DotInclDepGraph : public DotGraph
{
public:
DotInclDepGraph(const FileDef *fd,bool inverse);
@@ -223,7 +234,6 @@ class DotInclDepGraph
QCString diskName() const;
void writeXML(FTextStream &t);
void writeDocbook(FTextStream &t);
- static void resetNumbering();
private:
void buildGraph(DotNode *n,const FileDef *fd,int distance);
@@ -232,14 +242,13 @@ class DotInclDepGraph
DotNode *m_startNode;
QDict<DotNode> *m_usedNodes;
- static int m_curNodeNumber;
QCString m_inclDepFileName;
QCString m_inclByDepFileName;
bool m_inverse;
};
/** Representation of an call graph */
-class DotCallGraph
+class DotCallGraph : public DotGraph
{
public:
DotCallGraph(const MemberDef *md,bool inverse);
@@ -253,11 +262,9 @@ class DotCallGraph
bool isTooBig() const;
void determineVisibleNodes(QList<DotNode> &queue, int &maxNodes);
void determineTruncatedNodes(QList<DotNode> &queue);
- static void resetNumbering();
private:
DotNode *m_startNode;
- static int m_curNodeNumber;
QDict<DotNode> *m_usedNodes;
bool m_inverse;
QCString m_diskName;
@@ -265,7 +272,7 @@ class DotCallGraph
};
/** Representation of an directory dependency graph */
-class DotDirDeps
+class DotDirDeps : public DotGraph
{
public:
DotDirDeps(const DirDef *dir);
@@ -285,7 +292,7 @@ class DotDirDeps
};
/** Representation of a group collaboration graph */
-class DotGroupCollaboration
+class DotGroupCollaboration : public DotGraph
{
public :
enum EdgeType
@@ -328,7 +335,6 @@ class DotGroupCollaboration
bool writeImageMap=TRUE,int graphId=-1) const;
void buildGraph(const GroupDef* gd);
bool isTrivial() const;
- static void resetNumbering();
private :
void addCollaborationMember(const Definition* def, QCString& url, EdgeType eType );
@@ -338,7 +344,6 @@ class DotGroupCollaboration
const QCString& _label, const QCString& _url );
DotNode *m_rootNode;
- static int m_curNodeNumber;
QDict<DotNode> *m_usedNodes;
QCString m_diskName;
QList<Edge> m_edges;
@@ -518,6 +523,4 @@ void writeDotImageMapFromFile(FTextStream &t,
const QCString& relPath,const QCString& baseName,
const QCString& context,int graphId=-1);
-void resetDotNodeNumbering();
-
#endif
diff --git a/src/index.cpp b/src/index.cpp
index 744976d..a577d9a 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -285,7 +285,6 @@ void startFile(OutputList &ol,const char *name,const char *manName,
}
ol.writeSplitBar(altSidebarName ? altSidebarName : name);
ol.writeSearchInfo();
- resetDotNodeNumbering();
}
void endFile(OutputList &ol,bool skipNavIndex,bool skipEndContents,
diff --git a/testing/011/interface_integer.xml b/testing/011/interface_integer.xml
index 863ec91..21d71fd 100644
--- a/testing/011/interface_integer.xml
+++ b/testing/011/interface_integer.xml
@@ -59,24 +59,24 @@
<para>An interface </para>
</detaileddescription>
<inheritancegraph>
- <node id="1">
+ <node id="2">
<label>Object</label>
</node>
- <node id="0">
+ <node id="1">
<label>Integer</label>
<link refid="interface_integer"/>
- <childnode refid="1" relation="public-inheritance">
+ <childnode refid="2" relation="public-inheritance">
</childnode>
</node>
</inheritancegraph>
<collaborationgraph>
- <node id="3">
+ <node id="2">
<label>Object</label>
</node>
- <node id="2">
+ <node id="1">
<label>Integer</label>
<link refid="interface_integer"/>
- <childnode refid="3" relation="public-inheritance">
+ <childnode refid="2" relation="public-inheritance">
</childnode>
</node>
</collaborationgraph>
diff --git a/testing/027/struct_car.xml b/testing/027/struct_car.xml
index 61a8d16..b3d9894 100644
--- a/testing/027/struct_car.xml
+++ b/testing/027/struct_car.xml
@@ -27,43 +27,43 @@
<para><ref refid="struct_car" kindref="compound">Car</ref> class. </para>
</detaileddescription>
<inheritancegraph>
- <node id="1">
+ <node id="2">
<label>Vehicle</label>
<link refid="struct_vehicle"/>
- <childnode refid="2" relation="public-inheritance">
+ <childnode refid="3" relation="public-inheritance">
</childnode>
</node>
- <node id="2">
+ <node id="3">
<label>Object</label>
<link refid="struct_object"/>
</node>
- <node id="0">
+ <node id="1">
<label>Car</label>
<link refid="struct_car"/>
- <childnode refid="1" relation="public-inheritance">
+ <childnode refid="2" relation="public-inheritance">
</childnode>
</node>
</inheritancegraph>
<collaborationgraph>
- <node id="4">
+ <node id="2">
<label>Vehicle</label>
<link refid="struct_vehicle"/>
- <childnode refid="5" relation="public-inheritance">
+ <childnode refid="3" relation="public-inheritance">
</childnode>
- <childnode refid="5" relation="usage">
+ <childnode refid="3" relation="usage">
<edgelabel>base</edgelabel>
</childnode>
</node>
- <node id="5">
+ <node id="3">
<label>Object</label>
<link refid="struct_object"/>
</node>
- <node id="3">
+ <node id="1">
<label>Car</label>
<link refid="struct_car"/>
- <childnode refid="4" relation="public-inheritance">
+ <childnode refid="2" relation="public-inheritance">
</childnode>
- <childnode refid="4" relation="usage">
+ <childnode refid="2" relation="usage">
<edgelabel>base</edgelabel>
</childnode>
</node>
diff --git a/testing/027/struct_object.xml b/testing/027/struct_object.xml
index 18b34ef..754906e 100644
--- a/testing/027/struct_object.xml
+++ b/testing/027/struct_object.xml
@@ -63,26 +63,26 @@
<para>Base object class. </para>
</detaileddescription>
<inheritancegraph>
- <node id="9">
+ <node id="4">
<label>Truck</label>
<link refid="struct_truck"/>
- <childnode refid="7" relation="public-inheritance">
+ <childnode refid="2" relation="public-inheritance">
</childnode>
</node>
- <node id="7">
+ <node id="2">
<label>Vehicle</label>
<link refid="struct_vehicle"/>
- <childnode refid="6" relation="public-inheritance">
+ <childnode refid="1" relation="public-inheritance">
</childnode>
</node>
- <node id="6">
+ <node id="1">
<label>Object</label>
<link refid="struct_object"/>
</node>
- <node id="8">
+ <node id="3">
<label>Car</label>
<link refid="struct_car"/>
- <childnode refid="7" relation="public-inheritance">
+ <childnode refid="2" relation="public-inheritance">
</childnode>
</node>
</inheritancegraph>
diff --git a/testing/027/struct_truck.xml b/testing/027/struct_truck.xml
index 92877e3..0da26dc 100644
--- a/testing/027/struct_truck.xml
+++ b/testing/027/struct_truck.xml
@@ -27,43 +27,43 @@
<para><ref refid="struct_truck" kindref="compound">Truck</ref> class. </para>
</detaileddescription>
<inheritancegraph>
- <node id="11">
+ <node id="1">
<label>Truck</label>
<link refid="struct_truck"/>
- <childnode refid="12" relation="public-inheritance">
+ <childnode refid="2" relation="public-inheritance">
</childnode>
</node>
- <node id="12">
+ <node id="2">
<label>Vehicle</label>
<link refid="struct_vehicle"/>
- <childnode refid="13" relation="public-inheritance">
+ <childnode refid="3" relation="public-inheritance">
</childnode>
</node>
- <node id="13">
+ <node id="3">
<label>Object</label>
<link refid="struct_object"/>
</node>
</inheritancegraph>
<collaborationgraph>
- <node id="14">
+ <node id="1">
<label>Truck</label>
<link refid="struct_truck"/>
- <childnode refid="15" relation="public-inheritance">
+ <childnode refid="2" relation="public-inheritance">
</childnode>
- <childnode refid="15" relation="usage">
+ <childnode refid="2" relation="usage">
<edgelabel>base</edgelabel>
</childnode>
</node>
- <node id="15">
+ <node id="2">
<label>Vehicle</label>
<link refid="struct_vehicle"/>
- <childnode refid="16" relation="public-inheritance">
+ <childnode refid="3" relation="public-inheritance">
</childnode>
- <childnode refid="16" relation="usage">
+ <childnode refid="3" relation="usage">
<edgelabel>base</edgelabel>
</childnode>
</node>
- <node id="16">
+ <node id="3">
<label>Object</label>
<link refid="struct_object"/>
</node>
diff --git a/testing/027/struct_vehicle.xml b/testing/027/struct_vehicle.xml
index 3fc2456..40c2be2 100644
--- a/testing/027/struct_vehicle.xml
+++ b/testing/027/struct_vehicle.xml
@@ -67,40 +67,40 @@
<para><ref refid="struct_vehicle" kindref="compound">Vehicle</ref> class. </para>
</detaileddescription>
<inheritancegraph>
- <node id="20">
+ <node id="4">
<label>Truck</label>
<link refid="struct_truck"/>
- <childnode refid="17" relation="public-inheritance">
+ <childnode refid="1" relation="public-inheritance">
</childnode>
</node>
- <node id="17">
+ <node id="1">
<label>Vehicle</label>
<link refid="struct_vehicle"/>
- <childnode refid="18" relation="public-inheritance">
+ <childnode refid="2" relation="public-inheritance">
</childnode>
</node>
- <node id="18">
+ <node id="2">
<label>Object</label>
<link refid="struct_object"/>
</node>
- <node id="19">
+ <node id="3">
<label>Car</label>
<link refid="struct_car"/>
- <childnode refid="17" relation="public-inheritance">
+ <childnode refid="1" relation="public-inheritance">
</childnode>
</node>
</inheritancegraph>
<collaborationgraph>
- <node id="21">
+ <node id="1">
<label>Vehicle</label>
<link refid="struct_vehicle"/>
- <childnode refid="22" relation="public-inheritance">
+ <childnode refid="2" relation="public-inheritance">
</childnode>
- <childnode refid="22" relation="usage">
+ <childnode refid="2" relation="usage">
<edgelabel>base</edgelabel>
</childnode>
</node>
- <node id="22">
+ <node id="2">
<label>Object</label>
<link refid="struct_object"/>
</node>