node Class Reference

Repräsentiert einen Knoten im Verzeichnisbaum. More...

#include <node.h>

List of all members.

Public Member Functions

 node (QString path, QObject *parent=0)
void addToTotalSize (qint64 size)
void traverse ()
bool isDir ()
QRectF calculateRect ()
void addParentOffset (float offset)
void addParentOffset (QRectF rect)
nodeparent ()
bool isVertical ()
qint64 getTotalSize ()
QString getPath ()
QVector< node * > getChildren ()
int getDepth ()
float getScaleFactor ()
void setTreeItem (QTreeWidgetItem *item)

Static Public Member Functions

static void setTreeWidget (QTreeWidget *tw)

Public Attributes

QVector< node * > children
 Liste von untergeordneten Knoten.

Protected Member Functions

qint64 traverse (QDirIterator &it)
void addChild (node *childNode)
float getRelativeSize ()
void mousePressEvent (QGraphicsSceneMouseEvent *event)
void setSize (qint64 size)
qint64 getSize ()
float getOffset ()

Protected Attributes

QString path
 Pfad des aktuellen Knotens (relativ zum Elternknoten).
int depth
 Tiefe aktuellen Knotens.
qint64 fileSize
 Größe des aktuellen Knotens.
float totalSize
 Größe des aktuellen Unterbaumes.
float offset
bool bDir
QTreeWidgetItem * treeItem

Static Protected Attributes

static float scaleFactor = 1.0
static QTreeWidget * treeWidget = NULL


Detailed Description

Repräsentiert einen Knoten im Verzeichnisbaum.

Die Klasse node repräsentiert ein Verzeichnis bzw. eine Datei im Verzeichnisbaum.

Ein node-Objekt speichert jeweils Pfad (path), Typ (bDir) Größe (fileSize), sowie einen Zeiger auf den Elternknoten (parent()). Verzeichnisse speichern zudem eine Liste der untergeordneten Dateien und Verzeichnisse (children), sowie deren Gesamtgröße (totalSize).

Definition at line 13 of file node.h.


Constructor & Destructor Documentation

node::node ( QString  path,
QObject *  parent = 0 
)

Definition at line 6 of file node.cpp.

Referenced by traverse().


Member Function Documentation

void node::addToTotalSize ( qint64  size  ) 

Definition at line 24 of file node.cpp.

References totalSize.

Referenced by traverse().

void node::traverse (  ) 

Definition at line 28 of file node.cpp.

References path.

Referenced by MainWindow::chooseFolder(), and traverse().

bool node::isDir (  )  [inline]

Definition at line 22 of file node.h.

References bDir.

Referenced by BeamTreeScene::draw(), MainWindow::fillTree(), and BeamTreeScene::render().

QRectF node::calculateRect (  ) 

Definition at line 79 of file node.cpp.

References getOffset(), getRelativeSize(), isVertical(), and parent().

Referenced by BeamTreeScene::render().

void node::addParentOffset ( float  offset  ) 

Definition at line 112 of file node.cpp.

References offset, and parent().

Referenced by addParentOffset(), and BeamTreeScene::render().

void node::addParentOffset ( QRectF  rect  ) 

Definition at line 118 of file node.cpp.

References addParentOffset(), isVertical(), and offset.

node * node::parent (  ) 

Definition at line 126 of file node.cpp.

Referenced by addParentOffset(), calculateRect(), getRelativeSize(), and mousePressEvent().

bool node::isVertical (  ) 

Definition at line 75 of file node.cpp.

References depth.

Referenced by addParentOffset(), calculateRect(), BeamTreeScene::draw(), mousePressEvent(), and BeamTreeScene::render().

qint64 node::getTotalSize (  )  [inline]

Definition at line 34 of file node.h.

References totalSize.

Referenced by MainWindow::fillTree().

QString node::getPath (  )  [inline]

Definition at line 35 of file node.h.

Referenced by MainWindow::fillTree(), and BeamTreeScene::hilight().

QVector<node*> node::getChildren (  )  [inline]

Definition at line 36 of file node.h.

References children.

Referenced by MainWindow::fillTree(), and BeamTreeScene::render().

int node::getDepth (  )  [inline]

Definition at line 37 of file node.h.

References depth.

Referenced by BeamTreeScene::render().

float node::getScaleFactor (  )  [inline]

Definition at line 38 of file node.h.

References scaleFactor.

void node::setTreeItem ( QTreeWidgetItem *  item  )  [inline]

Definition at line 39 of file node.h.

References treeItem.

Referenced by MainWindow::fillTree().

static void node::setTreeWidget ( QTreeWidget *  tw  )  [inline, static]

Definition at line 41 of file node.h.

References treeWidget.

Referenced by MainWindow::createDock().

qint64 node::traverse ( QDirIterator &  it  )  [protected]

Definition at line 34 of file node.cpp.

References addChild(), addToTotalSize(), bDir, depth, getSize(), node(), setSize(), totalSize, and traverse().

void node::addChild ( node childNode  )  [protected]

Definition at line 16 of file node.cpp.

References bDir, and children.

Referenced by traverse().

float node::getRelativeSize (  )  [protected]

Definition at line 66 of file node.cpp.

References parent(), and totalSize.

Referenced by calculateRect().

void node::mousePressEvent ( QGraphicsSceneMouseEvent *  event  )  [protected]

Definition at line 130 of file node.cpp.

References isVertical(), parent(), path, treeItem, and treeWidget.

void node::setSize ( qint64  size  )  [inline, protected]

Definition at line 70 of file node.h.

References fileSize.

Referenced by traverse().

qint64 node::getSize (  )  [inline, protected]

Definition at line 71 of file node.h.

References fileSize.

Referenced by traverse().

float node::getOffset (  )  [inline, protected]

Definition at line 72 of file node.h.

References offset.

Referenced by calculateRect().


Member Data Documentation

QVector<node*> node::children

Liste von untergeordneten Knoten.

See also:
getChildren()

Definition at line 30 of file node.h.

Referenced by addChild(), and getChildren().

float node::scaleFactor = 1.0 [static, protected]

Definition at line 44 of file node.h.

Referenced by getScaleFactor().

QTreeWidget * node::treeWidget = NULL [static, protected]

Definition at line 45 of file node.h.

Referenced by mousePressEvent(), and setTreeWidget().

QString node::path [protected]

Pfad des aktuellen Knotens (relativ zum Elternknoten).

Definition at line 48 of file node.h.

Referenced by mousePressEvent(), and traverse().

int node::depth [protected]

Tiefe aktuellen Knotens.

Definition at line 50 of file node.h.

Referenced by getDepth(), isVertical(), and traverse().

qint64 node::fileSize [protected]

Größe des aktuellen Knotens.

See also:
getSize(), totalSize

Definition at line 55 of file node.h.

Referenced by getSize(), and setSize().

float node::totalSize [protected]

Größe des aktuellen Unterbaumes.

See also:
getTotalSize(), fileSize

Definition at line 60 of file node.h.

Referenced by addToTotalSize(), getRelativeSize(), getTotalSize(), and traverse().

float node::offset [protected]

Definition at line 61 of file node.h.

Referenced by addParentOffset(), and getOffset().

bool node::bDir [protected]

Definition at line 62 of file node.h.

Referenced by addChild(), isDir(), and traverse().

QTreeWidgetItem* node::treeItem [protected]

Definition at line 63 of file node.h.

Referenced by mousePressEvent(), and setTreeItem().


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

Generated on Wed Jun 4 14:40:10 2008 for infovis by  doxygen 1.5.5