/// <summary> /// Executes the command. /// Creates, gets parameters and add a Distributed line load to the selected line elements. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { services.GetProperties(this); DistributedSpanLoad newLoad = new DistributedSpanLoad(); newLoad.Da = 0; newLoad.Db = 1; newLoad.Direction = direction; newLoad.La = load; newLoad.Lb = load; newLoad.Type = type; //services.GetProperties(Title, load, false); if (Canguro.Controller.Grid.LoadEditFrm.EditLoad(newLoad) == System.Windows.Forms.DialogResult.OK) { List <Item> selection = GetSelection(services); foreach (Item item in selection) { if (item is LineElement) { ((LineElement)item).Loads.Add((DistributedSpanLoad)newLoad.Clone()); } } } }
/// <summary> /// Executes the command. /// Gets the parameters and creates the analysis case. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { string name = Culture.Get("defaultAnalysisCaseName"); Canguro.Model.Model model = services.Model; StaticCaseProps props = new StaticCaseProps(); AnalysisCase aCase = new AnalysisCase(name, props); services.GetProperties(aCase.Name, aCase, false); model.AbstractCases.Add(aCase); }
private void editAnalysisCaseButton_Click(object sender, EventArgs e) { Canguro.Model.Load.AbstractCase aCase = analysisCasesCheckedListBox.SelectedItem as Canguro.Model.Load.AbstractCase; if (aCase != null) { try { services.GetProperties(Culture.Get("edit"), aCase, false); UpdateDialog(); } catch (Canguro.Controller.CancelCommandException) { } } }
/// <summary> /// Executes the command. /// Asks the User for parameters and adds the Load to all selected Joints. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { GroundDisplacementLoad load = new GroundDisplacementLoad(); services.GetProperties(Title, load); Joint joint; while ((joint = services.GetJoint()) != null) { // TODO: Checar validez joint.Loads.Add(load); // Para que se refleje el cambio inmediatamente services.Model.ChangeModel(); } }
/// <summary> /// Executes the command. /// Gets the parameters and calls beamGrid3D() to make the grid. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { if (section == null) { section = Canguro.Model.Section.SectionManager.Instance.DefaultFrameSection as Canguro.Model.Section.FrameSection; } services.GetProperties(Culture.Get("gridCmdTitle"), this); Controller.Snap.Magnet m = services.GetPoint(Culture.Get("selectGridOrigin")); if (m == null) { return; } Microsoft.DirectX.Vector3 o = m.SnapPosition; StraightFrameProps props = new StraightFrameProps(); props.Section = section; beamGrid3D(services.Model, o.X, o.Y, o.Z, dx, 0, 0, 0, dy, 0, 0, 0, dz, nx + 1, ny + 1, nz + 1, true, props); }
/// <summary> /// Executes the command. /// Gets the parameters and calls createCylinder to add a Cylinder to the model /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { if (section == null) { section = Canguro.Model.Section.SectionManager.Instance.DefaultFrameSection as Canguro.Model.Section.FrameSection; } services.GetProperties(Culture.Get("cylinderCmdTitle"), this); Controller.Snap.Magnet m = services.GetPoint(Culture.Get("selectCylinderCenter")); if (m == null) { return; } Microsoft.DirectX.Vector3 o = m.SnapPosition; StraightFrameProps props = new StraightFrameProps(); props.Section = section; createCylinder(services.Model, o, r, c, h, s + 1, props); }
/// <summary> /// Executes the command. /// Creates one AreaElement. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { AreaElement area; List <Joint> joints = new List <Joint>(); Joint joint1, joint2, joint3, joint4; AreaProps props = new AreaProps(); List <LineElement> newLines = new List <LineElement>(); try { services.GetProperties(Culture.Get("addAreaProps"), props); joint1 = services.GetJoint(newLines); services.TrackingService = PolygonTrackingService.Instance; services.TrackingService.SetPoint(joint1.Position); services.Model.ChangeModel(); joint2 = services.GetJoint(newLines); services.TrackingService.SetPoint(joint2.Position); services.Model.ChangeModel(); joint3 = services.GetJoint(newLines); services.TrackingService.SetPoint(joint3.Position); services.Model.ChangeModel(); joint4 = services.GetJoint(newLines); if (joint4 != null) { services.TrackingService.SetPoint(joint4.Position); } services.Model.AreaList.Add(area = new AreaElement(props, joint1, joint2, joint3, joint4)); services.Model.ChangeModel(); } catch (Canguro.Controller.CancelCommandException) { } //if (newLines.Count == 0) // services.Model.Undo.Rollback(); //else // JoinCmd.Join(services.Model, new List<Joint>(), newLines); }
/// <summary> /// Executes the command. /// Adds a set of Line Elements. Opens a properties window and asks the user for two points or Joints for each one. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { LineElement line; Joint joint1, joint2; LineProps props = new StraightFrameProps(); List <LineElement> newLines = new List <LineElement>(); List <AreaElement> newAreas = new List <AreaElement>(); services.GetProperties(Culture.Get("addLineProps"), props); try { while ((joint1 = services.GetJoint(newLines)) != null) { services.TrackingService = LineTrackingService.Instance; services.TrackingService.SetPoint(joint1.Position); while ((joint2 = services.GetJoint(newLines)) == joint1) { ; } if (joint2 == null) { services.Model.JointList.Remove(joint1); break; } services.TrackingService = null; services.Model.LineList.Add(line = new LineElement(props, joint1, joint2)); newLines.Add(line); // Para que se refleje el cambio inmediatamente services.Model.ChangeModel(); } } catch (Canguro.Controller.CancelCommandException) { } JoinCmd.Join(services.Model, new List <Joint>(), newLines, newAreas); }
/// <summary> /// Executes the command. /// Opens the properties window to edit the selected Item. /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { Item item = services.GetItem(); services.GetProperties(Culture.Get("editCmdTitle"), item, false); }
/// <summary> /// Executes the command. /// Opens the properties window to edit the Active Layer /// </summary> /// <param name="services">CommandServices object to interact with the system</param> public override void Run(Canguro.Controller.CommandServices services) { Layer layer = services.Model.ActiveLayer; services.GetProperties(Culture.Get("editCmdTitle"), layer, false); }