36 className=
"anonymous:";
53 fullName = cd->
name();
63 n->
addChild(bn,color,edgeStyle,label);
68 bn->
addChild(n,color,edgeStyle,label);
76 QCString displayName=className;
97 n->
addChild(bn,color,edgeStyle,label);
102 bn->
addChild(n,color,edgeStyle,label);
116 while (!queue.empty())
122 bool truncated =
FALSE;
123 for (
const auto &dn : n->
children())
125 if (!dn->isVisible())
132 for (
const auto &dn : n->
parents())
134 if (!dn->isVisible())
146 int maxNodes,
bool includeParents)
148 DotNodeDeque childQueue;
149 DotNodeDeque parentQueue;
150 std::vector<size_t> childTreeWidth;
151 std::vector<size_t> parentTreeWidth;
152 childQueue.push_back(rootNode);
153 if (includeParents) parentQueue.push_back(rootNode);
156 while ((!childQueue.empty() || !parentQueue.empty()) && maxNodes>0)
158 if (!childQueue.empty())
160 DotNode *n = childQueue.front();
161 childQueue.pop_front();
167 size_t oldSize=childTreeWidth.size();
168 if (distance>oldSize)
170 childTreeWidth.resize(std::max(childTreeWidth.size(),distance));
171 for (
size_t i=oldSize;i<distance;i++) childTreeWidth[i]=0;
178 for (
const auto &dn : n->
children())
180 childQueue.push_back(dn);
184 if (includeParents && !parentQueue.empty())
186 DotNode *n = parentQueue.front();
187 parentQueue.pop_front();
194 size_t oldSize = parentTreeWidth.size();
195 if (distance>oldSize)
197 parentTreeWidth.resize(std::max(parentTreeWidth.size(),distance));
198 for (
size_t i=oldSize;i<distance;i++) parentTreeWidth[i]=0;
205 for (
const auto &dn : n->
parents())
207 parentQueue.push_back(dn);
214 size_t maxHeight=std::max(childTreeWidth.size(),parentTreeWidth.size());
215 for (
size_t i=0;i<childTreeWidth.size();i++)
217 if (childTreeWidth.at(i)>maxWidth) maxWidth=childTreeWidth.at(i);
219 for (
size_t i=0;i<parentTreeWidth.size();i++)
221 if (parentTreeWidth.at(i)>maxWidth) maxWidth=parentTreeWidth.at(i);
224 return maxWidth>80 && maxHeight<12;
235 auto it = std::begin(ss), e = std::end(ss);
238 label += (*it++).c_str();
239 for (; it!=e && count < maxLabels ; ++it,++count)
242 label += (*it).c_str();
244 if (count==maxLabels) label+=
"\n...";
270 for (
const auto &ucd : list)
274 ucd.templSpecifiers,base,distance);
283 QCString(),
TRUE,distance);
323 tmp_url+=
"#"+cd->
anchor();
342 DotNodeDeque openNodeQueue;
419 mapName=
"inherit_map";
434 return "Collaboration graph";
437 return "Inheritance graph";
453 bool generateImageMap,
456 return DotGraph::writeGraph(out, graphFormat, textFormat, path, fileName, relPath, generateImageMap, graphId);
465 node->writeXML(t,
TRUE);
473 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 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 QCString inheritanceGraphFileName() const =0
returns the file name to use for the inheritance graph
virtual QCString 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.
virtual bool isLinkable() const =0
virtual QCString anchor() const =0
virtual QCString briefDescriptionAsTooltip() const =0
virtual bool isAnonymous() const =0
virtual bool isHidden() const =0
virtual QCString getReference() const =0
virtual QCString displayName(bool includeScope=TRUE) const =0
virtual QCString getOutputFileBase() const =0
virtual const QCString & name() const =0
QCString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool TBRank=TRUE, bool imageMap=TRUE, int graphId=-1)
void writeDocbook(TextStream &t)
void writeXML(TextStream &t)
QCString getBaseName() const override
DotClassGraph(const ClassDef *cd, GraphType t)
bool determineVisibleNodes(DotNode *rootNode, int maxNodes, bool includeParents)
QCString m_inheritFileName
QCString getMapLabel() const override
~DotClassGraph() override
void computeTheGraph() override
void determineTruncatedNodes(DotNodeDeque &queue, bool includeParents)
void addClass(const ClassDef *cd, DotNode *n, EdgeInfo::Colors color, const QCString &label, const QCString &usedName, const QCString &templSpec, bool base, int distance)
void writeDEF(TextStream &t)
void buildGraph(const ClassDef *cd, DotNode *n, bool base, int distance)
QCString getImgAltText() const override
QCString m_collabFileName
static void computeGraph(DotNode *root, GraphType gt, GraphOutputFormat format, const QCString &rank, bool renderParents, bool backArrows, const QCString &title, QCString &graphStr)
GraphOutputFormat m_graphFormat
QCString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool writeImageMap=TRUE, int graphId=-1)
void setDistance(int distance)
void markAsVisible(bool b=TRUE)
DotNode & markAsTruncated(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 QCString &edgeLab=QCString(), const QCString &edgeURL=QCString(), int edgeLabCol=-1)
const DotNodeRefVector & parents() const
const DotNodeRefVector & children() const
TruncState isTruncated() const
static constexpr Colors protectionToColor(Protection prot)
This is an alternative implementation of QCString.
size_t length() const
Returns the length of the string, not counting the 0-terminator.
bool isEmpty() const
Returns TRUE iff the string is empty.
const std::string & str() const
Text streaming class that buffers data.
#define Config_getInt(name)
#define Config_getBool(name)
std::set< std::string > StringSet
static QCString joinLabels(const StringSet &ss)
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
QCString escapeCharsInString(const QCString &name, bool allowDots, bool allowUnderscore)
QCString stripScope(const QCString &name)
A bunch of utility functions.