00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "valueEditor.h"
00020 #include "resource.h"
00021 #include "windowTools.h"
00022 #include "MyObject.h"
00023 #include "face.h"
00024 #include "light.h"
00025 #include "controlEngine.h"
00026 #include "screen.h"
00027 #include "control.h"
00028
00029 extern ControlEngine ce;
00030
00031
00032
00033 ParamValueEditor::ParamValueEditor()
00034 {
00035 Zero();
00036 }
00037
00038 void ParamValueEditor::Zero()
00039 {
00040 object=NULL;
00041 rect.bottom=rect.left=rect.right=rect.top=0;
00042 hWndParent=NULL;
00043 independant=FALSE;
00044 }
00045
00046 void ParamValueEditor::operator=(ParamValueEditor &source)
00047 {
00048 rect.bottom=source.rect.bottom;
00049 rect.left=source.rect.left;
00050 rect.right=source.rect.right;
00051 rect.top=source.rect.top;
00052 hWndParent=source.hWndParent;
00053 independant=source.independant;
00054 }
00055
00056 ParamValueEditor * ParamValueEditor::GetCopy()
00057 {
00058 ParamValueEditor *newOne = new ParamValueEditor;
00059 newOne->object = new Object();
00060 *newOne=*this;
00061 *newOne->object = *object;
00062 return newOne;
00063 }
00064
00065
00066
00067 template <class T>
00068 ValueNamed<T>::ValueNamed()
00069 {
00070 Zero();
00071 }
00072
00073 template <class T>
00074 void ValueNamed<T>::Zero()
00075 {
00076 value = 0;
00077 description = "";
00078 }
00079
00080 template <class T>
00081 void ValueNamed<T>::operator=(ValueNamed &source)
00082 {
00083 value = source.value;
00084 description = source.description;
00085 }
00086
00087 template <class T>
00088 void ValueNamed<T>::Set(T _value,char *_desciption)
00089 {
00090 value = _value;
00091 description = _desciption;
00092 }
00093
00094
00095
00096 template <class T>
00097 ValueEditor<T>::ValueEditor()
00098 {
00099 Zero();
00100 }
00101
00102 template <class T>
00103 void ValueEditor<T>::Zero()
00104 {
00105 hItem=NULL;
00106 info="";
00107 variable="";
00108 valueText="";
00109 minValue=0;
00110 maxValue=1;
00111 value = NULL;
00112 specials.i.SuprAll();
00113 }
00114
00115 template <class T>
00116 void ValueEditor<T>::operator=(ValueEditor &source)
00117 {
00118 hItem=source.hItem;
00119 info=source.info;
00120 variable=source.variable;
00121 minValue=source.minValue;
00122 maxValue=source.maxValue;
00123 value=source.value;
00124 valueText=source.valueText;
00125 specials = source.specials;
00126 }
00127
00128 template <class T>
00129 ValueEditor<T> * ValueEditor<T>::GetCopy()
00130 {
00131 ValueEditor<T> *newOne = new ValueEditor<T>;
00132 *newOne=*this;
00133 return newOne;
00134 }
00135
00136 template <class T>
00137 void ValueEditor<T>::InterpretedText(MyString &interpretedText,char *_valueText,T *_value)
00138 {
00139 if (_valueText) valueText=_valueText;
00140 if (_value) value=_value;
00141
00142 interpretedText="";
00143
00144 for (int i=0;i<valueText.GetSize();i++)
00145 if (valueText[i]=='\t') interpretedText<<*value;
00146 else interpretedText<<valueText[i];
00147 }
00148
00149 template <class T>
00150 void ValueEditor<T>::Set(char *_variable,char *_info,T _minValue,T _maxValue,HTREEITEM _hItem)
00151 {
00152 hItem=_hItem;
00153 info=_info;
00154 variable=_variable;
00155 minValue=_minValue;
00156 maxValue=_maxValue;
00157 }
00158
00159 template <class T>
00160 void ValueEditor<T>::MAJ_TreeItem(HWND hWnd)
00161 {
00162 MyString text;
00163 InterpretedText(text);
00164 TVITEM item;
00165 item.mask = TVIF_HANDLE | TVIF_TEXT;
00166 item.hItem = hItem;
00167 item.pszText=text;
00168 TreeView_SetItem(GetDlgItem(hWnd,IDC_TREE_ELEM),&item);
00169 }
00170
00171 template <class T>
00172 void ValueEditor<T>::AddSpecial(T special,char *description)
00173 {
00174 ValueNamed<T> valSpecial;
00175 valSpecial.Set(special,description);
00176 specials.i+=valSpecial;
00177 }
00178
00179 template <class T>
00180 void ValueEditor<T>::MAJ_ValueMin(HWND hWnd)
00181 {
00182 MAJ_Value(hWnd,minValue);
00183 }
00184
00185 template <class T>
00186 void ValueEditor<T>::MAJ_ValueMax(HWND hWnd)
00187 {
00188 MAJ_Value(hWnd,maxValue);
00189 }
00190
00191 template <class T>
00192 void ValueEditor<T>::MAJ_ValueMids(HWND hWnd)
00193 {
00194 MAJ_Value(hWnd,(T)((minValue+maxValue)/2.0));
00195 }
00196
00197 template <class T>
00198 void ValueEditor<T>::MAJ_Value(HWND hWnd,T _value,BOOL refresh)
00199 {
00200 if (value) *value=_value;
00201 if (refresh)
00202 {
00203 MAJ_Value(hWnd);
00204 MAJ_Specials(hWnd);
00205 MAJ_Slider(hWnd);
00206 }
00207 }
00208
00209 template <class T>
00210 void ValueEditor<T>::MAJ_Value(HWND hWnd)
00211 {
00212 MyString text;
00213 if (value) text<<*value;
00214 Edit_SetText(GetDlgItem(hWnd,IDC_EDIT_VALUE),text);
00215 }
00216
00217 template <class T>
00218 void ValueEditor<T>::Get_Value(HWND hWnd)
00219 {
00220 char text[64];
00221 MyString textTmp;
00222 Edit_GetText(GetDlgItem(hWnd,IDC_EDIT_VALUE),text,64);
00223 textTmp = text;
00224 MAJ_Value(hWnd,(T)textTmp.ToDouble(),FALSE);
00225 }
00226
00227 template <class T>
00228 void ValueEditor<T>::MAJ_Slider(HWND hWnd)
00229 {
00230 if (!(this&&value)) return;
00231 BOOL isActive = !(!minValue && maxValue==-1);
00232 Static_Enable(GetDlgItem(hWnd,IDC_SLIDER_PAD),isActive);
00233 double xPos = 0;
00234 xPos = (100.0f*(*value-minValue))/(maxValue-minValue);
00235 SendMessage(GetDlgItem(hWnd,IDC_SLIDER_PAD), TBM_SETPOS, TRUE, (LPARAM)xPos);
00236 }
00237
00238 template <class T>
00239 void ValueEditor<T>::MAJ_Specials(HWND hWnd,int num)
00240 {
00241 HWND hWndCtrl = GetDlgItem(hWnd,IDC_COMBO_SPECIALS);
00242 ComboBox_ResetContent(hWndCtrl);
00243 MyString text;
00244 BOOL active = this&&value?TRUE:FALSE;
00245 if (active&&specials.GetNbElem())
00246 {
00247 ComboBox_Enable(hWndCtrl,TRUE);
00248 ComboBox_AddString(hWndCtrl,"<Nothing>");
00249 int numSel = 0;
00250 int numCur = 0;
00251 T valueCur = num==-1?*value:specials.i[num].value;
00252
00253 for (specials.i=0;specials.i.More();specials.i++)
00254 {
00255 text="";
00256 numCur++;
00257 T valueSpe = specials.i()->value;
00258 text<<specials.i()->description<<" (="<<valueSpe<<")";
00259 if (valueCur==valueSpe) numSel=numCur;
00260 ComboBox_AddString(hWndCtrl,text);
00261 }
00262 ComboBox_SetCurSel(hWndCtrl,numSel);
00263 if (num!=-1)
00264 {
00265 *value=valueCur;
00266 MAJ_Value(hWnd);
00267 }
00268 }
00269 else ComboBox_Enable(GetDlgItem(hWnd,IDC_COMBO_SPECIALS),FALSE);
00270 }
00271
00272 template <class T>
00273 void ValueEditor<T>::MAJ(HWND hWnd)
00274 {
00275 HWND hWndMin = GetDlgItem(hWnd,IDC_BUTTON_MIN);
00276 HWND hWndMax = GetDlgItem(hWnd,IDC_BUTTON_MAX);
00277 HWND hWndMids = GetDlgItem(hWnd,IDC_BUTTON_MIDS);
00278 HWND hWndValue= GetDlgItem(hWnd,IDC_EDIT_VALUE);
00279 HWND hWndInfo= GetDlgItem(hWnd,IDC_STATIC_VARIABLE);
00280 HWND hWndStaticValue= GetDlgItem(hWnd,IDC_STATIC1);
00281
00282 BOOL active = this&&value?TRUE:FALSE;
00283 if (active)
00284 {
00285 MyString text;
00286 text<<"Value: ["<<minValue<<";"<<maxValue<<"]";
00287 Static_SetText(hWndStaticValue,text);
00288 Static_Enable(hWndStaticValue,TRUE);
00289 Edit_Enable(hWndValue,TRUE);
00290 MAJ_Value(hWnd);
00291 Static_Enable(hWndMin,TRUE);
00292 Static_Enable(hWndMids,TRUE);
00293 Static_Enable(hWndMax,TRUE);
00294 Static_SetText(hWndInfo,info);
00295 }
00296 else
00297 {
00298 Static_SetText(hWndStaticValue,"Value: []");
00299 Edit_SetText(hWndValue,"");
00300 Static_Enable(hWndValue,FALSE);
00301 Static_Enable(hWndMin,FALSE);
00302 Static_Enable(hWndMids,FALSE);
00303 Static_Enable(hWndMax,FALSE);
00304 Static_SetText(hWndInfo,"Select a value to edit it");
00305 }
00306 MAJ_Specials(hWnd);
00307 MAJ_Slider(hWnd);
00308 }
00309
00310
00311
00312 #define IS_NOTHING 0
00313 #define IS_LIGHT 1
00314 #define IS_FOG 2
00315 #define IS_TEXTURE 10 // [10;+inf]
00316
00317 ValueEditors::ValueEditors()
00318 {
00319 }
00320
00321 ValueEditors::~ValueEditors()
00322 {
00323 Zero();
00324 }
00325
00326 void ValueEditors::Update(Object *object)
00327 {
00328 if (object)
00329 {
00330 VE_int = (CBase_VE_int *)object->thisParent;
00331 VE_double = (CBase_VE_double *) object->thisParent;
00332 VE_float = (CBase_VE_float *) object->thisParent;
00333 }
00334 }
00335
00336 void ValueEditors::Zero()
00337 {
00338 VE_int = NULL;
00339 VE_float = NULL;
00340 VE_double = NULL;
00341 list.i.SuprAll();
00342
00343 }
00344
00345 #define INSERT_ITEM_TYPED(type,variable,info,paramCur,minValue,maxValue,valueCur) \
00346 VE_##type##_cur.elem.Zero(); \
00347 VE_##type##_cur.param = paramCur; \
00348 VE_##type##_cur.elem.InterpretedText(interpretedText,message,valueCur); \
00349 elemTree.item.pszText = interpretedText; \
00350 elemTree.item.lParam = num++; \
00351 hParentItem = TreeView_InsertItem(hWnd,&elemTree); \
00352 VE_##type##_cur.elem.Set(variable,info,minValue,maxValue,hParentItem) ;
00353
00354 #define INSERT_ITEM_INT(variable,info,param,minValue,maxValue,valueCur) \
00355 INSERT_ITEM_TYPED(int,variable,info,param,minValue,maxValue,valueCur)
00356 #define INSERT_ITEM_FLOAT(variable,info,param,minValue,maxValue,valueCur) \
00357 INSERT_ITEM_TYPED(float,variable,info,param,minValue,maxValue,valueCur)
00358 #define INSERT_ITEM_DOUBLE(variable,info,param,minValue,maxValue,valueCur) \
00359 INSERT_ITEM_TYPED(double,variable,info,param,minValue,maxValue,valueCur)
00360
00361 #define INSERT_INT list.i+=VE_int_cur;
00362 #define INSERT_FLOAT list.i+=VE_float_cur;
00363 #define INSERT_DOUBLE list.i+=VE_double_cur;
00364
00365 #define INSERT_ITEM \
00366 elemTree.item.pszText = message; \
00367 elemTree.item.lParam = 0; \
00368 hParentItem = TreeView_InsertItem(hWnd,&elemTree);
00369 #define INSERT_ITEM_NUM(num) \
00370 elemTree.item.pszText = message; \
00371 elemTree.item.lParam = num; \
00372 hParentItem = TreeView_InsertItem(hWnd,&elemTree);
00373
00374 #define NUM_SELECTED_RENDER 65535
00375 #define NUM_SELECTED_LIGHT 65534
00376 #define NUM_SELECTED_TEXTURE 65533
00377 #define NUM_SELECTED_FONT 65532
00378 #define NUM_SELECTED_PICKING 65531
00379 #define NUM_SELECTED_NOTHING 65530
00380 #define NUM_SELECTED_TRASH 65529
00381
00382 void ValueEditors::MakeDebugStruct(HWND hWnd)
00383 {
00384 MyString message;
00385 HTREEITEM hParentItem;
00386 TVINSERTSTRUCT elemTree;
00387 elemTree.hInsertAfter = TVI_LAST;
00388 elemTree.hParent = NULL;
00389 elemTree.item.mask = TVIF_TEXT | TVIF_PARAM;
00390
00391 message="Config";
00392 INSERT_ITEM_NUM(MAKELPARAM(NUM_SELECTED_NOTHING,0));
00393 {
00394 elemTree.hParent = hParentItem;
00395 message="Render";
00396 INSERT_ITEM_NUM(MAKELPARAM(NUM_SELECTED_RENDER,0));
00397 message="Lights";
00398 INSERT_ITEM_NUM(MAKELPARAM(NUM_SELECTED_LIGHT,0));
00399 message="Textures";
00400 INSERT_ITEM_NUM(MAKELPARAM(NUM_SELECTED_TEXTURE,0));
00401 message="Fonts";
00402 INSERT_ITEM_NUM(MAKELPARAM(NUM_SELECTED_FONT,0));
00403 elemTree.hParent = NULL;
00404 }
00405 message="Picking";
00406 INSERT_ITEM_NUM(MAKELPARAM(NUM_SELECTED_PICKING,0));
00407 ;
00408 }
00409
00410 void ValueEditors::MakeDebugFaceStruct(HWND hWnd)
00411 {
00412 MakeDebugStruct(hWnd);
00413 MakeDebugFaceStruct(hWnd,NULL,ce.primitive.tree.GetRoot());
00414 MakeDebugFaceStruct(hWnd,NULL,ce.trash.GetRoot());
00415 }
00416
00417 void ValueEditors::MakeDebugFaceStruct(HWND hWnd,HTREEITEM hParentItem,FaceNode *node)
00418 {
00419 MyString message;
00420 TVINSERTSTRUCT elemTree;
00421 elemTree.hInsertAfter = TVI_LAST;
00422 elemTree.hParent = hParentItem;
00423 elemTree.item.mask = TVIF_TEXT | TVIF_PARAM;
00424 message=node->elem->name;
00425 INSERT_ITEM_NUM(MAKELPARAM(node->elem->idControl,node->elem->idFace));
00426 for (node->childs.i=0;node->childs.i.More();node->childs.i++)
00427 MakeDebugFaceStruct(hWnd,hParentItem,node->childs.i.GetElem());
00428 }
00429
00430 void ValueEditors::MakeDebugControlStruct(HWND hWnd)
00431 {
00432 MakeDebugStruct(hWnd);
00433 MakeDebugControlStruct(hWnd,NULL,ce.primitive.tree.GetRoot(),-1);
00434 HTREEITEM hParentItem;
00435 TVINSERTSTRUCT elemTree;
00436 MyString message;
00437 elemTree.hInsertAfter = TVI_LAST;
00438 elemTree.hParent = NULL;
00439 elemTree.item.mask = TVIF_TEXT | TVIF_PARAM;
00440 message = "Trash";
00441 INSERT_ITEM_NUM(MAKELPARAM(NUM_SELECTED_TRASH,0));
00442 MakeDebugControlStruct(hWnd,hParentItem,ce.trash.GetRoot(),-1);
00443 }
00444
00445 void ValueEditors::MakeDebugControlStruct(HWND hWnd,HTREEITEM hParentItem,FaceNode *node,int oldIdControl)
00446 {
00447 if (oldIdControl!=node->elem->idControl)
00448 {
00449 MyString message;
00450 TVINSERTSTRUCT elemTree;
00451 elemTree.hInsertAfter = TVI_LAST;
00452 elemTree.hParent = hParentItem;
00453 elemTree.item.mask = TVIF_TEXT | TVIF_PARAM;
00454 elemTree.item.lParam = node->elem->idControl;
00455 Control *control = Control::Find(node->elem->idControl);
00456 if (control)
00457 {
00458 message=control->name;
00459 elemTree.item.pszText = message;
00460 hParentItem = TreeView_InsertItem(hWnd,&elemTree);
00461 }
00462 }
00463 for (node->childs.i=0;node->childs.i.More();node->childs.i++)
00464 MakeDebugControlStruct(hWnd,hParentItem,node->childs.i.GetElem(),node->elem->idControl);
00465 }
00466
00467 void ValueEditors::MakeElemControlStruct(HWND hWnd,Control *control)
00468 {
00469 if (!control) return;
00470
00471 Zero();
00472 CBase_VE_double VE_double_cur;
00473 CBase_VE_int VE_int_cur;
00474 CBase_VE_float VE_float_cur;
00475 VE_double_cur.param = 12;
00476 MyString interpretedText;
00477
00478 HTREEITEM hParentItem,hParentItem2,hParentItem3,hParentItem4;
00479 TVINSERTSTRUCT elemTree;
00480 elemTree.hInsertAfter = TVI_LAST;
00481 elemTree.hParent = NULL;
00482 elemTree.item.mask = TVIF_TEXT | TVIF_PARAM;
00483
00484 int num = 1;
00485 MyString message;
00486 message.Format("Name: %s [id]: %d",(char *)control->name,control->id);
00487 INSERT_ITEM;
00488
00489 if (control->parent)
00490 {
00491 message.Format("Parent [id,face,name]: %d , %d , %s",control->parent->id,control->parentFace,(char *)control->parent->name);
00492 INSERT_ITEM;
00493 }
00494
00495 message.Format("Mode [enable,view,sleeped]: %d , %d , %d",control->isEnable,control->isView,control->sleepedDelay);
00496 INSERT_ITEM;
00497 {
00498 elemTree.hParent = hParentItem;
00499 message="isEnable: \t";
00500 INSERT_ITEM_INT("control.isEnable","control dois il etre utilisé",FALSE,0,-1,&control->isEnable);
00501 VE_int_cur.elem.AddSpecial(FALSE,"false");
00502 VE_int_cur.elem.AddSpecial(TRUE,"true");
00503 INSERT_INT;
00504 message="isView: \t";
00505 INSERT_ITEM_INT("control.isView","control dois il s'afficher",FALSE,0,-1,&control->isView);
00506 VE_int_cur.elem.AddSpecial(FALSE,"false");
00507 VE_int_cur.elem.AddSpecial(TRUE,"true");
00508 INSERT_INT;
00509 message="sleepedDelay: \t";
00510 INSERT_ITEM_INT("control.sleepedDelay","temps d'inaction avant evenement OnSleeped",FALSE,0,10000,&control->sleepedDelay);
00511 INSERT_INT;
00512 elemTree.hParent = NULL;
00513 }
00514
00515 message.Format("Events (%d links)",control->onControl.GetNbLinks());
00516 INSERT_ITEM;
00517 {
00518 hParentItem2 = hParentItem;
00519 elemTree.hParent = hParentItem;
00520 message.Format("onControl (%d links)",control->onControl.GetNbLinks());
00521 INSERT_ITEM;
00522 {
00523 hParentItem3 = hParentItem;
00524 elemTree.hParent = hParentItem;
00525 message.Format("mouse (%d links)",control->onControl.mouse.GetNbLinks());
00526 INSERT_ITEM;
00527 {
00528 hParentItem4 = hParentItem;
00529 elemTree.hParent = hParentItem;
00530 message.Format("left (%d links)",control->onControl.mouse.left.GetNbLinks());
00531 INSERT_ITEM;
00532 {
00533 elemTree.hParent = hParentItem;
00534 message.Format("down (%d links)",control->onControl.mouse.left.down.size());
00535 INSERT_ITEM;
00536 message.Format("up (%d links)",control->onControl.mouse.left.up.size());
00537 INSERT_ITEM;
00538 message.Format("click (%d links)",control->onControl.mouse.left.click.size());
00539 INSERT_ITEM;
00540 message.Format("doubleClick (%d links)",control->onControl.mouse.left.doubleClick.size());
00541 INSERT_ITEM;
00542 elemTree.hParent = hParentItem4;
00543 }
00544 message.Format("mid (%d links)",control->onControl.mouse.mid.GetNbLinks());
00545 INSERT_ITEM;
00546 {
00547 elemTree.hParent = hParentItem;
00548 message.Format("down (%d links)",control->onControl.mouse.mid.down.size());
00549 INSERT_ITEM;
00550 message.Format("up (%d links)",control->onControl.mouse.mid.up.size());
00551 INSERT_ITEM;
00552 message.Format("click (%d links)",control->onControl.mouse.mid.click.size());
00553 INSERT_ITEM;
00554 message.Format("doubleClick (%d links)",control->onControl.mouse.mid.doubleClick.size());
00555 INSERT_ITEM;
00556 elemTree.hParent = hParentItem4;
00557 }
00558 message.Format("right (%d links)",control->onControl.mouse.right.GetNbLinks());
00559 INSERT_ITEM;
00560 {
00561 elemTree.hParent = hParentItem;
00562 message.Format("down (%d links)",control->onControl.mouse.right.down.size());
00563 INSERT_ITEM;
00564 message.Format("up (%d links)",control->onControl.mouse.right.up.size());
00565 INSERT_ITEM;
00566 message.Format("click (%d links)",control->onControl.mouse.right.click.size());
00567 INSERT_ITEM;
00568 message.Format("doubleClick (%d links)",control->onControl.mouse.right.doubleClick.size());
00569 INSERT_ITEM;
00570 elemTree.hParent = hParentItem4;
00571 }
00572 message.Format("move (%d links)",control->onControl.mouse.move.size());
00573 INSERT_ITEM;
00574
00575
00576
00577
00578 message.Format("wheel (%d links)",control->onControl.mouse.wheel.size());
00579 INSERT_ITEM;
00580 elemTree.hParent = hParentItem3;
00581 }
00582 message.Format("key (%d links)",control->onControl.key.GetNbLinks());
00583 INSERT_ITEM;
00584 {
00585 elemTree.hParent = hParentItem;
00586 message.Format("down (%d links)",control->onControl.key.down.size());
00587 INSERT_ITEM;
00588 message.Format("up (%d links)",control->onControl.key.up.size());
00589 INSERT_ITEM;
00590 message.Format("click (%d links)",control->onControl.key.click.size());
00591 INSERT_ITEM;
00592 message.Format("doubleClick (%d links)",control->onControl.key.doubleClick.size());
00593 INSERT_ITEM;
00594 elemTree.hParent = hParentItem3;
00595 }
00596 message.Format("over (%d links)",control->onControl.over.GetNbLinks());
00597 INSERT_ITEM;
00598 {
00599 elemTree.hParent = hParentItem;
00600 message.Format("out (%d links)",control->onControl.over.out.size());
00601 INSERT_ITEM;
00602 message.Format("in (%d links)",control->onControl.over.in.size());
00603 INSERT_ITEM;
00604 elemTree.hParent = hParentItem3;
00605 }
00606 message.Format("faceover (%d links)",control->onControl.faceOver.GetNbLinks());
00607 INSERT_ITEM;
00608 {
00609 elemTree.hParent = hParentItem;
00610 message.Format("out (%d links)",control->onControl.faceOver.out.size());
00611 INSERT_ITEM;
00612 message.Format("in (%d links)",control->onControl.faceOver.in.size());
00613 INSERT_ITEM;
00614 elemTree.hParent = hParentItem3;
00615 }
00616 message.Format("sleeped (%d links)",control->onControl.sleeped.size());
00617 INSERT_ITEM;
00618
00619 elemTree.hParent = hParentItem2;
00620 }
00621 elemTree.hParent = NULL;
00622 }
00623 }
00624
00625 void ValueEditors::MakeRenderStruct(HWND hWnd)
00626 {
00627 Zero();
00628 CBase_VE_double VE_double_cur;
00629 CBase_VE_int VE_int_cur;
00630 CBase_VE_float VE_float_cur;
00631 VE_double_cur.param = 12;
00632 MyString interpretedText;
00633
00634 HTREEITEM hParentItem,hParentItem2;
00635 TVINSERTSTRUCT elemTree;
00636 elemTree.hInsertAfter = TVI_LAST;
00637 elemTree.hParent = NULL;
00638 elemTree.item.mask = TVIF_TEXT | TVIF_PARAM;
00639
00640 int num = 1;
00641 MyString message;
00642 message<<clear<<"Region [enable,nbPoly,nbOr]: "<<ce.screenMain.region.enable<<" , "<<ce.screenMain.region.points.GetNbElem()<<" , "<<ce.screenMain.region.nbOr;
00643 INSERT_ITEM;
00644 {
00645 elemTree.hParent = hParentItem;
00646 message="enable: \t";
00647 INSERT_ITEM_INT("region.enable","active le regionage",FALSE,0,1,&ce.screenMain.region.enable);
00648 INSERT_INT;
00649 message<<clear<<"box [xMin,xMax,yMin,yMax]: "<<ce.screenMain.region.xMin<<" , "<<ce.screenMain.region.xMax<<" , "<<ce.screenMain.region.yMin<<" , "<<ce.screenMain.region.yMax;
00650 INSERT_ITEM;
00651 elemTree.hParent = NULL;
00652 }
00653 message<<clear<<"Windows [title,fullScr]: "<<ce.screenMain.enableTitle<<" , "<<ce.screenMain.enableFullScreen;
00654 INSERT_ITEM;
00655 {
00656 elemTree.hParent = hParentItem;
00657 message="enableTitle: \t";
00658 INSERT_ITEM_INT("enableTitle","active le titre de la fenetre",FALSE,0,1,&ce.screenMain.enableTitle);
00659 INSERT_INT;
00660 message="enableFullScreen: \t";
00661 INSERT_ITEM_INT("enableFullScreen","active le mode plein ecran",FALSE,0,1,&ce.screenMain.enableFullScreen);
00662 INSERT_INT;
00663 message="enableAntiAliasing: \t";
00664 INSERT_ITEM_INT("enableAntiAliasing","active le mode anti-aliasing (active uniquement si la face l'utiulise)",FALSE,0,1,&ce.enableAntiAliasing);
00665 INSERT_INT;
00666 message="antiAliasingQuality: \t";
00667 INSERT_ITEM_INT("antiAliasingQuality","precision de l'anti-aliasing",FALSE,0,7,&ce.antiAliasingQuality);
00668 INSERT_INT;
00669 message="enableCursor: \t";
00670 INSERT_ITEM_INT("enableCursor","active l'affichage d'un curseur",FALSE,0,1,&ce.enableCursor);
00671 INSERT_INT;
00672 message="enableRepere: \t";
00673 INSERT_ITEM_INT("enableRepere","active l'affichage d'un repere 3d",FALSE,0,1,&ce.enableRepere);
00674 INSERT_INT;
00675 message="enableLightView: \t";
00676 INSERT_ITEM_INT("enableLightView","active les boite representant les lumieres",FALSE,0,1,&ce.enableLightView);
00677 INSERT_INT;
00678 message="enableBackGround: \t";
00679 INSERT_ITEM_INT("enableBackGround","active le fond",FALSE,0,1,&ce.enableBackGround);
00680 INSERT_INT;
00681 elemTree.hParent = NULL;
00682 }
00683
00684 message<<clear<<"Tools [inertia,monitor]: "<<ce.enableInertia<<" , "<<ce.monitor.enable;
00685 INSERT_ITEM;
00686 {
00687 elemTree.hParent = hParentItem;
00688 message="enableInertia: \t";
00689 INSERT_ITEM_INT("enableInertia","active le mode d'inertie",FALSE,0,1,&ce.enableInertia);
00690 INSERT_INT;
00691 message="enableViewInertia: \t";
00692 INSERT_ITEM_INT("enableViewInertia","active l'affichage du mode d'inertie",FALSE,0,1,&ce.enableViewInertia);
00693 INSERT_INT;
00694 message="enableMonitor: \t";
00695 INSERT_ITEM_INT("enableMonitor","active l'utilisation du moniteur de performance",FALSE,0,1,&ce.monitor.enable);
00696 INSERT_INT;
00697 elemTree.hParent = NULL;
00698 }
00699
00700 message<<clear<<"Fog [enable,start,end]: "<<ce.fog.isEnable<<" , "<<ce.fog.start<<" , "<<ce.fog.end;
00701 INSERT_ITEM;
00702 {
00703 elemTree.hParent = hParentItem;
00704 message="enable: \t";
00705 INSERT_ITEM_INT("fog.enable","active le brouillard",IS_FOG,0,1,&ce.fog.isEnable);
00706 INSERT_INT;
00707 message="start: \t";
00708 INSERT_ITEM_FLOAT("fog.start","distance z de debut du brouillard",IS_FOG,0,100,&ce.fog.start);
00709 INSERT_FLOAT;
00710 message="end: \t";
00711 INSERT_ITEM_FLOAT("fog.end","distance z de fin de brouillard",IS_FOG,0,100,&ce.fog.end);
00712 INSERT_FLOAT;
00713 message="density: \t";
00714 INSERT_ITEM_FLOAT("fog.density","densité du brouillard (utilisé en mode EXP ou EXP2)",IS_FOG,0,0.5,&ce.fog.density);
00715 INSERT_FLOAT;
00716 message="mode: \t";
00717 INSERT_ITEM_INT("fog.mode","type de calcul de brouillard",IS_FOG,0,-1,(int *)&ce.fog.mode);
00718 VE_float_cur.elem.AddSpecial(GL_LINEAR,"Linear");
00719 VE_float_cur.elem.AddSpecial(GL_EXP,"Exp");
00720 VE_float_cur.elem.AddSpecial(GL_EXP2,"Exp2");
00721 INSERT_INT;
00722 message="color ";
00723 ce.fog.color.ToString(message);
00724 INSERT_ITEM;
00725 {
00726 hParentItem2 = hParentItem;
00727 elemTree.hParent = hParentItem;
00728 message="enable: \t";
00729 INSERT_ITEM_INT("fog.color.enable","active la couleur",IS_FOG,0,1,&ce.fog.color.isEnable);
00730 INSERT_INT;
00731 message="r: \t";
00732 INSERT_ITEM_FLOAT("fog.color.r","Composante rouge",IS_FOG,0,1,&ce.fog.color.r);
00733 INSERT_FLOAT;
00734 message="g: \t";
00735 INSERT_ITEM_FLOAT("fog.color.g","Composante verte",IS_FOG,0,1,&ce.fog.color.g);
00736 INSERT_FLOAT;
00737 message="b: \t";
00738 INSERT_ITEM_FLOAT("fog.color.b","Composante bleu",IS_FOG,0,1,&ce.fog.color.b);
00739 INSERT_FLOAT;
00740 message="a: \t";
00741 INSERT_ITEM_FLOAT("fog.color.a","Composante alpha (pour blending)",IS_FOG,0,1,&ce.fog.color.a);
00742 INSERT_FLOAT;
00743 elemTree.hParent = hParentItem;
00744 }
00745 elemTree.hParent = NULL;
00746 }
00747 }
00748
00749 void ValueEditors::MakeLightsStruct(HWND hWnd)
00750 {
00751 Zero();
00752 CBase_VE_double VE_double_cur;
00753 CBase_VE_int VE_int_cur;
00754 CBase_VE_float VE_float_cur;
00755 MyString interpretedText;
00756
00757 HTREEITEM hParentItem,hParentItem2,hParentItem3;
00758 TVINSERTSTRUCT elemTree;
00759 elemTree.hInsertAfter = TVI_LAST;
00760 elemTree.hParent = NULL;
00761 elemTree.item.mask = TVIF_TEXT | TVIF_PARAM;
00762
00763 int num = 1;
00764 MyString message;
00765 Light *lightCur;
00766 BOOL *lightMoveCur;
00767 MyString lightName,paramName;
00768 for (int i=0;i<4;i++)
00769 {
00770 lightCur=&ce.lights[i];
00771 lightMoveCur=&ce.lightsMove[i];
00772
00773 lightName<<clear<<"light"<<i;
00774 message<<clear<<lightName<<" [enable]: "<<lightCur->isEnable;
00775 INSERT_ITEM;
00776 {
00777 hParentItem2 = hParentItem;
00778 elemTree.hParent = hParentItem;
00779 message="enable: \t";
00780 paramName<<clear<<lightName<<".enable";
00781 INSERT_ITEM_INT(paramName,"active la lumiere",IS_LIGHT,0,1,&lightCur->isEnable);
00782 INSERT_INT;
00783
00784 message="Material";
00785 INSERT_ITEM;
00786 {
00787 hParentItem3 = hParentItem;
00788 elemTree.hParent = hParentItem;
00789 message="ambient: ";
00790 lightCur->material.ambient.ToString(message);
00791 INSERT_ITEM;
00792 {
00793 elemTree.hParent = hParentItem;
00794 message="enable: \t";
00795 paramName<<clear<<lightName<<".ambient.enable";
00796 INSERT_ITEM_INT(paramName,"enable l'utilisation des couleurs",IS_LIGHT,0,1,&lightCur->material.ambient.isEnable);
00797 INSERT_INT;
00798 message="r: \t";
00799 paramName<<clear<<lightName<<".ambient.r";
00800 INSERT_ITEM_FLOAT(paramName,"Composante rouge",IS_LIGHT,0,1,&lightCur->material.ambient.r);
00801 INSERT_FLOAT;
00802 message="g: \t";
00803 paramName<<clear<<lightName<<".ambient.g";
00804 INSERT_ITEM_FLOAT(paramName,"Composante verte",IS_LIGHT,0,1,&lightCur->material.ambient.g);
00805 INSERT_FLOAT;
00806 message="b: \t";
00807 paramName<<clear<<lightName<<".ambient.b";
00808 INSERT_ITEM_FLOAT(paramName,"Composante bleu",IS_LIGHT,0,1,&lightCur->material.ambient.b);
00809 INSERT_FLOAT;
00810 message="a: \t";
00811 paramName<<clear<<lightName<<".ambient.a";
00812 INSERT_ITEM_FLOAT(paramName,"Composante alpha (pour blending)",IS_LIGHT,0,1,&lightCur->material.ambient.a);
00813 INSERT_FLOAT;
00814 elemTree.hParent = hParentItem3;
00815 }
00816
00817 message="diffuse: ";
00818 lightCur->material.diffuse.ToString(message);
00819 INSERT_ITEM;
00820 {
00821 elemTree.hParent = hParentItem;
00822 message="enable: \t";
00823 paramName<<clear<<lightName<<".diffuse.enable";
00824 INSERT_ITEM_INT(paramName,"enable l'utilisation des couleurs",IS_LIGHT,0,1,&lightCur->material.diffuse.isEnable);
00825 INSERT_INT;
00826 message="r: \t";
00827 paramName<<clear<<lightName<<".diffuse.r";
00828 INSERT_ITEM_FLOAT(paramName,"Composante rouge",IS_LIGHT,0,1,&lightCur->material.diffuse.r);
00829 INSERT_FLOAT;
00830 message="g: \t";
00831 paramName<<clear<<lightName<<".diffuse.g";
00832 INSERT_ITEM_FLOAT(paramName,"Composante verte",IS_LIGHT,0,1,&lightCur->material.diffuse.g);
00833 INSERT_FLOAT;
00834 message="b: \t";
00835 paramName<<clear<<lightName<<".diffuse.b";
00836 INSERT_ITEM_FLOAT(paramName,"Composante bleu",IS_LIGHT,0,1,&lightCur->material.diffuse.b);
00837 INSERT_FLOAT;
00838 message="a: \t";
00839 paramName<<clear<<lightName<<".diffuse.a";
00840 INSERT_ITEM_FLOAT(paramName,"Composante alpha (pour blending)",IS_LIGHT,0,1,&lightCur->material.diffuse.a);
00841 INSERT_FLOAT;
00842 elemTree.hParent = hParentItem3;
00843 }
00844
00845 message="specular: ";
00846 lightCur->material.specular.ToString(message);
00847 INSERT_ITEM;
00848 {
00849 elemTree.hParent = hParentItem;
00850 message="enable: \t";
00851 paramName<<clear<<lightName<<".specular.enable";
00852 INSERT_ITEM_INT(paramName,"enable l'utilisation des couleurs",IS_LIGHT,0,1,&lightCur->material.specular.isEnable);
00853 INSERT_INT;
00854 message="r: \t";
00855 paramName<<clear<<lightName<<".specular.r";
00856 INSERT_ITEM_FLOAT(paramName,"Composante rouge",IS_LIGHT,0,1,&lightCur->material.specular.r);
00857 INSERT_FLOAT;
00858 message="g: \t";
00859 paramName<<clear<<lightName<<".specular.g";
00860 INSERT_ITEM_FLOAT(paramName,"Composante verte",IS_LIGHT,0,1,&lightCur->material.specular.g);
00861 INSERT_FLOAT;
00862 message="b: \t";
00863 paramName<<clear<<lightName<<".specular.b";
00864 INSERT_ITEM_FLOAT(paramName,"Composante bleu",IS_LIGHT,0,1,&lightCur->material.specular.b);
00865 INSERT_FLOAT;
00866 message="a: \t";
00867 paramName<<clear<<lightName<<".specular.a";
00868 INSERT_ITEM_FLOAT(paramName,"Composante alpha (pour blending)",IS_LIGHT,0,1,&lightCur->material.specular.a);
00869 INSERT_FLOAT;
00870 elemTree.hParent = hParentItem2;
00871 }
00872 }
00873 message="position: ";
00874 lightCur->position.ToString(message);
00875 INSERT_ITEM;
00876 {
00877 elemTree.hParent = hParentItem;
00878 message="enable: \t";
00879 paramName<<clear<<lightName<<".position.enable";
00880 INSERT_ITEM_INT(paramName,"enable l'utilisation du positionement",IS_LIGHT,0,1,&lightCur->position.isEnable);
00881 INSERT_INT;
00882 message="x: \t";
00883 paramName<<clear<<lightName<<".position.x";
00884 INSERT_ITEM_FLOAT(paramName,"position x",IS_LIGHT,-1024,1024,&lightCur->position.x);
00885 VE_float_cur.elem.AddSpecial(180,"paralelle");
00886 INSERT_FLOAT;
00887 message="y: \t";
00888 paramName<<clear<<lightName<<".position.y";
00889 INSERT_ITEM_FLOAT(paramName,"position y",IS_LIGHT,-1024,1024,&lightCur->position.y);
00890 INSERT_FLOAT;
00891 message="z: \t";
00892 paramName<<clear<<lightName<<".position.z";
00893 INSERT_ITEM_FLOAT(paramName,"position z",IS_LIGHT,-1024,1024,&lightCur->position.z);
00894 INSERT_FLOAT;
00895 message="w: \t";
00896 paramName<<clear<<lightName<<".position.w";
00897 INSERT_ITEM_FLOAT(paramName,"directionnel ou ponctuel",IS_LIGHT,0,-1,&lightCur->position.w);
00898 VE_float_cur.elem.AddSpecial(0,"directionnel");
00899 VE_float_cur.elem.AddSpecial(1,"ponctuel");
00900 INSERT_FLOAT;
00901 elemTree.hParent = hParentItem2;
00902 }
00903
00904 message="direction: ";
00905 lightCur->direction.ToString(message);
00906 INSERT_ITEM;
00907 {
00908 elemTree.hParent = hParentItem;
00909 message="enable: \t";
00910 paramName<<clear<<lightName<<".direction.enable";
00911 INSERT_ITEM_INT(paramName,"enable l'utilisation des direction",IS_LIGHT,0,1,&lightCur->direction.isEnable);
00912 INSERT_INT;
00913 message="x: \t";
00914 paramName<<clear<<lightName<<".direction.x";
00915 INSERT_ITEM_FLOAT(paramName,"direction x",IS_LIGHT,-1024,1024,&lightCur->direction.x);
00916 INSERT_FLOAT;
00917 message="y: \t";
00918 paramName<<clear<<lightName<<".direction.y";
00919 INSERT_ITEM_FLOAT(paramName,"direction y",IS_LIGHT,-1024,1024,&lightCur->direction.y);
00920 INSERT_FLOAT;
00921 message="z: \t";
00922 paramName<<clear<<lightName<<".direction.z";
00923 INSERT_ITEM_FLOAT(paramName,"direction z",IS_LIGHT,-1024,1024,&lightCur->direction.z);
00924 INSERT_FLOAT;
00925 elemTree.hParent = hParentItem2;
00926 }
00927
00928 message="cutoff: ";
00929 lightCur->cutoff.ToString(message);
00930 INSERT_ITEM;
00931 {
00932 elemTree.hParent = hParentItem;
00933 message="enable: \t";
00934 paramName<<clear<<lightName<<".cutoff.enable";
00935 INSERT_ITEM_INT(paramName,"enable l'utilisation de l'ouverture",IS_LIGHT,0,1,&lightCur->cutoff.isEnable);
00936 INSERT_INT;
00937 message="value: \t";
00938 paramName<<clear<<lightName<<".cutoff.value";
00939 INSERT_ITEM_FLOAT(paramName,"valeur de l'ouverture",IS_LIGHT,0,90,&lightCur->cutoff.elem);
00940 VE_int_cur.elem.AddSpecial(180,"paralelle");
00941 INSERT_FLOAT;
00942 elemTree.hParent = hParentItem2;
00943 }
00944
00945 message="exponent: ";
00946 lightCur->exponent.ToString(message);
00947 INSERT_ITEM;
00948 {
00949 elemTree.hParent = hParentItem;
00950 message="enable: \t";
00951 paramName<<clear<<lightName<<".exponent.enable";
00952 INSERT_ITEM_INT(paramName,"enable l'utilisation du exponent",IS_LIGHT,0,1,&lightCur->exponent.isEnable);
00953 INSERT_INT;
00954 message="value: \t";
00955 paramName<<clear<<lightName<<".exponent.value";
00956 INSERT_ITEM_FLOAT(paramName,"valeur du exponent ",IS_LIGHT,0,128,&lightCur->exponent.elem);
00957 INSERT_FLOAT;
00958 elemTree.hParent = hParentItem2;
00959 }
00960
00961 message="attenuation";
00962 BOOL atLeast = FALSE;
00963 if (lightCur->attenuationCst.isEnable)
00964 {
00965 message<<": "<<lightCur->attenuationCst.elem;
00966 atLeast = TRUE;
00967 }
00968 if (lightCur->attenuationLin.isEnable)
00969 {
00970 if (atLeast) message<<"+";
00971 else message<<": ";
00972 message<<lightCur->attenuationLin.elem<<"*x";
00973 atLeast = TRUE;
00974 }
00975 if (lightCur->attenuationQuad.isEnable)
00976 {
00977 if (atLeast) message<<"+";
00978 else message<<": ";
00979 message<<lightCur->attenuationQuad.elem<<"*x2";
00980 atLeast = TRUE;
00981 }
00982 INSERT_ITEM;
00983 {
00984 hParentItem2 = hParentItem;
00985 elemTree.hParent = hParentItem;
00986 message<<clear<<"constant [enable,value]:"<<lightCur->attenuationCst.isEnable<<" , "<<lightCur->attenuationCst.elem;
00987 INSERT_ITEM;
00988 {
00989 elemTree.hParent = hParentItem;
00990 message="enable: \t";
00991 paramName<<clear<<lightName<<".attenuationCst.enable";
00992 INSERT_ITEM_INT(paramName,"enable l'utilisation de l'attenuation",IS_LIGHT,0,1,&lightCur->attenuationCst.isEnable);
00993 INSERT_INT;
00994 message="value: \t";
00995 paramName<<clear<<lightName<<".attenuationCst.value";
00996 INSERT_ITEM_FLOAT(paramName,"valeur de l'attenuation",IS_LIGHT,0,90,&lightCur->attenuationCst.elem);
00997 VE_float_cur.elem.AddSpecial(180,"paralelle");
00998 INSERT_FLOAT;
00999 elemTree.hParent = hParentItem2;
01000 }
01001 message<<clear<<"lineaire [enable,value]:"<<lightCur->attenuationLin.isEnable<<" , "<<lightCur->attenuationLin.elem;
01002 INSERT_ITEM;
01003 {
01004 elemTree.hParent = hParentItem;
01005 message="enable: \t";
01006 paramName<<clear<<lightName<<".attenuationLin.enable";
01007 INSERT_ITEM_INT(paramName,"enable l'utilisation de l'attenuation",IS_LIGHT,0,1,&lightCur->attenuationLin.isEnable);
01008 INSERT_INT;
01009 message="value: \t";
01010 paramName<<clear<<lightName<<".attenuationLin.value";
01011 INSERT_ITEM_FLOAT(paramName,"valeur de l'attenuation",IS_LIGHT,0,90,&lightCur->attenuationLin.elem);
01012 VE_float_cur.elem.AddSpecial(180,"paralelle");
01013 INSERT_FLOAT;
01014 elemTree.hParent = hParentItem2;
01015 }
01016 message<<clear<<"quadratique [enable,value]:"<<lightCur->attenuationQuad.isEnable<<" , "<<lightCur->attenuationQuad.elem;
01017 INSERT_ITEM;
01018 {
01019 elemTree.hParent = hParentItem;
01020 message="enable: \t";
01021 paramName<<clear<<lightName<<".attenuationQuad.enable";
01022 INSERT_ITEM_INT(paramName,"enable l'utilisation de l'attenuation",IS_LIGHT,0,1,&lightCur->attenuationQuad.isEnable);
01023 INSERT_INT;
01024 message="value: \t";
01025 paramName<<clear<<lightName<<".attenuationQuad.value";
01026 INSERT_ITEM_FLOAT(paramName,"valeur de l'attenuation",IS_LIGHT,0,90,&lightCur->attenuationQuad.elem);
01027 VE_float_cur.elem.AddSpecial(180,"paralelle");
01028 INSERT_FLOAT;
01029 elemTree.hParent = hParentItem2;
01030 }
01031 }
01032 elemTree.hParent=NULL;
01033 }
01034 }
01035 }
01036
01037 void ValueEditors::MakeTexturesStruct(HWND hWnd)
01038 {
01039 Zero();
01040 CBase_VE_double VE_double_cur;
01041 CBase_VE_int VE_int_cur;
01042 CBase_VE_float VE_float_cur;
01043 MyString interpretedText;
01044
01045 HTREEITEM hParentItem,hParentItem2;
01046 TVINSERTSTRUCT elemTree;
01047 elemTree.hInsertAfter = TVI_LAST;
01048 elemTree.hParent = NULL;
01049 elemTree.item.mask = TVIF_TEXT | TVIF_PARAM;
01050
01051 int num = 1;
01052 MyString message,textureNum,temp;
01053
01054 int numTexture = -1;
01055 for (Texture::list.i=0;Texture::list.i.More();Texture::list.i++)
01056 {
01057 numTexture++;
01058 Texture *texture = Texture::list.i.GetElem();
01059
01060 textureNum.Format("texture%d",numTexture);
01061 message.Format("%s [name,id]: \"%s\" , %d",(char*)textureNum,(char*)texture->name,texture->id);
01062 INSERT_ITEM;
01063 {
01064 hParentItem2 = hParentItem;
01065 elemTree.hParent = hParentItem;
01066
01067 message.Format("source: \"%s\"",(char*)texture->source);
01068 INSERT_ITEM;
01069 message.Format("size [x,y]: %d , %d",texture->xSize,texture->ySize);
01070 INSERT_ITEM;
01071 message="useResizing: \t";
01072 temp=textureNum;temp<<".useResizing";
01073 INSERT_ITEM_INT(temp,"utilse le redimentionement (parametre scale) ou changement a la source",FALSE,0,1,&texture->useResizing);
01074 INSERT_INT;
01075 message="scale [x,y]: ";message<<texture->xScale<<" , "<<texture->yScale;
01076 INSERT_ITEM;
01077 {
01078 elemTree.hParent = hParentItem;
01079 message="x: \t";
01080 temp=textureNum;temp<<".xScale";
01081 INSERT_ITEM_DOUBLE(temp,"scaling de la texture dans les x (<1 si texture original non exposant de 2)",FALSE,0,1,&texture->xScale);
01082 INSERT_DOUBLE;
01083 message="y: \t";
01084 temp=textureNum;temp<<".yScale";
01085 INSERT_ITEM_DOUBLE(temp,"scaling de la texture dans les y (<1 si texture original non exposant de 2)",FALSE,0,1,&texture->yScale);
01086 INSERT_DOUBLE;
01087 elemTree.hParent = hParentItem2;
01088 }
01089
01090 message="border ";
01091 texture->border.ToString(message);
01092 INSERT_ITEM;
01093 {
01094 elemTree.hParent = hParentItem;
01095 message="enable: \t";
01096 temp=textureNum;temp<<".border.enable";
01097 INSERT_ITEM_INT(temp,"enable l'utilisation des couleurs",IS_TEXTURE+numTexture,0,1,&texture->border.isEnable);
01098 INSERT_INT;
01099 message="r: \t";
01100 temp=textureNum;temp<<".border.r";
01101 INSERT_ITEM_FLOAT(temp,"Composante rouge",IS_TEXTURE+numTexture,-1,1,&texture->border.r);
01102 INSERT_FLOAT;
01103 message="g: \t";
01104 temp=textureNum;temp<<".border.g";
01105 INSERT_ITEM_FLOAT(temp,"Composante verte",IS_TEXTURE+numTexture,-1,1,&texture->border.g);
01106 INSERT_FLOAT;
01107 message="b: \t";
01108 temp=textureNum;temp<<".border.b";
01109 INSERT_ITEM_FLOAT(temp,"Composante bleu",IS_TEXTURE+numTexture,-1,1,&texture->border.b);
01110 INSERT_FLOAT;
01111 message="a: \t";
01112 temp=textureNum;temp<<".border.a";
01113 INSERT_ITEM_FLOAT(temp,"Composante alpha (pour blending)",IS_TEXTURE+numTexture,-1,1,&texture->border.a);
01114 INSERT_FLOAT;
01115 elemTree.hParent = hParentItem2;
01116 }
01117
01118 message="envColor ";
01119 texture->envColor.ToString(message);
01120 INSERT_ITEM;
01121 {
01122 elemTree.hParent = hParentItem;
01123 message="enable: \t";
01124 temp=textureNum;temp<<".envColor.enable";
01125 INSERT_ITEM_INT(temp,"enable l'utilisation des couleurs",IS_TEXTURE+numTexture,0,1,&texture->envColor.isEnable);
01126 INSERT_INT;
01127 message="r: \t";
01128 temp=textureNum;temp<<".envColor.r";
01129 INSERT_ITEM_FLOAT(temp,"Composante rouge",IS_TEXTURE+numTexture,-1,1,&texture->envColor.r);
01130 INSERT_FLOAT;
01131 message="g: \t";
01132 temp=textureNum;temp<<".envColor.g";
01133 INSERT_ITEM_FLOAT(temp,"Composante verte",IS_TEXTURE+numTexture,-1,1,&texture->envColor.g);
01134 INSERT_FLOAT;
01135 message="b: \t";
01136 temp=textureNum;temp<<".envColor.b";
01137 INSERT_ITEM_FLOAT(temp,"Composante bleu",IS_TEXTURE+numTexture,-1,1,&texture->envColor.b);
01138 INSERT_FLOAT;
01139 message="a: \t";
01140 temp=textureNum;temp<<".envColor.a";
01141 INSERT_ITEM_FLOAT(temp,"Composante alpha (pour blending)",IS_TEXTURE+numTexture,-1,1,&texture->envColor.a);
01142 INSERT_FLOAT;
01143 elemTree.hParent = hParentItem2;
01144 }
01145
01146 message="filter [min,mag]: ";message<<texture->minFilter<<" , "<<texture->magFilter;
01147 INSERT_ITEM;
01148 {
01149 elemTree.hParent = hParentItem;
01150 message="min: \t";
01151 temp=textureNum;temp<<".minFilter";
01152 INSERT_ITEM_INT(temp,"type de traitement si la taille de la texture orginal est plus petite qu'a l'affichage",IS_TEXTURE+numTexture,0,-1,(int *)&texture->minFilter);
01153 VE_int_cur.elem.AddSpecial(GL_NEAREST,"Nearest");
01154 VE_int_cur.elem.AddSpecial(GL_LINEAR,"Linear");
01155 INSERT_INT;
01156 message="mag: \t";
01157 temp=textureNum;temp<<".magFilter";
01158 INSERT_ITEM_INT(temp,"type de traitement si la taille de la texture original est plus grande qu'a l'affichage",IS_TEXTURE+numTexture,0,-1,(int *)&texture->magFilter);
01159 VE_int_cur.elem.AddSpecial(GL_NEAREST,"Nearest");
01160 VE_int_cur.elem.AddSpecial(GL_LINEAR,"Linear");
01161 INSERT_INT;
01162 elemTree.hParent = hParentItem2;
01163 }
01164 message="wrap [Hori,Verti]: ";message<<texture->wrapS<<" , "<<texture->wrapT;
01165 INSERT_ITEM;
01166 {
01167 elemTree.hParent = hParentItem;
01168 message="Horizontal: \t";
01169 temp<<clear<<textureNum<<".wrapS";
01170 INSERT_ITEM_INT(temp,"type d'envelopement horizontal",IS_TEXTURE+numTexture,0,-1,(int *)&texture->wrapS);
01171 VE_int_cur.elem.AddSpecial(GL_CLAMP ,"Clamp");
01172 VE_int_cur.elem.AddSpecial(GL_REPEAT,"Repeat");
01173 INSERT_INT;
01174 message="Vertical: \t";
01175 temp<<clear<<textureNum;temp<<".wrapT";
01176 INSERT_ITEM_INT(temp,"type d'envelopement vertical",IS_TEXTURE+numTexture,0,-1,(int *)&texture->wrapT);
01177 VE_int_cur.elem.AddSpecial(GL_CLAMP ,"Clamp");
01178 VE_int_cur.elem.AddSpecial(GL_REPEAT,"Repeat");
01179 INSERT_INT;
01180 elemTree.hParent = hParentItem2;
01181 }
01182 elemTree.hParent = NULL;
01183 }
01184 }
01185 }
01186
01191 void ValueEditors::MakeFontsStruct(HWND hWnd)
01192 {
01193 Zero();
01194 CBase_VE_double VE_double_cur;
01195 CBase_VE_int VE_int_cur;
01196 CBase_VE_float VE_float_cur;
01197 MyString interpretedText;
01198
01199 HTREEITEM hParentItem;
01200 TVINSERTSTRUCT elemTree;
01201 elemTree.hInsertAfter = TVI_LAST;
01202 elemTree.hParent = NULL;
01203 elemTree.item.mask = TVIF_TEXT | TVIF_PARAM;
01204
01205 int num = 1;
01206 MyString message,fontTxt,temp;
01207
01208 int numFont = -1;
01209
01210 MyList<FTFont *> fonts;
01211 fonts.i+=ce.fontBitmap;
01212 fonts.i+=ce.fontExtrude;
01213 fonts.i+=ce.fontOutline;
01214 fonts.i+=ce.fontPixmap;
01215 fonts.i+=ce.fontPolygon;
01216 fonts.i+=ce.fontTexture;
01217 for (fonts.i=0;fonts.i.More();fonts.i++)
01218 {
01219 FTFont *font = fonts.i.GetElem();
01220 numFont++;
01221 int size = font->FaceSize();
01222 float ascender = font->Ascender();
01223 float descender = font->Descender();
01224
01225 fontTxt.Format("font%d",numFont);
01226 message.Format("%s [name,asc,des]: \"%s\" , %0.2f , %0.2f",(char*)fontTxt,ascender,descender);
01227 INSERT_ITEM;
01228
01229
01230
01231
01232
01233
01234
01235
01236
01237
01238 }
01239 }
01240
01241 BOOL ValueEditors::MakeElemFaceStruct(HWND hWnd,FaceNode *node)
01242 {
01243 if (!node) return FALSE;
01244 Zero();
01245 CBase_VE_double VE_double_cur;
01246 CBase_VE_int VE_int_cur;
01247 CBase_VE_float VE_float_cur;
01248 MyString interpretedText;
01249
01250 Face *face = node->elem;
01251 HTREEITEM hParentItem,hParentItem2;
01252 TVINSERTSTRUCT elemTree;
01253 elemTree.hInsertAfter = TVI_LAST;
01254 elemTree.hParent = NULL;
01255 elemTree.item.mask = TVIF_TEXT | TVIF_PARAM;
01256
01257 int num = 1;
01258 MyString message;
01259 message.Format("Name: %s [idControl,idFace]: %d,%d",(char*)face->name,face->idControl,face->idFace);
01260 INSERT_ITEM;
01261 message<<clear<<"Angle [x,y,z]: "<<face->angle.x<<" , "<<face->angle.y<<" , "<<face->angle.z;
01262 INSERT_ITEM;
01263 {
01264 elemTree.hParent = hParentItem;
01265 message="angle.x: \t";
01266 INSERT_ITEM_DOUBLE("Angle.x","Angle X de l'univers",FALSE,-180,180,&face->angle.x);
01267 INSERT_DOUBLE;
01268 message="angle.y: \t";
01269 INSERT_ITEM_DOUBLE("Angle.y","Angle Y de l'univers",FALSE,-180,180,&face->angle.y);
01270 INSERT_DOUBLE;
01271 message="angle.z: \t";
01272 INSERT_ITEM_DOUBLE("Angle.z","Angle Z de l'univers",FALSE,-180,180,&face->angle.z);
01273 INSERT_DOUBLE;
01274 message="ratioXY: \t";
01275 INSERT_ITEM_DOUBLE("RatioXY","ration entre les X et Y",FALSE,-180,180,&face->ratioXY);
01276 INSERT_DOUBLE;
01277 elemTree.hParent = NULL;
01278 }
01279 message.Format("Mode [view,aalias,fog,blend,line]: %d , %d , %d , %d , %d",face->view,face->antialias,face->fog,face->blending,face->line);
01280 INSERT_ITEM;
01281 {
01282 elemTree.hParent = hParentItem;
01283 message="view: \t";
01284 INSERT_ITEM_INT("view","Face doit etre visualisé ?",FALSE,0,1,&face->view);
01285 INSERT_INT;
01286 message="antialias: \t";
01287 INSERT_ITEM_INT("antialias","Antialising activée?",FALSE,0,1,&face->antialias);
01288 INSERT_INT;
01289 message="fog: \t";
01290 INSERT_ITEM_INT("fog","Le brouillard concerne il cette face ? (si brouillard general est activé)",FALSE,0,1,&face->fog);
01291 INSERT_INT;
01292 message="blending: \t";
01293 INSERT_ITEM_INT("blending","Mode de transparance activé ? (utilise les valeur alphas)",FALSE,0,1,&face->blending);
01294 INSERT_INT;
01295
01296 message="line: \t";
01297 INSERT_ITEM_FLOAT("line","Taille du contour de la surface en ligne, booleen si antialiasing de ligne activé",FALSE,0,10,&face->line);
01298 INSERT_FLOAT;
01299
01300 message="lineMaterials";
01301 INSERT_ITEM;
01302 {
01303 hParentItem2 = hParentItem;
01304 elemTree.hParent = hParentItem;
01305 message="typeFace: \t";
01306 INSERT_ITEM_INT("typeFace","Type deface consernée",FALSE,0,-1,&face->lineMaterial.typeFace);
01307 VE_int_cur.elem.AddSpecial(GL_FRONT_AND_BACK,"front&back");
01308 VE_int_cur.elem.AddSpecial(GL_FRONT,"front");
01309 VE_int_cur.elem.AddSpecial(GL_BACK,"back");
01310 INSERT_INT;
01311
01312 message="ambient: ";
01313 face->lineMaterial.ambient.ToString(message);
01314 INSERT_ITEM;
01315 {
01316 elemTree.hParent = hParentItem;
01317 message="enable: \t";
01318 INSERT_ITEM_INT("lineMaterial.ambient.enable","enable l'utilisation des coureurs",FALSE,0,1,&face->lineMaterial.ambient.isEnable);
01319 INSERT_INT;
01320 message="r: \t";
01321 INSERT_ITEM_FLOAT("lineMaterial.ambient.r","Composante rouge",FALSE,0,1,&face->lineMaterial.ambient.r);
01322 INSERT_FLOAT;
01323 message="g: \t";
01324 INSERT_ITEM_FLOAT("lineMaterial.ambient.g","Composante verte",FALSE,0,1,&face->lineMaterial.ambient.g);
01325 INSERT_FLOAT;
01326 message="b: \t";
01327 INSERT_ITEM_FLOAT("lineMaterial.ambient.b","Composante bleu",FALSE,0,1,&face->lineMaterial.ambient.b);
01328 INSERT_FLOAT;
01329 message="a: \t";
01330 INSERT_ITEM_FLOAT("lineMaterial.ambient.a","Composante alpha (pour blending)",FALSE,0,1,&face->lineMaterial.ambient.a);
01331 INSERT_FLOAT;
01332 elemTree.hParent = hParentItem2;
01333 }
01334
01335 message="diffuse: ";
01336 face->lineMaterial.diffuse.ToString(message);
01337 INSERT_ITEM;
01338 {
01339 elemTree.hParent = hParentItem;
01340 message="enable: \t";
01341 INSERT_ITEM_INT("lineMaterial.diffuse.enable","enable l'utilisation des couleurs",FALSE,0,1,&face->lineMaterial.diffuse.isEnable);
01342 INSERT_INT;
01343 message="r: \t";
01344 INSERT_ITEM_FLOAT("lineMaterial.diffuse.r","Composante rouge",FALSE,0,1,&face->lineMaterial.diffuse.r);
01345 INSERT_FLOAT;
01346 message="g: \t";
01347 INSERT_ITEM_FLOAT("lineMaterial.diffuse.g","Composante verte",FALSE,0,1,&face->lineMaterial.diffuse.g);
01348 INSERT_FLOAT;
01349 message="b: \t";
01350 INSERT_ITEM_FLOAT("lineMaterial.diffuse.b","Composante bleu",FALSE,0,1,&face->lineMaterial.diffuse.b);
01351 INSERT_FLOAT;
01352 message="a: \t";
01353 INSERT_ITEM_FLOAT("lineMaterial.diffuse.a","Composante alpha (pour blending)",FALSE,0,1,&face->lineMaterial.diffuse.a);
01354 INSERT_FLOAT;
01355 elemTree.hParent = hParentItem2;
01356 }
01357
01358 message="specular: ";
01359 face->lineMaterial.specular.ToString(message);
01360 INSERT_ITEM;
01361 {
01362 elemTree.hParent = hParentItem;
01363 message="enable: \t";
01364 INSERT_ITEM_INT("lineMaterial.specular.enable","enable l'utilisation des couleurs",FALSE,0,1,&face->lineMaterial.specular.isEnable);
01365 INSERT_INT;
01366 message="r: \t";
01367 INSERT_ITEM_FLOAT("lineMaterial.specular.r","Composante rouge",FALSE,0,1,&face->lineMaterial.specular.r);
01368 INSERT_FLOAT;
01369 message="g: \t";
01370 INSERT_ITEM_FLOAT("lineMaterial.specular.g","Composante verte",FALSE,0,1,&face->lineMaterial.specular.g);
01371 INSERT_FLOAT;
01372 message="b: \t";
01373 INSERT_ITEM_FLOAT("lineMaterial.specular.b","Composante bleu",FALSE,0,1,&face->lineMaterial.specular.b);
01374 INSERT_FLOAT;
01375 message="a: \t";
01376 INSERT_ITEM_FLOAT("lineMaterial.specular.a","Composante alpha (pour blending)",FALSE,0,1,&face->lineMaterial.specular.a);
01377 INSERT_FLOAT;
01378 elemTree.hParent = hParentItem2;
01379 }
01380
01381 message="emission: ";
01382 face->lineMaterial.emission.ToString(message);
01383 INSERT_ITEM;
01384 {
01385 elemTree.hParent = hParentItem;
01386 message="enable: \t";
01387 INSERT_ITEM_INT("lineMaterial.emission.enable","enable l'utilisation des couleurs",FALSE,0,1,&face->lineMaterial.emission.isEnable);
01388 INSERT_INT;
01389 message="r: \t";
01390 INSERT_ITEM_FLOAT("lineMaterial.emission.r","Composante rouge",FALSE,0,1,&face->lineMaterial.emission.r);
01391 INSERT_FLOAT;
01392 message="g: \t";
01393 INSERT_ITEM_FLOAT("lineMaterial.emission.g","Composante verte",FALSE,0,1,&face->lineMaterial.emission.g);
01394 INSERT_FLOAT;
01395 message="b: \t";
01396 INSERT_ITEM_FLOAT("lineMaterial.emission.b","Composante bleu",FALSE,0,1,&face->lineMaterial.emission.b);
01397 INSERT_FLOAT;
01398 message="a: \t";
01399 INSERT_ITEM_FLOAT("lineMaterial.emission.a","Composante alpha (pour blending)",FALSE,0,1,&face->lineMaterial.emission.a);
01400 INSERT_FLOAT;
01401 elemTree.hParent = hParentItem2;
01402 }
01403
01404 message<<clear<<"shiness [enable,value]: "<<face->lineMaterial.shiness.isEnable<<" , "<<face->lineMaterial.shiness.elem;
01405 INSERT_ITEM;
01406 {
01407 elemTree.hParent = hParentItem;
01408 message="enable: \t";
01409 INSERT_ITEM_INT("lineMaterial.shiness.enable","enable l'utilisation de la luminosité",FALSE,0,1,&face->lineMaterial.shiness.isEnable);
01410 INSERT_INT;
01411 message="value: \t";
01412 INSERT_ITEM_INT("lineMaterial.shiness.value","luminosité",FALSE,0,128,&face->lineMaterial.shiness.elem);
01413 INSERT_INT;
01414 elemTree.hParent = hParentItem2;
01415 }
01416 elemTree.hParent = NULL;
01417 }
01418 elemTree.hParent = NULL;
01419 }
01420 if (face->text)
01421 {
01422 message.Format("Text [value,scale]: \"%s\" , %.2lf",(char*)face->text,face->text->scale);
01423 INSERT_ITEM;
01424 {
01425 hParentItem2 = hParentItem;
01426 elemTree.hParent = hParentItem;
01427
01428
01429
01430
01431
01432 message.Format("align [x,y]: %d , %d",face->text->xAlign,face->text->yAlign);
01433 INSERT_ITEM;
01434 {
01435 elemTree.hParent = hParentItem;
01436 message="x: \t";
01437 INSERT_ITEM_INT("text.align.x","type d'alignement sur les X",FALSE,0,-1,(int *)&face->text->xAlign);
01438 VE_int_cur.elem.AddSpecial(align_begin,"begin");
01439 VE_int_cur.elem.AddSpecial(align_center,"center");
01440 VE_int_cur.elem.AddSpecial(align_end,"end");
01441 VE_int_cur.elem.AddSpecial(align_justify,"justify");
01442 INSERT_INT;
01443 message="y: \t";
01444 INSERT_ITEM_INT("text.align.y","type d'alignement sur les Y",FALSE,0,-1,(int *)&face->text->yAlign);
01445 VE_int_cur.elem.AddSpecial(align_begin,"begin");
01446 VE_int_cur.elem.AddSpecial(align_center,"center");
01447 VE_int_cur.elem.AddSpecial(align_end,"end");
01448 VE_int_cur.elem.AddSpecial(align_justify,"justify");
01449 INSERT_INT;
01450 message="xJustifyLimit: \t";
01451 INSERT_ITEM_DOUBLE("text.xJustifyLimit","maximum de la justification en X",FALSE,0,50,&face->text->xJustifyLimit);
01452 INSERT_DOUBLE;
01453 message="yJustifyLimit: \t";
01454 INSERT_ITEM_DOUBLE("text.yJustifyLimit","maximum de la justification en Y",FALSE,0,50,&face->text->yJustifyLimit);
01455 INSERT_DOUBLE;
01456 elemTree.hParent = hParentItem2;
01457 }
01458
01459
01460
01461
01462 message.Format("wrapping [line,word,letter]: %d , %d , %d",face->text->lineWrap,face->text->wordWrap,face->text->letterWrap);
01463 INSERT_ITEM;
01464 {
01465 elemTree.hParent = hParentItem;
01466 message="line: \t";
01467 INSERT_ITEM_INT("text.lineWrap","les lignes sont elle secable ?(retour automatique)",FALSE,0,-1,(int *)&face->text->lineWrap);
01468 VE_int_cur.elem.AddSpecial(FALSE,"false");
01469 VE_int_cur.elem.AddSpecial(TRUE,"true");
01470 INSERT_INT;
01471 message="word: \t";
01472 INSERT_ITEM_INT("text.wordWrap","les mots sont ils secable ?(retour automatique)",FALSE,0,-1,(int *)&face->text->wordWrap);
01473 VE_int_cur.elem.AddSpecial(FALSE,"false");
01474 VE_int_cur.elem.AddSpecial(TRUE,"true");
01475 INSERT_INT;
01476 message="letter: \t";
01477 INSERT_ITEM_INT("text.letterWrap","les lettres sont elle secable ?",FALSE,0,-1,(int *)&face->text->letterWrap);
01478 VE_int_cur.elem.AddSpecial(FALSE,"false");
01479 VE_int_cur.elem.AddSpecial(TRUE,"true");
01480 INSERT_INT;
01481 elemTree.hParent = hParentItem2;
01482 }
01483
01484 message="scale: \t";
01485 INSERT_ITEM_DOUBLE("text.scale","taille relative de la fonte",FALSE,0,4,&face->text->scale);
01486 INSERT_DOUBLE;
01487
01488 message="depth: \t";
01489 INSERT_ITEM_FLOAT("text.depth","epaisseur (dans les cas d'une fonte extrude)",FALSE,0,20,&face->text->depth);
01490 INSERT_FLOAT;
01491
01492 message="material";
01493 INSERT_ITEM;
01494 {
01495 hParentItem2 = hParentItem;
01496 elemTree.hParent = hParentItem;
01497 message="typeFace: \t";
01498 INSERT_ITEM_INT("typeFace","Type deface consernée",FALSE,0,-1,&face->text->material.typeFace);
01499 VE_int_cur.elem.AddSpecial(GL_FRONT_AND_BACK,"front&back");
01500 VE_int_cur.elem.AddSpecial(GL_FRONT,"front");
01501 VE_int_cur.elem.AddSpecial(GL_BACK,"back");
01502 INSERT_INT;
01503
01504 message="ambient: ";
01505 face->text->material.ambient.ToString(message);
01506 INSERT_ITEM;
01507 {
01508 elemTree.hParent = hParentItem;
01509 message="enable: \t";
01510 INSERT_ITEM_INT("material.ambient.enable","enable l'utilisation des coureurs",FALSE,0,1,&face->text->material.ambient.isEnable);
01511 INSERT_INT;
01512 message="r: \t";
01513 INSERT_ITEM_FLOAT("material.ambient.r","Composante rouge",FALSE,0,1,&face->text->material.ambient.r);
01514 INSERT_FLOAT;
01515 message="g: \t";
01516 INSERT_ITEM_FLOAT("material.ambient.g","Composante verte",FALSE,0,1,&face->text->material.ambient.g);
01517 INSERT_FLOAT;
01518 message="b: \t";
01519 INSERT_ITEM_FLOAT("material.ambient.b","Composante bleu",FALSE,0,1,&face->text->material.ambient.b);
01520 INSERT_FLOAT;
01521 message="a: \t";
01522 INSERT_ITEM_FLOAT("material.ambient.a","Composante alpha (pour blending)",FALSE,0,1,&face->text->material.ambient.a);
01523 INSERT_FLOAT;
01524 elemTree.hParent = hParentItem2;
01525 }
01526
01527 message="diffuse: ";
01528 face->text->material.diffuse.ToString(message);
01529 INSERT_ITEM;
01530 {
01531 elemTree.hParent = hParentItem;
01532 message="enable: \t";
01533 INSERT_ITEM_INT("material.diffuse.enable","enable l'utilisation des couleurs",FALSE,0,1,&face->text->material.diffuse.isEnable);
01534 INSERT_INT;
01535 message="r: \t";
01536 INSERT_ITEM_FLOAT("material.diffuse.r","Composante rouge",FALSE,0,1,&face->text->material.diffuse.r);
01537 INSERT_FLOAT;
01538 message="g: \t";
01539 INSERT_ITEM_FLOAT("material.diffuse.g","Composante verte",FALSE,0,1,&face->text->material.diffuse.g);
01540 INSERT_FLOAT;
01541 message="b: \t";
01542 INSERT_ITEM_FLOAT("material.diffuse.b","Composante bleu",FALSE,0,1,&face->text->material.diffuse.b);
01543 INSERT_FLOAT;
01544 message="a: \t";
01545 INSERT_ITEM_FLOAT("material.diffuse.a","Composante alpha (pour blending)",FALSE,0,1,&face->text->material.diffuse.a);
01546 INSERT_FLOAT;
01547 elemTree.hParent = hParentItem2;
01548 }
01549
01550 message="specular: ";
01551 face->text->material.specular.ToString(message);
01552 INSERT_ITEM;
01553 {
01554 elemTree.hParent = hParentItem;
01555 message="enable: \t";
01556 INSERT_ITEM_INT("material.specular.enable","enable l'utilisation des couleurs",FALSE,0,1,&face->text->material.specular.isEnable);
01557 INSERT_INT;
01558 message="r: \t";
01559 INSERT_ITEM_FLOAT("material.specular.r","Composante rouge",FALSE,0,1,&face->text->material.specular.r);
01560 INSERT_FLOAT;
01561 message="g: \t";
01562 INSERT_ITEM_FLOAT("material.specular.g","Composante verte",FALSE,0,1,&face->text->material.specular.g);
01563 INSERT_FLOAT;
01564 message="b: \t";
01565 INSERT_ITEM_FLOAT("material.specular.b","Composante bleu",FALSE,0,1,&face->text->material.specular.b);
01566 INSERT_FLOAT;
01567 message="a: \t";
01568 INSERT_ITEM_FLOAT("material.specular.a","Composante alpha (pour blending)",FALSE,0,1,&face->text->material.specular.a);
01569 INSERT_FLOAT;
01570 elemTree.hParent = hParentItem2;
01571 }
01572
01573 message="emission: ";
01574 face->text->material.emission.ToString(message);
01575 INSERT_ITEM;
01576 {
01577 elemTree.hParent = hParentItem;
01578 message="enable: \t";
01579 INSERT_ITEM_INT("material.emission.enable","enable l'utilisation des couleurs",FALSE,0,1,&face->text->material.emission.isEnable);
01580 INSERT_INT;
01581 message="r: \t";
01582 INSERT_ITEM_FLOAT("material.emission.r","Composante rouge",FALSE,0,1,&face->text->material.emission.r);
01583 INSERT_FLOAT;
01584 message="g: \t";
01585 INSERT_ITEM_FLOAT("material.emission.g","Composante verte",FALSE,0,1,&face->text->material.emission.g);
01586 INSERT_FLOAT;
01587 message="b: \t";
01588 INSERT_ITEM_FLOAT("material.emission.b","Composante bleu",FALSE,0,1,&face->text->material.emission.b);
01589 INSERT_FLOAT;
01590 message="a: \t";
01591 INSERT_ITEM_FLOAT("material.emission.a","Composante alpha (pour blending)",FALSE,0,1,&face->text->material.emission.a);
01592 INSERT_FLOAT;
01593 elemTree.hParent = hParentItem2;
01594 }
01595
01596 message<<clear<<"shiness [enable,value]: "<<face->text->material.shiness.isEnable<<" , "<<face->text->material.shiness.elem;
01597 INSERT_ITEM;
01598 {
01599 elemTree.hParent = hParentItem;
01600 message="enable: \t";
01601 INSERT_ITEM_INT("material.shiness.enable","enable l'utilisation de la luminosité",FALSE,0,1,&face->text->material.shiness.isEnable);
01602 INSERT_INT;
01603 message="value: \t";
01604 INSERT_ITEM_INT("material.shiness.value","luminosité",FALSE,0,128,&face->text->material.shiness.elem);
01605 INSERT_INT;
01606 elemTree.hParent = hParentItem2;
01607 }
01608 elemTree.hParent = NULL;
01609 }
01610 elemTree.hParent = NULL;
01611 }
01612 }
01613 message="Curve";
01614 INSERT_ITEM;
01615 {
01616 hParentItem2 = hParentItem;
01617 elemTree.hParent = hParentItem;
01618 message.Format("center [x,y,z]: %.2f , %.2f , %.2f",face->curve.center.x,face->curve.center.y,face->curve.center.z);
01619 INSERT_ITEM;
01620 {
01621 elemTree.hParent = hParentItem;
01622 message="x: \t";
01623 INSERT_ITEM_DOUBLE("curve.center.x","position du centre en x de l'incurvation",FALSE,0,1,&face->curve.center.x);
01624 INSERT_DOUBLE;
01625 message="y: \t";
01626 INSERT_ITEM_DOUBLE("curve.center.y","position du centre en y de l'incurvation",FALSE,0,1,&face->curve.center.y);
01627 INSERT_DOUBLE;
01628 message="z: \t";
01629 INSERT_ITEM_DOUBLE("curve.center.z","position du centre en z de l'incurvation",FALSE,-1024,1024,&face->curve.center.z);
01630 INSERT_DOUBLE;
01631 elemTree.hParent = hParentItem2;
01632 }
01633 message<<clear<<"nbCut [x,y]: "<<face->curve.nbCut.x<<" , "<<face->curve.nbCut.y;
01634 INSERT_ITEM;
01635 {
01636 elemTree.hParent = hParentItem;
01637 message="x: \t";
01638 INSERT_ITEM_INT("curve.nbCut.x","nb subdivision en sous-face en x",FALSE,1,50,&face->curve.nbCut.x);
01639 INSERT_INT;
01640 message="y: \t";
01641 INSERT_ITEM_INT("curve.nbCut.y","nb subdivision en sous-face en y",FALSE,1,50,&face->curve.nbCut.y);
01642 INSERT_INT;
01643 elemTree.hParent = hParentItem2;
01644 }
01645 elemTree.hParent = NULL;
01646 }
01647 message.Format("Center [x,y => cx,cy]: %d , %d => %.2lf , %.2lf",face->center.x,face->center.y,face->computeCenter.x,face->computeCenter.y);
01648 INSERT_ITEM;
01649 {
01650 elemTree.hParent = hParentItem;
01651 message="x: \t";
01652 INSERT_ITEM_INT("center.x","position dans les x",FALSE,0,-1,&face->center.x);
01653 VE_int_cur.elem.AddSpecial(-1,"gauche");
01654 VE_int_cur.elem.AddSpecial(0,"centré");
01655 VE_int_cur.elem.AddSpecial(1,"droit");
01656 INSERT_INT;
01657 message="y: \t";
01658 INSERT_ITEM_INT("center.y","position dans les y",FALSE,0,-1,&face->center.y);
01659 VE_int_cur.elem.AddSpecial(-1,"haut");
01660 VE_int_cur.elem.AddSpecial(0,"centré");
01661 VE_int_cur.elem.AddSpecial(1,"bas");
01662 INSERT_INT;
01663 elemTree.hParent = NULL;
01664 }
01665 message="Position";
01666 INSERT_ITEM;
01667 {
01668 hParentItem2 = hParentItem;
01669 elemTree.hParent = hParentItem;
01670 if (face->position.x.IsDynamic())
01671 message.Format("position.x: %.2lf * %.2lf + %.2lf = %.2lf",face->position.x.percentValue,*face->position.x.baseValue,face->position.x.constValue,face->computePosition.x);
01672 else message.Format("position.x: %.2lf",face->position.x.constValue);
01673 INSERT_ITEM;
01674 {
01675 elemTree.hParent = hParentItem;
01676 if (face->position.x.IsDynamic())
01677 {
01678 message="percent: \t";
01679 INSERT_ITEM_DOUBLE("position.x.percentValue","composante pourcentage de la taille (taille = pourcentage*base+constante)",FALSE,-0.5,0.5,&face->position.x.percentValue);
01680 INSERT_DOUBLE;
01681 message="base: \t";
01682 INSERT_ITEM_DOUBLE("position.x.baseValue","composante pourcentage de la taille (taille = pourcentage*base+constante)",FALSE,-1024,1024,face->position.x.baseValue);
01683 INSERT_DOUBLE;
01684 }
01685 message="const: \t";
01686 INSERT_ITEM_DOUBLE("position.x.constValue","composante constante de la position (pos = pourcentage*variable+constante)",FALSE,-1024,1024,&face->position.x.constValue);
01687 INSERT_DOUBLE;
01688 elemTree.hParent = hParentItem2;
01689 }
01690 if (face->position.y.IsDynamic())
01691 message.Format("position.y: %.2lf * %.2lf + %.2lf = %.2lf",face->position.y.percentValue,*face->position.y.baseValue,face->position.y.constValue,face->computePosition.y);
01692 else message.Format("position.y: %.2lf",face->position.y.constValue);
01693 INSERT_ITEM;
01694 {
01695 elemTree.hParent = hParentItem;
01696 if (face->position.y.IsDynamic())
01697 {
01698 message="percent: \t";
01699 INSERT_ITEM_DOUBLE("position.y.percentValue","composante pourcentage de la taille (taille = pourcentage*base+constante)",FALSE,-0.5,0.5,&face->position.y.percentValue);
01700 INSERT_DOUBLE;
01701 message="base: \t";
01702 INSERT_ITEM_DOUBLE("position.y.baseValue","composante base de la taille (taille = pourcentage*base+constante)",FALSE,-1024,1024,face->position.y.baseValue);
01703 INSERT_DOUBLE;
01704 }
01705 message="const: \t";
01706 INSERT_ITEM_DOUBLE("position.y.constValue","composante constante de la position (pos = pourcentage*variable+constante)",FALSE,-1024,1024,&face->position.y.constValue);
01707 INSERT_DOUBLE;
01708 elemTree.hParent = hParentItem2;
01709 }
01710 if (face->position.z.IsDynamic())
01711 message.Format("position.z: %.2lf * %.2lf + %.2lf = %.2lf",face->position.z.percentValue,*face->position.z.baseValue,face->position.z.constValue,face->computePosition.z);
01712 else message.Format("position.z: %.2lf",face->position.z.constValue);
01713 INSERT_ITEM;
01714 {
01715 elemTree.hParent = hParentItem;
01716 if (face->position.z.IsDynamic())
01717 {
01718 message="percent: \t";
01719 INSERT_ITEM_DOUBLE("position.z.percentValue","composante pourcentage de la taille (taille = pourcentage*base+constante)",FALSE,-0.5,0.5,&face->position.z.percentValue);
01720 INSERT_DOUBLE;
01721 message="base: \t";
01722 INSERT_ITEM_DOUBLE("position.z.baseValue","composante pourcentage de la taille (taille = pourcentage*base+constante)",FALSE,-1024,1024,face->position.z.baseValue);
01723 INSERT_DOUBLE;
01724 }
01725 message="const: \t";
01726 INSERT_ITEM_DOUBLE("position.z.constValue","composante constante de la position (pos = pourcentage*variable+constante)",FALSE,-1024,1024,&face->position.z.constValue);
01727 INSERT_DOUBLE;
01728 elemTree.hParent = hParentItem2;
01729 }
01730 elemTree.hParent = NULL;
01731 }
01732 message="Size";
01733 INSERT_ITEM;
01734 {
01735 hParentItem2 = hParentItem;
01736 elemTree.hParent = hParentItem;
01737 if (face->size.x.IsDynamic())
01738 message.Format("size.x: %.2lf * %.2lf + %.2lf = %.2lf",face->size.x.percentValue,*face->size.x.baseValue,face->size.x.constValue,face->computeSize.x);
01739 else message.Format("size.x: %.2lf",face->size.x.constValue);
01740
01741 INSERT_ITEM;
01742 {
01743 elemTree.hParent = hParentItem;
01744 if (face->size.x.IsDynamic())
01745 {
01746 message="percent: \t";
01747 INSERT_ITEM_DOUBLE("size.x.percentValue","composante pourcentage de la taille (taille = pourcentage*base+constante)",FALSE,0,1,&face->size.x.percentValue);
01748 INSERT_DOUBLE;
01749 message="base: \t";
01750 INSERT_ITEM_DOUBLE("size.x.baseValue","composante pourcentage de la taille (taille = pourcentage*base+constante)",FALSE,0,2048,face->size.x.baseValue);
01751 INSERT_DOUBLE;
01752 }
01753 message="const: \t";
01754 INSERT_ITEM_DOUBLE("size.x.constValue","composante constante de la taille (taille = pourcentage*base+constante)",FALSE,0,2048,&face->size.x.constValue);
01755 INSERT_DOUBLE;
01756 elemTree.hParent = hParentItem2;
01757 }
01758 if (face->size.y.IsDynamic())
01759 message.Format("size.y: %.2lf * %.2lf + %.2lf = %.2lf",face->size.y.percentValue,*face->size.y.baseValue,face->size.y.constValue,face->computeSize.y);
01760 else message.Format("size.y: %.2lf",face->size.y.constValue);
01761 INSERT_ITEM;
01762 {
01763 elemTree.hParent = hParentItem;
01764 if (face->size.y.IsDynamic())
01765 {
01766 message="percent: \t";
01767 INSERT_ITEM_DOUBLE("size.y.percentValue","composante pourcentage de la taille (taille = pourcentage*base+constante)",FALSE,0,1,&face->size.y.percentValue);
01768 INSERT_DOUBLE;
01769 message="base: \t";
01770 INSERT_ITEM_DOUBLE("size.y.baseValue","composante pourcentage de la taille (taille = pourcentage*base+constante)",FALSE,0,2048,face->size.y.baseValue);
01771 INSERT_DOUBLE;
01772 }
01773 message="const: \t";
01774 INSERT_ITEM_DOUBLE("size.y.constValue","composante constante de la taille (taille = pourcentage*variable+constante)",FALSE,0,2048,&face->size.y.constValue);
01775 INSERT_DOUBLE;
01776 elemTree.hParent = hParentItem2;
01777 }
01778 elemTree.hParent = NULL;
01779 }
01780 message.Format("Scale [x,y,z]: %.3lf , %.3lf , %.3lf",face->scale.x,face->scale.y,face->scale.z);
01781 INSERT_ITEM;
01782 {
01783 elemTree.hParent = hParentItem;
01784 message="x: \t";
01785 INSERT_ITEM_DOUBLE("scale.x","zoom en x",FALSE,0.25,4,&face->scale.x);
01786 INSERT_DOUBLE;
01787 message="y: \t";
01788 INSERT_ITEM_DOUBLE("scale.y","zoom en y",FALSE,0.25,4,&face->scale.y);
01789 INSERT_DOUBLE;
01790 message="z: \t";
01791 INSERT_ITEM_DOUBLE("scale.z","zoom en z",FALSE,0.25,4,&face->scale.z);
01792 INSERT_DOUBLE;
01793 elemTree.hParent = NULL;
01794 }
01795 message="Material";
01796 INSERT_ITEM;
01797 {
01798 hParentItem2 = hParentItem;
01799 elemTree.hParent = hParentItem;
01800 message="typeFace: \t";
01801 INSERT_ITEM_INT("typeFace","Type deface consernée",FALSE,0,-1,&face->material.typeFace);
01802 VE_int_cur.elem.AddSpecial(GL_FRONT_AND_BACK,"front&back");
01803 VE_int_cur.elem.AddSpecial(GL_FRONT,"front");
01804 VE_int_cur.elem.AddSpecial(GL_BACK,"back");
01805 INSERT_INT;
01806
01807 message="ambient: ";
01808 face->material.ambient.ToString(message);
01809 INSERT_ITEM;
01810 {
01811 elemTree.hParent = hParentItem;
01812 message="enable: \t";
01813 INSERT_ITEM_INT("material.ambient.enable","enable l'utilisation des coureurs",FALSE,0,1,&face->material.ambient.isEnable);
01814 INSERT_INT;
01815 message="r: \t";
01816 INSERT_ITEM_FLOAT("material.ambient.r","Composante rouge",FALSE,0,1,&face->material.ambient.r);
01817 INSERT_FLOAT;
01818 message="g: \t";
01819 INSERT_ITEM_FLOAT("material.ambient.g","Composante verte",FALSE,0,1,&face->material.ambient.g);
01820 INSERT_FLOAT;
01821 message="b: \t";
01822 INSERT_ITEM_FLOAT("material.ambient.b","Composante bleu",FALSE,0,1,&face->material.ambient.b);
01823 INSERT_FLOAT;
01824 message="a: \t";
01825 INSERT_ITEM_FLOAT("material.ambient.a","Composante alpha (pour blending)",FALSE,0,1,&face->material.ambient.a);
01826 INSERT_FLOAT;
01827 elemTree.hParent = hParentItem2;
01828 }
01829
01830 message="diffuse: ";
01831 face->material.diffuse.ToString(message);
01832 INSERT_ITEM;
01833 {
01834 elemTree.hParent = hParentItem;
01835 message="enable: \t";
01836 INSERT_ITEM_INT("material.diffuse.enable","enable l'utilisation des couleurs",FALSE,0,1,&face->material.diffuse.isEnable);
01837 INSERT_INT;
01838 message="r: \t";
01839 INSERT_ITEM_FLOAT("material.diffuse.r","Composante rouge",FALSE,0,1,&face->material.diffuse.r);
01840 INSERT_FLOAT;
01841 message="g: \t";
01842 INSERT_ITEM_FLOAT("material.diffuse.g","Composante verte",FALSE,0,1,&face->material.diffuse.g);
01843 INSERT_FLOAT;
01844 message="b: \t";
01845 INSERT_ITEM_FLOAT("material.diffuse.b","Composante bleu",FALSE,0,1,&face->material.diffuse.b);
01846 INSERT_FLOAT;
01847 message="a: \t";
01848 INSERT_ITEM_FLOAT("material.diffuse.a","Composante alpha (pour blending)",FALSE,0,1,&face->material.diffuse.a);
01849 INSERT_FLOAT;
01850 elemTree.hParent = hParentItem2;
01851 }
01852
01853 message="specular: ";
01854 face->material.specular.ToString(message);
01855 INSERT_ITEM;
01856 {
01857 elemTree.hParent = hParentItem;
01858 message="enable: \t";
01859 INSERT_ITEM_INT("material.specular.enable","enable l'utilisation des couleurs",FALSE,0,1,&face->material.specular.isEnable);
01860 INSERT_INT;
01861 message="r: \t";
01862 INSERT_ITEM_FLOAT("material.specular.r","Composante rouge",FALSE,0,1,&face->material.specular.r);
01863 INSERT_FLOAT;
01864 message="g: \t";
01865 INSERT_ITEM_FLOAT("material.specular.g","Composante verte",FALSE,0,1,&face->material.specular.g);
01866 INSERT_FLOAT;
01867 message="b: \t";
01868 INSERT_ITEM_FLOAT("material.specular.b","Composante bleu",FALSE,0,1,&face->material.specular.b);
01869 INSERT_FLOAT;
01870 message="a: \t";
01871 INSERT_ITEM_FLOAT("material.specular.a","Composante alpha (pour blending)",FALSE,0,1,&face->material.specular.a);
01872 INSERT_FLOAT;
01873 elemTree.hParent = hParentItem2;
01874 }
01875
01876 message="emission: ";
01877 face->material.emission.ToString(message);
01878 INSERT_ITEM;
01879 {
01880 elemTree.hParent = hParentItem;
01881 message="enable: \t";
01882 INSERT_ITEM_INT("material.emission.enable","enable l'utilisation des couleurs",FALSE,0,1,&face->material.emission.isEnable);
01883 INSERT_INT;
01884 message="r: \t";
01885 INSERT_ITEM_FLOAT("material.emission.r","Composante rouge",FALSE,0,1,&face->material.emission.r);
01886 INSERT_FLOAT;
01887 message="g: \t";
01888 INSERT_ITEM_FLOAT("material.emission.g","Composante verte",FALSE,0,1,&face->material.emission.g);
01889 INSERT_FLOAT;
01890 message="b: \t";
01891 INSERT_ITEM_FLOAT("material.emission.b","Composante bleu",FALSE,0,1,&face->material.emission.b);
01892 INSERT_FLOAT;
01893 message="a: \t";
01894 INSERT_ITEM_FLOAT("material.emission.a","Composante alpha (pour blending)",FALSE,0,1,&face->material.emission.a);
01895 INSERT_FLOAT;
01896 elemTree.hParent = hParentItem2;
01897 }
01898
01899 message<<clear<<"shiness [enable,value]: "<<face->material.shiness.isEnable<<" , "<<face->material.shiness.elem;
01900 INSERT_ITEM;
01901 {
01902 elemTree.hParent = hParentItem;
01903 message="enable: \t";
01904 INSERT_ITEM_INT("material.shiness.enable","enable l'utilisation de la luminosité",FALSE,0,1,&face->material.shiness.isEnable);
01905 INSERT_INT;
01906 message="value: \t";
01907 INSERT_ITEM_INT("material.shiness.value","luminosité",FALSE,0,128,&face->material.shiness.elem);
01908 INSERT_INT;
01909 elemTree.hParent = hParentItem2;
01910 }
01911 elemTree.hParent = NULL;
01912 }
01913 message="Texture";
01914 if (face->texture)
01915 { message<<" [id,name]: "<<face->texture->id<<" , "<<face->texture->name;
01916 INSERT_ITEM;
01917 {
01918 hParentItem2 = hParentItem;
01919 elemTree.hParent = hParentItem;
01920 message="id: \t";
01921 INSERT_ITEM_INT("texture.id","Numero de la texture",IS_TEXTURE,0,15,&face->texture->id);
01922 VE_int_cur.elem.AddSpecial(0,"not use");
01923 INSERT_INT;
01924 elemTree.hParent = NULL;
01925 }
01926 }
01927 return TRUE;
01928 }
01929
01930 ValueEditors valueEditors;
01931
01932 LRESULT WINAPI DebugStructProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
01933 {
01934 static HWND hWndTreeStruct;
01935 static HWND hWndTreeElem;
01936 static FaceNode *node;
01937 static ParamValueEditor *param;
01938 static HWND hWndValueEditor;
01939 static RECT rect;
01940 static BOOL mode_control_enable;
01941 if (param) valueEditors.Update(param->object);
01942
01943 switch(message)
01944 {
01945 case WM_INITDIALOG:
01946 param=NULL;
01947 hWndValueEditor=NULL;
01948 GetWindowRect(hDlg,&rect);
01949 hWndTreeStruct = GetDlgItem(hDlg,IDC_TREE_STRUCT);
01950 hWndTreeElem = GetDlgItem(hDlg,IDC_TREE_ELEM);
01951 Button_SetCheck(GetDlgItem(hDlg,IDC_RADIO_FACEMODE),TRUE);
01952
01953 mode_control_enable = FALSE;
01954 valueEditors.MakeDebugFaceStruct(hWndTreeStruct);
01955 node = ce.primitive.tree.GetRoot();
01956 valueEditors.MakeElemFaceStruct(hWndTreeElem,node);
01957 TreeView_ExpandAll_Level(hWndTreeStruct,TRUE,2);
01958 TreeView_ExpandAll_Level(hWndTreeElem,TRUE,2);
01959 return TRUE;
01960
01961 case WM_MOVE:
01962 {
01963 int deltaX = -rect.left;
01964 int deltaY = -rect.top;
01965 GetWindowRect(hDlg,&rect);
01966 deltaX+=rect.left;
01967 deltaY+=rect.top;
01968
01969 if (param&&(!param->independant))
01970 {
01971 RECT rectElem;
01972 GetWindowRect(GetDlgItem(hDlg,IDC_TREE_ELEM),&rectElem);
01973 SetDeltaWindowPos(hWndValueEditor,deltaX,deltaY);
01974 }
01975 }
01976 return TRUE;
01977
01978 case WM_COMMAND:
01979 switch (LOWORD(wParam))
01980 {
01981 case IDOK:
01982 case IDCANCEL:
01983 EndDialog(hWndValueEditor,LOWORD(wParam));
01984 EndDialog(hDlg, LOWORD(wParam));
01985 return TRUE;
01986
01987 case IDC_RADIO_FACE_MODE:
01988 mode_control_enable = FALSE;
01989 TreeView_DeleteAllItems(hWndTreeStruct);
01990 TreeView_DeleteAllItems(hWndTreeElem);
01991 valueEditors.MakeDebugFaceStruct(hWndTreeStruct);
01992 node = ce.primitive.tree.GetRoot();
01993 valueEditors.MakeElemFaceStruct(hWndTreeElem,node);
01994 TreeView_ExpandAll_Level(hWndTreeStruct,TRUE,2);
01995 TreeView_ExpandAll_Level(hWndTreeElem,TRUE,2);
01996 break;
01997
01998 case IDC_RADIO_CONTROLS_MODE:
01999 mode_control_enable = TRUE;
02000 TreeView_DeleteAllItems(hWndTreeStruct);
02001 TreeView_DeleteAllItems(hWndTreeElem);
02002 valueEditors.MakeDebugControlStruct(hWndTreeStruct);
02003 node = ce.primitive.tree.GetRoot();
02004 valueEditors.MakeElemControlStruct(hWndTreeElem,ce.masterContainer);
02005 TreeView_ExpandAll_Level(hWndTreeStruct,TRUE,2);
02006 TreeView_ExpandAll_Level(hWndTreeElem,TRUE,2);
02007 break;
02008 }
02009 break;
02010
02011 case WM_NCMOUSEMOVE:
02012 case WM_MOUSEMOVE:
02013 ShowMouse(TRUE);
02014 return TRUE;
02015
02016 case WM_NOTIFY:
02017 {
02018 int numSelectedControl;
02019 int numSelectedFace;
02020 LPNMHDR pnmh = (LPNMHDR) lParam;
02021 LPNMTREEVIEW pnmtv = (LPNMTREEVIEW) lParam;
02022 switch (wParam)
02023 {
02024 case IDC_TREE_STRUCT:
02025 switch (pnmh->code)
02026 {
02027 case TVN_SELCHANGED:
02028 {
02029 LPARAM param =pnmtv->itemNew.lParam;
02030 numSelectedControl = LOWORD(param);
02031 numSelectedFace = HIWORD(param);
02032 if ((numSelectedFace&0x8000)==0x8000)
02033 numSelectedFace-=0x10000;
02034 }
02035 switch(numSelectedControl)
02036 {
02037 case NUM_SELECTED_RENDER:
02038 TreeView_DeleteAllItems(hWndTreeElem);
02039 valueEditors.MakeRenderStruct(hWndTreeElem);
02040 TreeView_ExpandAll_Level(hWndTreeElem,TRUE,2);
02041 break;
02042 case NUM_SELECTED_LIGHT:
02043 TreeView_DeleteAllItems(hWndTreeElem);
02044 valueEditors.MakeLightsStruct(hWndTreeElem);
02045 TreeView_ExpandAll_Level(hWndTreeElem,TRUE,2);
02046 break;
02047 case NUM_SELECTED_FONT:
02048 TreeView_DeleteAllItems(hWndTreeElem);
02049 valueEditors.MakeFontsStruct(hWndTreeElem);
02050 TreeView_ExpandAll_Level(hWndTreeElem,TRUE,2);
02051 break;
02052 case NUM_SELECTED_TEXTURE:
02053 TreeView_DeleteAllItems(hWndTreeElem);
02054 valueEditors.MakeTexturesStruct(hWndTreeElem);
02055 TreeView_ExpandAll_Level(hWndTreeElem,TRUE,2);
02056 break;
02057 case NUM_SELECTED_PICKING:
02058 case NUM_SELECTED_NOTHING:
02059 TreeView_DeleteAllItems(hWndTreeElem);
02060 TreeView_ExpandAll_Level(hWndTreeElem,TRUE,2);
02061 break;
02062 default:
02063 if (mode_control_enable)
02064 {
02065 Control *control = Control::Find(numSelectedControl);
02066 TreeView_DeleteAllItems(hWndTreeElem);
02067 valueEditors.MakeElemControlStruct(hWndTreeElem,control);
02068 TreeView_ExpandAll_Level(hWndTreeElem,TRUE,2);
02069 }
02070 else
02071 {
02072 node = ce.primitive.Find(numSelectedControl,numSelectedFace);
02073 TreeView_DeleteAllItems(hWndTreeElem);
02074 valueEditors.MakeElemFaceStruct(hWndTreeElem,node);
02075 TreeView_ExpandAll_Level(hWndTreeElem,TRUE,2);
02076 }
02077 }
02078 }
02079 break;
02080 case IDC_TREE_ELEM:
02081 switch (pnmh->code)
02082 {
02083 case TVN_SELCHANGED:
02084 int num = (int)pnmtv->itemNew.lParam;
02085
02086 if (param&¶m->independant) param=NULL;
02087 if (!param)
02088 {
02089 param = new ParamValueEditor;
02090 param->hWndParent = hDlg;
02091 param->independant = FALSE;
02092 param->object = NULL;
02093 hWndValueEditor = CreateDialogParam(ce.hInst,MAKEINTRESOURCE(IDD_VALUE_EDITOR),NULL,(DLGPROC)ValueEditorProc,(LPARAM)param);
02094 ShowWindow(hWndValueEditor,SW_SHOW);
02095 RECT rectElem;
02096 GetWindowRect(GetDlgItem(hDlg,IDC_TREE_ELEM),&rectElem);
02097 SetDeltaWindowPos(hWndValueEditor,rectElem.left,rectElem.bottom);
02098 }
02099 if (num)
02100 {
02101 param->object = valueEditors.list.i(num-1);
02102 valueEditors.Update(param->object);
02103
02104 MyString title;
02105 switch(param->object->type)
02106 {
02107 case CBASE_INDEX_INT:
02108 title<<"Value: "<<valueEditors.VE_int->elem.variable<<" - "<<node->elem->name;
02109 valueEditors.VE_int->elem.MAJ(hWndValueEditor);
02110 break;
02111 case CBASE_INDEX_FLOAT:
02112 title<<"Value: "<<valueEditors.VE_float->elem.variable<<" - "<<node->elem->name;
02113 valueEditors.VE_float->elem.MAJ(hWndValueEditor);
02114 break;
02115 case CBASE_INDEX_DOUBLE:
02116 title<<"Value: "<<valueEditors.VE_double->elem.variable<<" - "<<node->elem->name;
02117 valueEditors.VE_double->elem.MAJ(hWndValueEditor);
02118 break;
02119 }
02120 SetWindowText(hWndValueEditor,title);
02121 }
02122 else
02123 {
02124 param->object = NULL;
02125 ValueEditor<GLint> *temp=NULL;
02126 temp->MAJ(hWndValueEditor);
02127 }
02128
02129 }
02130 break;
02131 }
02132 }
02133 break;
02134 }
02135 return FALSE;
02136 }
02137
02138 void ApplyParamObj(LONG type)
02139 {
02140 switch(type)
02141 {
02142 case IS_FOG: ce.fog.Use(); break;
02143 case IS_LIGHT: ce.MajLights(); break;
02144 default:
02145 if (type>=IS_TEXTURE)
02146 {
02147 int num = type-IS_TEXTURE;
02148 Texture::list.i[num]->Config();
02149 }
02150 }
02151 }
02152
02156 LRESULT WINAPI ValueEditorProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
02157 {
02158 ParamValueEditor *param = (ParamValueEditor *) GetWindowLongPtr (hDlg,GWLP_USERDATA);
02159
02160 BOOL activeParam = param&¶m->object;
02161 if (activeParam) valueEditors.Update(param->object);
02162
02163 switch (message)
02164 {
02165 case WM_INITDIALOG:
02166 param = (ParamValueEditor *) lParam;
02167 SetWindowLongPtr (hDlg, GWLP_USERDATA , (LONG_PTR)param);
02168 if (param) GetWindowRect(hDlg,¶m->rect);
02169 return TRUE;
02170
02171 case WM_SIZE:
02172 {
02173 if (!param) return TRUE;
02174 int deltaX,deltaY;
02175 GetDeltaWindow(hDlg,¶m->rect,&deltaX,&deltaY);
02176 SetDeltaWindowSize(GetDlgItem(hDlg,IDC_STATIC_VARIABLE),deltaX,deltaY);
02177 SetDeltaWindowSize(GetDlgItem(hDlg,IDC_EDIT_VALUE),deltaX,0);
02178 SetDeltaWindowPos(GetDlgItem(hDlg,IDC_EDIT_VALUE),0,deltaY);
02179 SetDeltaWindowPos(GetDlgItem(hDlg,IDC_COMBO_SPECIALS),0,deltaY);
02180 SetDeltaWindowSize(GetDlgItem(hDlg,IDC_COMBO_SPECIALS),deltaX,0);
02181 SetDeltaWindowPos(GetDlgItem(hDlg,IDC_STATIC1),0,deltaY);
02182 SetDeltaWindowPos(GetDlgItem(hDlg,IDC_STATIC2),0,deltaY);
02183 SetDeltaWindowPos(GetDlgItem(hDlg,IDC_BUTTON_MIN),deltaX,deltaY);
02184 SetDeltaWindowPos(GetDlgItem(hDlg,IDC_BUTTON_MIDS),deltaX,deltaY);
02185 SetDeltaWindowPos(GetDlgItem(hDlg,IDC_BUTTON_MAX),deltaX,deltaY);
02186 SetDeltaWindowPos(GetDlgItem(hDlg,IDC_BUTTON_MOVE),deltaX,deltaY);
02187 SetDeltaWindowPos(GetDlgItem(hDlg,IDC_SLIDER_PAD),0,deltaY);
02188 SetDeltaWindowSize(GetDlgItem(hDlg,IDC_SLIDER_PAD),deltaX,0);
02189 InvalidateRect(hDlg,NULL,TRUE);
02190 }
02191 return TRUE;
02192
02193 case WM_HSCROLL:
02194 if (!activeParam) break;
02195 if ((HWND)lParam==GetDlgItem(hDlg,IDC_SLIDER_PAD))
02196 {
02197 int xPos;
02198 switch (LOWORD(wParam))
02199 {
02200 case SB_THUMBTRACK:
02201 xPos = HIWORD(wParam);
02202 float xValue = xPos/100.0f;
02203 if (param->object)
02204 {
02205 GLint valueInt;
02206 GLdouble valueDouble;
02207 GLfloat valueFloat;
02208 switch (param->object->type)
02209 {
02210 case CBASE_INDEX_INT:
02211 valueInt=valueEditors.VE_int->elem.minValue+(GLint)(xValue*(valueEditors.VE_int->elem.maxValue-valueEditors.VE_int->elem.minValue));
02212 valueEditors.VE_int->elem.MAJ_Value(hDlg,valueInt);
02213 break;
02214 case CBASE_INDEX_FLOAT:
02215 valueFloat=valueEditors.VE_float->elem.minValue+xValue*(valueEditors.VE_float->elem.maxValue-valueEditors.VE_float->elem.minValue);
02216 valueEditors.VE_float->elem.MAJ_Value(hDlg,valueFloat);
02217 break;
02218 case CBASE_INDEX_DOUBLE:
02219 valueDouble=valueEditors.VE_double->elem.minValue+xValue*(valueEditors.VE_double->elem.maxValue-valueEditors.VE_double->elem.minValue);
02220 valueEditors.VE_double->elem.MAJ_Value(hDlg,valueDouble);
02221 break;
02222 }
02223 ApplyParamObj(param->object->param);
02224 }
02225 break;
02226 }
02227 }
02228 break;
02229
02230 case WM_NCMOUSEMOVE:
02231 case WM_MOUSEMOVE:
02232 ShowMouse(TRUE);
02233 return TRUE;
02234
02235 case WM_COMMAND:
02236 switch (LOWORD(wParam))
02237 {
02238 case IDOK:
02239 case IDCANCEL: EndDialog(hDlg, LOWORD(wParam)); return TRUE;
02240 case IDC_COMBO_SPECIALS:
02241 if (!activeParam) break;
02242 switch (HIWORD(wParam))
02243 {
02244 case LBN_SELCHANGE :
02245 {
02246 int num = ComboBox_GetCurSel(GetDlgItem(hDlg,IDC_COMBO_SPECIALS));
02247 switch (param->object->type) {
02248 case CBASE_INDEX_INT: valueEditors.VE_int->elem.MAJ_Specials(hDlg,num-1); break;
02249 case CBASE_INDEX_FLOAT: valueEditors.VE_float->elem.MAJ_Specials(hDlg,num-1); break;
02250 case CBASE_INDEX_DOUBLE: valueEditors.VE_double->elem.MAJ_Specials(hDlg,num-1); break;
02251 }
02252 ApplyParamObj(param->object->param);
02253 }
02254 return TRUE;
02255 }
02256 break;
02257
02258 case IDC_BUTTON_MIN:
02259 if (!activeParam) break;
02260 switch (param->object->type) {
02261 case CBASE_INDEX_INT: valueEditors.VE_int->elem.MAJ_ValueMin(hDlg); break;
02262 case CBASE_INDEX_FLOAT: valueEditors.VE_float->elem.MAJ_ValueMin(hDlg); break;
02263 case CBASE_INDEX_DOUBLE: valueEditors.VE_double->elem.MAJ_ValueMin(hDlg); break;
02264 }
02265 ApplyParamObj(param->object->param);
02266 break;
02267 case IDC_BUTTON_MAX:
02268 if (!activeParam) break;
02269 switch (param->object->type) {
02270 case CBASE_INDEX_INT: valueEditors.VE_int->elem.MAJ_ValueMax(hDlg); break;
02271 case CBASE_INDEX_FLOAT: valueEditors.VE_float->elem.MAJ_ValueMax(hDlg); break;
02272 case CBASE_INDEX_DOUBLE: valueEditors.VE_double->elem.MAJ_ValueMax(hDlg); break;
02273 }
02274 ApplyParamObj(param->object->param);
02275 break;
02276 case IDC_BUTTON_MIDS:
02277 if (!activeParam) break;
02278 switch (param->object->type) {
02279 case CBASE_INDEX_INT: valueEditors.VE_int->elem.MAJ_ValueMids(hDlg); break;
02280 case CBASE_INDEX_FLOAT: valueEditors.VE_float->elem.MAJ_ValueMids(hDlg); break;
02281 case CBASE_INDEX_DOUBLE: valueEditors.VE_double->elem.MAJ_ValueMids(hDlg); break;
02282 }
02283 ApplyParamObj(param->object->param);
02284 break;
02285 case IDC_EDIT_VALUE:
02286 if (!activeParam) break;
02287 switch (param->object->type) {
02288 case CBASE_INDEX_INT: valueEditors.VE_int->elem.Get_Value(hDlg); valueEditors.VE_int->elem.MAJ_Specials(hDlg); valueEditors.VE_int->elem.MAJ_Slider(hDlg); valueEditors.VE_int->elem.MAJ_TreeItem(param->hWndParent); break;
02289 case CBASE_INDEX_FLOAT: valueEditors.VE_float->elem.Get_Value(hDlg); valueEditors.VE_float->elem.MAJ_Specials(hDlg); valueEditors.VE_float->elem.MAJ_Slider(hDlg); valueEditors.VE_float->elem.MAJ_TreeItem(param->hWndParent); break;
02290 case CBASE_INDEX_DOUBLE: valueEditors.VE_double->elem.Get_Value(hDlg); valueEditors.VE_double->elem.MAJ_Specials(hDlg); valueEditors.VE_double->elem.MAJ_Slider(hDlg); valueEditors.VE_double->elem.MAJ_TreeItem(param->hWndParent); break;
02291 }
02292 ApplyParamObj(param->object->param);
02293 break;
02294 case IDC_BUTTON_MOVE:
02295 if (!activeParam) break;
02296 param->independant = TRUE;
02297 Button_Enable(GetDlgItem(hDlg,IDC_BUTTON_MOVE),FALSE);
02298 ParamValueEditor *paramIndependant = param->GetCopy();
02299 SetWindowLongPtr(hDlg, GWLP_USERDATA , (LONG_PTR)paramIndependant);
02300 break;
02301 }
02302 break;
02303 }
02304 return FALSE;
02305 }