1 #include "DrFinestra.h" 3 DrFinestra::DrFinestra(QWidget *parent,
const char *name)
6 QPushButton *esci =
new QPushButton(
"&Esci",
this,
"Esci");
7 esci->setFont( QFont(
"Times",18,QFont::Bold) );
8 connect(esci, SIGNAL(clicked()), qApp,SLOT(quit()) );
11 QCheckBox *linee =
new QCheckBox(
"&Linee",
this,
"linee");
13 connect(linee,SIGNAL(clicked() ),e1,SLOT(DisegnaLinee()) );
15 QCheckBox *punti =
new QCheckBox(
"&Punti",
this,
"punti");
16 connect(punti,SIGNAL(clicked() ),e1,SLOT(DisegnaPunti()) );
18 QPushButton *distr =
new QPushButton(
"&Distr",
this,
"distr");
19 connect(distr, SIGNAL(clicked() ), e1,SLOT(PuntiDistribuzione()) );
21 QSpinBox *Valori =
new QSpinBox(2,1000,20,
this,
"Valori");
22 connect(Valori,SIGNAL(valueChanged(
int)),e1,SLOT(ImpValori(
int)) );
23 connect(e1,SIGNAL(ValoriCambiati(
int)),Valori,SLOT(setValue(
int)) );
25 QCheckBox *griglia =
new QCheckBox(
"&Griglia",
this,
"griglia");
26 connect(griglia,SIGNAL(clicked() ),e1,SLOT(DisegnaGriglia()) );
28 QCheckBox *riscala =
new QCheckBox(
"&Ris",
this,
"riscala");
29 connect(riscala,SIGNAL(clicked() ),e1,SLOT(SeRiscala()) );
31 QCheckBox *risTutto =
new QCheckBox(
"&Tutti",
this,
"risTutto");
32 connect(risTutto,SIGNAL(clicked() ),e1,SLOT(SeRiscalaTutto()) );
34 QCheckBox *nset =
new QCheckBox(
"&Set",
this,
"nset");
35 connect(nset,SIGNAL(clicked() ),e1,SLOT(NSet()) );
37 QPushButton *salva =
new QPushButton(
"&Salva",
this,
"autocor");
38 connect(salva, SIGNAL(clicked() ), e1,SLOT(Salva()) );
41 connect(a1, SIGNAL(PuntaCoord(
double **,
int,
int,
int) ), e1,SLOT(ApriExt(
double**,
int,
int,
int)) );
44 QPushButton *image =
new QPushButton(
"&Image",
this,
"image");
45 connect(image, SIGNAL(clicked() ), a1,SLOT(Open()) );
47 QPushButton *punta =
new QPushButton(
"&Punta",
this,
"Punta");
48 connect(punta, SIGNAL(clicked() ), a1,SLOT(Punta()) );
50 QLineEdit *nomeFile =
new QLineEdit(
this,
"nomeFile");
51 connect(nomeFile,SIGNAL( textChanged(
const QString &)),a1,SLOT( NomeFile(
const QString &)) );
53 QPushButton *filter =
new QPushButton(
"&Filter",
this,
"filter");
54 connect(filter, SIGNAL(clicked() ), a1,SLOT(Filter()) );
56 QPushButton *motion =
new QPushButton(
"&Motion",
this,
"motion");
57 connect(motion, SIGNAL(clicked() ), a1,SLOT(Motion()) );
59 QPushButton *run =
new QPushButton(
"&run",
this,
"run");
60 connect(run, SIGNAL(clicked() ), a1,SLOT(Run()) );
62 QPushButton *filterMC =
new QPushButton(
"&MC",
this,
"MC");
63 connect(filterMC, SIGNAL(clicked() ), a1,SLOT(FilterMC()) );
65 QPushButton *filterCoarseGrain =
new QPushButton(
"&CG",
this,
"CG");
66 connect(filterCoarseGrain, SIGNAL(clicked() ), a1,SLOT(FilterCoarseGrain()) );
67 connect(filterCoarseGrain, SIGNAL(clicked() ), e1,SLOT(repaint()) );
69 QSpinBox *NGrana =
new QSpinBox(0,5,1,
this,
"NGrana");
70 connect(NGrana,SIGNAL(valueChanged(
int)),a1,SLOT(ImpGrana(
int)) );
72 QPushButton *filterIncrease =
new QPushButton(
"&Increase",
this,
"Increase");
73 connect(filterIncrease, SIGNAL(clicked() ), a1,SLOT(FilterIncrease()) );
75 QPushButton *filterContrast =
new QPushButton(
"&Contrast",
this,
"Contrast");
76 connect(filterContrast, SIGNAL(clicked() ), a1,SLOT(FilterContrast()) );
77 connect(filterContrast, SIGNAL(clicked() ), e1,SLOT(repaint()) );
79 QPushButton *blackwhite =
new QPushButton(
"&B/W",
this,
"B/W");
80 connect(blackwhite, SIGNAL(clicked() ), a1,SLOT(BlackWhite()) );
81 connect(blackwhite, SIGNAL(clicked() ), e1,SLOT(repaint()) );
83 QPushButton *binary =
new QPushButton(
"&0/1",
this,
"0/1");
84 connect(binary, SIGNAL(clicked() ), a1,SLOT(Binary()) );
85 connect(binary, SIGNAL(clicked() ), e1,SLOT(repaint()) );
87 QPushButton *histo =
new QPushButton(
"&Histo",
this,
"Histo");
88 connect(histo, SIGNAL(clicked() ), a1,SLOT(Histo()) );
90 QPushButton *nablaphi =
new QPushButton(
"&Phi",
this,
"Phi");
91 connect(nablaphi, SIGNAL(clicked() ), a1,SLOT(NablaPhi()) );
92 connect(nablaphi, SIGNAL(clicked() ), e1,SLOT(repaint()) );
96 QPushButton *forward =
new QPushButton(
"&>",
this,
">");
97 connect(forward, SIGNAL(clicked() ), a1,SLOT(IncrSlide()) );
98 connect(forward, SIGNAL(clicked() ), s1,SLOT(IncrSlide()) );
100 QGridLayout *grid=
new QGridLayout(
this,1,3,10);
102 grid->setColStretch(1,15);
103 grid->setColStretch(0,2);
104 grid->setColStretch(2,1);
105 grid->setRowStretch(1,5);
106 grid->setRowStretch(0,0);
107 grid->setRowStretch(2,2);
108 grid->setRowMinimumHeight(1,200);
109 grid->setRowStretch(2,0);
110 grid->setRowStretch(3,0);
111 QVBoxLayout *PicHisto =
new QVBoxLayout;
112 grid->addLayout(PicHisto,1,1);
113 PicHisto->addWidget(e1);
114 PicHisto->addWidget(a1);
115 a1->setMinimumHeight(height());
117 QHBoxLayout *Disegna =
new QHBoxLayout;
118 QVBoxLayout *DisegnaSx =
new QVBoxLayout;
119 QVBoxLayout *DisegnaDx =
new QVBoxLayout;
121 DisegnaSx->addWidget(linee);
122 DisegnaSx->addSpacing(-10);
123 DisegnaSx->addWidget(punti);
124 DisegnaSx->addSpacing(-10);
125 DisegnaSx->addWidget(griglia);
126 DisegnaSx->addSpacing(-10);
127 DisegnaDx->addWidget(riscala);
128 DisegnaDx->addSpacing(-10);
129 DisegnaDx->addWidget(risTutto);
130 DisegnaDx->addSpacing(-10);
131 DisegnaDx->addWidget(nset);
132 Disegna->addLayout(DisegnaSx);
133 Disegna->addLayout(DisegnaDx);
138 QVBoxLayout *ASinistra =
new QVBoxLayout;
139 grid->addLayout(ASinistra,1,0);
140 ASinistra->addLayout(Disegna);
141 ASinistra->addWidget(distr);
142 ASinistra->addWidget(Valori);
143 ASinistra->addWidget(s1);
144 ASinistra->addWidget(salva);
147 QVBoxLayout *ASinistraGiu =
new QVBoxLayout;
148 grid->addLayout(ASinistraGiu,2,0);
150 QHBoxLayout *InAlto =
new QHBoxLayout;
151 grid->addLayout(InAlto,0,1);
152 InAlto->addWidget(histo);
153 InAlto->addWidget(blackwhite);
154 InAlto->addWidget(binary);
155 InAlto->addWidget(nablaphi);
156 InAlto->addWidget(forward);
157 InAlto->addWidget(punta);
159 QVBoxLayout *InAlto2 =
new QVBoxLayout;
160 grid->addLayout(InAlto2,0,2);
162 QVBoxLayout *ADestra =
new QVBoxLayout;
163 grid->addLayout(ADestra,1,2);
164 ADestra->addWidget(esci);
165 ADestra->addWidget(image);
166 ADestra->addWidget(nomeFile);
167 ADestra->addWidget(filter);
168 ADestra->addWidget(motion);
169 ADestra->addWidget(run);
170 ADestra->addWidget(filterMC);
171 ADestra->addWidget(NGrana);
172 ADestra->addWidget(filterCoarseGrain);
173 ADestra->addWidget(filterIncrease);
174 ADestra->addWidget(filterContrast);
175 ADestra->setSpacing(0);
177 QVBoxLayout *ADestra1 =
new QVBoxLayout;
178 grid->addLayout(ADestra1,2,2);
183 QHBoxLayout *InBasso =
new QHBoxLayout;
184 grid->addLayout(InBasso,2,1);
186 void DrFinestra::DataFile(
char *FileName){
187 a1->NomeFile(FileName);
189 void DrFinestra::ConfFile(
char *FileName){
190 printf(
"Ciccia %s\n",FileName);
192 void DrFinestra::Run(){
195 void DrFinestra::Histo(){
Contains the function to interacts with the data stored in VarDatFile.