My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
DotNode Class Reference

#include <dot.h>

Public Types

enum  GraphType {
  Dependency, Inheritance, Collaboration, Hierarchy,
  CallGraph
}
 
enum  TruncState { Unknown, Truncated, Untruncated }
 

Public Member Functions

 DotNode (int n, const char *lab, const char *tip, const char *url, bool rootNode=FALSE, ClassDef *cd=0)
 
 ~DotNode ()
 
void addChild (DotNode *n, int edgeColor=EdgeInfo::Purple, int edgeStyle=EdgeInfo::Solid, const char *edgeLab=0, const char *edgeURL=0, int edgeLabCol=-1)
 
void addParent (DotNode *n)
 
void deleteNode (DotNodeList &deletedList, SDict< DotNode > *skipNodes=0)
 
void removeChild (DotNode *n)
 
void removeParent (DotNode *n)
 
int findParent (DotNode *n)
 
void write (FTextStream &t, GraphType gt, GraphOutputFormat f, bool topDown, bool toChildren, bool backArrows)
 
void clearWriteFlag ()
 
void writeXML (FTextStream &t, bool isClassGraph)
 
void writeDocbook (FTextStream &t, bool isClassGraph)
 
void writeDEF (FTextStream &t)
 
QCString label () const
 
int number () const
 
bool isVisible () const
 
TruncState isTruncated () const
 
int distance () const
 
void renumberNodes (int &number)
 

Public Attributes

int m_subgraphId
 

Private Member Functions

void colorConnectedNodes (int curColor)
 
void writeBox (FTextStream &t, GraphType gt, GraphOutputFormat f, bool hasNonReachableChildren)
 
void writeArrow (FTextStream &t, GraphType gt, GraphOutputFormat f, DotNode *cn, EdgeInfo *ei, bool topDown, bool pointBack=TRUE)
 
void setDistance (int distance)
 
const DotNodefindDocNode () const
 
void markAsVisible (bool b=TRUE)
 
void markAsTruncated (bool b=TRUE)
 

Private Attributes

int m_number
 
QCString m_label
 label text
 
QCString m_tooltip
 node's tooltip
 
QCString m_url
 url of the node (format: remote$local)
 
QList< DotNode > * m_parents
 list of parent nodes (incoming arrows)
 
QList< DotNode > * m_children
 list of child nodes (outgoing arrows)
 
QList< EdgeInfo > * m_edgeInfo
 edge info for each child
 
bool m_deleted
 used to mark a node as deleted
 
bool m_written
 used to mark a node as written
 
bool m_hasDoc
 used to mark a node as documented
 
bool m_isRoot
 indicates if this is a root node
 
ClassDefm_classDef
 class representing this node (can be 0)
 
bool m_visible
 is the node visible in the output
 
TruncState m_truncated
 does the node have non-visible children/parents
 
int m_distance
 shortest path to the root node
 

Friends

class DotGfxHierarchyTable
 
class DotClassGraph
 
class DotInclDepGraph
 
class DotNodeList
 
class DotCallGraph
 
class DotGroupCollaboration
 
class DotInheritanceGraph
 
QCString computeMd5Signature (DotNode *root, GraphType gt, GraphOutputFormat f, bool lrRank, bool renderParents, bool backArrows, const QCString &title, QCString &graphStr)
 

Detailed Description

A node in a dot graph

Definition at line 60 of file dot.h.

Member Enumeration Documentation

Enumerator
Dependency 
Inheritance 
Collaboration 
Hierarchy 
CallGraph 

Definition at line 63 of file dot.h.

Enumerator
Unknown 
Truncated 
Untruncated 

Definition at line 64 of file dot.h.

Constructor & Destructor Documentation

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

Definition at line 1410 of file dot.cpp.

, m_number(n)
, m_label(lab)
, m_tooltip(tip)
, m_url(url)
, m_parents(0)
, m_deleted(FALSE)
, m_written(FALSE)
, m_hasDoc(FALSE)
, m_isRoot(isRoot)
, m_classDef(cd)
, m_visible(FALSE)
, m_distance(1000)
{
}
DotNode::~DotNode ( )

Definition at line 1431 of file dot.cpp.

References m_children, m_edgeInfo, and m_parents.

{
delete m_children;
delete m_parents;
delete m_edgeInfo;
}

Member Function Documentation

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

Definition at line 1438 of file dot.cpp.

References m_children, EdgeInfo::m_color, m_edgeInfo, EdgeInfo::m_labColor, EdgeInfo::m_label, EdgeInfo::m_style, and EdgeInfo::m_url.

Referenced by DotClassGraph::addClass(), DotGfxHierarchyTable::addHierarchy(), DotInclDepGraph::buildGraph(), and DotCallGraph::buildGraph().

{
if (m_children==0)
{
m_children = new QList<DotNode>;
m_edgeInfo = new QList<EdgeInfo>;
m_edgeInfo->setAutoDelete(TRUE);
}
m_children->append(n);
EdgeInfo *ei = new EdgeInfo;
ei->m_color = edgeColor;
ei->m_style = edgeStyle;
ei->m_label = edgeLab;
ei->m_url = edgeURL;
if (edgeLabCol==-1)
ei->m_labColor=edgeColor;
else
ei->m_labColor=edgeLabCol;
m_edgeInfo->append(ei);
}
void DotNode::addParent ( DotNode n)

Definition at line 1465 of file dot.cpp.

References m_parents.

Referenced by DotClassGraph::addClass(), DotGfxHierarchyTable::addHierarchy(), DotInclDepGraph::buildGraph(), and DotCallGraph::buildGraph().

{
if (m_parents==0)
{
m_parents = new QList<DotNode>;
}
m_parents->append(n);
}
void DotNode::clearWriteFlag ( )

Definition at line 2123 of file dot.cpp.

References clearWriteFlag(), m_children, m_parents, and m_written.

Referenced by clearWriteFlag(), computeMd5Signature(), DotGfxHierarchyTable::createGraph(), and DotGroupCollaboration::writeGraph().

{
m_written=FALSE;
if (m_parents!=0)
{
QListIterator<DotNode> dnlip(*m_parents);
DotNode *pn;
for (dnlip.toFirst();(pn=dnlip.current());++dnlip)
{
if (pn->m_written)
{
}
}
}
if (m_children!=0)
{
QListIterator<DotNode> dnlic(*m_children);
DotNode *cn;
for (dnlic.toFirst();(cn=dnlic.current());++dnlic)
{
if (cn->m_written)
{
}
}
}
}
void DotNode::colorConnectedNodes ( int  curColor)
private

Definition at line 2152 of file dot.cpp.

References colorConnectedNodes(), m_children, m_parents, m_subgraphId, and markAsVisible().

Referenced by colorConnectedNodes(), and DotGfxHierarchyTable::DotGfxHierarchyTable().

{
{
QListIterator<DotNode> dnlic(*m_children);
DotNode *cn;
for (dnlic.toFirst();(cn=dnlic.current());++dnlic)
{
if (cn->m_subgraphId==-1) // uncolored child node
{
cn->m_subgraphId=curColor;
cn->colorConnectedNodes(curColor);
//printf("coloring node %s (%p): %d\n",cn->m_label.data(),cn,cn->m_subgraphId);
}
}
}
if (m_parents)
{
QListIterator<DotNode> dnlip(*m_parents);
DotNode *pn;
for (dnlip.toFirst();(pn=dnlip.current());++dnlip)
{
if (pn->m_subgraphId==-1) // uncolored parent node
{
pn->m_subgraphId=curColor;
pn->colorConnectedNodes(curColor);
//printf("coloring node %s (%p): %d\n",pn->m_label.data(),pn,pn->m_subgraphId);
}
}
}
}
void DotNode::deleteNode ( DotNodeList deletedList,
SDict< DotNode > *  skipNodes = 0 
)

Definition at line 1484 of file dot.cpp.

References deleteNode(), SDict< T >::find(), m_children, m_deleted, and m_parents.

Referenced by deleteNode(), and deleteNodes().

{
if (m_deleted) return; // avoid recursive loops in case the graph has cycles
m_deleted=TRUE;
if (m_parents!=0) // delete all parent nodes of this node
{
QListIterator<DotNode> dnlip(*m_parents);
DotNode *pn;
for (dnlip.toFirst();(pn=dnlip.current());++dnlip)
{
//pn->removeChild(this);
pn->deleteNode(deletedList,skipNodes);
}
}
if (m_children!=0) // delete all child nodes of this node
{
QListIterator<DotNode> dnlic(*m_children);
DotNode *cn;
for (dnlic.toFirst();(cn=dnlic.current());++dnlic)
{
//cn->removeParent(this);
cn->deleteNode(deletedList,skipNodes);
}
}
// add this node to the list of deleted nodes.
//printf("skipNodes=%p find(%p)=%p\n",skipNodes,this,skipNodes ? skipNodes->find((int)this) : 0);
if (skipNodes==0 || skipNodes->find((char*)this)==0)
{
//printf("deleting\n");
deletedList.append(this);
}
}
int DotNode::distance ( ) const
inline
const DotNode * DotNode::findDocNode ( ) const
private

Definition at line 2201 of file dot.cpp.

References findDocNode(), m_children, m_hasDoc, m_parents, and m_url.

Referenced by DotGfxHierarchyTable::DotGfxHierarchyTable(), and findDocNode().

{
if (!m_url.isEmpty()) return this;
//printf("findDocNode(): `%s'\n",m_label.data());
if (m_parents)
{
QListIterator<DotNode> dnli(*m_parents);
DotNode *pn;
for (dnli.toFirst();(pn=dnli.current());++dnli)
{
if (!pn->m_hasDoc)
{
pn->m_hasDoc=TRUE;
const DotNode *dn = pn->findDocNode();
if (dn) return dn;
}
}
}
{
QListIterator<DotNode> dnli(*m_children);
DotNode *cn;
for (dnli.toFirst();(cn=dnli.current());++dnli)
{
if (!cn->m_hasDoc)
{
cn->m_hasDoc=TRUE;
const DotNode *dn = cn->findDocNode();
if (dn) return dn;
}
}
}
return 0;
}
int DotNode::findParent ( DotNode n)
inline

Definition at line 736 of file dot.cpp.

References m_parents.

{
if ( !m_parents ) return -1;
return m_parents->find(n);
}
TruncState DotNode::isTruncated ( ) const
inline
bool DotNode::isVisible ( ) const
inline
QCString DotNode::label ( ) const
inline
void DotNode::markAsTruncated ( bool  b = TRUE)
inlineprivate
void DotNode::markAsVisible ( bool  b = TRUE)
inlineprivate
int DotNode::number ( ) const
inline

Definition at line 88 of file dot.h.

References m_number.

Referenced by DotGroupCollaboration::Edge::write(), and writeArrow().

{ return m_number; }
void DotNode::removeChild ( DotNode n)

Definition at line 1474 of file dot.cpp.

References m_children.

{
if (m_children) m_children->remove(n);
}
void DotNode::removeParent ( DotNode n)

Definition at line 1479 of file dot.cpp.

References m_parents.

{
if (m_parents) m_parents->remove(n);
}
void DotNode::renumberNodes ( int &  number)

Definition at line 2187 of file dot.cpp.

References m_children, m_number, and renumberNodes().

Referenced by DotGfxHierarchyTable::DotGfxHierarchyTable(), and renumberNodes().

{
{
QListIterator<DotNode> dnlic(*m_children);
DotNode *cn;
for (dnlic.toFirst();(cn=dnlic.current());++dnlic)
{
}
}
}
void DotNode::setDistance ( int  distance)
private
void DotNode::write ( FTextStream t,
GraphType  gt,
GraphOutputFormat  f,
bool  topDown,
bool  toChildren,
bool  backArrows 
)

Definition at line 1863 of file dot.cpp.

References isVisible(), m_children, m_edgeInfo, m_parents, m_truncated, m_visible, m_written, Truncated, write(), writeArrow(), and writeBox().

Referenced by computeMd5Signature(), DotGfxHierarchyTable::createGraph(), write(), and DotGroupCollaboration::writeGraph().

{
//printf("DotNode::write(%d) name=%s this=%p written=%d visible=%d\n",m_distance,m_label.data(),this,m_written,m_visible);
if (m_written) return; // node already written to the output
if (!m_visible) return; // node is not visible
m_written=TRUE;
QList<DotNode> *nl = toChildren ? m_children : m_parents;
if (nl)
{
if (toChildren)
{
QListIterator<DotNode> dnli1(*nl);
QListIterator<EdgeInfo> dnli2(*m_edgeInfo);
DotNode *cn;
for (dnli1.toFirst();(cn=dnli1.current());++dnli1,++dnli2)
{
if (cn->isVisible())
{
//printf("write arrow %s%s%s\n",label().data(),backArrows?"<-":"->",cn->label().data());
writeArrow(t,gt,format,cn,dnli2.current(),topDown,backArrows);
}
cn->write(t,gt,format,topDown,toChildren,backArrows);
}
}
else // render parents
{
QListIterator<DotNode> dnli(*nl);
DotNode *pn;
for (dnli.toFirst();(pn=dnli.current());++dnli)
{
if (pn->isVisible())
{
//printf("write arrow %s%s%s\n",label().data(),backArrows?"<-":"->",pn->label().data());
gt,
format,
pn,
pn->m_edgeInfo->at(pn->m_children->findRef(this)),
FALSE,
backArrows
);
}
pn->write(t,gt,format,TRUE,FALSE,backArrows);
}
}
}
//printf("end DotNode::write(%d) name=%s\n",distance,m_label.data());
}
void DotNode::writeArrow ( FTextStream t,
GraphType  gt,
GraphOutputFormat  f,
DotNode cn,
EdgeInfo ei,
bool  topDown,
bool  pointBack = TRUE 
)
private

Definition at line 1812 of file dot.cpp.

References EdgeProperties::arrowStyleMap, Collaboration, Config_getBool, convertLabel(), EdgeProperties::edgeColorMap, EdgeProperties::edgeStyleMap, endl(), FONTNAME, FONTSIZE, GOF_BITMAP, Inheritance, EdgeInfo::m_color, EdgeInfo::m_label, m_number, EdgeInfo::m_style, normalEdgeProps, and number().

Referenced by computeMd5Signature(), and write().

{
t << " Node";
if (topDown)
t << cn->number();
else
t << m_number;
t << " -> Node";
if (topDown)
t << m_number;
else
t << cn->number();
t << " [";
static bool umlLook = Config_getBool(UML_LOOK);
const EdgeProperties *eProps = umlLook ? &umlEdgeProps : &normalEdgeProps;
QCString aStyle = eProps->arrowStyleMap[ei->m_color];
bool umlUseArrow = aStyle=="odiamond";
if (pointBack && !umlUseArrow) t << "dir=\"back\",";
t << "color=\"" << eProps->edgeColorMap[ei->m_color]
<< "\",fontsize=\"" << FONTSIZE << "\",";
t << "style=\"" << eProps->edgeStyleMap[ei->m_style] << "\"";
if (!ei->m_label.isEmpty())
{
t << ",label=\" " << convertLabel(ei->m_label) << "\" ";
}
if (umlLook &&
eProps->arrowStyleMap[ei->m_color] &&
)
{
bool rev = pointBack;
if (umlUseArrow) rev=!rev; // UML use relates has arrow on the start side
if (rev)
t << ",arrowtail=\"" << eProps->arrowStyleMap[ei->m_color] << "\"";
else
t << ",arrowhead=\"" << eProps->arrowStyleMap[ei->m_color] << "\"";
}
if (format==GOF_BITMAP) t << ",fontname=\"" << FONTNAME << "\"";
t << "];" << endl;
}
void DotNode::writeBox ( FTextStream t,
GraphType  gt,
GraphOutputFormat  f,
bool  hasNonReachableChildren 
)
private

Definition at line 1680 of file dot.cpp.

References Collaboration, Config_getBool, convertLabel(), endl(), escapeTooltip(), Definition::getLanguage(), ClassDef::getMemberGroupSDict(), ClassDef::getMemberList(), Doxygen::htmlFileExtension, Inheritance, SIntDict< MemberGroup >::Iterator, m_classDef, m_edgeInfo, m_isRoot, EdgeInfo::m_label, 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, SrcLangExt_Fortran, stripProtectionPrefix(), and writeBoxMemberList().

Referenced by write().

{
const char *labCol =
m_url.isEmpty() ? "grey75" : // non link
(
(hasNonReachableChildren) ? "red" : "black"
);
t << " Node" << m_number << " [label=\"";
static bool umlLook = Config_getBool(UML_LOOK);
if (m_classDef && umlLook && (gt==Inheritance || gt==Collaboration))
{
// add names shown as relations to a dictionary, so we don't show
// them as attributes as well
QDict<void> arrowNames(17);
{
// for each edge
QListIterator<EdgeInfo> li(*m_edgeInfo);
EdgeInfo *ei;
for (li.toFirst();(ei=li.current());++li)
{
if (!ei->m_label.isEmpty()) // labels joined by \n
{
int li=ei->m_label.find('\n');
int p=0;
QCString lab;
while ((li=ei->m_label.find('\n',p))!=-1)
{
lab = stripProtectionPrefix(ei->m_label.mid(p,li-p));
arrowNames.insert(lab,(void*)0x8);
p=li+1;
}
lab = stripProtectionPrefix(ei->m_label.right(ei->m_label.length()-p));
arrowNames.insert(lab,(void*)0x8);
}
}
}
//printf("DotNode::writeBox for %s\n",m_classDef->name().data());
static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
t << "{" << convertLabel(m_label);
t << "\\n|";
if (extractPrivate)
{
}
t << "|";
if (extractPrivate)
{
}
{
for (mgdi.toFirst();(mg=mgdi.current());++mgdi)
{
if (mg->members())
{
writeBoxMemberList(t,'*',mg->members(),m_classDef,FALSE,&arrowNames);
}
}
}
t << "}";
}
else // standard look
{
}
t << "\",height=0.2,width=0.4";
if (m_isRoot)
{
t << ",color=\"black\", fillcolor=\"grey75\", style=\"filled\", fontcolor=\"black\"";
}
else
{
static bool dotTransparent = Config_getBool(DOT_TRANSPARENT);
if (!dotTransparent)
{
t << ",color=\"" << labCol << "\", fillcolor=\"";
t << "white";
t << "\", style=\"filled\"";
}
else
{
t << ",color=\"" << labCol << "\"";
}
if (!m_url.isEmpty())
{
int anchorPos = m_url.findRev('#');
if (anchorPos==-1)
{
t << ",URL=\"" << m_url << Doxygen::htmlFileExtension << "\"";
}
else
{
t << ",URL=\"" << m_url.left(anchorPos) << Doxygen::htmlFileExtension
<< m_url.right(m_url.length()-anchorPos) << "\"";
}
}
if (!m_tooltip.isEmpty())
{
t << ",tooltip=\"" << escapeTooltip(m_tooltip) << "\"";
}
}
t << "];" << endl;
}
void DotNode::writeDEF ( FTextStream t)

Definition at line 2058 of file dot.cpp.

References EdgeInfo::Blue, endl(), EdgeInfo::Green, EdgeInfo::Grey, m_children, EdgeInfo::m_color, m_edgeInfo, EdgeInfo::m_label, m_label, m_number, m_url, EdgeInfo::Orange, EdgeInfo::Orange2, EdgeInfo::Purple, and EdgeInfo::Red.

Referenced by DotClassGraph::writeDEF().

{
const char* nodePrefix = " node-";
t << " node = {" << endl;
t << nodePrefix << "id = " << m_number << ';' << endl;
t << nodePrefix << "label = '" << m_label << "';" << endl;
if (!m_url.isEmpty())
{
QCString url(m_url);
const char *refPtr = url.data();
char *urlPtr = strchr(url.rawData(),'$');
if (urlPtr)
{
*urlPtr++='\0';
t << nodePrefix << "link = {" << endl << " "
<< nodePrefix << "link-id = '" << urlPtr << "';" << endl;
if (*refPtr!='\0')
{
t << " " << nodePrefix << "link-external = '"
<< refPtr << "';" << endl;
}
t << " };" << endl;
}
}
{
QListIterator<DotNode> nli(*m_children);
QListIterator<EdgeInfo> eli(*m_edgeInfo);
DotNode *childNode;
EdgeInfo *edgeInfo;
for (;(childNode=nli.current());++nli,++eli)
{
edgeInfo=eli.current();
t << " node-child = {" << endl;
t << " child-id = '" << childNode->m_number << "';" << endl;
t << " relation = ";
switch(edgeInfo->m_color)
{
case EdgeInfo::Blue: t << "public-inheritance"; break;
case EdgeInfo::Green: t << "protected-inheritance"; break;
case EdgeInfo::Red: t << "private-inheritance"; break;
case EdgeInfo::Purple: t << "usage"; break;
case EdgeInfo::Orange: t << "template-instance"; break;
case EdgeInfo::Orange2: t << "type-constraint"; break;
case EdgeInfo::Grey: ASSERT(0); break;
}
t << ';' << endl;
if (!edgeInfo->m_label.isEmpty())
{
t << " edgelabel = <<_EnD_oF_dEf_TeXt_" << endl
<< edgeInfo->m_label << endl
<< "_EnD_oF_dEf_TeXt_;" << endl;
}
t << " }; /* node-child */" << endl;
} /* for (;childNode...) */
}
t << " }; /* node */" << endl;
}
void DotNode::writeDocbook ( FTextStream t,
bool  isClassGraph 
)

Definition at line 1988 of file dot.cpp.

References EdgeInfo::Blue, convertToXML(), endl(), EdgeInfo::Green, EdgeInfo::Grey, m_children, EdgeInfo::m_color, m_edgeInfo, EdgeInfo::m_label, m_label, m_number, m_url, EdgeInfo::Orange, EdgeInfo::Orange2, EdgeInfo::Purple, and EdgeInfo::Red.

Referenced by DotClassGraph::writeDocbook(), and DotInclDepGraph::writeDocbook().

{
t << " <node id=\"" << m_number << "\">" << endl;
t << " <label>" << convertToXML(m_label) << "</label>" << endl;
if (!m_url.isEmpty())
{
QCString url(m_url);
const char *refPtr = url.data();
char *urlPtr = strchr(url.rawData(),'$');
if (urlPtr)
{
*urlPtr++='\0';
t << " <link refid=\"" << convertToXML(urlPtr) << "\"";
if (*refPtr!='\0')
{
t << " external=\"" << convertToXML(refPtr) << "\"";
}
t << "/>" << endl;
}
}
{
QListIterator<DotNode> nli(*m_children);
QListIterator<EdgeInfo> eli(*m_edgeInfo);
DotNode *childNode;
EdgeInfo *edgeInfo;
for (;(childNode=nli.current());++nli,++eli)
{
edgeInfo=eli.current();
t << " <childnode refid=\"" << childNode->m_number << "\" relation=\"";
if (isClassGraph)
{
switch(edgeInfo->m_color)
{
case EdgeInfo::Blue: t << "public-inheritance"; break;
case EdgeInfo::Green: t << "protected-inheritance"; break;
case EdgeInfo::Red: t << "private-inheritance"; break;
case EdgeInfo::Purple: t << "usage"; break;
case EdgeInfo::Orange: t << "template-instance"; break;
case EdgeInfo::Orange2: t << "type-constraint"; break;
case EdgeInfo::Grey: ASSERT(0); break;
}
}
else // include graph
{
t << "include";
}
t << "\">" << endl;
if (!edgeInfo->m_label.isEmpty())
{
int p=0;
int ni;
while ((ni=edgeInfo->m_label.find('\n',p))!=-1)
{
t << " <edgelabel>"
<< convertToXML(edgeInfo->m_label.mid(p,ni-p))
<< "</edgelabel>" << endl;
p=ni+1;
}
t << " <edgelabel>"
<< convertToXML(edgeInfo->m_label.right(edgeInfo->m_label.length()-p))
<< "</edgelabel>" << endl;
}
t << " </childnode>" << endl;
}
}
t << " </node>" << endl;
}
void DotNode::writeXML ( FTextStream t,
bool  isClassGraph 
)

Definition at line 1919 of file dot.cpp.

References EdgeInfo::Blue, convertToXML(), endl(), EdgeInfo::Green, EdgeInfo::Grey, m_children, EdgeInfo::m_color, m_edgeInfo, EdgeInfo::m_label, m_label, m_number, m_url, EdgeInfo::Orange, EdgeInfo::Orange2, EdgeInfo::Purple, and EdgeInfo::Red.

Referenced by DotClassGraph::writeXML(), and DotInclDepGraph::writeXML().

{
t << " <node id=\"" << m_number << "\">" << endl;
t << " <label>" << convertToXML(m_label) << "</label>" << endl;
if (!m_url.isEmpty())
{
QCString url(m_url);
const char *refPtr = url.data();
char *urlPtr = strchr(url.rawData(),'$');
if (urlPtr)
{
*urlPtr++='\0';
t << " <link refid=\"" << convertToXML(urlPtr) << "\"";
if (*refPtr!='\0')
{
t << " external=\"" << convertToXML(refPtr) << "\"";
}
t << "/>" << endl;
}
}
{
QListIterator<DotNode> nli(*m_children);
QListIterator<EdgeInfo> eli(*m_edgeInfo);
DotNode *childNode;
EdgeInfo *edgeInfo;
for (;(childNode=nli.current());++nli,++eli)
{
edgeInfo=eli.current();
t << " <childnode refid=\"" << childNode->m_number << "\" relation=\"";
if (isClassGraph)
{
switch(edgeInfo->m_color)
{
case EdgeInfo::Blue: t << "public-inheritance"; break;
case EdgeInfo::Green: t << "protected-inheritance"; break;
case EdgeInfo::Red: t << "private-inheritance"; break;
case EdgeInfo::Purple: t << "usage"; break;
case EdgeInfo::Orange: t << "template-instance"; break;
case EdgeInfo::Orange2: t << "type-constraint"; break;
case EdgeInfo::Grey: ASSERT(0); break;
}
}
else // include graph
{
t << "include";
}
t << "\">" << endl;
if (!edgeInfo->m_label.isEmpty())
{
int p=0;
int ni;
while ((ni=edgeInfo->m_label.find('\n',p))!=-1)
{
t << " <edgelabel>"
<< convertToXML(edgeInfo->m_label.mid(p,ni-p))
<< "</edgelabel>" << endl;
p=ni+1;
}
t << " <edgelabel>"
<< convertToXML(edgeInfo->m_label.right(edgeInfo->m_label.length()-p))
<< "</edgelabel>" << endl;
}
t << " </childnode>" << endl;
}
}
t << " </node>" << endl;
}

Friends And Related Function Documentation

QCString computeMd5Signature ( DotNode root,
DotNode::GraphType  gt,
GraphOutputFormat  f,
bool  lrRank,
bool  renderParents,
bool  backArrows,
const QCString &  title,
QCString &  graphStr 
)
friend

Computes a 16 byte md5 checksum for a given dot graph. The md5 checksum is returned as a 32 character ASCII string.

Definition at line 2990 of file dot.cpp.

{
//printf("computeMd5Signature\n");
QGString buf;
FTextStream md5stream(&buf);
writeGraphHeader(md5stream,title);
if (lrRank)
{
md5stream << " rankdir=\"LR\";" << endl;
}
root->clearWriteFlag();
root->write(md5stream,
gt,
format,
TRUE,
backArrows);
if (renderParents && root->m_parents)
{
QListIterator<DotNode> dnli(*root->m_parents);
DotNode *pn;
for (dnli.toFirst();(pn=dnli.current());++dnli)
{
if (pn->isVisible())
{
root->writeArrow(md5stream, // stream
gt, // graph type
format, // output format
pn, // child node
pn->m_edgeInfo->at(pn->m_children->findRef(root)), // edge info
FALSE, // topDown?
backArrows // point back?
);
}
pn->write(md5stream, // stream
gt, // graph type
format, // output format
TRUE, // topDown?
FALSE, // toChildren?
backArrows // backward pointing arrows?
);
}
}
writeGraphFooter(md5stream);
uchar md5_sig[16];
QCString sigStr(33);
MD5Buffer((const unsigned char *)buf.data(),buf.length(),md5_sig);
MD5SigToString(md5_sig,sigStr.rawData(),33);
graphStr=buf.data();
//printf("md5: %s | file: %s\n",sigStr,baseName.data());
return sigStr;
}
friend class DotCallGraph
friend

Definition at line 124 of file dot.h.

friend class DotClassGraph
friend

Definition at line 121 of file dot.h.

friend class DotGfxHierarchyTable
friend

Definition at line 120 of file dot.h.

friend class DotGroupCollaboration
friend

Definition at line 125 of file dot.h.

friend class DotInclDepGraph
friend

Definition at line 122 of file dot.h.

friend class DotInheritanceGraph
friend

Definition at line 126 of file dot.h.

friend class DotNodeList
friend

Definition at line 123 of file dot.h.

Member Data Documentation

QList<DotNode>* DotNode::m_children
private
ClassDef* DotNode::m_classDef
private

class representing this node (can be 0)

Definition at line 115 of file dot.h.

Referenced by writeBox().

bool DotNode::m_deleted
private

used to mark a node as deleted

Definition at line 111 of file dot.h.

Referenced by deleteNode().

int DotNode::m_distance
private

shortest path to the root node

Definition at line 118 of file dot.h.

Referenced by distance(), and setDistance().

QList<EdgeInfo>* DotNode::m_edgeInfo
private

edge info for each child

Definition at line 110 of file dot.h.

Referenced by addChild(), computeMd5Signature(), write(), writeBox(), writeDEF(), writeDocbook(), writeXML(), and ~DotNode().

bool DotNode::m_hasDoc
private

used to mark a node as documented

Definition at line 113 of file dot.h.

Referenced by findDocNode().

bool DotNode::m_isRoot
private

indicates if this is a root node

Definition at line 114 of file dot.h.

Referenced by writeBox().

QCString DotNode::m_label
private
int DotNode::m_number
private

Definition at line 104 of file dot.h.

Referenced by number(), renumberNodes(), writeArrow(), writeBox(), writeDEF(), writeDocbook(), and writeXML().

QList<DotNode>* DotNode::m_parents
private
int DotNode::m_subgraphId
QCString DotNode::m_tooltip
private

node's tooltip

Definition at line 106 of file dot.h.

Referenced by writeBox().

TruncState DotNode::m_truncated
private

does the node have non-visible children/parents

Definition at line 117 of file dot.h.

Referenced by isTruncated(), markAsTruncated(), and write().

QCString DotNode::m_url
private

url of the node (format: remote$local)

Definition at line 107 of file dot.h.

Referenced by findDocNode(), writeBox(), writeDEF(), writeDocbook(), and writeXML().

bool DotNode::m_visible
private

is the node visible in the output

Definition at line 116 of file dot.h.

Referenced by isVisible(), markAsVisible(), and write().

bool DotNode::m_written
private

used to mark a node as written

Definition at line 112 of file dot.h.

Referenced by clearWriteFlag(), and write().


The documentation for this class was generated from the following files: