📄 exampledlg.cpp
字号:
// exampleDlg.cpp : implementation file
//
#include "stdafx.h"
#include "example.h"
#include "exampleDlg.h"
#include "matlib.h"
#include "vis.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CExampleDlg dialog
CExampleDlg::CExampleDlg(CWnd* pParent /*=NULL*/)
: CDialog(CExampleDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CExampleDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CExampleDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CExampleDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CExampleDlg, CDialog)
//{{AFX_MSG_MAP(CExampleDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CExampleDlg message handlers
BOOL CExampleDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CExampleDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CExampleDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CExampleDlg::OnButton1()
{
initM(MATCOM_VERSION);
dMm(feature0); dMm(feature1); dMm(feature2); dMm(feature3); dMm(feature4); dMm(feature5); dMm(feature6); dMm(feature7) \
; dMm(feature8); dMm(feature9); dMm(x0); dMm(y0); dMm(x1); dMm(y1); dMm(x2); dMm(y2); dMm(x3); dMm(y3); dMm(x4) \
; dMm(y4); dMm(x5); dMm(y5); dMm(x6); dMm(y6); dMm(x7); dMm(y7); dMm(x8); dMm(y8); dMm(x9); dMm(y9);
call_stack_begin;
load(TM("feature0.txt"),(CL(feature0)));
load(TM("feature1.txt"),(CL(feature1)));
load(TM("feature2.txt"),(CL(feature2)));
load(TM("feature3.txt"),(CL(feature3)));
load(TM("feature4.txt"),(CL(feature4)));
load(TM("feature5.txt"),(CL(feature5)));
load(TM("feature6.txt"),(CL(feature6)));
load(TM("feature7.txt"),(CL(feature7)));
load(TM("feature8.txt"),(CL(feature8)));
load(TM("feature9.txt"),(CL(feature9)));
x0 = feature0(c_p,2.0);
y0 = feature0(c_p,3.0);
x1 = feature1(c_p,2.0);
y1 = feature1(c_p,3.0);
x2 = feature2(c_p,2.0);
y2 = feature2(c_p,3.0);
x3 = feature3(c_p,2.0);
y3 = feature3(c_p,3.0);
x4 = feature4(c_p,2.0);
y4 = feature4(c_p,3.0);
x5 = feature5(c_p,2.0);
y5 = feature5(c_p,3.0);
x6 = feature6(c_p,2.0);
y6 = feature6(c_p,3.0);
x7 = feature7(c_p,2.0);
y7 = feature7(c_p,3.0);
x8 = feature8(c_p,2.0);
y8 = feature8(c_p,3.0);
x9 = feature9(c_p,2.0);
y9 = feature9(c_p,3.0);
display( axis((BR(0.0),80.0,0.0,80.0)) );
display( title((CL(TM("空间关联模式 - 实体分布状况")))) );
display( xlabel((CL(TM("X")))) );
display( ylabel((CL(TM("Y")))) );
hold(TM("on"));
plot((CL(x0),y0,TM("go")));
plot((CL(x1),y1,TM("g*")));
plot((CL(x2),y2,TM("gx")));
plot((CL(x3),y3,TM("g+")));
plot((CL(x4),y4,TM("gs")));
plot((CL(x5),y5,TM("gd")));
plot((CL(x6),y6,TM("g<")));
plot((CL(x7),y7,TM("g>")));
plot((CL(x8),y8,TM("gp")));
plot((CL(x9),y9,TM("g^")));
hold(TM("off"));
call_stack_end;
exitM();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -