|
Doxygen
|
#include "dotdirdeps.h"#include "util.h"#include "doxygen.h"#include "config.h"#include "image.h"#include "dotnode.h"#include <algorithm>#include <iterator>#include <utility>#include <cstdint>#include <math.h>#include <cassert>#include <map>#include <memory>#include <string>#include <vector>Go to the source code of this file.
Classes | |
| struct | DotDirProperty |
| Properties are used to format the directories in the graph distinctively. More... | |
| class | DotDirPropertyBuilder |
| Builder helper to create instances of the DotDirProperty struct. More... | |
Typedefs | |
| using | DirDefMap = std::map<std::string,const DirDef *> |
| typedef std::vector< std::pair< std::unique_ptr< DirRelation >, bool > > | DirRelations |
| Elements consist of (1) directory relation and (2) whether it is pointing only to inherited dependees. | |
Functions | |
| static QCString | getDirectoryBackgroundColor (int depthIndex) |
| Returns a DOT color name according to the directory depth. | |
| static const char * | getDirectoryBorderColor (const DotDirProperty &property) |
| Returns a DOT color name according to the directory properties. | |
| static std::string | getDirectoryBorderStyle (const DotDirProperty &property) |
| Returns a DOT node style according to the directory properties. | |
| static TextStream & | common_attributes (TextStream &t, const DirDef *const dir, const DotDirProperty &prop) |
| static void | drawDirectory (TextStream &t, const DirDef *const directory, const DotDirProperty &property, DirDefMap &directoriesInGraph, int startLevel) |
| Puts DOT code for drawing directory to stream and adds it to the list. | |
| static bool | isAtMaxDepth (const DirDef *const directory, const int startLevel) |
| Checks, if the directory is a the maximum drawn directory level. | |
| static void | drawClusterOpening (TextStream &outputStream, const DirDef *const directory, const DotDirProperty &directoryProperty, DirDefMap &directoriesInGraph, const bool isAncestor, int startLevel) |
| Writes DOT code for opening a cluster subgraph to stream. | |
| static void | drawClusterClosing (TextStream &t) |
| static void | addDependencies (DirRelations &dependencies, const DirDef *const srcDir, bool isLeaf) |
| Assembles a list of the directory relations and whether or not they result from "inheritance". | |
| static void | drawTree (DirRelations &dependencies, TextStream &t, const DirDef *const directory, int startLevel, DirDefMap &directoriesInGraph, const bool isTreeRoot) |
| Recursively draws directory tree. | |
| void | writeDotDirDepGraph (TextStream &t, const DirDef *dd, bool linkRelations) |
| Write DOT code for directory dependency graph. | |
Definition at line 34 of file dotdirdeps.cpp.
| typedef std::vector< std::pair< std::unique_ptr<DirRelation>, bool> > DirRelations |
Elements consist of (1) directory relation and (2) whether it is pointing only to inherited dependees.
Definition at line 61 of file dotdirdeps.cpp.
|
static |
Assembles a list of the directory relations and whether or not they result from "inheritance".
| dependencies | Array to add the dependencies to. |
| srcDir | is the source of the dependency. |
| isLeaf | true, if no children are drawn for this directory. |
Definition at line 215 of file dotdirdeps.cpp.
References DirDef::dirIndex(), QCString::sprintf(), and DirDef::usedDirs().
Referenced by drawTree().
|
static |
Definition at line 137 of file dotdirdeps.cpp.
References addHtmlExtensionIfMissing(), Definition::briefDescriptionAsTooltip(), escapeTooltip(), getDirectoryBorderStyle(), and Definition::getOutputFileBase().
Referenced by drawClusterOpening(), and drawDirectory().
|
static |
|
static |
Writes DOT code for opening a cluster subgraph to stream.
Ancestor clusters directly get a label. Other clusters get a plain text node with a label instead. This is because the plain text node can be used to draw dependency relationships.
Definition at line 179 of file dotdirdeps.cpp.
References common_attributes(), Config_getString, DotNode::convertLabel(), getDirectoryBackgroundColor(), getDirectoryBorderColor(), Definition::getOutputFileBase(), DirDef::level(), DirDef::shortName(), and QCString::str().
Referenced by drawTree(), and writeDotDirDepGraph().
|
static |
Puts DOT code for drawing directory to stream and adds it to the list.
| [in,out] | t | stream to which the DOT code is written to |
| [in] | directory | will be mapped to a node in DOT code |
| [in] | property | are evaluated for formatting |
| [in,out] | directoriesInGraph | lists the directories which have been written to the output stream |
| [in] | startLevel | current level to calculate relative distances from to determine the background color |
Definition at line 155 of file dotdirdeps.cpp.
References common_attributes(), DotNode::convertLabel(), getDirectoryBackgroundColor(), getDirectoryBorderColor(), Definition::getOutputFileBase(), DirDef::level(), DirDef::shortName(), and QCString::str().
Referenced by drawTree().
|
static |
Recursively draws directory tree.
Definition at line 233 of file dotdirdeps.cpp.
References addDependencies(), drawClusterClosing(), drawClusterOpening(), drawDirectory(), drawTree(), DirDef::hasSubdirs(), isAtMaxDepth(), DotDirPropertyBuilder::makeOriginal(), and DirDef::subDirs().
Referenced by drawTree().
|
static |
Returns a DOT color name according to the directory depth.
Definition at line 64 of file dotdirdeps.cpp.
References Config_getInt, hex, and ColoredImage::hsl2rgb().
Referenced by drawClusterOpening(), and drawDirectory().
|
static |
Returns a DOT color name according to the directory properties.
Definition at line 98 of file dotdirdeps.cpp.
References DotDirProperty::isOrphaned, and DotDirProperty::isTruncated.
Referenced by drawClusterOpening(), and drawDirectory().
|
static |
Returns a DOT node style according to the directory properties.
Definition at line 119 of file dotdirdeps.cpp.
References DotDirProperty::isIncomplete, DotDirProperty::isOriginal, DotDirProperty::isOrphaned, and DotDirProperty::isTruncated.
Referenced by common_attributes().
|
static |
Checks, if the directory is a the maximum drawn directory level.
Definition at line 168 of file dotdirdeps.cpp.
References Config_getInt, and DirDef::level().
Referenced by drawTree().
| void writeDotDirDepGraph | ( | TextStream & | t, |
| const DirDef * | dd, | ||
| bool | linkRelations ) |
Write DOT code for directory dependency graph.
Code is generated for a directory. Successors (sub-directories) of this directory are recursively drawn. Recursion is limited by DIR_GRAPH_MAX_DEPTH. The dependencies of those directories are drawn.
If a dependee is not part of directory tree above, then the dependency is drawn to the first parent of the dependee, whose parent is an ancestor (sub-directory) of the original directory.
| t | stream where the DOT code is written to |
| dd | directory for which the graph is generated for |
| linkRelations | if true, hyperlinks to the list of file dependencies are added |
Definition at line 287 of file dotdirdeps.cpp.
References drawClusterOpening(), Definition::getOutputFileBase(), DirDef::parent(), parent(), QCString::str(), and DirDef::usedDirs().
Referenced by DotDirDeps::computeTheGraph().