// 3dParametersDlg.cpp // // (c)1998-2025 Codejock Software, All Rights Reserved. // // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN // CONSENT OF CODEJOCK SOFTWARE. // // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A // SINGLE COMPUTER. // // CONTACT INFORMATION: // support@codejock.com // http://www.codejock.com // ///////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "chartbrowser.h" #include "BaseView.h" #include "ComponentSliderCtrl.h" #include "3dParametersDlg.h" #ifdef _DEBUG # define new DEBUG_NEW # undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif #define ID_3D_ANTIALIASING 100 ///////////////////////////////////////////////////////////////////////////// // C3dParametersDlg dialog C3dParametersDlg::C3dParametersDlg(I3dParametersDlgHost& host, CWnd* pParent /*=NULL*/) : CTabCtrlDialog(C3dParametersDlg::IDD, pParent) , m_host(host) , m_wndChartControl(host.GetChartControl()) , m_pwndRotation(NULL) , m_pwndLightPosition(NULL) , m_pwndLightModelAmbient(NULL) , m_pwndLightAmbient(NULL) , m_pwndLightDiffuse(NULL) , m_pwndLightSpecular(NULL) , m_pwndMaterialEmission(NULL) , m_pwndMaterialDiffuse(NULL) , m_pwndMaterialSpecular(NULL) , m_pwndMaterialShininess(NULL) , m_pwndAntialiasing(NULL) { //{{AFX_DATA_INIT(C3dParametersDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_xRotationCallback.pThis = this; m_xLightPositionCallback.pThis = this; m_xLightModelAmbientCallback.pThis = this; m_xLightAmbientCallback.pThis = this; m_xLightDiffuseCallback.pThis = this; m_xLightSpecularCallback.pThis = this; m_xMaterialEmissionCallback.pThis = this; m_xMaterialDiffuseCallback.pThis = this; m_xMaterialSpecularCallback.pThis = this; m_xMaterialShininessCallback.pThis = this; } C3dParametersDlg::~C3dParametersDlg() { SAFE_DELETE(m_pwndRotation); SAFE_DELETE(m_pwndLightPosition); SAFE_DELETE(m_pwndLightModelAmbient); SAFE_DELETE(m_pwndLightAmbient); SAFE_DELETE(m_pwndLightDiffuse); SAFE_DELETE(m_pwndLightSpecular); SAFE_DELETE(m_pwndMaterialEmission); SAFE_DELETE(m_pwndMaterialDiffuse); SAFE_DELETE(m_pwndMaterialSpecular); SAFE_DELETE(m_pwndMaterialShininess); SAFE_DELETE(m_pwndAntialiasing); } void C3dParametersDlg::SetRotation(const CXTPChart3dRotation& rotation) { _ASSERTE(NULL != m_pwndRotation && ::IsWindow(*m_pwndRotation)); m_pwndRotation->SetValue(0, static_cast(rotation.m_dYaw)); m_pwndRotation->SetValue(1, static_cast(rotation.m_dPitch)); m_pwndRotation->SetValue(2, static_cast(rotation.m_dRoll)); } void C3dParametersDlg::SetLightPosition(const CXTPPoint3f& position) { _ASSERTE(NULL != m_pwndLightPosition && ::IsWindow(*m_pwndLightPosition)); m_pwndLightPosition->SetValue(0, position.X); m_pwndLightPosition->SetValue(1, position.Y); m_pwndLightPosition->SetValue(2, position.Z); } void C3dParametersDlg::SetLightModelAmbient(const CXTPChartColor& color) { _ASSERTE(NULL != m_pwndLightModelAmbient && ::IsWindow(*m_pwndLightModelAmbient)); m_pwndLightModelAmbient->SetValue(0, color.GetR()); m_pwndLightModelAmbient->SetValue(1, color.GetG()); m_pwndLightModelAmbient->SetValue(2, color.GetB()); m_pwndLightModelAmbient->SetValue(3, color.GetA()); } void C3dParametersDlg::SetLightAmbient(const CXTPChartColor& color) { _ASSERTE(NULL != m_pwndLightAmbient && ::IsWindow(*m_pwndLightAmbient)); m_pwndLightAmbient->SetValue(0, color.GetR()); m_pwndLightAmbient->SetValue(1, color.GetG()); m_pwndLightAmbient->SetValue(2, color.GetB()); m_pwndLightAmbient->SetValue(3, color.GetA()); } void C3dParametersDlg::SetLightDiffuse(const CXTPChartColor& color) { _ASSERTE(NULL != m_pwndLightDiffuse && ::IsWindow(*m_pwndLightDiffuse)); m_pwndLightDiffuse->SetValue(0, color.GetR()); m_pwndLightDiffuse->SetValue(1, color.GetG()); m_pwndLightDiffuse->SetValue(2, color.GetB()); m_pwndLightDiffuse->SetValue(3, color.GetA()); } void C3dParametersDlg::SetLightSpecular(const CXTPChartColor& color) { _ASSERTE(NULL != m_pwndLightSpecular && ::IsWindow(*m_pwndLightSpecular)); m_pwndLightSpecular->SetValue(0, color.GetR()); m_pwndLightSpecular->SetValue(1, color.GetG()); m_pwndLightSpecular->SetValue(2, color.GetB()); m_pwndLightSpecular->SetValue(3, color.GetA()); } void C3dParametersDlg::SetMaterialEmission(const CXTPChartColor& color) { _ASSERTE(NULL != m_pwndMaterialEmission && ::IsWindow(*m_pwndMaterialEmission)); m_pwndMaterialEmission->SetValue(0, color.GetR()); m_pwndMaterialEmission->SetValue(1, color.GetG()); m_pwndMaterialEmission->SetValue(2, color.GetB()); m_pwndMaterialEmission->SetValue(3, color.GetA()); } void C3dParametersDlg::SetMaterialDiffuse(const CXTPChartColor& color) { _ASSERTE(NULL != m_pwndMaterialDiffuse && ::IsWindow(*m_pwndMaterialDiffuse)); m_pwndMaterialDiffuse->SetValue(0, color.GetR()); m_pwndMaterialDiffuse->SetValue(1, color.GetG()); m_pwndMaterialDiffuse->SetValue(2, color.GetB()); m_pwndMaterialDiffuse->SetValue(3, color.GetA()); } void C3dParametersDlg::SetMaterialSpecular(const CXTPChartColor& color) { _ASSERTE(NULL != m_pwndMaterialSpecular && ::IsWindow(*m_pwndMaterialSpecular)); m_pwndMaterialSpecular->SetValue(0, color.GetR()); m_pwndMaterialSpecular->SetValue(1, color.GetG()); m_pwndMaterialSpecular->SetValue(2, color.GetB()); m_pwndMaterialSpecular->SetValue(3, color.GetA()); } void C3dParametersDlg::SetMaterialShininess(float fShininess) { _ASSERTE(NULL != m_pwndMaterialShininess && ::IsWindow(*m_pwndMaterialShininess)); m_pwndMaterialShininess->SetValue(0, fShininess); } void C3dParametersDlg::SetAntialiasing(BOOL bAntialiasing) { _ASSERTE(NULL != m_pwndAntialiasing && ::IsWindow(*m_pwndAntialiasing)); m_pwndAntialiasing->SetCheck(bAntialiasing ? BST_CHECKED : BST_UNCHECKED); } BOOL C3dParametersDlg::OnInitDialog() { CTabCtrlDialog::OnInitDialog(); CFont* pDlgFont = GetFont(); _ASSERTE(NULL != pDlgFont); LOGFONT lf; pDlgFont->GetLogFont(&lf); VERIFY(m_fntCtrl.CreateFontIndirect(&lf)); const int nHorzGap = XTP_DPI_X(6); CRect rcInitial(XTP_DPI_X(2), XTP_DPI_Y(2), XTP_DPI_X(291), XTP_DPI_Y(28)); CRect rcCtrl = rcInitial; m_pwndRotation = new CComponentSliderCtrl(m_xRotationCallback); if (m_pwndRotation->Create(this, rcCtrl)) { m_pwndRotation->AddValue(_T("Rotation.Yaw"), 0, 360, 0); m_pwndRotation->AddValue(_T("Rotation.Pitch"), 0, 360, 0); m_pwndRotation->AddValue(_T("Rotation.Roll"), 0, 360, 0); } else { TRACE(_T("Unable to create rotation controls\n")); } rcCtrl.OffsetRect(0, rcInitial.Height()); m_pwndLightPosition = new CComponentSliderCtrl(m_xLightPositionCallback); if (m_pwndLightPosition->Create(this, rcCtrl)) { m_pwndLightPosition->AddValue(_T("LightPosition.X"), 0.f, 1.f, 0.f); m_pwndLightPosition->AddValue(_T("LightPosition.Y"), 0.f, 1.f, 0.f); m_pwndLightPosition->AddValue(_T("LightPosition.Z"), 0.f, 1.f, 0.f); } else { TRACE(_T("Unable to create light position controls\n")); } rcCtrl.OffsetRect(0, rcInitial.Height()); m_pwndAntialiasing = new CButton(); if (!m_pwndAntialiasing->Create(_T("Enable Antialiasing"), WS_CHILD | BS_AUTOCHECKBOX, rcCtrl, this, ID_3D_ANTIALIASING)) { TRACE(_T("Unable to create antialiasing control\n")); } m_pwndAntialiasing->SetFont(&m_fntCtrl, FALSE); m_pwndAntialiasing->ShowWindow(SW_SHOW); rcCtrl = rcInitial; rcCtrl.OffsetRect(rcInitial.Width() + nHorzGap, 0); m_pwndLightModelAmbient = new CComponentSliderCtrl(m_xLightModelAmbientCallback); if (m_pwndLightModelAmbient->Create(this, rcCtrl)) { m_pwndLightModelAmbient->AddValue(_T("LightModelAmbient.R"), 0, 0xff, 0, _T("0x%02X")); m_pwndLightModelAmbient->AddValue(_T("LightModelAmbient.G"), 0, 0xff, 0, _T("0x%02X")); m_pwndLightModelAmbient->AddValue(_T("LightModelAmbient.B"), 0, 0xff, 0, _T("0x%02X")); m_pwndLightModelAmbient->AddValue(_T("LightModelAmbient.A"), 0, 0xff, 0, _T("0x%02X")); } else { TRACE(_T("Unable to create light model ambient color controls\n")); } rcCtrl.OffsetRect(0, rcInitial.Height()); m_pwndLightAmbient = new CComponentSliderCtrl(m_xLightAmbientCallback); if (m_pwndLightAmbient->Create(this, rcCtrl)) { m_pwndLightAmbient->AddValue(_T("LightAmbient.R"), 0, 0xff, 0, _T("0x%02X")); m_pwndLightAmbient->AddValue(_T("LightAmbient.G"), 0, 0xff, 0, _T("0x%02X")); m_pwndLightAmbient->AddValue(_T("LightAmbient.B"), 0, 0xff, 0, _T("0x%02X")); m_pwndLightAmbient->AddValue(_T("LightAmbient.A"), 0, 0xff, 0, _T("0x%02X")); } else { TRACE(_T("Unable to create light ambient color controls\n")); } rcCtrl.OffsetRect(0, rcInitial.Height()); m_pwndLightDiffuse = new CComponentSliderCtrl(m_xLightDiffuseCallback); if (m_pwndLightDiffuse->Create(this, rcCtrl)) { m_pwndLightDiffuse->AddValue(_T("LightDiffuse.R"), 0, 0xff, 0, _T("0x%02X")); m_pwndLightDiffuse->AddValue(_T("LightDiffuse.G"), 0, 0xff, 0, _T("0x%02X")); m_pwndLightDiffuse->AddValue(_T("LightDiffuse.B"), 0, 0xff, 0, _T("0x%02X")); m_pwndLightDiffuse->AddValue(_T("LightDiffuse.A"), 0, 0xff, 0, _T("0x%02X")); } else { TRACE(_T("Unable to create light diffuse color controls\n")); } rcCtrl.OffsetRect(0, rcInitial.Height()); m_pwndLightSpecular = new CComponentSliderCtrl(m_xLightSpecularCallback); if (m_pwndLightSpecular->Create(this, rcCtrl)) { m_pwndLightSpecular->AddValue(_T("LightSpecular.R"), 0, 0xff, 0, _T("0x%02X")); m_pwndLightSpecular->AddValue(_T("LightSpecular.G"), 0, 0xff, 0, _T("0x%02X")); m_pwndLightSpecular->AddValue(_T("LightSpecular.B"), 0, 0xff, 0, _T("0x%02X")); m_pwndLightSpecular->AddValue(_T("LightSpecular.A"), 0, 0xff, 0, _T("0x%02X")); } else { TRACE(_T("Unable to create light specular color controls\n")); } rcCtrl = rcInitial; rcCtrl.OffsetRect((rcInitial.Width() + nHorzGap) * 2, 0); m_pwndMaterialEmission = new CComponentSliderCtrl(m_xMaterialEmissionCallback); if (m_pwndMaterialEmission->Create(this, rcCtrl)) { m_pwndMaterialEmission->AddValue(_T("MaterialEmission.R"), 0, 0xff, 0, _T("0x%02X")); m_pwndMaterialEmission->AddValue(_T("MaterialEmission.G"), 0, 0xff, 0, _T("0x%02X")); m_pwndMaterialEmission->AddValue(_T("MaterialEmission.B"), 0, 0xff, 0, _T("0x%02X")); m_pwndMaterialEmission->AddValue(_T("MaterialEmission.A"), 0, 0xff, 0, _T("0x%02X")); } else { TRACE(_T("Unable to create material emission color controls\n")); } rcCtrl.OffsetRect(0, rcInitial.Height()); m_pwndMaterialDiffuse = new CComponentSliderCtrl(m_xMaterialDiffuseCallback); if (m_pwndMaterialDiffuse->Create(this, rcCtrl)) { m_pwndMaterialDiffuse->AddValue(_T("MaterialDiffuse.R"), 0, 0xff, 0, _T("0x%02X")); m_pwndMaterialDiffuse->AddValue(_T("MaterialDiffuse.G"), 0, 0xff, 0, _T("0x%02X")); m_pwndMaterialDiffuse->AddValue(_T("MaterialDiffuse.B"), 0, 0xff, 0, _T("0x%02X")); m_pwndMaterialDiffuse->AddValue(_T("MaterialDiffuse.A"), 0, 0xff, 0, _T("0x%02X")); } else { TRACE(_T("Unable to create material diffuse color controls\n")); } rcCtrl.OffsetRect(0, rcInitial.Height()); m_pwndMaterialSpecular = new CComponentSliderCtrl(m_xMaterialSpecularCallback); if (m_pwndMaterialSpecular->Create(this, rcCtrl)) { m_pwndMaterialSpecular->AddValue(_T("MaterialSpecular.R"), 0, 0xff, 0, _T("0x%02X")); m_pwndMaterialSpecular->AddValue(_T("MaterialSpecular.G"), 0, 0xff, 0, _T("0x%02X")); m_pwndMaterialSpecular->AddValue(_T("MaterialSpecular.B"), 0, 0xff, 0, _T("0x%02X")); m_pwndMaterialSpecular->AddValue(_T("MaterialSpecular.A"), 0, 0xff, 0, _T("0x%02X")); } else { TRACE(_T("Unable to create material specular color controls\n")); } rcCtrl.OffsetRect(0, rcInitial.Height()); m_pwndMaterialShininess = new CComponentSliderCtrl(m_xMaterialShininessCallback); if (m_pwndMaterialShininess->Create(this, rcCtrl)) { m_pwndMaterialShininess->AddValue(_T("MaterialShininess"), 0.f, 1.f, 0.f); } else { TRACE(_T("Unable to create material shininess controls\n")); } return TRUE; } void C3dParametersDlg::OnRotationChanged(const float* pfYaw, const float* pfPitch, const float* pfRoll) { CXTPChart3dRotation rotation = m_host.GetChartRotation(); m_host.SetChartRotation(CXTPChart3dRotation(NULL != pfYaw ? *pfYaw : rotation.m_dYaw, NULL != pfPitch ? *pfPitch : rotation.m_dPitch, NULL != pfRoll ? *pfRoll : rotation.m_dRoll)); } void C3dParametersDlg::OnLightPositionChanged(const float* pX, const float* pY, const float* pZ) { CXTPChartDiagram3DAppearance* p3dAppearance = m_wndChartControl.GetContent()->GetAppearance()->GetDiagram3DAppearance(); _ASSERTE(NULL != p3dAppearance); if (NULL != pX) p3dAppearance->LightPosition.X = *pX; if (NULL != pY) p3dAppearance->LightPosition.Y = *pY; if (NULL != pZ) p3dAppearance->LightPosition.Z = *pZ; m_wndChartControl.OnChartChanged(); } void C3dParametersDlg::OnLightModelAmbientChanged(const int* pR, const int* pG, const int* pB, const int* pA) { CXTPChartDiagram3DAppearance* p3dAppearance = m_wndChartControl.GetContent()->GetAppearance()->GetDiagram3DAppearance(); _ASSERTE(NULL != p3dAppearance); DWORD argb = CXTPChartColor::MakeARGB((NULL != pA ? *pA : p3dAppearance->LightModelAmbientColor.GetA()), (NULL != pR ? *pR : p3dAppearance->LightModelAmbientColor.GetR()), (NULL != pG ? *pG : p3dAppearance->LightModelAmbientColor.GetG()), (NULL != pB ? *pB : p3dAppearance->LightModelAmbientColor.GetB())); p3dAppearance->LightModelAmbientColor.SetValue(argb); m_wndChartControl.OnChartChanged(); } void C3dParametersDlg::OnLightAmbientChanged(const int* pR, const int* pG, const int* pB, const int* pA) { CXTPChartDiagram3DAppearance* p3dAppearance = m_wndChartControl.GetContent()->GetAppearance()->GetDiagram3DAppearance(); _ASSERTE(NULL != p3dAppearance); DWORD argb = CXTPChartColor::MakeARGB((NULL != pA ? *pA : p3dAppearance->LightAmbientColor.GetA()), (NULL != pR ? *pR : p3dAppearance->LightAmbientColor.GetR()), (NULL != pG ? *pG : p3dAppearance->LightAmbientColor.GetG()), (NULL != pB ? *pB : p3dAppearance->LightAmbientColor.GetB())); p3dAppearance->LightAmbientColor.SetValue(argb); m_wndChartControl.OnChartChanged(); } void C3dParametersDlg::OnLightDiffuseChanged(const int* pR, const int* pG, const int* pB, const int* pA) { CXTPChartDiagram3DAppearance* p3dAppearance = m_wndChartControl.GetContent()->GetAppearance()->GetDiagram3DAppearance(); _ASSERTE(NULL != p3dAppearance); DWORD argb = CXTPChartColor::MakeARGB((NULL != pA ? *pA : p3dAppearance->LightDiffuseColor.GetA()), (NULL != pR ? *pR : p3dAppearance->LightDiffuseColor.GetR()), (NULL != pG ? *pG : p3dAppearance->LightDiffuseColor.GetG()), (NULL != pB ? *pB : p3dAppearance->LightDiffuseColor.GetB())); p3dAppearance->LightDiffuseColor.SetValue(argb); m_wndChartControl.OnChartChanged(); } void C3dParametersDlg::OnLightSpecularChanged(const int* pR, const int* pG, const int* pB, const int* pA) { CXTPChartDiagram3DAppearance* p3dAppearance = m_wndChartControl.GetContent()->GetAppearance()->GetDiagram3DAppearance(); _ASSERTE(NULL != p3dAppearance); DWORD argb = CXTPChartColor::MakeARGB((NULL != pA ? *pA : p3dAppearance->LightSpecularColor.GetA()), (NULL != pR ? *pR : p3dAppearance->LightSpecularColor.GetR()), (NULL != pG ? *pG : p3dAppearance->LightSpecularColor.GetG()), (NULL != pB ? *pB : p3dAppearance->LightSpecularColor.GetB())); p3dAppearance->LightSpecularColor.SetValue(argb); m_wndChartControl.OnChartChanged(); } void C3dParametersDlg::OnMaterialEmissionChanged(const int* pR, const int* pG, const int* pB, const int* pA) { CXTPChartDiagram3DAppearance* p3dAppearance = m_wndChartControl.GetContent()->GetAppearance()->GetDiagram3DAppearance(); _ASSERTE(NULL != p3dAppearance); DWORD argb = CXTPChartColor::MakeARGB((NULL != pA ? *pA : p3dAppearance->MaterialEmissionColor.GetA()), (NULL != pR ? *pR : p3dAppearance->MaterialEmissionColor.GetR()), (NULL != pG ? *pG : p3dAppearance->MaterialEmissionColor.GetG()), (NULL != pB ? *pB : p3dAppearance->MaterialEmissionColor.GetB())); p3dAppearance->MaterialEmissionColor.SetValue(argb); m_wndChartControl.OnChartChanged(); } void C3dParametersDlg::OnMaterialDiffuseChanged(const int* pR, const int* pG, const int* pB, const int* pA) { CXTPChartDiagram3DAppearance* p3dAppearance = m_wndChartControl.GetContent()->GetAppearance()->GetDiagram3DAppearance(); _ASSERTE(NULL != p3dAppearance); DWORD argb = CXTPChartColor::MakeARGB((NULL != pA ? *pA : p3dAppearance->MaterialDiffuseColor.GetA()), (NULL != pR ? *pR : p3dAppearance->MaterialDiffuseColor.GetR()), (NULL != pG ? *pG : p3dAppearance->MaterialDiffuseColor.GetG()), (NULL != pB ? *pB : p3dAppearance->MaterialDiffuseColor.GetB())); p3dAppearance->MaterialDiffuseColor.SetValue(argb); m_wndChartControl.OnChartChanged(); } void C3dParametersDlg::OnMaterialSpecularChanged(const int* pR, const int* pG, const int* pB, const int* pA) { CXTPChartDiagram3DAppearance* p3dAppearance = m_wndChartControl.GetContent()->GetAppearance()->GetDiagram3DAppearance(); _ASSERTE(NULL != p3dAppearance); DWORD argb = CXTPChartColor::MakeARGB((NULL != pA ? *pA : p3dAppearance->MaterialSpecularColor.GetA()), (NULL != pR ? *pR : p3dAppearance->MaterialSpecularColor.GetR()), (NULL != pG ? *pG : p3dAppearance->MaterialSpecularColor.GetG()), (NULL != pB ? *pB : p3dAppearance->MaterialSpecularColor.GetB())); p3dAppearance->MaterialSpecularColor.SetValue(argb); m_wndChartControl.OnChartChanged(); } void C3dParametersDlg::OnMaterialShininessChanged(float fShininess) { CXTPChartDiagram3DAppearance* p3dAppearance = m_wndChartControl.GetContent()->GetAppearance()->GetDiagram3DAppearance(); _ASSERTE(NULL != p3dAppearance); p3dAppearance->MaterialShininess = fShininess; m_wndChartControl.OnChartChanged(); } void C3dParametersDlg::OnBtnAntialiasingClicked() { CXTPChartDiagram3DAppearance* p3dAppearance = m_wndChartControl.GetContent()->GetAppearance()->GetDiagram3DAppearance(); _ASSERTE(NULL != p3dAppearance); p3dAppearance->Antialiasing = (BST_CHECKED == m_pwndAntialiasing->GetCheck()); m_wndChartControl.OnChartChanged(); } void C3dParametersDlg::ComponentSliderCtrlCallback::OnBeforeValueChanged(int nItem) { pThis->m_wndChartControl.BeginFrequentUpdates(); UNREFERENCED_PARAMETER(nItem); } void C3dParametersDlg::ComponentSliderCtrlCallback::OnAfterValueChanged(int nItem) { pThis->m_wndChartControl.EndFrequentUpdates(); UNREFERENCED_PARAMETER(nItem); } void C3dParametersDlg::XRotationCallback::OnValueChanged(int nItem, int nValue) { float fValue = static_cast(nValue); switch (nItem) { case 0: // yaw pThis->OnRotationChanged(&fValue, NULL, NULL); break; case 1: // pitch pThis->OnRotationChanged(NULL, &fValue, NULL); break; case 2: // roll pThis->OnRotationChanged(NULL, NULL, &fValue); break; default: _ASSERTE(!"Unexpected"); } } void C3dParametersDlg::XLightPositionCallback::OnValueChanged(int nItem, float fValue) { switch (nItem) { case 0: // Z pThis->OnLightPositionChanged(&fValue, NULL, NULL); break; case 1: // Y pThis->OnLightPositionChanged(NULL, &fValue, NULL); break; case 2: // Z pThis->OnLightPositionChanged(NULL, NULL, &fValue); break; default: _ASSERTE(!"Unexpected"); } } void C3dParametersDlg::XLightModelAmbientCallback::OnValueChanged(int nItem, int nValue) { switch (nItem) { case 0: // R pThis->OnLightModelAmbientChanged(&nValue, NULL, NULL, NULL); break; case 1: // G pThis->OnLightModelAmbientChanged(NULL, &nValue, NULL, NULL); break; case 2: // B pThis->OnLightModelAmbientChanged(NULL, NULL, &nValue, NULL); break; case 3: // A pThis->OnLightModelAmbientChanged(NULL, NULL, NULL, &nValue); break; default: _ASSERTE(!"Unexpected"); } } void C3dParametersDlg::XLightAmbientCallback::OnValueChanged(int nItem, int nValue) { switch (nItem) { case 0: // R pThis->OnLightAmbientChanged(&nValue, NULL, NULL, NULL); break; case 1: // G pThis->OnLightAmbientChanged(NULL, &nValue, NULL, NULL); break; case 2: // B pThis->OnLightAmbientChanged(NULL, NULL, &nValue, NULL); break; case 3: // A pThis->OnLightAmbientChanged(NULL, NULL, NULL, &nValue); break; default: _ASSERTE(!"Unexpected"); } } void C3dParametersDlg::XLightDiffuseCallback::OnValueChanged(int nItem, int nValue) { switch (nItem) { case 0: // R pThis->OnLightDiffuseChanged(&nValue, NULL, NULL, NULL); break; case 1: // G pThis->OnLightDiffuseChanged(NULL, &nValue, NULL, NULL); break; case 2: // B pThis->OnLightDiffuseChanged(NULL, NULL, &nValue, NULL); break; case 3: // A pThis->OnLightDiffuseChanged(NULL, NULL, NULL, &nValue); break; default: _ASSERTE(!"Unexpected"); } } void C3dParametersDlg::XLightSpecularCallback::OnValueChanged(int nItem, int nValue) { switch (nItem) { case 0: // R pThis->OnLightSpecularChanged(&nValue, NULL, NULL, NULL); break; case 1: // G pThis->OnLightSpecularChanged(NULL, &nValue, NULL, NULL); break; case 2: // B pThis->OnLightSpecularChanged(NULL, NULL, &nValue, NULL); break; case 3: // A pThis->OnLightSpecularChanged(NULL, NULL, NULL, &nValue); break; default: _ASSERTE(!"Unexpected"); } } void C3dParametersDlg::XMaterialEmissionCallback::OnValueChanged(int nItem, int nValue) { switch (nItem) { case 0: // R pThis->OnMaterialEmissionChanged(&nValue, NULL, NULL, NULL); break; case 1: // G pThis->OnMaterialEmissionChanged(NULL, &nValue, NULL, NULL); break; case 2: // B pThis->OnMaterialEmissionChanged(NULL, NULL, &nValue, NULL); break; case 3: // A pThis->OnMaterialEmissionChanged(NULL, NULL, NULL, &nValue); break; default: _ASSERTE(!"Unexpected"); } } void C3dParametersDlg::XMaterialDiffuseCallback::OnValueChanged(int nItem, int nValue) { switch (nItem) { case 0: // R pThis->OnMaterialDiffuseChanged(&nValue, NULL, NULL, NULL); break; case 1: // G pThis->OnMaterialDiffuseChanged(NULL, &nValue, NULL, NULL); break; case 2: // B pThis->OnMaterialDiffuseChanged(NULL, NULL, &nValue, NULL); break; case 3: // A pThis->OnMaterialDiffuseChanged(NULL, NULL, NULL, &nValue); break; default: _ASSERTE(!"Unexpected"); } } void C3dParametersDlg::XMaterialSpecularCallback::OnValueChanged(int nItem, int nValue) { switch (nItem) { case 0: // R pThis->OnMaterialSpecularChanged(&nValue, NULL, NULL, NULL); break; case 1: // G pThis->OnMaterialSpecularChanged(NULL, &nValue, NULL, NULL); break; case 2: // B pThis->OnMaterialSpecularChanged(NULL, NULL, &nValue, NULL); break; case 3: // A pThis->OnMaterialSpecularChanged(NULL, NULL, NULL, &nValue); break; default: _ASSERTE(!"Unexpected"); } } void C3dParametersDlg::XMaterialShininessCallback::OnValueChanged(int nItem, float fValue) { pThis->OnMaterialShininessChanged(fValue); } BEGIN_MESSAGE_MAP(C3dParametersDlg, CTabCtrlDialog) ON_COMMAND(ID_3D_ANTIALIASING, OnBtnAntialiasingClicked) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // C3dParametersDlg message handlers