private void InitializeTubeDialog() { Text = "Create a Tube Primitive"; widthPanel.Hide(); depthPanel.Hide(); radiusLabel.Text = "Outer Radius"; var margin = radiusNumericUpDown.Margin; radiusNumericUpDown.Margin = new Padding(1, margin.Top, margin.Right, margin.Bottom); primitiveParameters = new PrimitiveParameters() { WLength = 2.0f, InnerRadius = 1.0f, Radius = 2.0f, USegments = 16, VSegments = 1, WSegments = 4, CapFill = CapFillType.TriangleFan }; heightNumericUpDown.Value = (decimal)primitiveParameters.WLength; innerRadiusNumericUpDown.Value = (decimal)primitiveParameters.InnerRadius; radiusNumericUpDown.Value = (decimal)primitiveParameters.Radius; uSegmentsNumericUpDown.Value = primitiveParameters.USegments; uSegmentsNumericUpDown.Minimum = 3; vSegmentsNumericUpDown.Value = primitiveParameters.VSegments; wSegmentsNumericUpDown.Value = primitiveParameters.WSegments; capFillComboBox.SelectedIndex = (int)primitiveParameters.CapFill; ClientSize = new System.Drawing.Size(ClientSize.Width, wSegmentsPanel.Bottom); }
private void InitializeTorusDialog() { Text = "Create a Torus Primitive"; widthPanel.Hide(); heightPanel.Hide(); depthPanel.Hide(); wSegmentsPanel.Hide(); capFillPanel.Hide(); primitiveParameters = new PrimitiveParameters() { InnerRadius = 1.0f, Radius = 2.0f, USegments = 16, VSegments = 16 }; innerRadiusNumericUpDown.Value = (decimal)primitiveParameters.InnerRadius; radiusNumericUpDown.Value = (decimal)primitiveParameters.Radius; uSegmentsNumericUpDown.Value = primitiveParameters.USegments; uSegmentsNumericUpDown.Minimum = 3; vSegmentsNumericUpDown.Value = primitiveParameters.VSegments; vSegmentsNumericUpDown.Minimum = 3; ClientSize = new System.Drawing.Size(ClientSize.Width, radiusPanel.Bottom); }
private void InitializeCylinderDialog() { Text = "Create a Cylinder Primitive"; widthPanel.Hide(); depthPanel.Hide(); innerRadiusPanel.Hide(); primitiveParameters = new PrimitiveParameters() { WLength = 2.0f, Radius = 1.0f, USegments = 16, VSegments = 1, WSegments = 4, CapFill = CapFillType.TriangleFan }; heightNumericUpDown.Value = (decimal)primitiveParameters.WLength; radiusNumericUpDown.Value = (decimal)primitiveParameters.Radius; uSegmentsNumericUpDown.Value = primitiveParameters.USegments; uSegmentsNumericUpDown.Minimum = 3; vSegmentsNumericUpDown.Value = primitiveParameters.VSegments; wSegmentsNumericUpDown.Value = primitiveParameters.WSegments; capFillComboBox.SelectedIndex = (int)primitiveParameters.CapFill; ClientSize = new System.Drawing.Size(ClientSize.Width, vSegmentsPanel.Bottom); }
private void InitializeDiscDialog() { Text = "Create a Disc Primitive"; widthPanel.Hide(); heightPanel.Hide(); depthPanel.Hide(); wSegmentsPanel.Hide(); capFillPanel.Hide(); radiusLabel.Text = "Outer Radius"; var margin = radiusNumericUpDown.Margin; radiusNumericUpDown.Margin = new Padding(1, margin.Top, margin.Right, margin.Bottom); primitiveParameters = new PrimitiveParameters() { Radius = 1.0f, InnerRadius = 0.0f, USegments = 16, VSegments = 1 }; innerRadiusNumericUpDown.Value = (decimal)primitiveParameters.InnerRadius; radiusNumericUpDown.Value = (decimal)primitiveParameters.Radius; uSegmentsNumericUpDown.Value = primitiveParameters.USegments; uSegmentsNumericUpDown.Minimum = 3; vSegmentsNumericUpDown.Minimum = 1; vSegmentsNumericUpDown.Value = primitiveParameters.VSegments; capFillComboBox.SelectedIndex = (int)primitiveParameters.CapFill; ClientSize = new System.Drawing.Size(ClientSize.Width, radiusPanel.Bottom); }
private void AppendMethodBody() { if (PrimitiveParameters.Any()) { AddLine(3, "var request = new Request(\"{0}\", ", Path); AddLine(3, "new Dictionary<string, object>"); AddLine(3, "{"); foreach (var parameter in PrimitiveParameters) { AddLine(4, "{{ \"{0}\", {0} }}{1}", parameter.Name, parameter == Parameters.Last() ? "" : ","); } AddLine(3, "});"); } else { AddLine(3, "var request = new Request(\"{0}\");", Path); } AppendMethodRequest(); }
private void InitializePlaneDialog() { Text = "Create a Plane Primitive"; heightPanel.Hide(); innerRadiusPanel.Hide(); radiusPanel.Hide(); wSegmentsPanel.Hide(); capFillPanel.Hide(); uSegmentsNumericUpDown.Minimum = 1; vSegmentsNumericUpDown.Minimum = 1; primitiveParameters = new PrimitiveParameters() { ULength = 1, VLength = 1, USegments = 1, VSegments = 1 }; ClientSize = new System.Drawing.Size(ClientSize.Width, radiusPanel.Bottom); }