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 <QColor>
6#include <QFont>
7#include <QGraphicsObject>
8#include <QGraphicsSceneHoverEvent>
9#include <QPen>
10
12#include "oks/class.hpp"
13
14namespace dbse {
15
18
19class SchemaGraphicObject : public QGraphicsObject
20{
21 Q_OBJECT
22public:
23 explicit SchemaGraphicObject(QString& ClassName, SchemaGraphicsScene* scene, QGraphicsObject* parent = nullptr);
25
26 [[nodiscard]] dunedaq::oks::OksClass* GetClass() const;
27 [[nodiscard]] QString GetClassName() const;
28 void GetInfo();
31 [[nodiscard]] QRectF boundingRect() const override;
32 [[nodiscard]] QPainterPath shape() const override;
33 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
37 void RemoveArrows();
38 bool HasArrow(SchemaGraphicObject* Dest) const;
39 void update_arrows();
40 bool highlighted() const { return m_highlight_class; };
41
42protected:
43 QVariant itemChange(GraphicsItemChange change, const QVariant& value);
44 void hoverEnterEvent(QGraphicsSceneHoverEvent* ev);
45 void hoverLeaveEvent(QGraphicsSceneHoverEvent* ev);
46 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev);
47
48private:
49 void set_font();
53 QStringList m_class_attributes;
55 QStringList m_class_methods;
57
61
63 bool m_highlight_active{ false };
64 bool m_highlight_class{ false };
65 QFont m_font;
67
70 QList<SchemaGraphicSegmentedArrow*> m_arrows;
71private slots:
72 void UpdateObject(QString Name);
73 void RemoveObject(QString Name);
74};
75
76} // namespace dbse
77#endif // SCHEMAGRAPHICOBJECT_H
void AddArrow(SchemaGraphicSegmentedArrow *Arrow)
Arrow API.
QPainterPath shape() const override
void hoverLeaveEvent(QGraphicsSceneHoverEvent *ev)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
void RemoveArrow(SchemaGraphicSegmentedArrow *Arrow)
QList< SchemaGraphicSegmentedArrow * > m_arrows
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:223
Including QT Headers.