Exemplo n.º 1
0
        public int addPoint(SketchPoint point)     //加入点(被取代)
        {
            KeyValuePair <int, int> temID = new KeyValuePair <int, int>(point.GetID()[0], point.GetID()[1]);

            if (!idToIndex.ContainsKey(temID))
            {
                for (int i = 0; i < pois.Count; i++)
                {
                    if (point.X == pois[i].x && point.Y == pois[i].y && point.Z == pois[i].z)
                    {
                        return(i);
                    }
                }

                newPoint temPoint = new newPoint(point);
                pois.Add(temPoint);
                temPoint.setIndex(pois.Count - 1);
                idToIndex.Add(temID, pois.Count - 1);
                indexToId.Add(pois.Count - 1, temID);
                return(pois.Count - 1);
            }
            else
            {
                return(idToIndex[temID]);
            }
        }
Exemplo n.º 2
0
        public newPoint(SketchPoint poi)
        {
            ori = poi;
            ID  = new KeyValuePair <int, int>(poi.GetID()[0], poi.GetID()[1]);
            x   = poi.X;
            y   = poi.Y;
            z   = poi.Z;

            ox = 0;
            oy = 0;
            oz = 0;

            next    = new List <int>();
            nextSeg = new List <KeyValuePair <int, int> >();

            nextSegs = new List <int>();
        }
Exemplo n.º 3
0
        public int findPoint(SketchPoint point)     //通过点的源数据找到点的索引
        {
            KeyValuePair <int, int> ID = new KeyValuePair <int, int>(point.GetID()[0], point.GetID()[1]);

            //int id1 = point.GetID()[0];
            //int id2 = point.GetID()[1];
            for (int i = 0; i < pois.Count; i++)
            {
                if (ID.Key == pois[i].ID.Key && ID.Value == pois[i].ID.Value)
                {
                    return(pois[i].index);
                }
            }
            return(-1);
        }