inline CVkss1Doc* CVkss1View::GetDocument()
{ return (CVkss1Doc*)m_pDocument; }
#endif
// vkss1View.cpp : implementation of the CVkss1View class
//
#include "stdafx.h"
#include "vkss1.h"
#include "vkss1Doc.h"
#include "vkss1View.h"
#include "Vkss1Dlg.h"
#include "MainFrm.h"
IMPLEMENT_DYNCREATE(CVkss1View, CView)
BEGIN_MESSAGE_MAP(CVkss1View, CView)
//{{AFX_MSG_MAP(CVkss1View)
ON_COMMAND(ID_Parametrs, OnParametrs)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
CVkss1View::CVkss1View()
{one=0;}
CVkss1View::~CVkss1View()
{}
BOOL CVkss1View::PreCreateWindow(CREATESTRUCT& cs)
{
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
void CVkss1View::OnDraw(CDC* pDC)
{virtwin();
CMainFrame *pp=(CMainFrame*)(AfxGetApp()->m_pMainWnd);
CVkss1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
int r=7;
CPen pdk1,pgre;
CPen *old;
COLORREF clk1=0x00000000;
COLORREF clgre=0x00ff0000;
pdk1.CreatePen(PS_SOLID,2,clk1);
pgre.CreatePen(PS_SOLID,1,clgre);
for(int g=0;g<16;g++)
{old=m_memDC.SelectObject(&pdk1);
m_memDC.Ellipse(pp->pl1[g][0]-r,pp->pl1[g][1]-r,pp->pl1[g][0]+r,pp->pl1[g][1]+r);
m_memDC.Ellipse(pp->pl2[g][0]-r,pp->pl2[g][1]-r,pp->pl2[g][0]+r,pp->pl2[g][1]+r);
m_memDC.Ellipse(pp->pl3[g][0]-r,pp->pl3[g][1]-r,pp->pl3[g][0]+r,pp->pl3[g][1]+r);
m_memDC.MoveTo(pp->pl1[g][0],pp->pl1[g][1]);
m_memDC.LineTo(pp->pl3[g][0],pp->pl3[g][1]);
m_memDC.SelectObject(old);
}
old=m_memDC.SelectObject(&pdk1);
m_memDC.MoveTo(pp->pl1[0][0],pp->pl1[0][1]);
m_memDC.LineTo(pp->pl1[3][0],pp->pl1[3][1]);
m_memDC.MoveTo(pp->pl1[4][0],pp->pl1[4][1]);
m_memDC.LineTo(pp->pl1[7][0],pp->pl1[7][1]);
m_memDC.MoveTo(pp->pl1[8][0],pp->pl1[8][1]);
m_memDC.LineTo(pp->pl1[11][0],pp->pl1[11][1]);
m_memDC.MoveTo(pp->pl1[12][0],pp->pl1[12][1]);
m_memDC.LineTo(pp->pl1[15][0],pp->pl1[15][1]);
m_memDC.MoveTo(pp->pl1[0][0],pp->pl1[0][1]);
m_memDC.LineTo(pp->pl1[12][0],pp->pl1[12][1]);
m_memDC.MoveTo(pp->pl1[1][0],pp->pl1[1][1]);
m_memDC.LineTo(pp->pl1[13][0],pp->pl1[13][1]);
m_memDC.MoveTo(pp->pl1[2][0],pp->pl1[2][1]);
m_memDC.LineTo(pp->pl1[14][0],pp->pl1[14][1]);
m_memDC.MoveTo(pp->pl1[3][0],pp->pl1[3][1]);
m_memDC.LineTo(pp->pl1[15][0],pp->pl1[15][1]);
m_memDC.MoveTo(pp->pl2[0][0],pp->pl2[0][1]);
m_memDC.LineTo(pp->pl2[3][0],pp->pl2[3][1]);
m_memDC.MoveTo(pp->pl2[4][0],pp->pl2[4][1]);
m_memDC.LineTo(pp->pl2[7][0],pp->pl2[7][1]);
m_memDC.MoveTo(pp->pl2[8][0],pp->pl2[8][1]);
m_memDC.LineTo(pp->pl2[11][0],pp->pl2[11][1]);
m_memDC.MoveTo(pp->pl2[12][0],pp->pl2[12][1]);
m_memDC.LineTo(pp->pl2[15][0],pp->pl2[15][1]);
m_memDC.MoveTo(pp->pl2[0][0],pp->pl2[0][1]);
m_memDC.LineTo(pp->pl2[12][0],pp->pl2[12][1]);
m_memDC.MoveTo(pp->pl2[1][0],pp->pl2[1][1]);
m_memDC.LineTo(pp->pl2[13][0],pp->pl2[13][1]);
m_memDC.MoveTo(pp->pl2[2][0],pp->pl2[2][1]);
m_memDC.LineTo(pp->pl2[14][0],pp->pl2[14][1]);
m_memDC.MoveTo(pp->pl2[3][0],pp->pl2[3][1]);
m_memDC.LineTo(pp->pl2[15][0],pp->pl2[15][1]);
m_memDC.MoveTo(pp->pl3[0][0],pp->pl3[0][1]);
m_memDC.LineTo(pp->pl3[3][0],pp->pl3[3][1]);
m_memDC.MoveTo(pp->pl3[4][0],pp->pl3[4][1]);
m_memDC.LineTo(pp->pl3[7][0],pp->pl3[7][1]);
m_memDC.MoveTo(pp->pl3[8][0],pp->pl3[8][1]);
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.