private void find_sub_elements(IMultiCurve2d multicurve, List <IParametricCurve2d> vAdd) { foreach (IParametricCurve2d curve in multicurve.Curves) { if (curve is IMultiCurve2d) { find_sub_elements(curve as IMultiCurve2d, vAdd); } else { vAdd.Add(curve); } } }
public int CountType(IMultiCurve2d curve, Type t) { int count = 0; foreach (IParametricCurve2d c in curve.Curves) { if (c.GetType() == t) { count++; } if (c is IMultiCurve2d) { count += CountType(c as IMultiCurve2d, t); } } return(count); }