HAL
hal::GraphContext Class Reference

Logical container for modules, gates, and nets. More...

#include <graph_context.h>

Inheritance diagram for hal::GraphContext:
Inheritance graph
Collaboration diagram for hal::GraphContext:
Collaboration graph

Public Slots

void abortLayout ()
 

Signals

void dataChanged ()
 
void exclusiveModuleLost (u32 old_id)
 

Public Member Functions

 GraphContext (u32 id_, const QString &name, QObject *parent=nullptr)
 
 ~GraphContext ()
 
void beginChange ()
 
void endChange ()
 
void add (const QSet< u32 > &modules, const QSet< u32 > &gates, PlacementHint placement=PlacementHint())
 
void remove (const QSet< u32 > &modules, const QSet< u32 > &gates)
 
void clear ()
 
bool isGateUnfolded (u32 gateId) const
 
bool isModuleUnfolded (const u32 moduleId) const
 
void unfoldModule (const u32 id, const PlacementHint &plc)
 
bool empty () const
 
bool willBeEmptied () const
 
bool isShowingModule (const u32 id) const
 
bool isShowingModule (const u32 id, const QSet< u32 > &minus_modules, const QSet< u32 > &minus_gates, const QSet< u32 > &plus_modules, const QSet< u32 > &plus_gates) const
 
bool isShowingModuleExclusively ()
 
void getModuleChildrenRecursively (const u32 moduleId, QSet< u32 > *gates, QSet< u32 > *modules) const
 
void storeViewport ()
 
void layoutProgress (int percent) const
 
void testIfAffected (const u32 id, const u32 *moduleId, const u32 *gateId)
 
bool isShowingNetSource (const u32 mNetId) const
 
bool isShowingNetDestination (const u32 mNetId) const
 
bool isShowingFoldedTopModule () const
 
Node getNetSource (const Net *n) const
 
Node getNetDestination (const Net *n) const
 
const QSet< u32 > & modules () const
 
const QSet< u32 > & gates () const
 
const QSet< u32 > & nets () const
 
GraphicsScenescene ()
 
QString name () const
 
QString getNameWithDirtyState () const
 
u32 id () const
 
void setLayouter (GraphLayouter *layouter)
 
void setShader (GraphShader *shader)
 
GraphLayoutergetLayouter () const
 
void moveNodeAction (const QPoint &from, const QPoint &to)
 
bool sceneUpdateInProgress () const
 
void scheduleSceneUpdate ()
 
Node nodeForGate (const u32 id) const
 
QDateTime getTimestamp () const
 
void writeToFile (QJsonObject &json, int parentId)
 
bool readFromFile (const QJsonObject &json)
 
void setDirty (bool dty)
 
bool isDirty () const
 
void setSpecialUpdate (bool state)
 
bool getSpecialUpdate () const
 
void setParentWidget (GraphWidget *gw)
 
u32 getExclusiveModuleId () const
 
void setExclusiveModuleId (u32 id, bool emitSignal=true)
 
void exclusiveModuleCheck ()
 
void showComments (const Node &nd)
 
void updateNets ()
 
void setScheduleRemove (const QSet< u32 > &mods, const QSet< u32 > &gats)
 
bool isScheduledRemove (const Node &nd)
 
- 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
 

Friends

class GraphContextManager
 
class LayoutLockerManager
 

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

Logical container for modules, gates, and nets.

The GraphContext is a container that holds all elements (Modules, Gates, Nets) that should be drawn in the scene. It uses a GraphLayouter to layout its elements and creates a scene with the corresponding GraphicsItems. Afterwards this scene can be shown in the GraphWidget's GraphGraphicsView.
Moreover the context may be changed (e.g. add/remove Gates or Modules). In this case the scene will be adapted as well.
This class notifies the GraphWidget parent about certain events.

Definition at line 54 of file graph_context.h.

Constructor & Destructor Documentation

◆ GraphContext()

hal::GraphContext::GraphContext ( u32  id_,
const QString name,
QObject parent = nullptr 
)
explicit

Constructor.

Parameters
id_- The unique id of the context.
name- The name of the context
parent- The parent QObject

Definition at line 25 of file graph_context.cpp.

References QObject::connect(), QDateTime::currentDateTime(), exclusiveModuleLost(), hal::gNetlistRelay, hal::SettingsItemDropdown::intChanged(), hal::NetlistRelay::moduleNameChanged(), and hal::MainWindow::sSettingStyle.

◆ ~GraphContext()

hal::GraphContext::~GraphContext ( )

Destructor. Used to notify all subscribers about the deletion.

Definition at line 46 of file graph_context.cpp.

References hal::GraphWidget::handleContextAboutToBeDeleted(), hal::LayoutLockerManager::instance(), and hal::LayoutLockerManager::removeWaitingContext().

Member Function Documentation

◆ abortLayout

◆ add()

void hal::GraphContext::add ( const QSet< u32 > &  modules,
const QSet< u32 > &  gates,
PlacementHint  placement = PlacementHint() 
)

Add Gates and/or Modules to the context. The scene will be updated afterwards (if not in a beginChanges-endChanges-block). Moreover a placement hint may be passed that can be used by the GraphLayouter.

Parameters
modules- A set of ids of the Modules to be added
gates- A set of ids of the Gates to be added
placement- A placement hint (leave empty for no hint)

Definition at line 89 of file graph_context.cpp.

References gates(), QSet::isEmpty(), hal::PlacementHint::mode(), modules(), and setDirty().

Referenced by hal::ActionAddItemsToObject::exec(), hal::ActionMoveNode::exec(), and unfoldModule().

◆ beginChange()

void hal::GraphContext::beginChange ( )

Mark the beginning of a block of changes that are done successively. Used to prevent the scene from updating after every single step. The scene will be only updated after endChange is called.
These 'changes-blocks' may be nested. In this case only the outer block will be considered.

Definition at line 74 of file graph_context.cpp.

Referenced by hal::ActionAddItemsToObject::exec(), hal::ActionRemoveItemsFromObject::exec(), and unfoldModule().

◆ clear()

void hal::GraphContext::clear ( )

Clear the context. All Gates and Modules as well as their placement hints will be removed.

Definition at line 141 of file graph_context.cpp.

References QSet::clear().

Referenced by hal::ActionMoveNode::exec(), and hal::GraphContextManager::restoreFromFile().

◆ dataChanged

void hal::GraphContext::dataChanged ( )
signal

◆ empty()

bool hal::GraphContext::empty ( ) const

Check if the context is empty i.e. does not contain Modules or Gates.

Returns
true if the context is empty.

Definition at line 234 of file graph_context.cpp.

References QSet::empty().

Referenced by isShowingModule().

◆ endChange()

void hal::GraphContext::endChange ( )

Mark the ending of a block of changes that are done successively. Used to prevent the scene from updating after every single step.

Definition at line 79 of file graph_context.cpp.

Referenced by hal::ActionAddItemsToObject::exec(), hal::ActionRemoveItemsFromObject::exec(), hal::PythonEditor::handleThreadFinished(), and unfoldModule().

◆ exclusiveModuleCheck()

void hal::GraphContext::exclusiveModuleCheck ( )

Checks whether context still shows module with id mExclusiveModuleId exclusively. If not, mExclusiveModuleId is set to 0.

Definition at line 713 of file graph_context.cpp.

References isShowingModuleExclusively(), and setExclusiveModuleId().

◆ exclusiveModuleLost

void hal::GraphContext::exclusiveModuleLost ( u32  old_id)
signal

◆ gates()

◆ getExclusiveModuleId()

u32 hal::GraphContext::getExclusiveModuleId ( ) const
inline

Get the exclusive module id.

Returns
The exclusive module id.

Definition at line 423 of file graph_context.h.

Referenced by hal::GuiApiClasses::View::addTo(), hal::NetlistRelay::addToModuleDialog(), hal::ContextTreeModel::data(), and hal::ActionDeleteObject::exec().

◆ getLayouter()

◆ getModuleChildrenRecursively()

void hal::GraphContext::getModuleChildrenRecursively ( const u32  moduleId,
QSet< u32 > *  gates,
QSet< u32 > *  modules 
) const

Recursively get all gates and submodules of module visible in graph context

Parameters
moduleId- The id of the module
gates- Gates of module
modules- Submodules of module

Definition at line 334 of file graph_context.cpp.

References test_plugin::g, gates(), hal::Module::get_gates(), hal::Netlist::get_module_by_id(), hal::Module::get_submodules(), hal::gNetlist, QSet::insert(), isModuleUnfolded(), and modules().

Referenced by isShowingModule().

◆ getNameWithDirtyState()

QString hal::GraphContext::getNameWithDirtyState ( ) const

Get the name of the context with dirty state.

Returns
the context's name with an asterisk if the dirty is set to true.

Definition at line 461 of file graph_context.cpp.

Referenced by hal::ContextTreeItem::getData().

◆ getNetDestination()

Node hal::GraphContext::getNetDestination ( const Net n) const

Given a net, this function returns the first visible destination node.

Parameters
n- Pointer to net
Returns
true The first visibible destination node, might be Node::None

Definition at line 420 of file graph_context.cpp.

References hal::GraphLayouter::boxes(), hal::NodeBoxes::boxForGate(), test_plugin::g, hal::NodeBox::getNode(), and test::n.

◆ getNetSource()

Node hal::GraphContext::getNetSource ( const Net n) const

Given a net, this function returns the first visible source node.

Parameters
n- Pointer to net
Returns
true The first visibible source node, might be Node::None

Definition at line 409 of file graph_context.cpp.

References hal::GraphLayouter::boxes(), hal::NodeBoxes::boxForGate(), test_plugin::g, hal::NodeBox::getNode(), and test::n.

◆ getSpecialUpdate()

bool hal::GraphContext::getSpecialUpdate ( ) const
inline

Get the special update state.

Returns
The special update state.

Definition at line 404 of file graph_context.h.

◆ getTimestamp()

QDateTime hal::GraphContext::getTimestamp ( ) const

Returns the timestamp of this context. The timestamp is generated in the constructor.

Returns
the timestamp of the context.

Definition at line 731 of file graph_context.cpp.

Referenced by hal::ContextTreeItem::getData(), and hal::ContextTreeItem::getTimestamp().

◆ id()

◆ isDirty()

bool hal::GraphContext::isDirty ( ) const
inline

Get the dirty state.

Returns
The dirty state.

Definition at line 389 of file graph_context.h.

◆ isGateUnfolded()

bool hal::GraphContext::isGateUnfolded ( u32  gateId) const

Fold the parent module of a specific gate. The specified gate as well as all other Gates and Submodules of the parent module are removed from the context and replaced by the module itself.

Parameters
gateId- The id of the gate

Definition at line 159 of file graph_context.cpp.

References QSet::contains().

◆ isModuleUnfolded()

bool hal::GraphContext::isModuleUnfolded ( const u32  moduleId) const

Checks whether a module is unfolded or not.

Parameters
moduleId- The id of the module

Definition at line 165 of file graph_context.cpp.

References QSet::contains(), test_plugin::g, hal::Netlist::get_module_by_id(), hal::Module::get_submodules(), and hal::gNetlist.

Referenced by getModuleChildrenRecursively().

◆ isScheduledRemove()

bool hal::GraphContext::isScheduledRemove ( const Node nd)

Check whether node is scheduled for removal

Definition at line 888 of file graph_context.cpp.

References QSet::end(), QSet::erase(), QSet::find(), hal::Node::Gate, hal::Node::id(), hal::Node::Module, and hal::Node::type().

◆ isShowingFoldedTopModule()

bool hal::GraphContext::isShowingFoldedTopModule ( ) const

Checks whether there is only the folded top_module in the context which makes other time consumptive tests unnecessary

Returns
true If here is only the folded top_module in the context

Definition at line 325 of file graph_context.cpp.

References QSet::constBegin().

◆ isShowingModule() [1/2]

bool hal::GraphContext::isShowingModule ( const u32  id) const

Checks if the context represents the content of the given module i.e. after double-clicking the module item.

Parameters
id- The id of the module
Returns
true if the context shows the content of the module

Definition at line 292 of file graph_context.cpp.

Referenced by isShowingModuleExclusively().

◆ isShowingModule() [2/2]

bool hal::GraphContext::isShowingModule ( const u32  id,
const QSet< u32 > &  minus_modules,
const QSet< u32 > &  minus_gates,
const QSet< u32 > &  plus_modules,
const QSet< u32 > &  plus_gates 
) const

Checks if the context represents the content of the given module i.e. after double-clicking the module item.
In some cases it is necessary that the check is performed on a previous state e.g. if a gate was newly assigned to the netlist and the affected GraphContexts should be discovered now. Since the comparison is done on the current netlist but the context does not contain the gate yet, this function will falsely return false even on the right GraphContexts. Therefore the new gate must be manually removed from the comparison by passing it in the minus_gates list.
Accordingly, it is also possible to add Gates to the comparison (e.g. after removing them from the module) as well as adding and removing Modules (i.e. submodules).

Parameters
id- The id of the module
minus_modules- The ids of the Modules that are removed for comparison
minus_gates- The ids of the Gates that are removed for comparison
plus_modules- The ids of the Modules that are added for comparison
plus_gates- The ids of the Gates that are added for comparison
Returns
true if the context Shows the content of the module.

Definition at line 297 of file graph_context.cpp.

References empty(), gates(), getModuleChildrenRecursively(), and modules().

◆ isShowingModuleExclusively()

bool hal::GraphContext::isShowingModuleExclusively ( )

Checks wether the context shows an module exclusively or not.

Definition at line 355 of file graph_context.cpp.

References isShowingModule().

Referenced by hal::GuiApiClasses::View::addTo(), exclusiveModuleCheck(), hal::ActionDeleteObject::exec(), and hal::GuiApiClasses::View::setName().

◆ isShowingNetDestination()

bool hal::GraphContext::isShowingNetDestination ( const u32  mNetId) const

Given a net, this functions checks if any of the Net's destination gates appear in the context.

Parameters
mNetId- The id of the net
Returns
true if a destination gate of the net is shown

Definition at line 392 of file graph_context.cpp.

References QSet::contains(), hal::Netlist::get_net_by_id(), hal::gNetlist, and net.

◆ isShowingNetSource()

bool hal::GraphContext::isShowingNetSource ( const u32  mNetId) const

Given a net, this function checks if any of the Net's source Gates appear in the context.

Parameters
mNetId- The id of the net
Returns
true if a source gate of the net is shown

Definition at line 375 of file graph_context.cpp.

References QSet::contains(), hal::Netlist::get_net_by_id(), hal::gNetlist, and net.

◆ layoutProgress()

void hal::GraphContext::layoutProgress ( int  percent) const

Called by layouter to signal progress

Parameters
percent

Definition at line 511 of file graph_context.cpp.

References QString::arg(), and hal::GraphWidget::showProgress().

Referenced by hal::GraphLayouter::layout().

◆ modules()

◆ moveNodeAction()

void hal::GraphContext::moveNodeAction ( const QPoint from,
const QPoint to 
)

◆ name()

QString hal::GraphContext::name ( ) const

◆ nets()

const QSet< u32 > & hal::GraphContext::nets ( ) const

Get the ids of the Nets of the context.

Returns
a set of net ids.

Definition at line 441 of file graph_context.cpp.

Referenced by hal::GraphWidget::ensureSelectionVisible(), and hal::ModuleShader::update().

◆ nodeForGate()

Node hal::GraphContext::nodeForGate ( const u32  id) const

Get a Node that contains a specific Gate.
If the context contains the Gate, the node of this gate is returned.
If the context only contains a parent module of the gate (or the parent's parent and so on...), the node of this Module is returned.
Else an empty node is returned.

Parameters
id- The Gate's id
Returns
the Node that contains the gate

Definition at line 484 of file graph_context.cpp.

References QSet::contains(), test_plugin::g, hal::Node::Gate, hal::Netlist::get_gate_by_id(), hal::Module::get_id(), hal::Module::get_parent_module(), hal::gNetlist, and hal::Node::Module.

◆ readFromFile()

◆ remove()

void hal::GraphContext::remove ( const QSet< u32 > &  modules,
const QSet< u32 > &  gates 
)

Remove Gates and/or Modules from the context. The scene will be updated afterwards (if no in a beginChanges-endChanges-block).

Parameters
modules- A set of ids of the modules to be removed
gates- A set of ids of the gates to be removed

Definition at line 117 of file graph_context.cpp.

References gates(), QSet::isEmpty(), modules(), and setDirty().

Referenced by hal::ActionRemoveItemsFromObject::exec(), and unfoldModule().

◆ scene()

◆ sceneUpdateInProgress()

bool hal::GraphContext::sceneUpdateInProgress ( ) const

Returns whether the scene is in an updating process (i.e. layouter process) or not.

Returns
true while the scene updates.

Definition at line 467 of file graph_context.cpp.

Referenced by hal::GraphWidget::ensureSelectionVisible(), hal::GraphWidget::GraphWidget(), and hal::GraphWidget::keyPressEvent().

◆ scheduleSceneUpdate()

void hal::GraphContext::scheduleSceneUpdate ( )

Notifies the context that a scene update is necessary. The scene will be updated immediately or as soon as the exterior beginChanges-endChanges-block is left.

Definition at line 472 of file graph_context.cpp.

Referenced by hal::ActionMoveNode::exec(), moveNodeAction(), and testIfAffected().

◆ setDirty()

void hal::GraphContext::setDirty ( bool  dty)

◆ setExclusiveModuleId()

void hal::GraphContext::setExclusiveModuleId ( u32  id,
bool  emitSignal = true 
)

◆ setLayouter()

void hal::GraphContext::setLayouter ( GraphLayouter layouter)

Set the GraphLayouter this context should use.

Parameters
layouter- The GraphLayouter to use

Definition at line 54 of file graph_context.cpp.

Referenced by hal::GraphContextManager::createNewContext(), and hal::GraphContextManager::restoreFromFile().

◆ setParentWidget()

void hal::GraphContext::setParentWidget ( GraphWidget gw)
inline

Set pointer to parent graph widget

Parameters
[in]gwparent of class GraphWidget

Definition at line 413 of file graph_context.h.

Referenced by hal::GraphWidget::GraphWidget().

◆ setScheduleRemove()

void hal::GraphContext::setScheduleRemove ( const QSet< u32 > &  mods,
const QSet< u32 > &  gats 
)

Make sure these nodes gets removed from context

Definition at line 882 of file graph_context.cpp.

Referenced by hal::NetlistRelay::addToModuleDialog().

◆ setShader()

void hal::GraphContext::setShader ( GraphShader shader)

Set the GraphShader that will be used.

Parameters
shader- The GraphShader

Definition at line 64 of file graph_context.cpp.

Referenced by hal::GraphContextManager::createNewContext(), and hal::GraphContextManager::restoreFromFile().

◆ setSpecialUpdate()

void hal::GraphContext::setSpecialUpdate ( bool  state)

Set the special update state.

Definition at line 917 of file graph_context.cpp.

References hal::state.

Referenced by hal::NetlistRelay::addToModuleDialog().

◆ showComments()

void hal::GraphContext::showComments ( const Node nd)

Open overlay and show nodes

Parameters
ndThe node for which comments should be shown

Definition at line 922 of file graph_context.cpp.

References hal::GraphWidget::showComments().

Referenced by hal::CommentSpeechBubble::mouseDoubleClickEvent().

◆ storeViewport()

void hal::GraphContext::storeViewport ( )

Convenience function to allow calls to GraphWidget::storeViewport via context

Definition at line 518 of file graph_context.cpp.

References hal::GraphWidget::storeViewport().

◆ testIfAffected()

void hal::GraphContext::testIfAffected ( const u32  id,
const u32 moduleId,
const u32 gateId 
)

Checks whether a modification affects the context and schedules an scene update if necessary.

Parameters
id- The id of the modified module
moduleId- The id of the module which was added/removed
gateId- The id of the gate which was added/removed

Definition at line 246 of file graph_context.cpp.

References scheduleSceneUpdate().

◆ unfoldModule()

void hal::GraphContext::unfoldModule ( const u32  id,
const PlacementHint plc 
)

◆ updateNets()

void hal::GraphContext::updateNets ( )

Update set of nets so that all connections to gates or modules within view are shown

Definition at line 629 of file graph_context.cpp.

References QSet::clear(), QSet::contains(), test_plugin::g, hal::Netlist::get_gate_by_id(), hal::Module::get_input_nets(), hal::Netlist::get_module_by_id(), hal::Module::get_output_nets(), hal::gNetlist, QSet::insert(), and net.

◆ willBeEmptied()

bool hal::GraphContext::willBeEmptied ( ) const

Checks whether the context will be empty after pending changes are applied.

Returns
true if the context is empty.

Definition at line 239 of file graph_context.cpp.

References QSet::isEmpty().

◆ writeToFile()

void hal::GraphContext::writeToFile ( QJsonObject json,
int  parentId 
)

Writes the context (its modules, gates, nets) to a given json object.

Parameters
json- The object to write to
int- ParentId of the graphContext.

modules

gates

nets

Definition at line 827 of file graph_context.cpp.

References QJsonArray::append(), hal::Node::Gate, hal::gContentManager, hal::ContentManager::getGraphTabWidget(), getLayouter(), hal::NetLayoutPoint::isUndefined(), hal::Node::Module, hal::GraphLayouter::positonForNode(), setDirty(), QDateTime::toString(), hal::GraphTabWidget::visibleStatus(), QPoint::x(), and QPoint::y().

Friends And Related Function Documentation

◆ GraphContextManager

friend class GraphContextManager
friend

Definition at line 56 of file graph_context.h.

◆ LayoutLockerManager

friend class LayoutLockerManager
friend

Definition at line 57 of file graph_context.h.


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