20 #include "../../cpp_simptshell/mesh_drawer/NodeItem.h"
22 #include <QGraphicsScene>
23 #include <QGraphicsItem>
25 #include <QStyleOption>
32 NodeItem::NodeItem(Node* n,
double mag)
36 ellipsesize = QRectF(-1 * mag, -1 * mag, 2 * mag, 2 * mag);
39 void NodeItem::paint(QPainter* painter,
const QStyleOptionGraphicsItem*,
QWidget*)
41 painter->setBrush(brush);
42 painter->setPen(Qt::NoPen);
43 painter->drawEllipse(ellipsesize);
46 QPainterPath NodeItem::shape()
const
49 path.addEllipse(ellipsesize);
53 QRectF NodeItem::boundingRect()
const
56 return QRectF(ellipsesize.x() - penwidth / 2., ellipsesize.y() - penwidth / 2.,
57 ellipsesize.width() + penwidth, ellipsesize.height() + penwidth);
60 void NodeItem::setColor()
62 static QColor indian_red(
"IndianRed");
63 static QColor deep_sky_blue(
"DeepSkyBlue");
64 static QColor purple(
"Purple");
70 if (n.IsAtBoundary()) {
71 setBrush(deep_sky_blue);
Namespace for SimPT shell package.
see the online Qt documentation