Public Member Functions | Private Attributes | List of all members
DiagramRow Class Reference
Inheritance diagram for DiagramRow:
QList< DiagramItem > QGList

Public Member Functions

 DiagramRow (TreeDiagram *d, int l)
 
void insertClass (DiagramItem *parent, ClassDef *cd, bool doBases, Protection prot, Specifier virt, const char *ts)
 
uint number ()
 
- Public Member Functions inherited from QList< DiagramItem >
 QList ()
 
 QList (const QList< DiagramItem > &l)
 
 ~QList ()
 
QList< DiagramItem > & operator= (const QList< DiagramItem > &l)
 
bool operator== (const QList< DiagramItem > &list) const
 
uint count () const
 
bool isEmpty () const
 
bool insert (uint i, const DiagramItem *d)
 
void inSort (const DiagramItem *d)
 
void prepend (const DiagramItem *d)
 
void append (const DiagramItem *d)
 
bool remove (uint i)
 
bool remove (const DiagramItem *d)
 
bool removeRef (const DiagramItem *d)
 
bool removeFirst ()
 
bool removeLast ()
 
DiagramItemtake (uint i)
 
void clear ()
 
void sort ()
 
int find (const DiagramItem *d) const
 
int findRef (const DiagramItem *d) const
 
uint contains (const DiagramItem *d) const
 
uint containsRef (const DiagramItem *d) const
 
DiagramItemat (uint i) const
 
DiagramItemgetFirst () const
 
DiagramItemgetLast () const
 
void setAutoDelete (bool enable)
 

Private Attributes

TreeDiagramdiagram
 
uint level
 

Detailed Description

Class representing a row in the built-in class diagram

Definition at line 85 of file diagram.cpp.

Constructor & Destructor Documentation

DiagramRow::DiagramRow ( TreeDiagram d,
int  l 
)
inline

Definition at line 88 of file diagram.cpp.

89  {
90  diagram=d;
91  level=l;
93  }
TreeDiagram * diagram
Definition: diagram.cpp:98
static QStrList * l
Definition: config.cpp:1044
uint level
Definition: diagram.cpp:99
void setAutoDelete(bool enable)
Definition: qlist.h:99
const bool TRUE
Definition: qglobal.h:371

Member Function Documentation

void DiagramRow::insertClass ( DiagramItem parent,
ClassDef cd,
bool  doBases,
Protection  prot,
Specifier  virt,
const char *  ts 
)

Definition at line 357 of file diagram.cpp.

359 {
360  //if (cd->visited) return; // the visit check does not work in case of
361  // multiple inheritance of the same class!
362  DiagramItem *di=new DiagramItem(parent, diagram->at(level)->count(),
363  cd,prot,virt,ts);
364  //cd->visited=TRUE;
365  if (parent) parent->addChild(di);
367  append(di);
368  BaseClassList *bcl=doBases ? cd->baseClasses() : cd->subClasses();
369  int count=0;
370  if (bcl)
371  {
372  /* there are base/sub classes */
373  BaseClassListIterator it(*bcl);
374  BaseClassDef *bcd;
375  for (;(bcd=it.current());++it)
376  {
377  ClassDef *ccd=bcd->classDef;
378  if (ccd && ccd->isVisibleInHierarchy() /*&& !ccd->visited*/) count++;
379  }
380  }
381  if (count>0 && (prot!=Private || !doBases))
382  {
383  DiagramRow *row=0;
384  if (diagram->count()<=level+1) /* add new row */
385  {
386  row = new DiagramRow(diagram,level+1);
387  diagram->append(row);
388  }
389  else /* get next row */
390  {
391  row=diagram->at(level+1);
392  }
393  /* insert base classes in the next row */
394  BaseClassListIterator it(*bcl);
395  BaseClassDef *bcd;
396  for (;(bcd=it.current());++it)
397  {
398  ClassDef *ccd=bcd->classDef;
399  if (ccd && ccd->isVisibleInHierarchy() /*&& !ccd->visited*/)
400  {
401  row->insertClass(di,ccd,doBases,bcd->prot,
402  doBases?bcd->virt:Normal,
403  doBases?bcd->templSpecifiers.data():"");
404  }
405  }
406  }
407 }
void move(int dx, int dy)
Definition: diagram.cpp:52
ClassDef * classDef
Definition: classdef.h:520
BaseClassList * subClasses() const
Definition: classdef.cpp:4404
void append(const DiagramItem *d)
Definition: qlist.h:73
TreeDiagram * diagram
Definition: diagram.cpp:98
Definition: types.h:26
const int gridHeight
Definition: diagram.cpp:143
DiagramRow(TreeDiagram *d, int l)
Definition: diagram.cpp:88
type * at(uint i) const
Definition: qlist.h:94
Protection prot
Definition: classdef.h:530
Definition: types.h:29
void insertClass(DiagramItem *parent, ClassDef *cd, bool doBases, Protection prot, Specifier virt, const char *ts)
Definition: diagram.cpp:357
uint count() const
Definition: qlist.h:66
uint level
Definition: diagram.cpp:99
const char * data() const
Definition: qcstring.h:207
Specifier virt
Definition: classdef.h:535
static Specifier virt
QCString templSpecifiers
Definition: classdef.h:538
bool isVisibleInHierarchy()
Definition: classdef.cpp:2743
void addChild(DiagramItem *di)
Definition: diagram.cpp:352
const int gridWidth
Definition: diagram.cpp:142
BaseClassList * baseClasses() const
Definition: classdef.cpp:4399
uint DiagramRow::number ( )
inline

Definition at line 96 of file diagram.cpp.

96 { return level; }
uint level
Definition: diagram.cpp:99

Member Data Documentation

TreeDiagram* DiagramRow::diagram
private

Definition at line 98 of file diagram.cpp.

uint DiagramRow::level
private

Definition at line 99 of file diagram.cpp.


The documentation for this class was generated from the following file: