Doxygen
Toggle main menu visibility
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
26
class
DotNode
;
27
class
TextStream
;
28
29
enum class
GraphOutputFormat
{
BITMAP
,
EPS
};
30
enum class
EmbeddedOutputFormat
{
Html
,
LaTeX
,
Rtf
,
DocBook
};
31
enum class
GraphType
{
Dependency
,
Inheritance
,
Collaboration
,
Hierarchy
,
CallGraph
};
32
33
/** A dot graph */
34
class
DotGraph
35
{
36
friend
class
DotNode
;
37
public
:
38
DotGraph
() :
m_doNotAddImageToIndex
(
FALSE
),
m_noDivTag
(
FALSE
),
39
m_zoomable
(
TRUE
),
m_urlOnly
(
FALSE
) {}
40
virtual
~DotGraph
() =
default
;
41
NON_COPYABLE
(
DotGraph
)
42
43
protected
:
44
/** returns the node number. */
45
int
getNextNodeNumber
() {
return
++
m_curNodeNumber
; }
46
/** returns the edge number. */
47
int
getNextEdgeNumber
() {
return
++
m_curEdgeNumber
; }
48
49
QCString
writeGraph
(
TextStream
&t,
50
GraphOutputFormat
gf,
51
EmbeddedOutputFormat
ef,
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
78
QCString
absBaseName
()
const
{
return
m_absPath
+
m_baseName
; }
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
85
GraphOutputFormat
m_graphFormat
=
GraphOutputFormat::BITMAP
;
86
EmbeddedOutputFormat
m_textFormat
=
EmbeddedOutputFormat::Html
;
87
Dir
m_dir
;
88
QCString
m_fileName
;
89
QCString
m_relPath
;
90
bool
m_generateImageMap
=
false
;
91
int
m_graphId
= 0;
92
93
QCString
m_absPath
;
94
QCString
m_baseName
;
95
QCString
m_theGraph
;
96
bool
m_regenerate
=
false
;
97
bool
m_doNotAddImageToIndex
=
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
107
int
m_curNodeNumber
= 0;
108
int
m_curEdgeNumber
= 0;
109
};
110
111
#endif
Dir
Class representing a directory in the file system.
Definition
dir.h:75
DotGraph::absBaseName
QCString absBaseName() const
Definition
dotgraph.h:78
DotGraph::m_noDivTag
bool m_noDivTag
Definition
dotgraph.h:98
DotGraph::absMapName
virtual QCString absMapName() const
Definition
dotgraph.h:72
DotGraph::m_dir
Dir m_dir
Definition
dotgraph.h:87
DotGraph::m_graphId
int m_graphId
Definition
dotgraph.h:91
DotGraph::computeGraph
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
DotGraph::m_textFormat
EmbeddedOutputFormat m_textFormat
Definition
dotgraph.h:86
DotGraph::imgName
QCString imgName() const
Definition
dotgraph.cpp:107
DotGraph::m_fileName
QCString m_fileName
Definition
dotgraph.h:88
DotGraph::absImgName
QCString absImgName() const
Definition
dotgraph.h:81
DotGraph::writeGraphFooter
static void writeGraphFooter(TextStream &t)
Definition
dotgraph.cpp:301
DotGraph::m_urlOnly
bool m_urlOnly
Definition
dotgraph.h:100
DotGraph::getBaseName
virtual QCString getBaseName() const =0
DotGraph::m_graphFormat
GraphOutputFormat m_graphFormat
Definition
dotgraph.h:85
DotGraph::~DotGraph
virtual ~DotGraph()=default
DotGraph::DotGraph
DotGraph()
Definition
dotgraph.h:38
DotGraph::generateCode
void generateCode(TextStream &t)
Definition
dotgraph.cpp:212
DotGraph::prepareDotFile
bool prepareDotFile()
Definition
dotgraph.cpp:151
DotGraph::writeGraphHeader
static void writeGraphHeader(TextStream &t, const QCString &title=QCString())
Definition
dotgraph.cpp:276
DotGraph::m_curNodeNumber
int m_curNodeNumber
Definition
dotgraph.h:107
DotGraph::getImgAltText
virtual QCString getImgAltText() const
Definition
dotgraph.h:74
DotGraph::relImgName
QCString relImgName() const
Definition
dotgraph.h:82
DotGraph::m_absPath
QCString m_absPath
Definition
dotgraph.h:93
DotGraph::getMapLabel
virtual QCString getMapLabel() const =0
DotGraph::m_doNotAddImageToIndex
bool m_doNotAddImageToIndex
Definition
dotgraph.h:97
DotGraph::m_regenerate
bool m_regenerate
Definition
dotgraph.h:96
DotGraph::getNextEdgeNumber
int getNextEdgeNumber()
returns the edge number.
Definition
dotgraph.h:47
DotGraph::m_zoomable
bool m_zoomable
Definition
dotgraph.h:99
DotGraph::absDotName
QCString absDotName() const
Definition
dotgraph.h:79
DotGraph::m_theGraph
QCString m_theGraph
Definition
dotgraph.h:95
DotGraph::getNextNodeNumber
int getNextNodeNumber()
returns the node number.
Definition
dotgraph.h:45
DotGraph::m_baseName
QCString m_baseName
Definition
dotgraph.h:94
DotGraph::m_curEdgeNumber
int m_curEdgeNumber
Definition
dotgraph.h:108
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:115
DotGraph::computeTheGraph
virtual void computeTheGraph()=0
DotGraph::DotNode
friend class DotNode
Definition
dotgraph.h:36
DotGraph::m_generateImageMap
bool m_generateImageMap
Definition
dotgraph.h:90
DotGraph::m_relPath
QCString m_relPath
Definition
dotgraph.h:89
DotNode
A node in a dot graph.
Definition
dotnode.h:68
QCString
This is an alternative implementation of QCString.
Definition
qcstring.h:101
TextStream
Text streaming class that buffers data.
Definition
textstream.h:36
construct.h
NON_COPYABLE
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition
construct.h:37
dir.h
GraphType
GraphType
Definition
dotgraph.h:31
GraphType::Hierarchy
@ Hierarchy
Definition
dotgraph.h:31
GraphType::Collaboration
@ Collaboration
Definition
dotgraph.h:31
GraphType::Dependency
@ Dependency
Definition
dotgraph.h:31
GraphType::CallGraph
@ CallGraph
Definition
dotgraph.h:31
GraphType::Inheritance
@ Inheritance
Definition
dotgraph.h:31
EmbeddedOutputFormat
EmbeddedOutputFormat
Definition
dotgraph.h:30
EmbeddedOutputFormat::Html
@ Html
Definition
dotgraph.h:30
EmbeddedOutputFormat::DocBook
@ DocBook
Definition
dotgraph.h:30
EmbeddedOutputFormat::LaTeX
@ LaTeX
Definition
dotgraph.h:30
EmbeddedOutputFormat::Rtf
@ Rtf
Definition
dotgraph.h:30
GraphOutputFormat
GraphOutputFormat
Definition
dotgraph.h:29
GraphOutputFormat::BITMAP
@ BITMAP
Definition
dotgraph.h:29
GraphOutputFormat::EPS
@ EPS
Definition
dotgraph.h:29
qcstring.h
TRUE
#define TRUE
Definition
qcstring.h:37
FALSE
#define FALSE
Definition
qcstring.h:34
src
dotgraph.h
Generated by
1.17.0