|
@@ -39,10 +39,6 @@ namespace SketchAssistantWPF
|
|
/// </summary>
|
|
/// </summary>
|
|
int deletionRadius = 5;
|
|
int deletionRadius = 5;
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// Size of areas marking endpoints of lines in the redraw mode.
|
|
|
|
- /// </summary>
|
|
|
|
- int markerRadius = 10;
|
|
|
|
- /// <summary>
|
|
|
|
/// The Position of the Cursor in the right picture box
|
|
/// The Position of the Cursor in the right picture box
|
|
/// </summary>
|
|
/// </summary>
|
|
Point currentCursorPosition;
|
|
Point currentCursorPosition;
|
|
@@ -63,10 +59,6 @@ namespace SketchAssistantWPF
|
|
/// </summary>
|
|
/// </summary>
|
|
HashSet<int>[,] linesMatrix;
|
|
HashSet<int>[,] linesMatrix;
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// List of items which will be overlayed over the right canvas.
|
|
|
|
- /// </summary>
|
|
|
|
- List<Tuple<bool, HashSet<Point>>> overlayItems;
|
|
|
|
- /// <summary>
|
|
|
|
/// Width of the LeftImageBox.
|
|
/// Width of the LeftImageBox.
|
|
/// </summary>
|
|
/// </summary>
|
|
public int leftImageBoxWidth;
|
|
public int leftImageBoxWidth;
|
|
@@ -99,8 +91,6 @@ namespace SketchAssistantWPF
|
|
/// </summary>
|
|
/// </summary>
|
|
private bool mouseDown;
|
|
private bool mouseDown;
|
|
|
|
|
|
- Image rightImageWithoutOverlay;
|
|
|
|
-
|
|
|
|
List<InternalLine> leftLineList;
|
|
List<InternalLine> leftLineList;
|
|
|
|
|
|
List<Tuple<bool, InternalLine>> rightLineList;
|
|
List<Tuple<bool, InternalLine>> rightLineList;
|
|
@@ -233,25 +223,7 @@ namespace SketchAssistantWPF
|
|
leftLineList = listOfLines;
|
|
leftLineList = listOfLines;
|
|
graphicLoaded = true;
|
|
graphicLoaded = true;
|
|
programPresenter.UpdateLeftLines(leftLineList);
|
|
programPresenter.UpdateLeftLines(leftLineList);
|
|
- //programPresenter.ClearRightLines(); //TODO check if right position for this method call
|
|
|
|
CanvasActivated();
|
|
CanvasActivated();
|
|
- /*
|
|
|
|
- var workingCanvas = GetEmptyCanvas(width, height);
|
|
|
|
- var workingGraph = Graphics.FromImage(workingCanvas);
|
|
|
|
- leftLineList = listOfLines;
|
|
|
|
- //redrawAss = new RedrawAssistant(leftLineList);
|
|
|
|
- //overlayItems = redrawAss.Initialize(markerRadius);
|
|
|
|
- //Lines
|
|
|
|
- foreach (InternalLine line in leftLineList)
|
|
|
|
- {
|
|
|
|
- line.DrawLine(workingGraph);
|
|
|
|
- }
|
|
|
|
- leftImage = workingCanvas;
|
|
|
|
- programPresenter.UpdateLeftImage(leftImage);
|
|
|
|
- //Set right image to same size as left image and delete linelist
|
|
|
|
- DrawEmptyCanvasRight();
|
|
|
|
- rightLineList = new List<Tuple<bool, InternalLine>>();
|
|
|
|
- */
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -286,7 +258,6 @@ namespace SketchAssistantWPF
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- //TODO: For the person implementing overlay: Add check if overlay needs to be added
|
|
|
|
programPresenter.UpdateRightLines(rightLineList);
|
|
programPresenter.UpdateRightLines(rightLineList);
|
|
}
|
|
}
|
|
RepopulateDeletionMatrixes();
|
|
RepopulateDeletionMatrixes();
|
|
@@ -372,10 +343,8 @@ namespace SketchAssistantWPF
|
|
rightLineList.Add(new Tuple<bool, InternalLine>(true, newLine));
|
|
rightLineList.Add(new Tuple<bool, InternalLine>(true, newLine));
|
|
newLine.PopulateMatrixes(isFilledMatrix, linesMatrix);
|
|
newLine.PopulateMatrixes(isFilledMatrix, linesMatrix);
|
|
programPresenter.PassLastActionTaken(historyOfActions.AddNewAction(new SketchAction(SketchAction.ActionType.Draw, newLine.GetID())));
|
|
programPresenter.PassLastActionTaken(historyOfActions.AddNewAction(new SketchAction(SketchAction.ActionType.Draw, newLine.GetID())));
|
|
- //TODO: For the person implementing overlay: Add check if overlay needs to be added
|
|
|
|
programPresenter.UpdateRightLines(rightLineList);
|
|
programPresenter.UpdateRightLines(rightLineList);
|
|
currentLine.Clear();
|
|
currentLine.Clear();
|
|
- //programPresenter.UpdateCurrentLine(currentLine)
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -440,38 +409,6 @@ namespace SketchAssistantWPF
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- /*
|
|
|
|
- /// <summary>
|
|
|
|
- /// A helper Function that updates the markerRadius & deletionRadius, considering the size of the canvas.
|
|
|
|
- /// </summary>
|
|
|
|
- /// <param name="CanvasSize">The size of the canvas</param>
|
|
|
|
- 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)
|
|
|
|
- {
|
|
|
|
- //Image is wider than it is high
|
|
|
|
- zoomFactor = (float)widthImage / (float)widthBox;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- //Image is higher than it is wide
|
|
|
|
- zoomFactor = (float)heightImage / (float)heightBox;
|
|
|
|
- }
|
|
|
|
- markerRadius = (int)(10 * zoomFactor);
|
|
|
|
- deletionRadius = (int)(5 * zoomFactor);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- */
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// If there is unsaved progress.
|
|
/// If there is unsaved progress.
|