HAL
hal::NodeBoxes Class Reference

The NodeBoxes class owns all NodeBox'es from hal view. More...

#include <node_box.h>

Inheritance diagram for hal::NodeBoxes:
Inheritance graph
Collaboration diagram for hal::NodeBoxes:
Collaboration graph

Public Member Functions

 NodeBoxes ()
 
 ~NodeBoxes ()
 
void addBox (const Node &nd, int px, int py)
 addBox call NodeBox constructor and store pointer in vector More...
 
void clearBoxes ()
 clearBoxes delete all NodeBox'es and clear vector. More...
 
NodeBoxboxForGate (const Gate *g) const
 boxForGate find NodeBox by Gate pointer. More...
 
NodeBoxboxForPoint (const QPoint &p) const
 boxForPoint find NodeBox by grid position More...
 
NodeBoxboxForNode (const Node &n) const
 boxForNode find NodeBox by node More...
 
NodeBoxboxForItem (GraphicsNode *item) const
 boxForItem find NodeBox by graphics item More...
 
QSet< u32filterNotInView (const QSet< u32 > &gats) const
 
- Public Member Functions inherited from QVector< NodeBox * >
 QVector ()
 
 QVector (int size)
 
 QVector (int size, const T &value)
 
 QVector (const QVector< T > &other)
 
 QVector (QVector< T > &&other)
 
 QVector (std::initializer_list< T > args)
 
 QVector (InputIterator first, InputIterator last)
 
 ~QVector ()
 
QVector< T > & operator= (const QVector< T > &other)
 
QVector< T > & operator= (QVector< T > &&other)
 
QVector< T > & operator= (std::initializer_list< T > args)
 
void swap (QVector< T > &other)
 
bool operator== (const QVector< T > &other) const const
 
bool operator!= (const QVector< T > &other) const const
 
int size () const const
 
bool isEmpty () const const
 
void resize (int size)
 
int capacity () const const
 
void reserve (int size)
 
void squeeze ()
 
T * data ()
 
const T * data () const const
 
const T * constData () const const
 
void clear ()
 
const T & at (int i) const const
 
T & operator[] (int i)
 
const T & operator[] (int i) const const
 
void append (const T &value)
 
void append (T &&value)
 
void append (const QVector< T > &value)
 
void prepend (T &&value)
 
void prepend (const T &value)
 
void insert (int i, T &&value)
 
void insert (int i, const T &value)
 
void insert (int i, int count, const T &value)
 
QVector::iterator insert (QVector::iterator before, int count, const T &value)
 
QVector::iterator insert (QVector::iterator before, const T &value)
 
QVector::iterator insert (QVector::iterator before, T &&value)
 
void replace (int i, const T &value)
 
void remove (int i)
 
void remove (int i, int count)
 
void removeFirst ()
 
void removeLast ()
 
takeFirst ()
 
takeLast ()
 
QVector< T > & fill (const T &value, int size)
 
int indexOf (const T &value, int from) const const
 
int lastIndexOf (const T &value, int from) const const
 
bool contains (const T &value) const const
 
int count (const T &value) const const
 
int count () const const
 
void removeAt (int i)
 
int removeAll (const T &t)
 
bool removeOne (const T &t)
 
int length () const const
 
takeAt (int i)
 
void move (int from, int to)
 
QVector::iterator begin ()
 
QVector::const_iterator begin () const const
 
QVector::const_iterator cbegin () const const
 
QVector::const_iterator constBegin () const const
 
QVector::iterator end ()
 
QVector::const_iterator end () const const
 
QVector::const_iterator cend () const const
 
QVector::const_iterator constEnd () const const
 
QVector::reverse_iterator rbegin ()
 
QVector::const_reverse_iterator rbegin () const const
 
QVector::reverse_iterator rend ()
 
QVector::const_reverse_iterator rend () const const
 
QVector::const_reverse_iterator crbegin () const const
 
QVector::const_reverse_iterator crend () const const
 
QVector::iterator erase (QVector::iterator begin, QVector::iterator end)
 
QVector::iterator erase (QVector::iterator pos)
 
T & first ()
 
const T & first () const const
 
const T & constFirst () const const
 
T & last ()
 
const T & last () const const
 
const T & constLast () const const
 
bool startsWith (const T &value) const const
 
bool endsWith (const T &value) const const
 
QVector< T > mid (int pos, int length) const const
 
value (int i) const const
 
value (int i, const T &defaultValue) const const
 
void swapItemsAt (int i, int j)
 
void push_back (const T &value)
 
void push_back (T &&value)
 
void push_front (T &&value)
 
void push_front (const T &value)
 
void pop_back ()
 
void pop_front ()
 
bool empty () const const
 
T & front ()
 
QVector::const_reference front () const const
 
QVector::reference back ()
 
QVector::const_reference back () const const
 
void shrink_to_fit ()
 
QVector< T > & operator+= (const QVector< T > &other)
 
QVector< T > & operator+= (const T &value)
 
QVector< T > & operator+= (T &&value)
 
QVector< T > operator+ (const QVector< T > &other) const const
 
QVector< T > & operator<< (const T &value)
 
QVector< T > & operator<< (const QVector< T > &other)
 
QVector< T > & operator<< (T &&value)
 
QDataStreamoperator<< (QDataStream &out, const QVector< T > &vector)
 
QList< T > toList () const const
 
std::vector< T > toStdVector () const const
 
bool operator< (const QVector< T > &lhs, const QVector< T > &rhs)
 
bool operator<= (const QVector< T > &lhs, const QVector< T > &rhs)
 
bool operator> (const QVector< T > &lhs, const QVector< T > &rhs)
 
bool operator>= (const QVector< T > &lhs, const QVector< T > &rhs)
 
uint qHash (const QVector< T > &key, uint seed)
 
QDataStreamoperator>> (QDataStream &in, QVector< T > &vector)
 

Additional Inherited Members

- Static Public Member Functions inherited from QVector< NodeBox * >
QVector< T > fromList (const QList< T > &list)
 
QVector< T > fromStdVector (const std::vector< T > &vector)
 
- Public Attributes inherited from QVector< NodeBox * >
typedef iterator
 
typedef const_iterator
 
typedef reverse_iterator
 
typedef const_reverse_iterator
 
typedef value_type
 
typedef pointer
 
typedef const_pointer
 
typedef reference
 
typedef const_reference
 
typedef difference_type
 
typedef Iterator
 
typedef ConstIterator
 
typedef size_type
 

Detailed Description

The NodeBoxes class owns all NodeBox'es from hal view.

Several index members (QHash) allow fast access by grid position, node id, mouse click in graphics, or net endpoint. Pointer to new NodeBox'es should only be added using the addBox() method to update index correctly.

Definition at line 149 of file node_box.h.

Constructor & Destructor Documentation

◆ NodeBoxes()

hal::NodeBoxes::NodeBoxes ( )
inline

Constructor

Definition at line 155 of file node_box.h.

◆ ~NodeBoxes()

hal::NodeBoxes::~NodeBoxes ( )

Destructor

Definition at line 44 of file node_box.cpp.

Member Function Documentation

◆ addBox()

void hal::NodeBoxes::addBox ( const Node nd,
int  px,
int  py 
)

addBox call NodeBox constructor and store pointer in vector

Parameters
ndNode to be created and added
pxgrid x-position
pygrid y-position

Definition at line 61 of file node_box.cpp.

References QVector< NodeBox * >::append(), test_plugin::g, hal::Netlist::get_gate_by_id(), hal::Module::get_gates(), hal::Netlist::get_module_by_id(), hal::NodeBox::getNode(), hal::gNetlist, hal::NodeBox::id(), hal::Node::isGate(), hal::Node::isModule(), and hal::NodeBox::item().

◆ boxForGate()

NodeBox* hal::NodeBoxes::boxForGate ( const Gate g) const
inline

boxForGate find NodeBox by Gate pointer.

Parameters
gpointer to netlist Gate
Returns
pointer to NodeBox or nullptr if none found

A NodeBox is returned if the box either represents the given gate or if the gate is part of a module rendered as box. The method ist mostly used to find boxes by net endpoints.

Definition at line 184 of file node_box.h.

References test_plugin::g.

Referenced by hal::GraphContext::getNetDestination(), and hal::GraphContext::getNetSource().

◆ boxForItem()

NodeBox* hal::NodeBoxes::boxForItem ( GraphicsNode item) const
inline

boxForItem find NodeBox by graphics item

Parameters
itempointer to graphics item
Returns
pointer to NodeBox or nullptr if none found

Mostly used to find NodeBox selected in QGraphicsView engine, e.g. by mouse position

Definition at line 209 of file node_box.h.

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

◆ boxForNode()

NodeBox* hal::NodeBoxes::boxForNode ( const Node n) const
inline

boxForNode find NodeBox by node

Parameters
nthe node
Returns
pointer to NodeBox or nullptr if none found

Used to search gates or modules by ID.

Definition at line 200 of file node_box.h.

References test::n.

Referenced by hal::NetlistRelay::addToModuleDialog(), hal::ShortestPath::module(), and hal::DragController::set().

◆ boxForPoint()

NodeBox* hal::NodeBoxes::boxForPoint ( const QPoint p) const
inline

boxForPoint find NodeBox by grid position

Parameters
pinteger grid position
Returns
pointer to NodeBox or nullptr if none found

Definition at line 191 of file node_box.h.

Referenced by hal::DragController::isDropAllowed().

◆ clearBoxes()

void hal::NodeBoxes::clearBoxes ( )

clearBoxes delete all NodeBox'es and clear vector.

Definition at line 50 of file node_box.cpp.

References QVector< NodeBox * >::clear().

◆ filterNotInView()

QSet< u32 > hal::NodeBoxes::filterNotInView ( const QSet< u32 > &  gats) const

Definition at line 83 of file node_box.cpp.

References hal::Node::Gate, and QSet::insert().


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