Doxygen
dotlegendgraph.cpp
浏览该文件的文档.
1 /******************************************************************************
2 *
3 * Copyright (C) 1997-2019 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15 
16 #include <sstream>
17 
18 #include "dotlegendgraph.h"
19 #include "util.h"
20 #include "config.h"
21 #include "doxygen.h"
22 #include "dot.h"
23 #include "language.h"
24 #include "dotfilepatcher.h"
25 
27 {
28  TextStream ts;
29  DotGraph::writeGraph(ts, GOF_BITMAP, EOF_Html, path, "", "", FALSE, 0);
30 
31  if (getDotImageExtension()=="svg")
32  {
34  createFilePatcher(absBaseName()+Config_getString(HTML_FILE_EXTENSION))->
35  addSVGObject("graph_legend", absImgName(),QCString());
36  }
37 }
38 
40 {
41  return "graph_legend";
42 }
43 
45 {
46  int fontSize = Config_getInt(DOT_FONTSIZE);
47  QCString fontName = Config_getString(DOT_FONTNAME);
48  TextStream md5stream;
50  md5stream << " Node9 [shape=\"box\",label=\"Inherited\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",fillcolor=\"grey75\",style=\"filled\" fontcolor=\"black\"];\n";
51  md5stream << " Node10 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
52  md5stream << " Node10 [shape=\"box\",label=\"PublicBase\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
53  md5stream << " Node11 -> Node10 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
54  md5stream << " Node11 [shape=\"box\",label=\"Truncated\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"red\"];\n";
55  md5stream << " Node13 -> Node9 [dir=\"back\",color=\"darkgreen\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
56  md5stream << " Node13 [shape=\"box\",label=\"ProtectedBase\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
57  md5stream << " Node14 -> Node9 [dir=\"back\",color=\"firebrick4\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
58  md5stream << " Node14 [shape=\"box\",label=\"PrivateBase\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
59  md5stream << " Node15 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
60  md5stream << " Node15 [shape=\"box\",label=\"Undocumented\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"grey75\"];\n";
61  md5stream << " Node16 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
62  md5stream << " Node16 [shape=\"box\",label=\"Templ< int >\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
63  md5stream << " Node17 -> Node16 [dir=\"back\",color=\"orange\",fontsize=\"" << fontSize << "\",style=\"dashed\",label=\"< int >\",fontname=\"" << fontName << "\"];\n";
64  md5stream << " Node17 [shape=\"box\",label=\"Templ< T >\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
65  md5stream << " Node18 -> Node9 [dir=\"back\",color=\"darkorchid3\",fontsize=\"" << fontSize << "\",style=\"dashed\",label=\"m_usedClass\",fontname=\"" << fontName << "\"];\n";
66  md5stream << " Node18 [shape=\"box\",label=\"Used\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
67  writeGraphFooter(md5stream);
68  m_theGraph = md5stream.str();
69 }
70 
72 {
73  return "";
74 }
75 
getDotImageExtension
QCString getDotImageExtension()
Definition: util.cpp:7032
DotManager::instance
static DotManager * instance()
Definition: dot.cpp:77
DotGraph::m_theGraph
QCString m_theGraph
Definition: dotgraph.h:89
dotlegendgraph.h
DotLegendGraph::computeTheGraph
virtual void computeTheGraph()
Definition: dotlegendgraph.cpp:44
DotGraph::absBaseName
QCString absBaseName() const
Definition: dotgraph.h:72
DotGraph::writeGraphFooter
static void writeGraphFooter(TextStream &t)
Definition: dotgraph.cpp:300
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
DotGraph::writeGraphHeader
static void writeGraphHeader(TextStream &t, const QCString &title=QCString())
Definition: dotgraph.cpp:268
dot.h
DotLegendGraph::getBaseName
virtual QCString getBaseName() const
Definition: dotlegendgraph.cpp:39
Config_getInt
#define Config_getInt(name)
Definition: config.h:34
theTranslator
Translator * theTranslator
Definition: language.cpp:156
doxygen.h
language.h
dotfilepatcher.h
TextStream::str
std::string str() const
Return the contents of the buffer as a std::string object
Definition: textstream.h:208
DotGraph::writeGraph
QCString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool writeImageMap=TRUE, int graphId=-1)
Definition: dotgraph.cpp:111
GOF_BITMAP
@ GOF_BITMAP
Definition: dotgraph.h:27
DotGraph::absImgName
QCString absImgName() const
Definition: dotgraph.h:75
Translator::trLegendTitle
virtual QCString trLegendTitle()=0
Config_getString
#define Config_getString(name)
Definition: config.h:32
DotLegendGraph::writeGraph
void writeGraph(const QCString &path)
Definition: dotlegendgraph.cpp:26
config.h
EOF_Html
@ EOF_Html
Definition: dotgraph.h:28
util.h
A bunch of utility functions.
DotLegendGraph::getMapLabel
virtual QCString getMapLabel() const
Definition: dotlegendgraph.cpp:71
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108