Moka Ihm Qt
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
creation-pyramide.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 "creation-pyramide.qt.hh"
25 #include "window.qt.hh"
26 #include "HtmlEntities.hh"
27 #include "SpaceWidget.qt.hh"
28 
29 #include <QtGui/QLabel>
30 
31 /*******************************************************************/
32 /* CLASSE creationPyramide */
33 /*******************************************************************/
35  GMap3d :: CControlerGMap * controler)
36  :
37  CreationObjet(parent , HTML::decode("Create cylinder") ,
38  controler)
39 {
40  FAffSub = new QLabel(" Subdivisions: " , this) ;
41  FAffPar = new QLabel(*HTML::decode("Parallels: ") , this) ;
42 
43  FSaisiePar = new QSpinBox(this) ;
44  FSaisiePar -> setMinimum(1);
45  FSaisiePar -> setMaximum(1000);
46  FSaisiePar -> setAccelerated(true);
47 
48  FAffMer = new QLabel(*HTML::decode("Meridians: ") , this) ;
49 
50  FSaisieMer = new QSpinBox(this) ;
51  FSaisieMer -> setMinimum(3);
52  FSaisieMer -> setMaximum(1000);
53  FSaisieMer -> setAccelerated(true);
54 
55  FAffFaces =
56  new QLabel(*HTML::decode("Faces created: ") , this) ;
57  FBase = new QCheckBox("Basis" , this) ;
58 
59  addWidget(FAffSub);
60  addWidget(FAffPar);
61  addWidget(FSaisiePar);
62  addWidget(new SpaceWidget(SPACE_PIX_SIZE, 1));
63  addWidget(FAffMer);
64  addWidget(FSaisieMer);
65  addWidget(new SpaceWidget(SPACE_PIX_SIZE, 1));
66  addWidget(FAffFaces);
67  addWidget(FBase);
68  addWidget(new SpaceWidget(SPACE_PIX_SIZE, 1));
69 
70  // Creation des boutons
71  FChoix = new BoutonsCreation(this) ;
72 
73  //*** Creation de la boite de positonnement ******
74  FPosit = new BoitePositionnement(this , parent , OBJECT_PYRAMID) ;
75 
76  update() ;
77 
78  QObject::connect(FSaisiePar , SIGNAL(valueChanged(int)) , this,
79  SLOT(callbackParallels())) ;
80  QObject::connect(FSaisieMer , SIGNAL(valueChanged(int)) , this,
81  SLOT(callbackMeridians())) ;
82  QObject::connect(FBase , SIGNAL(stateChanged(int)) , this ,
83  SLOT(callbackCheckedButton())) ;
84 }
85 
87 {
88 }
89 
91 {
93 
94  FSaisieMer ->setValue(FControler->getParameterCreation()
95  ->getPyramidNbMeridians());
96  FSaisiePar->setValue(FControler->getParameterCreation()
97  ->getPyramidNbParallels());
98  FBase -> setChecked(FControler->getParameterCreation()->getPyramidClosed());
99 }
100 
101 // Accesseurs en lecture
102 //----------------------
104 {
105  return FSaisieMer -> value();
106 }
107 
109 {
110  return FSaisiePar -> value();
111 }
112 
114 {
115  return FBase -> isChecked();
116 }
117 
118 // Accesseurs a la modification
119 //------------------------------
121 {
122  FSaisieMer -> setValue(m) ;
123  FControler -> getParameterCreation() -> setPyramidNbMeridians(m) ;
124  repaint() ;
125 }
126 
128 {
129  FSaisiePar -> setValue(p) ;
130  FControler -> getParameterCreation() -> setPyramidNbParallels(p) ;
131  repaint() ;
132 }
133 
135 {
136  FBase-> setChecked(b) ;
137  FControler -> getParameterCreation() -> setPyramidClosed(b) ;
138  repaint() ;
139 }
140 
141 // Slots
142 void CreationPyramide :: callbackMeridians()
143 {
145 }
146 
147 void CreationPyramide::callbackParallels()
148 {
150 }
151 
152 void CreationPyramide::callbackCheckedButton()
153 {
155 }