diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2015-02-21 16:12:30 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2015-02-21 16:17:14 (GMT) |
commit | 080a465b1321ff93c05ce398cd18a577e0ebae4b (patch) | |
tree | 0bae20bf26007d2856f0460143125a31cff131b5 /src/dot.cpp | |
parent | 5bfda3d4c1158e5429349a2698339650dcfbbe88 (diff) | |
download | Doxygen-080a465b1321ff93c05ce398cd18a577e0ebae4b.zip Doxygen-080a465b1321ff93c05ce398cd18a577e0ebae4b.tar.gz Doxygen-080a465b1321ff93c05ce398cd18a577e0ebae4b.tar.bz2 |
Added type constraint relations for Java generics to dot graphs and XML output
Diffstat (limited to 'src/dot.cpp')
-rw-r--r-- | src/dot.cpp | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/src/dot.cpp b/src/dot.cpp index 1182e8d..cc81c44 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -164,7 +164,8 @@ static const char *normalEdgeColorMap[] = "firebrick4", // Private "darkorchid3", // "use" relation "grey75", // Undocumented - "orange" // template relation + "orange", // template relation + "orange" // type constraint }; static const char *normalArrowStyleMap[] = @@ -190,7 +191,8 @@ static const char *umlEdgeColorMap[] = "firebrick4", // Private "grey25", // "use" relation "grey75", // Undocumented - "orange" // template relation + "orange", // template relation + "orange" // type constraint }; static const char *umlArrowStyleMap[] = @@ -2003,6 +2005,7 @@ void DotNode::writeXML(FTextStream &t,bool isClassGraph) case EdgeInfo::Red: t << "private-inheritance"; break; case EdgeInfo::Purple: t << "usage"; break; case EdgeInfo::Orange: t << "template-instance"; break; + case EdgeInfo::Orange2: t << "type-constraint"; break; case EdgeInfo::Grey: ASSERT(0); break; } } @@ -2071,6 +2074,7 @@ void DotNode::writeDocbook(FTextStream &t,bool isClassGraph) case EdgeInfo::Red: t << "private-inheritance"; break; case EdgeInfo::Purple: t << "usage"; break; case EdgeInfo::Orange: t << "template-instance"; break; + case EdgeInfo::Orange2: t << "type-constraint"; break; case EdgeInfo::Grey: ASSERT(0); break; } } @@ -2148,6 +2152,7 @@ void DotNode::writeDEF(FTextStream &t) case EdgeInfo::Red: t << "private-inheritance"; break; case EdgeInfo::Purple: t << "usage"; break; case EdgeInfo::Orange: t << "template-instance"; break; + case EdgeInfo::Orange2: t << "type-constraint"; break; case EdgeInfo::Grey: ASSERT(0); break; } t << ';' << endl; @@ -2591,7 +2596,7 @@ void DotClassGraph::addClass(ClassDef *cd,DotNode *n,int prot, { if (Config_getBool("HIDE_UNDOC_CLASSES") && !cd->isLinkable()) return; - int edgeStyle = (label || prot==EdgeInfo::Orange) ? EdgeInfo::Dashed : EdgeInfo::Solid; + int edgeStyle = (label || prot==EdgeInfo::Orange || prot==EdgeInfo::Orange2) ? EdgeInfo::Dashed : EdgeInfo::Solid; QCString className; if (usedName) // name is a typedef { @@ -2797,6 +2802,7 @@ bool DotClassGraph::determineVisibleNodes(DotNode *rootNode, void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,bool base,int distance) { + static bool templateRelations = Config_getBool("TEMPLATE_RELATIONS"); //printf("DocClassGraph::buildGraph(%s,distance=%d,base=%d)\n", // cd->name().data(),distance,base); // ---- Add inheritance relations @@ -2856,10 +2862,43 @@ void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,bool base,int distance) } } } + if (templateRelations && base) + { + ConstraintClassDict *dict = cd->templateTypeConstraints(); + if (dict) + { + ConstraintClassDictIterator ccdi(*dict); + ConstraintClassDef *ccd; + for (;(ccd=ccdi.current());++ccdi) + { + QCString label; + QDictIterator<void> dvi(*ccd->accessors); + const char *s; + bool first=TRUE; + int count=0; + int maxLabels=10; + for (;(s=dvi.currentKey()) && count<maxLabels;++dvi,++count) + { + if (first) + { + label=s; + first=FALSE; + } + else + { + label+=QCString("\n")+s; + } + } + if (count==maxLabels) label+="\n..."; + //printf("addClass: %s templSpec=%s\n",ucd->classDef->name().data(),ucd->templSpecifiers.data()); + addClass(ccd->classDef,n,EdgeInfo::Orange2,label,0, + 0,TRUE,distance); + } + } + } // ---- Add template instantiation relations - static bool templateRelations = Config_getBool("TEMPLATE_RELATIONS"); if (templateRelations) { if (base) // template relations for base classes |