private void AddDummyProfile(TipoTornitura tipoTornitura) { switch (tipoTornitura) { case TipoTornitura.Esterna: { var profile = new RawProfile(true); var ini = new RawInitPoint2D(profile); ini.X.SetValue(true, 0); ini.Y.SetValue(true, 25); var line1 = new RawLine2D(profile); line1.DeltaX.SetValue(true, -10); var line2 = new RawLine2D(profile); line2.DeltaY.SetValue(true, 10); line2.DeltaX.SetValue(true, -10); var line3 = new RawLine2D(profile); line3.DeltaY.SetValue(true, 10); profile.Add(ini); profile.Add(line1); profile.Add(line2); profile.Add(line3); Profile = profile; } break; case TipoTornitura.Interna: { var profile = new RawProfile(true); var ini = new RawInitPoint2D(profile); ini.X.SetValue(true, 0); ini.Y.SetValue(true, 70); var line1 = new RawLine2D(profile); line1.DeltaX.SetValue(true, -10); var line2 = new RawLine2D(profile); line2.DeltaY.SetValue(true, -10); line2.DeltaX.SetValue(true, -10); var line3 = new RawLine2D(profile); line3.DeltaY.SetValue(true, -10); profile.Add(ini); profile.Add(line1); profile.Add(line2); profile.Add(line3); Profile = profile; } break; } }
public Tornitura(TipoTornitura tipoTornitura) : base() { _tipoTornitura = tipoTornitura; Profile = new RawProfile(true); /* * per evitare danni inserisco punto iniziale qui, * anche se e meglio che venga creato dentro ctorù */ var ini = new RawInitPoint2D(Profile); Profile.Add(ini); ini.X.SetValue(true, 0); // AddDummyProfile(_tipoTornitura); Sgrossatura = new Operazione(this, LavorazioniEnumOperazioni.TornituraSgrossatura); Finitura = new Operazione(this, LavorazioniEnumOperazioni.TornituraFinitura); }