103 if (tooltip.
empty())
return tooltip;
105 const char *p=tooltip.
data();
111 case '"': result+=
"\\\"";
break;
112 case '\\': result+=
"\\\\";
break;
113 default: result+=c;
break;
124 constexpr auto tr_start =
"<TR><TD VALIGN=\"top\" CELLPADDING=\"1\" CELLSPACING=\"0\">";
125 constexpr auto tr_mid =
"</TD><TD VALIGN=\"top\" ALIGN=\"LEFT\" CELLPADDING=\"1\" CELLSPACING=\"0\">";
126 constexpr auto tr_end =
"</TD></TR>\n";
127 constexpr auto br =
"<BR ALIGN=\"LEFT\"/>";
132 for (
const auto &mma : *ml)
134 if (mma->getClassDef()==scope &&
135 (skipNames==
nullptr || skipNames->find(mma->name().str())==std::end(*skipNames)) &&
136 !(hideUndocMembers && !mma->hasDocumentation())
145 for (
const auto &mma : *ml)
147 if (mma->getClassDef() == scope &&
148 (skipNames==
nullptr || skipNames->find(mma->name().str())==std::end(*skipNames)) &&
149 !(hideUndocMembers && !mma->hasDocumentation())
153 if (numFields>0 && (totalCount>numFields*3/2 && count>=numFields))
161 t << tr_start << prot << tr_mid;
163 if (dotUmlDetails==DOT_UML_DETAILS_t::YES)
165 label+=mma->typeString();
169 if (!mma->isObjCMethod() && (mma->isFunction() || mma->isSlot() || mma->isSignal()))
171 if (dotUmlDetails==DOT_UML_DETAILS_t::YES)
173 label+=mma->argsString();
188 for (
const auto &mg : ml->getMemberGroupList())
190 if (!mg->members().empty())
200 DString bBefore(
"\\_/<({[: =-+@%#~?$");
206 int charsLeft=
static_cast<int>(l.
length());
213 result +=
"<<TABLE CELLBORDER=\"0\" BORDER=\"0\"><TR><TD VALIGN=\"top\" ALIGN=\"LEFT\" CELLPADDING=\"1\" CELLSPACING=\"0\">";
217 br =
"<BR ALIGN=\"LEFT\"/>";
221 br1 =
"</TD></TR>\n<TR><TD VALIGN=\"top\" ALIGN=\"LEFT\" CELLPADDING=\"1\" CELLSPACING=\"0\">";
222 br = br1 +
" ";
231 char cs[2] = { c, 0 };
232 const char *replacement = cs;
237 case '\\': replacement=
"\\\\";
break;
238 case '\n': replacement=
"\\n";
break;
239 case '<': replacement=
"<";
break;
240 case '>': replacement=
">";
break;
241 case '"': replacement=
""";
break;
242 case '\'': replacement=
"'";
break;
243 case '&': replacement=
"&";
break;
250 case '\\': replacement=
"\\\\";
break;
251 case '\n': replacement=
"\\n";
break;
252 case '<': replacement=
"\\<";
break;
253 case '>': replacement=
"\\>";
break;
254 case '"': replacement=
"\\\"";
break;
255 case '|': replacement=
"\\|";
break;
256 case '{': replacement=
"\\{";
break;
257 case '}': replacement=
"\\}";
break;
272 foldLen = (3*foldLen+sinceLast+2)/4;
275 else if ((pc!=
':' || c!=
':') && charsLeft>foldLen/3 && sinceLast>foldLen && bBefore.
contains(c))
279 foldLen = (foldLen+sinceLast+1)/2;
282 else if (charsLeft>1+foldLen/4 && sinceLast>foldLen+foldLen/3 &&
283 !isupper(c) && isupper(l[idx]))
287 foldLen = (foldLen+sinceLast+1)/2;
290 else if (charsLeft>foldLen/3 && sinceLast>foldLen && bAfter.
contains(c) && (c!=
':' || l[idx]!=
':'))
294 foldLen = (foldLen+sinceLast+1)/2;
311 result +=
"</TD></TR>\n</TABLE>>";
318 if (!s.
empty() && (s[0]==
'-' || s[0]==
'+' || s[0]==
'~' || s[0]==
'#'))
331 ,
m_number(graph->getNextNodeNumber())
354 edgeLabColor==-1 ? edgeColor : edgeLabColor);
381 pn->deleteNode(deletedList);
386 cn->deleteNode(deletedList);
389 deletedList.push_back(
this);
410 for (
const auto &dotNode : deletedNodes)
422 t <<
"shape=plain,label=";
429 if (!ei.label().empty())
437 arrowNames.insert(lab.
str());
441 arrowNames.insert(lab.
str());
445 constexpr auto hr_start =
"<TR><TD COLSPAN=\"2\" CELLPADDING=\"1\" CELLSPACING=\"0\">";
446 constexpr auto hr_end =
"</TD></TR>\n";
447 constexpr auto sep =
"<HR/>\n";
448 constexpr auto empty_line =
"<TR><TD COLSPAN=\"2\" CELLPADDING=\"1\" CELLSPACING=\"0\"> </TD></TR>\n";
450 t <<
"<<TABLE CELLBORDER=\"0\" BORDER=\"1\">";
453 if (dotUmlDetails!=DOT_UML_DETAILS_t::NONE)
455 bool lineWritten =
false;
469 if (!lineWritten) t << empty_line;
490 if (!mg->members().empty())
496 if (!lineWritten) t << empty_line;
527 size_t anchorPos = noTagURL.
rfind(
'#');
531 t << noTagURL <<
"\"";
537 t << fn << noTagURL.
mid(anchorPos) <<
"\"";
544 bool hasNonReachableChildren)
const
546 const char *labCol =
nullptr;
547 const char *fillCol =
"white";
561 labCol =
"orangered";
575 (hasNonReachableChildren ?
"red" :
"grey40");
577 (hasNonReachableChildren ?
"#FFF0F0" :
"white");
582 t <<
",height=0.2,width=0.4";
585 t <<
",color=\"gray40\", fillcolor=\"grey60\", style=\"filled\", fontcolor=\"black\"";
589 t <<
",color=\"" << labCol <<
"\"";
590 t <<
", fillcolor=\"" << fillCol <<
"\"";
591 t <<
", style=\"filled\"";
600 t <<
",tooltip=\" \"";
611 bool pointBack)
const
627 bool umlUseArrow = aStyle==
"odiamond";
632 if (pointBack && !umlUseArrow) t <<
"dir=\"back\",";
635 t <<
",tooltip=\" \"";
645 bool rev = pointBack;
646 if (umlUseArrow) rev=!rev;
676 writeArrow(t,gt,format,cn,&(*it),topDown,backArrows);
678 cn->write(t,gt,format,topDown,toChildren,backArrows);
688 const auto &
children = pn->children();
690 size_t index = child_it -
children.begin();
696 &pn->edgeInfo()[index],
701 pn->write(t,gt,format,
true,
false,backArrows);
709 t <<
" <node id=\"" <<
m_number <<
"\">\n";
714 size_t dollarPos = url.
find(
'$');
729 t <<
" <childnode refid=\"" << childNode->number() <<
"\" relation=\"";
763 t <<
" </childnode>\n";
771 t <<
" <node id=\"" <<
m_number <<
"\">\n";
790 t <<
" <childnode refid=\"" << childNode->number() <<
"\" relation=\"";
824 t <<
" </childnode>\n";
833 const char* nodePrefix =
" node-";
836 t << nodePrefix <<
"id = " <<
m_number <<
";\n";
837 t << nodePrefix <<
"label = '" <<
m_label <<
"';\n";
844 t << nodePrefix <<
"link = {\n" <<
" "
845 << nodePrefix <<
"link-id = '" << url.
mid(dollarPos+1) <<
"';\n";
848 t <<
" " << nodePrefix <<
"link-external = '"
849 << url.
left(dollarPos) <<
"';\n";
858 t <<
" node-child = {\n";
859 t <<
" child-id = '" << childNode->number() <<
"';\n";
876 t <<
" edgelabel = <<_EnD_oF_dEf_TeXt_\n"
878 <<
"_EnD_oF_dEf_TeXt_;\n";
880 t <<
" }; /* node-child */\n";
883 t <<
" }; /* node */\n";
890 for (
const auto &pn :
m_parents)
if (pn->isWritten()) pn->clearWriteFlag();
891 for (
const auto &cn :
m_children)
if (cn->isWritten()) cn->clearWriteFlag();
898 if (cn->subgraphId()==-1)
900 cn->setSubgraphId(curColor);
902 cn->colorConnectedNodes(curColor);
909 if (pn->subgraphId()==-1)
911 pn->setSubgraphId(curColor);
913 pn->colorConnectedNodes(curColor);
919#define DEBUG_RENUMBERING 0
926 static int level = 0;
928 for (
int i = 0; i < level; i++) printf(
" ");
936 cn->renumberNodes(
number);
940 pn->renumberNodes(
number);
945 for (
int i = 0; i < level; i++) printf(
" ");
A abstract class representing of a compound symbol.
virtual MemberList * getMemberList(MemberListType lt) const =0
Returns the members in the list identified by lt.
virtual bool isImplicitTemplateInstance() const =0
virtual const MemberGroupList & getMemberGroups() const =0
Returns the member groups defined for this class.
virtual const ClassDef * templateMaster() const =0
Returns the template master of which this class is an instance.
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
size_t rfind(char c, size_t pos=npos) const
DString mid(size_t index, size_t len=npos) const
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
DString right(size_t len) const
int contains(char c, bool cs=true) const
size_t find(char c, size_t pos=0) const
DString & sprintf(const char *format,...)
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
DString left(size_t len) const
const std::string & str() const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
size_t length() const
Returns the length of the string, not counting the 0-terminator.
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual bool hasDocumentation() const =0
int getNextEdgeNumber()
returns the edge number.
void writeDEF(TextStream &t) const
int findParent(DotNode *n)
static DString convertLabel(const DString &, LabelStyle=LabelStyle::Plain)
void writeUrl(TextStream &t) const
void setDistance(int distance)
void writeArrow(TextStream &t, GraphType gt, GraphOutputFormat f, const DotNode *cn, const EdgeInfo *ei, bool topDown, bool pointBack=true) const
void write(TextStream &t, GraphType gt, GraphOutputFormat f, bool topDown, bool toChildren, bool backArrows)
bool m_isRoot
indicates if this is a root node
void removeParent(DotNode *n)
const EdgeInfoVector & edgeInfo() const
void writeBox(TextStream &t, GraphType gt, GraphOutputFormat f, bool hasNonReachableChildren) const
TruncState m_truncated
does the node have non-visible children/parents
void writeDocbook(TextStream &t, bool isClassGraph) const
void renumberNodes(int &number)
bool m_written
used to mark a node as written
void removeChild(DotNode *n)
static void deleteNodes(DotNode *node)
EdgeInfoVector m_edgeInfo
edge info for each child
bool isRenumbered() const
int m_distance
shortest path to the root node
void addParent(DotNode *n)
DotNode(DotGraph *graph, const DString &lab, const DString &tip, const DString &url, bool rootNode=false, const ClassDef *cd=nullptr)
DotNodeRefVector m_parents
list of parent nodes (incoming arrows)
bool m_visible
is the node visible in the output
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)
DString m_tooltip
node's tooltip
void colorConnectedNodes(int curColor)
DotNodeRefVector m_children
list of child nodes (outgoing arrows)
DString m_label
label text
const ClassDef * m_classDef
class representing this node (can be 0)
static constexpr auto placeholderUrl
const DotNodeRefVector & children() const
bool m_deleted
used to mark a node as deleted
void deleteNode(DotNodeRefVector &deletedList)
void writeLabel(TextStream &t, GraphType gt) const
void writeXML(TextStream &t, bool isClassGraph) const
DString m_url
url of the node (format: remote$local)
Attributes of an edge of a dot graph.
A list of MemberDef objects as shown in documentation sections.
Text streaming class that buffers data.
virtual DString trAndMore(const DString &number)=0
#define Config_getInt(name)
#define Config_getBool(name)
#define Config_getString(name)
#define Config_getEnum(name)
std::unordered_set< std::string > StringUnorderedSet
static const char * normalEdgeColorMap[]
static const char * normalEdgeStyleMap[]
static EdgeProperties normalEdgeProps
static DString stripProtectionPrefix(const DString &s)
static void writeBoxMemberList(TextStream &t, char prot, const MemberList *ml, const ClassDef *scope, bool &lineWritten, bool isStatic=false, const StringUnorderedSet *skipNames=nullptr)
static const char * umlEdgeStyleMap[]
static const char * normalArrowStyleMap[]
static EdgeProperties umlEdgeProps
static const char * umlEdgeColorMap[]
static const char * umlArrowStyleMap[]
DString escapeTooltip(const DString &tooltip)
std::vector< DotNode * > DotNodeRefVector
DString escapeTooltip(const DString &tooltip)
const char * qPrint(const char *s)
Translator * theTranslator
Helper struct holding the properties of a edge in a dot graph.
const char *const * arrowStyleMap
const char *const * edgeStyleMap
const char *const * edgeColorMap
void addHtmlExtensionIfMissing(DString &fName)
DString convertToXML(const DString &s, bool keepEntities, const bool citeEntry)
A bunch of utility functions.