예제 #1
0
        public override void DrawContents(DataRecord rec)
        {
            if (rec != null)                    //new record
            {
                if (rec.content[0] == 0x09)     //check appuid
                {
                    if (rec.content[1] == 0x01) //mouse enabled
                    {
                        xspp = AppUtils.ValueMapToDouble(rec.content[2], -15, 15);
                        yspp = AppUtils.ValueMapToDouble(rec.content[3], -15, 15);
                    }
                    mxspp  = -AppUtils.ValueMapToDouble(rec.content[4], -15, 15);
                    myspp  = AppUtils.ValueMapToDouble(rec.content[5], -15, 15);
                    mxsoff = -AppUtils.ValueMapToDouble(rec.content[6], -15, 15);
                    mysoff = AppUtils.ValueMapToDouble(rec.content[7], -15, 15);
                }
            }
            xsp  = 0.8 * xsp + 0.2 * xspp;
            ysp  = 0.8 * ysp + 0.2 * yspp;
            mxsp = 0.8 * mxsp + 0.2 * mxspp;
            mysp = 0.8 * mysp + 0.2 * myspp;
            RendererWrapper.DrawCoordinate(boundingbox, new RGBAColor(1, 1, 1, 0.3));
            List <Point2D> mpts = new List <Point2D>();

            mpts.Add(new Point2D(boundingbox.Width / 2 + 7 * mxsoff, boundingbox.Height / 2));
            mpts.Add(new Point2D(boundingbox.Width / 2, boundingbox.Height / 2 + 7 * mysoff));
            RendererWrapper.DrawMarkers(boundingbox, mpts, Globals.emgchannelcols[7], 0, 10);
            RendererWrapper.DrawArrow(boundingbox, new Point2D(boundingbox.Width / 2, boundingbox.Height / 2),
                                      new Point2D(boundingbox.Width / 2 + 7 * mxsp - 7 * mxsoff, boundingbox.Height / 2),
                                      Globals.emgchannelcols[7], thickness: 2, headsize: 10);
            RendererWrapper.DrawArrow(boundingbox, new Point2D(boundingbox.Width / 2, boundingbox.Height / 2),
                                      new Point2D(boundingbox.Width / 2, boundingbox.Height / 2 + 7 * mysp - 7 * mysoff),
                                      Globals.emgchannelcols[7], thickness: 2, headsize: 10);
            RendererWrapper.DrawArrow(boundingbox, new Point2D(boundingbox.Width / 2, boundingbox.Height / 2),
                                      new Point2D(boundingbox.Width / 2 + 7 * xsp, boundingbox.Height / 2 + 7 * ysp),
                                      Globals.emgchannelcols[8], thickness: 2, headsize: 25);
        }
예제 #2
0
        public override void DrawContents(DataRecord rec)
        {
            if (rec != null)
            {
                if (rec.content[0] == 0x01)
                {
                    xsp = (rec.content[1] - 128) / 50.0;
                    ysp = (rec.content[2] - 128) / 50.0;
                    if (rec.content[3] == 0x01)
                    {
                        particles.Add(new Particle(Particle.ParticleShapes.Cross, new RGBAColor(1.0, 0.5, 0.0, 1.0),
                                                   600, 7, 7, cursorpos.x + boundingbox.Width / 2, cursorpos.y + boundingbox.Height / 2,
                                                   lifefade_: 200
                                                   ));
                        particles.Add(new Particle(Particle.ParticleShapes.Diamond, new RGBAColor(1.0, 0.5, 0.0, 1.0),
                                                   30, 3, 3, cursorpos.x + boundingbox.Width / 2, cursorpos.y + boundingbox.Height / 2,
                                                   lifefade_: 30, xscalef_: 15, yscalef_: 15, bm_: RendererWrapper.BlendModes.Add, aseyecandy_: true
                                                   ));
                        //leftclicks.Add(new Point2D(cursorpos.x + boundingbox.Width / 2, cursorpos.y + boundingbox.Height / 2));
                    }
                    if (rec.content[4] == 0x01)
                    {
                        particles.Add(new Particle(Particle.ParticleShapes.Cross, new RGBAColor(0.0, 0.3, 1.0, 1.0),
                                                   600, 7, 7, cursorpos.x + boundingbox.Width / 2, cursorpos.y + boundingbox.Height / 2,
                                                   lifefade_: 200
                                                   ));
                        particles.Add(new Particle(Particle.ParticleShapes.Diamond, new RGBAColor(0.0, 0.3, 1.0, 1.0),
                                                   30, 3, 3, cursorpos.x + boundingbox.Width / 2, cursorpos.y + boundingbox.Height / 2,
                                                   lifefade_: 30, xscalef_: 15, yscalef_: 15, bm_: RendererWrapper.BlendModes.Add, aseyecandy_: true
                                                   ));
                        //rightclicks.Add(new Point2D(cursorpos.x + boundingbox.Width / 2, cursorpos.y + boundingbox.Height / 2));
                    }
                }
            }
            cursorpos.x += xsp;
            cursorpos.y += ysp;
            if (cursorpos.x > boundary)
            {
                cursorpos.x = boundary;
            }
            if (cursorpos.x < -boundary)
            {
                cursorpos.x = -boundary;
            }
            if (cursorpos.y > boundary)
            {
                cursorpos.y = boundary;
            }
            if (cursorpos.y < -boundary)
            {
                cursorpos.y = -boundary;
            }
            List <Point2D> curpos = new List <Point2D>();

            curpos.Add(new Point2D(cursorpos.x + boundingbox.Width / 2, cursorpos.y + boundingbox.Height / 2));
            RendererWrapper.DrawCoordinate(boundingbox, new RGBAColor(1, 1, 1, 0.3));
            //RendererWrapper.DrawMarkers(boundingbox, leftclicks, new RGBAColor(1.0, 0.5, 0.0, 1.0), 1, 8);
            //RendererWrapper.DrawMarkers(boundingbox, rightclicks, new RGBAColor(0.0, 0.3, 1.0, 1.0), 1, 8);
            RendererWrapper.DrawParticles(boundingbox, particles);
            RendererWrapper.DrawMarkers(boundingbox, curpos, new RGBAColor(Globals.emgchannelcols[8]), 0, 8);
        }