|
@@ -34,6 +34,10 @@ namespace SketchAssistantWPF
|
|
/*** CLASS VARIABLES ***/
|
|
/*** CLASS VARIABLES ***/
|
|
/***********************/
|
|
/***********************/
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// this is a variable used for detecting whether the tracker is in the warning zone (0 +- variable), no drawing zone (0 +- 2 * variable) or normal drawing zone
|
|
|
|
+ /// </summary>
|
|
|
|
+ readonly double WARNING_ZONE_BOUNDARY = 0.10; //10cm
|
|
/// <summary>
|
|
/// <summary>
|
|
/// If the program is in drawing mode.
|
|
/// If the program is in drawing mode.
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -127,10 +131,6 @@ namespace SketchAssistantWPF
|
|
/// </summary>
|
|
/// </summary>
|
|
private bool optiTrackInsideDrawingZone = false;
|
|
private bool optiTrackInsideDrawingZone = false;
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// this is a variable used for detecting whether the tracker is in the warning zone (0 +- variable), no drawing zone (0 +- 2 * variable) or normal drawing zone
|
|
|
|
- /// </summary>
|
|
|
|
- private double WARNING_ZONE_BOUNDARY = 0.10; //10cm
|
|
|
|
- /// <summary>
|
|
|
|
/// object of class wristband used for controlling the vibrotactile wristband
|
|
/// object of class wristband used for controlling the vibrotactile wristband
|
|
/// </summary>
|
|
/// </summary>
|
|
private Wristband wristband;
|
|
private Wristband wristband;
|
|
@@ -246,7 +246,7 @@ namespace SketchAssistantWPF
|
|
if(PathTraveled > 2)
|
|
if(PathTraveled > 2)
|
|
{
|
|
{
|
|
PathTraveled = 0;
|
|
PathTraveled = 0;
|
|
- //Activate vibration here
|
|
|
|
|
|
+ //TODO: Activate vibration here
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -352,6 +352,7 @@ namespace SketchAssistantWPF
|
|
|
|
|
|
if (optiCursorPositions.Count > 0) { previousOptiCursorPosition = optiCursorPositions.Dequeue(); }
|
|
if (optiCursorPositions.Count > 0) { previousOptiCursorPosition = optiCursorPositions.Dequeue(); }
|
|
else { previousOptiCursorPosition = currentOptiCursorPosition; }
|
|
else { previousOptiCursorPosition = currentOptiCursorPosition; }
|
|
|
|
+ optiCursorPositions.Enqueue(currentOptiCursorPosition);
|
|
}
|
|
}
|
|
|
|
|
|
/********************************************/
|
|
/********************************************/
|
|
@@ -361,9 +362,8 @@ namespace SketchAssistantWPF
|
|
/// <summary>
|
|
/// <summary>
|
|
/// A function to update the dimensions of the left and right canvas when the window is resized.
|
|
/// A function to update the dimensions of the left and right canvas when the window is resized.
|
|
/// </summary>
|
|
/// </summary>
|
|
- /// <param name="LeftCanvas">The size of the left canvas.</param>
|
|
|
|
/// <param name="RightCanvas">The size of the right canvas.</param>
|
|
/// <param name="RightCanvas">The size of the right canvas.</param>
|
|
- public void ResizeEvent(ImageDimension LeftCanvas, ImageDimension RightCanvas)
|
|
|
|
|
|
+ public void ResizeEvent(ImageDimension RightCanvas)
|
|
{
|
|
{
|
|
if (RightCanvas.Height >= 0 && RightCanvas.Width >= 0) { rightImageSize = RightCanvas; }
|
|
if (RightCanvas.Height >= 0 && RightCanvas.Width >= 0) { rightImageSize = RightCanvas; }
|
|
RepopulateDeletionMatrixes();
|
|
RepopulateDeletionMatrixes();
|
|
@@ -479,7 +479,7 @@ namespace SketchAssistantWPF
|
|
/// <summary>
|
|
/// <summary>
|
|
/// The function called by the Presenter to set a variable which describes if OptiTrack is in use
|
|
/// The function called by the Presenter to set a variable which describes if OptiTrack is in use
|
|
/// </summary>
|
|
/// </summary>
|
|
- /// <param name="usingOptiTrack"></param>
|
|
|
|
|
|
+ /// <param name="usingOptiTrack">The status of optitrack button</param>
|
|
public void SetOptiTrack(bool usingOptiTrack)
|
|
public void SetOptiTrack(bool usingOptiTrack)
|
|
{
|
|
{
|
|
optiTrackInUse = usingOptiTrack;
|
|
optiTrackInUse = usingOptiTrack;
|
|
@@ -489,11 +489,9 @@ namespace SketchAssistantWPF
|
|
optiTrackInUse = false;
|
|
optiTrackInUse = false;
|
|
//Disable optipoint
|
|
//Disable optipoint
|
|
programPresenter.SetOverlayStatus("optipoint", false, currentCursorPosition);
|
|
programPresenter.SetOverlayStatus("optipoint", false, currentCursorPosition);
|
|
- Console.WriteLine("Point disabled");
|
|
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- Console.WriteLine("Point enabled: {0}",optiTrackInUse);
|
|
|
|
//Enable optipoint
|
|
//Enable optipoint
|
|
programPresenter.SetOverlayStatus("optipoint", true, currentCursorPosition);
|
|
programPresenter.SetOverlayStatus("optipoint", true, currentCursorPosition);
|
|
}
|
|
}
|
|
@@ -603,9 +601,7 @@ namespace SketchAssistantWPF
|
|
FinishCurrentLine(true);
|
|
FinishCurrentLine(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- //Draw with optitrack, when in drawing zone
|
|
|
|
- if (CheckInsideDrawingZone(optiTrackZ))
|
|
|
|
|
|
+ else //Draw with optitrack, when in drawing zone
|
|
{
|
|
{
|
|
//Optitrack wasn't in the drawing zone last tick -> start a new line
|
|
//Optitrack wasn't in the drawing zone last tick -> start a new line
|
|
if (!optiTrackInsideDrawingZone)
|
|
if (!optiTrackInsideDrawingZone)
|
|
@@ -617,11 +613,11 @@ namespace SketchAssistantWPF
|
|
programPresenter.UpdateCurrentLine(currentLine);
|
|
programPresenter.UpdateCurrentLine(currentLine);
|
|
if (optiTrackZ > WARNING_ZONE_BOUNDARY)
|
|
if (optiTrackZ > WARNING_ZONE_BOUNDARY)
|
|
{
|
|
{
|
|
- wristband.pushForward();
|
|
|
|
|
|
+ wristband.PushForward();
|
|
}
|
|
}
|
|
else if (optiTrackZ < -1 * WARNING_ZONE_BOUNDARY)
|
|
else if (optiTrackZ < -1 * WARNING_ZONE_BOUNDARY)
|
|
{
|
|
{
|
|
- wristband.pushBackward();
|
|
|
|
|
|
+ wristband.PushBackward();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|