Salome HOME
PR: synchro V7_main tag mergefrom_V6_main_28Feb13
[modules/geom.git] / src / DlgRef / DlgRef.cxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18
19 // File   : DlgRef.cxx
20 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
21
22 #include "DlgRef.h"
23
24 //////////////////////////////////////////
25 // DlgRef_1Check1Spin1Check
26 //////////////////////////////////////////
27
28 DlgRef_1Check1Spin1Check::DlgRef_1Check1Spin1Check( QWidget* parent, Qt::WindowFlags f )
29 : QWidget( parent, f )
30 {
31   setupUi( this );
32 }
33
34 DlgRef_1Check1Spin1Check::~DlgRef_1Check1Spin1Check()
35 {
36 }
37
38 //////////////////////////////////////////
39 // DlgRef_1List1Spin1Btn
40 //////////////////////////////////////////
41
42 DlgRef_1List1Spin1Btn::DlgRef_1List1Spin1Btn( QWidget* parent, Qt::WindowFlags f )
43 : QWidget( parent, f )
44 {
45   setupUi( this );
46 }
47
48 DlgRef_1List1Spin1Btn::~DlgRef_1List1Spin1Btn()
49 {
50 }
51
52 //////////////////////////////////////////
53 // DlgRef_1Sel1Check1List
54 //////////////////////////////////////////
55
56 DlgRef_1Sel1Check1List::DlgRef_1Sel1Check1List( QWidget* parent, Qt::WindowFlags f )
57 : QWidget( parent, f )
58 {
59   setupUi( this );
60 }
61
62 DlgRef_1Sel1Check1List::~DlgRef_1Sel1Check1List()
63 {
64 }
65
66 //////////////////////////////////////////
67 // DlgRef_1Sel1Check1Sel
68 //////////////////////////////////////////
69
70 DlgRef_1Sel1Check1Sel::DlgRef_1Sel1Check1Sel( QWidget* parent, Qt::WindowFlags f )
71 : QWidget( parent, f )
72 {
73   setupUi( this );
74 }
75
76 DlgRef_1Sel1Check1Sel::~DlgRef_1Sel1Check1Sel()
77 {
78 }
79
80 //////////////////////////////////////////
81 // DlgRef_1Sel1Check
82 //////////////////////////////////////////
83
84 DlgRef_1Sel1Check::DlgRef_1Sel1Check( QWidget* parent, Qt::WindowFlags f )
85 : QWidget( parent, f )
86 {
87   setupUi( this );
88 }
89
90 DlgRef_1Sel1Check::~DlgRef_1Sel1Check()
91 {
92 }
93
94 //////////////////////////////////////////
95 // DlgRef_1Sel1Frame
96 //////////////////////////////////////////
97
98 DlgRef_1Sel1Frame::DlgRef_1Sel1Frame( QWidget* parent, Qt::WindowFlags f )
99 : QWidget( parent, f )
100 {
101   setupUi( this );
102 }
103
104 DlgRef_1Sel1Frame::~DlgRef_1Sel1Frame()
105 {
106 }
107
108 //////////////////////////////////////////
109 // DlgRef_1Sel1List1Check3Btn
110 //////////////////////////////////////////
111
112 DlgRef_1Sel1List1Check3Btn::DlgRef_1Sel1List1Check3Btn( QWidget* parent, Qt::WindowFlags f )
113 : QWidget( parent, f )
114 {
115   setupUi( this );
116 }
117
118 DlgRef_1Sel1List1Check3Btn::~DlgRef_1Sel1List1Check3Btn()
119 {
120 }
121
122 //////////////////////////////////////////
123 // DlgRef_1Sel1Spin1Check
124 //////////////////////////////////////////
125
126 DlgRef_1Sel1Spin1Check::DlgRef_1Sel1Spin1Check( QWidget* parent, Qt::WindowFlags f )
127 : QWidget( parent, f )
128 {
129   setupUi( this );
130 }
131
132 DlgRef_1Sel1Spin1Check::~DlgRef_1Sel1Spin1Check()
133 {
134 }
135
136 //////////////////////////////////////////
137 // DlgRef_1Sel1Spin
138 //////////////////////////////////////////
139
140 DlgRef_1Sel1Spin::DlgRef_1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
141 : QWidget( parent, f )
142 {
143   setupUi( this );
144 }
145
146 DlgRef_1Sel1Spin::~DlgRef_1Sel1Spin()
147 {
148 }
149
150 //////////////////////////////////////////
151 // DlgRef_1Sel2Spin1View1Check
152 //////////////////////////////////////////
153
154 DlgRef_1Sel2Spin1View1Check::DlgRef_1Sel2Spin1View1Check( QWidget* parent, Qt::WindowFlags f )
155 : QWidget( parent, f )
156 {
157   setupUi( this );
158 }
159
160 DlgRef_1Sel2Spin1View1Check::~DlgRef_1Sel2Spin1View1Check()
161 {
162 }
163
164 //////////////////////////////////////////
165 // DlgRef_1Sel2Spin
166 //////////////////////////////////////////
167
168 DlgRef_1Sel2Spin::DlgRef_1Sel2Spin( QWidget* parent, Qt::WindowFlags f )
169 : QWidget( parent, f )
170 {
171   setupUi( this );
172 }
173
174 DlgRef_1Sel2Spin::~DlgRef_1Sel2Spin()
175 {
176 }
177
178 //////////////////////////////////////////
179 // DlgRef_1Sel3Check
180 //////////////////////////////////////////
181
182 DlgRef_1Sel3Check::DlgRef_1Sel3Check( QWidget* parent, Qt::WindowFlags f )
183 : QWidget( parent, f )
184 {
185   setupUi( this );
186 }
187
188 DlgRef_1Sel3Check::~DlgRef_1Sel3Check()
189 {
190 }
191
192 //////////////////////////////////////////
193 // DlgRef_1Sel3Spin
194 //////////////////////////////////////////
195
196 DlgRef_1Sel3Spin::DlgRef_1Sel3Spin( QWidget* parent, Qt::WindowFlags f )
197 : QWidget( parent, f )
198 {
199   setupUi( this );
200 }
201
202 DlgRef_1Sel3Spin::~DlgRef_1Sel3Spin()
203 {
204 }
205
206 //////////////////////////////////////////
207 // DlgRef_1Sel3Spin2Check1Spin
208 //////////////////////////////////////////
209
210 DlgRef_1Sel3Spin2Check1Spin::DlgRef_1Sel3Spin2Check1Spin( QWidget* parent, Qt::WindowFlags f )
211 : QWidget( parent, f )
212 {
213   setupUi( this );
214 }
215
216 DlgRef_1Sel3Spin2Check1Spin::~DlgRef_1Sel3Spin2Check1Spin()
217 {
218 }
219
220 //////////////////////////////////////////
221 // DlgRef_1Sel3Spin1Check
222 //////////////////////////////////////////
223
224 DlgRef_1Sel3Spin1Check::DlgRef_1Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
225 : QWidget( parent, f )
226 {
227   setupUi( this );
228 }
229
230 DlgRef_1Sel3Spin1Check::~DlgRef_1Sel3Spin1Check()
231 {
232 }
233
234 //////////////////////////////////////////
235 // DlgRef_1Sel5Spin1Check
236 //////////////////////////////////////////
237
238 DlgRef_1Sel5Spin1Check::DlgRef_1Sel5Spin1Check( QWidget* parent, Qt::WindowFlags f )
239 : QWidget( parent, f )
240 {
241   setupUi( this );
242 }
243
244 DlgRef_1Sel5Spin1Check::~DlgRef_1Sel5Spin1Check()
245 {
246 }
247
248 //////////////////////////////////////////
249 // DlgRef_1Spin
250 //////////////////////////////////////////
251
252 DlgRef_1Spin::DlgRef_1Spin( QWidget* parent, Qt::WindowFlags f )
253 : QWidget( parent, f )
254 {
255   setupUi( this );
256 }
257
258 DlgRef_1Spin::~DlgRef_1Spin()
259 {
260 }
261
262 //////////////////////////////////////////
263 // DlgRef_1Sel
264 //////////////////////////////////////////
265
266 DlgRef_1Sel::DlgRef_1Sel( QWidget* parent, Qt::WindowFlags f )
267 : QWidget( parent, f )
268 {
269   setupUi( this );
270 }
271
272 DlgRef_1Sel::~DlgRef_1Sel()
273 {
274 }
275
276 //////////////////////////////////////////
277 // DlgRef_1SelExt
278 //////////////////////////////////////////
279
280 DlgRef_1SelExt::DlgRef_1SelExt( QWidget* parent, Qt::WindowFlags f )
281 : QWidget( parent, f )
282 {
283   setupUi( this );
284 }
285
286 DlgRef_1SelExt::~DlgRef_1SelExt()
287 {
288 }
289
290 //////////////////////////////////////////
291 // DlgRef_2Sel1List1Check
292 //////////////////////////////////////////
293
294 DlgRef_2Sel1List1Check::DlgRef_2Sel1List1Check( QWidget* parent, Qt::WindowFlags f )
295 : QWidget( parent, f )
296 {
297   setupUi( this );
298 }
299
300 DlgRef_2Sel1List1Check::~DlgRef_2Sel1List1Check()
301 {
302 }
303
304 //////////////////////////////////////////
305 // DlgRef_2Sel1List2Check
306 //////////////////////////////////////////
307
308 DlgRef_2Sel1List2Check::DlgRef_2Sel1List2Check( QWidget* parent, Qt::WindowFlags f )
309 : QWidget( parent, f )
310 {
311   setupUi( this );
312 }
313
314 DlgRef_2Sel1List2Check::~DlgRef_2Sel1List2Check()
315 {
316 }
317
318 //////////////////////////////////////////
319 // DlgRef_2Sel1List
320 //////////////////////////////////////////
321
322 DlgRef_2Sel1List::DlgRef_2Sel1List( QWidget* parent, Qt::WindowFlags f )
323 : QWidget( parent, f )
324 {
325   setupUi( this );
326 }
327
328 DlgRef_2Sel1List::~DlgRef_2Sel1List()
329 {
330 }
331
332 //////////////////////////////////////////
333 // DlgRef_2Sel1Spin2Check
334 //////////////////////////////////////////
335
336 DlgRef_2Sel1Spin2Check::DlgRef_2Sel1Spin2Check( QWidget* parent, Qt::WindowFlags f )
337 : QWidget( parent, f )
338 {
339   setupUi( this );
340 }
341
342 DlgRef_2Sel1Spin2Check::~DlgRef_2Sel1Spin2Check()
343 {
344 }
345
346 //////////////////////////////////////////
347 // DlgRef_2Sel1Spin3Check1Spin
348 //////////////////////////////////////////
349
350 DlgRef_2Sel1Spin3Check1Spin::DlgRef_2Sel1Spin3Check1Spin( QWidget* parent, Qt::WindowFlags f )
351 : QWidget( parent, f )
352 {
353   setupUi( this );
354 }
355
356 DlgRef_2Sel1Spin3Check1Spin::~DlgRef_2Sel1Spin3Check1Spin()
357 {
358 }
359
360 //////////////////////////////////////////
361 // DlgRef_2Sel1Spin
362 //////////////////////////////////////////
363
364 DlgRef_2Sel1Spin::DlgRef_2Sel1Spin( QWidget* parent, Qt::WindowFlags f )
365 : QWidget( parent, f )
366 {
367   setupUi( this );
368 }
369
370 DlgRef_2Sel1Spin::~DlgRef_2Sel1Spin()
371 {
372 }
373
374 //////////////////////////////////////////
375 // DlgRef_2Sel1SpinInt
376 //////////////////////////////////////////
377
378 DlgRef_2Sel1SpinInt::DlgRef_2Sel1SpinInt( QWidget* parent, Qt::WindowFlags f )
379 : QWidget( parent, f )
380 {
381   setupUi( this );
382 }
383
384 DlgRef_2Sel1SpinInt::~DlgRef_2Sel1SpinInt()
385 {
386 }
387
388 //////////////////////////////////////////
389 // DlgRef_2Sel2List
390 //////////////////////////////////////////
391
392 DlgRef_2Sel2List::DlgRef_2Sel2List( QWidget* parent, Qt::WindowFlags f )
393 : QWidget( parent, f )
394 {
395   setupUi( this );
396 }
397
398 DlgRef_2Sel2List::~DlgRef_2Sel2List()
399 {
400 }
401
402 //////////////////////////////////////////
403 // DlgRef_2Sel2Spin1Check
404 //////////////////////////////////////////
405
406 DlgRef_2Sel2Spin1Check::DlgRef_2Sel2Spin1Check( QWidget* parent, Qt::WindowFlags f )
407 : QWidget( parent, f )
408 {
409   setupUi( this );
410 }
411
412 DlgRef_2Sel2Spin1Check::~DlgRef_2Sel2Spin1Check()
413 {
414 }
415
416 //////////////////////////////////////////
417 // DlgRef_2Sel2Spin3Check
418 //////////////////////////////////////////
419
420 DlgRef_2Sel2Spin3Check::DlgRef_2Sel2Spin3Check( QWidget* parent, Qt::WindowFlags f )
421 : QWidget( parent, f )
422 {
423   setupUi( this );
424 }
425
426 DlgRef_2Sel2Spin3Check::~DlgRef_2Sel2Spin3Check()
427 {
428 }
429
430 //////////////////////////////////////////
431 // DlgRef_2Sel2Spin
432 //////////////////////////////////////////
433
434 DlgRef_2Sel2Spin::DlgRef_2Sel2Spin( QWidget* parent, Qt::WindowFlags f )
435 : QWidget( parent, f )
436 {
437   setupUi( this );
438 }
439
440 DlgRef_2Sel2Spin::~DlgRef_2Sel2Spin()
441 {
442 }
443
444 //////////////////////////////////////////
445 // DlgRef_2Sel2Spin1Push
446 //////////////////////////////////////////
447
448 DlgRef_2Sel2Spin1Push::DlgRef_2Sel2Spin1Push( QWidget* parent, Qt::WindowFlags f )
449 : QWidget( parent, f )
450 {
451   setupUi( this );
452 }
453
454 DlgRef_2Sel2Spin1Push::~DlgRef_2Sel2Spin1Push()
455 {
456 }
457
458 //////////////////////////////////////////
459 // DlgRef_2Sel2Spin2Push
460 //////////////////////////////////////////
461
462 DlgRef_2Sel2Spin2Push::DlgRef_2Sel2Spin2Push( QWidget* parent, Qt::WindowFlags f )
463 : QWidget( parent, f )
464 {
465   setupUi( this );
466 }
467
468 DlgRef_2Sel2Spin2Push::~DlgRef_2Sel2Spin2Push()
469 {
470 }
471
472 //////////////////////////////////////////
473 // DlgRef_2Sel3Spin2Rb
474 //////////////////////////////////////////
475
476 DlgRef_2Sel3Spin2Rb::DlgRef_2Sel3Spin2Rb( QWidget* parent, Qt::WindowFlags f )
477 : QWidget( parent, f )
478 {
479   setupUi( this );
480 }
481
482 DlgRef_2Sel3Spin2Rb::~DlgRef_2Sel3Spin2Rb()
483 {
484 }
485
486 //////////////////////////////////////////
487 // DlgRef_2Sel3Spin
488 //////////////////////////////////////////
489
490 DlgRef_2Sel3Spin::DlgRef_2Sel3Spin( QWidget* parent, Qt::WindowFlags f )
491 : QWidget( parent, f )
492 {
493   setupUi( this );
494 }
495
496 DlgRef_2Sel3Spin::~DlgRef_2Sel3Spin()
497 {
498 }
499
500 //////////////////////////////////////////
501 // DlgRef_2Sel
502 //////////////////////////////////////////
503
504 DlgRef_2Sel::DlgRef_2Sel( QWidget* parent, Qt::WindowFlags f )
505 : QWidget( parent, f )
506 {
507   setupUi( this );
508 }
509
510 DlgRef_2Sel::~DlgRef_2Sel()
511 {
512 }
513
514 //////////////////////////////////////////
515 // DlgRef_2SelExt
516 //////////////////////////////////////////
517
518 DlgRef_2SelExt::DlgRef_2SelExt( QWidget* parent, Qt::WindowFlags f )
519 : QWidget( parent, f )
520 {
521   setupUi( this );
522 }
523
524 DlgRef_2SelExt::~DlgRef_2SelExt()
525 {
526 }
527
528 //////////////////////////////////////////
529 // DlgRef_2Spin
530 //////////////////////////////////////////
531
532 DlgRef_2Spin::DlgRef_2Spin( QWidget* parent, Qt::WindowFlags f )
533 : QWidget( parent, f )
534 {
535   setupUi( this );
536 }
537
538 DlgRef_2Spin::~DlgRef_2Spin()
539 {
540 }
541
542 //////////////////////////////////////////
543 // DlgRef_3Check
544 //////////////////////////////////////////
545
546 DlgRef_3Check::DlgRef_3Check( QWidget* parent, Qt::WindowFlags f )
547 : QWidget( parent, f )
548 {
549   setupUi( this );
550 }
551
552 DlgRef_3Check::~DlgRef_3Check()
553 {
554 }
555
556 //////////////////////////////////////////
557 // DlgRef_3Radio
558 //////////////////////////////////////////
559
560 DlgRef_3Radio::DlgRef_3Radio( QWidget* parent, Qt::WindowFlags f )
561 : QWidget( parent, f )
562 {
563   setupUi( this );
564 }
565
566 DlgRef_3Radio::~DlgRef_3Radio()
567 {
568 }
569
570 //////////////////////////////////////////
571 // DlgRef_3Radio1Sel1Spin
572 //////////////////////////////////////////
573
574 DlgRef_3Radio1Sel1Spin::DlgRef_3Radio1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
575 : QWidget( parent, f )
576 {
577   setupUi( this );
578 }
579
580 DlgRef_3Radio1Sel1Spin::~DlgRef_3Radio1Sel1Spin()
581 {
582 }
583
584 //////////////////////////////////////////
585 // DlgRef_3Sel1Check
586 //////////////////////////////////////////
587
588 DlgRef_3Sel1Check::DlgRef_3Sel1Check( QWidget* parent, Qt::WindowFlags f )
589 : QWidget( parent, f )
590 {
591   setupUi( this );
592 }
593
594 DlgRef_3Sel1Check::~DlgRef_3Sel1Check()
595 {
596 }
597
598 //////////////////////////////////////////
599 // DlgRef_3Sel1Spin
600 //////////////////////////////////////////
601
602 DlgRef_3Sel1Spin::DlgRef_3Sel1Spin( QWidget* parent, Qt::WindowFlags f )
603 : QWidget( parent, f )
604 {
605   setupUi( this );
606 }
607
608 DlgRef_3Sel1Spin::~DlgRef_3Sel1Spin()
609 {
610 }
611
612 //////////////////////////////////////////
613 // DlgRef_3Sel2Spin
614 //////////////////////////////////////////
615
616 DlgRef_3Sel2Spin::DlgRef_3Sel2Spin( QWidget* parent, Qt::WindowFlags f )
617 : QWidget( parent, f )
618 {
619   setupUi( this );
620 }
621
622 DlgRef_3Sel2Spin::~DlgRef_3Sel2Spin()
623 {
624 }
625
626 //////////////////////////////////////////
627 // DlgRef_3Sel3Spin1Check
628 //////////////////////////////////////////
629
630 DlgRef_3Sel3Spin1Check::DlgRef_3Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
631 : QWidget( parent, f )
632 {
633   setupUi( this );
634 }
635
636 DlgRef_3Sel3Spin1Check::~DlgRef_3Sel3Spin1Check()
637 {
638 }
639
640 void DlgRef_3Sel3Spin1Check::ShowRows( int fromRow, int toRow, bool toShow )
641 {
642   const int maxRows = 7;
643   
644   if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
645     int c = gridLayout1->count();
646     for ( int i = 0; i < c; i++ ) {
647       QWidget* w = gridLayout1->itemAt( i )->widget();
648       int row, col, rowspan, colspan;
649       gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
650       if ( w && row >= fromRow && row <= toRow )
651         w->setVisible( toShow );
652     }
653   }
654 }
655
656 //////////////////////////////////////////
657 // DlgRef_3Sel2Check3Spin
658 //////////////////////////////////////////
659
660 DlgRef_3Sel2Check3Spin::DlgRef_3Sel2Check3Spin( QWidget* parent, Qt::WindowFlags f )
661 : QWidget( parent, f )
662 {
663   setupUi( this );
664 }
665
666 DlgRef_3Sel2Check3Spin::~DlgRef_3Sel2Check3Spin()
667 {
668 }
669
670 void DlgRef_3Sel2Check3Spin::ShowRows( int fromRow, int toRow, bool toShow )
671 {
672   const int maxRows = 8;
673   
674   if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
675     int c = gridLayout1->count();
676     for ( int i = 0; i < c; i++ ) {
677       QWidget* w = gridLayout1->itemAt( i )->widget();
678       int row, col, rowspan, colspan;
679       gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
680       if ( w && row >= fromRow && row <= toRow )
681         w->setVisible( toShow );
682     }
683   }
684 }
685
686 //////////////////////////////////////////
687 // DlgRef_3Sel3Spin2Check
688 //////////////////////////////////////////
689
690 DlgRef_3Sel3Spin2Check::DlgRef_3Sel3Spin2Check( QWidget* parent, Qt::WindowFlags f )
691 : QWidget( parent, f )
692 {
693   setupUi( this );
694 }
695
696 DlgRef_3Sel3Spin2Check::~DlgRef_3Sel3Spin2Check()
697 {
698 }
699
700 void DlgRef_3Sel3Spin2Check::ShowRows( int fromRow, int toRow, bool toShow )
701 {
702   const int maxRows = 8;
703   
704   if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
705     int c = gridLayout1->count();
706     for ( int i = 0; i < c; i++ ) {
707       QWidget* w = gridLayout1->itemAt( i )->widget();
708       int row, col, rowspan, colspan;
709       gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
710       if ( w && row >= fromRow && row <= toRow )
711         w->setVisible( toShow );
712     }
713   }
714 }
715
716 //////////////////////////////////////////
717 // DlgRef_3Sel4Spin2Check
718 //////////////////////////////////////////
719
720 DlgRef_3Sel4Spin2Check::DlgRef_3Sel4Spin2Check( QWidget* parent, Qt::WindowFlags f )
721 : QWidget( parent, f )
722 {
723   setupUi( this );
724 }
725
726 DlgRef_3Sel4Spin2Check::~DlgRef_3Sel4Spin2Check()
727 {
728 }
729
730 //////////////////////////////////////////
731 // DlgRef_3Sel
732 //////////////////////////////////////////
733
734 DlgRef_3Sel::DlgRef_3Sel( QWidget* parent, Qt::WindowFlags f )
735 : QWidget( parent, f )
736 {
737   setupUi( this );
738 }
739
740 DlgRef_3Sel::~DlgRef_3Sel()
741 {
742 }
743
744 //////////////////////////////////////////
745 // DlgRef_3Spin1Check
746 //////////////////////////////////////////
747
748 DlgRef_3Spin1Check::DlgRef_3Spin1Check( QWidget* parent, Qt::WindowFlags f )
749 : QWidget( parent, f )
750 {
751   setupUi( this );
752 }
753
754 DlgRef_3Spin1Check::~DlgRef_3Spin1Check()
755 {
756 }
757
758 //////////////////////////////////////////
759 // DlgRef_3Spin
760 //////////////////////////////////////////
761
762 DlgRef_3Spin::DlgRef_3Spin( QWidget* parent, Qt::WindowFlags f )
763 : QWidget( parent, f )
764 {
765   setupUi( this );
766 }
767
768 DlgRef_3Spin::~DlgRef_3Spin()
769 {
770 }
771
772 //////////////////////////////////////////
773 // DlgRef_4Spin
774 //////////////////////////////////////////
775
776 DlgRef_4Spin::DlgRef_4Spin( QWidget* parent, Qt::WindowFlags f )
777 : QWidget( parent, f )
778 {
779   setupUi( this );
780 }
781
782 DlgRef_4Spin::~DlgRef_4Spin()
783 {
784 }
785
786 //////////////////////////////////////////
787 // DlgRef_4Sel1List1Check
788 //////////////////////////////////////////
789
790 DlgRef_4Sel1List1Check::DlgRef_4Sel1List1Check( QWidget* parent, Qt::WindowFlags f )
791 : QWidget( parent, f )
792 {
793   setupUi( this );
794 }
795
796 DlgRef_4Sel1List1Check::~DlgRef_4Sel1List1Check()
797 {
798 }
799
800 //////////////////////////////////////////
801 // DlgRef_4Sel1List
802 //////////////////////////////////////////
803
804 DlgRef_4Sel1List::DlgRef_4Sel1List( QWidget* parent, Qt::WindowFlags f )
805 : QWidget( parent, f )
806 {
807   setupUi( this );
808 }
809
810 DlgRef_4Sel1List::~DlgRef_4Sel1List()
811 {
812 }
813
814 //////////////////////////////////////////
815 // DlgRef_4Sel1Spin2Check
816 //////////////////////////////////////////
817
818 DlgRef_4Sel1Spin2Check::DlgRef_4Sel1Spin2Check( QWidget* parent, Qt::WindowFlags f )
819 : QWidget( parent, f )
820 {
821   setupUi( this );
822 }
823
824 DlgRef_4Sel1Spin2Check::~DlgRef_4Sel1Spin2Check()
825 {
826 }
827
828 void DlgRef_4Sel1Spin2Check::ShowRows( int fromRow, int toRow, bool toShow )
829 {
830   const int maxRows = 6;
831   
832   if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
833     int c = gridLayout1->count();
834     for ( int i = 0; i < c; i++ ) {
835       QWidget* w = gridLayout1->itemAt( i )->widget();
836       int row, col, rowspan, colspan;
837       gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
838       if ( w && row >= fromRow && row <= toRow )
839         w->setVisible( toShow );
840     }
841   }
842 }
843
844 //////////////////////////////////////////
845 // DlgRef_4Sel1Spin3Check
846 //////////////////////////////////////////
847
848 DlgRef_4Sel1Spin3Check::DlgRef_4Sel1Spin3Check( QWidget* parent, Qt::WindowFlags f )
849 : QWidget( parent, f )
850 {
851   setupUi( this );
852 }
853
854 DlgRef_4Sel1Spin3Check::~DlgRef_4Sel1Spin3Check()
855 {
856 }
857
858 //////////////////////////////////////////
859 // DlgRef_6Sel
860 //////////////////////////////////////////
861
862 DlgRef_6Sel::DlgRef_6Sel( QWidget* parent, Qt::WindowFlags f )
863 : QWidget( parent, f )
864 {
865   setupUi( this );
866 }
867
868 DlgRef_6Sel::~DlgRef_6Sel()
869 {
870 }
871
872 //////////////////////////////////////////
873 // DlgRef_Skeleton
874 //////////////////////////////////////////
875
876 DlgRef_Skeleton::DlgRef_Skeleton( QWidget* parent, Qt::WindowFlags f )
877 : QWidget( parent, f )
878 {
879   setupUi( this );
880 }
881
882 DlgRef_Skeleton::~DlgRef_Skeleton()
883 {
884 }
885
886 //////////////////////////////////////////
887 // Utility functions
888 //////////////////////////////////////////
889
890 QString DlgRef::PrintDoubleValue( double theValue, int thePrecision )
891 {
892   const double prec = 1e-12;
893   
894   if ( qAbs(theValue) < prec )
895     return "0";
896
897   QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( thePrecision ) );
898
899   if ( prec > 0 ) {
900     int p = 0;
901     while ( p < thePrecision ) {
902       QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( p++ ) );
903       double v = aRes.toDouble();
904       double err = qAbs( theValue - v );
905       if ( err > 0 && err <= prec )
906         break;
907     }
908   }
909
910   // remove trailing zeroes
911
912   QRegExp expre( QString( "(%1|%2)[+-]?[0-9]+$" ).arg( QLocale().exponential().toLower(), 
913                                                        QLocale().exponential().toUpper() ) );
914
915   int idx = aRes.indexOf( expre );
916   QString aResExp = "";
917   if ( idx >= 0 ) {
918     aResExp = aRes.mid( idx );
919     aRes = aRes.left( idx );
920   }
921
922   if ( aRes.contains( QLocale().decimalPoint() ) )
923     aRes.remove( QRegExp( QString( "(\\%1|0)0*$" ).arg( QLocale().decimalPoint() ) ) );
924
925   return aRes == "-0" ? QString( "0" ) : aRes + aResExp;
926 }