Ground-Truthing GUI 1.0

- Main Page
- Related Pages
- Classes
- Files

- File List

filereader.h
1
22 #ifndef FILEREADER
23 #define FILEREADER
24
25 #include "QTextStream"
26 #include "extractinformation.h"
27 #include "rectangledraw.h"
28 #include "image.h"
29
30 #include <QDebug>
31 #include <QFile>
32 #include <QList>
33 #include <QPointF>
34
35 class FileReader{
36
37 private:
38
39
40 // The input text stream from the file
41 QTextStream *inStream;
42
43 // The line in the text file we want to extract the information
44 QString line;
45
46 // The file attached to the image containing all the information
47 QFile *file;
48
49 // The list which will contain the rectangles
50 QList<RectangleDraw*> list;
51
52 // The rectangle described by all the information we have extracted from the text file
53 RectangleDraw *rect;
54
55 // The image filepath
56 QString image_path;
57
58 // The image associated to the file
59 Image *image;
60
61 public:
62
66 FileReader(QString file_path):image_path("NULL"),image(NULL)
67 {
68 //list=new QList;
69 file=new QFile(file_path);
70 inStream=new QTextStream(file);
71 }
72
76 virtual QString readFile();
77
81 virtual QList<RectangleDraw *> getList()const;
82
86 virtual QString getImagePath()const;
87
91 virtual Image* getImage()const;
92 };
93
94 #endif // FILEREADER
95
FileReader::getImagePath
virtual QString getImagePath() const
Returns the image filepath written in the file.
Definition: filereader.cpp:65
Image
Inherits the QPixmap class.
Definition: image.h:32
FileReader::getImage
virtual Image * getImage() const
Returns the image.
Definition: filereader.cpp:69
FileReader::FileReader
FileReader(QString file_path)
The constructor of the FileReader class.
Definition: filereader.h:66
RectangleDraw
Describes a rectangle drawn by the user.
Definition: rectangledraw.h:34
FileReader
Reads the text file content.
Definition: filereader.h:35
FileReader::readFile
virtual QString readFile()
Reads one line of the file and returns it.
Definition: filereader.cpp:5
FileReader::getList
virtual QList< RectangleDraw * > getList() const
Returns a list of all the rectangles described in the text file.
Definition: filereader.cpp:61