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); } }
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); } }
public void inSegTest() { LinePointSegmentSpline lcp = new LinePointSegmentSpline(); SegmentSpline seg = new SegmentSpline(); lcp.inSeg = seg; Assert.AreEqual(seg.endPoint, lcp); }
public void outSegTest() { LinePointSegmentSpline lcp = new LinePointSegmentSpline(); SegmentSpline seg = new SegmentSpline(); lcp.outSeg = seg; Assert.AreEqual(seg.startPoint, lcp); }
public void inSegNullTest() { LinePointSegmentSpline lcp = new LinePointSegmentSpline(); SegmentSpline seg = new SegmentSpline(); lcp.inSeg = seg; lcp.inSeg = null; Assert.IsNull(seg.endPoint); }
public void outSegNullTest() { LinePointSegmentSpline lcp = new LinePointSegmentSpline(); SegmentSpline seg = new SegmentSpline(); lcp.outSeg = seg; lcp.outSeg = null; Assert.IsNull(seg.startPoint); }
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; }