![]() |
HAL
|
The NodeBox class represents a node placed at a grid position within a hal view. More...
#include <node_box.h>
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... | |
GraphicsNode * | item () 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... | |
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.
hal::NodeBox::NodeBox | ( | const Node & | n, |
int | px, | ||
int | py | ||
) |
NodeBox constructor creates graphic item.
n | node of type gate or module |
px | x grid position where box is placed |
py | y 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().
|
inline |
getNode getter for node information
Definition at line 75 of file node_box.h.
Referenced by hal::NodeBoxes::addBox(), hal::DragController::finalGridPlacement(), hal::GraphContext::getNetDestination(), and hal::GraphContext::getNetSource().
|
inline |
Convenience getter for grid position as QPoint
Definition at line 105 of file node_box.h.
Referenced by hal::DragController::enterDrag(), hal::DragController::finalGridPlacement(), hal::DragController::isDropAllowed(), and hal::DragController::move().
|
inline |
id getter for ID information
Definition at line 87 of file node_box.h.
References hal::Node::id().
Referenced by hal::NodeBoxes::addBox().
|
inline |
inputPadding distance from top edge to first input net
Definition at line 130 of file node_box.h.
|
inline |
item getter for graphics item object
Definition at line 124 of file node_box.h.
Referenced by hal::NodeBoxes::addBox(), and hal::DragController::set().
|
inline |
outputPadding distance from top edge to first output net
Definition at line 136 of file node_box.h.
|
inline |
void hal::NodeBox::setItemPosition | ( | qreal | xpos, |
qreal | ypos | ||
) |
setItemPosition place item on scene at real position
xpos | x-scene position |
ypos | y-scene position |
Definition at line 37 of file node_box.cpp.
References QGraphicsItem::setPos().
|
inline |
type getter for type information
Definition at line 81 of file node_box.h.
References hal::Node::type().
Referenced by NodeBox().
|
inline |
x getter for X-grid position
Definition at line 93 of file node_box.h.
Referenced by hal::NetlistRelay::addToModuleDialog(), and hal::GraphLayouter::gridPointByItem().
|
inline |
y getter for Y-grid position
Definition at line 99 of file node_box.h.
Referenced by hal::NetlistRelay::addToModuleDialog(), and hal::GraphLayouter::gridPointByItem().