Moka Ihm Qt
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
options-divers.qt.cc
Go to the documentation of this file.
1 /*
2  * Moka : Un modeleur de 3-G-cartes.
3  * Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS,
6  * guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/
7  *
8  * This file is part of Moka
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #include "options-extrusion.qt.hh"
25 #include "window.qt.hh"
26 #include "HtmlEntities.hh"
27 
28 #include <QtGui/QVBoxLayout>
29 #include <QtGui/QLabel>
30 
31 // Constructeur
32 //-------------
33 OptionsDivers :: OptionsDivers ( Window * parent , QTabWidget * parentTab )
34  :
35  QWidget ( parentTab ) ,
36  FParent ( parent ) ,
37  FUpdate ( false )
38 {
39 
40  QVBoxLayout * glo_hbl = new QVBoxLayout(this) ;
41 
42  QGroupBox * gb_dep =
43  new QGroupBox(*HTML::decode("Camera moves"));
44  QVBoxLayout * dep_vbl = new QVBoxLayout(gb_dep);
45 
46 
47  QWidget * wid_rotation = new QWidget;
48  QHBoxLayout * rot_hbl = new QHBoxLayout(wid_rotation) ;
49 
50  saisie_angle = new FloatSpinBox (5,0,360,2,4) ;
51  saisie_angle -> setWrapping ( true ) ;
52 
53  rot_hbl -> addWidget (new QLabel ("Rotation angle: "), 0, Qt::AlignLeft);
54  rot_hbl -> addWidget (saisie_angle, 1, Qt::AlignLeft);
55 
56 
57  QWidget * wid_pas = new QWidget;
58  QHBoxLayout * pas_hbl = new QHBoxLayout(wid_pas) ;
59 
60  saisie_pas = new FloatSpinBox (1,0,200,2,4) ;
61 
62  pas_hbl -> addWidget (new QLabel ("Step: "), 0, Qt::AlignLeft);
63  pas_hbl -> addWidget (saisie_pas, 1, Qt::AlignLeft);
64 
65 
66  dep_vbl -> addWidget(wid_rotation);
67  dep_vbl -> addWidget(wid_pas);
68 
69  glo_hbl -> addWidget(gb_dep);
70  glo_hbl -> addStretch(2);
71 
72 
73  connect(saisie_angle, SIGNAL(valueChanged(double)),
74  this, SLOT(callbackChangeAngle(double)));
75 
76  connect(saisie_pas, SIGNAL(valueChanged(double)),
77  this, SLOT(callbackChangePas(double)));
78 }
79 
80 
81 // Destructeur
82 //------------
84 {
85 }
86 
87 // Mise a jour de l'affichage
88 //---------------------------
90 {
91  FUpdate = true ;
92 
93  CParameterEyePosition * eye = FParent -> getParameterEyePosition();
94  saisie_angle -> setValuef(eye -> getAngleRotation());
95  saisie_pas -> setValuef(eye -> getPasAvancement());
96 
97  FUpdate = false ;
98 }
99 
100 
102 {
103  if (!FUpdate)
104  FParent -> getParameterEyePosition() -> setAngleRotation(val);
105 }
106 
107 
109 {
110  if (!FUpdate)
111  FParent -> getParameterEyePosition() -> setPasAvancement(val);
112 }