Ejemplo n.º 1
0
//-----------------------------------------------------------------------------
void DataDialog::nameChanged()
{
	QString var = name->currentText();
	wchar_t *txt=new wchar_t[var.length()+1];
	var.toWCharArray(txt);	txt[var.length()]=0;
	mglData dat=parser.Calc(txt);	delete []txt;
	x1->setMaximum(dat.nx-1);	x1->setValue(-1);
	x2->setMaximum(dat.nx-1);	x2->setValue(-1);
	y1->setMaximum(dat.ny-1);	y1->setValue(-1);
	y2->setMaximum(dat.ny-1);	y2->setValue(-1);
	z1->setMaximum(dat.nz-1);	z1->setValue(-1);
	z2->setMaximum(dat.nz-1);	z2->setValue(-1);
}
Ejemplo n.º 2
0
//-----------------------------------------------------------------------------
void DataDialog::updateRes()
{
	result = name->currentText();
	int nx1 = x1->value(), nx2 = x2->value(), ny1 = y1->value(), ny2 = y2->value(), nz1 = z1->value(), nz2 = z2->value();
	if(nx1>=0 || ny1>=0 || nz1>=0 || nx2>=0 || ny2>=0 || nz2>=0)
		result += "(" + (nx1<0?"":QString::number(nx1)) + ":" + (nx2<0?"":QString::number(nx2)) + "," +
						(ny1<0?"":QString::number(ny1)) + ":" + (ny2<0?"":QString::number(ny2)) + "," +
						(nz1<0?"":QString::number(nz1)) + ":" + (nz2<0?"":QString::number(nz2)) + ")";
	if(oper->currentIndex()>0)
		result = "{" + oper->currentText() + " " + result + " '" + dirs->currentText() + "'}";
	wchar_t *txt=new wchar_t[result.length()+1];
	result.toWCharArray(txt);	txt[result.length()]=0;
	mglData dat=parser.Calc(txt);	delete []txt;
	sizes->setText(tr("Result (will have sizes ") + QString::number(dat.nx)+"*"+QString::number(dat.ny)+"*"+QString::number(dat.nz)+")"	);
	res->setText(result);
}