AstGraphWidget Class Reference

Layout of an AST in a graphicsview (similar to zgrViewer ). More...

#include <AstGraphWidget.h>

Inheritance diagram for AstGraphWidget:

Inheritance graph
[legend]
List of all members.

Public Slots

void setNode (SgNode *sgNode)
void gotoNode (SgNode *sgNode)
void setFilter (AstFilterInterface *filter)
void setFileFilter (int id)

Signals

void nodeActivated (SgNode *node)
void nodeActivatedAlt (SgNode *node)
void clicked (const QString &filename, int line, int column)
void nodeDropped (SgNode *node, QPoint pos)

Public Member Functions

 AstGraphWidget (QWidget *parent=0)
virtual ~AstGraphWidget ()
void setSgDragEnabled (bool b)
void setSgDropEnabled (bool b)
bool isSgDragEnabled () const
bool isSgDropEnabled () const

Protected Member Functions

virtual void updateGraph (SgNode *node, AstFilterInterface *filter)
virtual void wheelEvent (QWheelEvent *event)
virtual void scaleView (qreal scaleFactor)
virtual void mousePressEvent (QMouseEvent *event)
virtual void dragEnterEvent (QDragEnterEvent *ev)
virtual void dropEvent (QDropEvent *ev)
virtual void dragMoveEvent (QDragMoveEvent *ev)
virtual void mouseMoveEvent (QMouseEvent *event)
virtual bool acceptMimeData (const QMimeData *mimeData)
virtual void handleMimeData (const QMimeData *mimeData, const QPoint &pos)

Protected Attributes

QGraphicsScene * scene
DisplayTreeNoderoot
QPoint dragStartPosition
 position of mouseclick, used for d&d functions
bool dragEnabled
 if SgNodes can be dragged out of this view
bool dropEnabled
 if SgNodes can be dropped at this view

Properties

bool SgDragEnabled []
bool SgDropEnabled []

Detailed Description

Layout of an AST in a graphicsview (similar to zgrViewer ).

AstGraphView.jpg

This widget shows the AST layouted as a tree. For actual layouting the class TreeLayoutGenerator is used, but this can be replaced easily (for example to use different algorithms, or layout a general graph instead of a tree)

The actual code for displaying the nodes and edges is implemented in DisplayTreeNode and DisplayEdge

Definition at line 28 of file AstGraphWidget.h.


Constructor & Destructor Documentation

AstGraphWidget::AstGraphWidget ( QWidget *  parent = 0  ) 

Definition at line 26 of file AstGraphWidget.cpp.

AstGraphWidget::~AstGraphWidget (  )  [virtual]

Definition at line 35 of file AstGraphWidget.cpp.


Member Function Documentation

bool RoseGraphicsView::acceptMimeData ( const QMimeData *  mimeData  )  [protected, virtual, inherited]

Definition at line 158 of file RoseGraphicsView.cpp.

Referenced by RoseGraphicsView::dragEnterEvent().

Here is the caller graph for this function:

void RoseGraphicsView::clicked ( const QString &  filename,
int  line,
int  column 
) [signal, inherited]

Referenced by RoseGraphicsView::mousePressEvent().

void RoseGraphicsView::dragEnterEvent ( QDragEnterEvent *  ev  )  [protected, virtual, inherited]

Definition at line 133 of file RoseGraphicsView.cpp.

Here is the call graph for this function:

void RoseGraphicsView::dragMoveEvent ( QDragMoveEvent *  ev  )  [protected, virtual, inherited]

Definition at line 143 of file RoseGraphicsView.cpp.

void RoseGraphicsView::dropEvent ( QDropEvent *  ev  )  [protected, virtual, inherited]

Definition at line 149 of file RoseGraphicsView.cpp.

Here is the call graph for this function:

void RoseGraphicsView::gotoNode ( SgNode *  sgNode  )  [inline, slot, inherited]

Definition at line 40 of file RoseGraphicsView.h.

void RoseGraphicsView::handleMimeData ( const QMimeData *  mimeData,
const QPoint &  pos 
) [protected, virtual, inherited]

Definition at line 163 of file RoseGraphicsView.cpp.

Referenced by RoseGraphicsView::dropEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

bool RoseGraphicsView::isSgDragEnabled (  )  const [inline, inherited]

Definition at line 32 of file RoseGraphicsView.h.

bool RoseGraphicsView::isSgDropEnabled (  )  const [inline, inherited]

Definition at line 33 of file RoseGraphicsView.h.

void RoseGraphicsView::mouseMoveEvent ( QMouseEvent *  event  )  [protected, virtual, inherited]

Definition at line 104 of file RoseGraphicsView.cpp.

Here is the call graph for this function:

void RoseGraphicsView::mousePressEvent ( QMouseEvent *  event  )  [protected, virtual, inherited]

Definition at line 73 of file RoseGraphicsView.cpp.

Here is the call graph for this function:

void RoseGraphicsView::nodeActivated ( SgNode *  node  )  [signal, inherited]

Referenced by RoseGraphicsView::mousePressEvent().

void RoseGraphicsView::nodeActivatedAlt ( SgNode *  node  )  [signal, inherited]

void RoseGraphicsView::nodeDropped ( SgNode *  node,
QPoint  pos 
) [signal, inherited]

Referenced by RoseGraphicsView::handleMimeData(), and RoseGraphicsView::RoseGraphicsView().

void RoseGraphicsView::scaleView ( qreal  scaleFactor  )  [protected, virtual, inherited]

Definition at line 172 of file RoseGraphicsView.cpp.

Referenced by RoseGraphicsView::wheelEvent().

Here is the caller graph for this function:

void RoseGraphicsView::setFileFilter ( int  id  )  [slot, inherited]

Definition at line 64 of file RoseGraphicsView.cpp.

void RoseGraphicsView::setFilter ( AstFilterInterface filter  )  [slot, inherited]

Definition at line 53 of file RoseGraphicsView.cpp.

Referenced by RoseGraphicsView::setFileFilter().

void RoseGraphicsView::setNode ( SgNode *  sgNode  )  [slot, inherited]

Definition at line 47 of file RoseGraphicsView.cpp.

Referenced by RoseGraphicsView::gotoNode(), and RoseGraphicsView::RoseGraphicsView().

void RoseGraphicsView::setSgDragEnabled ( bool  b  )  [inline, inherited]

Definition at line 29 of file RoseGraphicsView.h.

void RoseGraphicsView::setSgDropEnabled ( bool  b  )  [inline, inherited]

Definition at line 30 of file RoseGraphicsView.h.

void AstGraphWidget::updateGraph ( SgNode *  node,
AstFilterInterface filter 
) [protected, virtual]

Reimplement in derived classes, and use curFilter and curNode to generate graph/tree

Implements RoseGraphicsView.

Definition at line 41 of file AstGraphWidget.cpp.

Here is the call graph for this function:

void RoseGraphicsView::wheelEvent ( QWheelEvent *  event  )  [protected, virtual, inherited]

Definition at line 181 of file RoseGraphicsView.cpp.

Here is the call graph for this function:


Member Data Documentation

bool RoseGraphicsView::dragEnabled [protected, inherited]

if SgNodes can be dragged out of this view

Definition at line 79 of file RoseGraphicsView.h.

Referenced by RoseGraphicsView::isSgDragEnabled(), RoseGraphicsView::mouseMoveEvent(), and RoseGraphicsView::setSgDragEnabled().

QPoint RoseGraphicsView::dragStartPosition [protected, inherited]

position of mouseclick, used for d&d functions

Definition at line 78 of file RoseGraphicsView.h.

Referenced by RoseGraphicsView::mouseMoveEvent(), and RoseGraphicsView::mousePressEvent().

bool RoseGraphicsView::dropEnabled [protected, inherited]

if SgNodes can be dropped at this view

Definition at line 80 of file RoseGraphicsView.h.

Referenced by RoseGraphicsView::acceptMimeData(), RoseGraphicsView::dropEvent(), RoseGraphicsView::isSgDropEnabled(), and RoseGraphicsView::setSgDropEnabled().

DisplayTreeNode* AstGraphWidget::root [protected]

Definition at line 41 of file AstGraphWidget.h.

Referenced by updateGraph().

QGraphicsScene* AstGraphWidget::scene [protected]

Definition at line 40 of file AstGraphWidget.h.

Referenced by AstGraphWidget(), updateGraph(), and ~AstGraphWidget().


Property Documentation

bool RoseGraphicsView::SgDragEnabled [read, write, inherited]

Definition at line 21 of file RoseGraphicsView.h.

bool RoseGraphicsView::SgDropEnabled [read, write, inherited]

Definition at line 21 of file RoseGraphicsView.h.


The documentation for this class was generated from the following files:
Generated on Tue Sep 15 14:48:48 2009 for RoseQtWidgets by  doxygen 1.4.7