doxygen
dotgroupcollaboration.h
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 #ifndef DOTGROUPCOLLABORATION_H
17 #define DOTGROUPCOLLABORATION_H
18 
19 #include <memory>
20 
21 #include "dotnode.h"
22 #include "dotgraph.h"
23 #include "groupdef.h"
24 
25 class TextStream;
26 
29 {
30  public :
33  QCString writeGraph(TextStream &t, GraphOutputFormat gf,EmbeddedOutputFormat ef,
34  const QCString &path,const QCString &fileName,const QCString &relPath,
35  bool writeImageMap=TRUE,int graphId=-1);
36  bool isTrivial() const;
37 
38  protected:
39  virtual QCString getBaseName() const;
40  virtual QCString getMapLabel() const;
41  virtual void computeTheGraph();
42 
43  private :
44  enum EdgeType
45  {
46  tmember = 0,
47  tclass,
48  tnamespace,
49  tfile,
50  tpages,
51  tdir,
52  thierarchy
53  };
54 
55  struct Link
56  {
57  Link(const QCString &lab,const QCString &u) : label(lab), url(u) {}
58  QCString label;
59  QCString url;
60  };
61 
62  struct Edge
63  {
64  Edge(DotNode *start,DotNode *end,EdgeType type)
65  : pNStart(start), pNEnd(end), eType(type) {}
66 
67  DotNode* pNStart;
68  DotNode* pNEnd;
69  EdgeType eType;
70 
71  std::vector<Link> links;
72  void write( TextStream &t ) const;
73  };
74 
75  void buildGraph(const GroupDef* gd);
76  void addCollaborationMember(const Definition* def, QCString& url, EdgeType eType );
77  void addMemberList( class MemberList* ml );
78  void writeGraphHeader(TextStream &t,const QCString &title) const;
79  Edge* addEdge( DotNode* _pNStart, DotNode* _pNEnd, EdgeType _eType,
80  const QCString& _label, const QCString& _url );
81 
82  DotNode *m_rootNode;
83  DotNodeMap m_usedNodes;
84  QCString m_diskName;
85  std::vector< std::unique_ptr<Edge> > m_edges;
86 };
87 
88 using DotGroupCollaborationPtr = std::shared_ptr<DotGroupCollaboration>;
89 
90 #endif
The common base class of all entity definitions found in the sources.
Definition: definition.h:76
A node in a dot graph.
Definition: dotnode.h:56
Text streaming class that buffers data.
Definition: textstream.h:33
Representation of a group collaboration graph.
Definition: dotgroupcollaboration.h:28
Definition: dotnode.h:134
A list of MemberDef objects as shown in documentation sections.
Definition: memberlist.h:81
A dot graph.
Definition: dotgraph.h:32
This is an alternative implementation of QCString.
Definition: qcstring.h:108
A model of a group of symbols.
Definition: groupdef.h:49