graph_analysis
VertexItemSimple.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_GUI_VERTEXITEMSIMPLE_HPP
2 #define GRAPH_ANALYSIS_GUI_VERTEXITEMSIMPLE_HPP
3 
4 #include "VertexItemBase.hpp"
5 
6 namespace graph_analysis {
7 namespace gui {
8 
15 {
16  friend class VertexItemTypeManager;
17 
18 protected:
20 
21 public:
22  VertexItemSimple(GraphWidget* graphWidget,
23  const graph_analysis::Vertex::Ptr& vertex,
24  QGraphicsItem* parent);
25 
26  virtual ~VertexItemSimple();
27 
28  virtual int type() const
29  {
30  return VertexItemSimpleType;
31  };
32 
37  virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value);
38 
42  void setDebug(bool debug) { mDebug = debug; }
43 
44 protected:
49  void dragEnterEvent(QGraphicsSceneDragDropEvent* event);
50  void dragLeaveEvent(QGraphicsSceneDragDropEvent* event);
51  void dropEvent(QGraphicsSceneDragDropEvent* event);
52  void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event);
53 
54  void hoverEnterEvent(QGraphicsSceneHoverEvent* event);
55  void hoverLeaveEvent(QGraphicsSceneHoverEvent* event);
56 
57 
59  const graph_analysis::Vertex::Ptr& vertex,
60  QGraphicsItem* parent) const;
61 
62 private:
63  bool mDebug;
64 
65  QGraphicsTextItem* mpLabel;
66  QGraphicsTextItem* mpClassName;
67  QGraphicsTextItem* mpCoordinate;
68  QGraphicsRectItem* mpRect;
69 
71  QString getScenePosAsString() const;
72 };
73 
74 } // end namespace gui
75 } // end namespace graph_analysis
76 #endif // GRAPH_ANALYSIS_GUI_VERTEXITEMSIMPLE_HPP
graph_analysis::gui::VertexItemTypeManager
factory for VertexItem-s: clones different types of VertexItem instances (i.e. graphical vertexs)
Definition: VertexItemTypeManager.hpp:28
graph_analysis::gui::VertexItemSimple::setDebug
void setDebug(bool debug)
Definition: VertexItemSimple.hpp:42
graph_analysis::gui::VertexItemSimple::dragLeaveEvent
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
Definition: VertexItemSimple.cpp:123
graph_analysis::gui::VertexItemSimple::VertexItemSimple
VertexItemSimple()
Definition: VertexItemSimple.cpp:15
graph_analysis::gui::VertexItemSimple::mouseDoubleClickEvent
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
Definition: VertexItemSimple.cpp:157
graph_analysis
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
graph_analysis::gui::VertexItemSimple::type
virtual int type() const
Definition: VertexItemSimple.hpp:28
graph_analysis::gui::VertexItemSimple::~VertexItemSimple
virtual ~VertexItemSimple()
Definition: VertexItemSimple.cpp:81
graph_analysis::gui::VertexItemSimple::hoverLeaveEvent
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Definition: VertexItemSimple.cpp:228
graph_analysis::gui::VertexItemSimpleType
@ VertexItemSimpleType
Definition: GraphicsItemTypes.hpp:14
VertexItemBase.hpp
graph_analysis::gui::VertexItemSimple::createNewItem
VertexItemBase * createNewItem(GraphWidget *graphWidget, const graph_analysis::Vertex::Ptr &vertex, QGraphicsItem *parent) const
Definition: VertexItemSimple.cpp:233
graph_analysis::Vertex::Ptr
shared_ptr< Vertex > Ptr
Definition: Vertex.hpp:22
graph_analysis::gui::VertexItemSimple::dropEvent
void dropEvent(QGraphicsSceneDragDropEvent *event)
Definition: VertexItemSimple.cpp:128
graph_analysis::gui::VertexItemSimple::hoverEnterEvent
void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Definition: VertexItemSimple.cpp:223
graph_analysis::gui::VertexItemSimple::itemChange
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Definition: VertexItemSimple.cpp:197
graph_analysis::gui::GraphWidget
Base-class for visual representations of a "Graph" in this framework.
Definition: GraphWidget.hpp:26
graph_analysis::gui::VertexItemSimple::dragEnterEvent
void dragEnterEvent(QGraphicsSceneDragDropEvent *event)
Definition: VertexItemSimple.cpp:93
graph_analysis::gui::VertexItemSimple
Definition: VertexItemSimple.hpp:14
graph_analysis::gui::VertexItemBase
graphical node representation interface
Definition: VertexItemBase.hpp:26