/// <summary> /// Selects the first polygon point. /// </summary> public void SelectFirstPolygonPoint() { Logger.Instance.Log(LogPriority.DEBUG, this, "[NOTICE]\t[INTERACTION]\t[NAVIGATION]\t" + "first poly point"); if (LastSelectedShapePolygonPoints == null && LastSelectedShape != null) { var pObs = LastSelectedShape.GetPolygonPointsObserver(); if (pObs != null) { LastSelectedShapePolygonPoints = pObs; } } if (LastSelectedShapePolygonPoints != null) { PolyPointDescriptor point; if (LastSelectedShapePolygonPoints.HasPoints()) { point = LastSelectedShapePolygonPoints.First(); } else { point = new PolyPointDescriptor(); } SpeakPolygonPoint(LastSelectedShapePolygonPoints); fire_PolygonPointSelected(LastSelectedShapePolygonPoints, point); } else { fire_PolygonPointSelected_Reset(); } }
void validationTimerCallback(object staus) { if (!_run || !IsShapeSelected || LastSelectedShape == null || !LastSelectedShape.IsValid(true)) { validationTimer.Dispose(); } }
/// <summary> /// Selects the previous polygon point. /// </summary> public void SelectPreviousPolygonPoint(bool ignoreLastDuplicate = true) { Logger.Instance.Log(LogPriority.DEBUG, this, "[NOTICE]\t[INTERACTION]\t[NAVIGATION]\t" + "previous poly point"); if (LastSelectedShapePolygonPoints == null && LastSelectedShape != null) { var pObs = LastSelectedShape.GetPolygonPointsObserver(); if (pObs != null) { LastSelectedShapePolygonPoints = pObs; } } if (LastSelectedShapePolygonPoints != null) { PolyPointDescriptor point; if (LastSelectedShapePolygonPoints.HasPoints()) { if (LastSelectedShapePolygonPoints.HasPrevious()) { point = LastSelectedShapePolygonPoints.Previous(); } else { point = LastSelectedShapePolygonPoints.Last(); if (ignoreLastDuplicate && LastSelectedShapePolygonPoints.HasPrevious()) { point = LastSelectedShapePolygonPoints.Previous(); } } } else { point = new PolyPointDescriptor(); } SpeakPolygonPoint(LastSelectedShapePolygonPoints); fire_PolygonPointSelected(LastSelectedShapePolygonPoints, point); } else { fire_PolygonPointSelected_Reset(); } }
/// <summary> /// Selects the first available polygon point. /// </summary> public void SelectPolygonPoint() { Logger.Instance.Log(LogPriority.DEBUG, this, "[NOTICE]\t[INTERACTION]\t[NAVIGATION]\t" + "select poly point"); if (LastSelectedShapePolygonPoints == null && LastSelectedShape != null) { LastSelectedShapePolygonPoints = LastSelectedShape.GetPolygonPointsObserver(); UpdateLastSelectedPolygonPoints(); } if (LastSelectedShapePolygonPoints != null) { SpeakPolygonPoint(LastSelectedShapePolygonPoints); int i; fire_PolygonPointSelected(LastSelectedShapePolygonPoints, LastSelectedShapePolygonPoints.Current(out i)); } else { fire_PolygonPointSelected_Reset(); } }
/// <summary> /// Selects the next following polygon point. /// </summary> /// <param name="ignoreLastDuplicate">if set to <c>true</c> to ignore the last point of an closed bezier, /// because it's the same as the first point..</param> public void SelectNextPolygonPoint(bool ignoreLastDuplicate = true) { // check if the shape is closed or not Logger.Instance.Log(LogPriority.DEBUG, this, "[NOTICE]\t[INTERACTION]\t[NAVIGATION]\t" + "next poly point"); if (LastSelectedShapePolygonPoints == null && LastSelectedShape != null) { LastSelectedShapePolygonPoints = LastSelectedShape.GetPolygonPointsObserver(); UpdateLastSelectedPolygonPoints(); } if (LastSelectedShapePolygonPoints != null) { PolyPointDescriptor point; if (LastSelectedShapePolygonPoints.HasPoints()) { if (!LastSelectedShapePolygonPoints.HasNext(ignoreLastDuplicate)) { LastSelectedShapePolygonPoints.ResetIterator(); } point = LastSelectedShapePolygonPoints.Next(); } else { point = new PolyPointDescriptor(); } SpeakPolygonPoint(LastSelectedShapePolygonPoints); fire_PolygonPointSelected(LastSelectedShapePolygonPoints, point); } else { fire_PolygonPointSelected_Reset(); } }