示例#1
0
        public static List <List <Point> > ToothToList(FrameworkElement tooth)
        {
            WrapTooth wrap = null;

            if (tooth is UpperTooth)
            {
                UpperTooth th = tooth as UpperTooth;
                wrap = th.WrapTooth_UpperTooth;
            }
            else
            {
                LowerTooth th = tooth as LowerTooth;
                wrap = th.WrapTooth_LowerTooth;
            }

            List <List <Point> > list = new List <List <Point> >();

            foreach (ObservableCollection <PointViewModel> t in wrap.Points)
            {
                List <Point> sublist = new List <Point>();
                foreach (PointViewModel p in t)
                {
                    sublist.Add(new Point(p.X, p.Y));
                }
                list.Add(sublist);
            }
            return(list);
        }
示例#2
0
        public static List <List <Point> > ToothToList(FrameworkElement tooth)
        {
            WrapTooth wrap = tooth.FindName("WrapToothInTooth") as WrapTooth;

            List <List <Point> > list = new List <List <Point> >();

            foreach (ObservableCollection <PointViewModel> t in wrap.Points)
            {
                List <Point> sublist = new List <Point>();
                foreach (PointViewModel p in t)
                {
                    sublist.Add(new Point(p.X, p.Y));
                }
                list.Add(sublist);
            }
            return(list);
        }
示例#3
0
        public static Point GetMinPoint(WrapTooth t)
        {
            double minX = double.MaxValue;
            double minY = double.MaxValue;

            foreach (TeethType pts in t.Points)
            {
                foreach (PointViewModel point in pts)
                {
                    if (point.X < minX)
                    {
                        minX = point.X;
                    }
                    if (point.Y < minY)
                    {
                        minY = point.Y;
                    }
                }
            }
            return(new Point(minX, minY));
        }
示例#4
0
        public static Point GetMaxPoint(WrapTooth t)
        {
            double maxX = double.MinValue;
            double maxY = double.MinValue;

            foreach (TeethType pts in t.Points)
            {
                foreach (PointViewModel point in pts)
                {
                    if (point.X > maxX)
                    {
                        maxX = point.X;
                    }
                    if (point.Y > maxY)
                    {
                        maxY = point.Y;
                    }
                }
            }
            return(new Point(maxX, maxY));
        }