Exemplo n.º 1
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));
            }
        }