87 lines
2.0 KiB
C++
87 lines
2.0 KiB
C++
// PipeElevationDlg.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "PipeElevationDlg.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CPipeElevationDlg dialog
|
|
|
|
|
|
CPipeElevationDlg::CPipeElevationDlg(CWnd* pParent /*=NULL*/)
|
|
: CDialog(CPipeElevationDlg::IDD, pParent)
|
|
{
|
|
//{{AFX_DATA_INIT(CPipeElevationDlg)
|
|
m_nE = 0.0;
|
|
m_nS = 0.0;
|
|
//}}AFX_DATA_INIT
|
|
}
|
|
|
|
|
|
void CPipeElevationDlg::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(CPipeElevationDlg)
|
|
DDX_Text(pDX, IDC_EDIT_E, m_nE);
|
|
DDX_Text(pDX, IDC_EDIT_S, m_nS);
|
|
//}}AFX_DATA_MAP
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CPipeElevationDlg, CDialog)
|
|
//{{AFX_MSG_MAP(CPipeElevationDlg)
|
|
ON_BN_CLICKED(IDC_BUTTON_S, OnButtonS)
|
|
ON_BN_CLICKED(IDC_BUTTON_E, OnButtonE)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CPipeElevationDlg message handlers
|
|
|
|
BOOL CPipeElevationDlg::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|
}
|
|
|
|
void CPipeElevationDlg::OnButtonS()
|
|
{
|
|
RBList rbMask(RTDXF0, _T("ATS_PIPE"), 8, GetLayerNames(_T("管")), NULL);
|
|
Entity ent;
|
|
UpdateData(TRUE);
|
|
HideDialog(this, TRUE);
|
|
if(SelectEntity(_T("\n请选择参考管线<退出>"), ent, RBList()) == RTNORM){
|
|
XPoint ps, pe;
|
|
GetPipePoint(ent, ps, pe);
|
|
m_nS = ps.z/1000;
|
|
}
|
|
HideDialog(this, FALSE);
|
|
UpdateData(FALSE);
|
|
|
|
}
|
|
|
|
void CPipeElevationDlg::OnButtonE()
|
|
{
|
|
RBList rbMask(RTDXF0, _T("ATS_PIPE"), 8, GetLayerNames(_T("管")), NULL);
|
|
Entity ent;
|
|
UpdateData(TRUE);
|
|
HideDialog(this, TRUE);
|
|
if(SelectEntity(_T("\n请选择参考管线<退出>"), ent, RBList()) == RTNORM){
|
|
XPoint ps, pe;
|
|
GetPipePoint(ent, ps, pe);
|
|
m_nE = pe.z/1000;
|
|
}
|
|
HideDialog(this, FALSE);
|
|
UpdateData(FALSE);
|
|
|
|
}
|