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
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();
44 bool highlighted() const {return m_highlight_class;};
45protected:
46 QVariant itemChange ( GraphicsItemChange change, const QVariant & value );
47 void hoverEnterEvent ( QGraphicsSceneHoverEvent* ev );
48 void hoverLeaveEvent ( QGraphicsSceneHoverEvent* ev );
49 void mouseDoubleClickEvent ( QGraphicsSceneMouseEvent* ev );
50private:
51 void set_font();
55 QStringList m_class_attributes;
57 QStringList m_class_methods;
59
63
65 bool m_highlight_active{false};
66 bool m_highlight_class{false};
67 QFont m_font;
69
72 QList<SchemaGraphicSegmentedArrow *> m_arrows;
73private slots:
74 void UpdateObject ( QString Name );
75 void RemoveObject ( QString Name );
76};
77
78} // namespace dbse
79#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:205
Including QT Headers.