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]); } }
public void storePoints() //获取点(被取代) { Debug.Print("Storing points: "); object[] temPoi = sket.GetSketchPoints2(); for (int i = 0; i < temPoi.Length; i++) { newPoint tem = new newPoint((SketchPoint)temPoi[i]); tem.setIndex(i); idToIndex.Add(tem.ID, tem.index); indexToId.Add(tem.index, tem.ID); pois.Add(tem); Debug.Print("Point " + i.ToString() + " : (" + tem.ID.Key + ", " + tem.ID.Value + ")"); Debug.Print(tem.x + ", " + tem.y + ", " + tem.z); } }