|
@@ -25,6 +25,14 @@ namespace SketchAssistantWPF
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ static readonly double TACTILE_SURFACE_FEEDBACK_INTENSITY = 1.0;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ static readonly int TACTILE_SURFACE_FEEDBACK_DURATION = 50;
|
|
|
|
|
|
|
|
|
|
|
@@ -362,8 +370,8 @@ namespace SketchAssistantWPF
|
|
|
}
|
|
|
|
|
|
|
|
|
- LocalArmbandInterface.actuate100();
|
|
|
- Console.WriteLine("StartVibrate");
|
|
|
+ LocalArmbandInterface.Actuate(0, 1.0, 20);
|
|
|
+ Console.WriteLine("Vibrate motor 0 for 20ms");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -392,8 +400,6 @@ namespace SketchAssistantWPF
|
|
|
currentLine.Clear();
|
|
|
}
|
|
|
UpdateUI();
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -430,39 +436,63 @@ namespace SketchAssistantWPF
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- public void UpdateSizes(ImageDimension CanvasSize)
|
|
|
- {
|
|
|
- if (rightImageWithoutOverlay != null)
|
|
|
+
|
|
|
+ if (programPresenter.IsMousePressed())
|
|
|
{
|
|
|
- int widthImage = rightImageSize.Width;
|
|
|
- int heightImage = rightImageSize.Height;
|
|
|
- int widthBox = CanvasSize.Width;
|
|
|
- int heightBox = CanvasSize.Height;
|
|
|
-
|
|
|
- float imageRatio = (float)widthImage / (float)heightImage;
|
|
|
- float containerRatio = (float)widthBox / (float)heightBox;
|
|
|
- float zoomFactor = 0;
|
|
|
- if (imageRatio >= containerRatio)
|
|
|
+ if(CentimeterGridPassed(previousCursorPosition, currentCursorPosition))
|
|
|
{
|
|
|
-
|
|
|
- zoomFactor = (float)widthImage / (float)widthBox;
|
|
|
+ LocalArmbandInterface.Actuate(0, TACTILE_SURFACE_FEEDBACK_INTENSITY, TACTILE_SURFACE_FEEDBACK_DURATION);
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
-
|
|
|
- zoomFactor = (float)heightImage / (float)heightBox;
|
|
|
- }
|
|
|
- markerRadius = (int)(10 * zoomFactor);
|
|
|
- deletionRadius = (int)(5 * zoomFactor);
|
|
|
}
|
|
|
}
|
|
|
- */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private bool CentimeterGridPassed(Point previousCursorPositionRealWorldCoordinates, Point currentCursorPositionRealWorldCoordinates)
|
|
|
+ {
|
|
|
+
|
|
|
+ if ((int)(previousCursorPositionRealWorldCoordinates.X * 100) != (int)(currentCursorPositionRealWorldCoordinates.X * 100)) return true;
|
|
|
+ if ((int)(previousCursorPositionRealWorldCoordinates.Y * 100) != (int)(currentCursorPositionRealWorldCoordinates.Y * 100)) return true;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+public void UpdateSizes(ImageDimension CanvasSize)
|
|
|
+{
|
|
|
+ if (rightImageWithoutOverlay != null)
|
|
|
+ {
|
|
|
+ int widthImage = rightImageSize.Width;
|
|
|
+ int heightImage = rightImageSize.Height;
|
|
|
+ int widthBox = CanvasSize.Width;
|
|
|
+ int heightBox = CanvasSize.Height;
|
|
|
+
|
|
|
+ float imageRatio = (float)widthImage / (float)heightImage;
|
|
|
+ float containerRatio = (float)widthBox / (float)heightBox;
|
|
|
+ float zoomFactor = 0;
|
|
|
+ if (imageRatio >= containerRatio)
|
|
|
+ {
|
|
|
+
|
|
|
+ zoomFactor = (float)widthImage / (float)widthBox;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ zoomFactor = (float)heightImage / (float)heightBox;
|
|
|
+ }
|
|
|
+ markerRadius = (int)(10 * zoomFactor);
|
|
|
+ deletionRadius = (int)(5 * zoomFactor);
|
|
|
+ }
|
|
|
+}
|
|
|
+*/
|
|
|
|
|
|
|
|
|
|