A node in a dot graph
更多...
#include <dotnode.h>
|
| DotNode (int n, const QCString &lab, const QCString &tip, const QCString &url, bool rootNode=FALSE, const ClassDef *cd=0) |
|
| ~DotNode () |
|
void | addChild (DotNode *n, int edgeColor=EdgeInfo::Purple, int edgeStyle=EdgeInfo::Solid, const QCString &edgeLab=QCString(), const QCString &edgeURL=QCString(), int edgeLabCol=-1) |
|
void | addParent (DotNode *n) |
|
void | deleteNode (DotNodeRefVector &deletedList) |
|
void | removeChild (DotNode *n) |
|
void | removeParent (DotNode *n) |
|
int | findParent (DotNode *n) |
|
void | write (TextStream &t, GraphType gt, GraphOutputFormat f, bool topDown, bool toChildren, bool backArrows) const |
|
void | writeXML (TextStream &t, bool isClassGraph) const |
|
void | writeDocbook (TextStream &t, bool isClassGraph) const |
|
void | writeDEF (TextStream &t) const |
|
void | writeBox (TextStream &t, GraphType gt, GraphOutputFormat f, bool hasNonReachableChildren) const |
|
void | writeArrow (TextStream &t, GraphType gt, GraphOutputFormat f, const DotNode *cn, const EdgeInfo *ei, bool topDown, bool pointBack=TRUE) const |
|
QCString | label () const |
|
int | number () const |
|
bool | isVisible () const |
|
TruncState | isTruncated () const |
|
int | distance () const |
|
int | subgraphId () const |
|
bool | isRenumbered () const |
|
bool | hasDocumentation () const |
|
bool | isWritten () const |
|
void | clearWriteFlag () |
|
void | renumberNodes (int &number) |
|
void | markRenumbered () |
|
void | markHasDocumentation () |
|
void | setSubgraphId (int id) |
|
void | colorConnectedNodes (int curColor) |
|
void | setDistance (int distance) |
|
void | markAsVisible (bool b=TRUE) |
|
void | markAsTruncated (bool b=TRUE) |
|
const DotNodeRefVector & | children () const |
|
const DotNodeRefVector & | parents () const |
|
const EdgeInfoVector & | edgeInfo () const |
|
A node in a dot graph
在文件 dotnode.h 第 56 行定义.
◆ TruncState
枚举值 |
---|
Unknown | |
Truncated | |
Untruncated | |
在文件 dotnode.h 第 65 行定义.
◆ DotNode()
◆ ~DotNode()
◆ addChild()
◆ addParent()
void DotNode::addParent |
( |
DotNode * |
n | ) |
|
◆ children()
在文件 dotnode.h 第 109 行定义.
引用了 m_children.
被这些函数引用 DotGfxHierarchyTable::addHierarchy(), DotClassGraph::determineTruncatedNodes(), DotInclDepGraph::determineTruncatedNodes(), DotCallGraph::determineTruncatedNodes(), DotInclDepGraph::determineVisibleNodes(), DotClassGraph::determineVisibleNodes(), DotCallGraph::determineVisibleNodes(), DotClassGraph::isTrivial(), DotInclDepGraph::isTrivial(), DotCallGraph::isTrivial(), DotClassGraph::numNodes(), DotInclDepGraph::numNodes(), DotCallGraph::numNodes() , 以及 write().
◆ clearWriteFlag()
void DotNode::clearWriteFlag |
( |
| ) |
|
◆ colorConnectedNodes()
void DotNode::colorConnectedNodes |
( |
int |
curColor | ) |
|
在文件 dotnode.cpp 第 772 行定义.
776 if (cn->subgraphId()==-1)
778 cn->setSubgraphId(curColor);
780 cn->colorConnectedNodes(curColor);
787 if (pn->subgraphId()==-1)
789 pn->setSubgraphId(curColor);
791 pn->colorConnectedNodes(curColor);
引用了 m_children , 以及 m_parents.
◆ convertLabel()
在文件 dotnode.cpp 第 184 行定义.
186 QCString bBefore(
"\\_/<({[: =-+@%#~?$");
197 while (idx < p.length())
203 case '\\': replacement=
"\\\\";
break;
204 case '\n': replacement=
"\\n";
break;
205 case '<': replacement=
"\\<";
break;
206 case '>': replacement=
"\\>";
break;
207 case '|': replacement=
"\\|";
break;
208 case '{': replacement=
"\\{";
break;
209 case '}': replacement=
"\\}";
break;
210 case '"': replacement=
"\\\"";
break;
211 default: replacement+=c;
break;
218 foldLen = (3*foldLen+sinceLast+2)/4;
221 else if ((pc!=
':' || c!=
':') && charsLeft>foldLen/3 && sinceLast>foldLen && bBefore.contains(c))
225 foldLen = (foldLen+sinceLast+1)/2;
228 else if (charsLeft>1+foldLen/4 && sinceLast>foldLen+foldLen/3 &&
229 !isupper(c) && isupper(p[idx]))
233 foldLen = (foldLen+sinceLast+1)/2;
236 else if (charsLeft>foldLen/3 && sinceLast>foldLen && bAfter.contains(c) && (c!=
':' || p[idx]!=
':'))
240 foldLen = (foldLen+sinceLast+1)/2;
引用了 Config_getInt, QCString::contains(), QCString::isEmpty() , 以及 QCString::length().
被这些函数引用 DotGroupCollaboration::Edge::write(), writeArrow(), writeBox() , 以及 writeBoxMemberList().
◆ deleteNode()
◆ deleteNodes()
void DotNode::deleteNodes |
( |
DotNode * |
node | ) |
|
|
static |
◆ distance()
int DotNode::distance |
( |
| ) |
const |
|
inline |
◆ edgeInfo()
◆ findParent()
int DotNode::findParent |
( |
DotNode * |
n | ) |
|
|
inline |
◆ hasDocumentation()
bool DotNode::hasDocumentation |
( |
| ) |
const |
|
inline |
◆ isRenumbered()
bool DotNode::isRenumbered |
( |
| ) |
const |
|
inline |
◆ isTruncated()
◆ isVisible()
bool DotNode::isVisible |
( |
| ) |
const |
|
inline |
◆ isWritten()
bool DotNode::isWritten |
( |
| ) |
const |
|
inline |
◆ label()
◆ markAsTruncated()
void DotNode::markAsTruncated |
( |
bool |
b = TRUE | ) |
|
|
inline |
◆ markAsVisible()
void DotNode::markAsVisible |
( |
bool |
b = TRUE | ) |
|
|
inline |
◆ markHasDocumentation()
void DotNode::markHasDocumentation |
( |
| ) |
|
|
inline |
◆ markRenumbered()
void DotNode::markRenumbered |
( |
| ) |
|
|
inline |
◆ number()
int DotNode::number |
( |
| ) |
const |
|
inline |
◆ parents()
◆ removeChild()
void DotNode::removeChild |
( |
DotNode * |
n | ) |
|
◆ removeParent()
void DotNode::removeParent |
( |
DotNode * |
n | ) |
|
◆ renumberNodes()
void DotNode::renumberNodes |
( |
int & |
number | ) |
|
◆ setDistance()
void DotNode::setDistance |
( |
int |
distance | ) |
|
◆ setSubgraphId()
void DotNode::setSubgraphId |
( |
int |
id | ) |
|
|
inline |
◆ subgraphId()
int DotNode::subgraphId |
( |
| ) |
const |
|
inline |
◆ write()
在文件 dotnode.cpp 第 532 行定义.
552 writeArrow(t,gt,format,cn,&(*it),topDown,backArrows);
554 cn->write(t,gt,format,topDown,toChildren,backArrows);
564 const auto &
children = pn->children();
566 size_t index = child_it -
children.begin();
572 &pn->edgeInfo()[index],
577 pn->write(t,gt,format,
TRUE,
FALSE,backArrows);
引用了 children(), FALSE, m_children, m_edgeInfo, m_parents, m_truncated, m_visible, m_written, TRUE, Truncated, writeArrow() , 以及 writeBox().
被这些函数引用 DotGraph::computeGraph().
◆ writeArrow()
在文件 dotnode.cpp 第 483 行定义.
505 bool umlUseArrow = aStyle==
"odiamond";
507 if (pointBack && !umlUseArrow) t <<
"dir=\"back\",";
520 bool rev = pointBack;
521 if (umlUseArrow) rev=!rev;
引用了 EdgeProperties::arrowStyleMap, Collaboration, EdgeInfo::color(), Config_getBool, Config_getInt, Config_getString, convertLabel(), EdgeProperties::edgeColorMap, EdgeProperties::edgeStyleMap, GOF_BITMAP, Inheritance, QCString::isEmpty(), EdgeInfo::label(), m_number, normalEdgeProps, number(), EdgeInfo::style() , 以及 umlEdgeProps.
被这些函数引用 DotGraph::computeGraph() , 以及 write().
◆ writeBox()
在文件 dotnode.cpp 第 357 行定义.
364 (hasNonReachableChildren ?
"red" :
"black");
365 t <<
" Node" <<
m_number <<
" [label=\"";
375 if (!ei.label().isEmpty())
377 int i=ei.label().find(
'\n');
380 while ((i=ei.label().find(
'\n',p))!=-1)
383 arrowNames.insert(lab.
str());
387 arrowNames.insert(lab.
str());
428 if (!mg->members().empty())
441 t <<
"\",height=0.2,width=0.4";
444 t <<
",color=\"black\", fillcolor=\"grey75\", style=\"filled\", fontcolor=\"black\"";
450 t <<
",color=\"" << labCol <<
"\", fillcolor=\"";
452 t <<
"\", style=\"filled\"";
456 t <<
",color=\"" << labCol <<
"\"";
478 t <<
",tooltip=\" \"";
引用了 addHtmlExtensionIfMissing(), Collaboration, Config_getBool, Config_getEnum, convertLabel(), escapeTooltip(), FALSE, QCString::findRev(), Definition::getLanguage(), ClassDef::getMemberGroups(), ClassDef::getMemberList(), Inheritance, QCString::isEmpty(), QCString::left(), QCString::length(), m_classDef, m_edgeInfo, m_isRoot, m_label, m_number, m_tooltip, m_url, MemberListType_pacAttribs, MemberListType_pacMethods, MemberListType_pacStaticAttribs, MemberListType_pacStaticMethods, MemberListType_priAttribs, MemberListType_priMethods, MemberListType_priSlots, MemberListType_priStaticAttribs, MemberListType_priStaticMethods, MemberListType_proAttribs, MemberListType_proMethods, MemberListType_properties, MemberListType_proSlots, MemberListType_proStaticAttribs, MemberListType_proStaticMethods, MemberListType_pubAttribs, MemberListType_pubMethods, MemberListType_pubSlots, MemberListType_pubStaticAttribs, MemberListType_pubStaticMethods, NONE, QCString::right(), SrcLangExt_Fortran, QCString::str(), stripProtectionPrefix(), TRUE , 以及 writeBoxMemberList().
被这些函数引用 write().
◆ writeDEF()
在文件 dotnode.cpp 第 708 行定义.
710 const char* nodePrefix =
" node-";
713 t << nodePrefix <<
"id = " <<
m_number <<
";\n";
714 t << nodePrefix <<
"label = '" <<
m_label <<
"';\n";
719 int dollarPos = url.find(
'$');
722 t << nodePrefix <<
"link = {\n" <<
" "
723 << nodePrefix <<
"link-id = '" << url.mid(dollarPos+1) <<
"';\n";
726 t <<
" " << nodePrefix <<
"link-external = '"
727 << url.left(dollarPos) <<
"';\n";
736 t <<
" node-child = {\n";
737 t <<
" child-id = '" << childNode->number() <<
"';\n";
754 t <<
" edgelabel = <<_EnD_oF_dEf_TeXt_\n"
756 <<
"_EnD_oF_dEf_TeXt_;\n";
758 t <<
" }; /* node-child */\n";
761 t <<
" }; /* node */\n";
引用了 ASSERT, EdgeInfo::Blue, edgeInfo(), QCString::find(), EdgeInfo::Green, EdgeInfo::Grey, QCString::isEmpty(), QCString::left(), m_children, m_edgeInfo, m_label, m_number, m_url, QCString::mid(), EdgeInfo::Orange, EdgeInfo::Orange2, EdgeInfo::Purple , 以及 EdgeInfo::Red.
◆ writeDocbook()
void DotNode::writeDocbook |
( |
TextStream & |
t, |
|
|
bool |
isClassGraph |
|
) |
| const |
在文件 dotnode.cpp 第 645 行定义.
647 t <<
" <node id=\"" <<
m_number <<
"\">\n";
652 int dollarPos = url.find(
'$');
655 t <<
" <link refid=\"" <<
convertToXML(url.mid(dollarPos+1)) <<
"\"";
658 t <<
" external=\"" <<
convertToXML(url.left(dollarPos)) <<
"\"";
667 t <<
" <childnode refid=\"" << childNode->number() <<
"\" relation=\"";
690 while ((ni=
edgeInfo.label().find(
'\n',p))!=-1)
701 t <<
" </childnode>\n";
引用了 ASSERT, EdgeInfo::Blue, convertToXML(), edgeInfo(), QCString::find(), EdgeInfo::Green, EdgeInfo::Grey, QCString::isEmpty(), QCString::left(), m_children, m_edgeInfo, m_label, m_number, m_url, QCString::mid(), EdgeInfo::Orange, EdgeInfo::Orange2, EdgeInfo::Purple , 以及 EdgeInfo::Red.
◆ writeXML()
void DotNode::writeXML |
( |
TextStream & |
t, |
|
|
bool |
isClassGraph |
|
) |
| const |
在文件 dotnode.cpp 第 583 行定义.
585 t <<
" <node id=\"" <<
m_number <<
"\">\n";
590 int dollarPos = url.find(
'$');
593 t <<
" <link refid=\"" <<
convertToXML(url.mid(dollarPos+1)) <<
"\"";
596 t <<
" external=\"" <<
convertToXML(url.left(dollarPos)) <<
"\"";
605 t <<
" <childnode refid=\"" << childNode->number() <<
"\" relation=\"";
628 while ((ni=
edgeInfo.label().find(
'\n',p))!=-1)
639 t <<
" </childnode>\n";
引用了 ASSERT, EdgeInfo::Blue, convertToXML(), edgeInfo(), QCString::find(), EdgeInfo::Green, EdgeInfo::Grey, QCString::isEmpty(), QCString::left(), m_children, m_edgeInfo, m_label, m_number, m_url, QCString::mid(), EdgeInfo::Orange, EdgeInfo::Orange2, EdgeInfo::Purple , 以及 EdgeInfo::Red.
◆ m_children
list of child nodes (outgoing arrows)
在文件 dotnode.h 第 119 行定义.
被这些函数引用 addChild(), children(), clearWriteFlag(), colorConnectedNodes(), deleteNode(), removeChild(), renumberNodes(), write(), writeDEF(), writeDocbook() , 以及 writeXML().
◆ m_classDef
◆ m_deleted
bool DotNode::m_deleted = false |
|
private |
◆ m_distance
int DotNode::m_distance = 1000 |
|
private |
◆ m_edgeInfo
◆ m_hasDoc
bool DotNode::m_hasDoc = false |
|
private |
◆ m_isRoot
◆ m_label
◆ m_number
◆ m_parents
◆ m_renumbered
bool DotNode::m_renumbered = false |
|
private |
◆ m_subgraphId
int DotNode::m_subgraphId = -1 |
|
private |
◆ m_tooltip
◆ m_truncated
◆ m_url
◆ m_visible
bool DotNode::m_visible = false |
|
private |
◆ m_written
bool DotNode::m_written = false |
|
mutableprivate |
该类的文档由以下文件生成:
static EdgeProperties normalEdgeProps
bool m_deleted
used to mark a node as deleted
@ MemberListType_priStaticMethods
@ MemberListType_priStaticAttribs
#define Config_getEnum(name)
@ MemberListType_pacStaticAttribs
uint length() const
Returns the length of the string, not counting the 0-terminator.
int findRev(char c, int index=-1, bool cs=TRUE) const
@ MemberListType_priAttribs
bool isEmpty() const
Returns TRUE iff the string is empty
const ClassDef * m_classDef
class representing this node (can be 0)
@ MemberListType_priSlots
const char *const * edgeStyleMap
bool isRenumbered() const
@ MemberListType_proAttribs
@ MemberListType_pubMethods
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
static QCString escapeTooltip(const QCString &tooltip)
std::unordered_set< std::string > StringUnorderedSet
bool m_written
used to mark a node as written
QCString addHtmlExtensionIfMissing(const QCString &fName)
@ MemberListType_pubSlots
#define Config_getInt(name)
@ MemberListType_proStaticMethods
QCString left(size_t len) const
bool m_renumbered
indicates if the node has been renumbered (to prevent endless loops)
void writeBox(TextStream &t, GraphType gt, GraphOutputFormat f, bool hasNonReachableChildren) const
static void writeBoxMemberList(TextStream &t, char prot, const MemberList *ml, const ClassDef *scope, bool isStatic=FALSE, const StringUnorderedSet *skipNames=nullptr)
QCString m_tooltip
node's tooltip
const char *const * edgeColorMap
@ MemberListType_pacAttribs
static QCString stripProtectionPrefix(const QCString &s)
@ MemberListType_pubStaticAttribs
QCString m_url
url of the node (format: remote$local)
const EdgeInfoVector & edgeInfo() const
void writeArrow(TextStream &t, GraphType gt, GraphOutputFormat f, const DotNode *cn, const EdgeInfo *ei, bool topDown, bool pointBack=TRUE) const
@ MemberListType_proMethods
Attributes of an edge of a dot graph
@ MemberListType_pacMethods
const char *const * arrowStyleMap
@ MemberListType_proStaticAttribs
static EdgeProperties umlEdgeProps
TruncState m_truncated
does the node have non-visible children/parents
Helper struct holding the properties of a edge in a dot graph.
#define Config_getBool(name)
bool m_hasDoc
used to mark a node as documented
@ MemberListType_priMethods
bool m_isRoot
indicates if this is a root node
int m_distance
shortest path to the root node
@ MemberListType_proSlots
EdgeInfoVector m_edgeInfo
edge info for each child
const char * qPrint(const char *s)
#define Config_getString(name)
bool m_visible
is the node visible in the output
@ MemberListType_pubAttribs
virtual MemberList * getMemberList(MemberListType lt) const =0
Returns the members in the list identified by lt
QCString convertToXML(const QCString &s, bool keepEntities)
@ MemberListType_pacStaticMethods
static QCString convertLabel(const QCString &l)
DotNodeRefVector m_children
list of child nodes (outgoing arrows)
virtual const MemberGroupList & getMemberGroups() const =0
Returns the member groups defined for this class
@ MemberListType_properties
void deleteNode(DotNodeRefVector &deletedList)
@ MemberListType_pubStaticMethods
DotNodeRefVector m_parents
list of parent nodes (incoming arrows)
std::vector< DotNode * > DotNodeRefVector
QCString right(size_t len) const
QCString m_label
label text
const DotNodeRefVector & children() const
This is an alternative implementation of QCString.