Subversion Repositories Kolibri OS

Rev

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