567 lines
14 KiB
C++
567 lines
14 KiB
C++
// CurveMeshDlg.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "CurveMeshDlg.h"
|
|
#include "actrans.h"
|
|
|
|
extern BOOL InvokeTkwMan(const TCHAR *pszLib, BOOL bSelOnly, XString &sBlockName);
|
|
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
int GetPolyShape(Entity ent, XPoly2D &poly2d)
|
|
{
|
|
XPoly2D shapePoly(ent);
|
|
if (!shapePoly) {
|
|
XCurveSegment segTemp(ent);
|
|
if (!segTemp){
|
|
return RTERROR;
|
|
}
|
|
segTemp.AsPoly2D(shapePoly);
|
|
}
|
|
shapePoly.Compress(); // add by ZJQ on 2002/10/07
|
|
poly2d=shapePoly;
|
|
return RTNORM;
|
|
}
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CCurveMeshDlg dialog
|
|
int CCurveMeshDlg::m_iLibrary = 1;
|
|
CCurveMeshDlg::CCurveMeshDlg(CWnd* pParent /*=NULL*/)
|
|
: GlwCAcUiDialog(CCurveMeshDlg::IDD, pParent) ,m_ssUnit(SS_FREE)
|
|
{
|
|
//{{AFX_DATA_INIT(CCurveMeshDlg)
|
|
m_csPtY = _T("");
|
|
m_csPtX = _T("");
|
|
m_bDelCurve = FALSE;
|
|
m_bDelCell = FALSE;
|
|
m_bDirection = FALSE;
|
|
//}}AFX_DATA_INIT
|
|
m_hIcon1=NULL;
|
|
m_hIcon2=NULL;
|
|
m_bScale=FALSE;
|
|
m_bLastDirection=m_bDirection;
|
|
m_dPtX=0.0;
|
|
m_dPtY=0.0;
|
|
}
|
|
|
|
CCurveMeshDlg::~CCurveMeshDlg()
|
|
{
|
|
if (m_hIcon1)
|
|
::DestroyIcon(m_hIcon1);
|
|
if (m_hIcon2)
|
|
::DestroyIcon(m_hIcon2);
|
|
}
|
|
|
|
void CCurveMeshDlg::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(CCurveMeshDlg)
|
|
DDX_Control(pDX, IDC_BUTTON_PICKCELL, m_ctrlCell);
|
|
DDX_Control(pDX, IDC_BUTTON_PICKBIND, m_ctrlBind);
|
|
DDX_Control(pDX, IDC_BUTTON_PICKBASE, m_ctrlPickBase);
|
|
DDX_Text(pDX, IDC_EDIT_PTY, m_csPtY);
|
|
DDX_Text(pDX, IDC_EDIT_PTX, m_csPtX);
|
|
DDX_Check(pDX, IDC_CHECK_DEL, m_bDelCurve);
|
|
DDX_Check(pDX, IDC_CHECK_DELSHAPE, m_bDelCell);
|
|
DDX_Check(pDX, IDC_CHECK_DIRECTION, m_bDirection);
|
|
DDX_Radio(pDX, IDC_RADIO_LIBRARY, m_iLibrary);
|
|
//}}AFX_DATA_MAP
|
|
CWnd *pWnd = GetDlgItem(IDOK);
|
|
CWnd *pWnd2 = GetDlgItem(IDC_PREVIEW);
|
|
int len = m_ssUnit.Length();
|
|
if (m_csPtX == _T("") || m_csPtY == _T("") || len == 0){
|
|
pWnd2->EnableWindow(FALSE);
|
|
pWnd->EnableWindow(FALSE);
|
|
}
|
|
else{
|
|
pWnd2->EnableWindow(TRUE);
|
|
pWnd->EnableWindow(TRUE);
|
|
}
|
|
}
|
|
|
|
BEGIN_MESSAGE_MAP(CCurveMeshDlg, GlwCAcUiDialog)
|
|
//{{AFX_MSG_MAP(CCurveMeshDlg)
|
|
ON_BN_CLICKED(IDC_PREVIEW, OnPreview)
|
|
ON_BN_CLICKED(IDC_BUTTON_PICKBASE, OnButtonPickbase)
|
|
ON_BN_CLICKED(IDC_BUTTON_PICKBIND, OnButtonPickbind)
|
|
ON_BN_CLICKED(IDC_BUTTON_PICKCELL, OnButtonPickcell)
|
|
ON_BN_CLICKED(IDC_RADIO_LIBRARY, OnRadioLibrary)
|
|
ON_BN_CLICKED(IDC_RADIO_ENTITY, OnRadioEntity)
|
|
ON_EN_CHANGE(IDC_EDIT_PTX, OnChangeEditPtx)
|
|
ON_EN_CHANGE(IDC_EDIT_PTY, OnChangeEditPty)
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CCurveMeshDlg message handlers
|
|
|
|
BOOL CCurveMeshDlg::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
CAcModuleResourceOverride vTemp;
|
|
|
|
m_hIcon1 = AfxGetApp()->LoadIcon(IDI_ICON_PICKBASE);
|
|
if (!m_hIcon1)
|
|
MessageBox(_T("无法找到指定ICON文件。"));
|
|
else
|
|
m_ctrlPickBase.SetIcon(m_hIcon1);
|
|
m_hIcon2 = AfxGetApp()->LoadIcon(IDI_ICON_PICK);
|
|
if (!m_hIcon2)
|
|
MessageBox(_T("无法找到指定ICON文件。"));
|
|
else{
|
|
m_ctrlBind.SetIcon(m_hIcon2);
|
|
m_ctrlCell.SetIcon(m_hIcon2);
|
|
}
|
|
CWnd *pWnd = GetDlgItem(IDOK);
|
|
pWnd->EnableWindow(FALSE);
|
|
CWnd *pWnd2 = GetDlgItem(IDC_PREVIEW);
|
|
pWnd2->EnableWindow(FALSE);
|
|
m_lstCurveMesh.Reset();
|
|
|
|
UpdateData(FALSE);
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|
}
|
|
|
|
void CCurveMeshDlg::OnButtonPickbase()
|
|
{
|
|
UpdateData(TRUE);
|
|
HideDialog(TRUE);
|
|
XVector3D vtNormal=Ucs2Wcs(XVector3D(0,0,1), TRUE);
|
|
((AcGeVector3d &)vtNormal).normalize();
|
|
|
|
//double nx, ny, nz;
|
|
//XPoint pt;
|
|
//m_ent.GetExtend(pt, &nx, &ny, &nz);
|
|
//pt.z -= nz/2;
|
|
//m_ptCen = pt;
|
|
//XPoly2D poly2d;
|
|
//if (GetPolyShape(m_ent, poly2d)==RTNORM) {
|
|
// poly2d.Center(m_ptCen);
|
|
//ptCen.z=0;
|
|
// int ret = 0;
|
|
if (XGetPoint(Ecs2Ucs(m_ptCen, vtNormal), _T("\n单元基点"), m_ptBase)==RTNORM) {
|
|
m_ptBase=Ucs2Ecs(m_ptBase, vtNormal);
|
|
m_csPtX = (const TCHAR *)Dist2Str(m_ptBase.x - m_ptCen.x);
|
|
m_csPtY = (const TCHAR *)Dist2Str(m_ptBase.y - m_ptCen.y);
|
|
}
|
|
HideDialog(FALSE);
|
|
UpdateData(FALSE);
|
|
|
|
}
|
|
|
|
void CCurveMeshDlg::OnButtonPickbind()
|
|
{
|
|
UpdateData(TRUE);
|
|
HideDialog(TRUE);
|
|
m_ssUnit.Free();
|
|
const TCHAR *szPrompts[2]={_T("\n请选择作为路径的曲线(线/弧/圆/多段线)或可绑定对象(路径曲面/扶手/坡屋顶)<退出>:"), _T("移除已选对象:") };
|
|
|
|
RBList rbMask1(RTDXF0, _T("LINE,ARC,CIRCLE,POLYLINE,LWPOLYLINE,TCH_*"), NULL);
|
|
if (m_ssUnit.Get(_T(":$"), szPrompts, NULL, rbMask1)!=RTNORM) {
|
|
HideDialog(FALSE);
|
|
UpdateData(FALSE);
|
|
return;
|
|
}
|
|
long len = m_ssUnit.Length();
|
|
CWnd *pWnd = GetDlgItem(IDC_STATIC_TEXT);
|
|
CString str;
|
|
str.Format(_T("已选择%d个对象!"), len);
|
|
pWnd->SetWindowText(str);
|
|
CWnd *pWnd2 = GetDlgItem(IDC_STATIC_ICON);
|
|
pWnd2->ShowWindow(SW_HIDE);
|
|
CWnd *pWnd3 = GetDlgItem(IDC_STATIC_ICON3);
|
|
pWnd3->ShowWindow(SW_SHOW);
|
|
|
|
long len2 = m_lstCurveMesh.Length();
|
|
for(long i=0L;i<len2;i++){
|
|
OPENOBJ_BEGIN(*m_lstCurveMesh[i], AcDb::kForWrite, TDbCurveMesh2, pCurveMesh);
|
|
pCurveMesh->erase(Adesk::kTrue);
|
|
OPENOBJ_END();
|
|
}
|
|
m_lstCurveMesh.Reset();
|
|
|
|
HideDialog(FALSE);
|
|
UpdateData(FALSE);
|
|
|
|
}
|
|
|
|
void CCurveMeshDlg::OnButtonPickcell()
|
|
{
|
|
UpdateData(TRUE);
|
|
HideDialog(TRUE);
|
|
|
|
if (m_iLibrary==0) {
|
|
XString sLibFile, sBlockName, sBlock;
|
|
AcDbObjectId sId;
|
|
sLibFile << g_sDwbPath << _T("polyshape.TKW");
|
|
if (!InvokeTkwMan(sLibFile, TRUE, sBlockName)) {
|
|
HideDialog(FALSE);
|
|
UpdateData(FALSE);
|
|
return;
|
|
}
|
|
if (LoadDwbBlock(sBlockName, sBlock)!=RTNORM) {
|
|
HideDialog(FALSE);
|
|
UpdateData(FALSE);
|
|
return;
|
|
}
|
|
sId=InitBlock(sBlock);
|
|
|
|
xg_getvar(_T("VIEWCTR"), m_ptBase);
|
|
XPushVar<int> osmode(_T("OSMODE"), 0);
|
|
XPushVar<int> attreq(_T("ATTREQ"), 0);
|
|
ads_command(RTSTR,_T(".INSERT"),RTSTR,
|
|
(const TCHAR *)sBlock,RT3DPOINT,&m_ptBase,RTSTR,_T(""),RTSTR,_T(""),RTSTR,_T(""),RTNONE);
|
|
Entity e;
|
|
acdbEntLast(e);
|
|
// Zyu modify on 100721,支持64位
|
|
//ads_command(RTSTR,_T(".EXPLODE"),RTENAME,(long *)e,RTNONE);
|
|
ads_command(RTSTR,_T(".EXPLODE"),RTENAME,(TLong_ptr *)e,RTNONE);
|
|
acdbEntLast(e);
|
|
XPoly2D myPoly(e);
|
|
if (!myPoly) {
|
|
XCurveSegment seg(e);
|
|
if (!seg) {
|
|
HideDialog(FALSE);
|
|
UpdateData(FALSE);
|
|
return;
|
|
}
|
|
seg.AsPoly2D(myPoly);
|
|
}
|
|
m_bScale=myPoly.HasArcSegment();
|
|
//e.Delete();
|
|
//myPoly.Make();
|
|
//acdbEntLast(m_ent);
|
|
m_ent.FreeGroups();
|
|
m_ent=e;
|
|
}
|
|
else {
|
|
RBList rbMask2(RTDXF0, _T("POLYLINE,LWPOLYLINE,ARC,CIRCLE,LINE"), NULL);
|
|
if (m_ent.FilterSelect(_T("\n请选择作为断面形状的曲线(线/弧/圆/多段线):"),rbMask2)!=RTNORM) {
|
|
HideDialog(FALSE);
|
|
UpdateData(FALSE);
|
|
return;
|
|
}
|
|
}
|
|
|
|
CWnd *pWnd = GetDlgItem(IDC_STATIC_TEXT2);
|
|
pWnd->SetWindowText(_T("选择成功!"));
|
|
CWnd *pWnd2 = GetDlgItem(IDC_STATIC_ICON2);
|
|
pWnd2->ShowWindow(SW_HIDE);
|
|
CWnd *pWnd3 = GetDlgItem(IDC_STATIC_ICON4);
|
|
pWnd3->ShowWindow(SW_SHOW);
|
|
|
|
//double nx, ny, nz;
|
|
//XPoint pt;
|
|
//m_ent.GetExtend(pt, &nx, &ny, &nz);
|
|
//pt.z -= nz/2;
|
|
XPoly2D poly2d;
|
|
if (GetPolyShape(m_ent, poly2d)==RTNORM) {
|
|
poly2d.Center(m_ptCen);
|
|
XPoint ptLow, ptUp;
|
|
poly2d.GetExtend(ptLow, ptUp);
|
|
double nx=ptUp.x-ptLow.x;
|
|
double ny=ptUp.y-ptLow.y;
|
|
if (m_iLibrary==0) {
|
|
//m_ptBase.z=pt.z;
|
|
m_ptBase =m_ptCen;// [12/4/2007 nsh]
|
|
m_dPtX=nx;
|
|
m_dPtY=ny;
|
|
m_csPtX=(const TCHAR *)Dist2Str(nx);
|
|
m_csPtY=(const TCHAR *)Dist2Str(ny);
|
|
}
|
|
else {
|
|
m_ptBase=m_ptCen;
|
|
m_ptBase.z=0;
|
|
//m_ptCen = pt;
|
|
//m_ptBase = m_ptCen;
|
|
m_csPtX = _T("0");
|
|
m_csPtY = _T("0");
|
|
}
|
|
}
|
|
|
|
HideDialog(FALSE);
|
|
UpdateData(FALSE);
|
|
}
|
|
|
|
void CCurveMeshDlg::OnPreview()
|
|
{
|
|
DoUpdateCell();
|
|
|
|
//UpdateData(TRUE);
|
|
HideDialog(TRUE);
|
|
|
|
XString sKeyword;
|
|
if (m_lstCurveMesh.Length() == 0)
|
|
DoDrawCurveMesh();
|
|
else
|
|
DoChangeCurveMesh();
|
|
|
|
ads_getstring(0, _T("\n按右键或回车返回对话框。"),sKeyword);
|
|
|
|
HideDialog(FALSE);
|
|
UpdateData(FALSE);
|
|
}
|
|
|
|
void CCurveMeshDlg::OnOK()
|
|
{
|
|
DoUpdateCell();
|
|
|
|
//UpdateData(TRUE);
|
|
CDialog::OnOK();
|
|
|
|
if (m_lstCurveMesh.Length() == 0)
|
|
DoDrawCurveMesh();
|
|
else
|
|
DoChangeCurveMesh();
|
|
|
|
long len = m_ssUnit.Length();
|
|
for(long i=0L;i<len;i++){
|
|
Entity ent=m_ssUnit[i];
|
|
BOOL bIsBind = FALSE;
|
|
|
|
OPENOBJ_BEGIN(ent, AcDb::kForRead, TDbPolyPathEnt, pPathEnt);
|
|
if (pPathEnt)
|
|
bIsBind = TRUE;
|
|
OPENOBJ_END();
|
|
if (!bIsBind)
|
|
{
|
|
OPENOBJ_BEGIN(ent, AcDb::kForRead, TDbPolyCurveEnt, pPathEnt);
|
|
if (pPathEnt)
|
|
bIsBind = TRUE;
|
|
OPENOBJ_END();
|
|
}
|
|
|
|
if (m_bDelCurve && (!bIsBind))
|
|
ent.Delete();
|
|
else
|
|
ent.Redraw(4);
|
|
}
|
|
if (m_bDelCell)
|
|
m_ent.Delete();
|
|
}
|
|
|
|
void CCurveMeshDlg::OnCancel()
|
|
{
|
|
long len2 = m_lstCurveMesh.Length();
|
|
for(long i=0L;i<len2;i++){
|
|
OPENOBJ_BEGIN(*m_lstCurveMesh[i], AcDb::kForWrite, TDbCurveMesh2, pCurveMesh);
|
|
pCurveMesh->erase(Adesk::kTrue);
|
|
OPENOBJ_END();
|
|
}
|
|
if ((m_iLibrary==0)&&m_bDelCell)
|
|
m_ent.Delete();
|
|
|
|
CDialog::OnCancel();
|
|
}
|
|
|
|
void CCurveMeshDlg::HideDialog(BOOL Flag)
|
|
{
|
|
if (Flag) {
|
|
GetParent()->EnableWindow(TRUE);
|
|
GetParent()->SetFocus();
|
|
GetParent()->SetActiveWindow();
|
|
ShowWindow(SW_HIDE);
|
|
}
|
|
else {
|
|
GetParent()->EnableWindow(FALSE);
|
|
EnableWindow(TRUE);
|
|
SetActiveWindow();
|
|
ShowWindow(SW_SHOW);
|
|
}
|
|
}
|
|
|
|
void CCurveMeshDlg::DoDrawCurveMesh()
|
|
{
|
|
XPoly2D shapePoly;
|
|
if (GetPolyShape(m_ent, shapePoly)!=RTNORM)
|
|
return;
|
|
|
|
m_lstCurveMesh.Reset();
|
|
XVector3D vtNormal=Ucs2Wcs(XVector3D(0,0,1), TRUE);
|
|
((AcGeVector3d &)vtNormal).normalize();
|
|
|
|
long len = m_ssUnit.Length();
|
|
for(long i=0L;i<len;i++)
|
|
{
|
|
AcDbObjectId idCurveMesh;
|
|
Entity ent=m_ssUnit[i];
|
|
AcDbObjectId idBind = NULL;
|
|
|
|
OPENOBJ_BEGIN(ent, AcDb::kForRead, TDbPolyPathEnt, pPathEnt);
|
|
if (pPathEnt)
|
|
idBind=pPathEnt->objectId();
|
|
OPENOBJ_END();
|
|
if (!idBind)
|
|
{
|
|
OPENOBJ_BEGIN(ent, AcDb::kForRead, TDbPolyCurveEnt, pPathEnt);
|
|
if (pPathEnt)
|
|
idBind=pPathEnt->objectId();
|
|
OPENOBJ_END();
|
|
}
|
|
|
|
if (idBind){
|
|
TDbCurveMesh2 *pMesh = new TDbCurveMesh2;
|
|
//pMesh->SetNormal(vtNormal);
|
|
pMesh->SetShapePoly(shapePoly);
|
|
pMesh->SetShapeBase(m_ptBase);
|
|
idCurveMesh = pMesh->AddToMSpace(Adesk::kFalse);
|
|
if (pMesh->SetBindObject(idBind)!=Acad::eOk){
|
|
pMesh->erase(Adesk::kTrue);
|
|
idCurveMesh = NULL;
|
|
}
|
|
pMesh->close();
|
|
} else {
|
|
//
|
|
//XPoly3D basePoly(ent);
|
|
//basePoly.TransUCS(Groups(0),Groups(1));
|
|
XVector3D vtPoly(0,0,1);
|
|
if (ent.GetData(210, &vtPoly)!=RTNORM)
|
|
vtPoly=XVector3D(0,0,1);
|
|
if (vtPoly.AsAcGeVector3d()!=vtNormal.AsAcGeVector3d()) {
|
|
adsout << _T("\n所选对象的构造平面与当前构造平面不平行!");
|
|
return;
|
|
}
|
|
|
|
XPoly2D basePoly;
|
|
if (GetPolyShape(ent, basePoly)!=RTNORM)
|
|
continue;
|
|
|
|
if (m_bDirection)
|
|
basePoly.Reverse();
|
|
|
|
TDbCurveMesh2 *pMesh = new TDbCurveMesh2;
|
|
pMesh->SetPathPoly(basePoly,vtNormal.AsAcGeVector3d());
|
|
pMesh->SetShapePoly(shapePoly);
|
|
pMesh->SetShapeBase(m_ptBase);
|
|
idCurveMesh = pMesh->AddToMSpace(Adesk::kTrue);
|
|
}
|
|
ent.Redraw(3); //虚线显示
|
|
if (idCurveMesh)
|
|
m_lstCurveMesh.Append(new AcDbObjectId(idCurveMesh));
|
|
}
|
|
m_bLastDirection=m_bDirection;
|
|
}
|
|
|
|
void CCurveMeshDlg::DoChangeCurveMesh()
|
|
{
|
|
XPoly2D shapePoly;
|
|
if (GetPolyShape(m_ent, shapePoly)!=RTNORM)
|
|
return;
|
|
|
|
long len = m_lstCurveMesh.Length();
|
|
for(long i=0L;i<len;i++){
|
|
OPENOBJ_BEGIN(*m_lstCurveMesh[i], AcDb::kForWrite, TDbCurveMesh2, pCurveMesh);
|
|
if (m_bDirection != m_bLastDirection &&
|
|
!pCurveMesh->IsBind()) {
|
|
XPoly2D basePoly;
|
|
AcGeVector3d vtNormal;
|
|
pCurveMesh->GetPathPoly(basePoly,vtNormal);
|
|
basePoly.Reverse();
|
|
pCurveMesh->SetPathPoly(basePoly,vtNormal);
|
|
}
|
|
pCurveMesh->SetShapePoly(shapePoly);
|
|
pCurveMesh->SetShapeBase(m_ptBase);
|
|
OPENOBJ_END();
|
|
actrTransactionManager->flushGraphics(); //acad 刷新
|
|
acedUpdateDisplay();
|
|
}
|
|
m_bLastDirection=m_bDirection;
|
|
}
|
|
|
|
void CCurveMeshDlg::DoUpdateCell()
|
|
{
|
|
UpdateData(TRUE);
|
|
XPoly2D poly2d;
|
|
if (GetPolyShape(m_ent, poly2d)==RTNORM) {
|
|
//m_polyShape=poly2d;
|
|
if (m_iLibrary==0) {
|
|
//double x, y, z;
|
|
//XPoint p;
|
|
//m_ent.GetExtend(p, &x, &y, &z);
|
|
XPoint ptLow, ptUp;
|
|
poly2d.GetExtend(ptLow, ptUp);
|
|
double x=ptUp.x-ptLow.x;
|
|
double y=ptUp.y-ptLow.y;
|
|
if (x>1E-3 && y>1E-3 &&
|
|
(fabs(x-_tstof(m_csPtX))>1E-3)||(fabs(y-_tstof(m_csPtY))>1E-3)) {
|
|
double sx,sy;
|
|
if (m_bScale) {
|
|
sx=sy=_tstof(m_csPtX)/x;
|
|
} else {
|
|
sx=_tstof(m_csPtX)/x;
|
|
sy=_tstof(m_csPtY)/y;
|
|
}
|
|
ads_matrix mat;
|
|
m_ptBase.GetScaleMatrix(sx,sy,1,mat);
|
|
m_ent.XTransform(mat);
|
|
}
|
|
}
|
|
else {
|
|
m_ptBase.x = m_ptCen.x + _tstof(m_csPtX);
|
|
m_ptBase.y = m_ptCen.y + _tstof(m_csPtY);
|
|
}
|
|
|
|
XVector3D vtNormal=Ucs2Wcs(XVector3D(0,0,1), TRUE);
|
|
((AcGeVector3d &)vtNormal).normalize();
|
|
m_ent.Redraw(4);
|
|
|
|
/*
|
|
XPoly2D shapePoly(m_ent);
|
|
XVector3D vtPoly(0,0,1);
|
|
if (m_ent.GetData(210, &vtPoly)!=RTNORM)
|
|
vtPoly=XVector3D(0,0,1);
|
|
if (vtPoly.AsAcGeVector3d()!=vtNormal.AsAcGeVector3d()) {
|
|
adsout << _T("\n所选截面形状线的构造平面与当前构造平面不平行!");
|
|
}*/
|
|
}
|
|
//UpdateData(FALSE);
|
|
}
|
|
|
|
void CCurveMeshDlg::OnRadioLibrary()
|
|
{
|
|
// TODO: Add your control notification handler code here
|
|
UpdateData(TRUE);
|
|
GetDlgItem(IDC_STATIC_1)->SetWindowText(_T("改变截面尺寸"));
|
|
GetDlgItem(IDC_STATIC_2)->SetWindowText(_T("X方向尺寸:"));
|
|
GetDlgItem(IDC_STATIC_3)->SetWindowText(_T("Y方向尺寸:"));
|
|
GetDlgItem(IDC_BUTTON_PICKBASE)->EnableWindow(FALSE);
|
|
UpdateData(FALSE);
|
|
}
|
|
|
|
void CCurveMeshDlg::OnRadioEntity()
|
|
{
|
|
// TODO: Add your control notification handler code here
|
|
UpdateData(TRUE);
|
|
GetDlgItem(IDC_STATIC_1)->SetWindowText(_T("拾取截面基点(距单元中心)"));
|
|
GetDlgItem(IDC_STATIC_2)->SetWindowText(_T("X:"));
|
|
GetDlgItem(IDC_STATIC_3)->SetWindowText(_T("Y:"));
|
|
GetDlgItem(IDC_BUTTON_PICKBASE)->EnableWindow(TRUE);
|
|
UpdateData(FALSE);
|
|
}
|
|
|
|
void CCurveMeshDlg::OnChangeEditPtx()
|
|
{
|
|
// TODO: Add your control notification handler code here
|
|
UpdateData(TRUE);
|
|
if (m_bScale && m_dPtX*m_dPtY>1.0E-6)
|
|
m_csPtY=(const TCHAR *)Dist2Str(_tstof(m_csPtX)/m_dPtX*m_dPtY);
|
|
UpdateData(FALSE);
|
|
}
|
|
|
|
void CCurveMeshDlg::OnChangeEditPty()
|
|
{
|
|
// TODO: Add your control notification handler code here
|
|
UpdateData(TRUE);
|
|
if (m_bScale && m_dPtX*m_dPtY>1.0E-6)
|
|
m_csPtX=(const TCHAR *)Dist2Str(_tstof(m_csPtY)/m_dPtY*m_dPtX);
|
|
UpdateData(FALSE);
|
|
}
|