![]() |
HAL
|
Logical container for modules, gates, and nets. More...
#include <graph_context.h>
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 |
GraphicsScene * | scene () |
QString | name () const |
QString | getNameWithDirtyState () const |
u32 | id () const |
void | setLayouter (GraphLayouter *layouter) |
void | setShader (GraphShader *shader) |
GraphLayouter * | getLayouter () 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) |
![]() | |
virtual const QMetaObject * | metaObject () 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) |
QThread * | thread () 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) |
T | 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 ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
const QObjectList & | children () 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< QByteArray > | dynamicPropertyNames () const const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
bool | inherits (const char *className) const const |
void | deleteLater () |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
T | qobject_cast (QObject *object) |
T | qobject_cast (const QObject *object) |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
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 | |
![]() | |
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) |
![]() | |
typedef | QObjectList |
![]() | |
QObject * | sender () 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) |
![]() | |
objectName | |
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.
|
explicit |
Constructor.
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.
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().
|
slot |
Definition at line 688 of file graph_context.cpp.
References QSet::clear(), hal::Node::Gate, QSet::insert(), hal::GraphLayouter::layout(), hal::Node::Module, hal::GraphLayouter::nodeToPositionMap(), and hal::GraphLayouter::rollback().
Referenced by hal::ProgressBar::ProgressBar().
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.
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().
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().
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().
|
signal |
Referenced by hal::ContextTreeModel::addContext(), and setDirty().
bool hal::GraphContext::empty | ( | ) | const |
Check if the context is empty i.e. does not contain Modules or Gates.
Definition at line 234 of file graph_context.cpp.
References QSet::empty().
Referenced by isShowingModule().
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().
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().
|
signal |
Referenced by GraphContext(), and setExclusiveModuleId().
Get the ids of the Gates of the context.
Definition at line 436 of file graph_context.cpp.
Referenced by add(), hal::NetlistRelay::addToModuleDialog(), hal::GraphWidget::ensureSelectionVisible(), hal::ActionDeleteObject::exec(), hal::GuiApiClasses::View::foldModule(), hal::GuiApiClasses::View::getGates(), getModuleChildrenRecursively(), hal::GraphGraphicsView::handleRemoveFromView(), isShowingModule(), remove(), unfoldModule(), and hal::ModuleShader::update().
|
inline |
Get 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().
|
inline |
Get the used GraphLayouter. Returns a nullptr if no layouter was configured yet.
Definition at line 319 of file graph_context.h.
Referenced by hal::NetlistRelay::addToModuleDialog(), hal::DragController::clear(), hal::GraphGraphicsView::dropEvent(), hal::ActionAddItemsToObject::exec(), hal::ActionDeleteObject::exec(), hal::ActionFoldModule::exec(), hal::ActionMoveNode::exec(), hal::ActionRemoveItemsFromObject::exec(), hal::ActionUnfoldModule::exec(), hal::DragController::finalGridPlacement(), hal::GuiApiClasses::View::getGridPlacement(), hal::GraphGraphicsView::handleShortestPath(), hal::DragController::isDropAllowed(), hal::DragController::move(), hal::GraphWidget::showProgress(), hal::GraphWidget::storeViewport(), and writeToFile().
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
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().
QString hal::GraphContext::getNameWithDirtyState | ( | ) | const |
Get the name of the context with dirty state.
Definition at line 461 of file graph_context.cpp.
Referenced by hal::ContextTreeItem::getData().
Given a net, this function returns the first visible destination node.
n | - Pointer to net |
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.
Given a net, this function returns the first visible source node.
n | - Pointer to net |
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.
|
inline |
Get the special update state.
Definition at line 404 of file graph_context.h.
QDateTime hal::GraphContext::getTimestamp | ( | ) | const |
Returns the timestamp of this context. The timestamp is generated in the constructor.
Definition at line 731 of file graph_context.cpp.
Referenced by hal::ContextTreeItem::getData(), and hal::ContextTreeItem::getTimestamp().
u32 hal::GraphContext::id | ( | ) | const |
Get the id of the context.
Definition at line 451 of file graph_context.cpp.
Referenced by hal::NetlistRelay::addToModuleDialog(), hal::LayoutLockerManager::canUpdate(), hal::NetlistRelay::deleteModule(), hal::GraphGraphicsView::dropEvent(), hal::ContextProxyModel::dropMimeData(), hal::ActionAddItemsToObject::exec(), hal::ActionCreateObject::exec(), hal::ActionDeleteObject::exec(), hal::ActionFoldModule::exec(), hal::ContextTreeItem::getData(), hal::ContextTreeItem::getId(), hal::GraphGraphicsView::handleRemoveFromView(), hal::ContextProxyModel::mimeData(), hal::ContextTreeModel::removeDirectory(), hal::LayoutLockerManager::removeWaitingContext(), hal::GraphContextManager::restoreFromFile(), hal::GraphContextManager::setContextId(), and setExclusiveModuleId().
|
inline |
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.
gateId | - The id of the gate |
Definition at line 159 of file graph_context.cpp.
References QSet::contains().
bool hal::GraphContext::isModuleUnfolded | ( | const u32 | moduleId | ) | const |
Checks whether a module is unfolded or not.
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().
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().
bool hal::GraphContext::isShowingFoldedTopModule | ( | ) | const |
Checks whether there is only the folded top_module in the context which makes other time consumptive tests unnecessary
Definition at line 325 of file graph_context.cpp.
References QSet::constBegin().
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.
id | - The id of the module |
Definition at line 292 of file graph_context.cpp.
Referenced by isShowingModuleExclusively().
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).
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 |
Definition at line 297 of file graph_context.cpp.
References empty(), gates(), getModuleChildrenRecursively(), and modules().
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().
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.
mNetId | - The id of the net |
Definition at line 392 of file graph_context.cpp.
References QSet::contains(), hal::Netlist::get_net_by_id(), hal::gNetlist, and net.
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.
mNetId | - The id of the net |
Definition at line 375 of file graph_context.cpp.
References QSet::contains(), hal::Netlist::get_net_by_id(), hal::gNetlist, and net.
void hal::GraphContext::layoutProgress | ( | int | percent | ) | const |
Called by layouter to signal progress
percent |
Definition at line 511 of file graph_context.cpp.
References QString::arg(), and hal::GraphWidget::showProgress().
Referenced by hal::GraphLayouter::layout().
Get the ids of the Modules of the context.
Definition at line 431 of file graph_context.cpp.
Referenced by add(), hal::NetlistRelay::addToModuleDialog(), hal::GraphWidget::ensureSelectionVisible(), hal::ActionDeleteObject::exec(), hal::GuiApiClasses::View::foldModule(), getModuleChildrenRecursively(), hal::GuiApiClasses::View::getModules(), hal::GraphGraphicsView::handleRemoveFromView(), isShowingModule(), remove(), unfoldModule(), hal::GuiApiClasses::View::unfoldModule(), and hal::ModuleShader::update().
Move node to antother grid location
Definition at line 523 of file graph_context.cpp.
References QMap::constEnd(), QMap::find(), from, hal::GraphLayouter::positionToNodeMap(), scheduleSceneUpdate(), hal::GraphLayouter::setNodePosition(), and hal::core_strings::to().
QString hal::GraphContext::name | ( | ) | const |
Get the name of the context.
Definition at line 456 of file graph_context.cpp.
Referenced by hal::ActionDeleteObject::exec(), hal::ActionRenameObject::exec(), hal::ContextTreeItem::getName(), hal::GuiApiClasses::View::getName(), and hal::GraphTabWidget::handleContextRenamed().
Get the ids of the Nets of the context.
Definition at line 441 of file graph_context.cpp.
Referenced by hal::GraphWidget::ensureSelectionVisible(), and hal::ModuleShader::update().
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.
id | - The Gate's id |
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.
bool hal::GraphContext::readFromFile | ( | const QJsonObject & | json | ) |
Reads a context from a given json object.
json | - The object to read from. |
Definition at line 736 of file graph_context.cpp.
References QList::append(), QJsonArray::at(), QSet::begin(), QSet::clear(), QJsonObject::contains(), QDateTime::fromString(), hal::Node::Gate, hal::Netlist::get_gate_by_id(), hal::Netlist::get_module_by_id(), hal::Netlist::get_net_by_id(), hal::gNetlist, QSet::insert(), QList::isEmpty(), QSet::isEmpty(), log_warning, hal::Node::Module, setDirty(), setExclusiveModuleId(), hal::GraphLayouter::setNodePosition(), QJsonArray::size(), QSet::size(), and QJsonValue::toObject().
Referenced by hal::GraphContextManager::restoreFromFile().
Remove Gates and/or Modules from the context. The scene will be updated afterwards (if no in a beginChanges-endChanges-block).
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().
GraphicsScene * hal::GraphContext::scene | ( | ) |
Get the scene the context works on.
Definition at line 446 of file graph_context.cpp.
References hal::GraphLayouter::scene().
Referenced by hal::GraphContextManager::createNewContext(), hal::GraphGraphicsView::drawForeground(), hal::GraphWidget::ensureSelectionVisible(), hal::GraphWidget::focusGate(), hal::GraphWidget::focusModule(), hal::GraphWidget::focusNet(), hal::GraphWidget::GraphWidget(), hal::GraphWidget::handleSceneAvailable(), and hal::GraphContextManager::restoreFromFile().
bool hal::GraphContext::sceneUpdateInProgress | ( | ) | const |
Returns whether the scene is in an updating process (i.e. layouter process) or not.
Definition at line 467 of file graph_context.cpp.
Referenced by hal::GraphWidget::ensureSelectionVisible(), hal::GraphWidget::GraphWidget(), and hal::GraphWidget::keyPressEvent().
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().
void hal::GraphContext::setDirty | ( | bool | dty | ) |
Sets the dirty state.
dty | - The value to set. |
Definition at line 875 of file graph_context.cpp.
References dataChanged(), and QObject::Q_EMIT().
Referenced by add(), hal::GraphGraphicsView::dropEvent(), hal::GuiApiClasses::View::isolateInNew(), hal::GraphContextManager::openModuleInView(), readFromFile(), remove(), hal::GraphContextManager::restoreFromFile(), and writeToFile().
void hal::GraphContext::setExclusiveModuleId | ( | u32 | id, |
bool | emitSignal = true |
||
) |
Sets the exclusive module id.
Definition at line 928 of file graph_context.cpp.
References exclusiveModuleLost(), id(), and QObject::Q_EMIT().
Referenced by exclusiveModuleCheck(), hal::ActionCreateObject::exec(), hal::GuiApiClasses::View::isolateInNew(), hal::GraphContextManager::openModuleInView(), readFromFile(), and hal::GraphContextManager::restoreFromFile().
void hal::GraphContext::setLayouter | ( | GraphLayouter * | layouter | ) |
Set the GraphLayouter this context should use.
layouter | - The GraphLayouter to use |
Definition at line 54 of file graph_context.cpp.
Referenced by hal::GraphContextManager::createNewContext(), and hal::GraphContextManager::restoreFromFile().
|
inline |
Set pointer to parent graph widget
[in] | gw | parent of class GraphWidget |
Definition at line 413 of file graph_context.h.
Referenced by hal::GraphWidget::GraphWidget().
Make sure these nodes gets removed from context
Definition at line 882 of file graph_context.cpp.
Referenced by hal::NetlistRelay::addToModuleDialog().
void hal::GraphContext::setShader | ( | GraphShader * | shader | ) |
Set the GraphShader that will be used.
shader | - The GraphShader |
Definition at line 64 of file graph_context.cpp.
Referenced by hal::GraphContextManager::createNewContext(), and hal::GraphContextManager::restoreFromFile().
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().
void hal::GraphContext::showComments | ( | const Node & | nd | ) |
Open overlay and show nodes
nd | The 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().
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().
Checks whether a modification affects the context and schedules an scene update if necessary.
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().
void hal::GraphContext::unfoldModule | ( | const u32 | id, |
const PlacementHint & | plc | ||
) |
Unfold a specific module. The specified module is removed from the context and replaced by its Gates and submodules.
id | - The id of the module to unfold |
Definition at line 184 of file graph_context.cpp.
References add(), hal::PlacementHint::addGridPosition(), beginChange(), QSet::empty(), endChange(), test_plugin::g, hal::Node::Gate, gates(), hal::Netlist::get_module_by_id(), hal::Module::get_submodules(), hal::gNetlist, hal::PlacementHint::GridPosition, QSet::insert(), hal::NetLayoutPoint::isUndefined(), hal::PlacementHint::mode(), hal::Node::Module, modules(), hal::GraphLayouter::positonForNode(), hal::GraphLayouter::prepareRollback(), remove(), and QSet::size().
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.
bool hal::GraphContext::willBeEmptied | ( | ) | const |
Checks whether the context will be empty after pending changes are applied.
Definition at line 239 of file graph_context.cpp.
References QSet::isEmpty().
void hal::GraphContext::writeToFile | ( | QJsonObject & | json, |
int | parentId | ||
) |
Writes the context (its modules, gates, nets) to a given json object.
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().
|
friend |
Definition at line 56 of file graph_context.h.
|
friend |
Definition at line 57 of file graph_context.h.