TermNodeGraphicsItem.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* @package ArmarX::Gui
17* @author Kai Welke (welke@kit.edu)
18* @copyright 2012 Humanoids Group, IAIM, IFA
19* @license http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
25#include <QGraphicsItem>
26#include <QPainter>
27#include <QString>
28
29#include "../TermNode.h"
30
31namespace armarx
32{
33 class TermNodeGraphicsItem : public QObject, public QGraphicsItem
34 {
35 Q_OBJECT
36
37 public:
38 // constructs a termnode graphics item
40
41 // set the position of the node
42 void setRect(QRectF boundingBox);
43 void setText(const QString& text);
44 void setPixmap(const QPixmap& pixmap);
45 void setColor(const QColor& penColor);
46
47 // pute virtual in QGraphicsItem
48 QRectF boundingRect() const override;
49 void
50 paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
51
52 signals:
55
56 public slots:
57 void updateNodeActivation(const QPointF&);
58 void activateNode();
59 void deactivateNode();
60 void activateNodeSilent();
61
62 private:
63 TermNode* node;
64 QString text;
65 QRectF boundingBox;
66 QPixmap pixmap;
67 QColor penColor;
68 bool pixmapSet;
69 bool activated;
70 };
71} // namespace armarx
#define option(type, fn)
void setText(const QString &text)
void setPixmap(const QPixmap &pixmap)
void updateNodeActivation(const QPointF &)
void setColor(const QColor &penColor)
void setRect(QRectF boundingBox)
QRectF boundingRect() const override
TermNodeGraphicsItem(TermTreeGraphicsScene *scene, TermNode *node)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
This file offers overloads of toIce() and fromIce() functions for STL container types.