1 #ifndef __PIPELINEEDITOR__NODE__H__
2 #define __PIPELINEEDITOR__NODE__H__
7 #include <QGraphicsItem>
14 // Some forward declarations
15 class QGraphicsSceneMouseEvent;
16 class QGraphicsSceneHoverEvent;
18 // Some forward declarations
27 namespace PipelineEditor
29 // Some other forward declarations
36 : public QGraphicsItem
39 Node( GraphCanvas* canvas, cpPlugins::Interface::Object* object );
42 void addEdge( Edge* edge );
43 QList< Edge* > edges( ) const;
45 void updateRepresentation( );
47 QRectF boundingRect( ) const;
48 QPainterPath shape( ) const;
51 const QStyleOptionGraphicsItem* option,
54 void moveBy(qreal dx, qreal dy)
56 std::cout << "move: " << dx << " " << dy << std::endl;
57 this->QGraphicsItem::moveBy( dx, dy );
61 QVariant itemChange( GraphicsItemChange change, const QVariant& value );
63 void mousePressEvent( QGraphicsSceneMouseEvent* event );
64 void mouseReleaseEvent( QGraphicsSceneMouseEvent* event );
65 void mouseDoubleClickEvent( QGraphicsSceneMouseEvent* event );
66 void hoverMoveEvent( QGraphicsSceneHoverEvent* event );
67 void hoverLeaveEvent( QGraphicsSceneHoverEvent* event );
68 void dragMoveEvent( QGraphicsSceneDragDropEvent* event );
69 void dragLeaveEvent( QGraphicsSceneDragDropEvent* event );
70 void dropEvent( QGraphicsSceneDragDropEvent* event );
72 void _selectPort( const QPointF& pos );
73 void _deselectPort( );
76 GraphCanvas* m_Canvas;
77 QList< Edge* > m_Edges;
78 cpPlugins::Interface::Object* m_Object;
83 std::set< std::string > m_Inputs;
84 std::set< std::string > m_Outputs;
85 std::map< std::string, QRectF > m_InputPorts;
86 std::map< std::string, QRectF > m_OutputPorts;
88 // Interaction objects
89 const QRectF* m_SelectedPort;
90 bool m_SelectedPortIsInput;
96 #endif // __PIPELINEEDITOR__NODE__H__