My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Enumerations | Functions
dot.h File Reference
#include <qlist.h>
#include <qdict.h>
#include <qwaitcondition.h>
#include <qmutex.h>
#include <qqueue.h>
#include <qthread.h>
#include "sortdict.h"

Go to the source code of this file.

Classes

struct  EdgeInfo
 
class  DotNode
 
class  DotNodeList
 
class  DotGfxHierarchyTable
 
class  DotClassGraph
 
class  DotInclDepGraph
 
class  DotCallGraph
 
class  DotDirDeps
 
class  DotGroupCollaboration
 
class  DotGroupCollaboration::Link
 
class  DotGroupCollaboration::Edge
 
class  DotConstString
 
class  DotRunner
 
struct  DotRunner::CleanupItem
 
class  DotFilePatcher
 
struct  DotFilePatcher::Map
 
class  DotRunnerQueue
 
class  DotWorkerThread
 
class  DotManager
 

Enumerations

enum  GraphOutputFormat { GOF_BITMAP, GOF_EPS }
 
enum  EmbeddedOutputFormat { EOF_Html, EOF_LaTeX, EOF_Rtf, EOF_DocBook }
 

Functions

void generateGraphLegend (const char *path)
 
void writeDotGraphFromFile (const char *inFile, const char *outDir, const char *outFile, GraphOutputFormat format)
 
void writeDotImageMapFromFile (FTextStream &t, const QCString &inFile, const QCString &outDir, const QCString &relPath, const QCString &baseName, const QCString &context, int graphId=-1)
 
void resetDotNodeNumbering ()
 

Enumeration Type Documentation

Enumerator
EOF_Html 
EOF_LaTeX 
EOF_Rtf 
EOF_DocBook 

Definition at line 43 of file dot.h.

Enumerator
GOF_BITMAP 
GOF_EPS 

Definition at line 42 of file dot.h.

Function Documentation

void generateGraphLegend ( const char *  path)

Generated a graphs legend page

Definition at line 4072 of file dot.cpp.

References IndexList::addImageFile(), DotRunner::addJob(), DotManager::addRun(), DotManager::addSVGObject(), checkAndUpdateMd5Signature(), checkDeliverables(), Config_getEnum, Config_getString, err(), FONTNAME, FONTSIZE, getDotImageExtension(), Doxygen::htmlFileExtension, Doxygen::indexList, DotManager::instance(), removeDotGraph(), theTranslator, Translator::trLegendTitle(), writeGraphFooter(), and writeGraphHeader().

Referenced by writeGraphInfo().

{
QDir d(path);
// store the original directory
if (!d.exists())
{
err("Output dir %s does not exist!\n",path); exit(1);
}
QGString theGraph;
FTextStream md5stream(&theGraph);
md5stream << " Node9 [shape=\"box\",label=\"Inherited\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",fillcolor=\"grey75\",style=\"filled\" fontcolor=\"black\"];\n";
md5stream << " Node10 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << FONTSIZE << "\",style=\"solid\",fontname=\"" << FONTNAME << "\"];\n";
md5stream << " Node10 [shape=\"box\",label=\"PublicBase\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"black\",URL=\"$classPublicBase" << Doxygen::htmlFileExtension << "\"];\n";
md5stream << " Node11 -> Node10 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << FONTSIZE << "\",style=\"solid\",fontname=\"" << FONTNAME << "\"];\n";
md5stream << " Node11 [shape=\"box\",label=\"Truncated\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"red\",URL=\"$classTruncated" << Doxygen::htmlFileExtension << "\"];\n";
md5stream << " Node13 -> Node9 [dir=\"back\",color=\"darkgreen\",fontsize=\"" << FONTSIZE << "\",style=\"solid\",fontname=\"" << FONTNAME << "\"];\n";
md5stream << " Node13 [shape=\"box\",label=\"ProtectedBase\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"black\",URL=\"$classProtectedBase" << Doxygen::htmlFileExtension << "\"];\n";
md5stream << " Node14 -> Node9 [dir=\"back\",color=\"firebrick4\",fontsize=\"" << FONTSIZE << "\",style=\"solid\",fontname=\"" << FONTNAME << "\"];\n";
md5stream << " Node14 [shape=\"box\",label=\"PrivateBase\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"black\",URL=\"$classPrivateBase" << Doxygen::htmlFileExtension << "\"];\n";
md5stream << " Node15 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << FONTSIZE << "\",style=\"solid\",fontname=\"" << FONTNAME << "\"];\n";
md5stream << " Node15 [shape=\"box\",label=\"Undocumented\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"grey75\"];\n";
md5stream << " Node16 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << FONTSIZE << "\",style=\"solid\",fontname=\"" << FONTNAME << "\"];\n";
md5stream << " Node16 [shape=\"box\",label=\"Templ< int >\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"black\",URL=\"$classTempl" << Doxygen::htmlFileExtension << "\"];\n";
md5stream << " Node17 -> Node16 [dir=\"back\",color=\"orange\",fontsize=\"" << FONTSIZE << "\",style=\"dashed\",label=\"< int >\",fontname=\"" << FONTNAME << "\"];\n";
md5stream << " Node17 [shape=\"box\",label=\"Templ< T >\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"black\",URL=\"$classTempl" << Doxygen::htmlFileExtension << "\"];\n";
md5stream << " Node18 -> Node9 [dir=\"back\",color=\"darkorchid3\",fontsize=\"" << FONTSIZE << "\",style=\"dashed\",label=\"m_usedClass\",fontname=\"" << FONTNAME << "\"];\n";
md5stream << " Node18 [shape=\"box\",label=\"Used\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"black\",URL=\"$classUsed" << Doxygen::htmlFileExtension << "\"];\n";
writeGraphFooter(md5stream);
uchar md5_sig[16];
QCString sigStr(33);
MD5Buffer((const unsigned char *)theGraph.data(),theGraph.length(),md5_sig);
MD5SigToString(md5_sig,sigStr.rawData(),33);
QCString absBaseName = (QCString)path+"/graph_legend";
QCString absDotName = absBaseName+".dot";
QCString imgExt = getDotImageExtension();
QCString imgFmt = Config_getEnum(DOT_IMAGE_FORMAT);
QCString imgName = "graph_legend."+imgExt;
QCString absImgName = absBaseName+"."+imgExt;
if (checkAndUpdateMd5Signature(absBaseName,sigStr) ||
!checkDeliverables(absImgName))
{
QFile dotFile(absDotName);
if (!dotFile.open(IO_WriteOnly))
{
err("Could not open file %s for writing\n",dotFile.name().data());
return;
}
FTextStream dotText(&dotFile);
dotText << theGraph;
dotFile.close();
// run dot to generate the a bitmap image from the graph
DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),TRUE,absImgName);
dotRun->addJob(imgFmt,absImgName);
}
else
{
removeDotGraph(absDotName);
}
if (imgExt=="svg")
{
absBaseName+Config_getString(HTML_FILE_EXTENSION),
"graph_legend",
absImgName,QCString());
}
}
void resetDotNodeNumbering ( )
void writeDotGraphFromFile ( const char *  inFile,
const char *  outDir,
const char *  outFile,
GraphOutputFormat  format 
)

Definition at line 4148 of file dot.cpp.

References IndexList::addImageFile(), DotRunner::addJob(), checkDotResult(), Config_getBool, Config_getEnum, err(), getDotImageExtension(), GOF_BITMAP, and Doxygen::indexList.

Referenced by DocbookDocVisitor::startDotFile(), LatexDocVisitor::startDotFile(), HtmlDocVisitor::writeDotFile(), RTFDocVisitor::writeDotFile(), and DocbookDocVisitor::writeDotFile().

{
QDir d(outDir);
if (!d.exists())
{
err("Output dir %s does not exist!\n",outDir); exit(1);
}
QCString imgExt = getDotImageExtension();
QCString imgFmt = Config_getEnum(DOT_IMAGE_FORMAT);
QCString imgName = (QCString)outFile+"."+imgExt;
QCString absImgName = d.absPath().utf8()+"/"+imgName;
QCString absOutFile = d.absPath().utf8()+"/"+outFile;
DotRunner dotRun(inFile,d.absPath().data(),FALSE,absImgName);
if (format==GOF_BITMAP)
dotRun.addJob(imgFmt,absImgName);
else // format==GOF_EPS
{
if (Config_getBool(USE_PDFLATEX))
{
dotRun.addJob("pdf",absOutFile+".pdf");
}
else
{
dotRun.addJob("ps",absOutFile+".eps");
}
}
dotRun.preventCleanUp();
if (!dotRun.run())
{
return;
}
if (format==GOF_BITMAP) checkDotResult(getDotImageExtension(),absImgName);
}
void writeDotImageMapFromFile ( FTextStream t,
const QCString &  inFile,
const QCString &  outDir,
const QCString &  relPath,
const QCString &  baseName,
const QCString &  context,
int  graphId 
)

Writes user defined image map to the output.

Parameters
ttext stream to write to
inFilejust the basename part of the filename
outDiroutput directory
relPathrelative path the to root of the output dir
baseNamethe base name of the output files
contextthe scope in which this graph is found (for resolving links)
graphIda unique id for this graph, use for dynamic sections

Definition at line 4200 of file dot.cpp.

References DotRunner::addJob(), DotFilePatcher::addSVGConversion(), Config_getEnum, convertMapFile(), endl(), err(), getDotImageExtension(), MAP_CMD, DotFilePatcher::run(), and writeSVGFigureLink().

Referenced by HtmlDocVisitor::writeDotFile().

{
QDir d(outDir);
if (!d.exists())
{
err("Output dir %s does not exist!\n",outDir.data()); exit(1);
}
QCString mapName = baseName+".map";
QCString imgExt = getDotImageExtension();
QCString imgFmt = Config_getEnum(DOT_IMAGE_FORMAT);
QCString imgName = baseName+"."+imgExt;
QCString absOutFile = d.absPath().utf8()+"/"+mapName;
DotRunner dotRun(inFile,d.absPath().data(),FALSE);
dotRun.addJob(MAP_CMD,absOutFile);
dotRun.preventCleanUp();
if (!dotRun.run())
{
return;
}
if (imgExt=="svg") // vector graphics
{
//writeSVGFigureLink(t,relPath,inFile,inFile+".svg");
//DotFilePatcher patcher(inFile+".svg");
QCString svgName=outDir+"/"+baseName+".svg";
writeSVGFigureLink(t,relPath,baseName,svgName);
DotFilePatcher patcher(svgName);
patcher.addSVGConversion(relPath,TRUE,context,TRUE,graphId);
patcher.run();
}
else // bitmap graphics
{
t << "<img src=\"" << relPath << imgName << "\" alt=\""
<< imgName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>" << endl
<< "<map name=\"" << mapName << "\" id=\"" << mapName << "\">";
convertMapFile(t, absOutFile, relPath ,TRUE, context);
t << "</map>" << endl;
}
d.remove(absOutFile);
}