예제 #1
0
파일: Sphere.cs 프로젝트: Ejik007/Lab1-2
 /// <summary>
 /// Sphere constructor
 /// </summary>
 /// <param name="g">GridView object to manage conversions</param>
 /// <param name="r">Radius (in logical units)</param>
 /// <param name="cX">X coordinate of center (logical units)</param>
 /// <param name="cY">Y coordinate of center (logical units)</param>
 public Sphere(GridView g, double r, double cX, double cY)
     : base(g)
 {
     this.radius=r;
     //Squared
     this.leftSquare=cX-r;
     this.upperSquare=cY-r;
     this.color=Color.Yellow; // default
 }
예제 #2
0
파일: Spheres.cs 프로젝트: Ejik007/Lab1-2
 /// <summary>
 /// WinForm constructor
 /// </summary>
 public FrmMain()
 {
     InitializeComponent();
     int lenX = this.panel.Width;
     int lenY = this.panel.Height;
     gv = new GridView(5.0,lenX,lenY);
     spheres = new ArrayList();
     panelGraphics = this.panel.CreateGraphics();
 }
예제 #3
0
파일: Spheres.cs 프로젝트: Ejik007/Lab1-2
 /// <summary>
 /// Радиу в условных единица 1-2, double
 /// </summary>
 /// <param name="radius"></param>
 public FrmMain(double radius)
 {
     _radius = radius;
     InitializeComponent();
     int lenX = this.panel.Width;
     int lenY = this.panel.Height;
     gv = new GridView(5.0, lenX, lenY);
     spheres = new ArrayList();
     panelGraphics = this.panel.CreateGraphics();
     this.centerX = 2;
     this.centerY = 2;
     btnDraw_Click(null, null);
 }