Doxygen
Loading...
Searching...
No Matches
dot.h File Reference
#include <map>
#include "threadpool.h"
#include "qcstring.h"
#include "dotgraph.h"
#include "dotfilepatcher.h"
#include "dotrunner.h"
#include "doxygen.h"
#include "construct.h"
+ Include dependency graph for dot.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  DotManager
 Singleton that manages parallel dot invocations and patching files for embedding image maps. More...
 

Functions

void writeDotGraphFromFile (const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
 
void writeDotImageMapFromFile (TextStream &t, const QCString &inFile, const QCString &outDir, const QCString &relPath, const QCString &baseName, const QCString &context, int graphId, const QCString &srcFile, int srcLine)
 

Function Documentation

◆ writeDotGraphFromFile()

void writeDotGraphFromFile ( const QCString & inFile,
const QCString & outDir,
const QCString & outFile,
GraphOutputFormat format,
const QCString & srcFile,
int srcLine )

Definition at line 230 of file dot.cpp.

233{
234 Dir d(outDir.str());
235 if (!d.exists())
236 {
237 term("Output dir %s does not exist!\n",qPrint(outDir));
238 }
239
241 QCString imgName = QCString(outFile)+"."+imgExt;
242 QCString absImgName = QCString(d.absPath())+"/"+imgName;
243 QCString absOutFile = QCString(d.absPath())+"/"+outFile;
244
245 DotRunner dotRun(inFile);
246 if (format==GraphOutputFormat::BITMAP)
247 {
248 dotRun.addJob(Config_getEnumAsString(DOT_IMAGE_FORMAT),absImgName,srcFile,srcLine);
249 }
250 else // format==GraphOutputFormat::EPS
251 {
252 if (Config_getBool(USE_PDFLATEX))
253 {
254 dotRun.addJob("pdf",absOutFile+".pdf",srcFile,srcLine);
255 }
256 else
257 {
258 dotRun.addJob("ps",absOutFile+".eps",srcFile,srcLine);
259 }
260 }
261
262 dotRun.preventCleanUp();
263 if (!dotRun.run())
264 {
265 return;
266 }
267
268 Doxygen::indexList->addImageFile(imgName);
269
270}
Class representing a directory in the file system.
Definition dir.h:75
Helper class to run dot from doxygen from multiple threads.
Definition dotrunner.h:31
static IndexList * indexList
Definition doxygen.h:134
This is an alternative implementation of QCString.
Definition qcstring.h:101
const std::string & str() const
Definition qcstring.h:537
#define Config_getEnumAsString(name)
Definition config.h:36
#define Config_getBool(name)
Definition config.h:33
#define term(fmt,...)
Definition message.h:94
const char * qPrint(const char *s)
Definition qcstring.h:672
QCString getDotImageExtension()
Definition util.cpp:6617

References Dir::absPath(), DotRunner::addJob(), BITMAP, Config_getBool, Config_getEnumAsString, Dir::exists(), getDotImageExtension(), Doxygen::indexList, DotRunner::preventCleanUp(), qPrint(), DotRunner::run(), QCString::str(), and term.

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

◆ writeDotImageMapFromFile()

void writeDotImageMapFromFile ( TextStream & t,
const QCString & inFile,
const QCString & outDir,
const QCString & relPath,
const QCString & baseName,
const QCString & context,
int graphId,
const QCString & srcFile,
int srcLine )

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
srcFilethe source file
srcLinethe line number in the source file

Definition at line 283 of file dot.cpp.

288{
289
290 Dir d(outDir.str());
291 if (!d.exists())
292 {
293 term("Output dir %s does not exist!\n",qPrint(outDir));
294 }
295
296 QCString mapName = baseName+".map";
298 QCString imgName = baseName+"."+imgExt;
299 QCString absOutFile = QCString(d.absPath())+"/"+mapName;
300
301 DotRunner dotRun(inFile);
302 dotRun.addJob(MAP_CMD,absOutFile,srcFile,srcLine);
303 dotRun.preventCleanUp();
304 if (!dotRun.run())
305 {
306 return;
307 }
308
309 if (imgExt=="svg") // vector graphics
310 {
311 QCString svgName = outDir+"/"+baseName+".svg";
312 DotFilePatcher::writeSVGFigureLink(t,relPath,baseName,svgName);
313 DotFilePatcher patcher(svgName);
314 patcher.addSVGConversion("",TRUE,context,TRUE,graphId);
315 patcher.run();
316 }
317 else // bitmap graphics
318 {
319 TextStream tt;
320 t << "<img src=\"" << relPath << imgName << "\" alt=\""
321 << imgName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>\n";
322 DotFilePatcher::convertMapFile(tt, absOutFile, relPath ,TRUE, context);
323 if (!tt.empty())
324 {
325 t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">";
326 t << tt.str();
327 t << "</map>\n";
328 }
329 }
330 d.remove(absOutFile.str());
331}
Helper class to insert a set of map file into an output file.
static bool convertMapFile(TextStream &t, const QCString &mapName, const QCString &relPath, bool urlOnly=FALSE, const QCString &context=QCString())
static bool writeSVGFigureLink(TextStream &out, const QCString &relPath, const QCString &baseName, const QCString &absImgName)
Check if a reference to a SVG figure can be written and do so if possible.
Text streaming class that buffers data.
Definition textstream.h:36
bool empty() const
Returns true iff the buffer is empty.
Definition textstream.h:253
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:229
#define MAP_CMD
Definition dot.cpp:34
#define TRUE
Definition qcstring.h:37

References Dir::absPath(), DotRunner::addJob(), DotFilePatcher::addSVGConversion(), DotFilePatcher::convertMapFile(), TextStream::empty(), Dir::exists(), getDotImageExtension(), MAP_CMD, DotRunner::preventCleanUp(), qPrint(), Dir::remove(), DotFilePatcher::run(), DotRunner::run(), QCString::str(), TextStream::str(), term, TRUE, and DotFilePatcher::writeSVGFigureLink().

Referenced by HtmlDocVisitor::writeDotFile().