[896] | 1 | #pragma once
|
---|
| 2 | #include <assert.h>
|
---|
| 3 |
|
---|
| 4 | typedef enum { bShowHelp, bMoveLight, bLookFromLight, bDots, bTurbo, LAST_BOOL } bool_t;
|
---|
| 5 | typedef enum { fLightScale, fRotVelo, fSecondModelHeight, LAST_NUMBER } number_t;
|
---|
| 6 |
|
---|
| 7 | enum { IDC_GEN_BUTTON = -4, IDC_RESET_BUTTON, IDC_SAVE_BUTTON, IDC_LOAD_BUTTON };
|
---|
| 8 |
|
---|
| 9 | #define CHARBUF 100 // The max length of a line in the save file
|
---|
| 10 |
|
---|
| 11 | typedef float (*CONVERTER)(float a);
|
---|
| 12 | typedef void (*ONCHANGE_CALLBACK)(void);
|
---|
| 13 |
|
---|
| 14 | float noconvert(float a); // { return a; }
|
---|
| 15 |
|
---|
| 16 | float convert100(float a);
|
---|
| 17 | float convert10(float a);
|
---|
| 18 | float convert1(float a);
|
---|
| 19 | float convertNSamples(float a);
|
---|
| 20 | float convertDepthResolution(float a);
|
---|
| 21 |
|
---|
| 22 | void OnChange(); // {}
|
---|
| 23 |
|
---|
| 24 |
|
---|
| 25 | class Parameters {
|
---|
| 26 | bool bparam[LAST_BOOL];
|
---|
| 27 | wchar_t bname[LAST_BOOL][CHARBUF];
|
---|
| 28 |
|
---|
| 29 | int param[LAST_NUMBER]; // 0..100 (0..num_steps)
|
---|
| 30 | wchar_t name[LAST_NUMBER][CHARBUF];
|
---|
| 31 | int numsteps[LAST_NUMBER];
|
---|
| 32 |
|
---|
| 33 | CONVERTER ffunc[LAST_NUMBER];
|
---|
| 34 | ONCHANGE_CALLBACK chfunc[LAST_NUMBER+3];
|
---|
| 35 |
|
---|
| 36 | CDXUTDialog* g_HUD;
|
---|
| 37 |
|
---|
| 38 | bool bSilent;
|
---|
| 39 | const static int CHARBUFFER_SIZE = 200;
|
---|
| 40 | enum { checkboxID0 = 1000, sliderID0 = 2000, staticID0 = 3000, upID0 = 4000, downID0 = 5000 };
|
---|
| 41 |
|
---|
| 42 | public:
|
---|
| 43 | void Setup( CDXUTDialog* g_HUD );
|
---|
| 44 | void Setup( CDXUTDialog* g_HUD, ONCHANGE_CALLBACK OnReset, ONCHANGE_CALLBACK OnSave = OnChange, ONCHANGE_CALLBACK OnLoad = OnChange);
|
---|
| 45 |
|
---|
| 46 | bool Get( bool_t i );
|
---|
| 47 | float Get( number_t i );
|
---|
| 48 | int GetInt( number_t i );
|
---|
| 49 |
|
---|
| 50 | void SetBool( bool_t ID, bool b );
|
---|
| 51 | void SetFloat( number_t ID, float v );
|
---|
| 52 | void SetInt( number_t ID, int v );
|
---|
| 53 |
|
---|
| 54 | void Add( bool_t ID, char* label, char cHotKey = 0 );
|
---|
| 55 | void Add( number_t ID, char* label, int num_steps);
|
---|
| 56 |
|
---|
| 57 | void Add( number_t ID, char* label, int num_steps,
|
---|
| 58 | CONVERTER ff, ONCHANGE_CALLBACK chf = OnChange );
|
---|
| 59 |
|
---|
| 60 | void Add( number_t ID, char* label, int num_steps, char cKeyDecr, char cKeyIncr,
|
---|
| 61 | CONVERTER ff = noconvert, ONCHANGE_CALLBACK chf = OnChange );
|
---|
| 62 |
|
---|
| 63 | void UpdateFromHUD( int controlID );
|
---|
| 64 |
|
---|
| 65 | void SaveToFile( char* fileName );
|
---|
| 66 | void LoadFromFile( char* fileName );
|
---|
| 67 | }; |
---|