00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "creation-cylindre.qt.hh"
00025 #include "window.qt.hh"
00026 #include "HtmlEntities.hh"
00027 #include "SpaceWidget.qt.hh"
00028
00029 #include <QtGui/QLabel>
00030
00031
00032
00033
00034
00035
00036
00037
00038 CreationCylindre :: CreationCylindre(Window * parent ,
00039 GMap3d :: CControlerGMap * controler) :
00040 CreationObjet(parent , HTML::decode("Création cylindre") ,
00041 controler)
00042 {
00043
00044 FAffSub = new QLabel(" Subdivisions : " , this) ;
00045 FAffPar = new QLabel(*HTML::decode("Parallèles : ") , this) ;
00046
00047 FSaisiePar = new QSpinBox(this) ;
00048 FSaisiePar -> setMinimum(1);
00049 FSaisiePar -> setMaximum(1000);
00050 FSaisiePar -> setAccelerated(true);
00051
00052 FAffMer = new QLabel(*HTML::decode("Méridiens : ") , this) ;
00053 FSaisieMer = new QSpinBox(this) ;
00054 FSaisieMer -> setMinimum(3);
00055 FSaisieMer -> setMaximum(1000);
00056 FSaisieMer -> setAccelerated(true);
00057
00058 FAffFaces = new QLabel(*HTML::decode("Faces créées : ") ,
00059 this) ;
00060 FFace1 = new QCheckBox("Face 1" , this) ;
00061 FFace2 = new QCheckBox("Face 2" , this) ;
00062
00063 addWidget(FAffSub);
00064 addWidget(FAffPar);
00065 addWidget(FSaisiePar);
00066 addWidget(new SpaceWidget(SPACE_PIX_SIZE, 1));
00067 addWidget(FAffMer);
00068 addWidget(FSaisieMer);
00069 addWidget(new SpaceWidget(SPACE_PIX_SIZE, 1));
00070 addWidget(FAffFaces);
00071 addWidget(FFace1);
00072 addWidget(FFace2);
00073 addWidget(new SpaceWidget(SPACE_PIX_SIZE, 1));
00074
00075
00076 FChoix = new BoutonsCreation(this) ;
00077
00078
00079 FPosit = new BoitePositionnement(this , parent , OBJECT_CYLINDER) ;
00080
00081 update() ;
00082 repaint() ;
00083
00084
00085 QObject::connect(FSaisiePar , SIGNAL(valueChanged(int)) , this,
00086 SLOT(callbackParallels())) ;
00087 QObject::connect(FSaisieMer , SIGNAL(valueChanged(int)) , this,
00088 SLOT(callbackMeridians())) ;
00089 QObject::connect(FFace1 , SIGNAL(clicked()) , this ,
00090 SLOT(callbackCheckedButton1())) ;
00091 QObject::connect(FFace2 , SIGNAL(clicked()) , this ,
00092 SLOT(callbackCheckedButton2())) ;
00093 }
00094
00095
00096
00097 CreationCylindre :: ~CreationCylindre() {}
00098
00099
00100
00101 void CreationCylindre :: update()
00102 {
00103 CreationObjet :: update() ;
00104
00105 FSaisieMer -> setValue(FControler -> getParameterCreation()
00106 -> getCylinderNbMeridians());
00107 FSaisiePar -> setValue(FControler->getParameterCreation()
00108 ->getCylinderNbParallels());
00109
00110 FFace1 -> setChecked(FControler->getParameterCreation()
00111 ->getCylinderClosedUp());
00112 FFace2 -> setChecked(FControler->getParameterCreation()
00113 ->getCylinderClosedDown());
00114 }
00115
00116
00117
00118 void CreationCylindre :: setMeridians(int m)
00119 {
00120 FControler ->getParameterCreation()->setCylinderNbMeridians(m);
00121 update();
00122 repaint() ;
00123 }
00124
00125 void CreationCylindre :: setParallels(int p)
00126 {
00127 FControler ->getParameterCreation()->setCylinderNbParallels(p);
00128 update();
00129 repaint() ;
00130 }
00131
00132 void CreationCylindre :: setClosedBorder1(bool b)
00133 {
00134 FControler->getParameterCreation()->setCylinderClosedUp(b);
00135 update() ;
00136 repaint() ;
00137 }
00138
00139 void CreationCylindre :: setClosedBorder2(bool b)
00140 {
00141 FControler->getParameterCreation()->setCylinderClosedDown(b);
00142 update() ;
00143 repaint() ;
00144
00145 }
00146
00147
00148
00149 void CreationCylindre :: callbackMeridians()
00150 {
00151 setMeridians(FSaisieMer -> value());
00152 }
00153
00154 void CreationCylindre :: callbackParallels()
00155 {
00156 setParallels(FSaisiePar->value());
00157 }
00158
00159 void CreationCylindre :: callbackCheckedButton1()
00160 {
00161 setClosedBorder1(FFace1->isChecked());
00162 }
00163
00164 void CreationCylindre :: callbackCheckedButton2()
00165 {
00166 setClosedBorder2(FFace2->isChecked());
00167 }