HAL
hal::GraphLayouter Class Referenceabstract

Base class for all specific layouters. More...

#include <graph_layouter.h>

Inheritance diagram for hal::GraphLayouter:
Inheritance graph
Collaboration diagram for hal::GraphLayouter:
Collaboration graph

Public Member Functions

 GraphLayouter (GraphContext *context, QObject *parent=nullptr)
 
 ~GraphLayouter ()
 
virtual QString name () const =0
 
virtual QString mDescription () const =0
 
virtual void add (const QSet< u32 > modules, const QSet< u32 > gates, const QSet< u32 > nets, PlacementHint placement=PlacementHint())=0
 
virtual void remove (const QSet< u32 > modules, const QSet< u32 > gates, const QSet< u32 > nets)=0
 
void layout ()
 
void alternateLayout ()
 
GraphicsScenescene () const
 
const QMap< Node, QPointnodeToPositionMap () const
 
const QMap< QPoint, NodepositionToNodeMap () const
 
GridPlacementgridPlacementFactory () const
 
NetLayoutPoint positonForNode (const Node &nd) const
 
Node nodeAtPosition (const QPoint &p) const
 
QPoint gridPointByItem (GraphicsNode *item) const
 
void dumpNodePositions (const QPoint &search) const
 
void setNodePosition (const Node &n, const QPoint &p)
 
void swapNodePositions (const Node &n1, const Node &n2)
 
void removeNodeFromMaps (const Node &n)
 
int minXIndex () const
 
int minYIndex () const
 
bool done () const
 
bool dumpJunctionEnabled ()
 
void setDumpJunctionEnabled (bool enabled)
 
QVector< qreal > xValues () const
 
QVector< qreal > yValues () const
 
qreal maxNodeWidth () const
 
qreal maxNodeHeight () const
 
qreal defaultGridWidth () const
 
qreal defaultGridHeight () const
 
qreal gridXposition (int ix) const
 
qreal gridYposition (int iy) const
 
const NodeBoxesboxes () const
 
void prepareRollback ()
 
bool canRollback () const
 
bool rollback ()
 
- Public Member Functions inherited from QObject
virtual const QMetaObjectmetaObject () const const
 
 QObject (QObject *parent)
 
virtual ~QObject ()
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
bool signalsBlocked () const const
 
bool blockSignals (bool block)
 
QThreadthread () const const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
const QObjectListchildren () const const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
void dumpObjectTree () const const
 
void dumpObjectInfo () const const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const const
 
QList< QByteArraydynamicPropertyNames () const const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
bool inherits (const char *className) const const
 
void deleteLater ()
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
 Q_CLASSINFO (Name, Value)
 
 Q_INTERFACES (...)
 
 Q_PROPERTY (...)
 
 Q_ENUMS (...)
 
 Q_FLAGS (...)
 
 Q_ENUM (...)
 
 Q_FLAG (...)
 
 Q_ENUM_NS (...)
 
 Q_FLAG_NS (...)
 
 Q_OBJECT Q_OBJECT
 
 Q_GADGET Q_GADGET
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SLOTS Q_SLOTS
 
 Q_SLOT Q_SLOT
 
 Q_EMIT Q_EMIT
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 

Protected Attributes

GraphicsScenemScene
 
GraphContextmParentContext
 
QMap< Node, QPointmNodeToPositionMap
 
QMap< QPoint, NodemPositionToNodeMap
 
QMap< Node, QPointmNodeToPositionRollback
 

Friends

class DrawNetThread
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
QObjectsender () const const
 
int senderSignalIndex () const const
 
int receivers (const char *signal) const const
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Base class for all specific layouters.

The abstract parent class for all graph layouters. The graph layouter is responsible for building up the scene using the information given in the passed GraphContext. It places the respective GraphicItems for the given gates and modules in positions that are calculated intelligently considering their order, connections and dimensions. Afterwards, the paths of GraphicsNet objects will be computed to visualize the nets between gates/modules.
If the GraphContext changes later on (e.g. gates/modules are added/removed), the GraphLayouter has the task to apply the changes in the scene.

Definition at line 77 of file graph_layouter.h.

Constructor & Destructor Documentation

◆ GraphLayouter()

◆ ~GraphLayouter()

hal::GraphLayouter::~GraphLayouter ( )

Destructor.

Definition at line 56 of file graph_layouter.cpp.

References QObject::deleteLater(), and mScene.

Member Function Documentation

◆ add()

virtual void hal::GraphLayouter::add ( const QSet< u32 modules,
const QSet< u32 gates,
const QSet< u32 nets,
PlacementHint  placement = PlacementHint() 
)
pure virtual

◆ alternateLayout()

void hal::GraphLayouter::alternateLayout ( )

◆ boxes()

◆ canRollback()

bool hal::GraphLayouter::canRollback ( ) const

Definition at line 282 of file graph_layouter.cpp.

References mNodeToPositionRollback.

Referenced by rollback(), and hal::GraphWidget::showProgress().

◆ defaultGridHeight()

qreal hal::GraphLayouter::defaultGridHeight ( ) const

Definition at line 200 of file graph_layouter.cpp.

Referenced by gridYposition(), and layout().

◆ defaultGridWidth()

qreal hal::GraphLayouter::defaultGridWidth ( ) const

Definition at line 195 of file graph_layouter.cpp.

Referenced by gridXposition(), and layout().

◆ done()

bool hal::GraphLayouter::done ( ) const

◆ dumpJunctionEnabled()

bool hal::GraphLayouter::dumpJunctionEnabled ( )

Definition at line 1341 of file graph_layouter.cpp.

◆ dumpNodePositions()

void hal::GraphLayouter::dumpNodePositions ( const QPoint search) const

◆ gridPlacementFactory()

GridPlacement * hal::GraphLayouter::gridPlacementFactory ( ) const

Creates a new GridPlacement instance (node to position hash) and returns the pointer The caller has the ownership and responsibility to delete that instance

Definition at line 71 of file graph_layouter.cpp.

References QHash::insert(), and mNodeToPositionMap.

Referenced by hal::ActionAddItemsToObject::exec(), hal::DragController::finalGridPlacement(), and hal::GuiApiClasses::View::getGridPlacement().

◆ gridPointByItem()

QPoint hal::GraphLayouter::gridPointByItem ( GraphicsNode item) const

◆ gridXposition()

qreal hal::GraphLayouter::gridXposition ( int  ix) const

◆ gridYposition()

qreal hal::GraphLayouter::gridYposition ( int  iy) const

◆ layout()

◆ maxNodeHeight()

qreal hal::GraphLayouter::maxNodeHeight ( ) const

Definition at line 190 of file graph_layouter.cpp.

◆ maxNodeWidth()

qreal hal::GraphLayouter::maxNodeWidth ( ) const

Definition at line 185 of file graph_layouter.cpp.

◆ mDescription()

virtual QString hal::GraphLayouter::mDescription ( ) const
pure virtual

Gets an inforaml description of the layouter.

Returns
the description of the layouter.

Implemented in hal::StandardGraphLayouter, and hal::PhysicalGraphLayouter.

◆ minXIndex()

int hal::GraphLayouter::minXIndex ( ) const

Definition at line 160 of file graph_layouter.cpp.

◆ minYIndex()

int hal::GraphLayouter::minYIndex ( ) const

Definition at line 165 of file graph_layouter.cpp.

◆ name()

virtual QString hal::GraphLayouter::name ( ) const
pure virtual

Gets the name of the layouter.

Returns
the name of the layouter.

Implemented in hal::StandardGraphLayouter, and hal::PhysicalGraphLayouter.

◆ nodeAtPosition()

Node hal::GraphLayouter::nodeAtPosition ( const QPoint p) const

Definition at line 79 of file graph_layouter.cpp.

References mPositionToNodeMap.

Referenced by hal::DragController::finalGridPlacement().

◆ nodeToPositionMap()

const QMap< Node, QPoint > hal::GraphLayouter::nodeToPositionMap ( ) const

◆ positionToNodeMap()

const QMap< QPoint, Node > hal::GraphLayouter::positionToNodeMap ( ) const

Definition at line 105 of file graph_layouter.cpp.

References mPositionToNodeMap.

Referenced by hal::GraphContext::moveNodeAction().

◆ positonForNode()

◆ prepareRollback()

void hal::GraphLayouter::prepareRollback ( )

Definition at line 276 of file graph_layouter.cpp.

References mNodeToPositionMap, and mNodeToPositionRollback.

Referenced by hal::GraphContext::unfoldModule().

◆ remove()

virtual void hal::GraphLayouter::remove ( const QSet< u32 modules,
const QSet< u32 gates,
const QSet< u32 nets 
)
pure virtual

◆ removeNodeFromMaps()

void hal::GraphLayouter::removeNodeFromMaps ( const Node n)

◆ rollback()

bool hal::GraphLayouter::rollback ( )

◆ scene()

GraphicsScene * hal::GraphLayouter::scene ( ) const

Gets the GraphicsScene the layouter works on.

Returns
the GraphicScene.

Definition at line 61 of file graph_layouter.cpp.

References mScene.

Referenced by hal::DragController::clear(), and hal::GraphContext::scene().

◆ setDumpJunctionEnabled()

void hal::GraphLayouter::setDumpJunctionEnabled ( bool  enabled)

Definition at line 1346 of file graph_layouter.cpp.

Referenced by hal::GraphContextManager::getDefaultLayouter().

◆ setNodePosition()

void hal::GraphLayouter::setNodePosition ( const Node n,
const QPoint p 
)

◆ swapNodePositions()

void hal::GraphLayouter::swapNodePositions ( const Node n1,
const Node n2 
)

Definition at line 124 of file graph_layouter.cpp.

References mNodeToPositionMap, and mPositionToNodeMap.

◆ xValues()

QVector< qreal > hal::GraphLayouter::xValues ( ) const

Definition at line 175 of file graph_layouter.cpp.

Referenced by layout().

◆ yValues()

QVector< qreal > hal::GraphLayouter::yValues ( ) const

Definition at line 180 of file graph_layouter.cpp.

Referenced by layout().

Friends And Related Function Documentation

◆ DrawNetThread

friend class DrawNetThread
friend

Definition at line 81 of file graph_layouter.h.

Member Data Documentation

◆ mNodeToPositionMap

QMap<Node, QPoint> hal::GraphLayouter::mNodeToPositionMap
protected

◆ mNodeToPositionRollback

QMap<Node, QPoint> hal::GraphLayouter::mNodeToPositionRollback
protected

Definition at line 326 of file graph_layouter.h.

Referenced by canRollback(), prepareRollback(), and rollback().

◆ mParentContext

GraphContext* hal::GraphLayouter::mParentContext
protected

Definition at line 323 of file graph_layouter.h.

Referenced by layout().

◆ mPositionToNodeMap

QMap<QPoint, Node> hal::GraphLayouter::mPositionToNodeMap
protected

◆ mScene

GraphicsScene* hal::GraphLayouter::mScene
protected

Definition at line 322 of file graph_layouter.h.

Referenced by GraphLayouter(), layout(), scene(), and ~GraphLayouter().


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