/// Event handler for type change menu item private void ChangeType(object sender, EventArgs e) { SpiroInstance si; if ( CurrentSpiro is Epitrochoid ) si=new Hypotrochoid(); else si=new Epitrochoid(); // clone all values from current si.Clone(CurrentSpiro); // replace current with new spiros[current]=si; Invalidate(); UpdateFloatingButton(); }
private void SpiroComplete(object sender, EventArgs e) { SpiroInstance si=sender as SpiroInstance; if ( numSpiros < 4 ) { SpiroInstance next; if ( (numSpiros % 2) == 1 ) { next=new Epitrochoid(); } else { next=new Hypotrochoid(); } next.ShowTrace=false; next.Randomise=false; next.MaxRandomDiameter=Math.Min(Bounds.Width, Bounds.Height) / 4; AutoRandom(next); spiroCanvas1.AddSpiro(next); numSpiros++; } AutoRandom(si); }
/// Add a new default epitrochoid public void AddEpitrochoid() { SpiroInstance si=new Epitrochoid(); spiros.Add(si); }
// see description in base class public override SpiroInstance Clone() { SpiroInstance clone=new Epitrochoid(); clone.Clone(this); return clone; }