www.pudn.com > SurfWareNew06.3.5(LYW).rar > CurveRotateProperties.cpp
// CurveRotateProperties.cpp : implementation file
//
#include "stdafx.h"
#include "surfware.h"
#include "CurveRotateProperties.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCurveRotateProperties dialog
CCurveRotateProperties::CCurveRotateProperties(CWnd* pParent /*=NULL*/)
: CDialog(CCurveRotateProperties::IDD, pParent)
{
//{{AFX_DATA_INIT(CCurveRotateProperties)
m_angle = 360.00;
m_DirectionX = 1.0f;
m_DirectionY = 0.0f;
m_DirectionZ = 0.0f;
m_PointX = 0.0f;
m_PointY = 0.0f;
m_PointZ = 0.0f;
m_SelectAxis = X;
m_angleEnd = 0.0;
selectvolume=0;
//}}AFX_DATA_INIT
}
void CCurveRotateProperties::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCurveRotateProperties)
DDX_Text(pDX, IDC_EDIT_ANGEL, m_angle);
DDV_MinMaxDouble(pDX, m_angle, 0., 360.);
DDX_Text(pDX, IDC_EDIT_DIRECTION_X, m_DirectionX);
DDX_Text(pDX, IDC_EDIT_DIRECTION_Y, m_DirectionY);
DDX_Text(pDX, IDC_EDIT_DIRECTION_Z, m_DirectionZ);
DDX_Text(pDX, IDC_EDIT_POINT_X, m_PointX);
DDX_Text(pDX, IDC_EDIT_POINT_Y, m_PointY);
DDX_Text(pDX, IDC_EDIT_POINT_Z, m_PointZ);
DDX_Text(pDX, IDC_ANGLE_END, m_angleEnd);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCurveRotateProperties, CDialog)
//{{AFX_MSG_MAP(CCurveRotateProperties)
ON_BN_CLICKED(IDC_RADIO_USER_DEFINE, OnRadioUserDefine)
ON_BN_CLICKED(IDC_RADIO_XAXIS, OnRadioXaxis)
ON_BN_CLICKED(IDC_RADIO_YAXIS, OnRadioYaxis)
ON_BN_CLICKED(IDC_RADIO_ZAXIS, OnRadioZaxis)
ON_BN_CLICKED(IDC_VOLUME, OnVolume)
ON_BN_CLICKED(IDC_RADIO1, OnCurve)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCurveRotateProperties message handlers
void CCurveRotateProperties::OnRadioUserDefine()
{
// TODO: Add your control notification handler code here
m_SelectAxis = USER_DEFINED;
SetEditStatus(TRUE);
m_PointX = 0;
m_PointY = 0;
m_PointZ = 0;
m_DirectionX = 0;
m_DirectionY = 0;
m_DirectionZ = 0;
m_angleEnd=0;
UpdateData(FALSE);
}
void CCurveRotateProperties::SetEditStatus(BOOL Status)
{
for (int i = IDC_EDIT_POINT_X; i <= IDC_EDIT_DIRECTION_Z; i++)
{
GetDlgItem(i)->EnableWindow(Status);
}
}
void CCurveRotateProperties::OnRadioXaxis()
{
// TODO: Add your control notification handler code here
m_SelectAxis = X;
SetEditStatus(FALSE);
m_PointX = 0;
m_PointY = 0;
m_PointZ = 0;
m_DirectionX = 1;
m_DirectionY = 0;
m_DirectionZ = 0;
UpdateData(FALSE);
}
BOOL CCurveRotateProperties::OnInitDialog()
{
CDialog::OnInitDialog();
((CButton*)GetDlgItem(IDC_RADIO_XAXIS))->SetCheck(TRUE);
m_SelectAxis = X;
m_angle = 360.00;
m_DirectionX = 1.0f;
m_DirectionY = 0.0f;
m_DirectionZ = 0.0f;
m_PointX = 0.0f;
m_SelectAxis = X;
m_PointY = 0.0f;
m_PointZ = 0.0f;
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CCurveRotateProperties::OnRadioYaxis()
{
// TODO: Add your control notification handler code here
m_SelectAxis = Y;
SetEditStatus(FALSE);
m_PointX = 0;
m_PointY = 0;
m_PointZ = 0;
m_DirectionX = 0;
m_DirectionY = 1;
m_DirectionZ = 0;
UpdateData(FALSE);
}
void CCurveRotateProperties::OnRadioZaxis()
{
m_SelectAxis = Z;
SetEditStatus(FALSE);
// TODO: Add your control notification handler code here
m_PointX = 0;
m_PointY = 0;
m_PointZ = 0;
m_DirectionX = 0;
m_DirectionY = 0;
m_DirectionZ = 1;
UpdateData(FALSE);
}
void CCurveRotateProperties::OnVolume()
{
// TODO: Add your control notification handler code here
selectvolume=1;
GetDlgItem(IDC_ANGLE_END)->EnableWindow(TRUE);
}
void CCurveRotateProperties::OnCurve()
{
// TODO: Add your control notification handler code here
selectvolume=0;
GetDlgItem(IDC_ANGLE_END)->EnableWindow(FALSE);
}