Revit.SDK.Samples.CurtainWallGrid.CS.GridDrawing.GetOutlineIndexes C# (CSharp) Méthode

GetOutlineIndexes() private méthode

get which segment contains the specified point, if the segment contains the point, return the index of the segment in the grid line
private GetOutlineIndexes ( List segList, System point ) : List
segList List /// the segment list to be checked with the specified point ///
point System /// the point which need to be checked ///
Résultat List
        private List<int> GetOutlineIndexes(List<SegmentLine2D> segList, System.Drawing.Point point)
        {
            List<int> resultIndexes = new List<int>();

             for (int i = 0; i < segList.Count; i++)
             {
            SegmentLine2D seg = segList[i];

            if (true == seg.Removed ||
                true == seg.Isolated)
            {
               continue;
            }

            Pen redPen = Pens.Red;
            // the specified point is one of the end points of the current segment
            System.Drawing.Point[] points = { seg.StartPoint, seg.EndPoint };
            foreach (System.Drawing.Point p in points)
            {
               bool equal = IsPointsEqual(p, point);
               if (true == equal)
               {
                  resultIndexes.Add(i);
               }
            }
             }

             return resultIndexes;
        }