private void buttonLand_Click(object sender, EventArgs e) { STL stl = (STL)listSTLObjects.SelectedItem; if (stl == null) { return; } stl.Land(); listSTLObjects_SelectedIndexChanged(null, null); cont.UpdateChanges(); }
public void openAndAddObject(string file) { STL stl = new STL(); stl.Load(file); stl.Center(Main.printerSettings.PrintAreaWidth / 2, Main.printerSettings.PrintAreaDepth / 2); stl.Land(); if (stl.list.Count > 0) { listSTLObjects.Items.Add(stl); cont.models.AddLast(stl); listSTLObjects.SelectedItem = stl; stl.addAnimation(new DropAnimation("drop")); updateSTLState(stl); } }
/// <summary> /// Opens the .stl file, sets the view to stl editor, and causes the model to animate a fall onto the print platform. /// </summary> /// <param name="file">File Path to the stl file.</param> public void OpenAndAddSTLFile(string file) { STL stl = new STL(); stl.Load(file); stl.Center(Main.printerSettings.PrintAreaWidth / 2, Main.printerSettings.PrintAreaDepth / 2); stl.Land(); if (stl.list.Count > 0) { this.main.listSTLObjects.Items.Add(stl); this.StleditorView.models.AddLast(stl); this.main.listSTLObjects.SelectedItem = stl; this.main.postionGUI.Autoposition(); stl.addAnimation(new DropAnimation("drop")); this.main.postionGUI.updateSTLState(stl); } else { this.main.listSTLObjects.Visible = false; } }