summaryrefslogtreecommitdiffstats
path: root/src/dirdef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dirdef.cpp')
-rw-r--r--src/dirdef.cpp140
1 files changed, 1 insertions, 139 deletions
diff --git a/src/dirdef.cpp b/src/dirdef.cpp
index 415a2fa..9107627 100644
--- a/src/dirdef.cpp
+++ b/src/dirdef.cpp
@@ -558,145 +558,7 @@ DirDef *DirDef::mergeDirectoryInTree(const QCString &path)
void DirDef::writeDepGraph(QTextStream &t)
{
- t << "digraph G {\n";
- if (Config_getBool("DOT_TRANSPARENT"))
- {
- t << " bgcolor=transparent;\n";
- }
- t << " compound=true\n";
- t << " node [ fontsize=10, fontname=\"FreeSans.ttf\"];\n";
- t << " edge [ labelfontsize=9, labelfontname=\"FreeSans.ttf\"];\n";
-
- QDict<DirDef> dirsInGraph(257);
-
- dirsInGraph.insert(getOutputFileBase(),this);
- if (parent())
- {
- t << " subgraph cluster" << parent()->getOutputFileBase() << " {\n";
- t << " graph [ bgcolor=\"#ddddee\", pencolor=\"black\", label=\""
- << parent()->shortName()
- << "\" fontname=\"FreeSans.ttf\", fontsize=10, URL=\"";
- t << parent()->getOutputFileBase() << Doxygen::htmlFileExtension;
- t << "\"]\n";
- }
- if (isCluster())
- {
- t << " subgraph cluster" << getOutputFileBase() << " {\n";
- t << " graph [ bgcolor=\"#eeeeff\", pencolor=\"black\", label=\"\""
- << " URL=\"" << getOutputFileBase() << Doxygen::htmlFileExtension
- << "\"];\n";
- t << " " << getOutputFileBase() << " [shape=plaintext label=\""
- << shortName() << "\"];\n";
-
- // add nodes for sub directories
- QListIterator<DirDef> sdi(m_subdirs);
- DirDef *sdir;
- for (sdi.toFirst();(sdir=sdi.current());++sdi)
- {
- t << " " << sdir->getOutputFileBase() << " [shape=box label=\""
- << sdir->shortName() << "\"";
- if (sdir->isCluster())
- {
- t << " color=\"red\"";
- }
- else
- {
- t << " color=\"black\"";
- }
- t << " fillcolor=\"white\" style=\"filled\"";
- t << " URL=\"" << sdir->getOutputFileBase()
- << Doxygen::htmlFileExtension << "\"";
- t << "];\n";
- dirsInGraph.insert(sdir->getOutputFileBase(),sdir);
- }
- t << " }\n";
- }
- else
- {
- t << " " << getOutputFileBase() << " [shape=box, label=\""
- << shortName() << "\", style=\"filled\", fillcolor=\"#eeeeff\","
- << " pencolor=\"black\", URL=\"" << getOutputFileBase()
- << Doxygen::htmlFileExtension << "\"];\n";
- }
- if (parent())
- {
- t << " }\n";
- }
-
- // add nodes for other used directories
- QDictIterator<UsedDir> udi(*m_usedDirs);
- UsedDir *udir;
- //printf("*** For dir %s\n",shortName().data());
- for (udi.toFirst();(udir=udi.current());++udi)
- // for each used dir (=directly used or a parent of a directly used dir)
- {
- const DirDef *usedDir=udir->dir();
- DirDef *dir=this;
- while (dir)
- {
- //printf("*** check relation %s->%s same_parent=%d !%s->isParentOf(%s)=%d\n",
- // dir->shortName().data(),usedDir->shortName().data(),
- // dir->parent()==usedDir->parent(),
- // usedDir->shortName().data(),
- // shortName().data(),
- // !usedDir->isParentOf(this)
- // );
- if (dir!=usedDir && dir->parent()==usedDir->parent() && !usedDir->isParentOf(this))
- // include if both have the same parent (or no parent)
- {
- t << " " << usedDir->getOutputFileBase() << " [shape=box label=\""
- << usedDir->shortName() << "\"";
- if (usedDir->isCluster())
- {
- if (!Config_getBool("DOT_TRANSPARENT"))
- {
- t << " fillcolor=\"white\" style=\"filled\"";
- }
- t << " color=\"red\"";
- }
- t << " URL=\"" << usedDir->getOutputFileBase()
- << Doxygen::htmlFileExtension << "\"];\n";
- dirsInGraph.insert(usedDir->getOutputFileBase(),usedDir);
- break;
- }
- dir=dir->parent();
- }
- }
-
- // add relations between all selected directories
- DirDef *dir;
- QDictIterator<DirDef> di(dirsInGraph);
- for (di.toFirst();(dir=di.current());++di) // foreach dir in the graph
- {
- QDictIterator<UsedDir> udi(*dir->usedDirs());
- UsedDir *udir;
- for (udi.toFirst();(udir=udi.current());++udi) // foreach used dir
- {
- const DirDef *usedDir=udir->dir();
- if ((dir!=this || !udir->inherited()) && // only show direct dependendies for this dir
- (usedDir!=this || !udir->inherited()) && // only show direct dependendies for this dir
- !usedDir->isParentOf(dir) && // don't point to own parent
- dirsInGraph.find(usedDir->getOutputFileBase())) // only point to nodes that are in the graph
- {
- QCString relationName;
- relationName.sprintf("dir_%06d_%06d",dir->m_dirCount,usedDir->m_dirCount);
- if (Doxygen::dirRelations.find(relationName)==0)
- {
- // new relation
- Doxygen::dirRelations.append(relationName,
- new DirRelation(relationName,dir,udir));
- }
- int nrefs = udir->filePairs().count();
- t << " " << dir->getOutputFileBase() << "->"
- << usedDir->getOutputFileBase();
- t << " [headlabel=\"" << nrefs << "\", labeldistance=1.5";
- t << " headhref=\"" << relationName << Doxygen::htmlFileExtension
- << "\"];\n";
- }
- }
- }
-
- t << "}\n";
+ writeDotDirDepGraph(t,this);
}
//----------------------------------------------------------------------