00001 00002 00003 00004 00005 00006 00007 #include "Volumizer.h" 00008 00009 options vol_opts; 00010 00014 void InitOptions() 00015 { 00016 vol_opts.stepsize = 1.0f; 00017 vol_opts.jitter = 0.25f; 00018 vol_opts.gradstep = 1.0f; 00019 vol_opts.rendermode = MODE_FULL; 00020 } 00021 00025 BOOL CALLBACK OptionsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) 00026 { 00027 char text[20]; 00028 00029 switch (message) 00030 { 00031 case WM_INITDIALOG: 00033 swprintf((LPWSTR)text, L"%1.2f", vol_opts.stepsize); 00034 SendMessage(GetDlgItem(hDlg, IDC_STEPSIZE), WM_SETTEXT, 0, (LPARAM)text); 00035 00036 swprintf((LPWSTR)text, L"%1.2f", vol_opts.jitter); 00037 SendMessage(GetDlgItem(hDlg, IDC_JITTER), WM_SETTEXT, 0, (LPARAM)text); 00038 00039 swprintf((LPWSTR)text, L"%1.2f", vol_opts.gradstep); 00040 SendMessage(GetDlgItem(hDlg, IDC_GRADSTEP), WM_SETTEXT, 0, (LPARAM)text); 00041 00042 if (vol_opts.rendermode == MODE_FULL) 00043 { 00044 SendMessage(GetDlgItem(hDlg, IDC_MODE_FULL), BM_SETCHECK, BST_CHECKED, 0); 00045 } 00046 else 00047 { 00048 SendMessage(GetDlgItem(hDlg, IDC_MODE_MIP), BM_SETCHECK, BST_CHECKED, 0); 00049 } 00050 00051 return TRUE; 00052 case WM_COMMAND: 00054 if (LOWORD(wParam) == IDOK) 00055 { 00056 SendMessage(GetDlgItem(hDlg, IDC_STEPSIZE), WM_GETTEXT, 10, (LPARAM)text); 00057 vol_opts.stepsize = (float)_wtof((LPWSTR)text); 00058 00059 SendMessage(GetDlgItem(hDlg, IDC_JITTER), WM_GETTEXT, 10, (LPARAM)text); 00060 vol_opts.jitter = (float)_wtof((LPWSTR)text); 00061 00062 SendMessage(GetDlgItem(hDlg, IDC_GRADSTEP), WM_GETTEXT, 10, (LPARAM)text); 00063 vol_opts.gradstep = (float)_wtof((LPWSTR)text); 00064 00065 if (SendMessage(GetDlgItem(hDlg, IDC_MODE_FULL), BM_GETCHECK, 0, 0) == BST_CHECKED) 00066 { 00067 vol_opts.rendermode = MODE_FULL; 00068 } 00069 else 00070 { 00071 vol_opts.rendermode = MODE_MIP; 00072 } 00073 00074 EndDialog(hDlg, 0); 00075 00077 RayRender(); 00078 00079 return TRUE; 00080 } 00081 break; 00082 } 00083 00084 return FALSE; 00085 } 00086 00087 #include "Volumizer.h"