public void Draw() { graphics.DrawRectangle(new Pen(Brushes.Green), boundary.x - boundary.width, boundary.y - boundary.height, boundary.width * 2, boundary.height * 2); if (divided) { QTne.Draw(); QTnw.Draw(); QTse.Draw(); QTsw.Draw(); } }
private void Draw() { graphics.Clear(Color.Black); quadtree = new Quadtree(new Rectangle(winWidth / 2, winHeight / 2, winHeight / 2, winWidth / 2), 4, graphics); foreach (var particle in particles) { quadtree.InsertParticle(particle); graphics.FillRectangle(Brushes.White, particle.position.X, particle.position.Y, 2f, 2f); } quadtree.Draw(); pictureBox1.Refresh(); }