Example #1
0
        /// <summary>
        /// Get the significant details of what needs approval
        /// </summary>
        /// <returns>A list of strings</returns>
        public override IDictionary <string, string> SignificantDetails()
        {
            IDictionary <string, string> returnList = base.SignificantDetails();

            returnList.Add("Collective", CollectiveNoun);
            returnList.Add("Starting Zone", StartingLocation.Name);
            returnList.Add("Recall Zone", EmergencyLocation.Name);

            returnList.Add("Head", Head.Name);
            returnList.Add("Torso", Torso.Name);
            returnList.Add("Legs", string.Format("{1} {0}", Legs.Item.Name, Legs.Amount));
            returnList.Add("Arms", string.Format("{1} {0}", Arms.Item.Name, Arms.Amount));
            returnList.Add("Blood", SanguinaryMaterial.Name);
            returnList.Add("Teeth", TeethType.ToString());
            returnList.Add("Breathes", Breathes.ToString());
            returnList.Add("Diet", DietaryNeeds.ToString());
            returnList.Add("Vision Range", string.Format("{0} - {1}", VisionRange.Low, VisionRange.High));
            returnList.Add("Temperature Tolerance", string.Format("{0} - {1}", TemperatureTolerance.Low, TemperatureTolerance.High));

            foreach (BodyPart part in BodyParts)
            {
                returnList.Add("Body Parts", string.Format("{0} - {1} ({2})", part.Part.Amount.ToString(), part.Part.Item.Name, part.Name));
            }

            return(returnList);
        }
Example #2
0
        public async Task <int> SaveTeethType(TeethType teethType)
        {
            if (teethType.Id != 0)
            {
                _context.TeethTypes.Update(teethType);

                await _context.SaveChangesAsync();

                return(1);
            }
            else
            {
                await _context.TeethTypes.AddAsync(teethType);

                await _context.SaveChangesAsync();

                return(1);
            }
        }
Example #3
0
        private ToothType GetAllPointsUpper()
        {
            int idx_up = Idx_Templates(UpperToothList);

            if (idx_up > 0)
            {
                SmileDesign_Page currentPage = (System.Windows.Application.Current.MainWindow.Content) as SmileDesign_Page;
                ToothType        uppertooth  = currentPage.ToothControl.UpperTooth[idx_up - 1];
                ToothType        sizechaged  = new ToothType();

                Point minPoint = Numerics.GetMinXY_Tooth(uppertooth);
                Point maxPoint = Numerics.GetMaxXY_Tooth(uppertooth);

                double nosewidth = ((LineGeometry)(currentPage.noseline_R.Data)).StartPoint.X - ((LineGeometry)(currentPage.noseline_L.Data)).StartPoint.X;

                ratiox = nosewidth / (maxPoint.X - minPoint.X);

                foreach (var temp in uppertooth)
                {
                    TeethType changed = new TeethType();

                    foreach (var teethtemp in (TeethType)temp)
                    {
                        PointViewModel pt = teethtemp;
                        pt.X *= ratiox;
                        pt.Y *= ratiox;

                        changed.Add(pt);
                    }
                    sizechaged.Add(changed);
                }

                return(sizechaged);
            }
            //return ((SmileDesign_Page)(Application.Current.MainWindow).Content).ToothControl.UpperTooth[idx_up - 1];
            return(null);
        }
Example #4
0
        public MainWindow()
        {
            InitializeComponent();
            DataContext = new MainViewModel();

            // Set data for UpperTooth.
            UpperTooth = new ToothList();
            UpperGuide = new Point(450, 100);
            for (int k = 0; k < 5; k++)
            {
                ToothType template = new ToothType();
                for (int i = 0; i < 6; i++)
                {
                    TeethType teeth = new TeethType();
                    for (int j = 0; j < 10; j++)
                    {
                        if (i >= 0 && i < 3)
                        {
                            teeth.Add(new PointViewModel(UpperX[k, i, j] + UpperGuide.X, UpperY[k, i, j] + UpperGuide.Y, j));
                        }
                        else
                        {
                            teeth.Add(new PointViewModel(-1 * UpperX[k, i - 3, j] + UpperGuide.X, UpperY[k, i - 3, j] + UpperGuide.Y, j));
                        }
                    }
                    template.Add(teeth);
                }
                UpperTooth.Add(template);
            }

            // Set data for LowerTooth.
            LowerTooth = new ToothList();
            LowerGuide = new Point(450, 300);
            for (int k = 0; k < 5; k++)
            {
                ToothType tooth = new ToothType();
                for (int i = 0; i < 4; i++)
                {
                    TeethType teeth = new TeethType();
                    for (int j = 0; j < 10; j++)
                    {
                        if (i >= 0 && i < 2)
                        {
                            teeth.Add(new PointViewModel(LowerX[k, i, j] + LowerGuide.X, LowerY[k, i, j] + LowerGuide.Y, j));
                        }
                        else
                        {
                            teeth.Add(new PointViewModel(-1 * LowerX[k, i - 2, j] + LowerGuide.X, LowerY[k, i - 2, j] + LowerGuide.Y, j));
                        }
                    }
                    tooth.Add(teeth);
                }
                LowerTooth.Add(tooth);
            }

            // Set global dictionary.
            dic = new Dictionary <string, int>();
            dic.Add("CanineL", 5);
            dic.Add("LateralIncisorL", 4);
            dic.Add("CentralIncisorL", 3);
            dic.Add("CentralIncisorR", 0);
            dic.Add("LateralIncisorR", 1);
            dic.Add("CanineR", 2);
        }