41 className=
"anonymous:";
45 else if (!usedName.
empty())
50 else if (!templSpec.
empty())
58 fullName = cd->
name();
68 n->
addChild(bn,color,edgeStyle,label);
73 bn->
addChild(n,color,edgeStyle,label);
102 n->
addChild(bn,color,edgeStyle,label);
107 bn->
addChild(n,color,edgeStyle,label);
121 while (!queue.empty())
127 bool truncated =
false;
128 for (
const auto &dn : n->
children())
130 if (!dn->isVisible())
137 for (
const auto &dn : n->
parents())
139 if (!dn->isVisible())
151 int maxNodes,
bool includeParents)
155 std::vector<size_t> childTreeWidth;
156 std::vector<size_t> parentTreeWidth;
157 childQueue.push_back(rootNode);
158 if (includeParents) parentQueue.push_back(rootNode);
161 while ((!childQueue.empty() || !parentQueue.empty()) && maxNodes>0)
163 if (!childQueue.empty())
165 DotNode *n = childQueue.front();
166 childQueue.pop_front();
172 size_t oldSize=childTreeWidth.size();
173 if (distance>oldSize)
175 childTreeWidth.resize(std::max(childTreeWidth.size(),distance));
176 for (
size_t i=oldSize;i<distance;i++) childTreeWidth[i]=0;
183 for (
const auto &dn : n->
children())
185 childQueue.push_back(dn);
189 if (includeParents && !parentQueue.empty())
191 DotNode *n = parentQueue.front();
192 parentQueue.pop_front();
199 size_t oldSize = parentTreeWidth.size();
200 if (distance>oldSize)
202 parentTreeWidth.resize(std::max(parentTreeWidth.size(),distance));
203 for (
size_t i=oldSize;i<distance;i++) parentTreeWidth[i]=0;
210 for (
const auto &dn : n->
parents())
212 parentQueue.push_back(dn);
219 size_t maxHeight=std::max(childTreeWidth.size(),parentTreeWidth.size());
220 for (
size_t i=0;i<childTreeWidth.size();i++)
222 if (childTreeWidth.at(i)>maxWidth) maxWidth=childTreeWidth.at(i);
224 for (
size_t i=0;i<parentTreeWidth.size();i++)
226 if (parentTreeWidth.at(i)>maxWidth) maxWidth=parentTreeWidth.at(i);
229 return maxWidth>80 && maxHeight<12;
240 auto it = std::begin(ss), e = std::end(ss);
244 for (; it!=e && (maxLabels==0 || count<maxLabels) ; ++it,++count)
249 if (maxLabels!=0 && count==maxLabels)
278 for (
const auto &ucd : list)
282 ucd.templSpecifiers,base,distance);
331 tmp_url+=
"#"+cd->
anchor();
427 mapName=
"inherit_map";
442 return "Collaboration graph";
445 return "Inheritance graph";
461 bool generateImageMap,
466 return DotGraph::writeGraph(out, graphFormat, textFormat, path, fileName, relPath, generateImageMap, graphId);
475 node->writeXML(t,
true);
483 node->writeDocbook(t,
true);
A abstract class representing of a compound symbol.
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
virtual DString inheritanceGraphFileName() const =0
returns the file name to use for the inheritance graph
virtual const TemplateInstanceList & getTemplateInstances() const =0
Returns a sorted dictionary with all template instances found for this template class.
virtual const UsesClassList & usedImplementationClasses() const =0
virtual DString collaborationGraphFileName() const =0
returns the file name to use for the collaboration graph
virtual const ConstraintClassList & templateTypeConstraints() const =0
virtual const UsesClassList & usedByImplementationClasses() const =0
virtual const ClassDef * templateMaster() const =0
Returns the template master of which this class is an instance.
virtual const BaseClassList & subClasses() const =0
Returns the list of sub classes that directly derive from this class.
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
const std::string & str() const
size_t length() const
Returns the length of the string, not counting the 0-terminator.
virtual bool isLinkable() const =0
virtual const DString & name() const =0
virtual DString briefDescriptionAsTooltip() const =0
virtual bool isAnonymous() const =0
virtual DString displayName(bool includeScope=true) const =0
virtual bool isHidden() const =0
virtual DString anchor() const =0
virtual DString getReference() const =0
virtual DString getOutputFileBase() const =0
void writeDocbook(TextStream &t)
void writeXML(TextStream &t)
DotClassGraph(const ClassDef *cd, GraphType t)
bool determineVisibleNodes(DotNode *rootNode, int maxNodes, bool includeParents)
DString getBaseName() const override
~DotClassGraph() override
void computeTheGraph() override
DString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const DString &path, const DString &fileName, const DString &relPath, bool TBRank=true, bool imageMap=true, int graphId=-1)
void determineTruncatedNodes(DotNodeDeque &queue, bool includeParents)
DString m_inheritFileName
DString getImgAltText() const override
void writeDEF(TextStream &t)
void addClass(const ClassDef *cd, DotNode *n, EdgeInfo::Colors color, const DString &label, const DString &usedName, const DString &templSpec, bool base, int distance)
void buildGraph(const ClassDef *cd, DotNode *n, bool base, int distance)
DString getMapLabel() const override
static void computeGraph(DotNode *root, GraphType gt, GraphOutputFormat format, const DString &rank, bool renderParents, bool backArrows, const DString &title, DString &graphStr)
GraphOutputFormat m_graphFormat
bool m_doNotAddImageToIndex
DString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const DString &path, const DString &fileName, const DString &relPath, bool writeImageMap=true, int graphId=-1)
void setDistance(int distance)
void markAsVisible(bool b=true)
static void deleteNodes(DotNode *node)
void addParent(DotNode *n)
void addChild(DotNode *n, EdgeInfo::Colors edgeColor=EdgeInfo::Purple, EdgeInfo::Styles edgeStyle=EdgeInfo::Solid, const DString &edgeLab=DString(), const DString &edgeURL=DString(), int edgeLabColor=-1)
DotNode & markAsTruncated(bool b=true)
const DotNodeRefVector & parents() const
const DotNodeRefVector & children() const
TruncState isTruncated() const
static constexpr Colors protectionToColor(Protection prot)
Text streaming class that buffers data.
#define Config_getInt(name)
#define Config_getBool(name)
std::set< std::string > StringSet
static DString joinLabels(const StringSet &ss)
DString insertTemplateSpecifierInScope(const DString &scope, const DString &templ)
DString stripScope(const DString &name)
DString escapeCharsInString(const DString &name, bool allowDots, bool allowUnderscore)
A bunch of utility functions.