internal override void AddValuePairs(List <DxfCodePair> pairs, DxfAcadVersion version, bool outputHandles)
            {
                pairs.Add(new DxfCodePair(72, (short)4));
                pairs.Add(new DxfCodePair(94, Degree));
                pairs.Add(new DxfCodePair(73, BoolShort(IsRational)));
                pairs.Add(new DxfCodePair(74, BoolShort(IsPeriodic)));
                pairs.Add(new DxfCodePair(95, Knots.Count));
                pairs.Add(new DxfCodePair(96, ControlPoints.Count));
                foreach (var item in Knots)
                {
                    pairs.Add(new DxfCodePair(40, item));
                }

                foreach (var item in ControlPoints)
                {
                    pairs.Add(new DxfCodePair(10, item.Point.X));
                    pairs.Add(new DxfCodePair(20, item.Point.Y));
                }

                if (ControlPoints.Any(cp => cp.Weight != 1.0))
                {
                    foreach (var item in ControlPoints)
                    {
                        pairs.Add(new DxfCodePair(42, item.Weight));
                    }
                }

                pairs.Add(new DxfCodePair(97, FitPoints.Count));
                foreach (var item in FitPoints)
                {
                    pairs.Add(new DxfCodePair(11, item.X));
                    pairs.Add(new DxfCodePair(21, item.Y));
                }

                pairs.Add(new DxfCodePair(12, StartTangent.X));
                pairs.Add(new DxfCodePair(22, StartTangent.Y));
                pairs.Add(new DxfCodePair(13, EndTangent.X));
                pairs.Add(new DxfCodePair(23, EndTangent.Y));
            }
Beispiel #2
0
 protected override void OnParametersSet()
 {
     if (Source != null && Target != null && ControlPointMethods != null)
     {
         if (Source.NodeId != null)
         {
             Source.Node = Diagram.Nodes.Find(Source.NodeId);
             if (Source.Node != null)
             {
                 Source.Node.SizeChanged += SizeChanged;
             }
             FixAnchor(Source);
         }
         if (Target.NodeId != null)
         {
             Target.Node = Diagram.Nodes.Find(Target.NodeId);
             if (Target.Node != null)
             {
                 Target.Node.SizeChanged += SizeChanged;
             }
             FixAnchor(Target);
         }
         Source.CoordinatesChanged = UpdateControlPoints;
         Target.CoordinatesChanged = UpdateControlPoints;
         if (!ControlPoints.Any())
         {
             InitializeControlPoints();
         }
         else
         {
             UpdateControlPoints();
         }
     }
     if (Links.Register(this))
     {
         OnCreate?.Invoke(this);
     }
     base.OnParametersSet();
 }