Beispiel #1
0
        public static ImageViewerMatrix Read(Dictionary <byte, object> par)
        {
            var res = new ImageViewerMatrix
            {
                M11     = (double)par[(byte)DiscussionParamKey.M11Key],
                M12     = (double)par[(byte)DiscussionParamKey.M12Key],
                M21     = (double)par[(byte)DiscussionParamKey.M21Key],
                M22     = (double)par[(byte)DiscussionParamKey.M22Key],
                OffsetX = (double)par[(byte)DiscussionParamKey.OffsetXKey],
                OffsetY = (double)par[(byte)DiscussionParamKey.OffsetYKey],

                OwnerId           = (int)par[(byte)DiscussionParamKey.ShapeOwnerId],
                TopicId           = (int)par[(byte)DiscussionParamKey.ChangedTopicId],
                ImageAttachmentId = (int)par[(byte)DiscussionParamKey.AttachmentId]
            };

            return(res);
        }
Beispiel #2
0
        public static ImageViewerMatrix Read(Dictionary<byte, object> par)
        {
            var res = new ImageViewerMatrix
                {
                    M11 = (double) par[(byte) DiscussionParamKey.M11Key],
                    M12 = (double) par[(byte) DiscussionParamKey.M12Key],
                    M21 = (double) par[(byte) DiscussionParamKey.M21Key],
                    M22 = (double) par[(byte) DiscussionParamKey.M22Key],
                    OffsetX = (double) par[(byte) DiscussionParamKey.OffsetXKey],
                    OffsetY = (double) par[(byte) DiscussionParamKey.OffsetYKey],

                    OwnerId = (int) par[(byte) DiscussionParamKey.ShapeOwnerId],
                    TopicId = (int) par[(byte) DiscussionParamKey.ChangedTopicId],
                    ImageAttachmentId = (int) par[(byte) DiscussionParamKey.AttachmentId]
                };

            return res;
        }
Beispiel #3
0
        public void SendManipulateImageViewer(ImageViewerMatrix mat)
        {
            if (peer == null || peer.PeerState != PeerStateValue.Connected)
                return;

            peer.OpCustom((byte)DiscussionOpCode.ImageViewerManipulateRequest,
                          mat.ToDict(),
                          true);
        }
Beispiel #4
0
 public void HandleManipulateImageViewer(LitePeer peer,
                                         ImageViewerMatrix imgMatrix,
                                         OperationRequest operationRequest,
                                         SendParameters sendParameters)
 {
     _doc.SetImageViewer(imgMatrix);
     
     _room.Broadcast(peer,
                     operationRequest,
                     sendParameters,
                     (byte)DiscussionEventCode.ImageViewerManipulatedEvent,
                     BroadcastTo.RoomExceptSelf);            
 }
Beispiel #5
0
        void CheckSendMatrix()
        {
            if (!ExplanationModeMediator.Inst.ExplanationModeEnabled)
                return;

            if (_attachId == NO_ATTACHMENT)
                return;

            var tr = GetTransform();
            var mat = new ImageViewerMatrix
                {
                    ImageAttachmentId = _attachId,
                    M11 = tr.M11,
                    M12 = tr.M12,
                    M21 = tr.M21,
                    M22 = tr.M22,
                    OffsetX = tr.OffsetX,
                    OffsetY = tr.OffsetY,
                    OwnerId = SessionInfo.Get().person.Id,
                    TopicId = _topicId
                };

            UISharedRTClient.Instance.clienRt.SendManipulateImageViewer(mat);
        }
Beispiel #6
0
        private void OnImageViewerManipulated(ImageViewerMatrix mat)
        {
            if (!ExplanationModeMediator.Inst.ExplanationModeEnabled)
                return;

            if (_topicId != mat.TopicId || _attachId != mat.ImageAttachmentId)
                return;

            SetTransform(new Matrix(mat.M11, mat.M12, mat.M21, mat.M22, mat.OffsetX, mat.OffsetY));

            updateZoomFactor(mat.M11);
        }
Beispiel #7
0
 public void SetImageViewer(ImageViewerMatrix imgViewer)
 {
     if (!_attachmentIdToViewer.ContainsKey(imgViewer.ImageAttachmentId))
         _attachmentIdToViewer.Add(imgViewer.ImageAttachmentId, imgViewer);
     else
         _attachmentIdToViewer[imgViewer.ImageAttachmentId] = imgViewer;
 }