示例#1
0
        private static Fraction GetFraction(BinaryReader br)
        {
            Fraction fra   = new Fraction();
            int      count = br.ReadInt32();

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    FractionPoint pt = new FractionPoint();
                    pt.X = br.ReadInt32();
                    pt.Y = br.ReadInt32();
                    pt.Z = br.ReadInt32();
                    fra.AddPoint(pt);
                }
            }
            return(fra);
        }
示例#2
0
        /// <summary>
        /// 数据库存储
        /// </summary>
        /// <param name="pts"></param>
        public void FromString(string pts)
        {
            m_fractions.Clear();

            string[] ptArray = pts.Split(new string[] { "," },
                StringSplitOptions.RemoveEmptyEntries);
            //
            int ptCnt = ptArray.Length / 3;
            int readTimes = 0;
            for (int i = 0; i < ptArray.Length && readTimes < ptCnt; i += 3)
            {
                FractionPoint pt = new FractionPoint();
                pt.X = System.Convert.ToInt32(ptArray[i]);
                pt.Y = System.Convert.ToInt32(ptArray[i+1]);
                pt.Z = System.Convert.ToInt32(ptArray[i+2]);
                AddPoint(pt);

                readTimes++;
            }
        }
示例#3
0
        /// <summary>
        /// 数据库存储
        /// </summary>
        /// <param name="pts"></param>
        public void FromString(string pts)
        {
            m_fractions.Clear();

            string[] ptArray = pts.Split(new string[] { "," },
                                         StringSplitOptions.RemoveEmptyEntries);
            //
            int ptCnt     = ptArray.Length / 3;
            int readTimes = 0;

            for (int i = 0; i < ptArray.Length && readTimes < ptCnt; i += 3)
            {
                FractionPoint pt = new FractionPoint();
                pt.X = System.Convert.ToInt32(ptArray[i]);
                pt.Y = System.Convert.ToInt32(ptArray[i + 1]);
                pt.Z = System.Convert.ToInt32(ptArray[i + 2]);
                AddPoint(pt);

                readTimes++;
            }
        }
示例#4
0
 public void AddPoint(FractionPoint pt)
 {
     m_fractions.Add(pt);
 }
示例#5
0
 public void AddPoint(FractionPoint pt)
 {
     m_fractions.Add(pt);
 }