//Private draw functions private void _DrawCircle(EvoGL drawer) { drawer.DrawCircle(this._startPoint, this._radius, this._baseColor); }
//Draw Function public void DrawSelf(EvoGL drawer) { //If Circle if (this._isCircle) { this._DrawCircle(drawer); return; } //Base if (this.DrawGrid) drawer.DrawGrid(this._startPoint, this._graphSize, 5.0, 1.0); //Draw BarGraph objects if (this.BarGraphPoints != null) { for (int i = 0; i < this.BarGraphPoints.Length; i++) { if (DrawDistribution) { var bw = (this.BarWidth * .99) / 2.0; for (int j = 0; j < this.BarGraphPoints[i].Length; j++) { var p = this.BarGraphPoints[i][j].Add(this._startPoint); var np = new Point[4]; np[0] = new Point(p.X - bw, p.Y * _graphSize.Y); np[1] = new Point(p.X + bw, p.Y * _graphSize.Y); np[2] = new Point(p.X + bw, 0); np[3] = new Point(p.X - bw, 0); drawer.DrawPolygonShadow(np, this.GetColor(i), 1.0, .25); //drawer.DrawLine(new Point(p.X, 0), new Point(p.X, p.Y * _graphSize.Y), Color.White, 1.0); } } else { drawer.DrawLines(this.BarGraphPoints[i].ToList<Point>(), this.GetColor(i), 1.0); /* var sp = new SortedValueList<Point>("<="); for (int j = 0; j < this.BarGraphPoints[i].Length; j++) sp.Add(this.BarGraphPoints[i][j], this.BarGraphPoints[i][j].X); var np = new Point[sp.Count + 3]; np[0] = new Point(sp[0].Add(this._startPoint).X, this._startPoint.Y); for (int j = 0; i < sp.Count; j++) np[j + 1] = new Point(sp[j].X, sp[j].Y * this._graphSize.Y).Add(this._startPoint); np[sp.Count + 1] = new Point(np[sp.Count].X, this._startPoint.Y); np[sp.Count + 2] = new Point(np[0].X, this._startPoint.Y); //drawer.DrawLines(np.ToList<Point>(), this.MyColor, 1.0); drawer.DrawPolygonShadow(np.ToArray<Point>(), Color.White, 1.0, .5); */ } } } //Draw Horizontals for (int i = 0; i < this.Verticals.Count; i++) { var px = this.Verticals[i] + this._startPoint.X; //drawer.DrawLine(new Point(px, this._startPoint.Y), new Point(px, this._startPoint.Y + this._graphSize.Y), this.MyColor, 1.0); } Gl.glEnd(); }