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;
}