private void AddPoint_Click(object sender, EventArgs e) { if (GetPointY.Length > 0 && GetPointX.Length > 0) { int x = Int32.Parse(GetPointX); GetPointX = ""; int y = Int32.Parse(GetPointY); GetPointY = ""; int[] point = { x, y }; ListPoints.Add(point); ListPointDesc.Add($"Вершина с координатой: {x}; {y}"); setListBoxPoints(); } }
/// <summary> /// Adds point to this cluster only if it is "reachable" /// (if point is inside a circle of radius Dist of any cluster's points ) /// </summary> /// <returns>false if point can't be added (that is either already in cluster /// or it is unreachable from any of the cluster's points)</returns> internal virtual bool AddObject(CacheObject obj) { bool l_bSuccess = true; if (!ContainsObject(obj) && IsPointReachable(obj.PointPosition)) { ListCacheObjects.Add(obj); ListPoints.Add(obj.PointPosition); RAGUIDS.Add(obj.RAGUID); MidPoint += obj.PointPosition; } else { l_bSuccess = false; } return(l_bSuccess); } // of AddPoint()
} // of overloaded constructor public Cluster(double pDist, BlPoint pPoint) : this(pDist) { ListPoints.Add(pPoint); } // of overloaded constructor
} // of overloaded constructor public cluster(double p_Dist, CacheObject obj) : this(p_Dist) { ListPoints.Add(obj.PointPosition); MidPoint = obj.PointPosition; } // of overloaded constructor