Class representing the tree layout for the built-in class diagram.
更多...
|
| TreeDiagram (const ClassDef *root, bool doBases) |
|
void | computeLayout () |
|
uint | computeRows () |
|
void | moveChildren (DiagramItem *root, int dx) |
|
void | computeExtremes (uint *labelWidth, uint *xpos) |
|
void | drawBoxes (TextStream &t, Image *image, bool doBase, bool bitmap, uint baseRows, uint superRows, uint cellWidth, uint cellHeight, QCString relPath="", bool generateMap=TRUE) |
|
void | drawConnectors (TextStream &t, Image *image, bool doBase, bool bitmap, uint baseRows, uint superRows, uint cellWidth, uint cellheight) |
|
DiagramRow * | row (int index) |
|
uint | numRows () const |
|
DiagramRow * | addRow (uint l) |
|
iterator | begin () |
|
iterator | end () |
|
Class representing the tree layout for the built-in class diagram.
在文件 diagram.cpp 第 100 行定义.
◆ iterator
◆ Ptr
◆ Vec
◆ TreeDiagram() [1/2]
TreeDiagram::TreeDiagram |
( |
const ClassDef * |
root, |
|
|
bool |
doBases |
|
) |
| |
◆ TreeDiagram() [2/2]
◆ addRow()
◆ begin()
◆ computeExtremes()
void TreeDiagram::computeExtremes |
( |
uint * |
labelWidth, |
|
|
uint * |
xpos |
|
) |
| |
◆ computeLayout()
void TreeDiagram::computeLayout |
( |
| ) |
|
在文件 diagram.cpp 第 434 行定义.
440 const auto &
row = *it;
445 for (
const auto &di : *
row)
448 if (pi==opi && !first) { delta-=
gridWidth; }
464 const auto &
row = *it;
472 while (rit!=
row->
end() && (*rit)->parentItem()==pi)
引用了 DiagramRow::begin(), DiagramRow::end(), gridWidth, layoutTree(), m_rows, maxTreeWidth, DiagramItem::move(), DiagramItem::numChildren(), DiagramItem::parentItem(), row() , 以及 TRUE.
◆ computeRows()
uint TreeDiagram::computeRows |
( |
| ) |
|
在文件 diagram.cpp 第 485 行定义.
490 while (it!=
m_rows.end() && !(*it)->item(0)->isInList())
499 const auto &
row = *it;
503 for (
const auto &di : *
row)
505 if (di->parentItem()!=opi) curListLen=1;
else curListLen++;
506 if (curListLen>maxListLen) maxListLen=curListLen;
引用了 m_rows, DiagramItem::parentItem() , 以及 row().
◆ drawBoxes()
在文件 diagram.cpp 第 568 行定义.
576 if (it!=
m_rows.end() && !doBase) ++it;
577 bool firstRow = doBase;
579 for (;it!=
m_rows.end() && !done;++it)
581 const auto &dr = *it;
583 float xf=0.0f,yf=0.0f;
601 if (doBase) yf += 1.0f;
613 superRows*cellHeight-
643 if (!firstRow && generateMap)
657 for (
const auto &di : *dr)
665 superRows*cellHeight-
675 writeBitmapBox(di.get(),image,x,y,cellWidth,cellHeight,firstRow,hasDocs);
676 if (!firstRow && generateMap)
引用了 DualDirIterator< C, I >::atEnd(), FALSE, DiagramItem::getClassDef(), gridHeight, gridWidth, Image::height(), DiagramItem::isInList(), ClassDef::isLinkable(), labelHorSpacing, labelVertSpacing, m_rows, DiagramItem::numChildren(), DiagramItem::parentItem(), TRUE, writeBitmapBox(), writeMapArea(), writeVectorBox(), DiagramItem::xPos() , 以及 DiagramItem::yPos().
◆ drawConnectors()
void TreeDiagram::drawConnectors |
( |
TextStream & |
t, |
|
|
Image * |
image, |
|
|
bool |
doBase, |
|
|
bool |
bitmap, |
|
|
uint |
baseRows, |
|
|
uint |
superRows, |
|
|
uint |
cellWidth, |
|
|
uint |
cellheight |
|
) |
| |
在文件 diagram.cpp 第 698 行定义.
705 for (;it!=
m_rows.end() && !done;++it)
707 const auto &dr = *it;
712 float xf=0.0f,yf=0.0f,ysf=0.0f;
713 auto rit = dr->begin();
714 while (rit!=dr->end())
771 y = ys - cellHeight/2;
777 y = ys + cellHeight/2;
818 t <<
"1 " << xf <<
" " << yf <<
" hedge\n";
823 t <<
"0 " << xf <<
" " << yf <<
" hedge\n";
828 if (rit!=dr->end()) di = (*rit).get();
else di=0;
857 t <<
"1 " << xf <<
" " << yf <<
" hedge\n";
861 t <<
"0 " << xf <<
" " << yf <<
" hedge\n";
866 t << xf <<
" " << ysf <<
" " << yf <<
" vedge\n";
870 t << xf <<
" " << (ysf + 0.25f) <<
" " << yf <<
" vedge\n";
874 if (rit!=dr->end()) ++rit;
880 for (
const auto &di : *dr)
969 if (first!=last && !first->
isInList())
引用了 Image::drawHorzArrow(), Image::drawHorzLine(), Image::drawVertArrow(), Image::drawVertLine(), FALSE, DiagramItem::getChildren(), getMinProtectionLevel(), gridHeight, gridWidth, Image::height(), DiagramItem::isInList(), labelHorSpacing, labelVertSpacing, m_rows, DiagramItem::parentItem(), DiagramItem::protection(), protToColor(), protToMask(), protToString(), TRUE, DiagramItem::xPos() , 以及 DiagramItem::yPos().
◆ end()
◆ layoutTree()
在文件 diagram.cpp 第 394 行定义.
410 for (k=children.front()->number();k<row->numItems();k++)
419 for (k=root->
number();k<row->numItems();k++)
425 auto it = children.begin();
426 for (;it!=children.end() && !moved && !(*it)->isInList();++it)
引用了 DiagramItem::avgChildPos(), FALSE, DiagramItem::getChildren(), DiagramRow::item(), m_rows, DiagramItem::move(), DiagramItem::number(), DiagramItem::numChildren(), row(), TRUE , 以及 DiagramItem::xPos().
被这些函数引用 computeLayout().
◆ moveChildren()
void TreeDiagram::moveChildren |
( |
DiagramItem * |
root, |
|
|
int |
dx |
|
) |
| |
◆ numRows()
uint TreeDiagram::numRows |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ row()
◆ m_rows
在文件 diagram.cpp 第 131 行定义.
被这些函数引用 addRow(), begin(), computeExtremes(), computeLayout(), computeRows(), drawBoxes(), drawConnectors(), end(), layoutTree(), numRows(), row() , 以及 TreeDiagram().
该类的文档由以下文件生成:
DiagramItem * item(int index)
Protection
Protection level of members
void move(int dx, int dy)
static Protection getMinProtectionLevel(const DiagramItemList &dil)
DiagramItemList getChildren()
Class representing a row in the built-in class diagram
DiagramItem * parentItem()
static void writeMapArea(TextStream &t, const ClassDef *cd, QCString relPath, uint x, uint y, uint w, uint h)
friend uint stringLength(const QCString &s)
void drawVertLine(uint x, uint ys, uint ye, uchar colIndex, uint mask)
void moveChildren(DiagramItem *root, int dx)
Protection protection() const
static uint protToMask(Protection p)
void drawHorzLine(uint y, uint xs, uint xe, uchar colIndex, uint mask)
const uint labelHorSpacing
helper class representing an iterator that can iterate forwards or backwards
static uchar protToColor(Protection p)
void drawVertArrow(uint x, uint ys, uint ye, uchar colIndex, uint mask)
static void writeBitmapBox(DiagramItem *di, Image *image, uint x, uint y, uint w, uint h, bool firstRow, bool hasDocs, bool children=FALSE)
static QCString protToString(Protection p)
const uint labelVertSpacing
bool layoutTree(DiagramItem *root, uint row)
const ClassDef * getClassDef() const
std::vector< DiagramItem * > DiagramItemList
void insertClass(DiagramItem *parent, const ClassDef *cd, bool doBases, Protection prot, Specifier virt, const QCString &ts)
void drawHorzArrow(uint y, uint xs, uint xe, uchar colIndex, uint mask)
virtual bool isLinkable() const =0
return TRUE iff a link to this class is possible (either within this project, or as a cross-reference...
static void writeVectorBox(TextStream &t, DiagramItem *di, float x, float y, bool children=FALSE)
DiagramRow * row(int index)
Class representing a single node in the built-in class diagram
This is an alternative implementation of QCString.