diff options
author | Thomas Haller <thomas.haller@redheads.de> | 2019-05-23 10:10:37 (GMT) |
---|---|---|
committer | Thomas Haller <thomas.haller@redheads.de> | 2019-05-23 10:10:37 (GMT) |
commit | 8bc1af8e715a9841d3754ec4154d4adeb7b8c1b0 (patch) | |
tree | 15cd0b042f3d729c0a86d4c304b65e1b5341e48f /src | |
parent | 5c9d812083af06c9e683c9ff2e32f5839066863c (diff) | |
download | Doxygen-8bc1af8e715a9841d3754ec4154d4adeb7b8c1b0.zip Doxygen-8bc1af8e715a9841d3754ec4154d4adeb7b8c1b0.tar.gz Doxygen-8bc1af8e715a9841d3754ec4154d4adeb7b8c1b0.tar.bz2 |
changed numbering of dot nodes to prevent different contents being generated for the same .dot file
Diffstat (limited to 'src')
-rw-r--r-- | src/dot.cpp | 63 | ||||
-rw-r--r-- | src/dot.h | 37 | ||||
-rw-r--r-- | src/index.cpp | 1 |
3 files changed, 33 insertions, 68 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(); -} - @@ -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, |