📄 modal.cpp
字号:
//
// (C) Copyright 1995-1997 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
// modal.cpp : Defines the initialization routines for the DLL.
//
#include "stdafx.h"
#include "resourcehelper.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
extern "C" HWND adsw_acadMainWnd();
bool bEnd = true;
double rHigh = 0.0;
void MFCTest()
{
// When resource from this ARX app is needed, just
// instantiate a local CTemporaryResourceOverride
CTemporaryResourceOverride thisResource;
ads_point pt;
MakeNewLayer("HighData",3);
bEnd = true;
while (bEnd)
{
if (ads_getpoint(NULL,"\n点取插入点!!",pt) == RTNONE) break;
if (ads_getreal("\n输入散点高程:",&rHigh) == RTNONE) break;
pt[2] = rHigh;
MakeCircle(pt, 0.3,3,"HighData");
MakePoint(pt,"HighData");
MakeText(pt,RtoS(rHigh,2,1),"HighData");
}
}
void MFCTest1()
{
int i = 0;
ads_point pt;
AcGePoint3d ptt;
AcGePoint3dArray ptArray;
MakeNewLayer("HighData",3);
bEnd = true;
while (bEnd)
{
i = 0;
if (ads_getreal("\n输入要附于等高线的高程值:",&rHigh) == RTNONE) break;
ptArray.removeSubArray(0,200);
while (ads_getpoint((i == 0 ? NULL : pt),"\n请点取等高线各顶点:",pt) != RTNONE)
{
if (i == 0)
{
MakeCircle(pt, 0.3,3,"HighData");
MakeText(pt,RtoS(rHigh,2,1),"HighData");
}
ptt.set(pt[0],pt[1],rHigh);
ptArray.append(ptt);
MakePline(ptArray,"HighData",3,1,false);
i++;
}
MakePline(ptArray,"HighData",3,1,true);
pt[0] = ptt.x; pt[1] = ptt.y; pt[2] = rHigh;
MakeCircle(pt, 0.3,3,"HighData");
MakeText(pt,RtoS(rHigh,2,1),"HighData");
}
}
/////////////////////////////////////////////////////////////////////////////
// CDiaTest dialog
CDiaTest::CDiaTest(CWnd* pParent /*=NULL*/)
: CDialog(CDiaTest::IDD, pParent)
{
//{{AFX_DATA_INIT(CDiaTest)
m_rHigh = 0.0;
//}}AFX_DATA_INIT
}
void CDiaTest::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDiaTest)
DDX_Control(pDX, IDC_EDIT1, m_ssss);
DDX_Text(pDX, IDC_EDIT1, m_rHigh);
DDV_MinMaxDouble(pDX, m_rHigh, -100., 10000.);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDiaTest, CDialog)
//{{AFX_MSG_MAP(CDiaTest)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDiaTest message handlers
void CDiaTest::OnCancel()
{
// TODO: Add extra cleanup here
bEnd = false;
CDialog::OnCancel();
}
void CDiaTest::OnOK()
{
// TODO: Add extra validation here
UpdateData(true);
if (m_rHigh > 8848 || m_rHigh < -100)
{
AfxMessageBox("您输入的高程有错误!");
return;
}
rHigh = m_rHigh;
CDialog::OnOK();
}
BOOL CDiaTest::OnInitDialog()
{
// TODO: Add extra initialization here
m_ssss.SetFocus();
// m_ssss.SetSel(1,20);
SetFocus();
CDialog::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -