Doxygen
Loading...
Searching...
No Matches
dotgraph.h
Go to the documentation of this file.
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 DOTGRAPH_H
17#define DOTGRAPH_H
18
19#include <iostream>
20#include <map>
21
22#include "qcstring.h"
23#include "dir.h"
24#include "construct.h"
25
26class DotNode;
27class TextStream;
28
32
33/** A dot graph */
35{
36 friend class DotNode;
37 public:
40 virtual ~DotGraph() = default;
42
43 protected:
44 /** returns the node number. */
46 /** returns the edge number. */
48
52 const QCString &path,
53 const QCString &fileName,
54 const QCString &relPath,
55 bool writeImageMap=TRUE,
56 int graphId=-1
57 );
58
59 static void writeGraphHeader(TextStream& t, const QCString& title = QCString());
60 static void writeGraphFooter(TextStream& t);
61 static void computeGraph(DotNode* root,
62 GraphType gt,
63 GraphOutputFormat format,
64 const QCString& rank, // either "LR", "RL", or ""
65 bool renderParents,
66 bool backArrows,
67 const QCString& title,
68 QCString& graphStr
69 );
70
71 virtual QCString getBaseName() const = 0;
72 virtual QCString absMapName() const { return m_absPath + m_baseName + ".map"; }
73 virtual QCString getMapLabel() const = 0;
74 virtual QCString getImgAltText() const { return ""; }
75
76 virtual void computeTheGraph() = 0;
77
79 QCString absDotName() const { return m_absPath + m_baseName + ".dot"; }
80 QCString imgName() const;
81 QCString absImgName() const { return m_absPath + imgName(); }
82 QCString relImgName() const { return m_relPath + imgName(); }
83
84 // the following variables are used while writing the graph to a .dot file
90 bool m_generateImageMap = false;
91 int m_graphId = 0;
92
96 bool m_regenerate = false;
98 bool m_noDivTag = false;
99 bool m_zoomable = true;
100 bool m_urlOnly = false;
101
102 private:
103
104 bool prepareDotFile();
105 void generateCode(TextStream &t);
106
109};
110
111#endif
Class representing a directory in the file system.
Definition dir.h:75
QCString absBaseName() const
Definition dotgraph.h:78
bool m_noDivTag
Definition dotgraph.h:98
virtual QCString absMapName() const
Definition dotgraph.h:72
Dir m_dir
Definition dotgraph.h:87
int m_graphId
Definition dotgraph.h:91
static void computeGraph(DotNode *root, GraphType gt, GraphOutputFormat format, const QCString &rank, bool renderParents, bool backArrows, const QCString &title, QCString &graphStr)
Definition dotgraph.cpp:306
EmbeddedOutputFormat m_textFormat
Definition dotgraph.h:86
QCString imgName() const
Definition dotgraph.cpp:107
QCString m_fileName
Definition dotgraph.h:88
QCString absImgName() const
Definition dotgraph.h:81
static void writeGraphFooter(TextStream &t)
Definition dotgraph.cpp:301
bool m_urlOnly
Definition dotgraph.h:100
virtual QCString getBaseName() const =0
GraphOutputFormat m_graphFormat
Definition dotgraph.h:85
virtual ~DotGraph()=default
DotGraph()
Definition dotgraph.h:38
void generateCode(TextStream &t)
Definition dotgraph.cpp:212
bool prepareDotFile()
Definition dotgraph.cpp:151
static void writeGraphHeader(TextStream &t, const QCString &title=QCString())
Definition dotgraph.cpp:276
int m_curNodeNumber
Definition dotgraph.h:107
virtual QCString getImgAltText() const
Definition dotgraph.h:74
QCString relImgName() const
Definition dotgraph.h:82
QCString m_absPath
Definition dotgraph.h:93
virtual QCString getMapLabel() const =0
bool m_doNotAddImageToIndex
Definition dotgraph.h:97
bool m_regenerate
Definition dotgraph.h:96
int getNextEdgeNumber()
returns the edge number.
Definition dotgraph.h:47
bool m_zoomable
Definition dotgraph.h:99
QCString absDotName() const
Definition dotgraph.h:79
QCString m_theGraph
Definition dotgraph.h:95
int getNextNodeNumber()
returns the node number.
Definition dotgraph.h:45
QCString m_baseName
Definition dotgraph.h:94
int m_curEdgeNumber
Definition dotgraph.h:108
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:115
virtual void computeTheGraph()=0
friend class DotNode
Definition dotgraph.h:36
bool m_generateImageMap
Definition dotgraph.h:90
QCString m_relPath
Definition dotgraph.h:89
A node in a dot graph.
Definition dotnode.h:68
This is an alternative implementation of QCString.
Definition qcstring.h:101
Text streaming class that buffers data.
Definition textstream.h:36
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition construct.h:37
GraphType
Definition dotgraph.h:31
@ Hierarchy
Definition dotgraph.h:31
@ Collaboration
Definition dotgraph.h:31
@ Dependency
Definition dotgraph.h:31
@ CallGraph
Definition dotgraph.h:31
@ Inheritance
Definition dotgraph.h:31
EmbeddedOutputFormat
Definition dotgraph.h:30
GraphOutputFormat
Definition dotgraph.h:29
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34