Doxygen
Loading...
Searching...
No Matches
dot.h File Reference
#include <map>
#include <vector>
#include "qcstring.h"
#include "dotgraph.h"
#include "dotfilepatcher.h"
#include "dotrunner.h"
#include "dotjob.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 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, bool toIndex)
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, bool newFile)

Function Documentation

◆ writeDotGraphFromFile()

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

Definition at line 196 of file dot.cpp.

199{
200 Dir d(outDir.str());
201 if (!d.exists())
202 {
203 term("Output dir {} does not exist!\n",outDir);
204 }
205
207 QCString imgName = outFile+"."+imgExt;
208 QCString absImgName = d.absPath()+"/"+imgName;
209 QCString absOutFile = d.absPath()+"/"+outFile;
210
211 QCString dotArgs;
212 if (format==GraphOutputFormat::BITMAP)
213 {
214 dotArgs = QCString("-T") + Config_getEnumAsString(DOT_IMAGE_FORMAT) + " -o \"" + absImgName + "\" \"" + inFile + "\"";
215 }
216 else // format==GraphOutputFormat::EPS
217 {
218 if (Config_getBool(USE_PDFLATEX))
219 {
220 dotArgs = QCString("-Tpdf -o \"") + absOutFile + ".pdf\" \"" + inFile + "\"";
221 }
222 else
223 {
224 dotArgs = QCString("-Teps -o \"") + absOutFile + ".eps\" \"" + inFile + "\"";
225 }
226 }
227
229 {
230 return;
231 }
232
233 if (toIndex) Doxygen::indexList->addImageFile(imgName);
234
235}
Class representing a directory in the file system.
Definition dir.h:75
static QCString verifiedDotPath
Definition doxygen.h:137
static IndexList * indexList
Definition doxygen.h:132
This is an alternative implementation of QCString.
Definition qcstring.h:101
const std::string & str() const
Definition qcstring.h:552
#define Config_getEnumAsString(name)
Definition config.h:36
#define Config_getBool(name)
Definition config.h:33
#define term(fmt,...)
Definition message.h:137
int system(const QCString &command, const QCString &args, bool commandHasConsole=true)
Definition portable.cpp:105
#define FALSE
Definition qcstring.h:34
QCString getDotImageExtension()
Definition util.cpp:6307

References Dir::absPath(), BITMAP, Config_getBool, Config_getEnumAsString, Dir::exists(), FALSE, getDotImageExtension(), Doxygen::indexList, QCString::str(), Portable::system(), term, and Doxygen::verifiedDotPath.

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,
bool newFile )

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
newFilesignal whether or not the file has been generated before (value false) or not.

Definition at line 249 of file dot.cpp.

254{
255
256 Dir d(outDir.str());
257 if (!d.exists())
258 {
259 term("Output dir {} does not exist!\n",outDir);
260 }
261
262 QCString mapName = baseName+".cmapx";
264 QCString imgName = baseName+"."+imgExt;
265 QCString absOutFile = d.absPath()+"/"+mapName;
266
267 QCString dotArgs = QCString("-T" MAP_CMD " -o \"") + absOutFile + "\" \"" + inFile + "\"";
269 {
270 return;
271 }
272
273 if (imgExt=="svg") // vector graphics
274 {
275 QCString svgName = outDir+"/"+baseName+".svg";
276 DotFilePatcher::writeSVGFigureLink(t,relPath,baseName,svgName);
277 if (newFile)
278 {
279 DotFilePatcher patcher(svgName);
280 patcher.addSVGConversion("",TRUE,context,TRUE,graphId);
281 patcher.run();
282 }
283 }
284 else // bitmap graphics
285 {
286 TextStream tt;
287 t << "<img src=\"" << relPath << imgName << "\" alt=\""
288 << imgName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>\n";
289 DotFilePatcher::convertMapFile(tt, absOutFile, relPath ,TRUE, context);
290 if (!tt.empty())
291 {
292 t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">";
293 t << tt.str();
294 t << "</map>\n";
295 }
296 }
297 d.remove(absOutFile.str());
298}
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.
QCString & remove(size_t index, size_t len)
Definition qcstring.h:442
Text streaming class that buffers data.
Definition textstream.h:36
bool empty() const
Returns true iff the buffer is empty.
Definition textstream.h:240
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:216
#define MAP_CMD
Definition dot.cpp:34
#define TRUE
Definition qcstring.h:37

References Dir::absPath(), DotFilePatcher::addSVGConversion(), DotFilePatcher::convertMapFile(), TextStream::empty(), Dir::exists(), FALSE, getDotImageExtension(), MAP_CMD, Dir::remove(), DotFilePatcher::run(), QCString::str(), TextStream::str(), Portable::system(), term, TRUE, Doxygen::verifiedDotPath, and DotFilePatcher::writeSVGFigureLink().

Referenced by HtmlDocVisitor::writeDotFile().