Ground-Truthing GUI 1.0

- Main Page
- Related Pages
- Classes
- Files

- File List

rectangledraw.h
1
22 #ifndef RECTANGLEDRAW
23 #define RECTANGLEDRAW
24
25 #include <QGraphicsRectItem>
26 #include <QPointF>
27 #include <QGraphicsPixmapItem>
28 #include <QDebug>
29 #include <QGraphicsSceneMouseEvent>
30 #include <QGraphicsSceneHoverEvent>
31 #include <QGraphicsSceneDragDropEvent>
32 #include <QGraphicsItem>
33
34 class RectangleDraw:public QGraphicsRectItem{
35
36 private:
37
38 // The rectangle id
39 int id;
40
41 // Top-Left point coordinates
42 QPointF point;
43
44 // The line number
45 QString lineNumber;
46
47 // The word number in the line
48 QString wordNumber;
49
50 // Create the annotation
51 QString annotation;
52
53 // The annotation icon
54 QGraphicsPixmapItem *item;
55
56 // The top-right point
57 QPointF topRight;
58
59 // The bottom-right point
60 QPointF bottomRight;
61
62 // The bottom-left point
63 QPointF bottomLeft;
64
65 // Get the QRectF object
66 QRectF rectF;
67
68 // The width of the rectangle
69 int width;
70
71 // The height of the rectangle
72 int height;
73
74 // Checks if the user wants to delete really one rectangle
75 bool checkDelete;
76
77 public:
78
81 RectangleDraw():id(0),point(0,0),item(NULL),topRight(0,0),bottomRight(0,0),bottomLeft(0,0),rectF(0,0,0,0),
82 height(0),width(0),annotation("Insert your annotation"),wordNumber("0"),lineNumber("0"),checkDelete(false)
83 {
84 //this->setFlag(QGraphicsItem::ItemIsSelectable,false);
85 this->setFlag(QGraphicsItem::ItemSendsGeometryChanges,false);
86 }
87
91 virtual int getId() const;
92
96 virtual void setId(int id);
97
101 virtual QPointF getPoint()const;
102
106 virtual void setPoint(QPointF point);
107
111 virtual QString getLineNumber() const;
112
116 virtual void setLineNumber(QString lineNumber);
117
121 virtual void setWordNumber(QString word);
122
126 virtual QString getWordNumber() const;
127
131 virtual QString getAnnotation() const;
132
136 virtual QPointF getTopRight();
137
141 virtual void setTopRight(QPointF point);
142
146 virtual QPointF getBottomRight();
147
151 virtual void setBottomRight(QPointF point);
152
156 virtual QPointF getBottomLeft();
157
161 virtual void setBottomLeft(QPointF point);
162
166 virtual void setAnnotation(QString annotation);
167
171 virtual QGraphicsPixmapItem* getItem()const;
172
176 virtual void setItem(QGraphicsPixmapItem *item);
177
180 virtual void adjustSize(int x, int y);
181
185 virtual void setRectF(QRectF rect);
186
190 virtual QRectF getRectF()const;
191
195 virtual void setCheckDelete(bool checkDelete_1);
196
200 virtual bool getCheckDelete()const;
201 };
202
203 #endif // RECTANGLEDRAW
204
RectangleDraw::getWordNumber
virtual QString getWordNumber() const
Returns the word number inserted by the user.
Definition: rectangledraw.cpp:51
RectangleDraw::setTopRight
virtual void setTopRight(QPointF point)
Sets the Top-Right point coordinates.
Definition: rectangledraw.cpp:75
RectangleDraw::getItem
virtual QGraphicsPixmapItem * getItem() const
Returns the little icon which indicates if the rectangle has been annotated or not.
Definition: rectangledraw.cpp:56
RectangleDraw::getLineNumber
virtual QString getLineNumber() const
Returns the line number inserted by the user.
Definition: rectangledraw.cpp:26
RectangleDraw::RectangleDraw
RectangleDraw()
The constructor of the RectangleDraw class.
Definition: rectangledraw.h:81
RectangleDraw::setPoint
virtual void setPoint(QPointF point)
Sets the Top-Left point coordinates.
Definition: rectangledraw.cpp:20
RectangleDraw::getRectF
virtual QRectF getRectF() const
Returns the rectangle coordinates.
Definition: rectangledraw.cpp:120
RectangleDraw::setAnnotation
virtual void setAnnotation(QString annotation)
Sets the comment inserted by the user.
Definition: rectangledraw.cpp:41
RectangleDraw::setCheckDelete
virtual void setCheckDelete(bool checkDelete_1)
Sets the state of the variable checking if the user wants to delete the rectangel.
Definition: rectangledraw.cpp:125
RectangleDraw::setLineNumber
virtual void setLineNumber(QString lineNumber)
Sets the line number inserted by the user.
Definition: rectangledraw.cpp:31
RectangleDraw::setId
virtual void setId(int id)
Sets the rectangle id.
Definition: rectangledraw.cpp:10
RectangleDraw::getBottomRight
virtual QPointF getBottomRight()
Returns the Bottom-Right point coordinates.
Definition: rectangledraw.cpp:80
RectangleDraw::getPoint
virtual QPointF getPoint() const
Returns the Top-Left point coordinates.
Definition: rectangledraw.cpp:15
RectangleDraw::setRectF
virtual void setRectF(QRectF rect)
Sets the rectangle coordinates.
Definition: rectangledraw.cpp:115
RectangleDraw::getBottomLeft
virtual QPointF getBottomLeft()
Returns the Bottom-Left point coordianates.
Definition: rectangledraw.cpp:95
RectangleDraw::adjustSize
virtual void adjustSize(int x, int y)
Deprecated method. Will be remove in a future release.
Definition: rectangledraw.cpp:109
RectangleDraw::getId
virtual int getId() const
Returns the rectangle ID.
Definition: rectangledraw.cpp:5
RectangleDraw::setWordNumber
virtual void setWordNumber(QString word)
Sets the word number inserted by the user.
Definition: rectangledraw.cpp:46
RectangleDraw
Describes a rectangle drawn by the user.
Definition: rectangledraw.h:34
RectangleDraw::getTopRight
virtual QPointF getTopRight()
Returns Top-Right point coordinates.
Definition: rectangledraw.cpp:66
RectangleDraw::setItem
virtual void setItem(QGraphicsPixmapItem *item)
Sets the little icon which indicats if the user has annotatted the rectangle.
Definition: rectangledraw.cpp:61
RectangleDraw::getAnnotation
virtual QString getAnnotation() const
Returns the comment inserted by the user.
Definition: rectangledraw.cpp:36
RectangleDraw::setBottomRight
virtual void setBottomRight(QPointF point)
Sets Bottom-Right point coordinates.
Definition: rectangledraw.cpp:90
RectangleDraw::setBottomLeft
virtual void setBottomLeft(QPointF point)
Sets the Bottom-Left point coordinates.
Definition: rectangledraw.cpp:104
RectangleDraw::getCheckDelete
virtual bool getCheckDelete() const
Check if the user wants to delete the rectangle or not.
Definition: rectangledraw.cpp:130