Example #1
0
 private void btnAddFixture_Click(object sender, EventArgs e)
 {
     using (CreateFixtureDialog dialog = new CreateFixtureDialog())
     {
         if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             var fixture = new Fixture(dialog.FixtureName);
             body.AddFixture(fixture);
         }
     }
 }
Example #2
0
 public FixtureEventArgs(Fixture fixture)
 {
     Fixture = fixture;
 }
Example #3
0
 public void AddFixture(Fixture fixture)
 {
     fixtures.Add(fixture.Name, fixture);
     if (FixtureAdded != null)
         FixtureAdded(this, new FixtureEventArgs(fixture));
 }
Example #4
0
 private void lstFixtures_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lstFixtures.SelectedItems.Count > 0)
     {
         selectedFixture = body.Fixtures[lstFixtures.SelectedItems[0].Name];
     }
     else
     {
         selectedFixture = null;
     }
     FillFixtureViewControls();
     canvas.Draw();
 }
Example #5
0
        private void DrawFixture(Fixture fixture, Color color, Graphics g)
        {
            var vertices = fixture.GetVertices();
            if (vertices.Length > 2)
            {
                g.DrawClosedCurve(new Pen(color), vertices, 0, System.Drawing.Drawing2D.FillMode.Winding);
            }

            for (var i = 0; i <vertices.Length; i++)
            {
                var vertex = vertices[i];
                g.FillEllipse(new SolidBrush(color), vertex.X - 2, vertex.Y - 2, 4, 4);
                g.DrawString(i.ToString(), pnlCanvas.Font, new SolidBrush(color), vertex.X - 4, vertex.Y - 15);
            }
        }