public ICylData AsCylData(TolType tolType) { try { var pts = new CylData(); foreach (var v in this) { switch (tolType) { case TolType.MAX: pts.Add(new PointCyl(v.RMax, v.ThetaRad, v.Z)); break; case TolType.MIN: pts.Add(new PointCyl(v.RMin, v.ThetaRad, v.Z)); break; case TolType.NOM: pts.Add(new PointCyl(v.RNom, v.ThetaRad, v.Z)); break; } } return(pts); } catch (Exception) { throw; } }
public DisplayData AsDisplayData(ViewPlane viewplane, TolType tolType) { var displayData = new DisplayData(FileName); switch (tolType) { case TolType.MAX: displayData.Color = Color.Red; break; case TolType.MIN: displayData.Color = Color.Blue; break; case TolType.NOM: displayData.Color = Color.Green; break; } displayData.Color = Color; foreach (var v in this) { switch (viewplane) { case ViewPlane.ZR: switch (tolType) { case TolType.MAX: displayData.Add(new PointF((float)v.Z, (float)v.RMax)); break; case TolType.MIN: displayData.Add(new PointF((float)v.Z, (float)v.RMin)); break; case TolType.NOM: displayData.Add(new PointF((float)v.Z, (float)v.RNom)); break; } break; case ViewPlane.THETAR: default: switch (tolType) { case TolType.MAX: displayData.Add(new PointF((float)(v.ThetaDeg), (float)v.RMax)); break; case TolType.MIN: displayData.Add(new PointF((float)(v.ThetaDeg), (float)v.RMin)); break; case TolType.NOM: displayData.Add(new PointF((float)(v.ThetaDeg), (float)v.RNom)); break; } break; } } return(displayData); }