示例#1
0
 public circumplexViz(Canvas canvasToDraw = null,int threshold = 3)
 {
     this.canvasToDraw = canvasToDraw;
     Point p1 = new Point(0,200);
     Point p2 = new Point(0,0);
     counter = 1;
     this.threshold = threshold;
     d = new dot(1, counter);
     if (this.canvasToDraw != null)
     {
         xAxis = new bone(26, 0, 26, 520);
         yAxis = new bone(3, 520, 665, 520);
         //a = new dot(7, 7, 2, Brushes.Red, off);
         xAxis.drawBone(this.canvasToDraw);
         yAxis.drawBone(this.canvasToDraw);
     }            // xAxis.moveBone(this.canvasToDraw, p2);
 }
示例#2
0
        private void drawJoint(SkeletonData sd, JointID i)
        {
            Joint j;
            dot a;
            j = sd.Joints[i];
            j = j.ScaleTo(310, 244, 1.6f,1.6f);
            Point p = new Point(j.Position.X, j.Position.Y);
            Point off = new Point(0, 5);

            if (i == JointID.Head)
            {
                a = new dot(7,7,2,Brushes.Blue, off);
            }

            else
            {
                a = new dot(7, 7, 2, Brushes.Red, off);
            }
            a.moveDot(canvas, p);
        }
示例#3
0
        public void draw(double Arousal, double Valence, double offsetA, double offsetV)
        {
            if (this.previousCanvas != null && this.previousCanvas != this.canvasToDraw)
            {
                //Basically refreshing everything. :/
                try { previousCanvas.Children.Remove(d.ellipse); }
                catch { System.Windows.MessageBox.Show("kaput.", "Kinect Not running", MessageBoxButton.OK, MessageBoxImage.Error); }
                reddot = true;
                dotqueue.numberOfDots = 0;
            }
            ++counter;
            //this counter is for name of the dot

            //dot a;
            Point p = new Point(Math.Round(Valence * offsetV)+20, Math.Round((100 - Arousal) * offsetV));
            Point off = new Point(0, 5);
            if (reddot == true)
            {
                d.moveDot(this.canvasToDraw, p);
                animate(d.ellipse);
                reddot = false;
            }
            else
            {
                //d.refreshDot(this.canvasToDraw, p);
                smoothmove(d.ellipse, prev, p);
                dot pdot = new dot(2);//, counter);
                pdot.moveDot(this.canvasToDraw, prev);
                //animate(pdot.ellipse);
                dotqueue.Enqueue(pdot);

            }

            if (dotqueue.numberOfDots >= this.threshold)
            {
                fadeOut(dotqueue.Dequeue().ellipse);
            }

            prev = p;
            previousCanvas = this.canvasToDraw;
        }
示例#4
0
 /// <summary></summary>
 public void Enqueue(dot dot)
 {
     lock (this)
     {
         _Queue.Enqueue(dot);
         //numberOfDots++;
         numberOfDots = _Queue.Count;
     }
 }