Beispiel #1
0
        private void RenderToothWatch(Graphics g, ToothGraphic toothGraphic)
        {
            float      toMm  = 1f / TcData.ScaleMmToPix;
            SolidBrush brush = new SolidBrush(toothGraphic.colorWatch);

            //Drawing a white silhouette around the colored watch W doesn't make sense here because unerupted teeth do not change color in this chart.
            if (ToothGraphic.IsRight(toothGraphic.ToothID))
            {
                if (ToothGraphic.IsMaxillary(toothGraphic.ToothID))
                {
                    g.DrawString("W", Font, brush, new PointF(TcData.GetTransXpix(toothGraphic.ToothID) + toothGraphic.ShiftM - 6f, 0));
                }
                else
                {
                    g.DrawString("W", Font, brush, new PointF(TcData.GetTransXpix(toothGraphic.ToothID) + toothGraphic.ShiftM - 7f, Height - Font.Size - 8f));
                }
            }
            else
            {
                if (ToothGraphic.IsMaxillary(toothGraphic.ToothID))
                {
                    g.DrawString("W", Font, brush, new PointF(TcData.GetTransXpix(toothGraphic.ToothID) - toothGraphic.ShiftM - 6f, 0));
                }
                else
                {
                    g.DrawString("W", Font, brush, new PointF(TcData.GetTransXpix(toothGraphic.ToothID) - toothGraphic.ShiftM - 7f, Height - Font.Size - 8f));
                }
            }
            brush.Dispose();
        }
Beispiel #2
0
        ///<summary></summary>
        private void DrawToothOcclusal(ToothGraphic toothGraphic, Graphics g)
        {
            ToothGroup group;
            float      x, y;
            Pen        outline = new Pen(Color.Gray);

            for (int i = 0; i < toothGraphic.Groups.Count; i++)
            {
                group = (ToothGroup)toothGraphic.Groups[i];
                if (!group.Visible)
                {
                    continue;
                }
                x = TcData.GetTransXpix(toothGraphic.ToothID);
                y = TcData.GetTransYocclusalPix(toothGraphic.ToothID);
                float        sqB  = 4;      //half the size of the central square. B for Big.
                float        cirB = 9.5f;   //radius of outer circle
                float        sqS  = 3;      //S for small
                float        cirS = 8f;
                GraphicsPath path;
                SolidBrush   brush = new SolidBrush(group.PaintColor);
                string       dir;
                switch (group.GroupType)
                {
                case ToothGroupType.O:
                    g.FillRectangle(brush, x - sqB, y - sqB, 2f * sqB, 2f * sqB);
                    g.DrawRectangle(outline, x - sqB, y - sqB, 2f * sqB, 2f * sqB);
                    break;

                case ToothGroupType.I:
                    g.FillRectangle(brush, x - sqS, y - sqS, 2f * sqS, 2f * sqS);
                    g.DrawRectangle(outline, x - sqS, y - sqS, 2f * sqS, 2f * sqS);
                    break;

                case ToothGroupType.B:
                    if (ToothGraphic.IsMaxillary(toothGraphic.ToothID))
                    {
                        path = GetPath("U", x, y, sqB, cirB);
                    }
                    else
                    {
                        path = GetPath("D", x, y, sqB, cirB);
                    }
                    g.FillPath(brush, path);
                    g.DrawPath(outline, path);
                    break;

                case ToothGroupType.F:
                    if (ToothGraphic.IsMaxillary(toothGraphic.ToothID))
                    {
                        path = GetPath("U", x, y, sqS, cirS);
                    }
                    else
                    {
                        path = GetPath("D", x, y, sqS, cirS);
                    }
                    g.FillPath(brush, path);
                    g.DrawPath(outline, path);
                    break;

                case ToothGroupType.L:
                    if (ToothGraphic.IsMaxillary(toothGraphic.ToothID))
                    {
                        dir = "D";
                    }
                    else
                    {
                        dir = "U";
                    }
                    if (ToothGraphic.IsAnterior(toothGraphic.ToothID))
                    {
                        path = GetPath(dir, x, y, sqS, cirS);
                    }
                    else
                    {
                        path = GetPath(dir, x, y, sqB, cirB);
                    }
                    g.FillPath(brush, path);
                    g.DrawPath(outline, path);
                    break;

                case ToothGroupType.M:
                    if (ToothGraphic.IsRight(toothGraphic.ToothID))
                    {
                        dir = "R";
                    }
                    else
                    {
                        dir = "L";
                    }
                    if (ToothGraphic.IsAnterior(toothGraphic.ToothID))
                    {
                        path = GetPath(dir, x, y, sqS, cirS);
                    }
                    else
                    {
                        path = GetPath(dir, x, y, sqB, cirB);
                    }
                    g.FillPath(brush, path);
                    g.DrawPath(outline, path);
                    break;

                case ToothGroupType.D:
                    if (ToothGraphic.IsRight(toothGraphic.ToothID))
                    {
                        dir = "L";
                    }
                    else
                    {
                        dir = "R";
                    }
                    if (ToothGraphic.IsAnterior(toothGraphic.ToothID))
                    {
                        path = GetPath(dir, x, y, sqS, cirS);
                    }
                    else
                    {
                        path = GetPath(dir, x, y, sqB, cirB);
                    }
                    g.FillPath(brush, path);
                    g.DrawPath(outline, path);
                    break;
                }
                //group.PaintColor
                //Gl.glCallList(displayListOffset+toothGraphic.GetIndexForDisplayList(group));
            }
        }