forked from liamnegron3/COP3530_Project3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspeciesnode.h
More file actions
45 lines (33 loc) · 1.15 KB
/
Copy pathspeciesnode.h
File metadata and controls
45 lines (33 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef SPECIESNODE_H
#define SPECIESNODE_H
#include <QPainter>
#include <QGraphicsItem>
#include <QDebug>
#include "TaxonomyGraph.h"
class SpeciesNode : public QGraphicsItem
{
public:
SpeciesNode();
SpeciesNode(QString _commonName, QString _scientificName);
//used to draw lines between nodes
void addEdge(QGraphicsLineItem *line,QGraphicsPolygonItem *arrowItem, bool isPoint1);
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
void moveLineToCenter(QPointF newPos,QGraphicsLineItem *line,QGraphicsPolygonItem *arrowItem, bool isParent);
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private:
bool pressed;
QString commonName;
QString scientificName;
vector<QGraphicsLineItem*> lines;
vector<QGraphicsPolygonItem*> arrowItems;
//QGraphicsLineItem *line;
//QGraphicsPolygonItem *arrowItem;
//is parent
vector<bool> isParent;
//bool isParent;
};
#endif // SPECIESNODE_H