Beispiel #1
0
        /// <summary>
        /// 如果该点所在的分块已经存在则返回该分块的指针,否则创建该分块并返回该分块的指针
        /// </summary>
        /// <param name="point"></param>
        /// <returns></returns>
        //[MethodImplAttribute(MethodImplOptions.Synchronized)]
        public IPart_Edit GOCPartRefByPoint(IPosition point)
        {
            //lock (this)
            {
                int x, y;
                x = ConvertRealValueToPartSequenceX(point.GetX());
                y = ConvertRealValueToPartSequenceY(point.GetY());

                IPart_Edit queryPart = queryTable.GetPartRef(x, y);

                //lock (queryTable)
                {
                    if (queryPart == null)
                    {
                        queryPart = queryTable.CreateAndGetPartRef(x, y);
                        queryPart.SetX(x);
                        queryPart.SetY(y);

                        //把引起part被创建的一点设定为该part的代表点.
                        queryPart.SetDeputyPoint(point);
                    }
                }

                return(queryPart);
            }
        }