2014-05-05 17:12:23 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QGraphicsItem>
|
|
|
|
|
2014-05-25 17:43:05 -04:00
|
|
|
#include <retroshare/rsgxscircles.h>
|
2014-05-05 17:12:23 -04:00
|
|
|
|
|
|
|
class CircleItem: public QObject, public QGraphicsItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2014-05-25 17:43:05 -04:00
|
|
|
CircleItem(const RsGroupMetaData& gxs_group_info,const RsGxsCircleDetails& details) ;
|
2014-05-05 17:12:23 -04:00
|
|
|
|
|
|
|
QRectF boundingRect() const ;
|
|
|
|
//QPainterPath shape() const ;
|
|
|
|
|
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) ;
|
|
|
|
|
|
|
|
//static QImage makeDefaultIcon(const RsGxsGroupId& id) ;
|
|
|
|
|
2014-05-25 17:43:05 -04:00
|
|
|
static const int IMG_SIZE = 32;
|
|
|
|
static const int CRC_SIZE = 128;
|
|
|
|
|
2014-05-05 17:12:23 -04:00
|
|
|
static CircleItem *_selected_node ;
|
|
|
|
|
|
|
|
const RsGroupMetaData& groupInfo() const { return _group_info ; }
|
|
|
|
signals:
|
|
|
|
void itemChanged() ;
|
|
|
|
|
|
|
|
private:
|
|
|
|
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *e);
|
|
|
|
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *e);
|
|
|
|
virtual QVariant itemChange(GraphicsItemChange change,const QVariant& value) ;
|
|
|
|
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
|
|
|
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
|
|
|
|
|
|
|
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *) ;
|
|
|
|
|
|
|
|
RsGroupMetaData _group_info ;
|
2014-05-25 17:43:05 -04:00
|
|
|
RsGxsCircleDetails _circle_details ;
|
2014-05-05 17:12:23 -04:00
|
|
|
|
|
|
|
bool mDeterminedBB;
|
|
|
|
bool mBBWidth;
|
|
|
|
bool _selected ;
|
2014-05-25 17:43:05 -04:00
|
|
|
|
|
|
|
std::vector<float> _angles ;
|
2014-05-05 17:12:23 -04:00
|
|
|
};
|
|
|
|
|