CPen aPen3;
CBrush aBrush3;
aPen3.CreatePen (PS_SOLID, 0, col);
aBrush3.CreateSolidBrush (col);
dcMem.SelectObject (&aPen3);
dcMem.SelectObject (&aBrush3);
dcMem.Rectangle (scx*(i-1)+scx/2, scy*(j-1)+scy/2,
scx*i+scx/2, scy*j+scy/2); } }
// Рисуем здание
CBrush aBrush4;
aBrush4.CreateSolidBrush (RGB(0,0,0));
RECT rect4;
SetRect (&rect4, scx*mdl->Build.left, scx*mdl->Build.top,
scx*mdl->Build.right, scx*mdl->Build.bottom);
dcMem.FrameRect (&rect4, &aBrush4);
// Выводим линии тока Psi
if (blFieldPsi) {
double fpsi;
for (i=0; i<=mdl->Nx; i++)
for (j=0; j<=mdl->Ny; j++)
for (ii=0; ii<scx; ii++)
for (jj=0; jj<scy; jj++)
if ((mdl->Cells[i][j]==kAir) || (mdl->Cells[i+1]
[j+1]==kAir)) {
fpsi = ((scx-ii)*(scy-jj)*mdl->Psi[i][j] +
(scx-ii)*jj*mdl->Psi[i][j+1] +
ii*(scy-jj)*mdl->Psi[i+1][j] +
ii*jj*mdl->Psi[i+1][j+1]) /scx/scy /mdl->kMaxPsi*20;
if (fabs(fpsi-floor(fpsi+0.5))<0.25/scy*mdl->h)
dcMem.SetPixelV (scx*i+ii, scy*j+jj,
RGB(127,255,255)); } }
// Выводим карту процессоров
if (blViewProcs && pDoc->kProc==kServerProc) {
CPen aPenPr1; aPenPr1.CreatePen (PS_SOLID, 1, RGB(255,255,255));
dcMem.SelectObject (&aPenPr1);
dcMem.MoveTo (scx/2, scy/2);
dcMem.LineTo (scx/2+scx*mdl->Nx, scy/2);
dcMem.LineTo (scx/2+scx*mdl->Nx, scy/2+scy*mdl->Ny);
dcMem.LineTo (scx/2, scy/2+scy*mdl->Ny);
for (i=0; i<pDoc->nClients; i++) {
dcMem.MoveTo (scx/2+scx*pDoc->Regions[i], scy/2);
dcMem.LineTo (scx/2+scx*pDoc->Regions[i], scy/2+scy*mdl->Ny);} }
// Выводим скорость U
if (blFieldU) {
CPen aPenU1; aPenU1.CreatePen (PS_SOLID, 0, RGB (255,127,127));
dcMem.SelectObject (&aPenU1);
double sc=0.03*nViewStep, l7, v, co, si;
int xa, ya, xb, yb, xc, yc, xd, yd;
for (ii=0; ii<=(mdl->Nx+1)/nViewStep; ii++)
for (jj=0; jj<=(mdl->Ny+1)/nViewStep; jj++) {
i=nViewStep*ii;