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)
 

Enumeration Type Documentation

Enumerator
EOF_Html 
EOF_LaTeX 
EOF_Rtf 
EOF_DocBook 

Definition at line 43 of file dot.h.

Definition: dot.h:43
Definition: dot.h:43
Definition: dot.h:43
Enumerator
GOF_BITMAP 
GOF_EPS 

Definition at line 42 of file dot.h.

42 { GOF_BITMAP, GOF_EPS };
Definition: dot.h:42
Definition: dot.h:42

Function Documentation

void generateGraphLegend ( const char *  path)

Generated a graphs legend page

Definition at line 4127 of file dot.cpp.

4128 {
4129  QDir d(path);
4130  // store the original directory
4131  if (!d.exists())
4132  {
4133  err("Output dir %s does not exist!\n",path); exit(1);
4134  }
4135 
4136  QGString theGraph;
4137  FTextStream md5stream(&theGraph);
4139  md5stream << " Node9 [shape=\"box\",label=\"Inherited\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",fillcolor=\"grey75\",style=\"filled\" fontcolor=\"black\"];\n";
4140  md5stream << " Node10 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << FONTSIZE << "\",style=\"solid\",fontname=\"" << FONTNAME << "\"];\n";
4141  md5stream << " Node10 [shape=\"box\",label=\"PublicBase\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"black\",URL=\"$classPublicBase" << Doxygen::htmlFileExtension << "\"];\n";
4142  md5stream << " Node11 -> Node10 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << FONTSIZE << "\",style=\"solid\",fontname=\"" << FONTNAME << "\"];\n";
4143  md5stream << " Node11 [shape=\"box\",label=\"Truncated\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"red\",URL=\"$classTruncated" << Doxygen::htmlFileExtension << "\"];\n";
4144  md5stream << " Node13 -> Node9 [dir=\"back\",color=\"darkgreen\",fontsize=\"" << FONTSIZE << "\",style=\"solid\",fontname=\"" << FONTNAME << "\"];\n";
4145  md5stream << " Node13 [shape=\"box\",label=\"ProtectedBase\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"black\",URL=\"$classProtectedBase" << Doxygen::htmlFileExtension << "\"];\n";
4146  md5stream << " Node14 -> Node9 [dir=\"back\",color=\"firebrick4\",fontsize=\"" << FONTSIZE << "\",style=\"solid\",fontname=\"" << FONTNAME << "\"];\n";
4147  md5stream << " Node14 [shape=\"box\",label=\"PrivateBase\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"black\",URL=\"$classPrivateBase" << Doxygen::htmlFileExtension << "\"];\n";
4148  md5stream << " Node15 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << FONTSIZE << "\",style=\"solid\",fontname=\"" << FONTNAME << "\"];\n";
4149  md5stream << " Node15 [shape=\"box\",label=\"Undocumented\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"grey75\"];\n";
4150  md5stream << " Node16 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << FONTSIZE << "\",style=\"solid\",fontname=\"" << FONTNAME << "\"];\n";
4151  md5stream << " Node16 [shape=\"box\",label=\"Templ< int >\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"black\",URL=\"$classTempl" << Doxygen::htmlFileExtension << "\"];\n";
4152  md5stream << " Node17 -> Node16 [dir=\"back\",color=\"orange\",fontsize=\"" << FONTSIZE << "\",style=\"dashed\",label=\"< int >\",fontname=\"" << FONTNAME << "\"];\n";
4153  md5stream << " Node17 [shape=\"box\",label=\"Templ< T >\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"black\",URL=\"$classTempl" << Doxygen::htmlFileExtension << "\"];\n";
4154  md5stream << " Node18 -> Node9 [dir=\"back\",color=\"darkorchid3\",fontsize=\"" << FONTSIZE << "\",style=\"dashed\",label=\"m_usedClass\",fontname=\"" << FONTNAME << "\"];\n";
4155  md5stream << " Node18 [shape=\"box\",label=\"Used\",fontsize=\"" << FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << FONTNAME << "\",color=\"black\",URL=\"$classUsed" << Doxygen::htmlFileExtension << "\"];\n";
4156  writeGraphFooter(md5stream);
4157  uchar md5_sig[16];
4158  QCString sigStr(33);
4159  MD5Buffer((const unsigned char *)theGraph.data(),theGraph.length(),md5_sig);
4160  MD5SigToString(md5_sig,sigStr.rawData(),33);
4161  QCString absBaseName = (QCString)path+"/graph_legend";
4162  QCString absDotName = absBaseName+".dot";
4163  QCString imgExt = getDotImageExtension();
4164  QCString imgFmt = Config_getEnum("DOT_IMAGE_FORMAT");
4165  QCString imgName = "graph_legend."+imgExt;
4166  QCString absImgName = absBaseName+"."+imgExt;
4167  if (checkAndUpdateMd5Signature(absBaseName,sigStr) ||
4168  !checkDeliverables(absImgName))
4169  {
4170  QFile dotFile(absDotName);
4171  if (!dotFile.open(IO_WriteOnly))
4172  {
4173  err("Could not open file %s for writing\n",dotFile.name().data());
4174  return;
4175  }
4176 
4177  FTextStream dotText(&dotFile);
4178  dotText << theGraph;
4179  dotFile.close();
4180 
4181  // run dot to generate the a bitmap image from the graph
4182 
4183  DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),TRUE,absImgName);
4184  dotRun->addJob(imgFmt,absImgName);
4185  DotManager::instance()->addRun(dotRun);
4186  }
4187  else
4188  {
4189  removeDotGraph(absDotName);
4190  }
4191  Doxygen::indexList->addImageFile(imgName);
4192 
4193  if (imgExt=="svg")
4194  {
4196  absBaseName+Config_getString("HTML_FILE_EXTENSION"),
4197  "graph_legend",
4198  absImgName,QCString());
4199  }
4200 
4201 }
Traverses directory structures and contents in a platform-independent way.
Definition: qdir.h:52
char * data() const
Definition: qgstring.h:42
static bool checkAndUpdateMd5Signature(const QCString &baseName, const QCString &md5)
Definition: dot.cpp:731
Definition: dot.h:356
uint length() const
Definition: qgstring.h:40
static bool checkDeliverables(const QCString &file1, const QCString &file2=QCString())
Definition: dot.cpp:758
#define IO_WriteOnly
Definition: qiodevice.h:62
static QCString htmlFileExtension
Definition: doxygen.h:130
virtual QCString trLegendTitle()=0
static DotManager * instance()
Definition: dot.cpp:1221
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
unsigned char uchar
Definition: nybbler.cc:11
static void writeGraphHeader(FTextStream &t, const QCString &title=QCString())
Definition: dot.cpp:251
#define Config_getEnum(val)
Definition: config.cpp:663
static void removeDotGraph(const QCString &dotName)
Definition: dot.cpp:714
void MD5Buffer(const unsigned char *buf, unsigned int len, unsigned char sig[16])
Definition: md5.c:275
#define FONTNAME
Definition: dot.cpp:54
void addImageFile(const char *name)
Definition: index.h:147
#define Config_getString(val)
Definition: config.cpp:660
QCString getDotImageExtension(void)
Definition: util.cpp:8562
void err(const char *fmt,...)
Definition: message.cpp:226
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
int addSVGObject(const QCString &file, const QCString &baseName, const QCString &figureNAme, const QCString &relPath)
Definition: dot.cpp:1305
#define FONTSIZE
Definition: dot.cpp:55
static void writeGraphFooter(FTextStream &t)
Definition: dot.cpp:281
void addJob(const char *format, const char *output)
Definition: dot.cpp:807
void MD5SigToString(unsigned char signature[16], char *str, int len)
Definition: md5.c:285
Translator * theTranslator
Definition: language.cpp:157
void addRun(DotRunner *run)
Definition: dot.cpp:1262
const bool TRUE
Definition: qglobal.h:371
static IndexList * indexList
Definition: doxygen.h:149
void writeDotGraphFromFile ( const char *  inFile,
const char *  outDir,
const char *  outFile,
GraphOutputFormat  format 
)

Definition at line 4203 of file dot.cpp.

4205 {
4206  QDir d(outDir);
4207  if (!d.exists())
4208  {
4209  err("Output dir %s does not exist!\n",outDir); exit(1);
4210  }
4211 
4212  QCString imgExt = getDotImageExtension();
4213  QCString imgFmt = Config_getEnum("DOT_IMAGE_FORMAT");
4214  QCString imgName = (QCString)outFile+"."+imgExt;
4215  QCString absImgName = d.absPath().utf8()+"/"+imgName;
4216  QCString absOutFile = d.absPath().utf8()+"/"+outFile;
4217 
4218  DotRunner dotRun(inFile,d.absPath().data(),FALSE,absImgName);
4219  if (format==GOF_BITMAP)
4220  dotRun.addJob(imgFmt,absImgName);
4221  else // format==GOF_EPS
4222  {
4223  if (Config_getBool("USE_PDFLATEX"))
4224  {
4225  dotRun.addJob("pdf",absOutFile+".pdf");
4226  }
4227  else
4228  {
4229  dotRun.addJob("ps",absOutFile+".eps");
4230  }
4231  }
4232 
4233  dotRun.preventCleanUp();
4234  if (!dotRun.run())
4235  {
4236  return;
4237  }
4238 
4240 
4241  Doxygen::indexList->addImageFile(imgName);
4242 
4243 }
Traverses directory structures and contents in a platform-independent way.
Definition: qdir.h:52
Definition: dot.h:356
static bool format(QChar::Decomposition tag, QString &str, int index, int len)
Definition: qstring.cpp:11496
const bool FALSE
Definition: qglobal.h:370
TFile * outFile
Definition: makeDST.cxx:36
#define Config_getEnum(val)
Definition: config.cpp:663
void addImageFile(const char *name)
Definition: index.h:147
#define Config_getBool(val)
Definition: config.cpp:664
QCString getDotImageExtension(void)
Definition: util.cpp:8562
static void checkDotResult(const char *imgExt, const char *imgName)
Definition: dot.cpp:662
void err(const char *fmt,...)
Definition: message.cpp:226
TFile * inFile
Definition: makeDST.cxx:36
void addJob(const char *format, const char *output)
Definition: dot.cpp:807
Definition: dot.h:42
static IndexList * indexList
Definition: doxygen.h:149
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 4255 of file dot.cpp.

4259 {
4260 
4261  QDir d(outDir);
4262  if (!d.exists())
4263  {
4264  err("Output dir %s does not exist!\n",outDir.data()); exit(1);
4265  }
4266 
4267  QCString mapName = baseName+".map";
4268  QCString imgExt = getDotImageExtension();
4269  QCString imgFmt = Config_getEnum("DOT_IMAGE_FORMAT");
4270  QCString imgName = baseName+"."+imgExt;
4271  QCString absOutFile = d.absPath().utf8()+"/"+mapName;
4272 
4273  DotRunner dotRun(inFile,d.absPath().data(),FALSE);
4274  dotRun.addJob(MAP_CMD,absOutFile);
4275  dotRun.preventCleanUp();
4276  if (!dotRun.run())
4277  {
4278  return;
4279  }
4280 
4281  if (imgExt=="svg") // vector graphics
4282  {
4283  //writeSVGFigureLink(t,relPath,inFile,inFile+".svg");
4284  //DotFilePatcher patcher(inFile+".svg");
4285  QCString svgName=outDir+"/"+baseName+".svg";
4286  writeSVGFigureLink(t,relPath,baseName,svgName);
4287  DotFilePatcher patcher(svgName);
4288  patcher.addSVGConversion(relPath,TRUE,context,TRUE,graphId);
4289  patcher.run();
4290  }
4291  else // bitmap graphics
4292  {
4293  t << "<img src=\"" << relPath << imgName << "\" alt=\""
4294  << imgName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>" << endl
4295  << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">";
4296 
4297  convertMapFile(t, absOutFile, relPath ,TRUE, context);
4298 
4299  t << "</map>" << endl;
4300  }
4301  d.remove(absOutFile);
4302 }
Traverses directory structures and contents in a platform-independent way.
Definition: qdir.h:52
Definition: dot.h:356
const bool FALSE
Definition: qglobal.h:370
#define Config_getEnum(val)
Definition: config.cpp:663
const char * data() const
Definition: qcstring.h:207
QCString getDotImageExtension(void)
Definition: util.cpp:8562
#define MAP_CMD
Definition: dot.cpp:51
void err(const char *fmt,...)
Definition: message.cpp:226
void addJob(const char *format, const char *output)
Definition: dot.cpp:807
static bool writeSVGFigureLink(FTextStream &out, const QCString &relPath, const QCString &baseName, const QCString &absImgName)
Definition: dot.cpp:618
static bool convertMapFile(FTextStream &t, const char *mapName, const QCString relPath, bool urlOnly=FALSE, const QCString &context=QCString())
Definition: dot.cpp:370
const bool TRUE
Definition: qglobal.h:371
QTextStream & endl(QTextStream &s)