Skip to main content

The DotGroupCollaboration Class Reference

Representation of a group collaboration graph. More...

Declaration

class DotGroupCollaboration { ... }

Included Headers

Base class

classDotGraph

A dot graph. More...

Enumerations Index

enumEdgeType { ... }

Public Constructors Index

DotGroupCollaboration (const GroupDef *gd)

Public Destructor Index

~DotGroupCollaboration () override

Public Member Functions Index

QCStringwriteGraph (TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool writeImageMap=TRUE, int graphId=-1)
boolisTrivial () const
boolisTooBig () const
intnumNodes () const

Protected Member Functions Index

QCStringgetBaseName () const override
QCStringgetMapLabel () const override
voidcomputeTheGraph () override

Private Member Functions Index

voidbuildGraph (const GroupDef *gd)
voidaddCollaborationMember (const Definition *def, QCString &url, EdgeType eType)
voidaddMemberList (class MemberList *ml)
voidwriteGraphHeader (TextStream &t, const QCString &title) const
Edge *addEdge (DotNode *_pNStart, DotNode *_pNEnd, EdgeType _eType, const QCString &_label, const QCString &_url)

Private Member Attributes Index

DotNode *m_rootNode
DotNodeMapm_usedNodes
QCStringm_diskName
std::vector< std::unique_ptr< Edge > >m_edges

Description

Representation of a group collaboration graph.

Definition at line 28 of file dotgroupcollaboration.h.

Enumerations

EdgeType

enum DotGroupCollaboration::EdgeType
Enumeration values
tmember (= 0)
tclass
tnamespace
tfile
tpages
tdir
thierarchy

Definition at line 48 of file dotgroupcollaboration.h.

Public Constructors

DotGroupCollaboration()

DotGroupCollaboration::DotGroupCollaboration (const GroupDef * gd)

Public Destructor

~DotGroupCollaboration()

DotGroupCollaboration::~DotGroupCollaboration ()

Declaration at line 32 of file dotgroupcollaboration.h, definition at line 38 of file dotgroupcollaboration.cpp.

39{
40 // delete all created Nodes saved in m_usedNodes map
41 for (const auto &[name,node] : m_usedNodes)
42 {
43 delete node;
44 }
45}

Reference m_usedNodes.

Public Member Functions

isTooBig()

bool DotGroupCollaboration::isTooBig ()

Declaration at line 39 of file dotgroupcollaboration.h, definition at line 324 of file dotgroupcollaboration.cpp.

325{
326 return numNodes()>=Config_getInt(DOT_GRAPH_MAX_NODES);
327}

References Config_getInt and numNodes.

Referenced by GroupDefImpl::writeGroupGraph.

isTrivial()

bool DotGroupCollaboration::isTrivial ()

Declaration at line 38 of file dotgroupcollaboration.h, definition at line 319 of file dotgroupcollaboration.cpp.

320{
321 return m_usedNodes.size() <= 1;
322}

Reference m_usedNodes.

Referenced by GroupDefImpl::writeGroupGraph.

numNodes()

int DotGroupCollaboration::numNodes ()

Declaration at line 40 of file dotgroupcollaboration.h, definition at line 329 of file dotgroupcollaboration.cpp.

330{
331 return static_cast<int>(m_usedNodes.size());
332}

Reference m_usedNodes.

Referenced by isTooBig and 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)

Declaration at line 35 of file dotgroupcollaboration.h, definition at line 249 of file dotgroupcollaboration.cpp.

250 GraphOutputFormat graphFormat, EmbeddedOutputFormat textFormat,
251 const QCString &path, const QCString &fileName, const QCString &relPath,
252 bool generateImageMap,int graphId)
253{
255
256 return DotGraph::writeGraph(t, graphFormat, textFormat, path, fileName, relPath, generateImageMap, graphId);
257}

References Html, DotGraph::m_doNotAddImageToIndex and DotGraph::writeGraph.

Referenced by DocbookGenerator::endGroupCollaboration, HtmlGenerator::endGroupCollaboration and LatexGenerator::endGroupCollaboration.

Protected Member Functions

computeTheGraph()

void DotGroupCollaboration::computeTheGraph ()
protected virtual

Declaration at line 45 of file dotgroupcollaboration.h, definition at line 216 of file dotgroupcollaboration.cpp.

217{
218 TextStream md5stream;
219 writeGraphHeader(md5stream,m_rootNode->label());
220
221 // clean write flags
222 for (const auto &[name,node] : m_usedNodes)
223 {
224 node->clearWriteFlag();
225 }
226
227 // write other nodes.
228 for (const auto &[name,node] : m_usedNodes)
229 {
231 }
232
233 // write edges
234 for (const auto &edge : m_edges)
235 {
236 edge->write( md5stream );
237 }
238
239 writeGraphFooter(md5stream);
240
241 m_theGraph = md5stream.str();
242}

References FALSE, Inheritance, m_edges, DotGraph::m_graphFormat, m_rootNode, DotGraph::m_theGraph, m_usedNodes, TextStream::str, TRUE, DotGraph::writeGraphFooter and writeGraphHeader.

getBaseName()

QCString DotGroupCollaboration::getBaseName ()
protected virtual

Declaration at line 43 of file dotgroupcollaboration.h, definition at line 211 of file dotgroupcollaboration.cpp.

Reference m_diskName.

getMapLabel()

QCString DotGroupCollaboration::getMapLabel ()
protected virtual

Declaration at line 44 of file dotgroupcollaboration.h, definition at line 244 of file dotgroupcollaboration.cpp.

References escapeCharsInString, FALSE and DotGraph::m_baseName.

Private Member Functions

addCollaborationMember()

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

Declaration at line 80 of file dotgroupcollaboration.h, definition at line 186 of file dotgroupcollaboration.cpp.

187 const Definition* def, QCString& url, EdgeType eType )
188{
189 // Create group nodes
190 QCString tmp_str;
191 for (const auto &d : def->partOfGroups())
192 {
193 auto it = m_usedNodes.find(d->name().str());
194 DotNode* nnode = it!=m_usedNodes.end() ? it->second : nullptr;
195 if ( nnode != m_rootNode )
196 {
197 if ( nnode==nullptr )
198 { // add node
199 tmp_str = d->getReference()+"$"+d->getOutputFileBase();
200 QCString tooltip = d->briefDescriptionAsTooltip();
201 nnode = new DotNode(this, d->groupTitle(), tooltip, tmp_str );
202 nnode->markAsVisible();
203 m_usedNodes.emplace(d->name().str(), nnode);
204 }
205 tmp_str = def->qualifiedName();
206 addEdge( m_rootNode, nnode, eType, tmp_str, url );
207 }
208 }
209}

References addEdge, DotGraph::DotNode, m_rootNode, m_usedNodes, DotNode::markAsVisible, Definition::partOfGroups and Definition::qualifiedName.

Referenced by addMemberList and buildGraph.

addEdge()

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

Declaration at line 83 of file dotgroupcollaboration.h, definition at line 162 of file dotgroupcollaboration.cpp.

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

References DotGraph::DotNode, QCString::isEmpty and m_edges.

Referenced by addCollaborationMember and buildGraph.

addMemberList()

void DotGroupCollaboration::addMemberList (class MemberList * ml)

Declaration at line 81 of file dotgroupcollaboration.h, definition at line 151 of file dotgroupcollaboration.cpp.

152{
153 QCString url;
154 if ( ml==nullptr || ml->empty() ) return;
155 for (const auto &def : *ml)
156 {
157 makeURL(def,url);
159 }
160}

References addCollaborationMember, MemberVector::empty, makeURL and tmember.

Referenced by buildGraph.

buildGraph()

void DotGroupCollaboration::buildGraph (const GroupDef * gd)

Declaration at line 79 of file dotgroupcollaboration.h, definition at line 58 of file dotgroupcollaboration.cpp.

59{
60 QCString url;
61 //===========================
62 // hierarchy.
63
64 // Write parents
65 for (const auto &d : gd->partOfGroups())
66 {
67 DotNode *nnode = nullptr;
68 auto it = m_usedNodes.find(d->name().str());
69 if ( it==m_usedNodes.end())
70 { // add node
71 makeURL(d,url);
72 QCString tooltip = d->briefDescriptionAsTooltip();
73 nnode = new DotNode(this, d->groupTitle(), tooltip, url );
74 nnode->markAsVisible();
75 m_usedNodes.emplace(d->name().str(), nnode);
76 }
77 else
78 {
79 nnode = it->second;
80 }
81 url = "";
83 }
84
85 // Add subgroups
86 for (const auto &def : gd->getSubGroups())
87 {
88 DotNode *nnode = nullptr;
89 auto it = m_usedNodes.find(def->name().str());
90 if ( it==m_usedNodes.end())
91 { // add node
92 makeURL(def,url);
93 QCString tooltip = def->briefDescriptionAsTooltip();
94 nnode = new DotNode(this, def->groupTitle(), tooltip, url );
95 nnode->markAsVisible();
96 m_usedNodes.emplace(def->name().str(), nnode);
97 }
98 else
99 {
100 nnode = it->second;
101 }
102 url = "";
104 }
105
106 //=======================
107 // Write collaboration
108
109 // Add members
110 addMemberList( gd->getMemberList(MemberListType::AllMembersList()) );
111
112 // Add classes
113 for (const auto &def : gd->getClasses())
114 {
115 makeURL(def,url);
117 }
118
119 // Add namespaces
120 for (const auto &def : gd->getNamespaces())
121 {
122 makeURL(def,url);
124 }
125
126 // Add files
127 for (const auto &def : gd->getFiles())
128 {
129 makeURL(def,url);
131 }
132
133 // Add pages
134 for (const auto &def : gd->getPages())
135 {
136 makeURL(def,url);
138 }
139
140 // Add directories
141 if ( !gd->getDirs().empty() )
142 {
143 for(const auto def : gd->getDirs())
144 {
145 makeURL(def,url);
147 }
148 }
149}

References addCollaborationMember, addEdge, addMemberList, DotGraph::DotNode, GroupDef::getClasses, GroupDef::getDirs, GroupDef::getFiles, GroupDef::getMemberList, GroupDef::getNamespaces, GroupDef::getPages, GroupDef::getSubGroups, m_rootNode, m_usedNodes, makeURL, DotNode::markAsVisible, Definition::partOfGroups, tclass, tdir, tfile, thierarchy, tnamespace and tpages.

Referenced by DotGroupCollaboration.

writeGraphHeader()

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

Declaration at line 82 of file dotgroupcollaboration.h, definition at line 334 of file dotgroupcollaboration.cpp.

335{
337 t << " rankdir=LR;\n";
338}

Reference DotGraph::writeGraphHeader.

Referenced by computeTheGraph.

Private Member Attributes

m_diskName

QCString DotGroupCollaboration::m_diskName

Definition at line 88 of file dotgroupcollaboration.h.

Referenced by DotGroupCollaboration and getBaseName.

m_edges

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

Definition at line 89 of file dotgroupcollaboration.h.

89 std::vector< std::unique_ptr<Edge> > m_edges;

Referenced by addEdge and computeTheGraph.

m_rootNode

DotNode* DotGroupCollaboration::m_rootNode

m_usedNodes

DotNodeMap DotGroupCollaboration::m_usedNodes

The documentation for this class was generated from the following files:


Generated via doxygen2docusaurus by Doxygen 1.14.0.