示例#1
0
        public override void DeleteVertex(SplineLinePoint lcp)
        {
            if (lcp is SplineSegmentLinePoint)
            {
                SplineSegmentLinePoint lcpNew = lcp as SplineSegmentLinePoint;

                RemoveFromAllCollections(lcpNew.inSeg);
                RemoveFromAllCollections(lcpNew.outSeg);

                if ((lcp.prev != null) & (lcp.next != null))
                {
                    SegmentSpline seg = new SegmentSpline();
                    seg.startPoint = lcp.prev as ISegmentPoint;
                    seg.endPoint   = lcp.next as ISegmentPoint;
                    seg.spline     = lcp.spline;
                    _segment.Add(seg);

                    AddTube(seg);

                    lcp.prev.next = lcp.next;
                }

                lcpNew.spline = null;
                _point.Remove(lcpNew);
            }
        }
示例#2
0
        private void AddSegment(SplineSegmentLinePoint lcp)
        {
            if (lcp == null)
            {
                return;
            }

            if (lcp.next != null)
            {
                RemoveFromAllCollections(((SplineSegmentLinePoint)lcp.next).inSeg);

                SegmentSpline seg = new SegmentSpline();
                seg.startPoint = lcp as ISegmentPoint;
                seg.endPoint   = lcp.next as ISegmentPoint;
                seg.spline     = lcp.spline;
                _segment.Add(seg);

                AddTube(seg);
            }

            if (lcp.prev != null)
            {
                RemoveFromAllCollections(((SplineSegmentLinePoint)lcp.prev).outSeg);

                SegmentSpline seg = new SegmentSpline();
                seg.startPoint = lcp.prev as ISegmentPoint;
                seg.endPoint   = lcp as ISegmentPoint;
                seg.spline     = lcp.spline;
                _segment.Add(seg);

                AddTube(seg);
            }
        }
示例#3
0
        public void inSegTest()
        {
            LinePointSegmentSpline lcp = new LinePointSegmentSpline();
            SegmentSpline          seg = new SegmentSpline();

            lcp.inSeg = seg;

            Assert.AreEqual(seg.endPoint, lcp);
        }
示例#4
0
        public void outSegTest()
        {
            LinePointSegmentSpline lcp = new LinePointSegmentSpline();
            SegmentSpline          seg = new SegmentSpline();

            lcp.outSeg = seg;

            Assert.AreEqual(seg.startPoint, lcp);
        }
示例#5
0
        public void inSegNullTest()
        {
            LinePointSegmentSpline lcp = new LinePointSegmentSpline();
            SegmentSpline          seg = new SegmentSpline();

            lcp.inSeg = seg;
            lcp.inSeg = null;

            Assert.IsNull(seg.endPoint);
        }
示例#6
0
        public void outSegNullTest()
        {
            LinePointSegmentSpline lcp = new LinePointSegmentSpline();
            SegmentSpline          seg = new SegmentSpline();

            lcp.outSeg = seg;
            lcp.outSeg = null;

            Assert.IsNull(seg.startPoint);
        }
示例#7
0
        private void AddTube(SegmentSpline seg)
        {
            TubeIncline tube = new TubeIncline();

            tube.StartVector = ((SplineLinePoint)seg.startPoint).vert.q;
            tube.StartNormal = ((SplineLinePoint)seg.startPoint).tau;

            tube.EndVector = ((SplineLinePoint)seg.endPoint).vert.q;
            tube.EndNormal = ((SplineLinePoint)seg.endPoint).tau;

            primitiveList.Add(tube);
            modelgroup.Children.Add(tube.model);

            if (colorManager != null)
            {
                tube.color = colorManager.spline;
            }
            tube.Selected += OnPrimitiveSelected;
        }