1 | /**********************************************************************
|
---|
2 | *<
|
---|
3 | FILE: IParamM.h
|
---|
4 |
|
---|
5 | DESCRIPTION: Parameter Maps
|
---|
6 |
|
---|
7 | CREATED BY: Rolf Berteig
|
---|
8 |
|
---|
9 | HISTORY: created 10/10/95
|
---|
10 |
|
---|
11 | *> Copyright (c) 1994, All Rights Reserved.
|
---|
12 | **********************************************************************/
|
---|
13 |
|
---|
14 |
|
---|
15 | #ifndef __IPARAMM__
|
---|
16 | #define __IPARAMM__
|
---|
17 |
|
---|
18 |
|
---|
19 | class IParamMap;
|
---|
20 | class IRendParams;
|
---|
21 |
|
---|
22 | // If custom handling of controls needs to be done, ParameterMap
|
---|
23 | // client can't implement one of these and set is as the ParameterMap's
|
---|
24 | // user callback.
|
---|
25 | class ParamMapUserDlgProc {
|
---|
26 | public:
|
---|
27 | virtual BOOL DlgProc(TimeValue t,IParamMap *map,HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)=0;
|
---|
28 | virtual void DeleteThis()=0;
|
---|
29 | };
|
---|
30 |
|
---|
31 | // Return this from DlgProc to get the viewports redrawn.
|
---|
32 | #define REDRAW_VIEWS 2
|
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 | class IParamMap {
|
---|
37 | public:
|
---|
38 | // Mark the UI as needing to be updated.
|
---|
39 | virtual void Invalidate()=0;
|
---|
40 |
|
---|
41 | // Swaps the existing parameter block with a new one and updates UI.
|
---|
42 | virtual void SetParamBlock(IParamArray *pb)=0;
|
---|
43 |
|
---|
44 | // The given proc will be called _after_ default processing is done.
|
---|
45 | // The callback can then apply constraints to controls.
|
---|
46 | // Note that if the proc is non-NULL when the ParamMap is deleted
|
---|
47 | // its DeleteThis() method will be called.
|
---|
48 | virtual void SetUserDlgProc(ParamMapUserDlgProc *proc=NULL)=0;
|
---|
49 |
|
---|
50 | // Changes a map entry to refer to a different item in the parameter block.
|
---|
51 | virtual void SetPBlockIndex(int mapIndex, int blockIndex)=0;
|
---|
52 |
|
---|
53 | // Access the dialog window.
|
---|
54 | virtual HWND GetHWnd()=0;
|
---|
55 |
|
---|
56 | // Access the parameter block
|
---|
57 | virtual IParamArray *GetParamBlock()=0;
|
---|
58 | };
|
---|
59 |
|
---|
60 |
|
---|
61 |
|
---|
62 |
|
---|
63 | enum ControlType {
|
---|
64 | TYPE_SPINNER,
|
---|
65 | TYPE_RADIO,
|
---|
66 | TYPE_SINGLECHEKBOX,
|
---|
67 | TYPE_MULTICHEKBOX,
|
---|
68 | TYPE_COLORSWATCH,
|
---|
69 | };
|
---|
70 |
|
---|
71 |
|
---|
72 | // Giving this value for scale specifies autoscale
|
---|
73 | #define SPIN_AUTOSCALE -1.0f
|
---|
74 |
|
---|
75 | class ParamUIDesc {
|
---|
76 | public:
|
---|
77 | // Float or int controlled by a single spinner
|
---|
78 | CoreExport ParamUIDesc(
|
---|
79 | int index,EditSpinnerType spinType,int idEdit,int idSpin,
|
---|
80 | float lowLim,float highLim,float scale,ParamDimension *dim=defaultDim);
|
---|
81 |
|
---|
82 | // int controlelled by n radio buttons
|
---|
83 | // vals[i] represents the value if ctrlIDs[i] is checked.
|
---|
84 | // if vals=NULL then ctrlIDs[i] represents a value of i.
|
---|
85 | //
|
---|
86 | // OR
|
---|
87 | //
|
---|
88 | // int controlled by multiple check boxes where each
|
---|
89 | // check boxes controlls a single bit.
|
---|
90 | // vals[i] specifies which bit ctrlIds[i] controls.
|
---|
91 | // If vals=NULL ctrlIDs[i] controls the ith bit.
|
---|
92 | CoreExport ParamUIDesc(
|
---|
93 | int index,ControlType type,int *ctrlIDs,int count,int *vals=NULL);
|
---|
94 |
|
---|
95 | // int controlled by a single check box (BOOL)
|
---|
96 | // or Point3 controlled by a color swatch.
|
---|
97 | CoreExport ParamUIDesc(int index,ControlType type,int id);
|
---|
98 |
|
---|
99 | // Point3 controlled by 3 spinners
|
---|
100 | CoreExport ParamUIDesc(int index,
|
---|
101 | EditSpinnerType spinType,
|
---|
102 | int idEdit1,int idSpin1,
|
---|
103 | int idEdit2,int idSpin2,
|
---|
104 | int idEdit3,int idSpin3,
|
---|
105 | float lowLim,float highLim,float scale,
|
---|
106 | ParamDimension *dim=defaultDim);
|
---|
107 |
|
---|
108 |
|
---|
109 | int pbIndex;
|
---|
110 | ParamType ptype;
|
---|
111 | ControlType ctype;
|
---|
112 | int id[6];
|
---|
113 | int *ids;
|
---|
114 | int *vals;
|
---|
115 | int count;
|
---|
116 |
|
---|
117 | EditSpinnerType spinType;
|
---|
118 | float lowLim;
|
---|
119 | float highLim;
|
---|
120 | float scale;
|
---|
121 | ParamDimension *dim;
|
---|
122 | };
|
---|
123 |
|
---|
124 |
|
---|
125 | // Creates a parameter map to handle the display of parameters in the command panal.
|
---|
126 | //
|
---|
127 | // This will add a rollup page to the command panel.
|
---|
128 | // DestroyCPParamMap().
|
---|
129 | //
|
---|
130 | CoreExport IParamMap *CreateCPParamMap(
|
---|
131 | ParamUIDesc *desc,int count,
|
---|
132 | IParamArray *pb,
|
---|
133 | Interface *ip,
|
---|
134 | HINSTANCE hInst,
|
---|
135 | TCHAR *dlgTemplate,
|
---|
136 | TCHAR *title,
|
---|
137 | DWORD flags);
|
---|
138 |
|
---|
139 | CoreExport void DestroyCPParamMap(IParamMap *m);
|
---|
140 |
|
---|
141 |
|
---|
142 | // Creates a parameter map that will handle a parameter block in a modeless
|
---|
143 | // dialog where time does not change and the viewport is not redrawn.
|
---|
144 | // Note that there is no need to destroy it. It executes the dialog and then
|
---|
145 | // destorys itself. Returns TRUE if the user selected OK, FALSE otherwise.
|
---|
146 | CoreExport BOOL CreateModalParamMap(
|
---|
147 | ParamUIDesc *desc,int count,
|
---|
148 | IParamArray *pb,
|
---|
149 | TimeValue t,
|
---|
150 | HINSTANCE hInst,
|
---|
151 | TCHAR *dlgTemplate,
|
---|
152 | HWND hParent,
|
---|
153 | ParamMapUserDlgProc *proc=NULL);
|
---|
154 |
|
---|
155 |
|
---|
156 | // Creates a parameter map to handle the display of render parameters or
|
---|
157 | // atmospheric plug-in parameters.
|
---|
158 | CoreExport IParamMap *CreateRParamMap(
|
---|
159 | ParamUIDesc *desc,int count,
|
---|
160 | IParamArray *pb,
|
---|
161 | IRendParams *ip,
|
---|
162 | HINSTANCE hInst,
|
---|
163 | TCHAR *dlgTemplate,
|
---|
164 | TCHAR *title,
|
---|
165 | DWORD flags);
|
---|
166 |
|
---|
167 | CoreExport void DestroyRParamMap(IParamMap *m);
|
---|
168 |
|
---|
169 |
|
---|
170 | #endif // __IPARAMM__
|
---|
171 |
|
---|
172 |
|
---|
173 |
|
---|