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_1Check1Spin1Check
26 //////////////////////////////////////////
28 DlgRef_1Check1Spin1Check::DlgRef_1Check1Spin1Check( QWidget* parent, Qt::WindowFlags f )
29 : QWidget( parent, f )
34 DlgRef_1Check1Spin1Check::~DlgRef_1Check1Spin1Check()
38 //////////////////////////////////////////
39 // DlgRef_1List1Spin1Btn
40 //////////////////////////////////////////
42 DlgRef_1List1Spin1Btn::DlgRef_1List1Spin1Btn( QWidget* parent, Qt::WindowFlags f )
43 : QWidget( parent, f )
48 DlgRef_1List1Spin1Btn::~DlgRef_1List1Spin1Btn()
52 //////////////////////////////////////////
53 // DlgRef_1Sel1Check1List
54 //////////////////////////////////////////
56 DlgRef_1Sel1Check1List::DlgRef_1Sel1Check1List( QWidget* parent, Qt::WindowFlags f )
57 : QWidget( parent, f )
62 DlgRef_1Sel1Check1List::~DlgRef_1Sel1Check1List()
66 //////////////////////////////////////////
67 // DlgRef_1Sel1Check1Sel
68 //////////////////////////////////////////
70 DlgRef_1Sel1Check1Sel::DlgRef_1Sel1Check1Sel( QWidget* parent, Qt::WindowFlags f )
71 : QWidget( parent, f )
76 DlgRef_1Sel1Check1Sel::~DlgRef_1Sel1Check1Sel()
80 //////////////////////////////////////////
82 //////////////////////////////////////////
84 DlgRef_1Sel1Check::DlgRef_1Sel1Check( QWidget* parent, Qt::WindowFlags f )
85 : QWidget( parent, f )
90 DlgRef_1Sel1Check::~DlgRef_1Sel1Check()
94 //////////////////////////////////////////
96 //////////////////////////////////////////
98 DlgRef_1Sel1Frame::DlgRef_1Sel1Frame( QWidget* parent, Qt::WindowFlags f )
99 : QWidget( parent, f )
104 DlgRef_1Sel1Frame::~DlgRef_1Sel1Frame()
108 //////////////////////////////////////////
109 // DlgRef_1Sel1List1Check3Btn
110 //////////////////////////////////////////
112 DlgRef_1Sel1List1Check3Btn::DlgRef_1Sel1List1Check3Btn( QWidget* parent, Qt::WindowFlags f )
113 : QWidget( parent, f )
118 DlgRef_1Sel1List1Check3Btn::~DlgRef_1Sel1List1Check3Btn()
122 //////////////////////////////////////////
123 // DlgRef_1Sel1Spin1Check
124 //////////////////////////////////////////
126 DlgRef_1Sel1Spin1Check::DlgRef_1Sel1Spin1Check( QWidget* parent, Qt::WindowFlags f )
127 : QWidget( parent, f )
132 DlgRef_1Sel1Spin1Check::~DlgRef_1Sel1Spin1Check()
136 //////////////////////////////////////////
138 //////////////////////////////////////////
140 DlgRef_1Sel1Spin::DlgRef_1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
141 : QWidget( parent, f )
146 DlgRef_1Sel1Spin::~DlgRef_1Sel1Spin()
150 //////////////////////////////////////////
151 // DlgRef_1Sel2Spin1View1Check
152 //////////////////////////////////////////
154 DlgRef_1Sel2Spin1View1Check::DlgRef_1Sel2Spin1View1Check( QWidget* parent, Qt::WindowFlags f )
155 : QWidget( parent, f )
160 DlgRef_1Sel2Spin1View1Check::~DlgRef_1Sel2Spin1View1Check()
164 //////////////////////////////////////////
166 //////////////////////////////////////////
168 DlgRef_1Sel2Spin::DlgRef_1Sel2Spin( QWidget* parent, Qt::WindowFlags f )
169 : QWidget( parent, f )
174 DlgRef_1Sel2Spin::~DlgRef_1Sel2Spin()
178 //////////////////////////////////////////
180 //////////////////////////////////////////
182 DlgRef_1Sel3Check::DlgRef_1Sel3Check( QWidget* parent, Qt::WindowFlags f )
183 : QWidget( parent, f )
188 DlgRef_1Sel3Check::~DlgRef_1Sel3Check()
192 //////////////////////////////////////////
194 //////////////////////////////////////////
196 DlgRef_1Sel3Spin::DlgRef_1Sel3Spin( QWidget* parent, Qt::WindowFlags f )
197 : QWidget( parent, f )
202 DlgRef_1Sel3Spin::~DlgRef_1Sel3Spin()
206 //////////////////////////////////////////
207 // DlgRef_1Sel3Spin2Check1Spin
208 //////////////////////////////////////////
210 DlgRef_1Sel3Spin2Check1Spin::DlgRef_1Sel3Spin2Check1Spin( QWidget* parent, Qt::WindowFlags f )
211 : QWidget( parent, f )
216 DlgRef_1Sel3Spin2Check1Spin::~DlgRef_1Sel3Spin2Check1Spin()
220 //////////////////////////////////////////
221 // DlgRef_1Sel3Spin1Check
222 //////////////////////////////////////////
224 DlgRef_1Sel3Spin1Check::DlgRef_1Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
225 : QWidget( parent, f )
230 DlgRef_1Sel3Spin1Check::~DlgRef_1Sel3Spin1Check()
234 //////////////////////////////////////////
235 // DlgRef_1Sel5Spin1Check
236 //////////////////////////////////////////
238 DlgRef_1Sel5Spin1Check::DlgRef_1Sel5Spin1Check( QWidget* parent, Qt::WindowFlags f )
239 : QWidget( parent, f )
244 DlgRef_1Sel5Spin1Check::~DlgRef_1Sel5Spin1Check()
248 //////////////////////////////////////////
250 //////////////////////////////////////////
252 DlgRef_1Spin::DlgRef_1Spin( QWidget* parent, Qt::WindowFlags f )
253 : QWidget( parent, f )
258 DlgRef_1Spin::~DlgRef_1Spin()
262 //////////////////////////////////////////
264 //////////////////////////////////////////
266 DlgRef_1Sel::DlgRef_1Sel( QWidget* parent, Qt::WindowFlags f )
267 : QWidget( parent, f )
272 DlgRef_1Sel::~DlgRef_1Sel()
276 //////////////////////////////////////////
278 //////////////////////////////////////////
280 DlgRef_1SelExt::DlgRef_1SelExt( QWidget* parent, Qt::WindowFlags f )
281 : QWidget( parent, f )
286 DlgRef_1SelExt::~DlgRef_1SelExt()
290 //////////////////////////////////////////
291 // DlgRef_2Sel1List1Check
292 //////////////////////////////////////////
294 DlgRef_2Sel1List1Check::DlgRef_2Sel1List1Check( QWidget* parent, Qt::WindowFlags f )
295 : QWidget( parent, f )
300 DlgRef_2Sel1List1Check::~DlgRef_2Sel1List1Check()
304 //////////////////////////////////////////
305 // DlgRef_2Sel1List2Check
306 //////////////////////////////////////////
308 DlgRef_2Sel1List2Check::DlgRef_2Sel1List2Check( QWidget* parent, Qt::WindowFlags f )
309 : QWidget( parent, f )
314 DlgRef_2Sel1List2Check::~DlgRef_2Sel1List2Check()
318 //////////////////////////////////////////
320 //////////////////////////////////////////
322 DlgRef_2Sel1List::DlgRef_2Sel1List( QWidget* parent, Qt::WindowFlags f )
323 : QWidget( parent, f )
328 DlgRef_2Sel1List::~DlgRef_2Sel1List()
332 //////////////////////////////////////////
333 // DlgRef_2Sel1Spin2Check
334 //////////////////////////////////////////
336 DlgRef_2Sel1Spin2Check::DlgRef_2Sel1Spin2Check( QWidget* parent, Qt::WindowFlags f )
337 : QWidget( parent, f )
342 DlgRef_2Sel1Spin2Check::~DlgRef_2Sel1Spin2Check()
346 //////////////////////////////////////////
347 // DlgRef_2Sel1Spin3Check1Spin
348 //////////////////////////////////////////
350 DlgRef_2Sel1Spin3Check1Spin::DlgRef_2Sel1Spin3Check1Spin( QWidget* parent, Qt::WindowFlags f )
351 : QWidget( parent, f )
356 DlgRef_2Sel1Spin3Check1Spin::~DlgRef_2Sel1Spin3Check1Spin()
360 //////////////////////////////////////////
362 //////////////////////////////////////////
364 DlgRef_2Sel1Spin::DlgRef_2Sel1Spin( QWidget* parent, Qt::WindowFlags f )
365 : QWidget( parent, f )
370 DlgRef_2Sel1Spin::~DlgRef_2Sel1Spin()
374 //////////////////////////////////////////
375 // DlgRef_2Sel1SpinInt
376 //////////////////////////////////////////
378 DlgRef_2Sel1SpinInt::DlgRef_2Sel1SpinInt( QWidget* parent, Qt::WindowFlags f )
379 : QWidget( parent, f )
384 DlgRef_2Sel1SpinInt::~DlgRef_2Sel1SpinInt()
388 //////////////////////////////////////////
390 //////////////////////////////////////////
392 DlgRef_2Sel2List::DlgRef_2Sel2List( QWidget* parent, Qt::WindowFlags f )
393 : QWidget( parent, f )
398 DlgRef_2Sel2List::~DlgRef_2Sel2List()
402 //////////////////////////////////////////
403 // DlgRef_2Sel2Spin1Check
404 //////////////////////////////////////////
406 DlgRef_2Sel2Spin1Check::DlgRef_2Sel2Spin1Check( QWidget* parent, Qt::WindowFlags f )
407 : QWidget( parent, f )
412 DlgRef_2Sel2Spin1Check::~DlgRef_2Sel2Spin1Check()
416 //////////////////////////////////////////
417 // DlgRef_2Sel2Spin3Check
418 //////////////////////////////////////////
420 DlgRef_2Sel2Spin3Check::DlgRef_2Sel2Spin3Check( QWidget* parent, Qt::WindowFlags f )
421 : QWidget( parent, f )
426 DlgRef_2Sel2Spin3Check::~DlgRef_2Sel2Spin3Check()
430 //////////////////////////////////////////
432 //////////////////////////////////////////
434 DlgRef_2Sel2Spin::DlgRef_2Sel2Spin( QWidget* parent, Qt::WindowFlags f )
435 : QWidget( parent, f )
440 DlgRef_2Sel2Spin::~DlgRef_2Sel2Spin()
444 //////////////////////////////////////////
445 // DlgRef_2Sel2Spin1Push
446 //////////////////////////////////////////
448 DlgRef_2Sel2Spin1Push::DlgRef_2Sel2Spin1Push( QWidget* parent, Qt::WindowFlags f )
449 : QWidget( parent, f )
454 DlgRef_2Sel2Spin1Push::~DlgRef_2Sel2Spin1Push()
458 //////////////////////////////////////////
459 // DlgRef_2Sel2Spin2Push
460 //////////////////////////////////////////
462 DlgRef_2Sel2Spin2Push::DlgRef_2Sel2Spin2Push( QWidget* parent, Qt::WindowFlags f )
463 : QWidget( parent, f )
468 DlgRef_2Sel2Spin2Push::~DlgRef_2Sel2Spin2Push()
472 //////////////////////////////////////////
473 // DlgRef_2Sel3Spin2Rb
474 //////////////////////////////////////////
476 DlgRef_2Sel3Spin2Rb::DlgRef_2Sel3Spin2Rb( QWidget* parent, Qt::WindowFlags f )
477 : QWidget( parent, f )
482 DlgRef_2Sel3Spin2Rb::~DlgRef_2Sel3Spin2Rb()
486 //////////////////////////////////////////
488 //////////////////////////////////////////
490 DlgRef_2Sel3Spin::DlgRef_2Sel3Spin( QWidget* parent, Qt::WindowFlags f )
491 : QWidget( parent, f )
496 DlgRef_2Sel3Spin::~DlgRef_2Sel3Spin()
500 //////////////////////////////////////////
502 //////////////////////////////////////////
504 DlgRef_2Sel::DlgRef_2Sel( QWidget* parent, Qt::WindowFlags f )
505 : QWidget( parent, f )
510 DlgRef_2Sel::~DlgRef_2Sel()
514 //////////////////////////////////////////
516 //////////////////////////////////////////
518 DlgRef_2SelExt::DlgRef_2SelExt( QWidget* parent, Qt::WindowFlags f )
519 : QWidget( parent, f )
524 DlgRef_2SelExt::~DlgRef_2SelExt()
528 //////////////////////////////////////////
530 //////////////////////////////////////////
532 DlgRef_2Spin::DlgRef_2Spin( QWidget* parent, Qt::WindowFlags f )
533 : QWidget( parent, f )
538 DlgRef_2Spin::~DlgRef_2Spin()
542 //////////////////////////////////////////
544 //////////////////////////////////////////
546 DlgRef_3Check::DlgRef_3Check( QWidget* parent, Qt::WindowFlags f )
547 : QWidget( parent, f )
552 DlgRef_3Check::~DlgRef_3Check()
556 //////////////////////////////////////////
558 //////////////////////////////////////////
560 DlgRef_3Radio::DlgRef_3Radio( QWidget* parent, Qt::WindowFlags f )
561 : QWidget( parent, f )
566 DlgRef_3Radio::~DlgRef_3Radio()
570 //////////////////////////////////////////
571 // DlgRef_3Radio1Sel1Spin
572 //////////////////////////////////////////
574 DlgRef_3Radio1Sel1Spin::DlgRef_3Radio1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
575 : QWidget( parent, f )
580 DlgRef_3Radio1Sel1Spin::~DlgRef_3Radio1Sel1Spin()
584 //////////////////////////////////////////
586 //////////////////////////////////////////
588 DlgRef_3Sel1Check::DlgRef_3Sel1Check( QWidget* parent, Qt::WindowFlags f )
589 : QWidget( parent, f )
594 DlgRef_3Sel1Check::~DlgRef_3Sel1Check()
598 //////////////////////////////////////////
600 //////////////////////////////////////////
602 DlgRef_3Sel1Spin::DlgRef_3Sel1Spin( QWidget* parent, Qt::WindowFlags f )
603 : QWidget( parent, f )
608 DlgRef_3Sel1Spin::~DlgRef_3Sel1Spin()
612 //////////////////////////////////////////
614 //////////////////////////////////////////
616 DlgRef_3Sel2Spin::DlgRef_3Sel2Spin( QWidget* parent, Qt::WindowFlags f )
617 : QWidget( parent, f )
622 DlgRef_3Sel2Spin::~DlgRef_3Sel2Spin()
626 //////////////////////////////////////////
627 // DlgRef_3Sel3Spin1Check
628 //////////////////////////////////////////
630 DlgRef_3Sel3Spin1Check::DlgRef_3Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
631 : QWidget( parent, f )
636 DlgRef_3Sel3Spin1Check::~DlgRef_3Sel3Spin1Check()
640 void DlgRef_3Sel3Spin1Check::ShowRows( int fromRow, int toRow, bool toShow )
642 const int maxRows = 7;
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 );
656 //////////////////////////////////////////
657 // DlgRef_3Sel2Check3Spin
658 //////////////////////////////////////////
660 DlgRef_3Sel2Check3Spin::DlgRef_3Sel2Check3Spin( QWidget* parent, Qt::WindowFlags f )
661 : QWidget( parent, f )
666 DlgRef_3Sel2Check3Spin::~DlgRef_3Sel2Check3Spin()
670 void DlgRef_3Sel2Check3Spin::ShowRows( int fromRow, int toRow, bool toShow )
672 const int maxRows = 8;
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 );
686 //////////////////////////////////////////
687 // DlgRef_3Sel3Spin2Check
688 //////////////////////////////////////////
690 DlgRef_3Sel3Spin2Check::DlgRef_3Sel3Spin2Check( QWidget* parent, Qt::WindowFlags f )
691 : QWidget( parent, f )
696 DlgRef_3Sel3Spin2Check::~DlgRef_3Sel3Spin2Check()
700 void DlgRef_3Sel3Spin2Check::ShowRows( int fromRow, int toRow, bool toShow )
702 const int maxRows = 8;
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 );
716 //////////////////////////////////////////
717 // DlgRef_3Sel4Spin2Check
718 //////////////////////////////////////////
720 DlgRef_3Sel4Spin2Check::DlgRef_3Sel4Spin2Check( QWidget* parent, Qt::WindowFlags f )
721 : QWidget( parent, f )
726 DlgRef_3Sel4Spin2Check::~DlgRef_3Sel4Spin2Check()
730 //////////////////////////////////////////
732 //////////////////////////////////////////
734 DlgRef_3Sel::DlgRef_3Sel( QWidget* parent, Qt::WindowFlags f )
735 : QWidget( parent, f )
740 DlgRef_3Sel::~DlgRef_3Sel()
744 //////////////////////////////////////////
745 // DlgRef_3Spin1Check
746 //////////////////////////////////////////
748 DlgRef_3Spin1Check::DlgRef_3Spin1Check( QWidget* parent, Qt::WindowFlags f )
749 : QWidget( parent, f )
754 DlgRef_3Spin1Check::~DlgRef_3Spin1Check()
758 //////////////////////////////////////////
760 //////////////////////////////////////////
762 DlgRef_3Spin::DlgRef_3Spin( QWidget* parent, Qt::WindowFlags f )
763 : QWidget( parent, f )
768 DlgRef_3Spin::~DlgRef_3Spin()
772 //////////////////////////////////////////
774 //////////////////////////////////////////
776 DlgRef_4Spin::DlgRef_4Spin( QWidget* parent, Qt::WindowFlags f )
777 : QWidget( parent, f )
782 DlgRef_4Spin::~DlgRef_4Spin()
786 //////////////////////////////////////////
787 // DlgRef_4Sel1List1Check
788 //////////////////////////////////////////
790 DlgRef_4Sel1List1Check::DlgRef_4Sel1List1Check( QWidget* parent, Qt::WindowFlags f )
791 : QWidget( parent, f )
796 DlgRef_4Sel1List1Check::~DlgRef_4Sel1List1Check()
800 //////////////////////////////////////////
802 //////////////////////////////////////////
804 DlgRef_4Sel1List::DlgRef_4Sel1List( QWidget* parent, Qt::WindowFlags f )
805 : QWidget( parent, f )
810 DlgRef_4Sel1List::~DlgRef_4Sel1List()
814 //////////////////////////////////////////
815 // DlgRef_4Sel1Spin2Check
816 //////////////////////////////////////////
818 DlgRef_4Sel1Spin2Check::DlgRef_4Sel1Spin2Check( QWidget* parent, Qt::WindowFlags f )
819 : QWidget( parent, f )
824 DlgRef_4Sel1Spin2Check::~DlgRef_4Sel1Spin2Check()
828 void DlgRef_4Sel1Spin2Check::ShowRows( int fromRow, int toRow, bool toShow )
830 const int maxRows = 6;
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 );
844 //////////////////////////////////////////
845 // DlgRef_4Sel1Spin3Check
846 //////////////////////////////////////////
848 DlgRef_4Sel1Spin3Check::DlgRef_4Sel1Spin3Check( QWidget* parent, Qt::WindowFlags f )
849 : QWidget( parent, f )
854 DlgRef_4Sel1Spin3Check::~DlgRef_4Sel1Spin3Check()
858 //////////////////////////////////////////
860 //////////////////////////////////////////
862 DlgRef_6Sel::DlgRef_6Sel( QWidget* parent, Qt::WindowFlags f )
863 : QWidget( parent, f )
868 DlgRef_6Sel::~DlgRef_6Sel()
872 //////////////////////////////////////////
874 //////////////////////////////////////////
876 DlgRef_Skeleton::DlgRef_Skeleton( QWidget* parent, Qt::WindowFlags f )
877 : QWidget( parent, f )
882 DlgRef_Skeleton::~DlgRef_Skeleton()
886 //////////////////////////////////////////
888 //////////////////////////////////////////
890 QString DlgRef::PrintDoubleValue( double theValue, int thePrecision )
892 const double prec = 1e-12;
894 if ( qAbs(theValue) < prec )
897 QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( thePrecision ) );
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 )
910 // remove trailing zeroes
912 QRegExp expre( QString( "(%1|%2)[+-]?[0-9]+$" ).arg( QLocale().exponential().toLower(),
913 QLocale().exponential().toUpper() ) );
915 int idx = aRes.indexOf( expre );
916 QString aResExp = "";
918 aResExp = aRes.mid( idx );
919 aRes = aRes.left( idx );
922 if ( aRes.contains( QLocale().decimalPoint() ) )
923 aRes.remove( QRegExp( QString( "(\\%1|0)0*$" ).arg( QLocale().decimalPoint() ) ) );
925 return aRes == "-0" ? QString( "0" ) : aRes + aResExp;