www.pudn.com > SurfWareNew06.3.5(LYW).rar > CreateNurbsCurve.cpp
// CreateNurbsCurve.cpp : implementation file
//
#include "stdafx.h"
#include "surfware.h"
#include "CreateNurbsCurve.h"
#include "include/PredefineData.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCreateNurbsCurve dialog
CCreateNurbsCurve::CCreateNurbsCurve(CWnd* pParent /*=NULL*/)
: CDialog(CCreateNurbsCurve::IDD, pParent)
{
//{{AFX_DATA_INIT(CCreateNurbsCurve)
//}}AFX_DATA_INIT
}
void CCreateNurbsCurve::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCreateNurbsCurve)
DDX_Control(pDX, IDC_CREATE_CV_1, m_CurveProfileBtn);
DDX_Control(pDX, IDC_CREATE_CV_2, m_LineTagentBtn);
DDX_Control(pDX, IDC_CREATE_CV_3, m_LineParallelBtn);
DDX_Control(pDX, IDC_CREATE_CV_4, m_LineNormalBtn);
DDX_Control(pDX, IDC_CREATE_CV_5, m_IntersectBtn);
DDX_Control(pDX, IDC_CREATE_CV_6, m_DropBtn);
DDX_Control(pDX, IDC_CREATE_CV_7, m_CircleTangentBtn);
DDX_Control(pDX, IDC_CREATE_CV_8, m_CircleEdgeBtn);
DDX_Control(pDX, IDC_CREATE_CV_9, m_NormalBtn);
DDX_Control(pDX, IDC_CREATE_CV_10, m_CutBtn);
DDX_Control(pDX, IDC_CREATE_CV_11, m_RibBtn);
DDX_Control(pDX, IDC_CREATE_CV_12, m_LineBtn);
DDX_Control(pDX, IDC_CREATE_CV_13, m_FilletBtn);
DDX_Control(pDX, IDC_CREATE_CV_14, m_OffsetBtn);
DDX_Control(pDX, IDC_CREATE_CV_15, m_FitBtn);
DDX_Control(pDX, IDC_CREATE_CV_16, m_CosBtn);
DDX_Control(pDX, IDC_CREATE_CV_17, m_CircleBtn);
DDX_Control(pDX, IDC_CREATE_CV_18, m_CurveBtn);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCreateNurbsCurve, CDialog)
//{{AFX_MSG_MAP(CCreateNurbsCurve)
ON_BN_CLICKED(IDC_CREATE_CV_18, OnCreateNurbsCurve)
ON_BN_CLICKED(IDC_CREATE_CV_17, OnCreateCircle)
ON_BN_CLICKED(IDC_CREATE_CV_12, OnCreateLine)
ON_BN_CLICKED(IDC_CREATE_CV_16, OnCreateLayCurve)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCreateNurbsCurve message handlers
BOOL CCreateNurbsCurve::OnInitDialog()
{
CDialog::OnInitDialog();
SetPublicAttribs();
SET_DLG_POS;
static ButtonInfoType ButtonInfo[]=
{
{&this->m_CircleBtn, IDI_LEFTPANNEL_CIRCLE,OPT_CR_CIRCLE},
{&this->m_CircleEdgeBtn, IDI_LEFTPANNEL_EDGE,OPT_NOT_CARRY_OUT},
{&this->m_CircleTangentBtn, IDI_LEFTPANNEL_CIRTANGENT,OPT_NOT_CARRY_OUT},
{&this->m_CosBtn, IDI_LEFTPANNEL_COS,OPT_CR_NB_CV_LAY},
{&this->m_CurveBtn, IDI_LEFTPANNEL_CURVE,OPT_CR_NB_CURVE},
{&this->m_CurveProfileBtn, IDI_LEFTPANNEL_PROFILE,OPT_NOT_CARRY_OUT},
{&this->m_CutBtn, IDI_LEFTPANNEL_CUT,OPT_NOT_CARRY_OUT},
{&this->m_DropBtn, IDI_LEFTPANNEL_DROP,OPT_NOT_CARRY_OUT},
{&this->m_FilletBtn, IDI_LEFTPANNEL_FILLET,OPT_NOT_CARRY_OUT},
{&this->m_FitBtn, IDI_LEFTPANNEL_CVFIT,OPT_NOT_CARRY_OUT},
{&this->m_IntersectBtn, IDI_LEFTPANNEL_CVINTERSECT,OPT_NOT_CARRY_OUT},
{&this->m_LineBtn, IDI_LEFTPANNEL_LINE,OPT_CR_LINE},
{&this->m_LineNormalBtn, IDI_LEFTPANNEL_CVNORMAL,OPT_NOT_CARRY_OUT},
{&this->m_LineParallelBtn, IDI_LEFTPANNEL_PARALLEL,OPT_NOT_CARRY_OUT},
{&this->m_LineTagentBtn, IDI_LEFTPANNEL_TANGENT,OPT_NOT_CARRY_OUT},
{&this->m_NormalBtn, IDI_LEFTPANNEL_NORMAL,OPT_NOT_CARRY_OUT},
{&this->m_OffsetBtn, IDI_LEFTPANNEL_OFFSET,OPT_NOT_CARRY_OUT},
{&this->m_RibBtn, IDI_LEFTPANNEL_RIB,OPT_NOT_CARRY_OUT},
};
btn=sizeof(ButtonInfo)/sizeof(ButtonInfoType);
SetButtons(ButtonInfo);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CCreateNurbsCurve::OnCreateNurbsCurve()
{
UpdateOptInfo(OPT_CR_NB_CURVE);
}
void CCreateNurbsCurve::OnCreateCircle()
{
UpdateOptInfo(OPT_CR_CIRCLE);
}
void CCreateNurbsCurve::OnCreateLine()
{
UpdateOptInfo(OPT_CR_LINE);
}
void CCreateNurbsCurve::OnCreateLayCurve()
{
UpdateOptInfo(OPT_CR_NB_CV_LAY);
m_pDoc->CreateLayCurve();
}