/// <summary> /// Gets a compressed textual description for Braille text output for a polygon point. /// </summary> /// <param name="pointsObs">The points observer.</param> /// <returns>a string suitable for short Braille output.</returns> public static string GetPointText(OoPolygonPointsObserver pointsObs) { if (pointsObs != null) { int index; var point = pointsObs.Current(out index); if (!point.Equals(default(PolyPointDescriptor))) { index += 1; string nodeType = LL.GetTrans("tangram.oomanipulation.element_speaker.label." + point.Flag.ToString()); // remove one point from count if first and last point is equal int count = pointsObs.Count - (pointsObs.FirstPointEqualsLastPoint() ? 1 : 0); String text = LL.GetTrans("tangram.oomanipulation.element_speaker.text.point", nodeType, index, count, (((float)point.X / 1000f)).ToString("0.##cm"), (((float)point.Y / 1000f)).ToString("0.##cm") ); //point.Flag.ToString() + " (" + index + "/" + pointsObs.Count + ") - x:" + point.X + " y:" + point.Y; return(text); } } return(String.Empty); }
/// <summary> /// Gets an audio description for auditory output for a polygon point. /// </summary> /// <param name="pointsObs">The points observer.</param> /// <returns>a string suitable for auditory output.</returns> public static string GetPointAudio(OoPolygonPointsObserver pointsObs) { if (pointsObs != null) { int index; var point = pointsObs.Current(out index); if (!point.Equals(default(PolyPointDescriptor))) { index += 1; string nodeType = LL.GetTrans("tangram.oomanipulation.element_speaker.label." + point.Flag.ToString()); // remove one point from count if first and last point is equal int count = pointsObs.Count - (pointsObs.FirstPointEqualsLastPoint() ? 1 : 0); String audio = LL.GetTrans("tangram.oomanipulation.element_speaker.audio.point", nodeType, index, count ); return(audio); } } return(String.Empty); }
private void fire_PolygonPointSelected(OoPolygonPointsObserver ppobs, util.PolyPointDescriptor point) { if (PolygonPointSelected != null) { Task t = new Task(new Action(() => { try { PolygonPointSelected.Invoke(this, new PolygonPointSelectedEventArgs(ppobs, point)); } catch { } })); t.Start(); } }
/// <summary> /// Returns the polygon point to audio and textual output receivers. /// </summary> /// <param name="pointsObs">The points obs.</param> public void SpeakPolygonPoint(OoPolygonPointsObserver pointsObs) { if (pointsObs != null) { String audio = GetPointAudio(pointsObs); String text = GetPointText(pointsObs); sendAudioFeedback(audio); sentTextFeedback(text); } }
/// <summary> /// Sets the shape for modification to the given observer. /// </summary> /// <param name="shape">The shape.</param> /// <param name="observed">The observed.</param> /// <returns>the currently selected Shape observer</returns> public bool SetPolypointForModification(OoPolygonPointsObserver points, OoShapeObserver shape) { if (shape != null && points != null && points.Shape == shape) { if (shapeManipulatorFunctionProxy != null && !ImageData.Instance.Active) { // OoElementSpeaker.PlayElementImmediately(shape, LL.GetTrans("tangram.lector.oo_observer.selected", String.Empty)); if (shapeManipulatorFunctionProxy.LastSelectedShape != shape) { shapeManipulatorFunctionProxy.LastSelectedShape = shape; } shapeManipulatorFunctionProxy.LastSelectedShapePolygonPoints = points; // shapeManipulatorFunctionProxy.SelectLastPolygonPoint(); shapeManipulatorFunctionProxy.SelectPolygonPoint(); } else // title+desc dialog handling { ImageData.Instance.NewSelectionHandling(shape); } } return(false); }
/// <summary> /// Initializes a new instance of the <see cref="PolygonPointSelectedEventArgs"/> class with empty Members. /// Should only be used to reset the listeners. /// </summary> public PolygonPointSelectedEventArgs() { PolygonPoints = null; Point = new util.PolyPointDescriptor(); }
/// <summary> /// Initializes a new instance of the <see cref="PolygonPointSelectedEventArgs"/> class. /// </summary> /// <param name="ppobs">polygon points observer.</param> /// <param name="point">current selected point.</param> public PolygonPointSelectedEventArgs(OoPolygonPointsObserver ppobs, tud.mci.tangram.util.PolyPointDescriptor point) { PolygonPoints = ppobs; Point = point; }