Doxygen
DotNode类 参考

A node in a dot graph 更多...

#include <dotnode.h>

+ DotNode 的协作图:

Public 类型

enum  TruncState { Unknown, Truncated, Untruncated }
 

Public 成员函数

 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 DotNodeRefVectorchildren () const
 
const DotNodeRefVectorparents () const
 
const EdgeInfoVectoredgeInfo () const
 

静态 Public 成员函数

static void deleteNodes (DotNode *node)
 
static QCString convertLabel (const QCString &l)
 

Private 属性

int m_number
 
QCString m_label
 label text 更多...
 
QCString m_tooltip
 node's tooltip 更多...
 
QCString m_url
 url of the node (format: remote$local) 更多...
 
DotNodeRefVector m_parents
 list of parent nodes (incoming arrows) 更多...
 
DotNodeRefVector m_children
 list of child nodes (outgoing arrows) 更多...
 
EdgeInfoVector m_edgeInfo
 edge info for each child 更多...
 
bool m_deleted = false
 used to mark a node as deleted 更多...
 
bool m_written = false
 used to mark a node as written 更多...
 
bool m_hasDoc = false
 used to mark a node as documented 更多...
 
bool m_isRoot
 indicates if this is a root node 更多...
 
const ClassDefm_classDef
 class representing this node (can be 0) 更多...
 
bool m_visible = false
 is the node visible in the output 更多...
 
TruncState m_truncated = Unknown
 does the node have non-visible children/parents 更多...
 
int m_distance = 1000
 shortest path to the root node 更多...
 
bool m_renumbered = false
 indicates if the node has been renumbered (to prevent endless loops) 更多...
 
int m_subgraphId = -1
 

详细描述

A node in a dot graph

在文件 dotnode.h56 行定义.

成员枚举类型说明

◆ TruncState

枚举值
Unknown 
Truncated 
Untruncated 

在文件 dotnode.h65 行定义.

构造及析构函数说明

◆ DotNode()

DotNode::DotNode ( int  n,
const QCString lab,
const QCString tip,
const QCString url,
bool  rootNode = FALSE,
const ClassDef cd = 0 
)

在文件 dotnode.cpp266 行定义.

268  : m_number(n)
269  , m_label(lab)
270  , m_tooltip(tip)
271  , m_url(url)
272  , m_isRoot(isRoot)
273  , m_classDef(cd)
274 {
275 }

◆ ~DotNode()

DotNode::~DotNode ( )

在文件 dotnode.cpp277 行定义.

278 {
279 }

成员函数说明

◆ addChild()

void DotNode::addChild ( DotNode n,
int  edgeColor = EdgeInfo::Purple,
int  edgeStyle = EdgeInfo::Solid,
const QCString edgeLab = QCString(),
const QCString edgeURL = QCString(),
int  edgeLabCol = -1 
)

在文件 dotnode.cpp281 行定义.

288 {
289  m_children.push_back(n);
290  m_edgeInfo.emplace_back(
291  edgeColor,
292  edgeStyle,
293  edgeLab,
294  edgeURL,
295  edgeLabCol==-1 ? edgeColor : edgeLabCol);
296 }

引用了 m_children , 以及 m_edgeInfo.

被这些函数引用 DotClassGraph::addClass(), DotGfxHierarchyTable::addHierarchy(), DotInclDepGraph::buildGraph() , 以及 DotCallGraph::buildGraph().

◆ addParent()

void DotNode::addParent ( DotNode n)

在文件 dotnode.cpp298 行定义.

299 {
300  m_parents.push_back(n);
301 }

引用了 m_parents.

被这些函数引用 DotClassGraph::addClass(), DotInclDepGraph::buildGraph() , 以及 DotCallGraph::buildGraph().

◆ children()

◆ clearWriteFlag()

void DotNode::clearWriteFlag ( )

在文件 dotnode.cpp765 行定义.

766 {
768  for (const auto &pn : m_parents) if (pn->isWritten()) pn->clearWriteFlag();
769  for (const auto &cn : m_children) if (cn->isWritten()) cn->clearWriteFlag();
770 }

引用了 FALSE, m_children, m_parents , 以及 m_written.

被这些函数引用 DotGraph::computeGraph().

◆ colorConnectedNodes()

void DotNode::colorConnectedNodes ( int  curColor)

在文件 dotnode.cpp772 行定义.

773 {
774  for (const auto &cn : m_children)
775  {
776  if (cn->subgraphId()==-1) // uncolored child node
777  {
778  cn->setSubgraphId(curColor);
779  cn->markAsVisible();
780  cn->colorConnectedNodes(curColor);
781  //printf("coloring node %s (%p): %d\n",qPrint(cn->label()),cn,cn->subgraphId());
782  }
783  }
784 
785  for (const auto &pn : m_parents)
786  {
787  if (pn->subgraphId()==-1) // uncolored parent node
788  {
789  pn->setSubgraphId(curColor);
790  pn->markAsVisible();
791  pn->colorConnectedNodes(curColor);
792  //printf("coloring node %s (%p): %d\n",qPrint(pn->label()),pn,pn->subgraphId());
793  }
794  }
795 }

引用了 m_children , 以及 m_parents.

◆ convertLabel()

QCString DotNode::convertLabel ( const QCString l)
static

在文件 dotnode.cpp184 行定义.

185 {
186  QCString bBefore("\\_/<({[: =-+@%#~?$"); // break before character set
187  QCString bAfter(">]),:;|"); // break after character set
188  QCString p(l);
189  if (p.isEmpty()) return QCString();
190  QCString result;
191  char c,pc=0;
192  uint idx = 0;
193  int len=p.length();
194  int charsLeft=len;
195  int sinceLast=0;
196  int foldLen = Config_getInt(DOT_WRAP_THRESHOLD); // ideal text length
197  while (idx < p.length())
198  {
199  c = p[idx++];
200  QCString replacement;
201  switch(c)
202  {
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;
212  }
213  // Some heuristics to insert newlines to prevent too long
214  // boxes and at the same time prevent ugly breaks
215  if (c=='\n')
216  {
217  result+=replacement;
218  foldLen = (3*foldLen+sinceLast+2)/4;
219  sinceLast=1;
220  }
221  else if ((pc!=':' || c!=':') && charsLeft>foldLen/3 && sinceLast>foldLen && bBefore.contains(c))
222  {
223  result+="\\l";
224  result+=replacement;
225  foldLen = (foldLen+sinceLast+1)/2;
226  sinceLast=1;
227  }
228  else if (charsLeft>1+foldLen/4 && sinceLast>foldLen+foldLen/3 &&
229  !isupper(c) && isupper(p[idx]))
230  {
231  result+=replacement;
232  result+="\\l";
233  foldLen = (foldLen+sinceLast+1)/2;
234  sinceLast=0;
235  }
236  else if (charsLeft>foldLen/3 && sinceLast>foldLen && bAfter.contains(c) && (c!=':' || p[idx]!=':'))
237  {
238  result+=replacement;
239  result+="\\l";
240  foldLen = (foldLen+sinceLast+1)/2;
241  sinceLast=0;
242  }
243  else
244  {
245  result+=replacement;
246  sinceLast++;
247  }
248  charsLeft--;
249  pc=c;
250  }
251  return result;
252 }

引用了 Config_getInt, QCString::contains(), QCString::isEmpty() , 以及 QCString::length().

被这些函数引用 DotGroupCollaboration::Edge::write(), writeArrow(), writeBox() , 以及 writeBoxMemberList().

◆ deleteNode()

void DotNode::deleteNode ( DotNodeRefVector deletedList)

在文件 dotnode.cpp315 行定义.

316 {
317  if (m_deleted) return; // avoid recursive loops in case the graph has cycles
318  m_deleted=TRUE;
319  // delete all parent nodes of this node
320  for (const auto &pn : m_parents)
321  {
322  pn->deleteNode(deletedList);
323  }
324  // delete all child nodes of this node
325  for (const auto &cn : m_children)
326  {
327  cn->deleteNode(deletedList);
328  }
329  // add this node to the list of deleted nodes.
330  deletedList.push_back(this);
331 }

引用了 m_children, m_deleted, m_parents , 以及 TRUE.

被这些函数引用 deleteNodes().

◆ deleteNodes()

void DotNode::deleteNodes ( DotNode node)
static

helper function that deletes all nodes in a connected graph, given one of the graph's nodes

在文件 dotnode.cpp347 行定义.

348 {
349  DotNodeRefVector deletedNodes;
350  node->deleteNode(deletedNodes); // collect nodes to be deleted.
351  for (const auto &dotNode : deletedNodes)
352  {
353  delete dotNode;
354  }
355 }

引用了 deleteNode().

被这些函数引用 DotCallGraph::~DotCallGraph(), DotClassGraph::~DotClassGraph() , 以及 DotInclDepGraph::~DotInclDepGraph().

◆ distance()

int DotNode::distance ( ) const
inline

◆ edgeInfo()

const EdgeInfoVector& DotNode::edgeInfo ( ) const
inline

在文件 dotnode.h111 行定义.

111 { return m_edgeInfo; }

引用了 m_edgeInfo.

被这些函数引用 writeDEF(), writeDocbook() , 以及 writeXML().

◆ findParent()

int DotNode::findParent ( DotNode n)
inline

在文件 dotnode.cpp338 行定义.

339 {
340  auto it = std::find(m_parents.begin(),m_parents.end(),n);
341  return it!=m_parents.end() ? static_cast<int>(it-m_parents.begin()) : -1;
342 }

引用了 m_parents.

◆ hasDocumentation()

bool DotNode::hasDocumentation ( ) const
inline

在文件 dotnode.h96 行定义.

96 { return m_hasDoc; }

引用了 m_hasDoc.

◆ isRenumbered()

bool DotNode::isRenumbered ( ) const
inline

在文件 dotnode.h95 行定义.

95 { return m_renumbered; }

引用了 m_renumbered.

被这些函数引用 renumberNodes().

◆ isTruncated()

TruncState DotNode::isTruncated ( ) const
inline

◆ isVisible()

◆ isWritten()

bool DotNode::isWritten ( ) const
inline

在文件 dotnode.h97 行定义.

97 { return m_written; }

引用了 m_written.

◆ label()

◆ markAsTruncated()

void DotNode::markAsTruncated ( bool  b = TRUE)
inline

◆ markAsVisible()

◆ markHasDocumentation()

void DotNode::markHasDocumentation ( )
inline

在文件 dotnode.h102 行定义.

102 { m_hasDoc = true; }

引用了 m_hasDoc.

◆ markRenumbered()

void DotNode::markRenumbered ( )
inline

在文件 dotnode.h101 行定义.

101 { m_renumbered = true; }

引用了 m_renumbered.

被这些函数引用 renumberNodes().

◆ number()

int DotNode::number ( ) const
inline

在文件 dotnode.h90 行定义.

90 { return m_number; }

引用了 m_number.

被这些函数引用 renumberNodes(), DotGroupCollaboration::Edge::write() , 以及 writeArrow().

◆ parents()

const DotNodeRefVector& DotNode::parents ( ) const
inline

◆ removeChild()

void DotNode::removeChild ( DotNode n)

在文件 dotnode.cpp303 行定义.

304 {
305  auto it = std::find(m_children.begin(),m_children.end(),n);
306  if (it!=m_children.end()) m_children.erase(it);
307 }

引用了 m_children.

◆ removeParent()

void DotNode::removeParent ( DotNode n)

在文件 dotnode.cpp309 行定义.

310 {
311  auto it = std::find(m_parents.begin(),m_parents.end(),n);
312  if (it!=m_parents.end()) m_parents.erase(it);
313 }

引用了 m_parents.

◆ renumberNodes()

void DotNode::renumberNodes ( int &  number)

在文件 dotnode.cpp799 行定义.

800 {
801  if (!isRenumbered())
802  {
803 #if DEBUG_RENUMBERING
804  static int level = 0;
805  printf("%3d: ",subgraphId());
806  for (int i = 0; i < level; i++) printf(" ");
807  printf("> %s old = %d new = %d\n",qPrint(m_label),m_number,number);
808  level++;
809 #endif
810  m_number = number++;
811  markRenumbered();
812  for (const auto &cn : m_children)
813  {
814  cn->renumberNodes(number);
815  }
816  for (const auto &pn : m_parents)
817  {
818  pn->renumberNodes(number);
819  }
820 #if DEBUG_RENUMBERING
821  level--;
822  printf("%3d: ",subgraphId());
823  for (int i = 0; i < level; i++) printf(" ");
824  printf("< %s assigned = %d\n",qPrint(m_label),m_number);
825 #endif
826  }
827 }

引用了 isRenumbered(), m_children, m_label, m_number, m_parents, markRenumbered(), number(), qPrint() , 以及 subgraphId().

◆ setDistance()

void DotNode::setDistance ( int  distance)

◆ setSubgraphId()

void DotNode::setSubgraphId ( int  id)
inline

在文件 dotnode.h103 行定义.

103 { m_subgraphId = id; }

引用了 m_subgraphId.

◆ subgraphId()

int DotNode::subgraphId ( ) const
inline

在文件 dotnode.h94 行定义.

94 { return m_subgraphId; }

引用了 m_subgraphId.

被这些函数引用 DotGfxHierarchyTable::computeTheGraph() , 以及 renumberNodes().

◆ write()

void DotNode::write ( TextStream t,
GraphType  gt,
GraphOutputFormat  f,
bool  topDown,
bool  toChildren,
bool  backArrows 
) const

在文件 dotnode.cpp532 行定义.

538 {
539  //printf("DotNode::write(%d) name=%s this=%p written=%d visible=%d\n",m_distance,qPrint(m_label),this,m_written,m_visible);
540  if (m_written) return; // node already written to the output
541  if (!m_visible) return; // node is not visible
542  writeBox(t,gt,format,m_truncated==Truncated);
543  m_written=TRUE;
544  if (toChildren)
545  {
546  auto it = m_edgeInfo.begin();
547  for (const auto &cn : m_children)
548  {
549  if (cn->isVisible())
550  {
551  //printf("write arrow %s%s%s\n",qPrint(label()),backArrows?"<-":"->",qPrint(cn->label()));
552  writeArrow(t,gt,format,cn,&(*it),topDown,backArrows);
553  }
554  cn->write(t,gt,format,topDown,toChildren,backArrows);
555  ++it;
556  }
557  }
558  else // render parents
559  {
560  for (const auto &pn : m_parents)
561  {
562  if (pn->isVisible())
563  {
564  const auto &children = pn->children();
565  auto child_it = std::find(children.begin(),children.end(),this);
566  size_t index = child_it - children.begin();
567  //printf("write arrow %s%s%s\n",qPrint(label()),backArrows?"<-":"->",qPrint(pn->label()));
568  writeArrow(t,
569  gt,
570  format,
571  pn,
572  &pn->edgeInfo()[index],
573  FALSE,
574  backArrows
575  );
576  }
577  pn->write(t,gt,format,TRUE,FALSE,backArrows);
578  }
579  }
580  //printf("end DotNode::write(%d) name=%s\n",distance,qPrint(m_label));
581 }

引用了 children(), FALSE, m_children, m_edgeInfo, m_parents, m_truncated, m_visible, m_written, TRUE, Truncated, writeArrow() , 以及 writeBox().

被这些函数引用 DotGraph::computeGraph().

◆ writeArrow()

void DotNode::writeArrow ( TextStream t,
GraphType  gt,
GraphOutputFormat  f,
const DotNode cn,
const EdgeInfo ei,
bool  topDown,
bool  pointBack = TRUE 
) const

在文件 dotnode.cpp483 行定义.

490 {
491  t << " Node";
492  if (topDown)
493  t << cn->number();
494  else
495  t << m_number;
496  t << " -> Node";
497  if (topDown)
498  t << m_number;
499  else
500  t << cn->number();
501  t << " [";
502 
503  const EdgeProperties *eProps = Config_getBool(UML_LOOK) ? &umlEdgeProps : &normalEdgeProps;
504  QCString aStyle = eProps->arrowStyleMap[ei->color()];
505  bool umlUseArrow = aStyle=="odiamond";
506 
507  if (pointBack && !umlUseArrow) t << "dir=\"back\",";
508  t << "color=\"" << eProps->edgeColorMap[ei->color()]
509  << "\",fontsize=\"" << Config_getInt(DOT_FONTSIZE) << "\",";
510  t << "style=\"" << eProps->edgeStyleMap[ei->style()] << "\"";
511  if (!ei->label().isEmpty())
512  {
513  t << ",label=\" " << convertLabel(ei->label()) << "\" ";
514  }
515  if (Config_getBool(UML_LOOK) &&
516  eProps->arrowStyleMap[ei->color()] &&
517  (gt==Inheritance || gt==Collaboration)
518  )
519  {
520  bool rev = pointBack;
521  if (umlUseArrow) rev=!rev; // UML use relates has arrow on the start side
522  if (rev)
523  t << ",arrowtail=\"" << eProps->arrowStyleMap[ei->color()] << "\"";
524  else
525  t << ",arrowhead=\"" << eProps->arrowStyleMap[ei->color()] << "\"";
526  }
527 
528  if (format==GOF_BITMAP) t << ",fontname=\"" << Config_getString(DOT_FONTNAME) << "\"";
529  t << "];\n";
530 }

引用了 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()

void DotNode::writeBox ( TextStream t,
GraphType  gt,
GraphOutputFormat  f,
bool  hasNonReachableChildren 
) const

在文件 dotnode.cpp357 行定义.

361 {
362  const char *labCol =
363  m_url.isEmpty() ? "grey75" : // non link
364  (hasNonReachableChildren ? "red" : "black");
365  t << " Node" << m_number << " [label=\"";
366 
367  if (m_classDef && Config_getBool(UML_LOOK) && (gt==Inheritance || gt==Collaboration))
368  {
369  // add names shown as relations to a set, so we don't show
370  // them as attributes as well
371  StringUnorderedSet arrowNames;
372  // for each edge
373  for (const auto &ei : m_edgeInfo)
374  {
375  if (!ei.label().isEmpty()) // labels joined by \n
376  {
377  int i=ei.label().find('\n');
378  int p=0;
379  QCString lab;
380  while ((i=ei.label().find('\n',p))!=-1)
381  {
382  lab = stripProtectionPrefix(ei.label().mid(p,i-p));
383  arrowNames.insert(lab.str());
384  p=i+1;
385  }
386  lab = stripProtectionPrefix(ei.label().right(ei.label().length()-p));
387  arrowNames.insert(lab.str());
388  }
389  }
390 
391  //printf("DotNode::writeBox for %s\n",qPrint(m_classDef->name()));
392  t << "{" << convertLabel(m_label) << "\\n";
393  static auto dotUmlDetails = Config_getEnum(DOT_UML_DETAILS);
394  if (dotUmlDetails!=DOT_UML_DETAILS_t::NONE)
395  {
396  t << "|";
404  if (Config_getBool(EXTRACT_PRIVATE))
405  {
408  }
409  t << "|";
418  if (Config_getBool(EXTRACT_PRIVATE))
419  {
423  }
425  {
426  for (const auto &mg : m_classDef->getMemberGroups())
427  {
428  if (!mg->members().empty())
429  {
430  writeBoxMemberList(t,'*',&mg->members(),m_classDef,FALSE,&arrowNames);
431  }
432  }
433  }
434  }
435  t << "}";
436  }
437  else // standard look
438  {
439  t << convertLabel(m_label);
440  }
441  t << "\",height=0.2,width=0.4";
442  if (m_isRoot)
443  {
444  t << ",color=\"black\", fillcolor=\"grey75\", style=\"filled\", fontcolor=\"black\"";
445  }
446  else
447  {
448  if (!Config_getBool(DOT_TRANSPARENT))
449  {
450  t << ",color=\"" << labCol << "\", fillcolor=\"";
451  t << "white";
452  t << "\", style=\"filled\"";
453  }
454  else
455  {
456  t << ",color=\"" << labCol << "\"";
457  }
458  if (!m_url.isEmpty())
459  {
460  int anchorPos = m_url.findRev('#');
461  if (anchorPos==-1)
462  {
463  t << ",URL=\"" << addHtmlExtensionIfMissing(m_url) << "\"";
464  }
465  else
466  {
467  t << ",URL=\"" << addHtmlExtensionIfMissing(m_url.left(anchorPos))
468  << m_url.right(m_url.length()-anchorPos) << "\"";
469  }
470  }
471  }
472  if (!m_tooltip.isEmpty())
473  {
474  t << ",tooltip=\"" << escapeTooltip(m_tooltip) << "\"";
475  }
476  else
477  {
478  t << ",tooltip=\" \""; // space in tooltip is required otherwise still something like 'Node0' is used
479  }
480  t << "];\n";
481 }

引用了 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()

void DotNode::writeDEF ( TextStream t) const

在文件 dotnode.cpp708 行定义.

709 {
710  const char* nodePrefix = " node-";
711 
712  t << " node = {\n";
713  t << nodePrefix << "id = " << m_number << ";\n";
714  t << nodePrefix << "label = '" << m_label << "';\n";
715 
716  if (!m_url.isEmpty())
717  {
718  QCString url(m_url);
719  int dollarPos = url.find('$');
720  if (dollarPos!=-1)
721  {
722  t << nodePrefix << "link = {\n" << " "
723  << nodePrefix << "link-id = '" << url.mid(dollarPos+1) << "';\n";
724  if (dollarPos>0)
725  {
726  t << " " << nodePrefix << "link-external = '"
727  << url.left(dollarPos) << "';\n";
728  }
729  t << " };\n";
730  }
731  }
732  auto it = m_edgeInfo.begin();
733  for (const auto &childNode : m_children)
734  {
735  const EdgeInfo &edgeInfo = *it;
736  t << " node-child = {\n";
737  t << " child-id = '" << childNode->number() << "';\n";
738  t << " relation = ";
739 
740  switch (edgeInfo.color())
741  {
742  case EdgeInfo::Blue: t << "public-inheritance"; break;
743  case EdgeInfo::Green: t << "protected-inheritance"; break;
744  case EdgeInfo::Red: t << "private-inheritance"; break;
745  case EdgeInfo::Purple: t << "usage"; break;
746  case EdgeInfo::Orange: t << "template-instance"; break;
747  case EdgeInfo::Orange2: t << "type-constraint"; break;
748  case EdgeInfo::Grey: ASSERT(0); break;
749  }
750  t << ";\n";
751 
752  if (!edgeInfo.label().isEmpty())
753  {
754  t << " edgelabel = <<_EnD_oF_dEf_TeXt_\n"
755  << edgeInfo.label() << "\n"
756  << "_EnD_oF_dEf_TeXt_;\n";
757  }
758  t << " }; /* node-child */\n";
759  ++it;
760  }
761  t << " }; /* node */\n";
762 }

引用了 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.cpp645 行定义.

646 {
647  t << " <node id=\"" << m_number << "\">\n";
648  t << " <label>" << convertToXML(m_label) << "</label>\n";
649  if (!m_url.isEmpty())
650  {
651  QCString url(m_url);
652  int dollarPos = url.find('$');
653  if (dollarPos!=-1)
654  {
655  t << " <link refid=\"" << convertToXML(url.mid(dollarPos+1)) << "\"";
656  if (dollarPos>0)
657  {
658  t << " external=\"" << convertToXML(url.left(dollarPos)) << "\"";
659  }
660  t << "/>\n";
661  }
662  }
663  auto it = m_edgeInfo.begin();
664  for (const auto &childNode : m_children)
665  {
666  const EdgeInfo &edgeInfo = *it;
667  t << " <childnode refid=\"" << childNode->number() << "\" relation=\"";
668  if (isClassGraph)
669  {
670  switch(edgeInfo.color())
671  {
672  case EdgeInfo::Blue: t << "public-inheritance"; break;
673  case EdgeInfo::Green: t << "protected-inheritance"; break;
674  case EdgeInfo::Red: t << "private-inheritance"; break;
675  case EdgeInfo::Purple: t << "usage"; break;
676  case EdgeInfo::Orange: t << "template-instance"; break;
677  case EdgeInfo::Orange2: t << "type-constraint"; break;
678  case EdgeInfo::Grey: ASSERT(0); break;
679  }
680  }
681  else // include graph
682  {
683  t << "include";
684  }
685  t << "\">\n";
686  if (!edgeInfo.label().isEmpty())
687  {
688  int p=0;
689  int ni;
690  while ((ni=edgeInfo.label().find('\n',p))!=-1)
691  {
692  t << " <edgelabel>"
693  << convertToXML(edgeInfo.label().mid(p,ni-p))
694  << "</edgelabel>\n";
695  p=ni+1;
696  }
697  t << " <edgelabel>"
698  << convertToXML(edgeInfo.label().right(edgeInfo.label().length()-p))
699  << "</edgelabel>\n";
700  }
701  t << " </childnode>\n";
702  ++it;
703  }
704  t << " </node>\n";
705 }

引用了 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.cpp583 行定义.

584 {
585  t << " <node id=\"" << m_number << "\">\n";
586  t << " <label>" << convertToXML(m_label) << "</label>\n";
587  if (!m_url.isEmpty())
588  {
589  QCString url(m_url);
590  int dollarPos = url.find('$');
591  if (dollarPos!=-1)
592  {
593  t << " <link refid=\"" << convertToXML(url.mid(dollarPos+1)) << "\"";
594  if (dollarPos>0)
595  {
596  t << " external=\"" << convertToXML(url.left(dollarPos)) << "\"";
597  }
598  t << "/>\n";
599  }
600  }
601  auto it = m_edgeInfo.begin();
602  for (const auto &childNode : m_children)
603  {
604  const EdgeInfo &edgeInfo = *it;
605  t << " <childnode refid=\"" << childNode->number() << "\" relation=\"";
606  if (isClassGraph)
607  {
608  switch(edgeInfo.color())
609  {
610  case EdgeInfo::Blue: t << "public-inheritance"; break;
611  case EdgeInfo::Green: t << "protected-inheritance"; break;
612  case EdgeInfo::Red: t << "private-inheritance"; break;
613  case EdgeInfo::Purple: t << "usage"; break;
614  case EdgeInfo::Orange: t << "template-instance"; break;
615  case EdgeInfo::Orange2: t << "type-constraint"; break;
616  case EdgeInfo::Grey: ASSERT(0); break;
617  }
618  }
619  else // include graph
620  {
621  t << "include";
622  }
623  t << "\">\n";
624  if (!edgeInfo.label().isEmpty())
625  {
626  int p=0;
627  int ni;
628  while ((ni=edgeInfo.label().find('\n',p))!=-1)
629  {
630  t << " <edgelabel>"
631  << convertToXML(edgeInfo.label().mid(p,ni-p))
632  << "</edgelabel>\n";
633  p=ni+1;
634  }
635  t << " <edgelabel>"
636  << convertToXML(edgeInfo.label().right(edgeInfo.label().length()-p))
637  << "</edgelabel>\n";
638  }
639  t << " </childnode>\n";
640  ++it;
641  }
642  t << " </node>\n";
643 }

引用了 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

DotNodeRefVector DotNode::m_children
private

list of child nodes (outgoing arrows)

在文件 dotnode.h119 行定义.

被这些函数引用 addChild(), children(), clearWriteFlag(), colorConnectedNodes(), deleteNode(), removeChild(), renumberNodes(), write(), writeDEF(), writeDocbook() , 以及 writeXML().

◆ m_classDef

const ClassDef* DotNode::m_classDef
private

class representing this node (can be 0)

在文件 dotnode.h125 行定义.

被这些函数引用 writeBox().

◆ m_deleted

bool DotNode::m_deleted = false
private

used to mark a node as deleted

在文件 dotnode.h121 行定义.

被这些函数引用 deleteNode().

◆ m_distance

int DotNode::m_distance = 1000
private

shortest path to the root node

在文件 dotnode.h128 行定义.

被这些函数引用 distance() , 以及 setDistance().

◆ m_edgeInfo

EdgeInfoVector DotNode::m_edgeInfo
private

edge info for each child

在文件 dotnode.h120 行定义.

被这些函数引用 addChild(), edgeInfo(), write(), writeBox(), writeDEF(), writeDocbook() , 以及 writeXML().

◆ m_hasDoc

bool DotNode::m_hasDoc = false
private

used to mark a node as documented

在文件 dotnode.h123 行定义.

被这些函数引用 hasDocumentation() , 以及 markHasDocumentation().

◆ m_isRoot

bool DotNode::m_isRoot
private

indicates if this is a root node

在文件 dotnode.h124 行定义.

被这些函数引用 writeBox().

◆ m_label

QCString DotNode::m_label
private

label text

在文件 dotnode.h115 行定义.

被这些函数引用 label(), renumberNodes(), writeBox(), writeDEF(), writeDocbook() , 以及 writeXML().

◆ m_number

int DotNode::m_number
private

在文件 dotnode.h114 行定义.

被这些函数引用 number(), renumberNodes(), writeArrow(), writeBox(), writeDEF(), writeDocbook() , 以及 writeXML().

◆ m_parents

DotNodeRefVector DotNode::m_parents
private

list of parent nodes (incoming arrows)

在文件 dotnode.h118 行定义.

被这些函数引用 addParent(), clearWriteFlag(), colorConnectedNodes(), deleteNode(), findParent(), parents(), removeParent(), renumberNodes() , 以及 write().

◆ m_renumbered

bool DotNode::m_renumbered = false
private

indicates if the node has been renumbered (to prevent endless loops)

在文件 dotnode.h129 行定义.

被这些函数引用 isRenumbered() , 以及 markRenumbered().

◆ m_subgraphId

int DotNode::m_subgraphId = -1
private

在文件 dotnode.h130 行定义.

被这些函数引用 setSubgraphId() , 以及 subgraphId().

◆ m_tooltip

QCString DotNode::m_tooltip
private

node's tooltip

在文件 dotnode.h116 行定义.

被这些函数引用 writeBox().

◆ m_truncated

TruncState DotNode::m_truncated = Unknown
private

does the node have non-visible children/parents

在文件 dotnode.h127 行定义.

被这些函数引用 isTruncated(), markAsTruncated() , 以及 write().

◆ m_url

QCString DotNode::m_url
private

url of the node (format: remote$local)

在文件 dotnode.h117 行定义.

被这些函数引用 writeBox(), writeDEF(), writeDocbook() , 以及 writeXML().

◆ m_visible

bool DotNode::m_visible = false
private

is the node visible in the output

在文件 dotnode.h126 行定义.

被这些函数引用 isVisible(), markAsVisible() , 以及 write().

◆ m_written

bool DotNode::m_written = false
mutableprivate

used to mark a node as written

在文件 dotnode.h122 行定义.

被这些函数引用 clearWriteFlag(), isWritten() , 以及 write().


该类的文档由以下文件生成:
normalEdgeProps
static EdgeProperties normalEdgeProps
Definition: dotnode.cpp:89
DotNode::m_deleted
bool m_deleted
used to mark a node as deleted
Definition: dotnode.h:121
DotNode::Untruncated
@ Untruncated
Definition: dotnode.h:65
MemberListType_priStaticMethods
@ MemberListType_priStaticMethods
Definition: types.h:114
MemberListType_priStaticAttribs
@ MemberListType_priStaticAttribs
Definition: types.h:125
Config_getEnum
#define Config_getEnum(name)
Definition: config.h:35
DotNode::Unknown
@ Unknown
Definition: dotnode.h:65
MemberListType_pacStaticAttribs
@ MemberListType_pacStaticAttribs
Definition: types.h:124
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
EdgeInfo::Red
@ Red
Definition: dotnode.h:34
DotNode::m_number
int m_number
Definition: dotnode.h:114
QCString::findRev
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:86
MemberListType_priAttribs
@ MemberListType_priAttribs
Definition: types.h:121
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
DotNode::m_classDef
const ClassDef * m_classDef
class representing this node (can be 0)
Definition: dotnode.h:125
MemberListType_priSlots
@ MemberListType_priSlots
Definition: types.h:117
QCString::str
std::string str() const
Definition: qcstring.h:442
EdgeProperties::edgeStyleMap
const char *const * edgeStyleMap
Definition: dotnode.cpp:44
DotNode::isRenumbered
bool isRenumbered() const
Definition: dotnode.h:95
MemberListType_proAttribs
@ MemberListType_proAttribs
Definition: types.h:119
MemberListType_pubMethods
@ MemberListType_pubMethods
Definition: types.h:107
Definition::getLanguage
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
escapeTooltip
static QCString escapeTooltip(const QCString &tooltip)
Definition: dotnode.cpp:99
EdgeInfo::Orange
@ Orange
Definition: dotnode.h:34
EdgeInfo::label
QCString label() const
Definition: dotnode.h:41
DotNode::Truncated
@ Truncated
Definition: dotnode.h:65
StringUnorderedSet
std::unordered_set< std::string > StringUnorderedSet
Definition: containers.h:28
uint
unsigned uint
Definition: qcstring.h:40
DotNode::m_subgraphId
int m_subgraphId
Definition: dotnode.h:130
DotNode::m_written
bool m_written
used to mark a node as written
Definition: dotnode.h:122
addHtmlExtensionIfMissing
QCString addHtmlExtensionIfMissing(const QCString &fName)
Definition: util.cpp:5275
MemberListType_pubSlots
@ MemberListType_pubSlots
Definition: types.h:115
Config_getInt
#define Config_getInt(name)
Definition: config.h:34
MemberListType_proStaticMethods
@ MemberListType_proStaticMethods
Definition: types.h:112
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
DotNode::m_renumbered
bool m_renumbered
indicates if the node has been renumbered (to prevent endless loops)
Definition: dotnode.h:129
DotNode::number
int number() const
Definition: dotnode.h:90
DotNode::writeBox
void writeBox(TextStream &t, GraphType gt, GraphOutputFormat f, bool hasNonReachableChildren) const
Definition: dotnode.cpp:357
NONE
@ NONE
Definition: htmldocvisitor.cpp:42
writeBoxMemberList
static void writeBoxMemberList(TextStream &t, char prot, const MemberList *ml, const ClassDef *scope, bool isStatic=FALSE, const StringUnorderedSet *skipNames=nullptr)
Definition: dotnode.cpp:117
DotNode::m_tooltip
QCString m_tooltip
node's tooltip
Definition: dotnode.h:116
DotNode::subgraphId
int subgraphId() const
Definition: dotnode.h:94
EdgeProperties::edgeColorMap
const char *const * edgeColorMap
Definition: dotnode.cpp:42
TRUE
#define TRUE
Definition: qcstring.h:36
EdgeInfo::Blue
@ Blue
Definition: dotnode.h:34
SrcLangExt_Fortran
@ SrcLangExt_Fortran
Definition: types.h:53
MemberListType_pacAttribs
@ MemberListType_pacAttribs
Definition: types.h:120
stripProtectionPrefix
static QCString stripProtectionPrefix(const QCString &s)
Definition: dotnode.cpp:254
Collaboration
@ Collaboration
Definition: dotgraph.h:29
MemberListType_pubStaticAttribs
@ MemberListType_pubStaticAttribs
Definition: types.h:122
DotNode::m_url
QCString m_url
url of the node (format: remote$local)
Definition: dotnode.h:117
DotNode::edgeInfo
const EdgeInfoVector & edgeInfo() const
Definition: dotnode.h:111
DotNode::writeArrow
void writeArrow(TextStream &t, GraphType gt, GraphOutputFormat f, const DotNode *cn, const EdgeInfo *ei, bool topDown, bool pointBack=TRUE) const
Definition: dotnode.cpp:483
MemberListType_proMethods
@ MemberListType_proMethods
Definition: types.h:108
EdgeInfo
Attributes of an edge of a dot graph
Definition: dotnode.h:31
MemberListType_pacMethods
@ MemberListType_pacMethods
Definition: types.h:109
GOF_BITMAP
@ GOF_BITMAP
Definition: dotgraph.h:27
EdgeProperties::arrowStyleMap
const char *const * arrowStyleMap
Definition: dotnode.cpp:43
MemberListType_proStaticAttribs
@ MemberListType_proStaticAttribs
Definition: types.h:123
umlEdgeProps
static EdgeProperties umlEdgeProps
Definition: dotnode.cpp:94
DotNode::m_truncated
TruncState m_truncated
does the node have non-visible children/parents
Definition: dotnode.h:127
EdgeInfo::style
int style() const
Definition: dotnode.h:40
EdgeProperties
Helper struct holding the properties of a edge in a dot graph.
Definition: dotnode.cpp:27
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
DotNode::distance
int distance() const
Definition: dotnode.h:93
DotNode::m_hasDoc
bool m_hasDoc
used to mark a node as documented
Definition: dotnode.h:123
EdgeInfo::color
int color() const
Definition: dotnode.h:39
MemberListType_priMethods
@ MemberListType_priMethods
Definition: types.h:110
EdgeInfo::Green
@ Green
Definition: dotnode.h:34
DotNode::m_isRoot
bool m_isRoot
indicates if this is a root node
Definition: dotnode.h:124
DotNode::m_distance
int m_distance
shortest path to the root node
Definition: dotnode.h:128
MemberListType_proSlots
@ MemberListType_proSlots
Definition: types.h:116
DotNode::m_edgeInfo
EdgeInfoVector m_edgeInfo
edge info for each child
Definition: dotnode.h:120
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
Config_getString
#define Config_getString(name)
Definition: config.h:32
EdgeInfo::Purple
@ Purple
Definition: dotnode.h:34
Inheritance
@ Inheritance
Definition: dotgraph.h:29
DotNode::m_visible
bool m_visible
is the node visible in the output
Definition: dotnode.h:126
MemberListType_pubAttribs
@ MemberListType_pubAttribs
Definition: types.h:118
ASSERT
#define ASSERT(x)
Definition: qcstring.h:44
ClassDef::getMemberList
virtual MemberList * getMemberList(MemberListType lt) const =0
Returns the members in the list identified by lt
convertToXML
QCString convertToXML(const QCString &s, bool keepEntities)
Definition: util.cpp:3948
EdgeInfo::Orange2
@ Orange2
Definition: dotnode.h:34
MemberListType_pacStaticMethods
@ MemberListType_pacStaticMethods
Definition: types.h:113
DotNode::convertLabel
static QCString convertLabel(const QCString &l)
Definition: dotnode.cpp:184
DotNode::m_children
DotNodeRefVector m_children
list of child nodes (outgoing arrows)
Definition: dotnode.h:119
ClassDef::getMemberGroups
virtual const MemberGroupList & getMemberGroups() const =0
Returns the member groups defined for this class
MemberListType_properties
@ MemberListType_properties
Definition: types.h:134
DotNode::deleteNode
void deleteNode(DotNodeRefVector &deletedList)
Definition: dotnode.cpp:315
MemberListType_pubStaticMethods
@ MemberListType_pubStaticMethods
Definition: types.h:111
DotNode::m_parents
DotNodeRefVector m_parents
list of parent nodes (incoming arrows)
Definition: dotnode.h:118
DotNodeRefVector
std::vector< DotNode * > DotNodeRefVector
Definition: dotnode.h:52
QCString::right
QCString right(size_t len) const
Definition: qcstring.h:217
DotNode::m_label
QCString m_label
label text
Definition: dotnode.h:115
EdgeInfo::Grey
@ Grey
Definition: dotnode.h:34
DotNode::children
const DotNodeRefVector & children() const
Definition: dotnode.h:109
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108
DotNode::markRenumbered
void markRenumbered()
Definition: dotnode.h:101