HAL
hal::ActionAddItemsToObject Class Reference

Adds an item to a module or grouping. More...

#include <action_add_items_to_object.h>

Inheritance diagram for hal::ActionAddItemsToObject:
Inheritance graph
Collaboration diagram for hal::ActionAddItemsToObject:
Collaboration graph

Public Member Functions

 ActionAddItemsToObject (const QSet< u32 > &mods=QSet< u32 >(), const QSet< u32 > &gats=QSet< u32 >(), const QSet< u32 > &nets=QSet< u32 >(), const QSet< u32 > &pins=QSet< u32 >())
 
bool exec () override
 
void setPlacementHint (PlacementHint hint)
 
void setUsedInCreateContext ()
 
QString tagname () const override
 
void writeToXml (QXmlStreamWriter &xmlOut) const override
 
void readFromXml (QXmlStreamReader &xmlIn) override
 
void addToHash (QCryptographicHash &cryptoHash) const override
 
- Public Member Functions inherited from hal::UserAction
virtual ~UserAction ()
 
virtual UserActionObject object () const
 
virtual void setObject (const UserActionObject &obj)
 
int compoundOrder () const
 
void setCompoundOrder (int cmpord)
 
qint64 timeStamp () const
 
QString cryptographicHash (int recordNo) const
 
UserActionundoAction () const
 
QString debugDump () const
 
void setObjectLock (bool lock)
 
void setParentObjectLock (bool lock)
 
bool hasProjectModified () const
 

Additional Inherited Members

- Protected Member Functions inherited from hal::UserAction
 UserAction ()
 
void writeParentObjectToXml (QXmlStreamWriter &xmlOut) const
 
void readParentObjectFromXml (QXmlStreamReader &xmlIn)
 
- Static Protected Member Functions inherited from hal::UserAction
static QString setToText (const QSet< u32 > &set)
 
static QSet< u32setFromText (const QString &s)
 
static QString gridToText (const QHash< hal::Node, QPoint > &grid)
 
static QHash< hal::Node, QPointgridFromText (const QString &txt)
 
- Protected Attributes inherited from hal::UserAction
UserActionObject mObject
 
UserActionObject mParentObject
 
int mCompoundOrder
 
UserActionmUndoAction
 
qint64 mTimeStamp
 
bool mObjectLock
 
bool mParentObjectLock
 
bool mProjectModified
 

Detailed Description

Adds an item to a module or grouping.

Adds Modules, Gates, or Nets to the UserActionObject which must exist and must be of type Module or Grouping.

Undo Action: ActionDeleteObject

Definition at line 41 of file action_add_items_to_object.h.

Constructor & Destructor Documentation

◆ ActionAddItemsToObject()

hal::ActionAddItemsToObject::ActionAddItemsToObject ( const QSet< u32 > &  mods = QSet<u32>(),
const QSet< u32 > &  gats = QSet<u32>(),
const QSet< u32 > &  nets = QSet<u32>(),
const QSet< u32 > &  pins = QSet<u32>() 
)
inline

Action constructor.

Parameters
mods- The ids of the modules to add
gats- The ids of the gates to add
nets- The ids of the nets to add
pins- The ids of the pins to add

Definition at line 61 of file action_add_items_to_object.h.

Referenced by exec().

Member Function Documentation

◆ addToHash()

void hal::ActionAddItemsToObject::addToHash ( QCryptographicHash cryptoHash) const
overridevirtual

Hook for derived classes to add parameter to cryptographic hash.

Parameters
cryptoHash- Additional hash data.

Reimplemented from hal::UserAction.

Definition at line 32 of file action_add_items_to_object.cpp.

References QCryptographicHash::addData(), and hal::UserAction::setToText().

◆ exec()

bool hal::ActionAddItemsToObject::exec ( )
overridevirtual

Executes user interaction and returns true on success. Note: Each implementation of exec() must include a call to the exec() method of base class to store the UserAction object in history and to transfer its ownership.

Returns
True on success, False otherwise.

Reimplemented from hal::UserAction.

Definition at line 103 of file action_add_items_to_object.cpp.

References ActionAddItemsToObject(), hal::GraphContext::add(), hal::UserActionCompound::addAction(), hal::Grouping::assign_gate_by_id(), hal::Module::assign_gates(), hal::Grouping::assign_module_by_id(), hal::Grouping::assign_net_by_id(), QHash::begin(), hal::GraphContext::beginChange(), hal::UserActionObjectType::ContextView, QHash::end(), hal::GraphContext::endChange(), hal::UserAction::exec(), test_plugin::g, hal::gContentManager, hal::Netlist::get_gate_by_id(), hal::Netlist::get_grouping_by_id(), hal::Module::get_id(), hal::Netlist::get_module_by_id(), hal::Module::get_parent_module(), hal::GraphContextManager::getContextById(), hal::ContentManager::getContextManagerWidget(), hal::ContextManagerWidget::getCurrentContext(), hal::GraphContext::getLayouter(), hal::gGraphContextManager, hal::gNetlist, hal::GraphLayouter::gridPlacementFactory(), hal::UserActionObjectType::Grouping, hal::GraphContext::id(), hal::UserActionObject::id(), QHash::insert(), QHash::isEmpty(), hal::UserAction::mObject, hal::UserActionObjectType::Module, hal::UserAction::mUndoAction, hal::Module::set_parent_module(), hal::UserAction::setObject(), and hal::UserActionObject::type().

Referenced by hal::AddToModuleReceiver::handleModulesPicked().

◆ readFromXml()

◆ setPlacementHint()

void hal::ActionAddItemsToObject::setPlacementHint ( PlacementHint  hint)
inline

Sets the placement hints that are used to layout the added items.

Parameters
hint- The new placement hint

Definition at line 76 of file action_add_items_to_object.h.

Referenced by hal::ActionDeleteObject::exec(), hal::ActionFoldModule::exec(), hal::ActionRemoveItemsFromObject::exec(), and hal::GraphContextManager::openNetEndpointsInView().

◆ setUsedInCreateContext()

void hal::ActionAddItemsToObject::setUsedInCreateContext ( )
inline

Must be called when adding pins to a pingroup and the pingroup was created in the same compound action. Sets a flag so that the undo action does not delete the source pingroup.

Definition at line 83 of file action_add_items_to_object.h.

◆ tagname()

QString hal::ActionAddItemsToObject::tagname ( ) const
overridevirtual

The xml tagname for the action is purely virtual and needs to be implemented in derived class.

Returns
The tagname.

Implements hal::UserAction.

Definition at line 27 of file action_add_items_to_object.cpp.

References hal::ActionAddItemsToObjectFactory::sFactory, and hal::UserActionFactory::tagname().

◆ writeToXml()


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