reman3/Rayman_X/cpa/tempgrp/ITF/cpadopt.cpp

200 lines
5.9 KiB
C++

/*=========================================================================
*
* CPAdOpt.cpp : Option Dialog - Implementation file
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#include "stdafx.h"
#ifdef ACTIVE_EDITOR
#include "acp_base.h"
#include "itf/CPAdOpt.hpp"
#include "itf/cpainter.hpp"
#include "itf/cohemngr.hpp"
#include "itf/cpaproj.hpp"
#include "itf/a3dkeyal.hpp"
//#################################################################################
// CPA_DialogOption dialog
//#################################################################################
/*----------------------------------------
----------------------------------------*/
CPA_DialogOption::CPA_DialogOption(CWnd* pParent /*=NULL*/)
: CDialog(CPA_DialogOption::IDD, pParent)
{
//{{AFX_DATA_INIT(EDT_DialogFlag)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
/*----------------------------------------
----------------------------------------*/
void CPA_DialogOption::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPA_DialogOption)
// general options
DDX_Control(pDX, CPA_IDC_AUTOCOHEMNGR, m_cCoheMngr);
DDX_Control(pDX, CPA_IDC_REINITMAP, m_cReinitMap);
DDX_Control(pDX, CPA_IDC_SCALEOBJECTS, m_cScaleEditor);
DDX_Control(pDX, CPA_IDC_PYRAMIDDEPTH, m_cPyramidDepth);
DDX_Control(pDX, CPA_IDC_TARGETDEPTH, m_cTargetDepth);
DDX_Control(pDX, CPA_IDC_AUTHORISATIONS, m_cAuthorisation);
DDX_Control(pDX, CPA_IDC_KEYBOARD, m_cKeyboard);
// move options
DDX_Control(pDX, CPA_IDC_ROTSTEP, m_cRotStep);
DDX_Control(pDX, CPA_IDC_TRANSTEP, m_cTranStep);
DDX_Control(pDX, CPA_IDC_GOTHROUGH, m_cGothrough);
DDX_Control(pDX, CPA_IDC_BLOCK, m_cBlock);
DDX_Control(pDX, CPA_IDC_SPEEDUP, m_cAccelerate);
//CPA2 Gabi Dumitrascu 98/07/09
//screen options
DDX_Control(pDX, IDC_CHECK_AUTOMATIC_SWAP, m_cAutomaticSwap);
DDX_Control(pDX, IDC_RADIO_SWAP_LEFT, m_cSwapLeft);
DDX_Control(pDX, IDC_RADIO_SWAP_RIGHT, m_cSwapRight);
DDX_Control(pDX, IDC_RADIO_SWAP_BOTH, m_cSwapBoth);
//End CPA2 Gabi Dumitrascu 98/07/09
//}}AFX_DATA_MAP
}
/*----------------------------------------
----------------------------------------*/
BEGIN_MESSAGE_MAP(CPA_DialogOption, CDialog)
//{{AFX_MSG_MAP(CPA_DialogOption)
ON_BN_CLICKED(CPA_IDC_AUTHORISATIONS, OnAuthorisation)
ON_BN_CLICKED(CPA_IDC_KEYBOARD, OnKeyboard)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//#################################################################################
// EDT_DialogFlag message handlers
//#################################################################################
/*----------------------------------------
----------------------------------------*/
void CPA_DialogOption::fn_vDoDialog (CPA_Interface *pInterface)
{
// init parameters
m_pInterface = pInterface;
// this dialog is modal
DoModal();
}
/*----------------------------------------
----------------------------------------*/
BOOL CPA_DialogOption::OnInitDialog ()
{
float fDepth;
char szDepth[15];
// Create the dialog
CDialog::OnInitDialog();
// init general options
m_cCoheMngr.SetCheck(g_oCoherenceManager.m_fn_bIsCoherenceManagerDialogAutomatic());
m_cReinitMap.SetCheck(M_GetMainApp()->m_bAutoReinitTheMap);
m_cScaleEditor.SetCheck(m_pInterface->fn_bIsScaleActive());
// init pyramidal depth
fDepth = GetInterface()->GetPyramidalDepth();
sprintf(szDepth, "%8.4f", fDepth);
m_cPyramidDepth.SetWindowText(szDepth);
// init target depth
fDepth = GetInterface()->GetCameraTargetDepth();
sprintf(szDepth, "%8.4f", fDepth);
m_cTargetDepth.SetWindowText(szDepth);
// init move options
// ...
//CPA2 Gabi Dumitrascu 98/07/09
//init screen options
m_cAutomaticSwap.SetCheck (m_pInterface->fn_bGetAutomaticSwap ());
int nSwapID;
switch (m_pInterface->fn_eGetForceSwap())
{
case eSwapBoth : nSwapID = IDC_RADIO_SWAP_BOTH; break;
case eSwapLeft : nSwapID = IDC_RADIO_SWAP_LEFT; break;
case eSwapRight : nSwapID = IDC_RADIO_SWAP_RIGHT; break;
}
CheckRadioButton (IDC_RADIO_SWAP_LEFT, IDC_RADIO_SWAP_BOTH, nSwapID);
//End CPA2 Gabi Dumitrascu 98/07/09
return TRUE;
}
/*----------------------------------------
----------------------------------------*/
void CPA_DialogOption::OnOK()
{
float fDepth;
char szDepth[15];
// register general options
g_oCoherenceManager.m_fn_vSetAutomaticCoherenceManagerDialog(m_cCoheMngr.GetCheck());
M_GetMainApp()->m_bAutoReinitTheMap = m_cReinitMap.GetCheck();
GetInterface()->fn_bSetScaleActive(m_cScaleEditor.GetCheck());
// register pyramidal depth
m_cPyramidDepth.GetWindowText(szDepth, 15);
fDepth = (float) atof (szDepth);
GetInterface()->SetPyramidalDepth(fDepth);
// register target depth
m_cTargetDepth.GetWindowText(szDepth, 15);
fDepth = (float) atof (szDepth);
GetInterface()->SetCameraTargetDepth(fDepth);
//CPA2 Gabi Dumitrascu 98/07/09
m_pInterface->fn_bSetAutomaticSwap (m_cAutomaticSwap.GetCheck ());
int nSwapID = GetCheckedRadioButton (IDC_RADIO_SWAP_LEFT, IDC_RADIO_SWAP_BOTH);
tdeForceSwap eForceSwap = eSwapRight;
switch (nSwapID)
{
case IDC_RADIO_SWAP_BOTH : eForceSwap = eSwapBoth; break;
case IDC_RADIO_SWAP_LEFT : eForceSwap = eSwapLeft; break;
case IDC_RADIO_SWAP_RIGHT : eForceSwap = eSwapRight; break;
}
m_pInterface->fn_eSetForceSwap (eForceSwap);
//End CPA2 Gabi Dumitrascu 98/07/09
// register options
GetInterface()->fn_vSaveOptions();
// close dialog
CDialog::OnOK();
}
/*----------------------------------------
----------------------------------------*/
void CPA_DialogOption::OnCancel()
{
// close dialog
CDialog::OnCancel();
}
/*----------------------------------------
----------------------------------------*/
void CPA_DialogOption::OnAuthorisation()
{
}
/*----------------------------------------
----------------------------------------*/
void CPA_DialogOption::OnKeyboard()
{
A3d_KeyboardAllConfDlg oDialog;
oDialog.DoModal();
}
#endif // ACTIVE_EDITOR