浏览该文件的文档.
33 #define MAP_CMD "cmapx"
99 for (i=0;i<dotNumThreads;i++)
101 std::unique_ptr<DotWorkerThread> thread = std::make_unique<DotWorkerThread>(
m_queue);
103 if (thread->isRunning())
126 auto insobj = std::make_unique<DotRunner>(absDotName, md5Hash);
133 if (md5Hash != runit->second->getMd5Hash())
135 err(
"md5 hash does not match for two different runs of %s !\n",
qPrint(absDotName));
137 rv = runit->second.get();
151 return &(rv.first->second);
158 if (numDotRuns+numFilePatchers>1)
162 msg(
"Generating dot graphs in single threaded mode...\n");
166 msg(
"Generating dot graphs using %zu parallel threads...\n",std::min(numDotRuns+numFilePatchers,
m_workers.size()));
199 msg(
"Running dot for graph %zu/%zu\n",prev,numDotRuns);
216 msg(
"Running dot for graph %zu/%zu\n",prev,numDotRuns);
221 while (numDotRuns>=prev)
223 msg(
"Running dot for graph %zu/%zu\n",prev,numDotRuns);
251 if (fp.second.isSVGFile())
253 msg(
"Patching output file %zu/%zu\n",i,numFilePatchers);
254 if (!fp.second.run())
return FALSE;
260 if (!fp.second.isSVGFile())
262 msg(
"Patching output file %zu/%zu\n",i,numFilePatchers);
263 if (!fp.second.run())
return FALSE;
274 const QCString &srcFile,
int srcLine)
279 term(
"Output dir %s does not exist!\n",
qPrint(outDir));
296 dotRun.
addJob(
"pdf",absOutFile+
".pdf",srcFile,srcLine);
300 dotRun.
addJob(
"ps",absOutFile+
".eps",srcFile,srcLine);
328 const QCString &context,
int graphId,
329 const QCString &srcFile,
int srcLine)
335 term(
"Output dir %s does not exist!\n",
qPrint(outDir));
340 QCString imgName = baseName+
"."+imgExt;
353 QCString svgName = outDir+
"/"+baseName+
".svg";
362 t <<
"<img src=\"" << relPath << imgName <<
"\" alt=\""
363 << imgName <<
"\" border=\"0\" usemap=\"#" << mapName <<
"\"/>\n";
367 t <<
"<map name=\"" << mapName <<
"\" id=\"" << mapName <<
"\">";
Singleton that manages parallel dot invocations and patching files for embedding image maps
QCString getDotImageExtension()
bool run()
Runs dot for all jobs added.
static DotManager * instance()
DotFilePatcher * createFilePatcher(const QCString &fileName)
static QCString g_dotFontPath
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Class representing a directory in the file system
Helper class to run dot from doxygen from multiple threads.
static void deleteInstance()
bool isEmpty() const
Returns TRUE iff the string is empty
static IndexList * indexList
DotRunner * createRunner(const QCString &absDotName, const QCString &md5Hash)
void err(const char *fmt,...)
Text streaming class that buffers data.
bool empty() const
Returns true iff the buffer is empty
QCString getenv(const QCString &variable)
Helper class to insert a set of map file into an output file
void unsetenv(const QCString &variable)
void addJob(const QCString &format, const QCString &output, const QCString &srcFile, int srcLine)
Adds an additional job to the run.
std::vector< std::unique_ptr< DotWorkerThread > > m_workers
void preventCleanUp()
Prevent cleanup of the dot file (for user provided dot files)
#define Config_getInt(name)
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
void addImageFile(const QCString &name)
std::string absPath() const
void enqueue(DotRunner *runner)
#define Config_getEnumAsString(name)
Queue of dot jobs to run.
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.
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)
std::string str() const
Return the contents of the buffer as a std::string object
std::map< std::string, DotFilePatcher > m_filePatchers
static DotManager * m_theInstance
QCString pathListSeparator()
static void setDotFontPath(const QCString &path)
#define Config_getBool(name)
void msg(const char *fmt,...)
void term(const char *fmt,...)
const char * qPrint(const char *s)
#define Config_getString(name)
int addSVGConversion(const QCString &relPath, bool urlOnly, const QCString &context, bool zoomable, int graphId)
std::map< std::string, std::unique_ptr< DotRunner > > m_runners
void setenv(const QCString &variable, const QCString &value)
static void unsetDotFontPath()
static bool convertMapFile(TextStream &t, const QCString &mapName, const QCString &relPath, bool urlOnly=FALSE, const QCString &context=QCString())
Portable versions of functions that are platform dependent.
A bunch of utility functions.
QCString & prepend(const char *s)
This is an alternative implementation of QCString.