📄 单像空间后方交会dlg.cpp
字号:
// 单像空间后方交会Dlg.cpp : implementation file
//
#include "stdafx.h"
#include "单像空间后方交会.h"
#include "单像空间后方交会Dlg.h"
#include "math.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyDlg dialog
CMyDlg::CMyDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMyDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMyDlg)
/*
double x0=0,y0=0;
double f=153.24;
double x[4]={-86.15,-53.40,-14.78,10.46};
double y[4]={-68.99,82.21,-76.63,64.43};
double XX[4]={36589.41,37631.08,39100.97,40426.54};
double YY[4]={25273.32,31324.51,24934.98,30319.81};
double ZZ[4]={2195.17,728.69,2386.50,757.31};
*/
m_x1 = -86.15;
m_x2 = -53.40;
m_x3 =-14.78;
m_x4 = 10.46;
m_XX1 = 36589.41;
m_XX2 = 37631.08;
m_XX3 = 39100.97;
m_XX4 = 40426.54;
m_y1 = -68.99;
m_y2 = 82.21;
m_y3 = -76.63;
m_y4 = 64.43;
m_YY1 = 25273.32;
m_YY2 = 31324.51;
m_YY3 = 24934.98;
m_YY4 = 30319.81;
m_ZZ1 = 2195.17;
m_ZZ2 = 728.69;
m_ZZ3 = 2386.50;
m_ZZ4 = 757.31;
m_XS = 0.0;
m_YS = 0.0;
m_ZS = 0.0;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDI_ICON1);
}
void CMyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyDlg)
DDX_Text(pDX, IDC_x1, m_x1);
DDX_Text(pDX, IDC_x2, m_x2);
DDX_Text(pDX, IDC_x3, m_x3);
DDX_Text(pDX, IDC_x4, m_x4);
DDX_Text(pDX, IDC_XX1, m_XX1);
DDX_Text(pDX, IDC_XX2, m_XX2);
DDX_Text(pDX, IDC_XX3, m_XX3);
DDX_Text(pDX, IDC_XX4, m_XX4);
DDX_Text(pDX, IDC_y1, m_y1);
DDX_Text(pDX, IDC_y2, m_y2);
DDX_Text(pDX, IDC_y3, m_y3);
DDX_Text(pDX, IDC_y4, m_y4);
DDX_Text(pDX, IDC_YY1, m_YY1);
DDX_Text(pDX, IDC_YY2, m_YY2);
DDX_Text(pDX, IDC_YY3, m_YY3);
DDX_Text(pDX, IDC_YY4, m_YY4);
DDX_Text(pDX, IDC_ZZ1, m_ZZ1);
DDX_Text(pDX, IDC_ZZ2, m_ZZ2);
DDX_Text(pDX, IDC_ZZ3, m_ZZ3);
DDX_Text(pDX, IDC_ZZ4, m_ZZ4);
DDX_Text(pDX, IDC_XS, m_XS);
DDX_Text(pDX, IDC_YS, m_YS);
DDX_Text(pDX, IDC_ZS, m_ZS);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
//{{AFX_MSG_MAP(CMyDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyDlg message handlers
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// 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
}
void CMyDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// 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 CMyDlg::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 CMyDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CMyDlg::OnButton1()
{
double x0=0,y0=0;
double f=153.24;
//double x[4]={-86.15,-53.40,-14.78,10.46};
//double y[4]={-68.99,82.21,-76.63,64.43};
//double XX[4]={36589.41,37631.08,39100.97,40426.54};
//double YY[4]={25273.32,31324.51,24934.98,30319.81};
//double ZZ[4]={2195.17,728.69,2386.50,757.31};
double x[4],y[4],XX[4],YY[4],ZZ[4];
m_ZS=0.0;m_YS=0.0;m_ZS=0.0;
UpdateData(true);
x[0]=m_x1;x[1]=m_x2;x[2]=m_x3;x[3]=m_x4;
y[0]=m_y1;y[1]=m_y2;y[2]=m_y3;y[3]=m_y4;
XX[0]=m_XX1;XX[1]=m_XX2;XX[2]=m_XX3;XX[3]=m_XX4;
YY[0]=m_YY1;YY[1]=m_YY2;YY[2]=m_YY3;YY[3]=m_YY4;
ZZ[0]=m_ZZ1;ZZ[1]=m_ZZ2;ZZ[2]=m_ZZ3;ZZ[3]=m_ZZ4;
CBackInsection BI(x0,y0,f,x,y,XX,YY,ZZ,4);
BI.Process();
m_XS=BI.GetXs();
m_YS=BI.GetYs();
m_ZS=BI.GetZs();
UpdateData(false);
//BI.Display();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -