Public Member Functions | Private Attributes | List of all members
DiagramItem Class Reference

Public Member Functions

 DiagramItem (DiagramItem *p, int number, ClassDef *cd, Protection prot, Specifier virt, const char *ts)
 
 ~DiagramItem ()
 
QCString label () const
 
QCString fileName () const
 
DiagramItemparentItem ()
 
DiagramItemListgetChildren ()
 
void move (int dx, int dy)
 
int xPos () const
 
int yPos () const
 
int avgChildPos () const
 
int numChildren () const
 
void addChild (DiagramItem *di)
 
int number () const
 
Protection protection () const
 
Specifier virtualness () const
 
void putInList ()
 
bool isInList () const
 
ClassDefgetClassDef () const
 

Private Attributes

DiagramItemListchildren
 
DiagramItemparent
 
int x
 
int y
 
int num
 
Protection prot
 
Specifier virt
 
QCString templSpec
 
bool inList
 
ClassDefclassDef
 

Detailed Description

Class representing a single node in the built-in class diagram

Definition at line 42 of file diagram.cpp.

Constructor & Destructor Documentation

DiagramItem::DiagramItem ( DiagramItem p,
int  number,
ClassDef cd,
Protection  prot,
Specifier  virt,
const char *  ts 
)

Definition at line 286 of file diagram.cpp.

288 {
289  parent=p;
290  x=y=0;
291  //name=n;
292  num=number;
294  prot=pr;
295  virt=vi;
296  inList=FALSE;
297  classDef=cd;
298  templSpec=ts;
299 }
ClassDef * classDef
Definition: diagram.cpp:73
const bool FALSE
Definition: qglobal.h:370
int number() const
Definition: diagram.cpp:58
Specifier virt
Definition: diagram.cpp:70
DiagramItem * parent
Definition: diagram.cpp:66
QCString templSpec
Definition: diagram.cpp:71
p
Definition: test.py:223
bool inList
Definition: diagram.cpp:72
Protection prot
Definition: diagram.cpp:69
DiagramItemList * children
Definition: diagram.cpp:65
DiagramItem::~DiagramItem ( )

Definition at line 301 of file diagram.cpp.

302 {
303  delete children;
304 }
DiagramItemList * children
Definition: diagram.cpp:65

Member Function Documentation

void DiagramItem::addChild ( DiagramItem di)

Definition at line 352 of file diagram.cpp.

353 {
354  children->append(di);
355 }
void append(const type *d)
Definition: qlist.h:73
DiagramItemList * children
Definition: diagram.cpp:65
int DiagramItem::avgChildPos ( ) const

Definition at line 333 of file diagram.cpp.

334 {
335  DiagramItem *di;
336  int c=children->count();
337  if (c==0) // no children -> don't move
338  return xPos();
339  if ((di=children->getFirst())->isInList()) // children should be in a list
340  return di->xPos();
341  if (c&1) // odd number of children -> get pos of middle child
342  return children->at(c/2)->xPos();
343  else // even number of children -> get middle of most middle children
344  return (children->at(c/2-1)->xPos()+children->at(c/2)->xPos())/2;
345 }
int xPos() const
Definition: diagram.cpp:53
bool isInList() const
Definition: diagram.cpp:62
type * at(uint i) const
Definition: qlist.h:94
uint count() const
Definition: qlist.h:66
type * getFirst() const
Definition: qlist.h:95
DiagramItemList * children
Definition: diagram.cpp:65
QCString DiagramItem::fileName ( ) const

Definition at line 328 of file diagram.cpp.

329 {
330  return classDef->getOutputFileBase();
331 }
ClassDef * classDef
Definition: diagram.cpp:73
QCString getOutputFileBase() const
Definition: classdef.cpp:3533
DiagramItemList* DiagramItem::getChildren ( )
inline

Definition at line 51 of file diagram.cpp.

51 { return children; }
DiagramItemList * children
Definition: diagram.cpp:65
ClassDef* DiagramItem::getClassDef ( ) const
inline

Definition at line 63 of file diagram.cpp.

63 { return classDef; }
ClassDef * classDef
Definition: diagram.cpp:73
bool DiagramItem::isInList ( ) const
inline

Definition at line 62 of file diagram.cpp.

62 { return inList; }
bool inList
Definition: diagram.cpp:72
QCString DiagramItem::label ( ) const

Definition at line 306 of file diagram.cpp.

307 {
309  if (!templSpec.isEmpty())
310  {
311  // we use classDef->name() here and not diplayName() in order
312  // to get the name used in the inheritance relation.
313  QCString n = classDef->name();
314  if (/*n.right(2)=="-g" ||*/ n.right(2)=="-p")
315  {
316  n = n.left(n.length()-2);
317  }
319  }
320  else
321  {
322  result=classDef->displayName();
323  }
324  if (Config_getBool("HIDE_SCOPE_NAMES")) result=stripScope(result);
325  return result;
326 }
static QCString result
bool isEmpty() const
Definition: qcstring.h:189
uint length() const
Definition: qcstring.h:195
ClassDef * classDef
Definition: diagram.cpp:73
QCString left(uint len) const
Definition: qcstring.cpp:213
QCString displayName(bool includeScope=TRUE) const
Definition: classdef.cpp:312
const QCString & name() const
Definition: definition.h:114
QCString templSpec
Definition: diagram.cpp:71
QCString right(uint len) const
Definition: qcstring.cpp:231
std::void_t< T > n
#define Config_getBool(val)
Definition: config.cpp:664
QCString stripScope(const char *name)
Definition: util.cpp:5605
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
Definition: util.cpp:5527
void DiagramItem::move ( int  dx,
int  dy 
)
inline

Definition at line 52 of file diagram.cpp.

52 { x+=dx; y+=dy; }
int DiagramItem::number ( ) const
inline

Definition at line 58 of file diagram.cpp.

58 { return num; }
int DiagramItem::numChildren ( ) const

Definition at line 347 of file diagram.cpp.

348 {
349  return children->count();
350 }
uint count() const
Definition: qlist.h:66
DiagramItemList * children
Definition: diagram.cpp:65
DiagramItem* DiagramItem::parentItem ( )
inline

Definition at line 50 of file diagram.cpp.

50 { return parent; }
DiagramItem * parent
Definition: diagram.cpp:66
Protection DiagramItem::protection ( ) const
inline

Definition at line 59 of file diagram.cpp.

59 { return prot; }
Protection prot
Definition: diagram.cpp:69
void DiagramItem::putInList ( )
inline

Definition at line 61 of file diagram.cpp.

61 { inList=TRUE; }
bool inList
Definition: diagram.cpp:72
const bool TRUE
Definition: qglobal.h:371
Specifier DiagramItem::virtualness ( ) const
inline

Definition at line 60 of file diagram.cpp.

60 { return virt; }
Specifier virt
Definition: diagram.cpp:70
int DiagramItem::xPos ( ) const
inline

Definition at line 53 of file diagram.cpp.

53 { return x; }
int DiagramItem::yPos ( ) const
inline

Definition at line 54 of file diagram.cpp.

54 { return y; }

Member Data Documentation

DiagramItemList* DiagramItem::children
private

Definition at line 65 of file diagram.cpp.

ClassDef* DiagramItem::classDef
private

Definition at line 73 of file diagram.cpp.

bool DiagramItem::inList
private

Definition at line 72 of file diagram.cpp.

int DiagramItem::num
private

Definition at line 68 of file diagram.cpp.

DiagramItem* DiagramItem::parent
private

Definition at line 66 of file diagram.cpp.

Protection DiagramItem::prot
private

Definition at line 69 of file diagram.cpp.

QCString DiagramItem::templSpec
private

Definition at line 71 of file diagram.cpp.

Specifier DiagramItem::virt
private

Definition at line 70 of file diagram.cpp.

int DiagramItem::x
private

Definition at line 67 of file diagram.cpp.

int DiagramItem::y
private

Definition at line 67 of file diagram.cpp.


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