HAL
hal::NodeBox Class Reference

The NodeBox class represents a node placed at a grid position within a hal view. More...

#include <node_box.h>

Collaboration diagram for hal::NodeBox:
Collaboration graph

Public Member Functions

 NodeBox (const Node &n, int px, int py)
 NodeBox constructor creates graphic item. More...
 
Node getNode () const
 getNode getter for node information More...
 
Node::NodeType type () const
 type getter for type information More...
 
u32 id () const
 id getter for ID information More...
 
int x () const
 x getter for X-grid position More...
 
int y () const
 y getter for Y-grid position More...
 
QPoint gridPosition () const
 
void setItem (GraphicsNode *item_)
 setItem More...
 
void setItemPosition (qreal xpos, qreal ypos)
 setItemPosition place item on scene at real position More...
 
GraphicsNodeitem () const
 item getter for graphics item object More...
 
qreal inputPadding () const
 inputPadding distance from top edge to first input net More...
 
qreal outputPadding () const
 outputPadding distance from top edge to first output net More...
 

Detailed Description

The NodeBox class represents a node placed at a grid position within a hal view.

The constructur of NodeBox creates the box item derived from GraphicsNode/QGraphicsItem. Constructor should be called by layouter since scene position needs to be assigned to scene. Each hal view has its own list of NodeBox'es which should be stored in class NodeBoxes.

Definition at line 49 of file node_box.h.

Constructor & Destructor Documentation

◆ NodeBox()

hal::NodeBox::NodeBox ( const Node n,
int  px,
int  py 
)

NodeBox constructor creates graphic item.

Parameters
nnode of type gate or module
pxx grid position where box is placed
pyy grid position where box is placed

Definition at line 16 of file node_box.cpp.

References hal::GraphicsFactory::createGraphicsGate(), hal::GraphicsFactory::createGraphicsModule(), hal::Node::Gate, hal::Netlist::get_gate_by_id(), hal::Netlist::get_module_by_id(), hal::gNetlist, hal::Node::Module, and type().

Member Function Documentation

◆ getNode()

Node hal::NodeBox::getNode ( ) const
inline

getNode getter for node information

Returns
the node represented by NodeBox

Definition at line 75 of file node_box.h.

Referenced by hal::NodeBoxes::addBox(), hal::DragController::finalGridPlacement(), hal::GraphContext::getNetDestination(), and hal::GraphContext::getNetSource().

◆ gridPosition()

QPoint hal::NodeBox::gridPosition ( ) const
inline

Convenience getter for grid position as QPoint

Returns
grid position

Definition at line 105 of file node_box.h.

Referenced by hal::DragController::enterDrag(), hal::DragController::finalGridPlacement(), hal::DragController::isDropAllowed(), and hal::DragController::move().

◆ id()

u32 hal::NodeBox::id ( ) const
inline

id getter for ID information

Returns
the id as unsigned integer

Definition at line 87 of file node_box.h.

References hal::Node::id().

Referenced by hal::NodeBoxes::addBox().

◆ inputPadding()

qreal hal::NodeBox::inputPadding ( ) const
inline

inputPadding distance from top edge to first input net

Returns
input padding as real value

Definition at line 130 of file node_box.h.

◆ item()

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

item getter for graphics item object

Returns
pointer to item

Definition at line 124 of file node_box.h.

Referenced by hal::NodeBoxes::addBox(), and hal::DragController::set().

◆ outputPadding()

qreal hal::NodeBox::outputPadding ( ) const
inline

outputPadding distance from top edge to first output net

Returns
output padding as real value

Definition at line 136 of file node_box.h.

◆ setItem()

void hal::NodeBox::setItem ( GraphicsNode item_)
inline

setItem

Parameters
item_

Definition at line 111 of file node_box.h.

◆ setItemPosition()

void hal::NodeBox::setItemPosition ( qreal  xpos,
qreal  ypos 
)

setItemPosition place item on scene at real position

Parameters
xposx-scene position
yposy-scene position

Definition at line 37 of file node_box.cpp.

References QGraphicsItem::setPos().

◆ type()

Node::NodeType hal::NodeBox::type ( ) const
inline

type getter for type information

Returns
the type should be either Node::Module or Node::Gate

Definition at line 81 of file node_box.h.

References hal::Node::type().

Referenced by NodeBox().

◆ x()

int hal::NodeBox::x ( ) const
inline

x getter for X-grid position

Returns
x-grid position

Definition at line 93 of file node_box.h.

Referenced by hal::NetlistRelay::addToModuleDialog(), and hal::GraphLayouter::gridPointByItem().

◆ y()

int hal::NodeBox::y ( ) const
inline

y getter for Y-grid position

Returns
y-grid position

Definition at line 99 of file node_box.h.

Referenced by hal::NetlistRelay::addToModuleDialog(), and hal::GraphLayouter::gridPointByItem().


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