Ground-Truthing GUI 1.0

- Main Page
- Related Pages
- Classes
- Files

- File List

addiconpicture.h
1
24 #ifndef ADDICONPICTURE
25 #define ADDICONPICTURE
26
27 #include <QGraphicsScene>
28 #include <QImage>
29 #include <QGraphicsPixmapItem>
30 #include <QPixmap>
31 #include <QPointF>
32 #include <rectangledraw.h>
33
34 class AddIconPicture{
35
36 private:
37
38 // The application scene
39 QGraphicsScene *scene;
40
41 // The image the user wants to work with
42 QImage *image;
43
44 // The little icon which indicates if the user
45 // has annotated one rectangle or not
46 QGraphicsPixmapItem *item;
47
48 public:
49
50
55 AddIconPicture(QGraphicsScene *scene_1,RectangleDraw *rectangle):scene(scene_1){
56
57 image= new QImage("../Icons/annotation.png");
58 item= new QGraphicsPixmapItem(QPixmap::fromImage(*image));
59 item->setPos(rectangle->rect().topLeft());
60 scene->addItem(item);
61 rectangle->setItem(item);
62 }
63
67 virtual QGraphicsPixmapItem* getItem()const;
68 };
69
70 #endif // ADDICONPICTURE
71
AddIconPicture::getItem
virtual QGraphicsPixmapItem * getItem() const
Return the little item which is associated to a rectangle when it is annotated.
Definition: addiconpicture.cpp:3
AddIconPicture::AddIconPicture
AddIconPicture(QGraphicsScene *scene_1, RectangleDraw *rectangle)
The constructor of the AddIconPicture class.
Definition: addiconpicture.h:55
AddIconPicture
Adds an icon at the top-left corner of a rectangle.
Definition: addiconpicture.h:34
RectangleDraw
Describes a rectangle drawn by the user.
Definition: rectangledraw.h:34
RectangleDraw::setItem
virtual void setItem(QGraphicsPixmapItem *item)
Sets the little icon which indicats if the user has annotatted the rectangle.
Definition: rectangledraw.cpp:61