/// <summary> /// On stylus-down we record initial ink packets, stroke ID and Tablet properties. Don't return any ink messages yet. /// </summary> /// <param name="rtissd"></param> /// <remarks> /// By definition CP3 real-time ink is ink that only exists during the act of inking, then is promptly deleted. The static /// completed strokes are created and deleted by separate messages (InkSheetStrokesAddedMessage/...DeletedMessage). /// CP3 generates three types of real-time ink messages: stylus down, packets, and stylus up. We translate the accumulated /// packets into ink strokes (using a constant ID, so that each RT ink message will replace the previous one on WebViewer), /// then on stylus up, we delete the last RT stroke, and a completed static ink stroke is added by InkSheetStrokesAddedMessage. /// By definition, real-time messages may be dropped by the CP3 sender, so we need to design with this expectation. /// The only serious impact of lost RT messages is that they may cause stray RT ink to remain after /// the static ink is deleted. To work around this, we will keep a list of the RT ink strokes which have been /// added, but not yet deleted, then on InkSheetStrokesDeleted, we will examine the list, and generate deletes for any strays. /// </remarks> internal void AddRealTimeInkSheetStylusDown(UW.ClassroomPresenter.Network.Messages.Presentation.RealTimeInkSheetStylusDownMessage rtissd) { //Debug.WriteLine("***** Realtime Ink stylus down StrokeID=" + rtissd.StrokeId.ToString() + "; stylusId=" + rtissd.StylusId.ToString()); // Store the packets array. In CP3 they use a hashtable keyed on the stylusId, but we can probably just assume one int[]. // Also store the current stroke id so that we won't apply the wrong packets if a message is lost. this.previousRealTimePackets = rtissd.Packets; this.previousRealTimeStroke = rtissd.StrokeId; this.previousTabletProperties = rtissd.TabletProperties.CreateTabletPropertyDescriptionCollection(); //For now we assume only one stylus. }
private void HandleStylusDownHelper(object sender, int stylusId, int strokeId, int[] packets, TabletPropertyDescriptionCollection tabletProperties) { this.FlushPackets(stylusId, strokeId); Message message = new RealTimeInkSheetStylusDownMessage(this.m_Sheet, stylusId, strokeId, packets, tabletProperties); message.Tags = new MessageTags(); message.Tags.SlideID = this.m_SlideID; message.Tags.Priority = MessagePriority.RealTime; message.Tags.BridgePriority = MessagePriority.RealTime; this.Sender.Send(message, MessagePriority.RealTime); }
private void HandleStylusDownHelper(object sender, int stylusId, int strokeId, int[] packets, TabletPropertyDescriptionCollection tabletProperties) { this.FlushPackets(stylusId, strokeId); if (ViewerStateModel.NonStandardDpi) { RealTimeInkSheetModel.ScalePackets(packets, ViewerStateModel.DpiNormalizationSendMatrix); } Message message = new RealTimeInkSheetStylusDownMessage(this.m_Sheet, stylusId, strokeId, packets, tabletProperties); message.Tags = new MessageTags(); message.Tags.SlideID = m_SlideID; message.Tags.Priority = MessagePriority.RealTime; message.Tags.BridgePriority = MessagePriority.RealTime; this.Sender.Send(message, MessagePriority.RealTime); }