示例#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();
        }
        ///<summary>Gets the rectangle in pixels surrounding a tooth number.  Used to draw the box and to invalidate the area.</summary>
        private RectangleF GetNumberRec(string tooth_id, Graphics g)
        {
            float xPos = GetTransX(tooth_id);
            float yPos = Height / 2f;

            if (ToothGraphic.IsMaxillary(tooth_id))
            {
                yPos -= 14;
            }
            else
            {
                yPos += 3;
            }
            string displayNum = tooth_id;

            if (useInternational)
            {
                displayNum = ToothGraphic.ToInternat(displayNum);
            }
            float strWidth = g.MeasureString(displayNum, Font).Width;

            xPos -= strWidth / 2f;
            RectangleF rec = new RectangleF(xPos - 1, yPos - 1, strWidth, 12);   //this rec has origin at UL

            return(rec);
        }
 ///<summary>Sets the specified permanent tooth to primary as follows: Sets ShowPrimary to true for the perm tooth.  Makes pri tooth visible=true, repositions perm tooth by translating -Y.  Moves primary tooth slightly to M or D sometimes for better alignment.  And if 2nd primary molar, then because of the larger size, it must move all perm molars to distal.  Ignores if invalid perm tooth.</summary>
 public void SetToPrimary(string toothID)
 {
     if (simpleMode)
     {
         if (!ToothGraphic.IsValidToothID(toothID))
         {
             return;
         }
         if (ToothGraphic.IsPrimary(toothID))
         {
             return;
         }
         ListToothGraphics[toothID].ShowPrimary = true;
         //ListToothGraphics[toothID].ShiftO-=12;
         ListToothGraphics[toothID].Visible = false;              //instead of shiftO
         this.Invalidate();
         if (!ToothGraphic.IsValidToothID(ToothGraphic.PermToPri(toothID)))
         {
             return;
         }
         ListToothGraphics[ToothGraphic.PermToPri(toothID)].Visible = true;
     }
     else
     {
         toothChart.SetToPrimary(toothID);
     }
 }
示例#4
0
        private void DrawWatches(Graphics g)
        {
            Hashtable watchTeeth = new Hashtable(TcData.ListToothGraphics.Count);

            for (int t = 0; t < TcData.ListToothGraphics.Count; t++)       //loop through each adult tooth
            {
                ToothGraphic toothGraphic = TcData.ListToothGraphics[t];
                //If a tooth is marked to be watched then it is always visible, even if the tooth is missing/hidden.
                if (toothGraphic.ToothID == "implant" || !toothGraphic.Watch || Tooth.IsPrimary(toothGraphic.ToothID))
                {
                    continue;
                }
                watchTeeth[toothGraphic.ToothID] = toothGraphic;
            }
            for (int t = 0; t < TcData.ListToothGraphics.Count; t++)       //loop through each primary tooth
            {
                ToothGraphic toothGraphic = TcData.ListToothGraphics[t];
                //If a tooth is marked to be watched then it is always visible, even if the tooth is missing/hidden.
                if (toothGraphic.ToothID == "implant" || !toothGraphic.Watch || !Tooth.IsPrimary(toothGraphic.ToothID) || !toothGraphic.Visible)
                {
                    continue;
                }
                watchTeeth[Tooth.PriToPerm(toothGraphic.ToothID)] = toothGraphic;
            }
            foreach (DictionaryEntry toothGraphic in watchTeeth)
            {
                RenderToothWatch(g, (ToothGraphic)toothGraphic.Value);
            }
        }
 private float GetTransYocclusal(string tooth_id)
 {
     if (ToothGraphic.IsMaxillary(tooth_id))
     {
         return(Height / 2 - 48f);
     }
     return(Height / 2 + 48f);
 }
示例#6
0
 ///<summary>Sets the specified permanent tooth to primary. Works as follows: Sets ShowPrimaryLetter to true for the perm tooth.  Makes pri tooth visible=true.  Also repositions perm tooth by translating -Y.  Moves primary tooth slightly to M or D sometimes for better alignment.  And if 2nd primary molar, then because of the larger size, it must move all perm molars to distal.</summary>
 public void SetPrimary(string toothID)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     if (Tooth.IsPrimary(toothID))
     {
         return;
     }
     tcData.ListToothGraphics[toothID].ShiftO -= 12;
     if (ToothGraphic.IsValidToothID(Tooth.PermToPri(toothID)))             //if there's a primary tooth at this location
     {
         tcData.ListToothGraphics[Tooth.PermToPri(toothID)].Visible = true; //show the primary.
         tcData.ListToothGraphics[toothID].ShowPrimaryLetter        = true;
     }
     //first pri mand molars, shift slightly to M
     if (toothID == "21")
     {
         tcData.ListToothGraphics["J"].ShiftM += 0.5f;
     }
     if (toothID == "28")
     {
         tcData.ListToothGraphics["S"].ShiftM += 0.5f;
     }
     //second pri molars are huge, so shift distally for space
     //and move all the perm molars distally too
     if (toothID == "4")
     {
         tcData.ListToothGraphics["A"].ShiftM -= 0.5f;
         tcData.ListToothGraphics["1"].ShiftM -= 1;
         tcData.ListToothGraphics["2"].ShiftM -= 1;
         tcData.ListToothGraphics["3"].ShiftM -= 1;
     }
     if (toothID == "13")
     {
         tcData.ListToothGraphics["J"].ShiftM  -= 0.5f;
         tcData.ListToothGraphics["14"].ShiftM -= 1;
         tcData.ListToothGraphics["15"].ShiftM -= 1;
         tcData.ListToothGraphics["16"].ShiftM -= 1;
     }
     if (toothID == "20")
     {
         tcData.ListToothGraphics["K"].ShiftM  -= 1.2f;
         tcData.ListToothGraphics["17"].ShiftM -= 2.3f;
         tcData.ListToothGraphics["18"].ShiftM -= 2.3f;
         tcData.ListToothGraphics["19"].ShiftM -= 2.3f;
     }
     if (toothID == "29")
     {
         tcData.ListToothGraphics["T"].ShiftM  -= 1.2f;
         tcData.ListToothGraphics["30"].ShiftM -= 2.3f;
         tcData.ListToothGraphics["31"].ShiftM -= 2.3f;
         tcData.ListToothGraphics["32"].ShiftM -= 2.3f;
     }
     Invalidate();
 }
示例#7
0
 ///<summary>Used for missing teeth.  This should always be done before setting restorations, because a pontic will cause the tooth to become visible again except for the root.  So if setMissing after a pontic, then the pontic can't show.</summary>
 public void SetMissing(string toothID)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     tcData.ListToothGraphics[toothID].Visible = false;
     Invalidate();
 }
示例#8
0
 ///<summary>A series of color settings will result in the last ones entered overriding earlier entries.</summary>
 public void SetSurfaceColors(string toothID, string surfaces, Color color)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     tcData.ListToothGraphics[toothID].SetSurfaceColors(surfaces, color);
     Invalidate();
 }
示例#9
0
 ///<summary>Set this tooth to show a sealant</summary>
 public void SetSealant(string toothID, Color color)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     tcData.ListToothGraphics[toothID].IsSealant    = true;
     tcData.ListToothGraphics[toothID].colorSealant = color;
     Invalidate();
 }
示例#10
0
 ///<summary>This draws a big red extraction X right on top of the tooth.  It's up to the calling application to figure out when it's appropriate to do this.  Even if the tooth has been marked invisible, there's a good chance that this will still get drawn because a tooth can be set visible again for the drawing the pontic.  So the calling application needs to figure out when it's appropriate to draw the X, and not set this otherwise.</summary>
 public void SetBigX(string toothID, Color color)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     tcData.ListToothGraphics[toothID].DrawBigX = true;
     tcData.ListToothGraphics[toothID].colorX   = color;
     Invalidate();
 }
        ///<summary>In control coords rather than mm.</summary>
        private float GetTransYfacial(string tooth_id)
        {
            float basic = 30;

            if (ToothGraphic.IsMaxillary(tooth_id))
            {
                return(Height / 2 - basic);
            }
            return(Height / 2 + basic);
        }
示例#12
0
 public void SetMobility(string toothID, string mobility, Color color)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     tcData.ListToothGraphics[toothID].Mobility      = mobility;
     tcData.ListToothGraphics[toothID].colorMobility = color;
     Invalidate();
 }
示例#13
0
 ///<summary>Set this tooth to show a 'W' to indicate that the tooth is being watched.</summary>
 public void SetWatch(string toothID, Color color)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     tcData.ListToothGraphics[toothID].Watch      = true;
     tcData.ListToothGraphics[toothID].colorWatch = color;
     Invalidate();
 }
示例#14
0
 ///<summary>This is just the same as SetMissing, except that it also hides the number from showing.  This is used, for example, if premolars are missing, and ortho has completely closed the space.  User will not be able to select this tooth because the number is hidden.</summary>
 public void SetHidden(string toothID)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     tcData.ListToothGraphics[toothID].Visible    = false;
     tcData.ListToothGraphics[toothID].HideNumber = true;
     Invalidate();
 }
示例#15
0
 ///<summary></summary>
 private void DrawFacialView(ToothGraphic toothGraphic, Graphics g)
 {
     /*
      * if(toothGraphic.Visible
      || (toothGraphic.IsCrown && toothGraphic.IsImplant)
      || toothGraphic.IsPontic) {
      ||     //DrawTooth(toothGraphic,g);
      ||}
      ||float w=0;
      ||if(!Tooth.IsPrimary(toothGraphic.ToothID)) {
      ||     w=ToothGraphic.GetWidth(toothGraphic.ToothID)/TcData.ScaleMmToPix;
      ||             // /TcData.WidthProjection*(float)Width;
      ||}
      ||if(!Tooth.IsPrimary(toothGraphic.ToothID) && (!toothGraphic.Visible || toothGraphic.IsPontic)) {
      ||     if(ToothGraphic.IsMaxillary(toothGraphic.ToothID)) {
      ||             //g.FillRectangle(new SolidBrush(colorBackSimple),x-w/2f,0,w,Height/2f-20);
      ||     }
      ||     else {
      ||             //g.FillRectangle(new SolidBrush(colorBackSimple),x-w/2f,Height/2f+20,w,Height/2f-20);
      ||     }
      ||}*/
     if (toothGraphic.DrawBigX)
     {
         float x     = TcData.GetTransXpix(toothGraphic.ToothID);
         float y     = TcData.GetTransYfacialPix(toothGraphic.ToothID);
         float halfw = 6f * TcData.PixelScaleRatio;
         float halfh = 29f * TcData.PixelScaleRatio;            //58;
         //float offsety=73;
         //toothGraphic.colorX
         //if(ToothGraphic.IsMaxillary(toothGraphic.ToothID)) {
         //g.DrawLine(new Pen(toothGraphic.colorX),x-halfxwidth,Height/2f-offsetofx-xheight,x+halfxwidth,Height/2f-offsetofx);
         //g.DrawLine(new Pen(toothGraphic.colorX),x+halfxwidth,Height/2f-offsetofx-xheight,x-halfxwidth,Height/2f-offsetofx);
         g.DrawLine(new Pen(toothGraphic.colorX, 2f * TcData.PixelScaleRatio), x - halfw, y - halfh, x + halfw, y + halfh);
         g.DrawLine(new Pen(toothGraphic.colorX, 2f * TcData.PixelScaleRatio), x + halfw, y - halfh, x - halfw, y + halfh);
         //}
         //else {//Mandible
         //g.DrawLine(new Pen(toothGraphic.colorX),x-halfxwidth,Height/2f+offsetofx+xheight,x+halfxwidth,Height/2f+offsetofx);
         //g.DrawLine(new Pen(toothGraphic.colorX),x+halfxwidth,Height/2f+offsetofx+xheight,x-halfxwidth,Height/2f+offsetofx);
         //	g.DrawLine(new Pen(toothGraphic.colorX),x-halfw,y+halfh,x+halfw,y);
         //	g.DrawLine(new Pen(toothGraphic.colorX),x+halfw,y+halfh,x-halfw,y);
         //}
     }
     //if(toothGraphic.Visible && toothGraphic.IsRCT) {//draw RCT
     //x=,y= etc
     //toothGraphic.colorRCT
     //?
     //}
     //if(toothGraphic.Visible && toothGraphic.IsBU) {//BU or Post
     //?
     //}
     //if(toothGraphic.IsImplant) {
     //?
     //}
 }
        ///<summary>Pri or perm tooth numbers are valid.  Only locations of perm teeth are stored.  This also converts mm to screen pixels.</summary>
        private float GetTransX(string tooth_id)
        {
            int toothInt = ToothGraphic.IdToInt(tooth_id);

            if (toothInt == -1)
            {
                throw new ApplicationException("Invalid tooth number: " + tooth_id); //only for debugging
            }
            float xmm = ToothGraphic.GetDefaultOrthoXpos(toothInt);                  //in +/- mm from center

            return((WidthProjection / 2f + xmm) * Width / WidthProjection);
        }
示例#17
0
 ///<summary>This will mostly only be successful on certain anterior teeth.   For others, it will just show F coloring.</summary>
 public void SetVeneer(string toothID, Color color)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     tcData.ListToothGraphics[toothID].SetSurfaceColors("BFV", color);
     tcData.ListToothGraphics[toothID].SetGroupColor(ToothGroupType.EnamelF, color);
     tcData.ListToothGraphics[toothID].SetGroupColor(ToothGroupType.DF, color);
     tcData.ListToothGraphics[toothID].SetGroupColor(ToothGroupType.MF, color);
     tcData.ListToothGraphics[toothID].SetGroupColor(ToothGroupType.IF, color);
     Invalidate();
 }
示例#18
0
 ///<summary>Set this tooth to show a BU or post.</summary>
 public void SetBU(string toothID, Color color)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     //TcData.ListToothGraphics[toothID].IsBU=true;
     //TcData.ListToothGraphics[toothID].colorBU=color;
     //Buildups are now just another group, so
     tcData.ListToothGraphics[toothID].SetGroupVisibility(ToothGroupType.Buildup, true);
     tcData.ListToothGraphics[toothID].SetGroupColor(ToothGroupType.Buildup, color);
     Invalidate();
 }
示例#19
0
 ///<summary>Moves position of tooth.  Rotations first in order listed, then translations.  Tooth doesn't get moved immediately, just when painting.  All changes are cumulative and are in addition to any previous translations and rotations.</summary>
 public void MoveTooth(string toothID, float rotate, float tipM, float tipB, float shiftM, float shiftO, float shiftB)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     tcData.ListToothGraphics[toothID].ShiftM += shiftM;
     tcData.ListToothGraphics[toothID].ShiftO += shiftO;
     tcData.ListToothGraphics[toothID].ShiftB += shiftB;
     tcData.ListToothGraphics[toothID].Rotate += rotate;
     tcData.ListToothGraphics[toothID].TipM   += tipM;
     tcData.ListToothGraphics[toothID].TipB   += tipB;
     Invalidate();
 }
 ///<summary>This draws a big red extraction X right on top of the tooth.  It's up to the calling application to figure out when it's appropriate to do this.  Even if the tooth has been marked invisible, there's a good chance that this will still get drawn because a tooth can be set visible again for the drawing the pontic.  So the calling application needs to figure out when it's appropriate to draw the X, and not set this otherwise.</summary>
 public void SetBigX(string toothID, Color color)
 {
     if (simpleMode)
     {
         if (!ToothGraphic.IsValidToothID(toothID))
         {
             return;
         }
         ListToothGraphics[toothID].DrawBigX = true;
         ListToothGraphics[toothID].colorX   = color;
     }
     else
     {
         toothChart.SetBigX(toothID, color);
     }
 }
 ///<summary></summary>
 public void SetSurfaceColors(string toothID, string surfaces, Color color)
 {
     if (simpleMode)
     {
         if (!ToothGraphic.IsValidToothID(toothID))
         {
             return;
         }
         ListToothGraphics[toothID].SetSurfaceColors(surfaces, color);
         this.Invalidate();
     }
     else
     {
         toothChart.SetSurfaceColors(toothID, surfaces, color);
     }
 }
示例#22
0
 ///<summary>This is used for crowns and for retainers.  Crowns will be visible on missing teeth with implants.  Crowns are visible on F and O views, unlike ponics which are only visible on F view.  If the tooth is not visible, that should be set before this call, because then, this will set the root invisible.</summary>
 public void SetCrown(string toothID, Color color)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     tcData.ListToothGraphics[toothID].IsCrown = true;
     if (!tcData.ListToothGraphics[toothID].Visible)             //tooth not visible, so set root invisible.
     {
         tcData.ListToothGraphics[toothID].SetGroupVisibility(ToothGroupType.Cementum, false);
     }
     tcData.ListToothGraphics[toothID].SetSurfaceColors("MODBLFIV", color);
     tcData.ListToothGraphics[toothID].SetGroupColor(ToothGroupType.Enamel, color);
     tcData.ListToothGraphics[toothID].SetGroupColor(ToothGroupType.EnamelF, color);
     this.Invalidate();
 }
 ///<summary>Used for missing teeth.  This should always be done before setting restorations, because a pontic will cause the tooth to become visible again except for the root.  So if setInvisible after a pontic, then the pontic can't show.</summary>
 public void SetInvisible(string toothID)
 {
     if (simpleMode)
     {
         if (!ToothGraphic.IsValidToothID(toothID))
         {
             return;
         }
         ListToothGraphics[toothID].Visible = false;
         this.Invalidate();
     }
     else
     {
         toothChart.SetInvisible(toothID);
     }
 }
 ///<summary>Set this tooth to show a sealant</summary>
 public void SetSealant(string toothID, Color color)
 {
     if (simpleMode)
     {
         if (!ToothGraphic.IsValidToothID(toothID))
         {
             return;
         }
         ListToothGraphics[toothID].IsSealant    = true;
         ListToothGraphics[toothID].colorSealant = color;
     }
     else
     {
         toothChart.SetSealant(toothID, color);
     }
 }
 ///<summary>This is just the same as SetInvisible, except that it also hides the number from showing.  This is used, for example, if premolars are missing, and ortho has completely closed the space.  User will not be able to select this tooth because the number is hidden.</summary>
 public void HideTooth(string toothID)
 {
     if (simpleMode)
     {
         if (!ToothGraphic.IsValidToothID(toothID))
         {
             return;
         }
         ListToothGraphics[toothID].Visible    = false;
         ListToothGraphics[toothID].HideNumber = true;
         this.Invalidate();
     }
     else
     {
         toothChart.HideTooth(toothID);
     }
 }
        ///<summary>Draws the number and the rectangle behind it.  Draws in the appropriate color</summary>
        private void DrawNumber(int intTooth, bool isSelected, bool isFullRedraw, Graphics g)
        {
            string tooth_id   = intTooth.ToString();
            string displayNum = intTooth.ToString();
            bool   hideNumber = false;
            string pri        = ToothGraphic.PermToPri(tooth_id);

            try{
                if (ToothGraphic.IsValidToothID(pri) &&            //pri is valid
                    ListToothGraphics[pri].Visible)                       //and pri visible
                {
                    tooth_id = pri;
                }
                if (isFullRedraw && ListToothGraphics[tooth_id].HideNumber) //if redrawing all numbers, and this is a "hidden" number
                {
                    return;                                                 //skip
                }
                displayNum = tooth_id;
                if (useInternational)
                {
                    displayNum = ToothGraphic.ToInternat(displayNum);
                }
                hideNumber = ListToothGraphics[tooth_id].HideNumber;
            }
            catch {
                //must be design mode.
            }
            RectangleF rec = GetNumberRec(tooth_id, g);

            if (isSelected)
            {
                g.FillRectangle(new SolidBrush(colorBackHighlight), rec);
                if (!hideNumber)                //Only draw if number is not hidden.
                {
                    g.DrawString(displayNum, Font, new SolidBrush(colorTextHighlight), rec.X, rec.Y);
                }
            }
            else
            {
                g.FillRectangle(new SolidBrush(colorBackground), rec);
                if (!hideNumber)                 //Only draw if number is not hidden.
                {
                    g.DrawString(displayNum, Font, new SolidBrush(colorText), rec.X, rec.Y);
                }
            }
        }
示例#27
0
 ///<summary>This is used for any pontic, including bridges, full dentures, and partials.  It is usually used on a tooth that has already been set invisible.  This routine cuases the tooth to show again, but the root needs to be invisible.  Then, it sets the entire crown to the specified color.  If the tooth is already visible, then it does not set the root invisible.</summary>
 public void SetPontic(string toothID, Color color)
 {
     if (!ToothGraphic.IsValidToothID(toothID))
     {
         return;
     }
     tcData.ListToothGraphics[toothID].IsPontic = true;
     if (!tcData.ListToothGraphics[toothID].Visible)
     {
         //tooth not visible, but since IsPontic changes the visibility behavior of the tooth, we need to set the root invisible.
         tcData.ListToothGraphics[toothID].SetGroupVisibility(ToothGroupType.Cementum, false);
     }
     tcData.ListToothGraphics[toothID].SetSurfaceColors("MODBLFIV", color);
     tcData.ListToothGraphics[toothID].SetGroupColor(ToothGroupType.Enamel, color);
     tcData.ListToothGraphics[toothID].SetGroupColor(ToothGroupType.EnamelF, color);
     Invalidate();
 }
 ///<summary>Used by mousedown and mouse move to set teeth selected or unselected.  Also used externally to set teeth selected.  Draws the changes also.</summary>
 public void SetSelected(int intTooth, bool setValue)
 {
     if (simpleMode)
     {
         Graphics g = this.CreateGraphics();
         if (setValue)
         {
             ALSelectedTeeth.Add(intTooth);
             DrawNumber(intTooth, true, false, g);
         }
         else
         {
             ALSelectedTeeth.Remove(intTooth);
             DrawNumber(intTooth, false, false, g);
         }
         RectangleF recF = GetNumberRec(intTooth.ToString(), g);
         Rectangle  rec  = new Rectangle((int)recF.X, (int)recF.Y, (int)recF.Width, (int)recF.Height);
         Invalidate(rec);
         Application.DoEvents();
         if (ALSelectedTeeth.Count == 0)
         {
             selectedTeeth = new string[0];
         }
         else
         {
             selectedTeeth = new string[ALSelectedTeeth.Count];
             for (int i = 0; i < ALSelectedTeeth.Count; i++)
             {
                 if (ToothGraphic.IsValidToothID(ToothGraphic.PermToPri(ALSelectedTeeth[i].ToString())) &&                    //pri is valid
                     ListToothGraphics[ALSelectedTeeth[i].ToString()].ShowPrimary)                       //and set to show pri
                 {
                     selectedTeeth[i] = ToothGraphic.PermToPri(ALSelectedTeeth[i].ToString());
                 }
                 else
                 {
                     selectedTeeth[i] = ((int)ALSelectedTeeth[i]).ToString();
                 }
             }
         }
         g.Dispose();
     }
     else
     {
         toothChart.SetSelected(intTooth, setValue);
     }
 }
示例#29
0
 ///<summary>Returns the ToothGraphic with the given toothID.</summary>
 public ToothGraphic this[string toothID] {
     get {
         if (toothID != "implant" && !ToothGraphic.IsValidToothID(toothID))
         {
             throw new ArgumentException("Tooth ID not valid: " + toothID);
         }
         for (int i = 0; i < List.Count; i++)
         {
             if (((ToothGraphic)List[i]).ToothID == toothID)
             {
                 return((ToothGraphic)List[i]);
             }
         }
         return(null);
     }
     set {
         //List[index]=value;
     }
 }
示例#30
0
        private void DrawOcclusalView(ToothGraphic toothGraphic, Graphics g)
        {
            //now the occlusal surface. Absolute pixels instead of mm relative to center.
            float x, y;

            x = TcData.GetTransXpix(toothGraphic.ToothID);
            y = TcData.GetTransYocclusalPix(toothGraphic.ToothID);
            if (toothGraphic.Visible ||        //might not be visible if an implant
                (toothGraphic.IsCrown && toothGraphic.IsImplant)                   //a crown on an implant will paint
                //pontics won't paint, because tooth is invisible
                //but, unlike the regular toothchart, we do want pontics to paint here
                || toothGraphic.IsPontic)
            {
                DrawToothOcclusal(toothGraphic, g);
            }
            if (toothGraphic.Visible &&
                toothGraphic.IsSealant)                  //draw sealant
            //?
            {
            }
        }