DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaGraphicObject.hpp
Go to the documentation of this file.
1#ifndef SCHEMAGRAPHICOBJECT_H
2#define SCHEMAGRAPHICOBJECT_H
3
5#include <QGraphicsObject>
6#include <QGraphicsSceneHoverEvent>
7#include <QFont>
8#include <QColor>
9#include <QPen>
10
12#include "oks/class.hpp"
13
14namespace dbse
15{
16
17class SchemaGraphicSegmentedArrow;
18class SchemaGraphicsScene;
19
20class SchemaGraphicObject: public QGraphicsObject
21{
22 Q_OBJECT
23public:
24 explicit SchemaGraphicObject ( QString & ClassName,
26 QGraphicsObject * parent = nullptr );
28
29 [[nodiscard]] dunedaq::oks::OksClass * GetClass() const;
30 [[nodiscard]] QString GetClassName() const;
31 void GetInfo();
34 [[nodiscard]] QRectF boundingRect() const override;
35 [[nodiscard]] QPainterPath shape() const override;
36 void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option,
37 QWidget * widget ) override;
41 void RemoveArrows();
42 bool HasArrow ( SchemaGraphicObject * Dest ) const;
43 void update_arrows();
44protected:
45 QVariant itemChange ( GraphicsItemChange change, const QVariant & value );
46 void hoverEnterEvent ( QGraphicsSceneHoverEvent* ev );
47 void hoverLeaveEvent ( QGraphicsSceneHoverEvent* ev );
48 void mouseDoubleClickEvent ( QGraphicsSceneMouseEvent* ev );
49private:
50 void set_font();
54 QStringList m_class_attributes;
56 QStringList m_class_methods;
58
62
64 bool m_highlight_active{false};
65 bool m_highlight_class{false};
66 QFont m_font;
68
71 QList<SchemaGraphicSegmentedArrow *> m_arrows;
72private slots:
73 void UpdateObject ( QString Name );
74 void RemoveObject ( QString Name );
75};
76
77} // namespace dbse
78#endif // SCHEMAGRAPHICOBJECT_H
void AddArrow(SchemaGraphicSegmentedArrow *Arrow)
Arrow API.
QList< SchemaGraphicSegmentedArrow * > m_arrows
QPainterPath shape() const override
void hoverLeaveEvent(QGraphicsSceneHoverEvent *ev)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
void RemoveArrow(SchemaGraphicSegmentedArrow *Arrow)
SchemaGraphicObject(QString &ClassName, SchemaGraphicsScene *scene, QGraphicsObject *parent=nullptr)
void hoverEnterEvent(QGraphicsSceneHoverEvent *ev)
QVariant itemChange(GraphicsItemChange change, const QVariant &value)
void toggle_highlight_class()
Graphic API.
dunedaq::oks::OksClass * GetClass() const
QRectF boundingRect() const override
dunedaq::oks::OksClass * m_class_info
SchemaGraphicsScene * m_scene
bool HasArrow(SchemaGraphicObject *Dest) const
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *ev)
The OKS class.
Definition class.hpp:200
Including QT Headers.