private void DrawCg( kMath.CollGrid cg ) { if ( cg != null ) { g.DrawRectangle ( ppen, cg.p0.x, cg.p0.y, cg.p1.x - cg.p0.x, cg.p1.y - cg.p0.y ); if ( cg.CL[ 0 ] != null ) { foreach ( kMath.CollGrid cgl in cg.CL ) { DrawCg ( cgl ); } //Parallel.ForEach(cg.CL, DrawCg); } } }
private void DrawCg( kMath.CollGrid cg ) { if ( cg != null ) { //lock ( cg ) //{ /*this.g.DrawLine(ppen, cg.p0.x, cg.p0.y, cg.p0.x, cg.p1.y); this.g.DrawLine(ppen, cg.p0.x, cg.p1.y, cg.p1.x, cg.p1.y); this.g.DrawLine(ppen, cg.p1.x, cg.p1.y, cg.p1.x, cg.p0.y); this.g.DrawLine(ppen, cg.p1.x, cg.p0.y, cg.p0.x, cg.p0.y);*/ g.DrawRectangle ( ppen, cg.p0.x, cg.p0.y, cg.p1.x - cg.p0.x, cg.p1.y - cg.p0.y ); //this.g.DrawString(cg.PL.Count.ToString(), // fnt, brsh, cg.p1.x/2, cg.p0.y/2); //this.g.DrawString(cg.CL.Length.ToString(), // fnt, brsh, cg.p1.x, cg.p1.y); if ( cg.CL[ 0 ] != null ) { foreach ( kMath.CollGrid cgl in cg.CL ) { DrawCg ( cgl ); } //Parallel.ForEach(cg.CL, DrawCg); } //} } }