Package adaptlil.data_classes
Class BestPointOfGaze
java.lang.Object
adaptlil.data_classes.BestPointOfGaze
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBestPointOfGaze
(double x, double y, boolean isValid) Construct BestPointofGaze data class object. -
Method Summary
Modifier and TypeMethodDescriptionstatic BestPointOfGaze
getBestPointOfGaze
(int bpogxIndex, int bpogyIndex, int bpogvIndex, String[] cells) Constructs BestPointOfGaze Object through the strings of an array.double
getX()
Gets the X coordinate for the best point of gaze (where the user is looking on the screen)double
getY()
Gets the Y coordinate for the best point of gaze (where the user is looking on the screen)interpolate
(BestPointOfGaze firstBestPointOfGaze, BestPointOfGaze nextBestPointOfGaze, int nSteps) Performs Linear interpolation nSteps BestPointOfGaze elements between the first BestPointofGaze and the next BestPointofGazeboolean
isValid()
Flag set by gazepoint to signal the BestPointOfGaze packet is corrupted.void
setValid
(boolean valid) Set to true to signal there is an issue with BestPointOfGaze packet.void
setX
(double x) Set the x coordinate of best point of gaze.void
setY
(double y) Set the Y coordinate of best point of gaze.
-
Field Details
-
x
private double x -
y
private double y -
isValid
private boolean isValid
-
-
Constructor Details
-
BestPointOfGaze
public BestPointOfGaze() -
BestPointOfGaze
public BestPointOfGaze(double x, double y, boolean isValid) Construct BestPointofGaze data class object. Best point of gaze is the area between where the left and right eye are looking. If only the left eye is available this object will represent the left eye and vice versa for the right eye.- Parameters:
x
-y
-isValid
-
-
-
Method Details
-
getBestPointOfGaze
public static BestPointOfGaze getBestPointOfGaze(int bpogxIndex, int bpogyIndex, int bpogvIndex, String[] cells) Constructs BestPointOfGaze Object through the strings of an array. In this case, an excel line.- Parameters:
bpogxIndex
-bpogyIndex
-bpogvIndex
-cells
-- Returns:
-
interpolate
public BestPointOfGaze[] interpolate(BestPointOfGaze firstBestPointOfGaze, BestPointOfGaze nextBestPointOfGaze, int nSteps) Performs Linear interpolation nSteps BestPointOfGaze elements between the first BestPointofGaze and the next BestPointofGaze- Parameters:
firstBestPointOfGaze
-nextBestPointOfGaze
-nSteps
- Number of BestPointofGaze packets to interpolate between.- Returns:
-
getX
public double getX()Gets the X coordinate for the best point of gaze (where the user is looking on the screen)- Returns:
- returns scale [0-1] where 0.5 represents the middle of the screen on the x axis
-
setX
public void setX(double x) Set the x coordinate of best point of gaze.- Parameters:
x
- Keep within range 0-1.
-
getY
public double getY()Gets the Y coordinate for the best point of gaze (where the user is looking on the screen)- Returns:
- returns scale [0-1] where 0.5 represents the middle of the screen on the Y axis.
-
setY
public void setY(double y) Set the Y coordinate of best point of gaze.- Parameters:
y
- Keep within range 0-1.
-
isValid
public boolean isValid()Flag set by gazepoint to signal the BestPointOfGaze packet is corrupted.- Returns:
-
setValid
public void setValid(boolean valid) Set to true to signal there is an issue with BestPointOfGaze packet.
-