Classes | Macros | Functions | Variables
diagram.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <qlist.h>
#include <qarray.h>
#include "ftextstream.h"
#include <qfile.h>
#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"

Go to the source code of this file.

Classes

class  DiagramItem
 
class  DiagramItemList
 
class  DiagramRow
 
class  DiagramRowIterator
 
class  TreeDiagram
 

Macros

#define IMAGE_EXT   ".png"
 

Functions

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

Variables

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

Macro Definition Documentation

#define IMAGE_EXT   ".png"

Function Documentation

void clearVisitFlags ( )

Definition at line 1017 of file diagram.cpp.

1018 {
1020  ClassDef *cd;
1021  for (;(cd=cli.current());++cli)
1022  {
1023  cd->visited=FALSE;
1024  }
1025 }
const bool FALSE
Definition: qglobal.h:370
def cli(ctx)
Definition: main.py:7
bool visited
Definition: classdef.h:402
friend class Iterator
Definition: sortdict.h:289
static ClassSDict * classSDict
Definition: doxygen.h:99
static Protection getMinProtectionLevel ( DiagramItemList dil)
static

Definition at line 210 of file diagram.cpp.

211 {
213  DiagramItem *di=it.current();
215  for (++it;(di=it.current());++it)
216  {
217  Protection p=di->protection();
218  if (p!=result)
219  {
220  if (result==Protected && p==Public) result=p;
221  else if (result==Private) result=p;
222  }
223  }
224  return result;
225 }
static QCString result
Definition: types.h:26
Protection protection() const
Definition: diagram.cpp:59
Definition: types.h:26
p
Definition: test.py:223
Protection
Definition: types.h:26
static uint protToColor ( Protection  p)
static

Definition at line 174 of file diagram.cpp.

175 {
176  switch(p)
177  {
178  case Public: return 6;
179  case Package: // package is not possible!
180  case Protected: return 5;
181  case Private: return 4;
182  }
183  return 0;
184 }
Definition: types.h:26
Definition: types.h:26
Definition: types.h:26
p
Definition: test.py:223
static uint protToMask ( Protection  p)
static

Definition at line 162 of file diagram.cpp.

163 {
164  switch(p)
165  {
166  case Public: return 0xffffffff;
167  case Package: // package is not possible!
168  case Protected: return 0xcccccccc;
169  case Private: return 0xaaaaaaaa;
170  }
171  return 0;
172 }
Definition: types.h:26
Definition: types.h:26
Definition: types.h:26
p
Definition: test.py:223
static QCString protToString ( Protection  p)
static

Definition at line 186 of file diagram.cpp.

187 {
188  switch(p)
189  {
190  case Public: return "solid";
191  case Package: // package is not possible!
192  case Protected: return "dashed";
193  case Private: return "dotted";
194  }
195  return 0;
196 }
Definition: types.h:26
Definition: types.h:26
Definition: types.h:26
p
Definition: test.py:223
static uint virtToMask ( Specifier  p)
static

Definition at line 198 of file diagram.cpp.

199 {
200  switch(p)
201  {
202  case Normal: return 0xffffffff;
203  case Virtual: return 0xf0f0f0f0;
204  default: return 0;
205  }
206  return 0;
207 }
Definition: types.h:29
Definition: types.h:29
p
Definition: test.py:223
static void writeBitmapBox ( DiagramItem di,
Image image,
int  x,
int  y,
int  w,
int  h,
bool  firstRow,
bool  hasDocs,
bool  children = FALSE 
)
static

Definition at line 227 of file diagram.cpp.

230 {
231  int colFill = hasDocs ? (firstRow ? 0 : 2) : 7;
232  int colBorder = (firstRow || !hasDocs) ? 1 : 3;
233  int l = Image::stringLength(di->label());
235  image->fillRect(x+1,y+1,w-2,h-2,colFill,mask);
236  image->drawRect(x,y,w,h,colBorder,mask);
237  image->writeString(x+(w-l)/2, y+(h-fontHeight)/2, di->label(),1);
238  if (children)
239  {
240  int i;
241  for (i=0;i<5;i++)
242  image->drawHorzLine(y+h+i-6,x+w-2-i,x+w-2,firstRow?1:3,0xffffffff);
243  }
244 }
void fillRect(int x, int y, int width, int height, uchar colIndex, uint mask)
Definition: image.cpp:374
void drawHorzLine(int y, int xs, int xe, uchar colIndex, uint mask)
Definition: image.cpp:325
friend uint stringLength(const char *s)
Definition: image.cpp:314
static QStrList * l
Definition: config.cpp:1044
void writeString(int x, int y, const char *s, uchar fg)
Definition: image.cpp:301
void drawRect(int x, int y, int width, int height, uchar colIndex, uint mask)
Definition: image.cpp:366
Specifier virtualness() const
Definition: diagram.cpp:60
const uint fontHeight
Definition: diagram.cpp:148
static uint virtToMask(Specifier p)
Definition: diagram.cpp:198
QCString label() const
Definition: diagram.cpp:306
list x
Definition: train.py:276
unsigned uint
Definition: qglobal.h:351
static void writeMapArea ( FTextStream t,
ClassDef cd,
QCString  relPath,
int  x,
int  y,
int  w,
int  h 
)
static

Definition at line 255 of file diagram.cpp.

257 {
258  if (cd->isLinkable())
259  {
260  QCString ref=cd->getReference();
261  t << "<area ";
262  if (!ref.isEmpty())
263  {
264  t << externalLinkTarget() << externalRef(relPath,ref,FALSE);
265  }
266  t << "href=\"";
267  t << externalRef(relPath,ref,TRUE);
269  if (!cd->anchor().isEmpty())
270  {
271  t << "#" << cd->anchor();
272  }
273  t << "\" ";
274  QCString tooltip = cd->briefDescriptionAsTooltip();
275  if (!tooltip.isEmpty())
276  {
277  t << "title=\"" << convertToHtml(tooltip) << "\" ";
278  }
279  t << "alt=\"" << convertToXML(cd->displayName());
280  t << "\" shape=\"rect\" coords=\"" << x << "," << y << ",";
281  t << (x+w) << "," << (y+h) << "\"/>" << endl;
282  }
283 }
QCString convertToXML(const char *s)
Definition: util.cpp:5717
bool isEmpty() const
Definition: qcstring.h:189
static QCString htmlFileExtension
Definition: doxygen.h:130
const bool FALSE
Definition: qglobal.h:370
QCString displayName(bool includeScope=TRUE) const
Definition: classdef.cpp:312
QCString getReference() const
Definition: classdef.cpp:3814
QCString convertToHtml(const char *s, bool keepEntities)
Definition: util.cpp:5746
QCString anchor() const
Definition: classdef.cpp:4606
bool isLinkable() const
Definition: classdef.cpp:2729
QCString getOutputFileBase() const
Definition: classdef.cpp:3533
list x
Definition: train.py:276
QCString briefDescriptionAsTooltip() const
QCString externalLinkTarget()
Definition: util.cpp:7850
const bool TRUE
Definition: qglobal.h:371
QTextStream & endl(QTextStream &s)
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
Definition: util.cpp:7856
static void writeVectorBox ( FTextStream t,
DiagramItem di,
float  x,
float  y,
bool  children = FALSE 
)
static

Definition at line 246 of file diagram.cpp.

248 {
249  if (di->virtualness()==Virtual) t << "dashed\n";
250  t << " (" << di->label() << ") " << x << " " << y << " box\n";
251  if (children) t << x << " " << y << " mark\n";
252  if (di->virtualness()==Virtual) t << "solid\n";
253 }
Definition: types.h:29
Specifier virtualness() const
Definition: diagram.cpp:60
QCString label() const
Definition: diagram.cpp:306
list x
Definition: train.py:276

Variable Documentation

const uint fontHeight = 12

Definition at line 148 of file diagram.cpp.

const int gridHeight = 100

Definition at line 143 of file diagram.cpp.

const int gridWidth = 100

Definition at line 142 of file diagram.cpp.

const uint labelHorMargin = 6

Definition at line 147 of file diagram.cpp.

const uint labelHorSpacing = 10

Definition at line 145 of file diagram.cpp.

const uint labelVertSpacing = 32

Definition at line 146 of file diagram.cpp.

const uint maxTreeWidth = 8

Definition at line 141 of file diagram.cpp.