![]() |
HAL
|
Stores and manages the gui's selection state. More...
#include <selection_relay.h>
Public Types | |
enum class | ItemType { None = 0 , Gate = 1 , Net = 2 , Module = 3 } |
enum class | Subfocus { None = 0 , Left = 1 , Right = 2 } |
Signals | |
void | selectionChanged (void *sender) |
void | subfocusChanged (void *sender) |
Public Member Functions | |
SelectionRelay (QObject *parent=nullptr) | |
void | clear () |
void | clearAndUpdate () |
void | registerSender (void *sender, QString name) |
void | removeSender (void *sender) |
void | relaySelectionChanged (void *sender) |
void | relaySubfocusChanged (void *sender) |
void | navigateUp () |
void | navigateDown () |
void | handleModuleRemoved (const u32 id) |
void | handleGateRemoved (const u32 id) |
void | handleNetRemoved (const u32 id) |
bool | isModuleSelected (u32 id) const |
bool | isGateSelected (u32 id) const |
bool | isNetSelected (u32 id) const |
QList< u32 > | selectedGatesList () const |
QList< u32 > | selectedNetsList () const |
QList< u32 > | selectedModulesList () const |
QList< Node > | selectedNodesList () const |
std::vector< u32 > | selectedGatesVector () const |
std::vector< u32 > | selectedNetsVector () const |
std::vector< u32 > | selectedModulesVector () const |
const QSet< u32 > & | selectedGates () const |
const QSet< u32 > & | selectedNets () const |
const QSet< u32 > & | selectedModules () const |
int | numberSelectedGates () const |
int | numberSelectedNets () const |
int | numberSelectedModules () const |
int | numberSelectedNodes () const |
int | numberSelectedItems () const |
bool | containsGate (u32 id) const |
bool | containsNet (u32 id) const |
bool | containsModule (u32 id) const |
void | addGate (u32 id) |
void | addNet (u32 id) |
void | addModule (u32 id) |
void | setSelectedGates (const QSet< u32 > &ids) |
void | setSelectedNets (const QSet< u32 > &ids) |
void | setSelectedModules (const QSet< u32 > &ids) |
void | actionSetSelected (const QSet< u32 > &mods, const QSet< u32 > &gats, const QSet< u32 > &nets) |
void | removeGate (u32 id) |
void | removeNet (u32 id) |
void | removeModule (u32 id) |
ItemType | focusType () const |
u32 | focusId () const |
Subfocus | subfocus () const |
u32 | subfocusIndex () const |
void | setFocus (ItemType ftype, u32 fid, Subfocus sfoc=Subfocus::None, u32 sfinx=0) |
void | setFocusDirect (ItemType ftype, u32 fid, Subfocus sfoc=Subfocus::None, u32 sfinx=0) |
QList< UserActionObject > | toUserActionObject () const |
![]() | |
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 | |
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 | |
Stores and manages the gui's selection state.
The SelectionRelay is used to manage the selection and the focus of Modules, Gates and Nets.
There can be any number of selected modules and/or gates and/or nets, but only one focused item at a time.
This class contains signals to notify objects about changes of the focus and the selection. However these signals must be emitted manually by calling the functions relaySelectionChanged and relaySubfocusChanged.
Remark: Changes within the selection that are done calling methods like addGate, removeNet, or setSelectedModules are only applied after calling the relaySelectionChanged function.
Definition at line 59 of file selection_relay.h.
|
strong |
enum used to describe the type of a selected/focused item. ItemType::None can be used to specify that the Item is empty e.g. no item is focused.
Enumerator | |
---|---|
None | |
Gate | |
Net | |
Module |
Definition at line 68 of file selection_relay.h.
|
strong |
enum used to describe the sub-focus. The sub-focus is the focus within the focused module/gate item.
Enumerator | |
---|---|
None | |
Left | |
Right |
Definition at line 82 of file selection_relay.h.
|
explicit |
Constructor.
parent | - The parent QObject |
Definition at line 15 of file selection_relay.cpp.
References clear().
void hal::SelectionRelay::actionSetSelected | ( | const QSet< u32 > & | mods, |
const QSet< u32 > & | gats, | ||
const QSet< u32 > & | nets | ||
) |
This function is invoked by the ActionSetSelectionFocus (and must not be used by others basically). It is responsible to apply the selection changes that were done by the setters of this SelectionRelay (e.g. addGate, setSelectedModules, ...); the UserAction that executes this function was built up using these setters.
If the action is an UNDO action it may want to recreate the previous selection. Therefore the calling party must pass the new selection as parameters - they are not stored within the selection relay itself, but in the ActionSetSelectionFocus. The new selection overwrites the old one.
Calling this function emits the signal SelectionRelay::selectionChanged afterwards.
mods | - The set of ids of modules to overwrite the selection with |
gats | - The set of ids of gates to overwrite the selection with |
nets | - The set of ids of nets to overwrite the selection with |
Definition at line 113 of file selection_relay.cpp.
References QObject::Q_EMIT(), and selectionChanged().
Referenced by hal::ActionSetSelectionFocus::exec().
void hal::SelectionRelay::addGate | ( | u32 | id | ) |
Adds the gate with the specified id to the current selection.
id | - The id of the gate to add |
Definition at line 65 of file selection_relay.cpp.
References QSet::insert().
Referenced by hal::ModuleContextMenu::addGateSubmenu(), hal::ModuleWidget::handleTreeSelectionChanged(), and hal::GuiApi::selectGate().
void hal::SelectionRelay::addModule | ( | u32 | id | ) |
Adds the module with the specified id to the current selection.
id | - The id of the module to add |
Definition at line 77 of file selection_relay.cpp.
References QSet::insert().
Referenced by hal::ModuleContextMenu::addModuleSubmenu(), hal::NetlistRelay::addToModuleDialog(), hal::AddToModuleReceiver::handleModulesPicked(), hal::ModuleWidget::handleTreeSelectionChanged(), and hal::GuiApi::selectModule().
void hal::SelectionRelay::addNet | ( | u32 | id | ) |
Adds the net with the specified id to the current selection.
id | - The id of the net to add |
Definition at line 71 of file selection_relay.cpp.
References QSet::insert().
Referenced by hal::ModuleContextMenu::addNetSubmenu(), hal::GatePinTree::handleContextMenuRequested(), hal::ModulePinsTree::handleContextMenuRequested(), hal::ModuleWidget::handleTreeSelectionChanged(), and hal::GuiApi::selectNet().
void hal::SelectionRelay::clear | ( | ) |
Clears all member variables. Does not emit the selectionChanged signal.
Definition at line 22 of file selection_relay.cpp.
References QSet::clear(), hal::UserAction::mObject, and None.
Referenced by hal::NetlistRelay::addToModuleDialog(), clearAndUpdate(), hal::GatePinTree::handleContextMenuRequested(), hal::ModulePinsTree::handleContextMenuRequested(), hal::GraphicsScene::handleInternSelectionChanged(), hal::AddToModuleReceiver::handleModulesPicked(), hal::ModuleWidget::handleTreeSelectionChanged(), hal::GuiApi::select(), hal::GuiApi::selectGate(), SelectionRelay(), hal::GuiApi::selectModule(), and hal::GuiApi::selectNet().
void hal::SelectionRelay::clearAndUpdate | ( | ) |
Clears all member variables. Emits selectionChanged.
Definition at line 155 of file selection_relay.cpp.
References clear().
Referenced by hal::GuiApi::deselectAllItems(), and hal::GraphWidget::keyPressEvent().
|
inline |
Return true iff the gate with the specified id is contained in the current selection.
id | - The id of the gate to look for |
Definition at line 379 of file selection_relay.h.
References QSet::contains().
|
inline |
Return true iff the module with the specified id is contained in the current selection.
id | - The id of the module to look for |
Definition at line 401 of file selection_relay.h.
References QSet::contains().
|
inline |
Return true iff the net with the specified id is contained in the current selection.
id | - The id of the net to look for |
Definition at line 390 of file selection_relay.h.
References QSet::contains().
|
inline |
Gets the id of the item in the current focus.
Definition at line 528 of file selection_relay.h.
Referenced by hal::ActionSetSelectionFocus::exec(), hal::ActionSetSelectionFocus::hasModifications(), hal::StandardGraphicsGate::paint(), hal::StandardGraphicsModule::paint(), and hal::GraphNavigationWidget::setup().
|
inline |
Gets the type of the item that is in the current focus. ItemType::None if no item is in focus.
Definition at line 518 of file selection_relay.h.
Referenced by hal::ActionSetSelectionFocus::exec(), hal::ActionSetSelectionFocus::hasModifications(), hal::StandardGraphicsGate::paint(), hal::StandardGraphicsModule::paint(), and hal::GraphNavigationWidget::setup().
void hal::SelectionRelay::handleGateRemoved | ( | const u32 | id | ) |
Called whenever a gate was removed from the netlist. Used to remove the id of the removed gate from the selection (if available).
id | - The id of the removed gate |
Definition at line 413 of file selection_relay.cpp.
References QSet::end(), QSet::find(), and QSet::remove().
void hal::SelectionRelay::handleModuleRemoved | ( | const u32 | id | ) |
Called whenever a module was removed from the netlist. Used to remove the id of the removed module from the selection (if available).
id | - The id of the removed module |
Definition at line 402 of file selection_relay.cpp.
References QSet::end(), QSet::find(), and QSet::remove().
void hal::SelectionRelay::handleNetRemoved | ( | const u32 | id | ) |
Called whenever a gate was removed from the netlist. Used to remove the id of the removed gate from the selection (if available).
id | - The id of the removed net |
Definition at line 424 of file selection_relay.cpp.
References QSet::end(), QSet::find(), and QSet::remove().
bool hal::SelectionRelay::isGateSelected | ( | u32 | id | ) | const |
Decides whether a gate is selected or not.
Note that this function will always return false for gates that appear in the mGatesSuppressedByFilter member (set by suppressedByFilter).
id | - The id of the gate |
Definition at line 392 of file selection_relay.cpp.
References QSet::contains().
Referenced by hal::GraphicsScene::handleExternSelectionChanged().
bool hal::SelectionRelay::isModuleSelected | ( | u32 | id | ) | const |
Decides whether a module is selected or not.
Note that this function will always return false for modules that appear in the mModulesSuppressedByFilter member (set by suppressedByFilter).
id | - The id of the module |
Definition at line 387 of file selection_relay.cpp.
References QSet::contains().
Referenced by hal::GraphicsScene::handleExternSelectionChanged().
bool hal::SelectionRelay::isNetSelected | ( | u32 | id | ) | const |
Decides whether a net is selected or not.
Note that this function will always return false for nets that appear in the mNetsSuppressedByFilter member (set by suppressedByFilter).
id | - The id of the net |
Definition at line 397 of file selection_relay.cpp.
References QSet::contains().
Referenced by hal::GraphicsScene::handleExternSelectionChanged().
void hal::SelectionRelay::navigateDown | ( | ) |
Navigates down in the currently focused object. It only adjusts the sub-focus index mSubfocusIndex of the current sub-focus. Afterwards if the index has changed, it emits the signal subfocusChanged.
Definition at line 285 of file selection_relay.cpp.
References test_plugin::g, Gate, hal::Netlist::get_gate_by_id(), hal::Module::get_input_nets(), hal::Netlist::get_module_by_id(), hal::Netlist::get_net_by_id(), hal::Module::get_output_nets(), hal::gNetlist, Left, Module, test::n, Net, None, relaySubfocusChanged(), and Right.
void hal::SelectionRelay::navigateUp | ( | ) |
Navigates up in the currently focused object. It only adjusts the sub-focus index mSubfocusIndex of the current sub-focus. Afterwards if the index has changed, it emits the signal subfocusChanged.
Definition at line 192 of file selection_relay.cpp.
References test_plugin::g, Gate, hal::Netlist::get_gate_by_id(), hal::Module::get_input_nets(), hal::Netlist::get_module_by_id(), hal::Netlist::get_net_by_id(), hal::Module::get_output_nets(), hal::gNetlist, Left, Module, test::n, Net, None, relaySubfocusChanged(), and Right.
|
inline |
Gets the amount of currently selected gates.
Definition at line 328 of file selection_relay.h.
References QSet::size().
Referenced by hal::GraphicsScene::handleExternSelectionChanged(), and hal::SelectionDetailsWidget::handleSelectionUpdate().
|
inline |
Gets the amount of all currently selected items. Items are gates nets or modules.
Definition at line 368 of file selection_relay.h.
References QSet::size().
Referenced by hal::GateSelectPicker::handleSelectionChanged(), hal::ModuleSelectPicker::handleSelectionChanged(), and hal::SelectionDetailsWidget::handleSelectionUpdate().
|
inline |
Gets the amount of currently selected modules.
Definition at line 348 of file selection_relay.h.
References QSet::size().
Referenced by hal::GraphicsScene::handleExternSelectionChanged(), and hal::SelectionDetailsWidget::handleSelectionUpdate().
|
inline |
Gets the amount of currently selected nets.
Definition at line 338 of file selection_relay.h.
References QSet::size().
Referenced by hal::GraphicsScene::handleExternSelectionChanged(), and hal::SelectionDetailsWidget::handleSelectionUpdate().
|
inline |
Gets the amount of currently selected nodes. Nodes are both gates and modules.
Definition at line 358 of file selection_relay.h.
References QSet::size().
Referenced by hal::ModuleContextMenu::addGateSubmenu(), hal::ModuleContextMenu::addModuleSubmenu(), hal::ModuleContextMenu::addMultipleElementsSubmenu(), and hal::SelectionDetailsWidget::handleSelectionUpdate().
void hal::SelectionRelay::registerSender | ( | void * | sender, |
QString | name | ||
) |
Registers a sender object. Used in the hal user study to keep track of the selection changes.
sender | - The object to register |
name | - The name of the object |
Definition at line 161 of file selection_relay.cpp.
References QVector::append(), name, and QObject::sender().
Referenced by hal::GraphicsScene::GraphicsScene(), hal::GuiApi::GuiApi(), hal::ModuleWidget::ModuleWidget(), and hal::SelectionDetailsWidget::SelectionDetailsWidget().
void hal::SelectionRelay::relaySelectionChanged | ( | void * | sender | ) |
Applies and relays all selection changes done by functions of this SelectionRelay (e.g. addGate, setSelectedNets, ...), by executing the built up ActionSetSelectionFocus UserAction.
Emits the selectionChanged signal. If compiled with the HAL_STUDY flag it also invokes the evaluateSelectionChanged function.
If the receiver wants to prevent event handling of certain senders (e.g. itself to prevent infinite loops), it can check the sender pointer. Therefore the sender should always pass a this-pointer.
sender | - The object that invokes this function. |
Definition at line 175 of file selection_relay.cpp.
References QObject::sender().
Referenced by hal::ModuleContextMenu::addGateSubmenu(), hal::ModuleContextMenu::addModuleSubmenu(), hal::ModuleContextMenu::addNetSubmenu(), hal::NetlistRelay::addToModuleDialog(), hal::GuiApi::deselectGate(), hal::GuiApi::deselectModule(), hal::GuiApi::deselectNet(), hal::GatePinTree::handleContextMenuRequested(), hal::ModulePinsTree::handleContextMenuRequested(), hal::GraphicsScene::handleInternSelectionChanged(), hal::AddToModuleReceiver::handleModulesPicked(), hal::ModuleWidget::handleTreeSelectionChanged(), hal::GuiApi::selectGate(), hal::GuiApi::selectModule(), and hal::GuiApi::selectNet().
void hal::SelectionRelay::relaySubfocusChanged | ( | void * | sender | ) |
Emits the sub-focusChanged signal. If the receiver wants to prevent event handling of certain senders (e.g. itself to prevent infinite loops), it can check the sender pointer. Therefore the sender should always pass a this-pointer.
sender | - The object that invokes this function. |
Definition at line 185 of file selection_relay.cpp.
References QObject::Q_EMIT(), QObject::sender(), and subfocusChanged().
Referenced by navigateDown(), and navigateUp().
void hal::SelectionRelay::removeGate | ( | u32 | id | ) |
Removes the gate of the specified id from the current selection.
id | - The id of the gate to remove |
Definition at line 121 of file selection_relay.cpp.
References QSet::remove().
Referenced by hal::GuiApi::deselectGate().
void hal::SelectionRelay::removeModule | ( | u32 | id | ) |
Removes the module of the specified id from the current selection.
id | - The id of the module to remove |
Definition at line 133 of file selection_relay.cpp.
References QSet::remove().
Referenced by hal::GuiApi::deselectModule().
void hal::SelectionRelay::removeNet | ( | u32 | id | ) |
Removes the net of the specified id from the current selection.
id | - The id of the net to remove |
Definition at line 127 of file selection_relay.cpp.
References QSet::remove().
Referenced by hal::GuiApi::deselectNet().
void hal::SelectionRelay::removeSender | ( | void * | sender | ) |
Unregisters a sender object. Used in the hal user study to keep track of the selection changes.
sender | - The object to unregister |
Definition at line 166 of file selection_relay.cpp.
References QObject::sender().
Gets a set of ids of all selected gates.
Definition at line 298 of file selection_relay.h.
Referenced by hal::ModuleContextMenu::addGateSubmenu(), hal::GuiApi::deselectGate(), hal::GraphWidget::ensureSelectionVisible(), hal::ActionSetSelectionFocus::exec(), hal::GraphGraphicsView::handleRemoveFromView(), hal::ActionSetSelectionFocus::hasModifications(), hal::GuiApi::selectGate(), and hal::DragController::set().
Overwrites the list of suppressed modules, gates and nets. Suppressed items can't be selected i.e. isModuleSelected/isGateSelected/isNetSelected will always return false. Note that this only applies to these three functions. It does not restrict their appearance in the public members mSelectedGates/mSelectedNets/mSelectedModules.
modIds | - A list of suppressed module ids |
gatIds | - A list of suppressed gate ids |
netIds | - A list of suppressed net ids Gets a list of ids of all selected gates. |
Definition at line 231 of file selection_relay.h.
References QSet::values().
Referenced by hal::NetlistRelay::addToModuleDialog(), hal::GraphWidget::ensureSelectionVisible(), hal::GuiApi::getSelectedGates(), hal::GateSelectPicker::handleSelectionChanged(), hal::SelectionDetailsWidget::handleSelectionUpdate(), hal::ModuleSelectExclude::ModuleSelectExclude(), hal::SelectionTreeView::populate(), and selectedNodesList().
|
inline |
Gets a list of ids of all selected gates as an std::vector.
Definition at line 268 of file selection_relay.h.
References QSet::begin(), and QSet::end().
Referenced by hal::PluginParameterDialog::accept(), and hal::GuiApi::getSelectedGateIds().
Gets a set of ids of all selected modules.
Definition at line 318 of file selection_relay.h.
Referenced by hal::ModuleContextMenu::addModuleSubmenu(), hal::GuiApi::deselectModule(), hal::GraphWidget::ensureSelectionVisible(), hal::ActionSetSelectionFocus::exec(), hal::GraphGraphicsView::handleRemoveFromView(), hal::ActionSetSelectionFocus::hasModifications(), hal::GuiApi::selectModule(), and hal::DragController::set().
Gets a list of ids of all selected modules.
Definition at line 251 of file selection_relay.h.
References QSet::values().
Referenced by hal::NetlistRelay::addToModuleDialog(), hal::GraphWidget::ensureSelectionVisible(), hal::GuiApi::getSelectedModules(), hal::ModuleSelectPicker::handleSelectionChanged(), hal::ModuleWidget::handleSelectionChanged(), hal::SelectionDetailsWidget::handleSelectionUpdate(), hal::ModuleSelectExclude::ModuleSelectExclude(), hal::SelectionTreeView::populate(), and selectedNodesList().
|
inline |
Gets a list of ids of all selected modules as an std::vector.
Definition at line 288 of file selection_relay.h.
References QSet::begin(), and QSet::end().
Referenced by hal::PluginParameterDialog::accept(), and hal::GuiApi::getSelectedModuleIds().
Gets a set of ids of all selected nets.
Definition at line 308 of file selection_relay.h.
Referenced by hal::ModuleContextMenu::addNetSubmenu(), hal::GuiApi::deselectNet(), hal::GraphWidget::ensureSelectionVisible(), hal::ActionSetSelectionFocus::exec(), hal::ActionSetSelectionFocus::hasModifications(), and hal::GuiApi::selectNet().
Gets a list of ids of all selected nets.
Definition at line 241 of file selection_relay.h.
References QSet::values().
Referenced by hal::GraphWidget::ensureSelectionVisible(), hal::GuiApi::getSelectedNets(), hal::SelectionDetailsWidget::handleSelectionUpdate(), and hal::SelectionTreeView::populate().
|
inline |
Gets a list of ids of all selected nets as an std::vector.
Definition at line 278 of file selection_relay.h.
References QSet::begin(), and QSet::end().
Referenced by hal::PluginParameterDialog::accept(), and hal::GuiApi::getSelectedNetIds().
Get a list of all selected modules and gates as nodes
Definition at line 473 of file selection_relay.cpp.
References QList::append(), hal::Node::Gate, hal::Node::Module, selectedGatesList(), and selectedModulesList().
|
signal |
Q_SIGNAL to notify that the selection has been changed. If the receiver wants to prevent event handling of certain senders (e.g. itself to prevent infinite loops), it can check the sender pointer. Therefore the sender should always pass a this-pointer.
sender | - The object |
Referenced by actionSetSelected(), hal::GraphicsScene::connectAll(), hal::GraphicsScene::disconnectAll(), hal::GateSelectPicker::GateSelectPicker(), hal::ModuleSelectPicker::ModuleSelectPicker(), hal::ModuleWidget::ModuleWidget(), hal::SelectionDetailsWidget::SelectionDetailsWidget(), hal::GateSelectPicker::terminatePicker(), and hal::ModuleSelectPicker::terminatePicker().
void hal::SelectionRelay::setFocus | ( | ItemType | ftype, |
u32 | fid, | ||
Subfocus | sfoc = Subfocus::None , |
||
u32 | sfinx = 0 |
||
) |
Changes the focus and subfocus to a new value. They are applied after relaySelectionChanged or relaySubfocusChanged was called.
ftype | - The ItemType of the new focus item |
fid | - The id of the new focus item |
sfoc | - The new Subfocus |
sfinx | - The new Subfocus index (i.e. the pin index in subfocus) |
Definition at line 139 of file selection_relay.cpp.
References hal::UserActionObjectType::fromSelectionType(), and hal::ActionSetSelectionFocus::setObject().
Referenced by hal::NetlistRelay::addToModuleDialog(), hal::GraphicsScene::handleInternSelectionChanged(), hal::AddToModuleReceiver::handleModulesPicked(), hal::ModuleWidget::handleTreeSelectionChanged(), hal::GuiApi::selectGate(), hal::GuiApi::selectModule(), and hal::GuiApi::selectNet().
void hal::SelectionRelay::setFocusDirect | ( | ItemType | ftype, |
u32 | fid, | ||
Subfocus | sfoc = Subfocus::None , |
||
u32 | sfinx = 0 |
||
) |
This function is called by the UserAction ActionSetSelectionFocus (and must not be called by others basically). It is used to apply the changes in the focus/subfocus to the SelectionRelay. Note that these changes are not relayed until the signal subfocusChanged is emitted.
ftype | - The ItemType of the new focus item |
fid | - The id of the new focus item |
sfoc | - The new Subfocus |
sfinx | - The new Subfocus index (i.e. the pin index in subfocus) |
Definition at line 147 of file selection_relay.cpp.
Referenced by hal::ActionSetSelectionFocus::exec().
Overwrites the gate selection with the specified list. The selection of nets and modules are not changed/overwritten by this function.
ids | - A set of gate ids to overwrite the gate selection with |
Definition at line 95 of file selection_relay.cpp.
Referenced by hal::GuiApi::deselectGate(), hal::GraphicsScene::handleInternSelectionChanged(), and hal::GuiApi::selectGate().
Overwrites the module selection with the specified list. The selection of gates and nets are not changed/overwritten by this function.
ids | - A set of module ids to overwrite the module selection with |
Definition at line 107 of file selection_relay.cpp.
Referenced by hal::GuiApi::deselectModule(), hal::GraphicsScene::handleInternSelectionChanged(), and hal::GuiApi::selectModule().
Overwrites the net selection with the specified list. The selection of gates and modules are not changed/overwritten by this function.
ids | - A set of net ids to overwrite the net selection with |
Definition at line 101 of file selection_relay.cpp.
Referenced by hal::GuiApi::deselectNet(), hal::GraphicsScene::handleInternSelectionChanged(), and hal::GuiApi::selectNet().
|
inline |
Gets the current Subfocus. Returns Subfocus::None if there is no Subfocus.
Definition at line 538 of file selection_relay.h.
Referenced by hal::ActionSetSelectionFocus::exec(), hal::ActionSetSelectionFocus::hasModifications(), hal::StandardGraphicsGate::paint(), and hal::StandardGraphicsModule::paint().
|
signal |
Q_SIGNAL to notify that the sub-focus has been changed. If the receiver wants to prevent event handling of certain senders (e.g. itself to prevent infinite loops), it can check the sender pointer. Therefore the sender should always pass a this-pointer.
sender | - The object |
Referenced by hal::GraphicsScene::connectAll(), hal::GraphicsScene::disconnectAll(), hal::GraphGraphicsView::GraphGraphicsView(), and relaySubfocusChanged().
|
inline |
Return the index of the current subfocus (i.e. the index of the pin in Subfocus).
Definition at line 548 of file selection_relay.h.
Referenced by hal::ActionSetSelectionFocus::exec(), hal::ActionSetSelectionFocus::hasModifications(), hal::StandardGraphicsGate::paint(), and hal::StandardGraphicsModule::paint().
QList< UserActionObject > hal::SelectionRelay::toUserActionObject | ( | ) | const |
Wraps each selected item into a UserActionObject. Returns the list of all these objects.
Definition at line 83 of file selection_relay.cpp.
References QList::append(), hal::UserActionObjectType::Gate, hal::UserActionObjectType::Module, and hal::UserActionObjectType::Net.
Referenced by hal::SelectionDetailsWidget::selectionToGroupingAction().