public void AddPoint(TPoint lcp, LinePointAdditionMethod method) { if (lcp != null) { AddPointComponent comp = new AddPointComponent(); comp.lcp = lcp; comp.collection = new LinePointCollection <TPoint>(linePoint); switch (method) { case LinePointAdditionMethod.last: { comp.strategy = new AddPointStrategyLast(); break; } case LinePointAdditionMethod.first: { comp.strategy = new AddPointStrategyFirst(); break; } } comp.Build(); linePoint.Add(lcp); Sphere sphere = new Sphere(); sphere.r = r; sphere.color = colorManager.spline; sphere.center = lcp.vert.q; AddPrimitive(sphere); } }
public override void AddVertex(SplineLinePoint lcp, LinePointAdditionMethod method) { if (lcp == null) { return; } if (!ConfirmCollection()) { return; } if (lcp is SplineSegmentLinePoint) { SplineSegmentLinePoint lcpNew = lcp as SplineSegmentLinePoint; AddPointComponent component = new AddPointComponent(); component.lcp = lcpNew; component.collection = new LinePointCollection <SplineSegmentLinePoint>(_point); switch (method) { case LinePointAdditionMethod.last: { component.strategy = new AddPointStrategyLast(); break; } case LinePointAdditionMethod.first: { component.strategy = new AddPointStrategyFirst(); break; } case LinePointAdditionMethod.intoSpline: { component.strategy = new AddPointStrategyIntoSpline(); break; } default: { break; } } component.Build(); if ((!component.Complite()) & (_point.Count > 1)) { return; } _point.Add(lcpNew); AddSegment(lcpNew); } }
protected override void AddVertexIntoCollection(LinePointSegmentSpline lcp, LinePointAdditionMethod method) { if (lcp != null) { if (method == LinePointAdditionMethod.intoSpline) { AddPointComponent comp = new AddPointComponent(); comp.lcp = lcp; comp.collection = new LinePointCollection <LinePointSegmentSpline>(pointList); comp.strategy = new AddPointStrategyIntoSpline(); comp.Build(); } else { base.AddVertexIntoCollection(lcp, method); } } }
protected virtual void AddVertexIntoCollection(TPoint lcp, LinePointAdditionMethod method) { AddPointComponent comp = new AddPointComponent(); comp.collection = new LinePointCollection <TPoint>(pointList); comp.lcp = lcp; switch (method) { case LinePointAdditionMethod.last: { comp.strategy = new AddPointStrategyLast(); break; } case LinePointAdditionMethod.first: { comp.strategy = new AddPointStrategyFirst(); break; } } comp.Build(); }
public virtual void AddVertex(TPoint lcp, LinePointAdditionMethod method) { AddVertexIntoCollection(lcp, method); pointList.Add(lcp); if ((lcp.prev != null) & (lcp.next != null)) { TSegment seg = (lcp.prev as LinePointSegment).outSeg as TSegment; RemoveSegment(seg); } if (lcp.prev != null) { TSegment seg = CreateSegment(lcp.prev as TPoint, lcp as TPoint); AddSegment(seg); } if (lcp.next != null) { TSegment seg = CreateSegment(lcp as TPoint, lcp.next as TPoint); AddSegment(seg); } }
public override void AddVertex(LinePointSegmentSpline lcp, LinePointAdditionMethod method) { base.AddVertex(lcp, method); lcp.DistanceIsCritical += OnPointCriticalDistance; }