27 #include <QGraphicsScene> 29 #include <QMouseEvent> 31 #include <QGraphicsSceneMouseEvent> 34 #include <QGraphicsRectItem> 36 #include <QGraphicsView> 39 #include "filewriter.h" 40 #include "createfileabstraction.h" 41 #include "rectangledraw.h" 42 #include "rectanglewindow.h" 43 #include "removeconfirmationwindow.h" 44 #include "filereader.h" 45 #include "removeconfirmationwindow.h" 57 QPixmap *erase_pixmap;
60 QPixmap *modify_pixmap;
63 QRectF sceneRectangle;
73 QList<RectangleDraw*> list;
86 bool mouseLeftPressed;
113 bool isOnTopLeftCornerPressed;
114 bool isOnTopRightCornerPressed;
115 bool isOnBottomLeftCornerPressed;
116 bool isOnBottomRightCornerPressed;
128 QCursor *erase_cursor;
131 QCursor *modify_cursor;
145 sceneRectangle(sceneRectangle_1),pixmap(pixmap_1),mouseLeftPressed(false),
146 createfileabstraction(cfa_1),rect(NULL),id(0),UserPoint(0,0),window(NULL),drawButton(false),eraseButton(false),
147 dragButton(false),doubleClick(true),view(view_1),modifyButton(false),isSelected(false),
148 rectModified(NULL),isOnCorner(false),isOnTopLeftCornerPressed(false),isOnTopRightCornerPressed(false),
149 isOnBottomLeftCornerPressed(false),isOnBottomRightCornerPressed(false),startModifying(false),remove(NULL)
152 filewriter=
new FileWriter(createfileabstraction);
158 this->setSceneRect(sceneRectangle);
161 this->addPixmap(*pixmap);
164 erase_pixmap=
new QPixmap(
"../Icons/cursor_erase.png");
167 modify_pixmap=
new QPixmap(
"../Icons/pencil.png");
170 erase_cursor=
new QCursor(*erase_pixmap);
173 modify_cursor=
new QCursor(*modify_pixmap);
238 virtual QList<RectangleDraw*>
getList()
const;
243 virtual void setList(QList<RectangleDraw*> list_1);
248 virtual void setId(
int id);
325 #endif // DRAWRECTANGLE virtual void setDoubleClick(bool value)
Deprecated. Will be removed in a future release.
Definition: imagegraphicsscene.cpp:449
virtual void setId(int id)
Sets the rectangle ID.
Definition: imagegraphicsscene.cpp:501
virtual QList< RectangleDraw * > getList() const
Returns a list of all the rectangles in the scene.
Definition: imagegraphicsscene.cpp:481
virtual void setModify(bool state)
Deprecated. Will be remove in a future release.
Definition: imagegraphicsscene.cpp:469
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
Deprecated. Will be removed in a future release.
Definition: imagegraphicsscene.cpp:118
virtual void setEraseButton(bool value)
Sets the state of the erase icon.
Definition: imagegraphicsscene.cpp:436
virtual QCursor * getModifyCursor() const
Returns the shape of the Modify cursor.
Definition: imagegraphicsscene.cpp:477
virtual void setList(QList< RectangleDraw * > list_1)
Sets the list of the rectangles drawn in th scene.
Definition: imagegraphicsscene.cpp:497
virtual bool Iscontaining(RectangleDraw *rectangle, QPointF point) const
Checks if the user is pressing on one rectangle.
Definition: imagegraphicsscene.cpp:415
The window asking for the user confirmation when he wants to delete a rectangle.
Definition: removeconfirmationwindow.h:36
Creates a text file related to an image.
Definition: createfileabstraction.h:34
virtual FileWriter * getFileWriter() const
Returns the FileWriter object.
Definition: imagegraphicsscene.cpp:485
void mousePressEvent(QGraphicsSceneMouseEvent *event)
Detects when the user presses one button of the mouse.
Definition: imagegraphicsscene.cpp:3
virtual void setCreateFileAbstraction(CreateFileAbstraction *createfileabstraction_1)
Sets the text file associated to the image.
Definition: imagegraphicsscene.cpp:505
virtual bool getDoubleClick() const
Deprecated method. Will be removed in the future release.
Definition: imagegraphicsscene.cpp:453
virtual bool checkModify() const
Checks if we are in the "Modify" mode or not.
Definition: imagegraphicsscene.cpp:465
virtual QCursor * getEraseCursor() const
Returns the shape of the erase cursor.
Definition: imagegraphicsscene.cpp:473
virtual void setFileWriter(FileWriter *filewriter_1)
Sets the FielWriter object.
Definition: imagegraphicsscene.cpp:509
ImageGraphicsScene(QGraphicsView *view_1, QPixmap *pixmap_1, QRectF sceneRectangle_1, CreateFileAbstraction *cfa_1)
The constructor of the ImageGraphicsScene class.
Definition: imagegraphicsscene.h:144
virtual void setDrawButton(bool value)
Sets the state of the draw icon.
Definition: imagegraphicsscene.cpp:431
void changeCursor(bool value)
Deprecated signal. Will be deleted in a future release.
virtual CreateFileAbstraction * getCreateFileAbstraction() const
Returns the text file.
Definition: imagegraphicsscene.cpp:493
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Detects when the user releases one button of the mouse.
Definition: imagegraphicsscene.cpp:388
Displays the rectangles and work on the image.
Definition: imagegraphicsscene.h:47
Write in a text file.
Definition: filewriter.h:28
The annotation window.
Definition: rectanglewindow.h:42
Describes a rectangle drawn by the user.
Definition: rectangledraw.h:34
virtual bool getDrawButton() const
Returns the state of the draw icon.
Definition: imagegraphicsscene.cpp:441
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Detects when the user moves his mouse all around the scene.
Definition: imagegraphicsscene.cpp:146
virtual bool getDragButton() const
Returns the state of the drag icon.
Definition: imagegraphicsscene.cpp:461
virtual void setDragButton(bool value)
Sets the state of the drag icon.
Definition: imagegraphicsscene.cpp:457
virtual int checkMousePress(QPointF point)
Checks if the mouse is pressing one of the rectangle corners when we are in the "Modify" mode...
Definition: imagegraphicsscene.cpp:319
virtual void setIsSelected(bool state)
Deprecated. Will be removed in a future release.
Definition: imagegraphicsscene.cpp:489
virtual bool getEraseButton() const
Returns the state of the erase icon.
Definition: imagegraphicsscene.cpp:445
virtual int checkMouseMove(QPointF point)
Checks if the mouse is around one of the rectangle corners when we are in the "Modify" mode...
Definition: imagegraphicsscene.cpp:251
virtual ~ImageGraphicsScene()
Class destructor.
Definition: imagegraphicsscene.h:178