Example #1
0
        public void PaintPointSymbol(Device device, GraphicView activeView, Vector3 magnet, PointMagnetType type, byte alpha)
        {
            // Must be called within a Begin-EndScene block
            Vector3 point2D = magnet;

            activeView.Project(ref point2D);

            drawPointSymbol(device, point2D.X, point2D.Y, type, alpha);
        }
Example #2
0
        private void drawPointSymbol(Device device, float x, float y, PointMagnetType type, byte alpha)
        {
            // Get color
            Color color;

            if (alpha == 255)
            {
                color = Color.Gold;
            }
            else
            {
                color = Color.FromArgb(alpha, Color.OrangeRed);
            }

            Cull cull        = device.RenderState.CullMode;
            bool alphaEnable = device.RenderState.AlphaBlendEnable;

            device.RenderState.CullMode         = Cull.None;
            device.RenderState.AlphaBlendEnable = true;
            device.RenderState.SourceBlend      = Blend.BothSourceAlpha;
            device.RenderState.DestinationBlend = Blend.DestinationColor;

            switch (type)
            {
            case PointMagnetType.EndPoint:
                drawEndPoint(device, x, y, color);
                break;

            case PointMagnetType.Intersection:
                drawIntersectPoint(device, x, y, color);
                break;

            case PointMagnetType.MidPoint:
                drawMidPoint(device, x, y, color);
                break;

            case PointMagnetType.Perpendicular:
                drawPerpPoint(device, x, y, color);
                break;

            case PointMagnetType.SimplePoint:
                drawSimplePoint(device, x, y, color);
                break;
            }

            device.RenderState.AlphaBlendEnable = alphaEnable;
            device.RenderState.CullMode         = cull;
        }
Example #3
0
 public PointMagnet(Vector3 pointInternational, PointMagnetType type)
     : base(pointInternational)
 {
     this.type = type;
     joint     = null;
 }
Example #4
0
 public void PaintPointSymbol(Device device, GraphicView activeView, Point magnet, PointMagnetType type, byte alpha)
 {
     drawPointSymbol(device, magnet.X, magnet.Y, type, alpha);
 }
Example #5
0
        public void PaintPointSymbol(Device device, GraphicView activeView, Vector3 magnet, PointMagnetType type, byte alpha)
        {
            // Must be called within a Begin-EndScene block
            Vector3 point2D = magnet;

            activeView.Project(ref point2D);

            drawPointSymbol(device, point2D.X, point2D.Y, type, alpha);
        }
Example #6
0
 public void PaintPointSymbol(Device device, GraphicView activeView, Point magnet, PointMagnetType type, byte alpha)
 {
     drawPointSymbol(device, magnet.X, magnet.Y, type, alpha);
 }
Example #7
0
        private void drawPointSymbol(Device device, float x, float y, PointMagnetType type, byte alpha)
        {
            // Get color
            Color color;
            if (alpha == 255)
                color = Color.Gold;
            else
                color = Color.FromArgb(alpha, Color.OrangeRed);

            Cull cull = device.RenderState.CullMode;
            bool alphaEnable = device.RenderState.AlphaBlendEnable;

            device.RenderState.CullMode = Cull.None;
            device.RenderState.AlphaBlendEnable = true;
            device.RenderState.SourceBlend = Blend.BothSourceAlpha;
            device.RenderState.DestinationBlend = Blend.DestinationColor;

            switch (type)
            {
                case PointMagnetType.EndPoint:
                    drawEndPoint(device, x, y, color);
                    break;
                case PointMagnetType.Intersection:
                    drawIntersectPoint(device, x, y, color);
                    break;
                case PointMagnetType.MidPoint:
                    drawMidPoint(device, x, y, color);
                    break;
                case PointMagnetType.Perpendicular:
                    drawPerpPoint(device, x, y, color);
                    break;
                case PointMagnetType.SimplePoint:
                    drawSimplePoint(device, x, y, color);
                    break;
            }

            device.RenderState.AlphaBlendEnable = alphaEnable;
            device.RenderState.CullMode = cull;
        }
Example #8
0
 public PointMagnet(Vector3 pointInternational, PointMagnetType type)
     : base(pointInternational)
 {
     this.type = type;
     joint = null;
 }