Doxygen
diagram.cpp 文件参考
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <algorithm>
#include "diagram.h"
#include "image.h"
#include "classdef.h"
#include "config.h"
#include "message.h"
#include "util.h"
#include "doxygen.h"
#include "portable.h"
#include "index.h"
#include "classlist.h"
#include "textstream.h"
+ diagram.cpp 的引用(Include)关系图:

浏览源代码.

class  DiagramItem
 Class representing a single node in the built-in class diagram 更多...
 
class  DiagramRow
 Class representing a row in the built-in class diagram 更多...
 
class  TreeDiagram
 Class representing the tree layout for the built-in class diagram. 更多...
 
class  DualDirIterator< C, I >
 helper class representing an iterator that can iterate forwards or backwards 更多...
 
struct  ClassDiagram::Private
 

宏定义

#define IMAGE_EXT   ".png"
 

类型定义

using DiagramItemList = std::vector< DiagramItem * >
 

函数

static uint protToMask (Protection p)
 
static uchar protToColor (Protection p)
 
static QCString protToString (Protection p)
 
static uint virtToMask (Specifier p)
 
static Protection getMinProtectionLevel (const DiagramItemList &dil)
 
static void writeBitmapBox (DiagramItem *di, Image *image, uint x, uint y, uint w, uint h, bool firstRow, bool hasDocs, bool children=FALSE)
 
static void writeVectorBox (TextStream &t, DiagramItem *di, float x, float y, bool children=FALSE)
 
static void writeMapArea (TextStream &t, const ClassDef *cd, QCString relPath, uint x, uint y, uint w, uint h)
 

变量

const uint maxTreeWidth = 8
 
const uint gridWidth = 100
 
const uint gridHeight = 100
 
const uint labelHorSpacing = 10
 
const uint labelVertSpacing = 32
 
const uint labelHorMargin = 6
 
const uint fontHeight = 12
 

宏定义说明

◆ IMAGE_EXT

#define IMAGE_EXT   ".png"

类型定义说明

◆ DiagramItemList

using DiagramItemList = std::vector<DiagramItem*>

在文件 diagram.cpp37 行定义.

函数说明

◆ getMinProtectionLevel()

static Protection getMinProtectionLevel ( const DiagramItemList dil)
static

在文件 diagram.cpp195 行定义.

196 {
197  auto it = dil.begin();
198  Protection result = Private;
199  if (it!=dil.end())
200  {
201  result=(*it)->protection();
202  for (++it;it!=dil.end();++it)
203  {
204  Protection p=(*it)->protection();
205  if (p!=result)
206  {
207  if (result==Protected && p==Public) result=p;
208  else if (result==Private) result=p;
209  }
210  }
211  }
212  return result;
213 }

引用了 Private, Protected , 以及 Public.

被这些函数引用 TreeDiagram::drawConnectors().

◆ protToColor()

static uchar protToColor ( Protection  p)
static

在文件 diagram.cpp159 行定义.

160 {
161  switch(p)
162  {
163  case Public: return 6;
164  case Package: // package is not possible!
165  case Protected: return 5;
166  case Private: return 4;
167  }
168  return 0;
169 }

引用了 Package, Private, Protected , 以及 Public.

被这些函数引用 TreeDiagram::drawConnectors().

◆ protToMask()

static uint protToMask ( Protection  p)
static

在文件 diagram.cpp147 行定义.

148 {
149  switch(p)
150  {
151  case Public: return 0xffffffff;
152  case Package: // package is not possible!
153  case Protected: return 0xcccccccc;
154  case Private: return 0xaaaaaaaa;
155  }
156  return 0;
157 }

引用了 Package, Private, Protected , 以及 Public.

被这些函数引用 TreeDiagram::drawConnectors().

◆ protToString()

static QCString protToString ( Protection  p)
static

在文件 diagram.cpp171 行定义.

172 {
173  switch(p)
174  {
175  case Public: return "solid";
176  case Package: // package is not possible!
177  case Protected: return "dashed";
178  case Private: return "dotted";
179  }
180  return QCString();
181 }

引用了 Package, Private, Protected , 以及 Public.

被这些函数引用 TreeDiagram::drawConnectors().

◆ virtToMask()

static uint virtToMask ( Specifier  p)
static

在文件 diagram.cpp183 行定义.

184 {
185  switch(p)
186  {
187  case Normal: return 0xffffffff;
188  case Virtual: return 0xf0f0f0f0;
189  default: return 0;
190  }
191  return 0;
192 }

引用了 Normal , 以及 Virtual.

被这些函数引用 writeBitmapBox().

◆ writeBitmapBox()

static void writeBitmapBox ( DiagramItem di,
Image image,
uint  x,
uint  y,
uint  w,
uint  h,
bool  firstRow,
bool  hasDocs,
bool  children = FALSE 
)
static

在文件 diagram.cpp215 行定义.

218 {
219  uchar colFill = hasDocs ? (firstRow ? 0 : 2) : 7;
220  uchar colBorder = (firstRow || !hasDocs) ? 1 : 3;
221  uint l = Image::stringLength(di->label());
222  uint mask=virtToMask(di->virtualness());
223  image->fillRect(x+1,y+1,w-2,h-2,colFill,mask);
224  image->drawRect(x,y,w,h,colBorder,mask);
225  image->writeString(x+(w-l)/2, y+(h-fontHeight)/2, di->label(),1);
226  if (children)
227  {
228  uint i;
229  for (i=0;i<5;i++)
230  {
231  image->drawHorzLine(y+h+i-6,x+w-2-i,x+w-2,firstRow?1:3,0xffffffff);
232  }
233  }
234 }

引用了 Image::drawHorzLine(), Image::drawRect(), Image::fillRect(), fontHeight, DiagramItem::label(), Image::stringLength, virtToMask(), DiagramItem::virtualness() , 以及 Image::writeString().

被这些函数引用 TreeDiagram::drawBoxes().

◆ writeMapArea()

static void writeMapArea ( TextStream t,
const ClassDef cd,
QCString  relPath,
uint  x,
uint  y,
uint  w,
uint  h 
)
static

在文件 diagram.cpp245 行定义.

247 {
248  if (cd->isLinkable())
249  {
250  QCString ref=cd->getReference();
251  t << "<area ";
252  if (!ref.isEmpty())
253  {
254  t << externalLinkTarget(true);
255  }
256  t << "href=\"";
257  t << externalRef(relPath,ref,TRUE);
259  if (!cd->anchor().isEmpty())
260  {
261  t << "#" << cd->anchor();
262  }
263  t << "\" ";
264  QCString tooltip = cd->briefDescriptionAsTooltip();
265  if (!tooltip.isEmpty())
266  {
267  t << "title=\"" << convertToHtml(tooltip) << "\" ";
268  }
269  t << "alt=\"" << convertToXML(cd->displayName());
270  t << "\" shape=\"rect\" coords=\"" << x << "," << y << ",";
271  t << (x+w) << "," << (y+h) << "\"/>\n";
272  }
273 }

引用了 addHtmlExtensionIfMissing(), ClassDef::anchor(), Definition::briefDescriptionAsTooltip(), convertToHtml(), convertToXML(), ClassDef::displayName(), externalLinkTarget(), externalRef(), ClassDef::getOutputFileBase(), ClassDef::getReference(), QCString::isEmpty(), ClassDef::isLinkable() , 以及 TRUE.

被这些函数引用 TreeDiagram::drawBoxes().

◆ writeVectorBox()

static void writeVectorBox ( TextStream t,
DiagramItem di,
float  x,
float  y,
bool  children = FALSE 
)
static

在文件 diagram.cpp236 行定义.

238 {
239  if (di->virtualness()==Virtual) t << "dashed\n";
240  t << " (" << convertToPSString(di->label()) << ") " << x << " " << y << " box\n";
241  if (children) t << x << " " << y << " mark\n";
242  if (di->virtualness()==Virtual) t << "solid\n";
243 }

引用了 convertToPSString(), DiagramItem::label(), Virtual , 以及 DiagramItem::virtualness().

被这些函数引用 TreeDiagram::drawBoxes().

变量说明

◆ fontHeight

const uint fontHeight = 12

在文件 diagram.cpp145 行定义.

被这些函数引用 writeBitmapBox() , 以及 ClassDiagram::writeImage().

◆ gridHeight

const uint gridHeight = 100

在文件 diagram.cpp140 行定义.

被这些函数引用 TreeDiagram::drawBoxes(), TreeDiagram::drawConnectors() , 以及 DiagramRow::insertClass().

◆ gridWidth

◆ labelHorMargin

const uint labelHorMargin = 6

在文件 diagram.cpp144 行定义.

被这些函数引用 ClassDiagram::writeImage().

◆ labelHorSpacing

const uint labelHorSpacing = 10

在文件 diagram.cpp142 行定义.

被这些函数引用 TreeDiagram::drawBoxes(), TreeDiagram::drawConnectors() , 以及 ClassDiagram::writeImage().

◆ labelVertSpacing

const uint labelVertSpacing = 32

在文件 diagram.cpp143 行定义.

被这些函数引用 TreeDiagram::drawBoxes(), TreeDiagram::drawConnectors() , 以及 ClassDiagram::writeImage().

◆ maxTreeWidth

const uint maxTreeWidth = 8

在文件 diagram.cpp138 行定义.

被这些函数引用 TreeDiagram::computeLayout().

Image::writeString
void writeString(uint x, uint y, const QCString &s, uchar fg)
Definition: image.cpp:300
Normal
@ Normal
Definition: types.h:29
Protection
Protection
Protection level of members
Definition: types.h:26
Private
@ Private
Definition: types.h:26
DiagramItem::label
QCString label() const
Definition: diagram.cpp:282
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
Image::drawRect
void drawRect(uint x, uint y, uint width, uint height, uchar colIndex, uint mask)
Definition: image.cpp:367
Image::stringLength
friend uint stringLength(const QCString &s)
Definition: image.cpp:314
Virtual
@ Virtual
Definition: types.h:29
Public
@ Public
Definition: types.h:26
Image::fillRect
void fillRect(uint x, uint y, uint width, uint height, uchar colIndex, uint mask)
Definition: image.cpp:375
Package
@ Package
Definition: types.h:26
uint
unsigned uint
Definition: qcstring.h:40
addHtmlExtensionIfMissing
QCString addHtmlExtensionIfMissing(const QCString &fName)
Definition: util.cpp:5275
uchar
unsigned char uchar
Definition: qcstring.h:38
fontHeight
const uint fontHeight
Definition: diagram.cpp:145
ClassDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
Returns the unique base name (without extension) of the class's file on disk
Image::drawHorzLine
void drawHorzLine(uint y, uint xs, uint xe, uchar colIndex, uint mask)
Definition: image.cpp:326
TRUE
#define TRUE
Definition: qcstring.h:36
externalLinkTarget
QCString externalLinkTarget(const bool parent)
Definition: util.cpp:6323
Protected
@ Protected
Definition: types.h:26
ClassDef::getReference
virtual QCString getReference() const =0
If this class originated from a tagfile, this will return the tag file reference
ClassDef::displayName
virtual QCString displayName(bool includeScope=TRUE) const =0
Returns the name as it is appears in the documentation
convertToXML
QCString convertToXML(const QCString &s, bool keepEntities)
Definition: util.cpp:3948
DiagramItem::virtualness
Specifier virtualness() const
Definition: diagram.cpp:57
Definition::briefDescriptionAsTooltip
virtual QCString briefDescriptionAsTooltip() const =0
virtToMask
static uint virtToMask(Specifier p)
Definition: diagram.cpp:183
externalRef
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
Definition: util.cpp:6334
ClassDef::isLinkable
virtual bool isLinkable() const =0
return TRUE iff a link to this class is possible (either within this project, or as a cross-reference...
convertToPSString
QCString convertToPSString(const QCString &s)
Definition: util.cpp:4142
convertToHtml
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition: util.cpp:4063
ClassDef::anchor
virtual QCString anchor() const =0
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108