Ejemplo n.º 1
0
        public void Set(MarkPoint mkp)
        {
            CadFigure fig        = mkp.Figure;
            int       pointIndex = mkp.PointIndex;

            int cnt = fig.PointList.Count;

            if (cnt < 2)
            {
                return;
            }

            if (!fig.IsLoop)
            {
                if (pointIndex == cnt - 1)
                {
                    Ruler[RCount] = CadRuler.Create(fig, pointIndex - 1, pointIndex);
                    RCount++;
                    return;
                }
                else if (pointIndex == 0)
                {
                    Ruler[RCount] = CadRuler.Create(fig, 1, 0);
                    RCount++;
                    return;
                }
            }

            int idx0;
            int idx1;

            idx0 = (pointIndex + cnt - 1) % cnt;
            idx1 = pointIndex;

            Debug.Assert(idx0 >= 0 && idx0 < cnt);

            Ruler[RCount] = CadRuler.Create(fig, idx0, idx1);
            RCount++;

            idx0 = (pointIndex + 1) % cnt;
            idx1 = pointIndex;

            Debug.Assert(idx0 >= 0 && idx0 < cnt);

            Ruler[RCount] = CadRuler.Create(fig, idx0, idx1);
            RCount++;
        }
Ejemplo n.º 2
0
 public void Set(MarkSegment mks, DrawContext dc)
 {
     Ruler[RCount] = CadRuler.Create(mks.Figure, mks.PtIndexA, mks.PtIndexB);
     RCount++;
 }