Doxygen
DotGroupCollaboration类 参考

Representation of a group collaboration graph 更多...

#include <dotgroupcollaboration.h>

+ 类 DotGroupCollaboration 继承关系图:
+ DotGroupCollaboration 的协作图:

struct  Edge
 
struct  Link
 

Public 成员函数

 DotGroupCollaboration (const GroupDef *gd)
 
 ~DotGroupCollaboration ()
 
QCString writeGraph (TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool writeImageMap=TRUE, int graphId=-1)
 
bool isTrivial () const
 
- Public 成员函数 继承自 DotGraph
 DotGraph ()
 
virtual ~DotGraph ()
 

Protected 成员函数

virtual QCString getBaseName () const
 
virtual QCString getMapLabel () const
 
virtual void computeTheGraph ()
 
- Protected 成员函数 继承自 DotGraph
int getNextNodeNumber ()
 returns node numbers. 更多...
 
QCString writeGraph (TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool writeImageMap=TRUE, int graphId=-1)
 
virtual QCString absMapName () const
 
virtual QCString getImgAltText () const
 
QCString absBaseName () const
 
QCString absDotName () const
 
QCString imgName () const
 
QCString absImgName () const
 
QCString relImgName () const
 

Private 类型

enum  EdgeType {
  tmember = 0, tclass, tnamespace, tfile,
  tpages, tdir, thierarchy
}
 

Private 成员函数

void buildGraph (const GroupDef *gd)
 
void addCollaborationMember (const Definition *def, QCString &url, EdgeType eType)
 
void addMemberList (class MemberList *ml)
 
void writeGraphHeader (TextStream &t, const QCString &title) const
 
EdgeaddEdge (DotNode *_pNStart, DotNode *_pNEnd, EdgeType _eType, const QCString &_label, const QCString &_url)
 

Private 属性

DotNodem_rootNode
 
DotNodeMap m_usedNodes
 
QCString m_diskName
 
std::vector< std::unique_ptr< Edge > > m_edges
 

额外继承的成员函数

- 静态 Protected 成员函数 继承自 DotGraph
static void writeGraphHeader (TextStream &t, const QCString &title=QCString())
 
static void writeGraphFooter (TextStream &t)
 
static void computeGraph (DotNode *root, GraphType gt, GraphOutputFormat format, const QCString &rank, bool renderParents, bool backArrows, const QCString &title, QCString &graphStr)
 
- Protected 属性 继承自 DotGraph
GraphOutputFormat m_graphFormat = GOF_BITMAP
 
EmbeddedOutputFormat m_textFormat = EOF_Html
 
Dir m_dir
 
QCString m_fileName
 
QCString m_relPath
 
bool m_generateImageMap = false
 
int m_graphId = 0
 
QCString m_absPath
 
QCString m_baseName
 
QCString m_theGraph
 
bool m_regenerate = false
 
bool m_doNotAddImageToIndex = false
 
bool m_noDivTag = false
 
bool m_zoomable = true
 
bool m_urlOnly = false
 

详细描述

Representation of a group collaboration graph

在文件 dotgroupcollaboration.h28 行定义.

成员枚举类型说明

◆ EdgeType

枚举值
tmember 
tclass 
tnamespace 
tfile 
tpages 
tdir 
thierarchy 

在文件 dotgroupcollaboration.h44 行定义.

45  {
46  tmember = 0,
47  tclass,
48  tnamespace,
49  tfile,
50  tpages,
51  tdir,
53  };

构造及析构函数说明

◆ DotGroupCollaboration()

DotGroupCollaboration::DotGroupCollaboration ( const GroupDef gd)

◆ ~DotGroupCollaboration()

DotGroupCollaboration::~DotGroupCollaboration ( )

在文件 dotgroupcollaboration.cpp38 行定义.

39 {
40  // delete all created Nodes saved in m_usedNodes map
41  for (const auto &kv : m_usedNodes)
42  {
43  delete kv.second;
44  }
45 }

引用了 m_usedNodes.

成员函数说明

◆ addCollaborationMember()

void DotGroupCollaboration::addCollaborationMember ( const Definition def,
QCString url,
EdgeType  eType 
)
private

在文件 dotgroupcollaboration.cpp179 行定义.

181 {
182  // Create group nodes
183  QCString tmp_str;
184  for (const auto &d : def->partOfGroups())
185  {
186  auto it = m_usedNodes.find(d->name().str());
187  DotNode* nnode = it!=m_usedNodes.end() ? it->second : 0;
188  if ( nnode != m_rootNode )
189  {
190  if ( nnode==0 )
191  { // add node
192  tmp_str = d->getReference()+"$"+d->getOutputFileBase();
193  QCString tooltip = d->briefDescriptionAsTooltip();
194  nnode = new DotNode(getNextNodeNumber(), d->groupTitle(), tooltip, tmp_str );
195  nnode->markAsVisible();
196  m_usedNodes.insert(std::make_pair(d->name().str(), nnode));
197  }
198  tmp_str = def->qualifiedName();
199  addEdge( m_rootNode, nnode, eType, tmp_str, url );
200  }
201  }
202 }

引用了 addEdge(), DotGraph::getNextNodeNumber(), m_rootNode, m_usedNodes, DotNode::markAsVisible(), Definition::partOfGroups() , 以及 Definition::qualifiedName().

被这些函数引用 addMemberList() , 以及 buildGraph().

◆ addEdge()

DotGroupCollaboration::Edge * DotGroupCollaboration::addEdge ( DotNode _pNStart,
DotNode _pNEnd,
EdgeType  _eType,
const QCString _label,
const QCString _url 
)
private

在文件 dotgroupcollaboration.cpp155 行定义.

158 {
159  // search a existing link.
160  auto it = std::find_if(m_edges.begin(),m_edges.end(),
161  [&_pNStart,&_pNEnd,&_eType](const auto &edge)
162  { return edge->pNStart==_pNStart && edge->pNEnd==_pNEnd && edge->eType==_eType; });
163 
164  if (it==m_edges.end()) // new link
165  {
166  m_edges.emplace_back(std::make_unique<Edge>(_pNStart,_pNEnd,_eType));
167  it = m_edges.end()-1;
168  }
169 
170  if (!_label.isEmpty()) // add label
171  {
172  (*it)->links.emplace_back(_label,_url);
173  }
174 
175  // return found or added edge
176  return (*it).get();
177 }

引用了 QCString::isEmpty() , 以及 m_edges.

被这些函数引用 addCollaborationMember() , 以及 buildGraph().

◆ addMemberList()

void DotGroupCollaboration::addMemberList ( class MemberList ml)
private

在文件 dotgroupcollaboration.cpp144 行定义.

145 {
146  if ( ml==0 || ml->empty() ) return;
147  for (const auto &def : *ml)
148  {
149  QCString tmp_url = def->getReference()+"$"+addHtmlExtensionIfMissing(def->getOutputFileBase());
150  +"#"+def->anchor();
152  }
153 }

引用了 addCollaborationMember(), addHtmlExtensionIfMissing(), MemberVector::empty() , 以及 tmember.

被这些函数引用 buildGraph().

◆ buildGraph()

void DotGroupCollaboration::buildGraph ( const GroupDef gd)
private

在文件 dotgroupcollaboration.cpp47 行定义.

48 {
49  QCString tmp_url;
50  //===========================
51  // hierarchy.
52 
53  // Write parents
54  for (const auto &d : gd->partOfGroups())
55  {
56  DotNode *nnode = 0;
57  auto it = m_usedNodes.find(d->name().str());
58  if ( it==m_usedNodes.end())
59  { // add node
60  tmp_url = d->getReference()+"$"+d->getOutputFileBase();
61  QCString tooltip = d->briefDescriptionAsTooltip();
62  nnode = new DotNode(getNextNodeNumber(), d->groupTitle(), tooltip, tmp_url );
63  nnode->markAsVisible();
64  m_usedNodes.insert(std::make_pair(d->name().str(), nnode));
65  }
66  else
67  {
68  nnode = it->second;
69  }
70  tmp_url = "";
71  addEdge( nnode, m_rootNode, DotGroupCollaboration::thierarchy, tmp_url, tmp_url );
72  }
73 
74  // Add subgroups
75  for (const auto &def : gd->getSubGroups())
76  {
77  DotNode *nnode = 0;
78  auto it = m_usedNodes.find(def->name().str());
79  if ( it==m_usedNodes.end())
80  { // add node
81  tmp_url = def->getReference()+"$"+def->getOutputFileBase();
82  QCString tooltip = def->briefDescriptionAsTooltip();
83  nnode = new DotNode(getNextNodeNumber(), def->groupTitle(), tooltip, tmp_url );
84  nnode->markAsVisible();
85  m_usedNodes.insert(std::make_pair(def->name().str(), nnode));
86  }
87  else
88  {
89  nnode = it->second;
90  }
91  tmp_url = "";
92  addEdge( m_rootNode, nnode, DotGroupCollaboration::thierarchy, tmp_url, tmp_url );
93  }
94 
95  //=======================
96  // Write collaboration
97 
98  // Add members
100 
101  // Add classes
102  for (const auto &def : gd->getClasses())
103  {
104  tmp_url = def->getReference()+"$"+addHtmlExtensionIfMissing(def->getOutputFileBase());
105  if (!def->anchor().isEmpty())
106  {
107  tmp_url+="#"+def->anchor();
108  }
110  }
111 
112  // Add namespaces
113  for (const auto &def : gd->getNamespaces())
114  {
115  tmp_url = def->getReference()+"$"+addHtmlExtensionIfMissing(def->getOutputFileBase());
117  }
118 
119  // Add files
120  for (const auto &def : gd->getFiles())
121  {
122  tmp_url = def->getReference()+"$"+addHtmlExtensionIfMissing(def->getOutputFileBase());
124  }
125 
126  // Add pages
127  for (const auto &def : gd->getPages())
128  {
129  tmp_url = def->getReference()+"$"+addHtmlExtensionIfMissing(def->getOutputFileBase());
131  }
132 
133  // Add directories
134  if ( !gd->getDirs().empty() )
135  {
136  for(const auto def : gd->getDirs())
137  {
138  tmp_url = def->getReference()+"$"+addHtmlExtensionIfMissing(def->getOutputFileBase());
140  }
141  }
142 }

引用了 addCollaborationMember(), addEdge(), addHtmlExtensionIfMissing(), addMemberList(), GroupDef::getClasses(), GroupDef::getDirs(), GroupDef::getFiles(), GroupDef::getMemberList(), GroupDef::getNamespaces(), DotGraph::getNextNodeNumber(), GroupDef::getPages(), GroupDef::getSubGroups(), m_rootNode, m_usedNodes, DotNode::markAsVisible(), MemberListType_allMembersList, Definition::partOfGroups(), tclass, tdir, tfile, thierarchy, tnamespace , 以及 tpages.

被这些函数引用 DotGroupCollaboration().

◆ computeTheGraph()

void DotGroupCollaboration::computeTheGraph ( )
protectedvirtual

实现了 DotGraph.

在文件 dotgroupcollaboration.cpp209 行定义.

210 {
211  TextStream md5stream;
212  writeGraphHeader(md5stream,m_rootNode->label());
213 
214  // clean write flags
215  for (const auto &kv : m_usedNodes)
216  {
217  kv.second->clearWriteFlag();
218  }
219 
220  // write other nodes.
221  for (const auto &kv : m_usedNodes)
222  {
223  kv.second->write(md5stream,Inheritance,m_graphFormat,TRUE,FALSE,FALSE);
224  }
225 
226  // write edges
227  for (const auto &edge : m_edges)
228  {
229  edge->write( md5stream );
230  }
231 
232  writeGraphFooter(md5stream);
233 
234  m_theGraph = md5stream.str();
235 }

引用了 FALSE, Inheritance, DotNode::label(), m_edges, DotGraph::m_graphFormat, m_rootNode, DotGraph::m_theGraph, m_usedNodes, TextStream::str(), TRUE, DotGraph::writeGraphFooter() , 以及 writeGraphHeader().

◆ getBaseName()

QCString DotGroupCollaboration::getBaseName ( ) const
protectedvirtual

实现了 DotGraph.

在文件 dotgroupcollaboration.cpp204 行定义.

205 {
206  return m_diskName;
207 }

引用了 m_diskName.

◆ getMapLabel()

QCString DotGroupCollaboration::getMapLabel ( ) const
protectedvirtual

实现了 DotGraph.

在文件 dotgroupcollaboration.cpp237 行定义.

238 {
240 }

引用了 escapeCharsInString(), FALSE , 以及 DotGraph::m_baseName.

◆ isTrivial()

bool DotGroupCollaboration::isTrivial ( ) const

在文件 dotgroupcollaboration.cpp312 行定义.

313 {
314  return m_usedNodes.size() <= 1;
315 }

引用了 m_usedNodes.

被这些函数引用 GroupDefImpl::writeGroupGraph().

◆ writeGraph()

QCString DotGroupCollaboration::writeGraph ( TextStream t,
GraphOutputFormat  gf,
EmbeddedOutputFormat  ef,
const QCString path,
const QCString fileName,
const QCString relPath,
bool  writeImageMap = TRUE,
int  graphId = -1 
)

在文件 dotgroupcollaboration.cpp242 行定义.

246 {
248 
249  return DotGraph::writeGraph(t, graphFormat, textFormat, path, fileName, relPath, generateImageMap, graphId);
250 }

引用了 DotGraph::m_doNotAddImageToIndex, TRUE , 以及 DotGraph::writeGraph().

被这些函数引用 DocbookGenerator::endGroupCollaboration(), HtmlGenerator::endGroupCollaboration() , 以及 LatexGenerator::endGroupCollaboration().

◆ writeGraphHeader()

void DotGroupCollaboration::writeGraphHeader ( TextStream t,
const QCString title 
) const
private

在文件 dotgroupcollaboration.cpp317 行定义.

318 {
319  int fontSize = Config_getInt(DOT_FONTSIZE);
320  QCString fontName = Config_getString(DOT_FONTNAME);
321  t << "digraph ";
322  if (title.isEmpty())
323  {
324  t << "\"Dot Graph\"";
325  }
326  else
327  {
328  t << "\"" << convertToXML(title) << "\"";
329  }
330  t << "\n";
331  t << "{\n";
332  if (Config_getBool(DOT_TRANSPARENT))
333  {
334  t << " bgcolor=\"transparent\";\n";
335  }
336  t << " edge [fontname=\"" << fontName << "\",fontsize=\"" << fontSize << "\","
337  "labelfontname=\"" << fontName << "\",labelfontsize=\"" << fontSize << "\"];\n";
338  t << " node [fontname=\"" << fontName << "\",fontsize=\"" << fontSize << "\",shape=box];\n";
339  t << " rankdir=LR;\n";
340 }

引用了 Config_getBool, Config_getInt, Config_getString, convertToXML() , 以及 QCString::isEmpty().

被这些函数引用 computeTheGraph().

类成员变量说明

◆ m_diskName

QCString DotGroupCollaboration::m_diskName
private

在文件 dotgroupcollaboration.h84 行定义.

被这些函数引用 DotGroupCollaboration() , 以及 getBaseName().

◆ m_edges

std::vector< std::unique_ptr<Edge> > DotGroupCollaboration::m_edges
private

在文件 dotgroupcollaboration.h85 行定义.

被这些函数引用 addEdge() , 以及 computeTheGraph().

◆ m_rootNode

DotNode* DotGroupCollaboration::m_rootNode
private

◆ m_usedNodes

DotNodeMap DotGroupCollaboration::m_usedNodes
private

该类的文档由以下文件生成:
DotGroupCollaboration::addCollaborationMember
void addCollaborationMember(const Definition *def, QCString &url, EdgeType eType)
Definition: dotgroupcollaboration.cpp:179
DotGroupCollaboration::m_usedNodes
DotNodeMap m_usedNodes
Definition: dotgroupcollaboration.h:83
DotGraph::m_theGraph
QCString m_theGraph
Definition: dotgraph.h:89
DotGraph::m_doNotAddImageToIndex
bool m_doNotAddImageToIndex
Definition: dotgraph.h:91
GroupDef::getClasses
virtual const ClassLinkedRefMap & getClasses() const =0
DotGroupCollaboration::tnamespace
@ tnamespace
Definition: dotgroupcollaboration.h:48
DotGroupCollaboration::m_rootNode
DotNode * m_rootNode
Definition: dotgroupcollaboration.h:82
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
MemberListType_allMembersList
@ MemberListType_allMembersList
Definition: types.h:147
DotGroupCollaboration::thierarchy
@ thierarchy
Definition: dotgroupcollaboration.h:52
GroupDef::groupTitle
virtual QCString groupTitle() const =0
GroupDef::getFiles
virtual const FileList & getFiles() const =0
GroupDef::getMemberList
virtual MemberList * getMemberList(MemberListType lt) const =0
DotGraph::writeGraphFooter
static void writeGraphFooter(TextStream &t)
Definition: dotgraph.cpp:300
QCString::str
std::string str() const
Definition: qcstring.h:442
DotGroupCollaboration::addMemberList
void addMemberList(class MemberList *ml)
Definition: dotgroupcollaboration.cpp:144
DotGraph::getNextNodeNumber
int getNextNodeNumber()
returns node numbers.
Definition: dotgraph.h:41
GroupDef::getSubGroups
virtual const GroupList & getSubGroups() const =0
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
DotNode::markAsVisible
void markAsVisible(bool b=TRUE)
Definition: dotnode.h:107
Definition::qualifiedName
virtual QCString qualifiedName() const =0
addHtmlExtensionIfMissing
QCString addHtmlExtensionIfMissing(const QCString &fName)
Definition: util.cpp:5275
DotNode
A node in a dot graph
Definition: dotnode.h:56
GroupDef::getDirs
virtual const DirList & getDirs() const =0
Config_getInt
#define Config_getInt(name)
Definition: config.h:34
DotGroupCollaboration::tclass
@ tclass
Definition: dotgroupcollaboration.h:47
DotGroupCollaboration::tdir
@ tdir
Definition: dotgroupcollaboration.h:51
Definition::name
virtual QCString name() const =0
DotNode::label
QCString label() const
Definition: dotnode.h:89
DotGroupCollaboration::m_diskName
QCString m_diskName
Definition: dotgroupcollaboration.h:84
DotGraph::m_graphFormat
GraphOutputFormat m_graphFormat
Definition: dotgraph.h:79
TRUE
#define TRUE
Definition: qcstring.h:36
GroupDef::getNamespaces
virtual const NamespaceLinkedRefMap & getNamespaces() const =0
DotGroupCollaboration::writeGraphHeader
void writeGraphHeader(TextStream &t, const QCString &title) const
Definition: dotgroupcollaboration.cpp:317
TextStream::str
std::string str() const
Return the contents of the buffer as a std::string object
Definition: textstream.h:208
Definition::partOfGroups
virtual const GroupList & partOfGroups() const =0
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
DotGroupCollaboration::addEdge
Edge * addEdge(DotNode *_pNStart, DotNode *_pNEnd, EdgeType _eType, const QCString &_label, const QCString &_url)
Definition: dotgroupcollaboration.cpp:155
GroupDef::getPages
virtual const PageLinkedRefMap & getPages() const =0
Definition::getReference
virtual QCString getReference() const =0
DotGroupCollaboration::buildGraph
void buildGraph(const GroupDef *gd)
Definition: dotgroupcollaboration.cpp:47
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
GroupDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
escapeCharsInString
QCString escapeCharsInString(const QCString &name, bool allowDots, bool allowUnderscore)
Definition: util.cpp:3442
Config_getString
#define Config_getString(name)
Definition: config.h:32
Inheritance
@ Inheritance
Definition: dotgraph.h:29
DotGroupCollaboration::tmember
@ tmember
Definition: dotgroupcollaboration.h:46
convertToXML
QCString convertToXML(const QCString &s, bool keepEntities)
Definition: util.cpp:3948
DotGroupCollaboration::tfile
@ tfile
Definition: dotgroupcollaboration.h:49
Definition::briefDescriptionAsTooltip
virtual QCString briefDescriptionAsTooltip() const =0
DotGroupCollaboration::m_edges
std::vector< std::unique_ptr< Edge > > m_edges
Definition: dotgroupcollaboration.h:85
DotGroupCollaboration::tpages
@ tpages
Definition: dotgroupcollaboration.h:50
DotGraph::m_baseName
QCString m_baseName
Definition: dotgraph.h:88
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108