Allink
v0.1
|
00001 #include "DrFinestra.h" 00002 00003 DrFinestra::DrFinestra(QWidget *parent,const char *name) 00004 :QWidget(parent,name){ 00005 // esci 00006 QPushButton *esci = new QPushButton("&Esci",this,"Esci"); 00007 esci->setFont( QFont("Times",18,QFont::Bold) ); 00008 connect(esci, SIGNAL(clicked()), qApp,SLOT(quit()) ); 00009 e1 = new ElementiGrafici(this); 00010 // disegna linee 00011 QCheckBox *linee = new QCheckBox("&Linee",this,"linee"); 00012 linee->toggle(); 00013 connect(linee,SIGNAL(clicked() ),e1,SLOT(DisegnaLinee()) ); 00014 // disegna punti 00015 QCheckBox *punti = new QCheckBox("&Punti",this,"punti"); 00016 connect(punti,SIGNAL(clicked() ),e1,SLOT(DisegnaPunti()) ); 00017 // distr 00018 QPushButton *distr = new QPushButton("&Distr",this,"distr"); 00019 connect(distr, SIGNAL(clicked() ), e1,SLOT(PuntiDistribuzione()) ); 00020 // Valori 00021 QSpinBox *Valori = new QSpinBox(2,1000,20,this,"Valori"); 00022 connect(Valori,SIGNAL(valueChanged(int)),e1,SLOT(ImpValori(int)) ); 00023 connect(e1,SIGNAL(ValoriCambiati(int)),Valori,SLOT(setValue(int)) ); 00024 // disegna griglia 00025 QCheckBox *griglia = new QCheckBox("&Griglia",this,"griglia"); 00026 connect(griglia,SIGNAL(clicked() ),e1,SLOT(DisegnaGriglia()) ); 00027 // seRiscala 00028 QCheckBox *riscala = new QCheckBox("&Ris",this,"riscala"); 00029 connect(riscala,SIGNAL(clicked() ),e1,SLOT(SeRiscala()) ); 00030 // seRisTutto 00031 QCheckBox *risTutto = new QCheckBox("&Tutti",this,"risTutto"); 00032 connect(risTutto,SIGNAL(clicked() ),e1,SLOT(SeRiscalaTutto()) ); 00033 // seSet 00034 QCheckBox *nset = new QCheckBox("&Set",this,"nset"); 00035 connect(nset,SIGNAL(clicked() ),e1,SLOT(NSet()) ); 00036 // salva 00037 QPushButton *salva = new QPushButton("&Salva",this,"autocor"); 00038 connect(salva, SIGNAL(clicked() ), e1,SLOT(Salva()) ); 00039 // Animazione 00040 a1 = new Animation(this); 00041 connect(a1, SIGNAL(PuntaCoord(double **,int,int,int) ), e1,SLOT(ApriExt(double**,int,int,int)) ); 00042 //connect(a1, SIGNAL( PuntaCoord(Variabili *v1) ), e1,SLOT(ApriExt(Variabili *v1)) ); 00043 // image 00044 QPushButton *image = new QPushButton("&Image",this,"image"); 00045 connect(image, SIGNAL(clicked() ), a1,SLOT(Open()) ); 00046 // punta 00047 QPushButton *punta = new QPushButton("&Punta",this,"Punta"); 00048 connect(punta, SIGNAL(clicked() ), a1,SLOT(Punta()) ); 00049 // nomeFile 00050 QLineEdit *nomeFile = new QLineEdit(this,"nomeFile"); 00051 connect(nomeFile,SIGNAL( textChanged(const QString &)),a1,SLOT( NomeFile(const QString &)) ); 00052 // filter 00053 QPushButton *filter = new QPushButton("&Filter",this,"filter"); 00054 connect(filter, SIGNAL(clicked() ), a1,SLOT(Filter()) ); 00055 // motion 00056 QPushButton *motion = new QPushButton("&Motion",this,"motion"); 00057 connect(motion, SIGNAL(clicked() ), a1,SLOT(Motion()) ); 00058 // run 00059 QPushButton *run = new QPushButton("&run",this,"run"); 00060 connect(run, SIGNAL(clicked() ), a1,SLOT(Run()) ); 00061 // filterMC 00062 QPushButton *filterMC = new QPushButton("&MC",this,"MC"); 00063 connect(filterMC, SIGNAL(clicked() ), a1,SLOT(FilterMC()) ); 00064 // filterCoarseGrain 00065 QPushButton *filterCoarseGrain = new QPushButton("&CG",this,"CG"); 00066 connect(filterCoarseGrain, SIGNAL(clicked() ), a1,SLOT(FilterCoarseGrain()) ); 00067 connect(filterCoarseGrain, SIGNAL(clicked() ), e1,SLOT(repaint()) ); 00068 // NGrana 00069 QSpinBox *NGrana = new QSpinBox(0,5,1,this,"NGrana"); 00070 connect(NGrana,SIGNAL(valueChanged(int)),a1,SLOT(ImpGrana(int)) ); 00071 // filterIncrease 00072 QPushButton *filterIncrease = new QPushButton("&Increase",this,"Increase"); 00073 connect(filterIncrease, SIGNAL(clicked() ), a1,SLOT(FilterIncrease()) ); 00074 // filterContrast 00075 QPushButton *filterContrast = new QPushButton("&Contrast",this,"Contrast"); 00076 connect(filterContrast, SIGNAL(clicked() ), a1,SLOT(FilterContrast()) ); 00077 connect(filterContrast, SIGNAL(clicked() ), e1,SLOT(repaint()) ); 00078 // BW 00079 QPushButton *blackwhite = new QPushButton("&B/W",this,"B/W"); 00080 connect(blackwhite, SIGNAL(clicked() ), a1,SLOT(BlackWhite()) ); 00081 connect(blackwhite, SIGNAL(clicked() ), e1,SLOT(repaint()) ); 00082 // binary 00083 QPushButton *binary = new QPushButton("&0/1",this,"0/1"); 00084 connect(binary, SIGNAL(clicked() ), a1,SLOT(Binary()) ); 00085 connect(binary, SIGNAL(clicked() ), e1,SLOT(repaint()) ); 00086 // Histo 00087 QPushButton *histo = new QPushButton("&Histo",this,"Histo"); 00088 connect(histo, SIGNAL(clicked() ), a1,SLOT(Histo()) ); 00089 // NablaPhi 00090 QPushButton *nablaphi = new QPushButton("&Phi",this,"Phi"); 00091 connect(nablaphi, SIGNAL(clicked() ), a1,SLOT(NablaPhi()) ); 00092 connect(nablaphi, SIGNAL(clicked() ), e1,SLOT(repaint()) ); 00093 // Script 00094 s1 = new DrScript(); 00095 // > 00096 QPushButton *forward = new QPushButton("&>",this,">"); 00097 connect(forward, SIGNAL(clicked() ), a1,SLOT(IncrSlide()) ); 00098 connect(forward, SIGNAL(clicked() ), s1,SLOT(IncrSlide()) ); 00099 // Scena 00100 QGridLayout *grid= new QGridLayout(this,1,3,10); 00101 //grid->addWidget(a1,1,1); 00102 grid->setColStretch(1,15); 00103 grid->setColStretch(0,2); 00104 grid->setColStretch(2,1); 00105 grid->setRowStretch(1,5); 00106 grid->setRowStretch(0,0); 00107 grid->setRowStretch(2,2); 00108 grid->setRowMinimumHeight(1,200); 00109 grid->setRowStretch(2,0); 00110 grid->setRowStretch(3,0); 00111 QVBoxLayout *PicHisto = new QVBoxLayout; 00112 grid->addLayout(PicHisto,1,1); 00113 PicHisto->addWidget(e1); 00114 PicHisto->addWidget(a1); 00115 a1->setMinimumHeight(height()); 00116 00117 QHBoxLayout *Disegna = new QHBoxLayout; 00118 QVBoxLayout *DisegnaSx = new QVBoxLayout; 00119 QVBoxLayout *DisegnaDx = new QVBoxLayout; 00120 // Disegna->addWidget(cosaDisegna); 00121 DisegnaSx->addWidget(linee); 00122 DisegnaSx->addSpacing(-10); 00123 DisegnaSx->addWidget(punti); 00124 DisegnaSx->addSpacing(-10); 00125 DisegnaSx->addWidget(griglia); 00126 DisegnaSx->addSpacing(-10); 00127 DisegnaDx->addWidget(riscala); 00128 DisegnaDx->addSpacing(-10); 00129 DisegnaDx->addWidget(risTutto); 00130 DisegnaDx->addSpacing(-10); 00131 DisegnaDx->addWidget(nset); 00132 Disegna->addLayout(DisegnaSx); 00133 Disegna->addLayout(DisegnaDx); 00134 00135 //QHBoxLayout *Coordinate = new QHBoxLayout; 00136 00137 00138 QVBoxLayout *ASinistra = new QVBoxLayout; 00139 grid->addLayout(ASinistra,1,0); 00140 ASinistra->addLayout(Disegna); 00141 ASinistra->addWidget(distr); 00142 ASinistra->addWidget(Valori); 00143 ASinistra->addWidget(s1); 00144 ASinistra->addWidget(salva); 00145 //grid->addWidget(s1,2,0); 00146 00147 QVBoxLayout *ASinistraGiu = new QVBoxLayout; 00148 grid->addLayout(ASinistraGiu,2,0); 00149 00150 QHBoxLayout *InAlto = new QHBoxLayout; 00151 grid->addLayout(InAlto,0,1); 00152 InAlto->addWidget(histo); 00153 InAlto->addWidget(blackwhite); 00154 InAlto->addWidget(binary); 00155 InAlto->addWidget(nablaphi); 00156 InAlto->addWidget(forward); 00157 InAlto->addWidget(punta); 00158 00159 QVBoxLayout *InAlto2 = new QVBoxLayout; 00160 grid->addLayout(InAlto2,0,2); 00161 00162 QVBoxLayout *ADestra = new QVBoxLayout; 00163 grid->addLayout(ADestra,1,2); 00164 ADestra->addWidget(esci); 00165 ADestra->addWidget(image); 00166 ADestra->addWidget(nomeFile); 00167 ADestra->addWidget(filter); 00168 ADestra->addWidget(motion); 00169 ADestra->addWidget(run); 00170 ADestra->addWidget(filterMC); 00171 ADestra->addWidget(NGrana); 00172 ADestra->addWidget(filterCoarseGrain); 00173 ADestra->addWidget(filterIncrease); 00174 ADestra->addWidget(filterContrast); 00175 ADestra->setSpacing(0); 00176 00177 QVBoxLayout *ADestra1 = new QVBoxLayout; 00178 grid->addLayout(ADestra1,2,2); 00179 00180 // QHBoxLayout *MenoInAlto = new QHBoxLayout; 00181 // grid->addLayout(MenoInAlto,2,1); 00182 00183 QHBoxLayout *InBasso = new QHBoxLayout; 00184 grid->addLayout(InBasso,2,1); 00185 } 00186 void DrFinestra::DataFile(char *FileName){ 00187 a1->NomeFile(FileName); 00188 } 00189 void DrFinestra::ConfFile(char *FileName){ 00190 printf("Ciccia %s\n",FileName); 00191 } 00192 void DrFinestra::Run(){ 00193 a1->Run(); 00194 } 00195 void DrFinestra::Histo(){ 00196 //a1->Histo(); 00197 //e1->ApriExt(a1->st,256,NLevel,100); 00198 }