1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
24 //////////////////////////////////////////
25 // DlgRef_1List1Spin1Btn
26 //////////////////////////////////////////
28 DlgRef_1List1Spin1Btn::DlgRef_1List1Spin1Btn( QWidget* parent, Qt::WindowFlags f )
29 : QWidget( parent, f )
34 DlgRef_1List1Spin1Btn::~DlgRef_1List1Spin1Btn()
38 //////////////////////////////////////////
39 // DlgRef_1Sel1Check1List
40 //////////////////////////////////////////
42 DlgRef_1Sel1Check1List::DlgRef_1Sel1Check1List( QWidget* parent, Qt::WindowFlags f )
43 : QWidget( parent, f )
48 DlgRef_1Sel1Check1List::~DlgRef_1Sel1Check1List()
52 //////////////////////////////////////////
53 // DlgRef_1Sel1Check1Sel
54 //////////////////////////////////////////
56 DlgRef_1Sel1Check1Sel::DlgRef_1Sel1Check1Sel( QWidget* parent, Qt::WindowFlags f )
57 : QWidget( parent, f )
62 DlgRef_1Sel1Check1Sel::~DlgRef_1Sel1Check1Sel()
66 //////////////////////////////////////////
68 //////////////////////////////////////////
70 DlgRef_1Sel1Check::DlgRef_1Sel1Check( QWidget* parent, Qt::WindowFlags f )
71 : QWidget( parent, f )
76 DlgRef_1Sel1Check::~DlgRef_1Sel1Check()
80 //////////////////////////////////////////
82 //////////////////////////////////////////
84 DlgRef_1Sel1Frame::DlgRef_1Sel1Frame( QWidget* parent, Qt::WindowFlags f )
85 : QWidget( parent, f )
90 DlgRef_1Sel1Frame::~DlgRef_1Sel1Frame()
94 //////////////////////////////////////////
95 // DlgRef_1Sel1List1Check3Btn
96 //////////////////////////////////////////
98 DlgRef_1Sel1List1Check3Btn::DlgRef_1Sel1List1Check3Btn( QWidget* parent, Qt::WindowFlags f )
99 : QWidget( parent, f )
104 DlgRef_1Sel1List1Check3Btn::~DlgRef_1Sel1List1Check3Btn()
108 //////////////////////////////////////////
109 // DlgRef_1Sel1Spin1Check
110 //////////////////////////////////////////
112 DlgRef_1Sel1Spin1Check::DlgRef_1Sel1Spin1Check( QWidget* parent, Qt::WindowFlags f )
113 : QWidget( parent, f )
118 DlgRef_1Sel1Spin1Check::~DlgRef_1Sel1Spin1Check()
122 //////////////////////////////////////////
124 //////////////////////////////////////////
126 DlgRef_1Sel1Spin::DlgRef_1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
127 : QWidget( parent, f )
132 DlgRef_1Sel1Spin::~DlgRef_1Sel1Spin()
136 //////////////////////////////////////////
137 // DlgRef_1Sel2Spin1View1Check
138 //////////////////////////////////////////
140 DlgRef_1Sel2Spin1View1Check::DlgRef_1Sel2Spin1View1Check( QWidget* parent, Qt::WindowFlags f )
141 : QWidget( parent, f )
146 DlgRef_1Sel2Spin1View1Check::~DlgRef_1Sel2Spin1View1Check()
150 //////////////////////////////////////////
152 //////////////////////////////////////////
154 DlgRef_1Sel2Spin::DlgRef_1Sel2Spin( QWidget* parent, Qt::WindowFlags f )
155 : QWidget( parent, f )
160 DlgRef_1Sel2Spin::~DlgRef_1Sel2Spin()
164 //////////////////////////////////////////
166 //////////////////////////////////////////
168 DlgRef_1Sel3Check::DlgRef_1Sel3Check( QWidget* parent, Qt::WindowFlags f )
169 : QWidget( parent, f )
174 DlgRef_1Sel3Check::~DlgRef_1Sel3Check()
178 //////////////////////////////////////////
180 //////////////////////////////////////////
182 DlgRef_1Sel3Spin::DlgRef_1Sel3Spin( QWidget* parent, Qt::WindowFlags f )
183 : QWidget( parent, f )
188 DlgRef_1Sel3Spin::~DlgRef_1Sel3Spin()
192 //////////////////////////////////////////
193 // DlgRef_1Sel3Spin2Check1Spin
194 //////////////////////////////////////////
196 DlgRef_1Sel3Spin2Check1Spin::DlgRef_1Sel3Spin2Check1Spin( QWidget* parent, Qt::WindowFlags f )
197 : QWidget( parent, f )
202 DlgRef_1Sel3Spin2Check1Spin::~DlgRef_1Sel3Spin2Check1Spin()
206 //////////////////////////////////////////
207 // DlgRef_1Sel3Spin1Check
208 //////////////////////////////////////////
210 DlgRef_1Sel3Spin1Check::DlgRef_1Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
211 : QWidget( parent, f )
216 DlgRef_1Sel3Spin1Check::~DlgRef_1Sel3Spin1Check()
220 //////////////////////////////////////////
221 // DlgRef_1Sel5Spin1Check
222 //////////////////////////////////////////
224 DlgRef_1Sel5Spin1Check::DlgRef_1Sel5Spin1Check( QWidget* parent, Qt::WindowFlags f )
225 : QWidget( parent, f )
230 DlgRef_1Sel5Spin1Check::~DlgRef_1Sel5Spin1Check()
234 //////////////////////////////////////////
236 //////////////////////////////////////////
238 DlgRef_1Spin::DlgRef_1Spin( QWidget* parent, Qt::WindowFlags f )
239 : QWidget( parent, f )
244 DlgRef_1Spin::~DlgRef_1Spin()
248 //////////////////////////////////////////
250 //////////////////////////////////////////
252 DlgRef_1Sel::DlgRef_1Sel( QWidget* parent, Qt::WindowFlags f )
253 : QWidget( parent, f )
258 DlgRef_1Sel::~DlgRef_1Sel()
262 //////////////////////////////////////////
264 //////////////////////////////////////////
266 DlgRef_1SelExt::DlgRef_1SelExt( QWidget* parent, Qt::WindowFlags f )
267 : QWidget( parent, f )
272 DlgRef_1SelExt::~DlgRef_1SelExt()
276 //////////////////////////////////////////
277 // DlgRef_2Sel1List1Check
278 //////////////////////////////////////////
280 DlgRef_2Sel1List1Check::DlgRef_2Sel1List1Check( QWidget* parent, Qt::WindowFlags f )
281 : QWidget( parent, f )
286 DlgRef_2Sel1List1Check::~DlgRef_2Sel1List1Check()
290 //////////////////////////////////////////
291 // DlgRef_2Sel1List2Check
292 //////////////////////////////////////////
294 DlgRef_2Sel1List2Check::DlgRef_2Sel1List2Check( QWidget* parent, Qt::WindowFlags f )
295 : QWidget( parent, f )
300 DlgRef_2Sel1List2Check::~DlgRef_2Sel1List2Check()
304 //////////////////////////////////////////
306 //////////////////////////////////////////
308 DlgRef_2Sel1List::DlgRef_2Sel1List( QWidget* parent, Qt::WindowFlags f )
309 : QWidget( parent, f )
314 DlgRef_2Sel1List::~DlgRef_2Sel1List()
318 //////////////////////////////////////////
319 // DlgRef_2Sel1Spin2Check
320 //////////////////////////////////////////
322 DlgRef_2Sel1Spin2Check::DlgRef_2Sel1Spin2Check( QWidget* parent, Qt::WindowFlags f )
323 : QWidget( parent, f )
328 DlgRef_2Sel1Spin2Check::~DlgRef_2Sel1Spin2Check()
332 //////////////////////////////////////////
333 // DlgRef_2Sel1Spin3Check1Spin
334 //////////////////////////////////////////
336 DlgRef_2Sel1Spin3Check1Spin::DlgRef_2Sel1Spin3Check1Spin( QWidget* parent, Qt::WindowFlags f )
337 : QWidget( parent, f )
342 DlgRef_2Sel1Spin3Check1Spin::~DlgRef_2Sel1Spin3Check1Spin()
346 //////////////////////////////////////////
348 //////////////////////////////////////////
350 DlgRef_2Sel1Spin::DlgRef_2Sel1Spin( QWidget* parent, Qt::WindowFlags f )
351 : QWidget( parent, f )
356 DlgRef_2Sel1Spin::~DlgRef_2Sel1Spin()
360 //////////////////////////////////////////
361 // DlgRef_2Sel1SpinInt
362 //////////////////////////////////////////
364 DlgRef_2Sel1SpinInt::DlgRef_2Sel1SpinInt( QWidget* parent, Qt::WindowFlags f )
365 : QWidget( parent, f )
370 DlgRef_2Sel1SpinInt::~DlgRef_2Sel1SpinInt()
374 //////////////////////////////////////////
376 //////////////////////////////////////////
378 DlgRef_2Sel2List::DlgRef_2Sel2List( QWidget* parent, Qt::WindowFlags f )
379 : QWidget( parent, f )
384 DlgRef_2Sel2List::~DlgRef_2Sel2List()
388 //////////////////////////////////////////
389 // DlgRef_2Sel2Spin1Check
390 //////////////////////////////////////////
392 DlgRef_2Sel2Spin1Check::DlgRef_2Sel2Spin1Check( QWidget* parent, Qt::WindowFlags f )
393 : QWidget( parent, f )
398 DlgRef_2Sel2Spin1Check::~DlgRef_2Sel2Spin1Check()
402 //////////////////////////////////////////
403 // DlgRef_2Sel2Spin3Check
404 //////////////////////////////////////////
406 DlgRef_2Sel2Spin3Check::DlgRef_2Sel2Spin3Check( QWidget* parent, Qt::WindowFlags f )
407 : QWidget( parent, f )
412 DlgRef_2Sel2Spin3Check::~DlgRef_2Sel2Spin3Check()
416 //////////////////////////////////////////
418 //////////////////////////////////////////
420 DlgRef_2Sel2Spin::DlgRef_2Sel2Spin( QWidget* parent, Qt::WindowFlags f )
421 : QWidget( parent, f )
426 DlgRef_2Sel2Spin::~DlgRef_2Sel2Spin()
430 //////////////////////////////////////////
431 // DlgRef_2Sel2Spin1Push
432 //////////////////////////////////////////
434 DlgRef_2Sel2Spin1Push::DlgRef_2Sel2Spin1Push( QWidget* parent, Qt::WindowFlags f )
435 : QWidget( parent, f )
440 DlgRef_2Sel2Spin1Push::~DlgRef_2Sel2Spin1Push()
444 //////////////////////////////////////////
445 // DlgRef_2Sel2Spin2Push
446 //////////////////////////////////////////
448 DlgRef_2Sel2Spin2Push::DlgRef_2Sel2Spin2Push( QWidget* parent, Qt::WindowFlags f )
449 : QWidget( parent, f )
454 DlgRef_2Sel2Spin2Push::~DlgRef_2Sel2Spin2Push()
458 //////////////////////////////////////////
459 // DlgRef_2Sel3Spin2Rb
460 //////////////////////////////////////////
462 DlgRef_2Sel3Spin2Rb::DlgRef_2Sel3Spin2Rb( QWidget* parent, Qt::WindowFlags f )
463 : QWidget( parent, f )
468 DlgRef_2Sel3Spin2Rb::~DlgRef_2Sel3Spin2Rb()
472 //////////////////////////////////////////
474 //////////////////////////////////////////
476 DlgRef_2Sel3Spin::DlgRef_2Sel3Spin( QWidget* parent, Qt::WindowFlags f )
477 : QWidget( parent, f )
482 DlgRef_2Sel3Spin::~DlgRef_2Sel3Spin()
486 //////////////////////////////////////////
488 //////////////////////////////////////////
490 DlgRef_2Sel::DlgRef_2Sel( QWidget* parent, Qt::WindowFlags f )
491 : QWidget( parent, f )
496 DlgRef_2Sel::~DlgRef_2Sel()
500 //////////////////////////////////////////
502 //////////////////////////////////////////
504 DlgRef_2SelExt::DlgRef_2SelExt( QWidget* parent, Qt::WindowFlags f )
505 : QWidget( parent, f )
510 DlgRef_2SelExt::~DlgRef_2SelExt()
514 //////////////////////////////////////////
516 //////////////////////////////////////////
518 DlgRef_2Spin::DlgRef_2Spin( QWidget* parent, Qt::WindowFlags f )
519 : QWidget( parent, f )
524 DlgRef_2Spin::~DlgRef_2Spin()
528 //////////////////////////////////////////
530 //////////////////////////////////////////
532 DlgRef_3Check::DlgRef_3Check( QWidget* parent, Qt::WindowFlags f )
533 : QWidget( parent, f )
538 DlgRef_3Check::~DlgRef_3Check()
542 //////////////////////////////////////////
544 //////////////////////////////////////////
546 DlgRef_3Radio::DlgRef_3Radio( QWidget* parent, Qt::WindowFlags f )
547 : QWidget( parent, f )
552 DlgRef_3Radio::~DlgRef_3Radio()
556 //////////////////////////////////////////
557 // DlgRef_3Radio1Sel1Spin
558 //////////////////////////////////////////
560 DlgRef_3Radio1Sel1Spin::DlgRef_3Radio1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
561 : QWidget( parent, f )
566 DlgRef_3Radio1Sel1Spin::~DlgRef_3Radio1Sel1Spin()
570 //////////////////////////////////////////
572 //////////////////////////////////////////
574 DlgRef_3Sel1Check::DlgRef_3Sel1Check( QWidget* parent, Qt::WindowFlags f )
575 : QWidget( parent, f )
580 DlgRef_3Sel1Check::~DlgRef_3Sel1Check()
584 //////////////////////////////////////////
586 //////////////////////////////////////////
588 DlgRef_3Sel1Spin::DlgRef_3Sel1Spin( QWidget* parent, Qt::WindowFlags f )
589 : QWidget( parent, f )
594 DlgRef_3Sel1Spin::~DlgRef_3Sel1Spin()
598 //////////////////////////////////////////
600 //////////////////////////////////////////
602 DlgRef_3Sel2Spin::DlgRef_3Sel2Spin( QWidget* parent, Qt::WindowFlags f )
603 : QWidget( parent, f )
608 DlgRef_3Sel2Spin::~DlgRef_3Sel2Spin()
612 //////////////////////////////////////////
613 // DlgRef_3Sel3Spin1Check
614 //////////////////////////////////////////
616 DlgRef_3Sel3Spin1Check::DlgRef_3Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
617 : QWidget( parent, f )
622 DlgRef_3Sel3Spin1Check::~DlgRef_3Sel3Spin1Check()
626 void DlgRef_3Sel3Spin1Check::ShowRows( int fromRow, int toRow, bool toShow )
628 const int maxRows = 7;
630 if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
631 int c = gridLayout1->count();
632 for ( int i = 0; i < c; i++ ) {
633 QWidget* w = gridLayout1->itemAt( i )->widget();
634 int row, col, rowspan, colspan;
635 gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
636 if ( w && row >= fromRow && row <= toRow )
637 w->setVisible( toShow );
642 //////////////////////////////////////////
643 // DlgRef_3Sel2Check3Spin
644 //////////////////////////////////////////
646 DlgRef_3Sel2Check3Spin::DlgRef_3Sel2Check3Spin( QWidget* parent, Qt::WindowFlags f )
647 : QWidget( parent, f )
652 DlgRef_3Sel2Check3Spin::~DlgRef_3Sel2Check3Spin()
656 void DlgRef_3Sel2Check3Spin::ShowRows( int fromRow, int toRow, bool toShow )
658 const int maxRows = 8;
660 if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
661 int c = gridLayout1->count();
662 for ( int i = 0; i < c; i++ ) {
663 QWidget* w = gridLayout1->itemAt( i )->widget();
664 int row, col, rowspan, colspan;
665 gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
666 if ( w && row >= fromRow && row <= toRow )
667 w->setVisible( toShow );
672 //////////////////////////////////////////
673 // DlgRef_3Sel3Spin2Check
674 //////////////////////////////////////////
676 DlgRef_3Sel3Spin2Check::DlgRef_3Sel3Spin2Check( QWidget* parent, Qt::WindowFlags f )
677 : QWidget( parent, f )
682 DlgRef_3Sel3Spin2Check::~DlgRef_3Sel3Spin2Check()
686 void DlgRef_3Sel3Spin2Check::ShowRows( int fromRow, int toRow, bool toShow )
688 const int maxRows = 8;
690 if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
691 int c = gridLayout1->count();
692 for ( int i = 0; i < c; i++ ) {
693 QWidget* w = gridLayout1->itemAt( i )->widget();
694 int row, col, rowspan, colspan;
695 gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
696 if ( w && row >= fromRow && row <= toRow )
697 w->setVisible( toShow );
702 //////////////////////////////////////////
703 // DlgRef_3Sel4Spin2Check
704 //////////////////////////////////////////
706 DlgRef_3Sel4Spin2Check::DlgRef_3Sel4Spin2Check( QWidget* parent, Qt::WindowFlags f )
707 : QWidget( parent, f )
712 DlgRef_3Sel4Spin2Check::~DlgRef_3Sel4Spin2Check()
716 //////////////////////////////////////////
718 //////////////////////////////////////////
720 DlgRef_3Sel::DlgRef_3Sel( QWidget* parent, Qt::WindowFlags f )
721 : QWidget( parent, f )
726 DlgRef_3Sel::~DlgRef_3Sel()
730 //////////////////////////////////////////
731 // DlgRef_3Spin1Check
732 //////////////////////////////////////////
734 DlgRef_3Spin1Check::DlgRef_3Spin1Check( QWidget* parent, Qt::WindowFlags f )
735 : QWidget( parent, f )
740 DlgRef_3Spin1Check::~DlgRef_3Spin1Check()
744 //////////////////////////////////////////
746 //////////////////////////////////////////
748 DlgRef_3Spin::DlgRef_3Spin( QWidget* parent, Qt::WindowFlags f )
749 : QWidget( parent, f )
754 DlgRef_3Spin::~DlgRef_3Spin()
758 //////////////////////////////////////////
760 //////////////////////////////////////////
762 DlgRef_4Spin::DlgRef_4Spin( QWidget* parent, Qt::WindowFlags f )
763 : QWidget( parent, f )
768 DlgRef_4Spin::~DlgRef_4Spin()
772 //////////////////////////////////////////
773 // DlgRef_4Sel1List1Check
774 //////////////////////////////////////////
776 DlgRef_4Sel1List1Check::DlgRef_4Sel1List1Check( QWidget* parent, Qt::WindowFlags f )
777 : QWidget( parent, f )
782 DlgRef_4Sel1List1Check::~DlgRef_4Sel1List1Check()
786 //////////////////////////////////////////
788 //////////////////////////////////////////
790 DlgRef_4Sel1List::DlgRef_4Sel1List( QWidget* parent, Qt::WindowFlags f )
791 : QWidget( parent, f )
796 DlgRef_4Sel1List::~DlgRef_4Sel1List()
800 //////////////////////////////////////////
801 // DlgRef_4Sel1Spin2Check
802 //////////////////////////////////////////
804 DlgRef_4Sel1Spin2Check::DlgRef_4Sel1Spin2Check( QWidget* parent, Qt::WindowFlags f )
805 : QWidget( parent, f )
810 DlgRef_4Sel1Spin2Check::~DlgRef_4Sel1Spin2Check()
814 void DlgRef_4Sel1Spin2Check::ShowRows( int fromRow, int toRow, bool toShow )
816 const int maxRows = 6;
818 if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
819 int c = gridLayout1->count();
820 for ( int i = 0; i < c; i++ ) {
821 QWidget* w = gridLayout1->itemAt( i )->widget();
822 int row, col, rowspan, colspan;
823 gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
824 if ( w && row >= fromRow && row <= toRow )
825 w->setVisible( toShow );
830 //////////////////////////////////////////
831 // DlgRef_4Sel1Spin3Check
832 //////////////////////////////////////////
834 DlgRef_4Sel1Spin3Check::DlgRef_4Sel1Spin3Check( QWidget* parent, Qt::WindowFlags f )
835 : QWidget( parent, f )
840 DlgRef_4Sel1Spin3Check::~DlgRef_4Sel1Spin3Check()
844 //////////////////////////////////////////
846 //////////////////////////////////////////
848 DlgRef_6Sel::DlgRef_6Sel( QWidget* parent, Qt::WindowFlags f )
849 : QWidget( parent, f )
854 DlgRef_6Sel::~DlgRef_6Sel()
858 //////////////////////////////////////////
860 //////////////////////////////////////////
862 DlgRef_Skeleton::DlgRef_Skeleton( QWidget* parent, Qt::WindowFlags f )
863 : QWidget( parent, f )
868 DlgRef_Skeleton::~DlgRef_Skeleton()
872 //////////////////////////////////////////
874 //////////////////////////////////////////
876 QString DlgRef::PrintDoubleValue( double theValue, int thePrecision )
878 const double prec = 1e-12;
880 if ( qAbs(theValue) < prec )
883 QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( thePrecision ) );
887 while ( p < thePrecision ) {
888 QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( p++ ) );
889 double v = aRes.toDouble();
890 double err = qAbs( theValue - v );
891 if ( err > 0 && err <= prec )
896 // remove trailing zeroes
898 QRegExp expre( QString( "(%1|%2)[+-]?[0-9]+$" ).arg( QLocale().exponential().toLower(),
899 QLocale().exponential().toUpper() ) );
901 int idx = aRes.indexOf( expre );
902 QString aResExp = "";
904 aResExp = aRes.mid( idx );
905 aRes = aRes.left( idx );
908 if ( aRes.contains( QLocale().decimalPoint() ) )
909 aRes.remove( QRegExp( QString( "(\\%1|0)0*$" ).arg( QLocale().decimalPoint() ) ) );
911 return aRes == "-0" ? QString( "0" ) : aRes + aResExp;