private int Threaded_SetGrid(int start, int end, Engine.Threading.ParamList paramList) { int numCol = (int)paramList.Get("numCol").Value; for (int x = start; x < end; x++) { for (int y = 0; y < numCol; y++) { t_cells[x, y] = new PressureGridCell(t_gridCellWidth, t_gridCellHeight); t_cells[x, y].CalculateAveragePressure(t_flowField, x * t_gridCellWidth, y * t_gridCellHeight); } } return(0); }
public Engine.Surface.Canvas GetVectorFieldSketch() { t_vectorFieldSketch = new Surface.Canvas(Width, Height, Engine.Colors.White); for (int x = 0; x < t_cells.GetLength(0); x++) { for (int y = 0; y < t_cells.GetLength(1); y++) { PressureGridCell gc = t_cells[x, y]; Engine.Point pStart = new Point((x * gc.Width) - (gc.Width / 2), (y * gc.Height) - (gc.Height / 2)); Engine.Calc.Vector shortV = new Calc.Vector(0, 0); shortV += gc.Pressure; shortV.SetMagnitude(gc.Width / 2); Engine.Point pEnd = new Point(pStart.X + (int)shortV.X, pStart.Y + (int)shortV.Y); Engine.Tools.Drawing.DrawLine(t_vectorFieldSketch, pStart, pEnd, Engine.Colors.Black); } } return(t_vectorFieldSketch); }