1 // Copyright (C) 2007-2011 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
21 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
25 //////////////////////////////////////////
26 // DlgRef_1List1Spin1Btn
27 //////////////////////////////////////////
29 DlgRef_1List1Spin1Btn::DlgRef_1List1Spin1Btn( QWidget* parent, Qt::WindowFlags f )
30 : QWidget( parent, f )
35 DlgRef_1List1Spin1Btn::~DlgRef_1List1Spin1Btn()
39 //////////////////////////////////////////
40 // DlgRef_1Sel1Check1List
41 //////////////////////////////////////////
43 DlgRef_1Sel1Check1List::DlgRef_1Sel1Check1List( QWidget* parent, Qt::WindowFlags f )
44 : QWidget( parent, f )
49 DlgRef_1Sel1Check1List::~DlgRef_1Sel1Check1List()
53 //////////////////////////////////////////
54 // DlgRef_1Sel1Check1Sel
55 //////////////////////////////////////////
57 DlgRef_1Sel1Check1Sel::DlgRef_1Sel1Check1Sel( QWidget* parent, Qt::WindowFlags f )
58 : QWidget( parent, f )
63 DlgRef_1Sel1Check1Sel::~DlgRef_1Sel1Check1Sel()
67 //////////////////////////////////////////
69 //////////////////////////////////////////
71 DlgRef_1Sel1Check::DlgRef_1Sel1Check( QWidget* parent, Qt::WindowFlags f )
72 : QWidget( parent, f )
77 DlgRef_1Sel1Check::~DlgRef_1Sel1Check()
81 //////////////////////////////////////////
82 // DlgRef_1Sel1List1Check3Btn
83 //////////////////////////////////////////
85 DlgRef_1Sel1List1Check3Btn::DlgRef_1Sel1List1Check3Btn( QWidget* parent, Qt::WindowFlags f )
86 : QWidget( parent, f )
91 DlgRef_1Sel1List1Check3Btn::~DlgRef_1Sel1List1Check3Btn()
95 //////////////////////////////////////////
96 // DlgRef_1Sel1Spin1Check
97 //////////////////////////////////////////
99 DlgRef_1Sel1Spin1Check::DlgRef_1Sel1Spin1Check( QWidget* parent, Qt::WindowFlags f )
100 : QWidget( parent, f )
105 DlgRef_1Sel1Spin1Check::~DlgRef_1Sel1Spin1Check()
109 //////////////////////////////////////////
111 //////////////////////////////////////////
113 DlgRef_1Sel1Spin::DlgRef_1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
114 : QWidget( parent, f )
119 DlgRef_1Sel1Spin::~DlgRef_1Sel1Spin()
123 //////////////////////////////////////////
124 // DlgRef_1Sel2Spin1View1Check
125 //////////////////////////////////////////
127 DlgRef_1Sel2Spin1View1Check::DlgRef_1Sel2Spin1View1Check( QWidget* parent, Qt::WindowFlags f )
128 : QWidget( parent, f )
133 DlgRef_1Sel2Spin1View1Check::~DlgRef_1Sel2Spin1View1Check()
137 //////////////////////////////////////////
139 //////////////////////////////////////////
141 DlgRef_1Sel2Spin::DlgRef_1Sel2Spin( QWidget* parent, Qt::WindowFlags f )
142 : QWidget( parent, f )
147 DlgRef_1Sel2Spin::~DlgRef_1Sel2Spin()
151 //////////////////////////////////////////
153 //////////////////////////////////////////
155 DlgRef_1Sel3Check::DlgRef_1Sel3Check( QWidget* parent, Qt::WindowFlags f )
156 : QWidget( parent, f )
161 DlgRef_1Sel3Check::~DlgRef_1Sel3Check()
165 //////////////////////////////////////////
167 //////////////////////////////////////////
169 DlgRef_1Sel3Spin::DlgRef_1Sel3Spin( QWidget* parent, Qt::WindowFlags f )
170 : QWidget( parent, f )
175 DlgRef_1Sel3Spin::~DlgRef_1Sel3Spin()
179 //////////////////////////////////////////
180 // DlgRef_1Sel3Spin1Check
181 //////////////////////////////////////////
183 DlgRef_1Sel3Spin1Check::DlgRef_1Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
184 : QWidget( parent, f )
189 DlgRef_1Sel3Spin1Check::~DlgRef_1Sel3Spin1Check()
193 //////////////////////////////////////////
194 // DlgRef_1Sel4Spin2Check
195 //////////////////////////////////////////
197 DlgRef_1Sel4Spin2Check::DlgRef_1Sel4Spin2Check( QWidget* parent, Qt::WindowFlags f )
198 : QWidget( parent, f )
203 DlgRef_1Sel4Spin2Check::~DlgRef_1Sel4Spin2Check()
207 //////////////////////////////////////////
209 //////////////////////////////////////////
211 DlgRef_1Sel4Spin::DlgRef_1Sel4Spin( QWidget* parent, Qt::WindowFlags f )
212 : QWidget( parent, f )
217 DlgRef_1Sel4Spin::~DlgRef_1Sel4Spin()
221 //////////////////////////////////////////
222 // DlgRef_1Sel5Spin1Check
223 //////////////////////////////////////////
225 DlgRef_1Sel5Spin1Check::DlgRef_1Sel5Spin1Check( QWidget* parent, Qt::WindowFlags f )
226 : QWidget( parent, f )
231 DlgRef_1Sel5Spin1Check::~DlgRef_1Sel5Spin1Check()
235 //////////////////////////////////////////
237 //////////////////////////////////////////
239 DlgRef_1Sel5Spin::DlgRef_1Sel5Spin( QWidget* parent, Qt::WindowFlags f )
240 : QWidget( parent, f )
245 DlgRef_1Sel5Spin::~DlgRef_1Sel5Spin()
249 //////////////////////////////////////////
251 //////////////////////////////////////////
253 DlgRef_1Spin::DlgRef_1Spin( QWidget* parent, Qt::WindowFlags f )
254 : QWidget( parent, f )
259 DlgRef_1Spin::~DlgRef_1Spin()
263 //////////////////////////////////////////
265 //////////////////////////////////////////
267 DlgRef_1Sel::DlgRef_1Sel( QWidget* parent, Qt::WindowFlags f )
268 : QWidget( parent, f )
273 DlgRef_1Sel::~DlgRef_1Sel()
277 //////////////////////////////////////////
279 //////////////////////////////////////////
281 DlgRef_1SelExt::DlgRef_1SelExt( QWidget* parent, Qt::WindowFlags f )
282 : QWidget( parent, f )
287 DlgRef_1SelExt::~DlgRef_1SelExt()
291 //////////////////////////////////////////
292 // DlgRef_2Sel1List1Check
293 //////////////////////////////////////////
295 DlgRef_2Sel1List1Check::DlgRef_2Sel1List1Check( QWidget* parent, Qt::WindowFlags f )
296 : QWidget( parent, f )
301 DlgRef_2Sel1List1Check::~DlgRef_2Sel1List1Check()
305 //////////////////////////////////////////
306 // DlgRef_2Sel1List2Check
307 //////////////////////////////////////////
309 DlgRef_2Sel1List2Check::DlgRef_2Sel1List2Check( QWidget* parent, Qt::WindowFlags f )
310 : QWidget( parent, f )
315 DlgRef_2Sel1List2Check::~DlgRef_2Sel1List2Check()
319 //////////////////////////////////////////
321 //////////////////////////////////////////
323 DlgRef_2Sel1List::DlgRef_2Sel1List( QWidget* parent, Qt::WindowFlags f )
324 : QWidget( parent, f )
329 DlgRef_2Sel1List::~DlgRef_2Sel1List()
333 //////////////////////////////////////////
334 // DlgRef_2Sel1Spin2Check
335 //////////////////////////////////////////
337 DlgRef_2Sel1Spin2Check::DlgRef_2Sel1Spin2Check( QWidget* parent, Qt::WindowFlags f )
338 : QWidget( parent, f )
343 DlgRef_2Sel1Spin2Check::~DlgRef_2Sel1Spin2Check()
347 //////////////////////////////////////////
349 //////////////////////////////////////////
351 DlgRef_2Sel1Spin::DlgRef_2Sel1Spin( QWidget* parent, Qt::WindowFlags f )
352 : QWidget( parent, f )
357 DlgRef_2Sel1Spin::~DlgRef_2Sel1Spin()
361 //////////////////////////////////////////
362 // DlgRef_2Sel1SpinInt
363 //////////////////////////////////////////
365 DlgRef_2Sel1SpinInt::DlgRef_2Sel1SpinInt( QWidget* parent, Qt::WindowFlags f )
366 : QWidget( parent, f )
371 DlgRef_2Sel1SpinInt::~DlgRef_2Sel1SpinInt()
375 //////////////////////////////////////////
377 //////////////////////////////////////////
379 DlgRef_2Sel2List::DlgRef_2Sel2List( QWidget* parent, Qt::WindowFlags f )
380 : QWidget( parent, f )
385 DlgRef_2Sel2List::~DlgRef_2Sel2List()
389 //////////////////////////////////////////
390 // DlgRef_2Sel2Spin1Check
391 //////////////////////////////////////////
393 DlgRef_2Sel2Spin1Check::DlgRef_2Sel2Spin1Check( QWidget* parent, Qt::WindowFlags f )
394 : QWidget( parent, f )
399 DlgRef_2Sel2Spin1Check::~DlgRef_2Sel2Spin1Check()
403 //////////////////////////////////////////
404 // DlgRef_2Sel2Spin3Check
405 //////////////////////////////////////////
407 DlgRef_2Sel2Spin3Check::DlgRef_2Sel2Spin3Check( QWidget* parent, Qt::WindowFlags f )
408 : QWidget( parent, f )
413 DlgRef_2Sel2Spin3Check::~DlgRef_2Sel2Spin3Check()
417 //////////////////////////////////////////
419 //////////////////////////////////////////
421 DlgRef_2Sel2Spin::DlgRef_2Sel2Spin( QWidget* parent, Qt::WindowFlags f )
422 : QWidget( parent, f )
427 DlgRef_2Sel2Spin::~DlgRef_2Sel2Spin()
431 //////////////////////////////////////////
432 // DlgRef_2Sel2Spin1Push
433 //////////////////////////////////////////
435 DlgRef_2Sel2Spin1Push::DlgRef_2Sel2Spin1Push( QWidget* parent, Qt::WindowFlags f )
436 : QWidget( parent, f )
441 DlgRef_2Sel2Spin1Push::~DlgRef_2Sel2Spin1Push()
445 //////////////////////////////////////////
446 // DlgRef_2Sel3Spin2Rb
447 //////////////////////////////////////////
449 DlgRef_2Sel3Spin2Rb::DlgRef_2Sel3Spin2Rb( QWidget* parent, Qt::WindowFlags f )
450 : QWidget( parent, f )
455 DlgRef_2Sel3Spin2Rb::~DlgRef_2Sel3Spin2Rb()
459 //////////////////////////////////////////
461 //////////////////////////////////////////
463 DlgRef_2Sel3Spin::DlgRef_2Sel3Spin( QWidget* parent, Qt::WindowFlags f )
464 : QWidget( parent, f )
469 DlgRef_2Sel3Spin::~DlgRef_2Sel3Spin()
473 //////////////////////////////////////////
474 // DlgRef_2Sel4Spin1Check
475 //////////////////////////////////////////
477 DlgRef_2Sel4Spin1Check::DlgRef_2Sel4Spin1Check( QWidget* parent, Qt::WindowFlags f )
478 : QWidget( parent, f )
483 DlgRef_2Sel4Spin1Check::~DlgRef_2Sel4Spin1Check()
487 //////////////////////////////////////////
489 //////////////////////////////////////////
491 DlgRef_2Sel::DlgRef_2Sel( QWidget* parent, Qt::WindowFlags f )
492 : QWidget( parent, f )
497 DlgRef_2Sel::~DlgRef_2Sel()
501 //////////////////////////////////////////
503 //////////////////////////////////////////
505 DlgRef_2SelExt::DlgRef_2SelExt( QWidget* parent, Qt::WindowFlags f )
506 : QWidget( parent, f )
511 DlgRef_2SelExt::~DlgRef_2SelExt()
515 //////////////////////////////////////////
517 //////////////////////////////////////////
519 DlgRef_2Spin::DlgRef_2Spin( QWidget* parent, Qt::WindowFlags f )
520 : QWidget( parent, f )
525 DlgRef_2Spin::~DlgRef_2Spin()
529 //////////////////////////////////////////
531 //////////////////////////////////////////
533 DlgRef_3Check::DlgRef_3Check( QWidget* parent, Qt::WindowFlags f )
534 : QWidget( parent, f )
539 DlgRef_3Check::~DlgRef_3Check()
543 //////////////////////////////////////////
545 //////////////////////////////////////////
547 DlgRef_3Radio::DlgRef_3Radio( QWidget* parent, Qt::WindowFlags f )
548 : QWidget( parent, f )
553 DlgRef_3Radio::~DlgRef_3Radio()
557 //////////////////////////////////////////
558 // DlgRef_3Radio1Sel1Spin
559 //////////////////////////////////////////
561 DlgRef_3Radio1Sel1Spin::DlgRef_3Radio1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
562 : QWidget( parent, f )
567 DlgRef_3Radio1Sel1Spin::~DlgRef_3Radio1Sel1Spin()
571 //////////////////////////////////////////
573 //////////////////////////////////////////
575 DlgRef_3Sel1Check::DlgRef_3Sel1Check( QWidget* parent, Qt::WindowFlags f )
576 : QWidget( parent, f )
581 DlgRef_3Sel1Check::~DlgRef_3Sel1Check()
585 //////////////////////////////////////////
587 //////////////////////////////////////////
589 DlgRef_3Sel1Spin::DlgRef_3Sel1Spin( QWidget* parent, Qt::WindowFlags f )
590 : QWidget( parent, f )
595 DlgRef_3Sel1Spin::~DlgRef_3Sel1Spin()
599 //////////////////////////////////////////
601 //////////////////////////////////////////
603 DlgRef_3Sel2Spin::DlgRef_3Sel2Spin( QWidget* parent, Qt::WindowFlags f )
604 : QWidget( parent, f )
609 DlgRef_3Sel2Spin::~DlgRef_3Sel2Spin()
613 //////////////////////////////////////////
614 // DlgRef_3Sel3Spin1Check
615 //////////////////////////////////////////
617 DlgRef_3Sel3Spin1Check::DlgRef_3Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
618 : QWidget( parent, f )
623 DlgRef_3Sel3Spin1Check::~DlgRef_3Sel3Spin1Check()
627 void DlgRef_3Sel3Spin1Check::ShowRows( int fromRow, int toRow, bool toShow )
629 const int maxRows = 7;
631 if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
632 int c = gridLayout1->count();
633 for ( int i = 0; i < c; i++ ) {
634 QWidget* w = gridLayout1->itemAt( i )->widget();
635 int row, col, rowspan, colspan;
636 gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
637 if ( w && row >= fromRow && row <= toRow )
638 w->setVisible( toShow );
643 //////////////////////////////////////////
644 // DlgRef_3Sel3Spin2Check
645 //////////////////////////////////////////
647 DlgRef_3Sel3Spin2Check::DlgRef_3Sel3Spin2Check( QWidget* parent, Qt::WindowFlags f )
648 : QWidget( parent, f )
653 DlgRef_3Sel3Spin2Check::~DlgRef_3Sel3Spin2Check()
657 void DlgRef_3Sel3Spin2Check::ShowRows( int fromRow, int toRow, bool toShow )
659 const int maxRows = 8;
661 if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
662 int c = gridLayout1->count();
663 for ( int i = 0; i < c; i++ ) {
664 QWidget* w = gridLayout1->itemAt( i )->widget();
665 int row, col, rowspan, colspan;
666 gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
667 if ( w && row >= fromRow && row <= toRow )
668 w->setVisible( toShow );
673 //////////////////////////////////////////
674 // DlgRef_3Sel4Spin2Check
675 //////////////////////////////////////////
677 DlgRef_3Sel4Spin2Check::DlgRef_3Sel4Spin2Check( QWidget* parent, Qt::WindowFlags f )
678 : QWidget( parent, f )
683 DlgRef_3Sel4Spin2Check::~DlgRef_3Sel4Spin2Check()
687 //////////////////////////////////////////
689 //////////////////////////////////////////
691 DlgRef_3Sel::DlgRef_3Sel( QWidget* parent, Qt::WindowFlags f )
692 : QWidget( parent, f )
697 DlgRef_3Sel::~DlgRef_3Sel()
701 //////////////////////////////////////////
702 // DlgRef_3Spin1Check
703 //////////////////////////////////////////
705 DlgRef_3Spin1Check::DlgRef_3Spin1Check( QWidget* parent, Qt::WindowFlags f )
706 : QWidget( parent, f )
711 DlgRef_3Spin1Check::~DlgRef_3Spin1Check()
715 //////////////////////////////////////////
717 //////////////////////////////////////////
719 DlgRef_3Spin::DlgRef_3Spin( QWidget* parent, Qt::WindowFlags f )
720 : QWidget( parent, f )
725 DlgRef_3Spin::~DlgRef_3Spin()
729 //////////////////////////////////////////
730 // DlgRef_4Sel1List1Check
731 //////////////////////////////////////////
733 DlgRef_4Sel1List1Check::DlgRef_4Sel1List1Check( QWidget* parent, Qt::WindowFlags f )
734 : QWidget( parent, f )
739 DlgRef_4Sel1List1Check::~DlgRef_4Sel1List1Check()
743 //////////////////////////////////////////
745 //////////////////////////////////////////
747 DlgRef_4Sel1List::DlgRef_4Sel1List( QWidget* parent, Qt::WindowFlags f )
748 : QWidget( parent, f )
753 DlgRef_4Sel1List::~DlgRef_4Sel1List()
757 //////////////////////////////////////////
758 // DlgRef_4Sel1Spin2Check
759 //////////////////////////////////////////
761 DlgRef_4Sel1Spin2Check::DlgRef_4Sel1Spin2Check( QWidget* parent, Qt::WindowFlags f )
762 : QWidget( parent, f )
767 DlgRef_4Sel1Spin2Check::~DlgRef_4Sel1Spin2Check()
771 void DlgRef_4Sel1Spin2Check::ShowRows( int fromRow, int toRow, bool toShow )
773 const int maxRows = 6;
775 if ( toRow >= fromRow && fromRow >= 0 && toRow <= maxRows ) {
776 int c = gridLayout1->count();
777 for ( int i = 0; i < c; i++ ) {
778 QWidget* w = gridLayout1->itemAt( i )->widget();
779 int row, col, rowspan, colspan;
780 gridLayout1->getItemPosition( i, &row, &col, &rowspan, &colspan );
781 if ( w && row >= fromRow && row <= toRow )
782 w->setVisible( toShow );
787 //////////////////////////////////////////
788 // DlgRef_4Sel1Spin3Check
789 //////////////////////////////////////////
791 DlgRef_4Sel1Spin3Check::DlgRef_4Sel1Spin3Check( QWidget* parent, Qt::WindowFlags f )
792 : QWidget( parent, f )
797 DlgRef_4Sel1Spin3Check::~DlgRef_4Sel1Spin3Check()
801 //////////////////////////////////////////
803 //////////////////////////////////////////
805 DlgRef_6Sel::DlgRef_6Sel( QWidget* parent, Qt::WindowFlags f )
806 : QWidget( parent, f )
811 DlgRef_6Sel::~DlgRef_6Sel()
815 //////////////////////////////////////////
817 //////////////////////////////////////////
819 DlgRef_Skeleton::DlgRef_Skeleton( QWidget* parent, Qt::WindowFlags f )
820 : QWidget( parent, f )
825 DlgRef_Skeleton::~DlgRef_Skeleton()
829 //////////////////////////////////////////
831 //////////////////////////////////////////
833 QString DlgRef::PrintDoubleValue( double theValue, int thePrecision )
835 const double prec = 1e-12;
837 if ( qAbs(theValue) < prec )
840 QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( thePrecision ) );
844 while ( p < thePrecision ) {
845 QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( p++ ) );
846 double v = aRes.toDouble();
847 double err = qAbs( theValue - v );
848 if ( err > 0 && err <= prec )
853 // remove trailing zeroes
855 QRegExp expre( QString( "(%1|%2)[+-]?[0-9]+$" ).arg( QLocale().exponential().toLower(),
856 QLocale().exponential().toUpper() ) );
858 int idx = aRes.indexOf( expre );
859 QString aResExp = "";
861 aResExp = aRes.mid( idx );
862 aRes = aRes.left( idx );
865 if ( aRes.contains( QLocale().decimalPoint() ) )
866 aRes.remove( QRegExp( QString( "(\\%1|0)0*$" ).arg( QLocale().decimalPoint() ) ) );
868 return aRes == "-0" ? QString( "0" ) : aRes + aResExp;