Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

volumebar.cpp

Go to the documentation of this file.
00001 
00002 
00003 
00004 // volumebar.cpp : implementation file
00005 //
00006 
00007 #include "stdafx.h"
00008 #include "3dvis.h"
00009 #include "volumebar.h"
00010 
00011 
00012 #include "data.h"
00013 #include "raycaster.h"
00014 extern Data *data3D;
00015 extern Raycaster *raycaster;
00016 
00017 
00018 #ifdef _DEBUG
00019 #define new DEBUG_NEW
00020 #undef THIS_FILE
00021 static char THIS_FILE[] = __FILE__;
00022 #endif
00023 
00025 // volumebar dialog
00026 
00027 volumebar::volumebar(/*CWnd* pParent /*=NULL*/)
00028 //      : CDialog(volumebar::IDD, pParent)
00029         : CDialogBar()
00030 {
00031         //{{AFX_DATA_INIT(volumebar)
00032         m_fVolumeStepLength = 1.0f;
00033         //}}AFX_DATA_INIT
00034 
00035         
00036         m_dRenderType = NN;
00037 }
00038 
00039 
00040 void volumebar::DoDataExchange(CDataExchange* pDX)
00041 {
00042 //      CDialog::DoDataExchange(pDX);
00043         //{{AFX_DATA_MAP(volumebar)
00044         DDX_Text(pDX, IDC_EDIT_STEP_LENGTH, m_fVolumeStepLength);
00045         DDV_MinMaxFloat(pDX, m_fVolumeStepLength, 1.f, 10.f);
00046         //}}AFX_DATA_MAP
00047 }
00048 
00049 
00050 BEGIN_MESSAGE_MAP(volumebar, CDialogBar)
00051         //{{AFX_MSG_MAP(volumebar)
00052         ON_BN_CLICKED(IDC_BUTTON_RENDER_VOLUME, OnButtonRenderVolume)
00053         ON_BN_CLICKED(IDC_RADIO_VOLUME_NN, OnRadioVolumeNn)
00054         ON_BN_CLICKED(IDC_RADIO_VOLUME_TRI, OnRadioVolumeTri)
00055         ON_WM_SHOWWINDOW()
00056         //}}AFX_MSG_MAP
00057         ON_UPDATE_COMMAND_UI(IDC_BUTTON_RENDER_VOLUME, OnUpdateButtonRenderVolume)
00058 END_MESSAGE_MAP()
00059 
00060 
00061 // volumebar message handlers
00062 
00063 void volumebar::OnUpdateButtonRenderVolume(CCmdUI* pCmdUI) {
00064         pCmdUI->Enable();
00065 }
00066 
00067 
00068 void volumebar::OnRadioVolumeNn() 
00069 {
00070         // TODO: Add your control notification handler code here
00071         if (!raycaster)
00072                 return;
00073 
00074         raycaster->SetRaytype(NN);
00075         m_dRenderType = NN;
00076 }
00077 
00078 void volumebar::OnRadioVolumeTri() 
00079 {
00080         // TODO: Add your control notification handler code here
00081         if (!raycaster)
00082                 return;
00083 
00084         raycaster->SetRaytype(TRI);
00085         m_dRenderType = TRI;
00086 }
00087 
00088 void volumebar::OnShowWindow(BOOL bShow, UINT nStatus) 
00089 {
00090         CDialogBar::OnShowWindow(bShow, nStatus);
00091         
00092         UpdateData(FALSE);
00093 
00094         // TODO: Add your message handler code here
00095         int button;
00096         switch (m_dRenderType) {
00097                 case NN:
00098                         button = IDC_RADIO_VOLUME_NN;
00099                         break;
00100                 case TRI:
00101                         button = IDC_RADIO_VOLUME_TRI;
00102                         break;
00103         }
00104         ((CButton *)GetDlgItem(button))->SetCheck(1);
00105 }
00106 
00107 
00108 void volumebar::OnButtonRenderVolume() 
00109 {
00110         // TODO: Add your control notification handler code here
00111         if (!raycaster)
00112                 return;
00113         
00114 //      raycaster->UpdateSize();
00115         raycaster->Raycast();
00116         
00117 }

Generated on Thu Jan 30 21:35:43 2003 for 3DVis by doxygen1.3-rc2