示例#1
0
 private void Draw(ICurve theCurve)
 {
     if (theCurve is CompositeCurve)
     {
         CompositeCurve compositeCurve = theCurve as CompositeCurve;
         Entity[]       explodedCurves = compositeCurve.Explode();
         foreach (Entity ent in explodedCurves)
         {
             DrawScreenCurve((ICurve)ent);
         }
     }
     else
     {
         DrawScreenCurve(theCurve);
     }
 }
示例#2
0
        private void explodeButton_OnClick(object sender, RoutedEventArgs e)
        {
            for (int i = model1.Entities.Count - 1; i >= 0; i--)
            {
                Entity ent = model1.Entities[i];

                if (ent.Selected)
                {
                    if (ent is BlockReference)
                    {
                        model1.Entities.RemoveAt(i);

                        BlockReference br = (BlockReference)ent;

                        Entity[] entList = model1.Entities.Explode(br);

                        model1.Entities.AddRange(entList);
                    }

                    else if (ent is CompositeCurve)
                    {
                        model1.Entities.RemoveAt(i);

                        CompositeCurve cc = (CompositeCurve)ent;

                        model1.Entities.AddRange(cc.Explode());
                    }

                    else if (ent.GroupIndex > -1)
                    {
                        model1.Ungroup(ent.GroupIndex);
                    }
                }
            }

            model1.Invalidate();
        }