Commit 89fa6a22 authored by Thiago Santini's avatar Thiago Santini

Refactors InputData and derived classes

Use initialization directly instead of assignment later on
parent 2d7639a2
......@@ -41,12 +41,12 @@
class EyeData : public InputData {
public:
explicit EyeData(){
timestamp = 0;
input = cv::Mat();
pupil = Pupil();
validPupil = false;
processingTimestamp = 0;
explicit EyeData() :
InputData(),
input(),
pupil(),
validPupil(false)
{
}
cv::Mat input;
......
......@@ -52,19 +52,18 @@ public:
class FieldData : public InputData {
public:
explicit FieldData(){
timestamp = 0;
input = cv::Mat();
gazeEstimate = cv::Point3f(0,0,0);
validGazeEstimate = false;
extrapolatedGazeEstimate = 0;
markers = std::vector<Marker>();
collectionMarker = Marker();
undistorted = false;
width = 0;
height = 0;
processingTimestamp = 0;
}
explicit FieldData() :
InputData(),
input(),
gazeEstimate(0,0,0),
validGazeEstimate(false),
extrapolatedGazeEstimate(0),
markers(),
collectionMarker(),
undistorted(false),
width(0),
height(0)
{}
cv::Mat input;
cv::Point3f gazeEstimate;
bool validGazeEstimate;
......
......@@ -10,7 +10,7 @@ public:
// (e.g., Left Eye, Right Eye) and make the synchronizer generic
// (i.e., taking InputData and operating over a vector of these).
// This would allow us to dynamically add input widgets
InputData() {
explicit InputData() {
timestamp = maxTimestamp;
processingTimestamp = maxTimestamp;
}
......
......@@ -6,7 +6,7 @@
QElapsedTimer gTimer;
Timestamp maxTimestamp = std::numeric_limits<qint64>::max();
const Timestamp maxTimestamp = std::numeric_limits<qint64>::max();
QString gExeDir;
QString gCfgDir;
......
......@@ -33,7 +33,7 @@ Q_DECLARE_METATYPE(QCameraInfo)
extern QElapsedTimer gTimer;
typedef qint64 Timestamp;
extern Timestamp maxTimestamp;
extern const Timestamp maxTimestamp;
Q_DECLARE_METATYPE(Timestamp)
extern QString gExeDir;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment