Subversion Repositories Kolibri OS

Rev

Rev 6022 | Rev 6060 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2165 IgorA 1
;
2
; в этом файле собраны функции нужные для создания и
5935 IgorA 3
; работы окна с координатами вершин
2165 IgorA 4
;
5
 
5938 IgorA 6
prop_wnd_width  equ 340 ;ширина окна со свойствами объекта
7
prop_wnd_height equ 460 ;высота окна со свойствами объекта
8
3d_wnd_l equ   5 ;отступ для tinygl буфера слева
9
3d_wnd_t equ  23 ;отступ для tinygl буфера сверху
10
3d_wnd_w equ 320
11
3d_wnd_h equ 240
2165 IgorA 12
SIZE_ONE_FLOAT equ 14
13
MAX_OBJECT_SIZE equ (4+SIZE_ONE_FLOAT*3+1)
14
 
15
prop_wnd_run db 0 ;переменная следящая за тем что-бы не запускать больше 1-го окна со свойствами одновременно
16
 
2173 IgorA 17
txt_q db '?',0
2165 IgorA 18
txt_space:
19
	db SIZE_ONE_FLOAT dup(' ')
20
.end:
21
	db 0
22
 
23
obj_point: ;добавляемый объект
24
	dd 0   ;указатель
25
.text:
26
	rb MAX_OBJECT_SIZE
27
 
5944 IgorA 28
if lang eq ru
29
txt_select_vert: db 'Выбрано: '
30
else
31
txt_select_vert: db 'Select: '
32
end if
33
.count:
34
dq 0,0
2165 IgorA 35
 
36
;даное окно (процесс) вызываеться функцией but_wnd_coords
37
align 4
38
prop_start:
39
pushad
40
	mcall 40,0x27 ;маска ожидаемых событий
41
	inc byte[prop_wnd_run]
5930 IgorA 42
	mov dword[w_scr_t3.type],1
6046 IgorA 43
	mov edi,o3d
44
	stdcall obj_clear_param, edi
2165 IgorA 45
 
46
	stdcall [tl_node_get_data],tree1
47
	xor edx,edx
4332 IgorA 48
	mov dword[capt_p],txt_q
5911 IgorA 49
	cmp eax,0
4332 IgorA 50
	je .no_points
5935 IgorA 51
		mov ebx,[eax] ;получаем значение сдвига выбранного блока
5938 IgorA 52
		add ebx,[open_file_data]
2165 IgorA 53
 
5938 IgorA 54
		cmp word[ebx],CHUNK_OBJBLOCK
55
		jne .end_oblo
56
			mov dword[capt_p],txt_4000
5944 IgorA 57
			stdcall found_block_data, tree1
5938 IgorA 58
			cmp eax,0
59
			je .no_points
60
			mov esi,eax
61
			movzx ecx,byte[esi+2] ;cl - уровень выбранного узла
62
			.cycle_0:
63
				stdcall [tl_node_poi_get_next_info], tree1,esi
64
				cmp eax,0
65
				je .no_points
66
				cmp byte[eax+2],cl
67
				jle .no_points
68
				mov esi,eax
69
				stdcall [tl_node_poi_get_data], tree1,esi
70
				mov ebx,[eax]
71
				add ebx,[open_file_data]
72
				cmp word[ebx],CHUNK_VERTLIST
73
				je .ini_vlist
74
				jmp .cycle_0
75
			jmp .no_points
76
		.end_oblo:
77
		cmp word[ebx],CHUNK_TRIMESH
78
		jne .end_trim
79
			mov dword[capt_p],txt_4100
5944 IgorA 80
			stdcall found_block_data, tree1
5938 IgorA 81
			cmp eax,0
82
			je .no_points
83
			mov esi,eax
84
			movzx ecx,byte[esi+2] ;cl - уровень выбранного узла
85
			.cycle_1:
86
				stdcall [tl_node_poi_get_next_info], tree1,esi
87
				cmp eax,0
88
				je .no_points
89
				cmp byte[eax+2],cl
90
				jle .no_points
91
				mov esi,eax
92
				stdcall [tl_node_poi_get_data], tree1,esi
93
				mov ebx,[eax]
94
				add ebx,[open_file_data]
95
				cmp word[ebx],CHUNK_VERTLIST
96
				je .ini_vlist
97
				jmp .cycle_1
98
			jmp .no_points
99
		.end_trim:
4332 IgorA 100
		cmp word[ebx],CHUNK_VERTLIST
5935 IgorA 101
		jne .end_vlist
5938 IgorA 102
			mov dword[capt_p],txt_4110
103
			.ini_vlist:
4332 IgorA 104
			movzx edx,word[ebx+6] ;колличество точек
105
			add ebx,8
5935 IgorA 106
			;поиск данных для треугольков
5944 IgorA 107
			stdcall found_block_data, tree1
5938 IgorA 108
			cmp eax,0
109
			je .set_points
110
			mov esi,eax
5935 IgorA 111
			;если нашли выбранный узел, то далее пытаемся найти узел с треугольниками
112
			movzx ecx,byte[esi+2] ;cl - уровень выбранного узла
5938 IgorA 113
			.cycle_2:
5935 IgorA 114
				stdcall [tl_node_poi_get_next_info], tree1,esi
115
				cmp eax,0
116
				je .set_points
117
				mov esi,eax
118
				stdcall [tl_node_poi_get_data], tree1,esi
119
				cmp byte[esi+2],cl
120
				jl .set_points
121
				je .found
5938 IgorA 122
				jmp .cycle_2
5935 IgorA 123
			.found: ;если нашли узел тогоже уровня что и выбранный узел
124
				cmp eax,0
125
				je .set_points
126
				mov eax,[eax]
5938 IgorA 127
				add eax,[open_file_data]
5935 IgorA 128
				cmp word[eax],CHUNK_FACELIST
5938 IgorA 129
				jne .cycle_2
5935 IgorA 130
				movzx ecx,word[eax+6]
6046 IgorA 131
				mov [edi+offs_obj_tri_count],ecx
5935 IgorA 132
				add eax,8 ;2+4+2 (chunk+size+count)
6046 IgorA 133
				mov [edi+offs_obj_tri_data],eax
5935 IgorA 134
			jmp .set_points
135
		.end_vlist:
136
		cmp word[ebx],CHUNK_TRACKPIVOT
4332 IgorA 137
		jne @f
138
			inc edx
139
			add ebx,6
140
			mov dword[capt_p],txt_b013
5935 IgorA 141
			jmp .set_points
4332 IgorA 142
		@@:
143
		cmp word[ebx],0xb014
144
		jne @f
145
			mov edx,2
146
			add ebx,6
147
			mov dword[capt_p],txt_b014
5935 IgorA 148
			;jmp .set_points
4332 IgorA 149
		@@:
5935 IgorA 150
		.set_points:
6046 IgorA 151
		mov [edi+offs_obj_poi_data],ebx
152
		mov [edi+offs_obj_poi_count],edx
4332 IgorA 153
	.no_points:
154
 
2165 IgorA 155
	;настройка списка объектов
156
	mov dword[tree3.info_max_count],2
157
	add dword[tree3.info_max_count],edx ;ставим число узлов, равное колличеству точек (+2 на начало и конец списка)
158
	stdcall dword[tl_data_init], tree3
159
	mov eax,dword[icon_tl_sys]
160
	mov dword[tree3.data_img_sys],eax
161
	mov eax,dword[icon_toolbar]
162
	mov dword[tree3.data_img],eax
163
 
4332 IgorA 164
	cmp edx,0
2165 IgorA 165
	je .no_object
2173 IgorA 166
		mov word[NumberSymbolsAD],5
2165 IgorA 167
		finit
168
		.new_point:
169
			mov dword[obj_point],ebx
170
			mov dword[obj_point.text],0
171
			cld
172
			mov ecx,3
173
			@@:
174
				fld dword[ebx]
175
				fstp qword[Data_Double]
176
				call DoubleFloat_to_String
177
				add ebx,4
178
				stdcall str_len, Data_String
179
				mov esi,txt_space
180
				add esi,eax
181
				cmp esi,txt_space.end
182
				jl .normal_size
183
					mov esi,txt_space.end-1 ;минимум 1 пробел нужно добавить, что-бы цифры не слипались
184
				.normal_size:
185
				stdcall str_cat, obj_point.text,esi
186
				stdcall str_cat, obj_point.text,Data_String
187
				loop @b
5944 IgorA 188
			stdcall dword[tl_node_add], tree3,(ID_ICON_POINT shl 16),obj_point
2165 IgorA 189
			stdcall dword[tl_cur_next], tree3
190
			dec edx
191
			cmp edx,0
192
			jg .new_point
193
			stdcall dword[tl_cur_beg], tree3
194
	.no_object:
6046 IgorA 195
	stdcall obj_set_sizes, o3d
196
	stdcall obj_set_normals, o3d
2173 IgorA 197
	edit_boxes_set_sys_color edit1,editboxes_end,sc ;установка системных цветов
198
	stdcall [edit_box_set_text], edit1, txt_q
199
	stdcall [edit_box_set_text], edit2, txt_q
200
	stdcall [edit_box_set_text], edit3, txt_q
5938 IgorA 201
	mov eax,0xc0c0c0
202
	mov ebx,[color_ox]
203
	shr ebx,2
204
	and ebx,0x3f3f3f
205
	add eax,ebx
206
	mov [edit1.color],eax
207
	mov eax,0xc0c0c0
208
	mov ebx,[color_oy]
209
	shr ebx,2
210
	and ebx,0x3f3f3f
211
	add eax,ebx
212
	mov [edit2.color],eax
213
	mov eax,0xc0c0c0
214
	mov ebx,[color_oz]
215
	shr ebx,2
216
	and ebx,0x3f3f3f
217
	add eax,ebx
218
	mov [edit3.color],eax
5944 IgorA 219
 
220
	mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
221
	mov eax,[eax] ;eax -> ZBuffer
222
	mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf
223
	mov dword[buf_ogl],eax
2165 IgorA 224
popad
225
 
5930 IgorA 226
	call prop_red_win
227
 
228
;не отрывать эту функцию от предыдущей
2165 IgorA 229
align 4
5930 IgorA 230
prop_still:
231
	pushad
232
 
5935 IgorA 233
	mcall 23,10
234
	or eax,eax
235
	jnz @f
236
		call prop_timer_funct
237
		jmp .end
238
	@@:
239
 
5930 IgorA 240
	cmp al,1 ;изм. положение окна
241
	jne @f
242
		call prop_red_win
243
		jmp .end
244
	@@:
245
	cmp al,2
246
	jne @f
247
		call prop_key
248
		jmp .end
249
	@@:
250
	cmp al,3
251
	jz prop_button
252
	cmp al,6
253
	jne @f
254
		call prop_mouse
255
	@@:
256
.end:
257
	popad
258
	jmp prop_still
259
 
260
align 4
2165 IgorA 261
prop_red_win:
262
pushad
263
	mcall 12,1
264
 
265
	xor eax,eax
4332 IgorA 266
	mov edi,dword[capt_p] ;children window caption
2165 IgorA 267
	mov bx,word[procinfo.box.left]
268
	add bx,word[buf_0.l]
5930 IgorA 269
	add bx,5 ;ширина боковой рамки
2165 IgorA 270
	shl ebx,16
271
	mov bx,prop_wnd_width
272
	mov cx,word[procinfo.box.top]
2173 IgorA 273
	add cx,word[buf_0.t]
2165 IgorA 274
	shl ecx,16
5930 IgorA 275
	mov cx,prop_wnd_height
5938 IgorA 276
	mov edx,[sc.work]
277
	or  edx,0x33000000
2165 IgorA 278
	int 0x40
279
 
2173 IgorA 280
	mov esi,[sc.work_button]
5935 IgorA 281
	mcall 8, (5 shl 16)+20, (266 shl 16)+20, 3
282
	mcall , (30 shl 16)+20, (266 shl 16)+20, 4
2173 IgorA 283
 
284
	mov ebx,[image_data_toolbar]
5938 IgorA 285
	add ebx,3*IMAGE_TOOLBAR_ICON_SIZE
5935 IgorA 286
	mcall 7, , (16 shl 16)+16, (7 shl 16)+268 ;load
2173 IgorA 287
 
288
	sub ebx,IMAGE_TOOLBAR_ICON_SIZE
5935 IgorA 289
	mov edx,(32 shl 16)+268 ;save
2173 IgorA 290
	int 0x40
291
 
2165 IgorA 292
	mov dword[w_scr_t3.all_redraw],1
293
	stdcall [scrollbar_ver_draw],dword w_scr_t3
294
	stdcall [tl_draw], tree3
2173 IgorA 295
	stdcall [edit_box_draw], edit1
296
	stdcall [edit_box_draw], edit2
297
	stdcall [edit_box_draw], edit3
5930 IgorA 298
 
5935 IgorA 299
	stdcall [kmainmenu_draw], [main_menu]
6046 IgorA 300
	stdcall draw_3d, o3d
2165 IgorA 301
	mcall 12,2
302
popad
5930 IgorA 303
	ret
2165 IgorA 304
 
305
align 4
5935 IgorA 306
proc prop_key uses eax ebx
2165 IgorA 307
	mcall 2
5930 IgorA 308
 
309
	test word [edit1.flags],10b ;ed_focus
310
	je @f
311
		stdcall [edit_box_key], edit1
312
		jmp .end
313
	@@:
314
	test word [edit2.flags],10b
315
	je @f
316
		stdcall [edit_box_key], edit2
317
		jmp .end
318
	@@:
319
	test word [edit3.flags],10b
320
	je @f
321
		stdcall [edit_box_key], edit3
322
		jmp .end
323
	@@:
5935 IgorA 324
	cmp dword[el_focus], tree3
325
	jne @f
326
		stdcall [tl_key], tree3
327
		jmp .end
328
	@@:
5930 IgorA 329
 
330
	cmp ah,178 ;Up
331
	jne @f
332
		fld dword[angle_x]
333
		fadd dword[delt_size]
334
		fstp dword[angle_x]
6046 IgorA 335
		stdcall draw_3d, o3d
5930 IgorA 336
		jmp .end
337
	@@:
338
	cmp ah,177 ;Down
339
	jne @f
340
		fld dword[angle_x]
341
		fsub dword[delt_size]
342
		fstp dword[angle_x]
6046 IgorA 343
		stdcall draw_3d, o3d
5930 IgorA 344
		jmp .end
345
	@@:
346
	cmp ah,176 ;Left
347
	jne @f
348
		fld dword[angle_y]
349
		fadd dword[delt_size]
350
		fstp dword[angle_y]
6046 IgorA 351
		stdcall draw_3d, o3d
5930 IgorA 352
		jmp .end
353
	@@:
354
	cmp ah,179 ;Right
355
	jne @f
356
		fld dword[angle_y]
357
		fsub dword[delt_size]
358
		fstp dword[angle_y]
6046 IgorA 359
		stdcall draw_3d, o3d
5930 IgorA 360
		;jmp .end
361
	@@:
362
	.end:
2165 IgorA 363
	ret
5935 IgorA 364
endp
2165 IgorA 365
 
366
align 4
367
prop_mouse:
5938 IgorA 368
	push eax ebx
369
	mcall 37,3
370
	bt eax,0
371
	jnc .end_m
372
		;mouse l. but. move
373
		cmp dword[mouse_drag],1
374
		jne .end_m
375
		mcall 37,1 ;get mouse coords
376
		mov ebx,eax
377
		shr ebx,16 ;mouse.x
378
		cmp ebx,3d_wnd_l
379
		jg @f
380
			mov ebx,3d_wnd_l
381
		@@:
382
		sub ebx,3d_wnd_l
383
		cmp ebx,3d_wnd_w
384
		jle @f
385
			mov ebx,3d_wnd_w
386
		@@:
387
		and eax,0xffff ;mouse.y
388
		cmp eax,3d_wnd_t
389
		jg @f
390
			mov eax,3d_wnd_t
391
		@@:
392
		sub eax,3d_wnd_t
393
		cmp eax,3d_wnd_h
394
		jle @f
395
			mov eax,3d_wnd_h
396
		@@:
397
		finit
398
		fild dword[mouse_y]
399
		mov [mouse_y],eax
400
		fisub dword[mouse_y]
401
		fdiv dword[angle_dxm] ;если курсор движется по оси y (вверх или вниз) то поворот делаем вокруг оси x
402
		fadd dword[angle_x]
403
		fstp dword[angle_x]
404
 
405
		fild dword[mouse_x]
406
		mov [mouse_x],ebx
407
		fisub dword[mouse_x]
408
		fdiv dword[angle_dym] ;если курсор движется по оси x (вверх или вниз) то поворот делаем вокруг оси y
409
		fadd dword[angle_y]
410
		fstp dword[angle_y]
411
 
6046 IgorA 412
		stdcall draw_3d, o3d
5938 IgorA 413
		jmp .end_d
414
	.end_m:
415
	bt eax,16
416
	jnc @f
417
		;mouse l. but. up
418
		mov dword[mouse_drag],0
419
		jmp .end_d
420
	@@:
421
	bt eax,8
422
	jnc .end_d
423
		;mouse l. but. press
424
		mcall 37,1 ;get mouse coords
425
		mov ebx,eax
426
		shr ebx,16 ;mouse.x
427
		cmp ebx,3d_wnd_l
428
		jl .end_d
429
		sub ebx,3d_wnd_l
430
		cmp ebx,3d_wnd_w
431
		jg .end_d
432
		and eax,0xffff ;mouse.y
433
		cmp eax,3d_wnd_t
434
		jl .end_d
435
		sub eax,3d_wnd_t
436
		cmp eax,3d_wnd_h
437
		jg .end_d
438
		mov dword[mouse_drag],1
439
		mov dword[mouse_x],ebx
440
		mov dword[mouse_y],eax
441
	.end_d:
442
 
5935 IgorA 443
	stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
2165 IgorA 444
	stdcall [tl_mouse], tree3
2173 IgorA 445
	stdcall [edit_box_mouse], edit1
446
	stdcall [edit_box_mouse], edit2
447
	stdcall [edit_box_mouse], edit3
5938 IgorA 448
	pop ebx eax
2165 IgorA 449
	ret
450
 
451
align 4
452
prop_button:
453
	mcall 17 ;получить код нажатой кнопки
454
 
2173 IgorA 455
	cmp ah,3
2165 IgorA 456
	jne @f
5930 IgorA 457
		call get_point_coords
6046 IgorA 458
		stdcall draw_3d, o3d
5930 IgorA 459
		jmp prop_still.end
2165 IgorA 460
	@@:
2173 IgorA 461
	cmp ah,4
462
	jne @f
5911 IgorA 463
		push eax ebx ecx edi esi
2173 IgorA 464
		stdcall [tl_node_get_data],tree3
5911 IgorA 465
		cmp eax,0
2173 IgorA 466
		je .no_select_1
5911 IgorA 467
			mov ebx,[eax]
2173 IgorA 468
			finit
2165 IgorA 469
 
2173 IgorA 470
			mov esi,string1
471
			mov edi,Data_String
472
			cld
5930 IgorA 473
			mov ecx,8
474
			rep movsd
2173 IgorA 475
			call String_to_DoubleFloat
476
			fld  qword[Data_Double] ;считываем как double
477
			fstp dword[ebx] ;сохраняем как float
478
 
479
			mov esi,string2
480
			mov edi,Data_String
481
			cld
5930 IgorA 482
			mov ecx,8
483
			rep movsd
2173 IgorA 484
			call String_to_DoubleFloat
485
			fld  qword[Data_Double] ;считываем как double
486
			fstp dword[ebx+4] ;сохраняем как float
487
 
488
			mov esi,string3
489
			mov edi,Data_String
490
			cld
5930 IgorA 491
			mov ecx,8
492
			rep movsd
2173 IgorA 493
			call String_to_DoubleFloat
494
			fld  qword[Data_Double] ;считываем как double
495
			fstp dword[ebx+8] ;сохраняем как float
496
 
497
			;обновление измененного узла в списке tree3 и главного окна (по таймеру)
498
			mov word[NumberSymbolsAD],5
499
			mov dword[obj_point],ebx
500
			mov dword[obj_point.text],0
501
			cld
502
			mov ecx,3
503
			.coord:
504
				fld dword[ebx]
505
				fstp qword[Data_Double]
506
				call DoubleFloat_to_String
507
				add ebx,4
508
				stdcall str_len, Data_String
509
				mov esi,txt_space
510
				add esi,eax
511
				cmp esi,txt_space.end
512
				jl .normal_size
513
					mov esi,txt_space.end-1 ;минимум 1 пробел нужно добавить, что-бы цифры не слипались
514
				.normal_size:
515
				stdcall str_cat, obj_point.text,esi
516
				stdcall str_cat, obj_point.text,Data_String
517
				loop .coord
5944 IgorA 518
			mov byte[obj_point.text],'*' ;отмечаем что вершина изменялась
5911 IgorA 519
			stdcall dword[tl_node_set_data], tree3,obj_point
2173 IgorA 520
			stdcall dword[tl_draw], tree3
521
			mov byte[can_save],1 ;для показа кнопки 'Сохранить'
522
			mov dword[offs_last_timer],0 ;для обновления блока в таймере
6046 IgorA 523
			stdcall draw_3d, o3d
2173 IgorA 524
		.no_select_1:
5911 IgorA 525
		pop esi edi ecx ebx eax
5930 IgorA 526
		jmp prop_still.end
2173 IgorA 527
	@@:
5935 IgorA 528
	cmp ah,5
529
	jne @f
530
		call mnu_vertexes_on_off
531
		jmp prop_still.end
532
	@@:
533
	cmp ah,6
534
	jne @f
535
		call mnu_faces_on_off
536
		jmp prop_still.end
537
	@@:
538
	cmp ah,7
539
	jne @f
5938 IgorA 540
		call mnu_faces_fill_on_off
541
		jmp prop_still.end
542
	@@:
543
	cmp ah,8
544
	jne @f
5935 IgorA 545
		call mnu_light_on_off
546
		jmp prop_still.end
547
	@@:
5938 IgorA 548
	cmp ah,9
549
	jne @f
550
		call mnu_reset_settings
551
		jmp prop_still.end
552
	@@:
5944 IgorA 553
	cmp ah,10
554
	jne @f
555
		call mnu_vertexes_select
556
		jmp prop_still.end
557
	@@:
558
	cmp ah,11
559
	jne @f
560
		call mnu_vertexes_deselect
561
		jmp prop_still.end
562
	@@:
563
	cmp ah,12
564
	jne @f
565
		call mnu_reset_average_x
566
		jmp prop_still.end
567
	@@:
568
	cmp ah,13
569
	jne @f
570
		call mnu_reset_average_y
571
		jmp prop_still.end
572
	@@:
573
	cmp ah,14
574
	jne @f
575
		call mnu_reset_average_z
576
		jmp prop_still.end
577
	@@:
2173 IgorA 578
 
2165 IgorA 579
	cmp ah,1
5930 IgorA 580
	jne prop_still.end
2165 IgorA 581
.exit:
582
	mov dword[tree3.data_img],0 ;чистим указатели на иконки что-бы их не удалил деструктор
583
	mov dword[tree3.data_img_sys],0 ;т. к. они еще используються в других элементах
584
	stdcall dword[tl_data_clear], tree3
6046 IgorA 585
	mov edi,o3d
586
	stdcall mem.Free,[edi+offs_obj_normals_tri_data]
587
	stdcall mem.Free,[edi+offs_obj_normals_poi_data]
588
	mov dword[edi+offs_obj_normals_tri_data],0
589
	mov dword[edi+offs_obj_normals_poi_data],0
2165 IgorA 590
	mov byte[prop_wnd_run],0 ;обнуляем счетчик окон
591
	mcall -1 ;выход из программы
592
 
5930 IgorA 593
align 4
594
get_point_coords:
595
	;загрузка координат в editbox-ы
596
	push eax ebx
597
	stdcall [tl_node_get_data],tree3
598
	cmp eax,0
599
	je @f
600
		mov ebx,[eax]
601
		mov word[NumberSymbolsAD],8
602
		finit
603
		fld dword[ebx]
604
		fstp qword[Data_Double]
605
		call DoubleFloat_to_String
606
		stdcall [edit_box_set_text], edit1, Data_String
607
		fld dword[ebx+4]
608
		fstp qword[Data_Double]
609
		call DoubleFloat_to_String
610
		stdcall [edit_box_set_text], edit2, Data_String
611
		fld dword[ebx+8]
612
		fstp qword[Data_Double]
613
		call DoubleFloat_to_String
614
		stdcall [edit_box_set_text], edit3, Data_String
615
		stdcall [edit_box_draw], edit1
616
		stdcall [edit_box_draw], edit2
617
		stdcall [edit_box_draw], edit3
618
	@@:
619
	pop ebx eax
620
	ret
621
 
622
align 4
5935 IgorA 623
proc prop_timer_funct uses eax
624
	;просматриваем выделенную координату
625
	stdcall [tl_node_get_data],tree3
626
	cmp [cursor_last_draw],eax
627
	je @f
628
		mov [cursor_last_draw],eax
6046 IgorA 629
		stdcall draw_3d, o3d
5935 IgorA 630
	@@:
631
	ret
632
endp
633
 
634
align 4
5944 IgorA 635
proc mnu_vertexes_select uses eax ebx
636
	stdcall [tl_node_get_data],tree3
637
	cmp eax,0
638
	je .no_points
639
	stdcall found_block_data,tree3
640
	cmp eax,0
641
	je .no_points
642
		mov bx,word[eax]
643
		cmp bx,ID_ICON_POINT_SEL
644
		je @f
645
			mov word[eax],ID_ICON_POINT_SEL
646
			inc dword[obj_poi_sel_c]
647
			jmp .change
648
		@@:
649
			mov word[eax],ID_ICON_POINT
650
			dec dword[obj_poi_sel_c]
651
		.change:
652
			mov eax,[obj_poi_sel_c]
653
			stdcall convert_int_to_str, txt_select_vert.count,16
654
	.no_points:
655
	ret
656
endp
657
 
658
align 4
659
proc mnu_vertexes_deselect uses eax
660
	cmp dword[obj_poi_sel_c],0
661
	je .no_points
662
	mov dword[obj_poi_sel_c],0
663
	stdcall [tl_node_poi_get_info], tree3,0
664
	cmp eax,0
665
	je .no_points
666
	@@:
667
		mov word[eax],ID_ICON_POINT
668
		stdcall [tl_node_poi_get_next_info], tree3,eax
669
		cmp eax,0
670
		jne @b
671
	.no_points:
672
	ret
673
endp
674
 
675
align 4
676
proc mnu_reset_average_x uses eax ebx ecx edx edi
677
	cmp dword[obj_poi_sel_c],2
678
	jl .end_select
679
		finit
680
		fldz
681
		mov ecx,dword[obj_poi_sel_c]
682
		stdcall dword[tl_node_poi_get_info], tree3,0
683
		@@:
684
			cmp eax,0
685
			je .end_select
686
			mov ebx,eax
687
			cmp word[ebx],ID_ICON_POINT_SEL
688
			jne .next_sel0
689
				stdcall [tl_node_poi_get_data], tree3,ebx
690
				mov eax,[eax]
691
				fadd dword[eax]
692
				dec ecx
693
				jz @f
694
			.next_sel0:
695
			stdcall dword[tl_node_poi_get_next_info], tree3,ebx
696
			jmp @b
697
		@@:
698
		fidiv dword[obj_poi_sel_c]
699
		fstp dword[eax]
700
		mov edx,[eax]
701
		mov ecx,dword[obj_poi_sel_c]
702
		stdcall dword[tl_node_poi_get_info], tree3,0
703
		@@:
704
			cmp eax,0
705
			je .end_select
706
			mov ebx,eax
707
			cmp word[ebx],ID_ICON_POINT_SEL
708
			jne .next_sel1
709
				stdcall [tl_node_poi_get_data], tree3,ebx
710
				mov edi,eax
711
				mov eax,[eax]
712
				mov [eax],edx
713
				stdcall update_tree, edi
714
				dec ecx
715
				jz @f
716
			.next_sel1:
717
			stdcall dword[tl_node_poi_get_next_info], tree3,ebx
718
			jmp @b
719
		@@:
720
    .end_select:
721
	ret
722
endp
723
 
724
align 4
725
proc mnu_reset_average_y uses eax ebx ecx edx edi
726
	cmp dword[obj_poi_sel_c],2
727
	jl .end_select
728
		finit
729
		fldz
730
		mov ecx,dword[obj_poi_sel_c]
731
		stdcall dword[tl_node_poi_get_info], tree3,0
732
		@@:
733
			cmp eax,0
734
			je .end_select
735
			mov ebx,eax
736
			cmp word[ebx],ID_ICON_POINT_SEL
737
			jne .next_sel0
738
				stdcall [tl_node_poi_get_data], tree3,ebx
739
				mov eax,[eax]
740
				fadd dword[eax+4]
741
				dec ecx
742
				jz @f
743
			.next_sel0:
744
			stdcall dword[tl_node_poi_get_next_info], tree3,ebx
745
			jmp @b
746
		@@:
747
		fidiv dword[obj_poi_sel_c]
748
		fstp dword[eax+4]
749
		mov edx,[eax+4]
750
		mov ecx,dword[obj_poi_sel_c]
751
		stdcall dword[tl_node_poi_get_info], tree3,0
752
		@@:
753
			cmp eax,0
754
			je .end_select
755
			mov ebx,eax
756
			cmp word[ebx],ID_ICON_POINT_SEL
757
			jne .next_sel1
758
				stdcall [tl_node_poi_get_data], tree3,ebx
759
				mov edi,eax
760
				mov eax,[eax]
761
				mov [eax+4],edx
762
				stdcall update_tree, edi
763
				dec ecx
764
				jz @f
765
			.next_sel1:
766
			stdcall dword[tl_node_poi_get_next_info], tree3,ebx
767
			jmp @b
768
		@@:
769
    .end_select:
770
	ret
771
endp
772
 
773
align 4
774
proc mnu_reset_average_z uses eax ebx ecx edx edi
775
	cmp dword[obj_poi_sel_c],2
776
	jl .end_select
777
		finit
778
		fldz
779
		mov ecx,dword[obj_poi_sel_c]
780
		stdcall dword[tl_node_poi_get_info], tree3,0
781
		@@:
782
			cmp eax,0
783
			je .end_select
784
			mov ebx,eax
785
			cmp word[ebx],ID_ICON_POINT_SEL
786
			jne .next_sel0
787
				stdcall [tl_node_poi_get_data], tree3,ebx
788
				mov eax,[eax]
789
				fadd dword[eax+8]
790
				dec ecx
791
				jz @f
792
			.next_sel0:
793
			stdcall dword[tl_node_poi_get_next_info], tree3,ebx
794
			jmp @b
795
		@@:
796
		fidiv dword[obj_poi_sel_c]
797
		fstp dword[eax+8]
798
		mov edx,[eax+8]
799
		mov ecx,dword[obj_poi_sel_c]
800
		stdcall dword[tl_node_poi_get_info], tree3,0
801
		@@:
802
			cmp eax,0
803
			je .end_select
804
			mov ebx,eax
805
			cmp word[ebx],ID_ICON_POINT_SEL
806
			jne .next_sel1
807
				stdcall [tl_node_poi_get_data], tree3,ebx
808
				mov edi,eax
809
				mov eax,[eax]
810
				mov [eax+8],edx
811
				stdcall update_tree, edi
812
				dec ecx
813
				jz @f
814
			.next_sel1:
815
			stdcall dword[tl_node_poi_get_next_info], tree3,ebx
816
			jmp @b
817
		@@:
818
    .end_select:
819
	ret
820
endp
821
 
822
align 4
823
proc update_tree h_mem:dword
824
pushad
825
	mov edi,[h_mem]
826
	mov ebx,[edi]
827
	finit
828
 
829
	;обновление измененного узла в списке tree3 и главного окна (по таймеру)
830
	mov word[NumberSymbolsAD],5
831
	mov dword[obj_point.text],0
832
	cld
833
	mov ecx,3
834
	.coord:
835
		fld dword[ebx]
836
		fstp qword[Data_Double]
837
		call DoubleFloat_to_String
838
		add ebx,4
839
		stdcall str_len, Data_String
840
		mov esi,txt_space
841
		add esi,eax
842
		cmp esi,txt_space.end
843
		jl .normal_size
844
			mov esi,txt_space.end-1 ;минимум 1 пробел нужно добавить, что-бы цифры не слипались
845
		.normal_size:
846
		stdcall str_cat, obj_point.text,esi
847
		stdcall str_cat, obj_point.text,Data_String
848
		loop .coord
849
	mov esi,obj_point.text
850
	mov byte[esi],'*' ;отмечаем что вершина изменялась
851
	mov byte[can_save],1 ;для показа кнопки 'Сохранить'
852
	add edi,4
853
	mov ecx,MAX_OBJECT_SIZE-4
854
	rep movsb
855
popad
856
	ret
857
endp
858
 
859
align 4
5938 IgorA 860
angle_dxm dd 1.7775 ;~ 3d_wnd_w/180 - прибавление углов поворота сцены при вращении мышей
861
angle_dym dd 1.3335 ;~ 3d_wnd_h/180
5948 IgorA 862
ratio dd 1.3333 ;~ 3d_wnd_w/3d_wnd_h
5935 IgorA 863
cursor_last_draw dd 0 ;положение курсора при последней прорисовке 3d окна
4332 IgorA 864
capt_p dd 0
865
 
2165 IgorA 866
;дерево с объектами в пользовательском файле
5930 IgorA 867
tree3 tree_list MAX_OBJECT_SIZE,3, tl_key_no_edit+tl_list_box_mode,\
5935 IgorA 868
	16,16, 0xffffff,0xb0d0ff,0x400040, 5,290,303,140, 16, 4,0, el_focus,\
5930 IgorA 869
	w_scr_t3,get_point_coords
2165 IgorA 870
 
5935 IgorA 871
edit1 edit_box 80,  76, 269, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 34, string1, mouse_dd, 0
872
edit2 edit_box 80, 160, 269, 0xd0d0ff, 0xff, 0x80ff, 0, 0x8000, 34, string2, mouse_dd, 0
873
edit3 edit_box 80, 244, 269, 0xd0ffd0, 0xff, 0x80ff, 0, 0x8000, 34, string3, mouse_dd, 0
2173 IgorA 874
editboxes_end:
875
 
876
string1 rb 34
877
string2 rb 34
878
string3 rb 34
879
 
2165 IgorA 880
align 4
5930 IgorA 881
w_scr_t3 scrollbar 16, 0,0,0, 15, 100,0,0, 0,0,0, 1