HAL
hal::SelectionRelay Class Reference

Stores and manages the gui's selection state. More...

#include <selection_relay.h>

Inheritance diagram for hal::SelectionRelay:
Inheritance graph
Collaboration diagram for hal::SelectionRelay:
Collaboration graph

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< u32selectedGatesList () const
 
QList< u32selectedNetsList () const
 
QList< u32selectedModulesList () const
 
QList< NodeselectedNodesList () const
 
std::vector< u32selectedGatesVector () const
 
std::vector< u32selectedNetsVector () const
 
std::vector< u32selectedModulesVector () 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< UserActionObjecttoUserActionObject () const
 
- 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
 

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

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.

Member Enumeration Documentation

◆ ItemType

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.

◆ Subfocus

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.

Constructor & Destructor Documentation

◆ SelectionRelay()

hal::SelectionRelay::SelectionRelay ( QObject parent = nullptr)
explicit

Constructor.

Parameters
parent- The parent QObject

Definition at line 15 of file selection_relay.cpp.

References clear().

Member Function Documentation

◆ actionSetSelected()

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.

Parameters
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().

◆ addGate()

void hal::SelectionRelay::addGate ( u32  id)

Adds the gate with the specified id to the current selection.

Parameters
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().

◆ addModule()

void hal::SelectionRelay::addModule ( u32  id)

Adds the module with the specified id to the current selection.

Parameters
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().

◆ addNet()

void hal::SelectionRelay::addNet ( u32  id)

Adds the net with the specified id to the current selection.

Parameters
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().

◆ clear()

◆ clearAndUpdate()

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().

◆ containsGate()

bool hal::SelectionRelay::containsGate ( u32  id) const
inline

Return true iff the gate with the specified id is contained in the current selection.

Parameters
id- The id of the gate to look for
Returns
true iff the gate is selected

Definition at line 379 of file selection_relay.h.

References QSet::contains().

◆ containsModule()

bool hal::SelectionRelay::containsModule ( u32  id) const
inline

Return true iff the module with the specified id is contained in the current selection.

Parameters
id- The id of the module to look for
Returns
true iff the module is selected

Definition at line 401 of file selection_relay.h.

References QSet::contains().

◆ containsNet()

bool hal::SelectionRelay::containsNet ( u32  id) const
inline

Return true iff the net with the specified id is contained in the current selection.

Parameters
id- The id of the net to look for
Returns
true iff the net is selected

Definition at line 390 of file selection_relay.h.

References QSet::contains().

◆ focusId()

u32 hal::SelectionRelay::focusId ( ) const
inline

◆ focusType()

ItemType hal::SelectionRelay::focusType ( ) const
inline

Gets the type of the item that is in the current focus. ItemType::None if no item is in focus.

Returns
the ItemType of the current item 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().

◆ handleGateRemoved()

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).

Parameters
id- The id of the removed gate

Definition at line 413 of file selection_relay.cpp.

References QSet::end(), QSet::find(), and QSet::remove().

◆ handleModuleRemoved()

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).

Parameters
id- The id of the removed module

Definition at line 402 of file selection_relay.cpp.

References QSet::end(), QSet::find(), and QSet::remove().

◆ handleNetRemoved()

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).

Parameters
id- The id of the removed net

Definition at line 424 of file selection_relay.cpp.

References QSet::end(), QSet::find(), and QSet::remove().

◆ isGateSelected()

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).

Parameters
id- The id of the gate
Returns
true if the gate is selected and not suppressed.

Definition at line 392 of file selection_relay.cpp.

References QSet::contains().

Referenced by hal::GraphicsScene::handleExternSelectionChanged().

◆ isModuleSelected()

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).

Parameters
id- The id of the module
Returns
true if the module is selected and not suppressed.

Definition at line 387 of file selection_relay.cpp.

References QSet::contains().

Referenced by hal::GraphicsScene::handleExternSelectionChanged().

◆ isNetSelected()

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).

Parameters
id- The id of the net
Returns
true if the net is selected and not suppressed.

Definition at line 397 of file selection_relay.cpp.

References QSet::contains().

Referenced by hal::GraphicsScene::handleExternSelectionChanged().

◆ navigateDown()

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.

◆ navigateUp()

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.

◆ numberSelectedGates()

int hal::SelectionRelay::numberSelectedGates ( ) const
inline

Gets the amount of currently selected gates.

Returns
the amount of selected gates

Definition at line 328 of file selection_relay.h.

References QSet::size().

Referenced by hal::GraphicsScene::handleExternSelectionChanged(), and hal::SelectionDetailsWidget::handleSelectionUpdate().

◆ numberSelectedItems()

int hal::SelectionRelay::numberSelectedItems ( ) const
inline

Gets the amount of all currently selected items. Items are gates nets or modules.

Returns
the amount of selected items

Definition at line 368 of file selection_relay.h.

References QSet::size().

Referenced by hal::GateSelectPicker::handleSelectionChanged(), hal::ModuleSelectPicker::handleSelectionChanged(), and hal::SelectionDetailsWidget::handleSelectionUpdate().

◆ numberSelectedModules()

int hal::SelectionRelay::numberSelectedModules ( ) const
inline

Gets the amount of currently selected modules.

Returns
the amount of selected modules

Definition at line 348 of file selection_relay.h.

References QSet::size().

Referenced by hal::GraphicsScene::handleExternSelectionChanged(), and hal::SelectionDetailsWidget::handleSelectionUpdate().

◆ numberSelectedNets()

int hal::SelectionRelay::numberSelectedNets ( ) const
inline

Gets the amount of currently selected nets.

Returns
the amount of selected nets

Definition at line 338 of file selection_relay.h.

References QSet::size().

Referenced by hal::GraphicsScene::handleExternSelectionChanged(), and hal::SelectionDetailsWidget::handleSelectionUpdate().

◆ numberSelectedNodes()

int hal::SelectionRelay::numberSelectedNodes ( ) const
inline

Gets the amount of currently selected nodes. Nodes are both gates and modules.

Returns
the amount of selected nodes

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().

◆ registerSender()

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.

Parameters
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().

◆ relaySelectionChanged()

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.

Parameters
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().

◆ relaySubfocusChanged()

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.

Parameters
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().

◆ removeGate()

void hal::SelectionRelay::removeGate ( u32  id)

Removes the gate of the specified id from the current selection.

Parameters
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().

◆ removeModule()

void hal::SelectionRelay::removeModule ( u32  id)

Removes the module of the specified id from the current selection.

Parameters
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().

◆ removeNet()

void hal::SelectionRelay::removeNet ( u32  id)

Removes the net of the specified id from the current selection.

Parameters
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().

◆ removeSender()

void hal::SelectionRelay::removeSender ( void *  sender)

Unregisters a sender object. Used in the hal user study to keep track of the selection changes.

Parameters
sender- The object to unregister

Definition at line 166 of file selection_relay.cpp.

References QObject::sender().

◆ selectedGates()

◆ selectedGatesList()

QList<u32> hal::SelectionRelay::selectedGatesList ( ) const
inline

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.

Parameters
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.
Returns
the list of gate ids

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().

◆ selectedGatesVector()

std::vector<u32> hal::SelectionRelay::selectedGatesVector ( ) const
inline

Gets a list of ids of all selected gates as an std::vector.

Returns
the vector of gate ids

Definition at line 268 of file selection_relay.h.

References QSet::begin(), and QSet::end().

Referenced by hal::PluginParameterDialog::accept(), and hal::GuiApi::getSelectedGateIds().

◆ selectedModules()

◆ selectedModulesList()

◆ selectedModulesVector()

std::vector<u32> hal::SelectionRelay::selectedModulesVector ( ) const
inline

Gets a list of ids of all selected modules as an std::vector.

Returns
the vector of module ids

Definition at line 288 of file selection_relay.h.

References QSet::begin(), and QSet::end().

Referenced by hal::PluginParameterDialog::accept(), and hal::GuiApi::getSelectedModuleIds().

◆ selectedNets()

const QSet<u32>& hal::SelectionRelay::selectedNets ( ) const
inline

◆ selectedNetsList()

QList<u32> hal::SelectionRelay::selectedNetsList ( ) const
inline

Gets a list of ids of all selected nets.

Returns
the list of net ids

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().

◆ selectedNetsVector()

std::vector<u32> hal::SelectionRelay::selectedNetsVector ( ) const
inline

Gets a list of ids of all selected nets as an std::vector.

Returns
the vector of net ids

Definition at line 278 of file selection_relay.h.

References QSet::begin(), and QSet::end().

Referenced by hal::PluginParameterDialog::accept(), and hal::GuiApi::getSelectedNetIds().

◆ selectedNodesList()

QList< Node > hal::SelectionRelay::selectedNodesList ( ) const

Get a list of all selected modules and gates as nodes

Returns
the list of nodes

Definition at line 473 of file selection_relay.cpp.

References QList::append(), hal::Node::Gate, hal::Node::Module, selectedGatesList(), and selectedModulesList().

◆ selectionChanged

void hal::SelectionRelay::selectionChanged ( void *  sender)
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.

Parameters
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().

◆ setFocus()

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.

Parameters
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().

◆ setFocusDirect()

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.

Parameters
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().

◆ setSelectedGates()

void hal::SelectionRelay::setSelectedGates ( const QSet< u32 > &  ids)

Overwrites the gate selection with the specified list. The selection of nets and modules are not changed/overwritten by this function.

Parameters
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().

◆ setSelectedModules()

void hal::SelectionRelay::setSelectedModules ( const QSet< u32 > &  ids)

Overwrites the module selection with the specified list. The selection of gates and nets are not changed/overwritten by this function.

Parameters
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().

◆ setSelectedNets()

void hal::SelectionRelay::setSelectedNets ( const QSet< u32 > &  ids)

Overwrites the net selection with the specified list. The selection of gates and modules are not changed/overwritten by this function.

Parameters
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().

◆ subfocus()

Subfocus hal::SelectionRelay::subfocus ( ) const
inline

Gets the current Subfocus. Returns Subfocus::None if there is no Subfocus.

Returns
the current 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().

◆ subfocusChanged

void hal::SelectionRelay::subfocusChanged ( void *  sender)
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.

Parameters
sender- The object

Referenced by hal::GraphicsScene::connectAll(), hal::GraphicsScene::disconnectAll(), hal::GraphGraphicsView::GraphGraphicsView(), and relaySubfocusChanged().

◆ subfocusIndex()

u32 hal::SelectionRelay::subfocusIndex ( ) const
inline

Return the index of the current subfocus (i.e. the index of the pin in Subfocus).

Returns
the Subfocus index.

Definition at line 548 of file selection_relay.h.

Referenced by hal::ActionSetSelectionFocus::exec(), hal::ActionSetSelectionFocus::hasModifications(), hal::StandardGraphicsGate::paint(), and hal::StandardGraphicsModule::paint().

◆ toUserActionObject()

QList< UserActionObject > hal::SelectionRelay::toUserActionObject ( ) const

Wraps each selected item into a UserActionObject. Returns the list of all these objects.

Returns
the list of UserActionObjects

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().


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