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

#include <dot.h>

Public Member Functions

 DotDirDeps (DirDef *dir)
 
 ~DotDirDeps ()
 
bool isTrivial () const
 
QCString writeGraph (FTextStream &out, GraphOutputFormat gf, EmbeddedOutputFormat ef, const char *path, const char *fileName, const char *relPath, bool writeImageMap=TRUE, int graphId=-1, bool linkRelations=TRUE) const
 

Private Attributes

DirDefm_dir
 

Detailed Description

Representation of an directory dependency graph

Definition at line 258 of file dot.h.

Constructor & Destructor Documentation

DotDirDeps::DotDirDeps ( DirDef dir)

Definition at line 3914 of file dot.cpp.

: m_dir(dir)
{
}
DotDirDeps::~DotDirDeps ( )

Definition at line 3918 of file dot.cpp.

{
}

Member Function Documentation

bool DotDirDeps::isTrivial ( ) const

Definition at line 4065 of file dot.cpp.

References DirDef::depGraphIsTrivial(), and m_dir.

Referenced by DirContext::Private::hasDirGraph(), and DirDef::writeDirectoryGraph().

{
}
QCString DotDirDeps::writeGraph ( FTextStream out,
GraphOutputFormat  gf,
EmbeddedOutputFormat  ef,
const char *  path,
const char *  fileName,
const char *  relPath,
bool  writeImageMap = TRUE,
int  graphId = -1,
bool  linkRelations = TRUE 
) const

Definition at line 3922 of file dot.cpp.

References DotManager::addFigure(), IndexList::addImageFile(), DotRunner::addJob(), DotManager::addMap(), DotManager::addRun(), DotManager::addSVGConversion(), DotManager::addSVGObject(), checkAndUpdateMd5Signature(), checkDeliverables(), Config_getBool, Config_getEnum, convertToXML(), DirDef::displayName(), endl(), EOF_DocBook, err(), escapeCharsInString(), getDotImageExtension(), DirDef::getOutputFileBase(), GOF_BITMAP, GOF_EPS, Doxygen::indexList, insertMapFile(), DotManager::instance(), m_dir, MAP_CMD, removeDotGraph(), writeDotDirDepGraph(), writeSVGFigureLink(), and writeVecGfxFigure().

Referenced by DirContext::Private::dirGraph(), RTFGenerator::endDirDepGraph(), LatexGenerator::endDirDepGraph(), and HtmlGenerator::endDirDepGraph().

{
QDir d(path);
// store the original directory
if (!d.exists())
{
err("Output dir %s does not exist!\n",path); exit(1);
}
static bool usePDFLatex = Config_getBool(USE_PDFLATEX);
QCString baseName=m_dir->getOutputFileBase()+"_dep";
QCString mapName=escapeCharsInString(baseName,FALSE);
QCString imgExt = getDotImageExtension();
QCString imgFmt = Config_getEnum(DOT_IMAGE_FORMAT);
QCString absBaseName = d.absPath().utf8()+"/"+baseName;
QCString absDotName = absBaseName+".dot";
QCString absMapName = absBaseName+".map";
QCString absPdfName = absBaseName+".pdf";
QCString absEpsName = absBaseName+".eps";
QCString absImgName = absBaseName+"."+imgExt;
// compute md5 checksum of the graph were are about to generate
QGString theGraph;
FTextStream md5stream(&theGraph);
//m_dir->writeDepGraph(md5stream);
writeDotDirDepGraph(md5stream,m_dir,linkRelations);
uchar md5_sig[16];
QCString sigStr(33);
MD5Buffer((const unsigned char *)theGraph.data(),theGraph.length(),md5_sig);
MD5SigToString(md5_sig,sigStr.rawData(),33);
bool regenerate=FALSE;
if (checkAndUpdateMd5Signature(absBaseName,sigStr) ||
!checkDeliverables(graphFormat==GOF_BITMAP ? absImgName :
usePDFLatex ? absPdfName : absEpsName,
graphFormat==GOF_BITMAP && generateImageMap ? absMapName : QCString())
)
{
regenerate=TRUE;
QFile f(absDotName);
if (!f.open(IO_WriteOnly))
{
err("Cannot create file %s.dot for writing!\n",baseName.data());
}
FTextStream t(&f);
t << theGraph.data();
f.close();
if (graphFormat==GOF_BITMAP)
{
// run dot to create a bitmap image
DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),TRUE,absImgName);
dotRun->addJob(imgFmt,absImgName);
if (generateImageMap) dotRun->addJob(MAP_CMD,absMapName);
}
else if (graphFormat==GOF_EPS)
{
DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),FALSE);
if (usePDFLatex)
{
dotRun->addJob("pdf",absPdfName);
}
else
{
dotRun->addJob("ps",absEpsName);
}
}
}
Doxygen::indexList->addImageFile(baseName+"."+imgExt);
if (graphFormat==GOF_BITMAP && textFormat==EOF_DocBook)
{
out << "<para>" << endl;
out << " <figure>" << endl;
out << " <title>Directory Dependency diagram";
out << "</title>" << endl;
out << " <mediaobject>" << endl;
out << " <imageobject>" << endl;
out << " <imagedata";
out << " width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"1\" fileref=\"" << relPath << baseName << "." << imgExt << "\">";
out << "</imagedata>" << endl;
out << " </imageobject>" << endl;
out << " </mediaobject>" << endl;
out << " </figure>" << endl;
out << "</para>" << endl;
}
else if (graphFormat==GOF_BITMAP && generateImageMap)
{
if (imgExt=="svg") // Scalable vector graphics
{
out << "<div class=\"center\">";
if (regenerate || !writeSVGFigureLink(out,relPath,baseName,absImgName)) // need to patch the links in the generated SVG file
{
if (regenerate)
{
DotManager::instance()->addSVGConversion(absImgName,relPath,FALSE,QCString(),TRUE,graphId);
}
int mapId = DotManager::instance()->addSVGObject(fileName,baseName,absImgName,relPath);
out << "<!-- SVG " << mapId << " -->" << endl;
}
out << "</div>" << endl;
}
else // bitmap graphics
{
out << "<div class=\"center\"><img src=\"" << relPath << baseName << "."
<< imgExt << "\" border=\"0\" usemap=\"#"
<< mapName << "\" alt=\"";
out << "\"/>";
out << "</div>" << endl;
if (regenerate || !insertMapFile(out,absMapName,relPath,mapName))
{
int mapId = DotManager::instance()->addMap(fileName,absMapName,relPath,
TRUE,QCString(),mapName);
out << "<!-- MAP " << mapId << " -->" << endl;
}
}
}
else if (graphFormat==GOF_EPS)
{
if (regenerate || !writeVecGfxFigure(out,baseName,absBaseName))
{
int figId = DotManager::instance()->addFigure(fileName,baseName,absBaseName,FALSE);
out << endl << "% FIG " << figId << endl;
}
}
if (!regenerate) removeDotGraph(absDotName);
return baseName;
}

Member Data Documentation

DirDef* DotDirDeps::m_dir
private

Definition at line 274 of file dot.h.

Referenced by isTrivial(), and writeGraph().


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